We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

oneclick-form.html 12.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<!--
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * 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>
 */
-->



27
<!-- ko foreach: getAdyenBillingAgreements() -->
28
<div class="payment-method" data-bind="css: {'_active': (value == $parent.isBillingAgreementChecked())}">
29 30


31 32 33 34 35
    <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"/>
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
        <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>
52 53 54
    </div>
    <div class="payment-method-content">

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

59
        <div class="payment-method-billing-address">
Rik ter Beek's avatar
Rik ter Beek committed
60
            <!-- ko foreach: $parents[1].getRegion($parent.getBillingAddressFormName()) -->
61 62 63 64
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>

65 66


67 68 69 70 71 72 73 74 75 76 77
        <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}">

78
                <!-- ko if: agreement_data.card -->
79 80 81 82 83 84

                <div class="field number">
                    <label class="label">
                        <span><!-- ko text: $t('Credit Card Number')--><!-- /ko --></span>
                    </label>
                    <div class="control">
85
                        <span data-bind="text: '**** **** **** ' + agreement_data.card.number"></span>
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
                    </div>
                </div>


                <div class="field number expire-update" data-bind="css: {'_disable': (true == expiry())}">
                    <label class="label">
                        <span><!-- ko text: $t('Expiration Date')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <span data-bind="text: agreement_data.card.expiryMonth + '/' + agreement_data.card.expiryYear"></span>
                        <a class="" data-bind="click: selectExpiry"
                                ><!-- ko text: $t('Update') --><!-- /ko --></a>
                    </div>
                </div>

                <div class="field date required changable-card-expiry" data-bind="attr: {id: getCode() + '_' + value + '_cc_type_exp_div'}, css: {'_active': (true == expiry())}">
                    <label data-bind="attr: {for: getCode() + '_' + value + '_expiration'}" class="label">
                        <span><!-- ko text: $t('Expiration Date')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <div class="fields group group-2">
                            <div class="field no-label month">
                                <div class="control">
                                    <select  class="select select-month"
                                             data-encrypted-name="expiryMonth"
                                             data-bind="attr: {id: getCode() + '_' + value + '_expiration', 'data-container': getCode() + '-' + value + '-cc-month', 'data-validate': JSON.stringify({required:true, 'validate-cc-exp':'#' + getCode() + '_expiration_yr'})},
                                                enable: $parent.isActive($parents),
                                                options: $parent.getCcMonthsValues(),
                                                optionsValue: 'value',
                                                optionsText: 'month',
                                                optionsCaption: $t('Month'),
                                                value: creditCardExpMonth"
                                             data-validate="{required:true}">
                                    </select>
                                </div>
                            </div>
                            <div class="field no-label year">
                                <div class="control">
                                    <select class="select select-year"
                                            data-encrypted-name="expiryYear"
                                            data-bind="attr: {id: getCode() + '_' + value + '_expiration_yr', 'data-container': getCode() + '-' + value + '-cc-year', 'data-validate': JSON.stringify({required:true})},
                                               enable: $parent.isActive($parents),
                                               options: $parent.getCcYearsValues(),
                                               optionsValue: 'value',
                                               optionsText: 'year',
                                               optionsCaption: $t('Year'),
                                               value: creditCardExpYear"
                                            data-validate="{required:true}">
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


Aleffio's avatar
Aleffio committed
142
                <!-- ko if: hasVerification()-->
143 144 145 146 147 148 149 150 151 152 153 154 155
                <div class="field cvv required" data-bind="attr: {id: getCode() + '_' + value + '_cc_type_cvv_div'}">
                    <label data-bind="attr: {for: getCode() + '_' + value + '_cc_cid'}" class="label">
                        <span><!-- ko text: $t('Card Verification Number')--><!-- /ko --></span>
                    </label>
                    <div class="control _with-tooltip">
                        <input type="number"
                               autocomplete="off"
                               class="input-text cvv"
                               data-encrypted-name="cvc"
                               value=""
                               data-bind="attr: {id: getCode() + '_' + value + '_cc_cid',
                                title: $t('Card Verification Number'),
                                'data-container': getCode() + '-' + value + '-cc-cvv',
156
                                'data-validate': JSON.stringify({'required-number':true})},
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
                                enable: $parent.isActive($parents),
                                value: creditCardVerificationNumber"
                               data-validate="{required:true}"/>
                        <div class="field-tooltip toggle">
                        <span class="field-tooltip-action action-cvv"
                              tabindex="0"
                              data-toggle="dropdown"
                              data-bind="attr: {title: $t('What is this?')}, mageInit: {'dropdown':{'activeClass': '_active'}}">
                            <span><!-- ko text: $t('What is this?')--><!-- /ko --></span>
                        </span>
                            <div class="field-tooltip-content"
                                 data-target="dropdown"
                                 data-bind="html: $parent.getCvvImageHtml()"></div>
                        </div>
                    </div>
                </div>
                <!-- /ko -->
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
                <!--/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-->

Alessio Zampatti's avatar
Alessio Zampatti committed
207
                <!-- ko if: number_of_installments.length > 0 -->
208 209 210 211 212 213 214 215

                <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]"
Alessio Zampatti's avatar
Alessio Zampatti committed
216
                                 data-bind="attr: {id: getCode() + '_installments', 'data-container': getCode() + '-installments', 'data-validate': JSON.stringify({required:false})},
217 218 219 220
                                        enable: $parent.isActive($parents),
                                        options: getInstallments,
                                        optionsValue: 'value',
                                        optionsText: 'key',
Alessio Zampatti's avatar
Alessio Zampatti committed
221
                                        optionsCaption: $t('Do not use Installments'),
222 223 224 225 226 227 228 229 230
                                        value: installment"
                                 data-validate="{required:true}">
                        </select>
                    </div>
                </div>


                <!-- /ko -->

231

232 233 234 235 236 237 238 239 240 241 242
            </fieldset>
            <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="
243
                                click: placeOrder,
244 245 246 247 248 249 250 251 252 253 254 255 256
                                attr: {title: $t('Place Order')},
                                enable: (value == $parent.isBillingAgreementChecked())
                                "
                            disabled>
                        <span data-bind="text: $t('Place Order')"></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>

<!--/ko-->