kp.html 2.79 KB
<!--
/**
 * This file is part of the Klarna KP module
 *
 * (c) Klarna Bank AB (publ)
 *
 * For the full copyright and license information, please view the NOTICE
 * and LICENSE files that were distributed with this source code.
 */
-->
<div class="payment-method" data-bind="visible: isVisible, css: {'_active': (getCode() == isChecked())}">
    <div class="payment-method-title field choice">
        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
        <label data-bind="attr: {'for': getCode()}" class="label">
            <span>
                <div style="float:right"><img width="55" data-bind="attr: {'src': getLogoUrl()}"></div><span data-bind="html: getTitle()"></span>
            </span>
        </label>
    </div>
    <div class="payment-method-content">
        <!-- ko foreach: getRegion('messages') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
        <div class="payment-method-billing-address">
            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
        <div>
            <div data-bind="text: getMessage(), visible: hasMessage()"></div>
            <div data-bind="attr: {'id': getContainerId()}, afterRender: checkPreSelect()"></div>
            <fieldset class="fieldset items klarna_kp" data-bind="attr: {'id': 'payment_form_' + getCode()}"
                      style="display: none">
                <input type="hidden"
                       name="payment[authorization_token]"
                       data-bind="attr: {'id': 'authorization_token_' + getCode()}, value: getAuthorizationToken()"
                />
            </fieldset>
        </div>
        <div class="checkout-agreements-block">
            <!-- ko foreach: $parent.getRegion('before-place-order') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>

        <div class="actions-toolbar">
            <div class="primary">
                <button data-role="review-save"
                        type="submit"
                        data-bind="
                        attr: {title: $t('Place Order')},
                        enable: (getCode() == isChecked() && isPlaceOrderActionAllowed() && showButton()),
                        click: authorize,
                        css: {disabled: !isPlaceOrderActionAllowed()}"
                        class="action primary checkout"
                        disabled>
                    <span data-bind="i18n: 'Place Order'"></span>
                </button>
            </div>
        </div>
    </div>
</div>