We will be off on April 7th (Monday) for public holiday in our country

oneclick-form.html 7 KB
<!--
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * Adyen Payment module (https://www.adyen.com/)
 *
 * Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
 * See LICENSE.txt for license details.
 *
 * Author: Adyen <magento@adyen.com>
 */
-->
<!-- ko foreach: getAdyenBillingAgreements() -->
<div class="payment-method" data-bind="css: {'_active': (value == $parent.isBillingAgreementChecked())}">
    <div class="payment-method-title field choice">
        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': value}, value: value, checked: $parent.isBillingAgreementChecked, click: $parent.selectBillingAgreement"/>
        <label data-bind="attr: {'for': value}" class="label">

            <!-- ko if: logo -->
            <img data-bind="attr: {
                                'class': getCode(),
                                'src': logo.url,
                                'width': logo.width,
                                'height': logo.height
                                }">

            <!--/ko-->

            <span data-bind="text: label"></span>
        </label>
    </div>
    <div class="payment-method-content">

        <!-- ko ifnot: (getOriginKey()) -->
        <span class="message message-error error"><!-- ko text: $t('Please configure an API Key and a live endpoint prefix(if in Production Mode) in your Adyen Required Settings')--><!-- /ko --></span>
        <!--/ko-->

        <!-- ko foreach: $parent.getRegion(getMessageName()) -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->

        <div class="payment-method-billing-address">
            <!-- ko foreach: $parents[1].getRegion($parent.getBillingAddressFormName()) -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>

        <form class="form" action="#" method="post" data-bind="
            attr: {'id': 'adyen_oneclick_' + value, 'data-role': 'adyen_oneclick_' + value },
            mageInit: {
                'transparent':{
                    'context': $parent.context(),
                    'controller': $parent.getControllerName(),
                    'orderSaveUrl':$parent.getPlaceOrderUrl(),
                }, 'validation':[]}">

            <fieldset
                    data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'payment_form_' + $parent.getCode() + '_' + value}">

                <!-- ko if: agreement_data.card -->
                <div class="field number">
                    <label class="label">
                        <span><!-- ko text: $t('Credit Card Number')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <span data-bind="text: '**** **** **** ' + agreement_data.card.number"></span>
                    </div>
                </div>

                <div afterRender="renderSecureCVC()" data-bind="attr: { id: 'cvcContainer-' + value}"></div>
                <!--/ko-->

                <!-- ko if: agreement_data.bank -->
                <div class="field number">
                    <label class="label">
                        <span><!-- ko text: $t('Bank account holder name')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <span data-bind="text: agreement_data.bank.ownerName"></span>
                    </div>
                </div>

                <div class="field number">
                    <label class="label">
                        <span><!-- ko text: $t('Iban')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <span data-bind="text: agreement_data.bank.iban"></span>
                    </div>
                </div>

                <div class="field number">
                    <label class="label">
                        <span><!-- ko text: $t('Country')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <span data-bind="text: agreement_data.bank.countryCode"></span>
                    </div>
                </div>
                <!--/ko-->

                <!-- ko if: number_of_installments.length > 0 -->
                <div class="field required"
                     data-bind="attr: {id: getCode() + '_installments_div'}, visible: getInstallments().length > 0">
                    <label data-bind="attr: {for: getCode() + '_installments'}" class="label">
                        <span><!-- ko text: $t('Installments')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <select class="select"
                                name="payment[number_of_installments]"
                                data-bind="attr: {id: getCode() + '_installments', 'data-container': getCode() + '-installments', 'data-validate': JSON.stringify({required:false})},
                                        enable: $parent.isActive($parents),
                                        options: getInstallments,
                                        optionsValue: 'value',
                                        optionsText: 'key',
                                        optionsCaption: $t('Do not use Installments'),
                                        value: installment"
                                data-validate="{required:true}">
                        </select>
                    </div>
                </div>
                <!-- /ko -->
            </fieldset>
        </form>
        <div class="checkout-agreements-block">
            <!-- ko foreach: $parents[1].getRegion('before-place-order') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
        <div class="actions-toolbar">
            <div class="primary">
                <button class="action primary checkout"
                        type="submit"
                        data-bind="
                                click: placeOrder,
                                attr: {title: $t('Place Order')},
                                enable: isButtonActive()"
                        disabled>
                    <span data-bind="text: $t('Place Order')"></span>
                </button>
            </div>
        </div>
    </div>
</div>
<!--/ko-->