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

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

<!-- ko ifnot: (isPaymentMethodSelectionOnAdyen())-->
    <!-- ko foreach: getAdyenHppPaymentMethods() -->
        <div class="payment-method" data-bind="css: {'_active': (value == $parent.isBrandCodeChecked())}">
            <div class="payment-method-title field choice">
29

30 31 32 33
                <input type="radio"
                       name="payment[method]"
                       class="radio"
                       data-bind="attr: {'id': value}, value: value, checked: $parent.isBrandCodeChecked, click: $parent.selectPaymentMethodBrandCode"/>
34 35 36 37 38 39 40 41 42 43 44 45
                <label data-bind="attr: {'for': value}" class="label">

                    <!-- ko if: name.icon -->
                    <img data-bind="attr: {
                                'src': name.icon.url,
                                'width': name.icon.url.width,
                                'height': name.icon.url.height
                                }">
                    <!--/ko-->

                    <span data-bind="text: name.title"></span>
                </label>
46 47 48 49 50 51 52 53 54
            </div>
            <div class="payment-method-content">

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

55 56
                <form class="form" data-role="adyen-hpp-form" action="#" method="post" data-bind="mageInit: { 'validation':[]}, attr: {id: 'payment_form_' + $parent.getCode() + '_' + value}">
                <fieldset class="fieldset" data-bind='attr: {id: "payment_fieldset_" + $parent.getCode() + "_" + value}'>
57 58 59 60
                     <!-- ko if: value == 'ideal' -->
                        <label data-bind="attr: {'for': 'issuerId'}" class="label">
                            <span><!-- ko text: $t('Select Your Bank') --><!-- /ko --></span>
                        </label>
61 62 63 64 65 66 67 68

                        <select name="payment[issuer_id]" data-bind="
                                options: name.issuers,
                                optionsText: 'name',
                                optionsValue: 'issuerId',
                                value: issuerId,
                                optionsCaption: $t('Choose Your Bank')">
                        </select>
69
                    <!--/ko-->
70

71
                    <!-- ko if: isPaymentMethodOpenInvoiceMethod() -->
72
                        <!-- ko if: showGender() -->
73
                            <div class="field gender required">
74
                                    <label data-bind="attr: {for: getCode() + '_gender_type_' + value}" class="label">
75 76 77 78 79
                                        <span><!-- ko text: $t('Gender')--><!-- /ko --></span>
                                    </label>
                                    <div class="control">
                                        <select class="select select-gender-type"
                                                name="payment[gender]"
80
                                                data-bind="attr: {id: getCode() + '_gender_type_' + value, 'data-container': getCode() + '-gender-type'},
81 82 83 84 85 86 87 88 89
                                                    options: $parent.getGenderTypes(),
                                                    optionsValue: 'key',
                                                    optionsText: 'value',
                                                    optionsCaption: $t('-Please select-'),
                                                    value: gender"
                                                data-validate="{required:true}">
                                        </select>
                                    </div>
                            </div>
90 91
                        <!--/ko-->

92
                        <!-- ko if: showDob() -->
93
                            <div class="field dob type required">
94
                                <label data-bind="attr: {for: getCode() + '_dob_' + value}" class="label">
95 96 97 98 99
                                    <span><!-- ko text: $t('Date of Birth')--><!-- /ko --></span>
                                </label>
                                <div class="control">
                                    <input type="text" class="input-text"
                                           name="payment[dob]"
Rik ter Beek's avatar
Rik ter Beek committed
100 101 102 103 104 105 106 107 108 109 110
                                           data-bind="
                                           attr: {
                                                 id: getCode() + '_dob_' + value,
                                                 title: $t('Date of Birth'),
                                                 'data-container': getCode() + '-dob_'  + value,
                                           },
                                            datepicker: {
                                                storage: datepickerValue,
                                                options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' }
                                           },
                                           value: dob"
111
                                           data-validate="{required:true}"
112 113 114 115
                                    />
                                </div>
                            </div>
                        <!--/ko-->
116

117
                        <!-- ko if: showTelephone() -->
118
                            <div class="field telephone type required">
119
                                <label data-bind="attr: {for: getCode() + '_telephone_' + value}" class="label">
120 121 122 123 124 125
                                    <span><!-- ko text: $t('Telephone')--><!-- /ko --></span>
                                </label>
                                <div class="control">
                                    <input type="number" class="input-text"
                                           name="payment[telephone]"
                                           data-bind="
126
                                               attr: {
127
                                                    id: getCode() + '_telephone_' + value,
128
                                                    title: $t('Telephone'),
129 130
                                                    'data-container': getCode() + '-telephone_' + value,
                                                    'data-validate': JSON.stringify({'required-number':true})
131 132 133
                                                },
                                                value: telephone"
                                           data-validate="{required:true}"
134 135 136 137
                                    />
                                </div>
                            </div>
                        <!--/ko-->
138 139

                    <!-- ko if: showSsn() -->
140
                    <div class="field ssn type required">
141
                        <label data-bind="attr: {for: getCode() + '_ssn_' + value}" class="label">
142 143 144 145 146 147 148
                            <span><!-- ko text: $t('Personal number (last digits)')--><!-- /ko --></span>
                        </label>
                        <div class="control">
                            <input type="text" class="input-text"
                                   name="payment[ssn]"
                                   data-bind="
                                           attr: {
149
                                                id: getCode() + '_ssn_' + value,
150 151
                                                title: $t('Social Security Number'),
                                                'data-container': getCode() + '-ssn',
152
                                                'data-validate': JSON.stringify({'required-number':true}),
153
                                                maxlength : getSsnLength()
154 155
                                            },
                                            value: ssn"
156
                                   data-validate="{required:true}"
157 158 159 160 161
                            />
                        </div>
                    </div>
                    <!--/ko-->

162
                    <!--/ko-->
163
                </fieldset>
164 165
                </form>

166 167 168 169 170 171 172 173 174 175 176
                <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: $parent.continueToAdyenBrandCode, enable: (value == $parent.isBrandCodeChecked())"
                                disabled>
177
                            <span data-bind="text: $t('Place Order')"></span>
178 179 180
                        </button>
                    </div>
                </div>
181
            </div>
rikterbeek's avatar
rikterbeek committed
182
        </div>
183 184 185
    <!--/ko-->
<!--/ko-->

186

187 188 189 190 191 192 193 194
<!-- ko if: (isPaymentMethodSelectionOnAdyen()) -->

    <div class="payment-method" data-bind="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()"/>
195 196 197 198 199 200 201 202 203
            <label data-bind="attr: {'for': getCode()}" class="label">

                <!-- ko if: isIconEnabled() -->
                    <div data-bind="attr: { 'class': 'adyen-sprite ' + getCode() }"></div>
                <!--/ko-->

                <span data-bind="text: getTitle()"></span>
            </label>

204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
        </div>
        <div class="payment-method-content">
            <div class="payment-method-billing-address">
                <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
                <!-- ko template: getTemplate() --><!-- /ko -->
                <!--/ko-->
            </div>
            <fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
                <div class="payment-method-note">
                    <!-- ko text: $t('You will be redirected to the Adyen website.') --><!-- /ko -->
                </div>
            </fieldset>
            <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 class="action primary checkout"
                            type="submit"
                            data-bind="click: continueToAdyen, enable: (getCode() == isChecked())"
                            disabled>
                        <span data-bind="text: $t('Continue to Adyen')"></span>
                    </button>
                </div>
rikterbeek's avatar
rikterbeek committed
230
            </div>
231
        </div>
rikterbeek's avatar
rikterbeek committed
232
    </div>
233
<!--/ko-->