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

cc-form.html 9.07 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 29
 */
-->
<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()"/>
30 31
        <label data-bind="attr: {'for': getCode()}" class="label">

32 33
            <!-- ko if: showLogo() -->
            <div data-bind="attr: { 'class': 'adyen-sprite ' + getCode() }"></div>
34 35 36 37
            <!--/ko-->

            <span data-bind="text: getTitle()"></span>
        </label>
rikterbeek's avatar
rikterbeek committed
38 39 40
    </div>

    <div class="payment-method-content">
41

rikterbeek's avatar
rikterbeek committed
42
        <div class="payment-method-billing-address">
43
            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
rikterbeek's avatar
rikterbeek committed
44 45 46 47 48
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>


49
        <form class="form" id="adyen-cc-form" data-role="adyen-cc-form" action="#" method="post" data-bind="mageInit: {
rikterbeek's avatar
rikterbeek committed
50 51 52 53 54 55 56
            'transparent':{
                'context': context(),
                'controller': getControllerName(),
                'orderSaveUrl':getPlaceOrderUrl(),
            }, 'validation':[]}">


57 58 59 60 61
            <!-- ko foreach: getRegion('messages') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->


62 63
            <fieldset
                    data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'payment_form_' + getCode()}">
64 65
                <!-- ko if: (isShowLegend())-->
                <legend class="legend">
66
                    <span><!-- ko text: $t('Credit Card Information')--><!-- /ko --></span>
67 68
                </legend>
                <br/>
69
                <!-- /ko -->
70

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
                <div class="field holdername type">
                    <label data-bind="attr: {for: 'creditCardHolderName'}" class="label">
                        <span><!-- ko text: $t('Credit Card Owner')--><!-- /ko --></span>
                    </label>
                    <div class="control">
                        <input type="text"
                               class="input-text required-entry"
                               data-encrypted-name="holderName"
                               value=""
                               data-bind="attr: {
                                                id: 'creditCardHolderName',
                                                title: $t('Credit Card Owner'),
                                                placeholder: $t('Credit Card Owner'),
                                                'data-container': getCode() + '-cc-owner'
                                                },
                                            enable: isActive($parents),
                                            value: creditCardOwner,
                                            valueUpdate: 'keyup' "
                               data-validate="{required:true}"
                        />
                    </div>
                </div>

                <div class="field type">
95
                    <label data-bind="attr: {for: getCode() + '_cc_type'}" class="label">
96
                        <span><!-- ko text: $t('Credit Card Type')--><!-- /ko --></span>
97 98 99 100
                    </label>
                    <div class="control">
                        <ul class="credit-card-types">
                            <!-- ko foreach: {data: getCcAvailableTypesValues(), as: 'item'} -->
101
                            <li class="item" data-bind="css: {_active: $parent.creditCardType() == item.value} ">
102 103 104 105 106 107 108 109 110 111 112
                                <!--ko if: $parent.getIcons(item.value) -->
                                <img data-bind="attr: {
                                'src': $parent.getIcons(item.value).url,
                                'alt': item.type,
                                'width': $parent.getIcons(item.value).width,
                                'height': $parent.getIcons(item.value).height
                                }">
                                <!--/ko-->
                            </li>
                            <!--/ko-->
                        </ul>
113
                        <p class="helper-text" data-bind="css: {hidden: creditCardType() !== ''} "><!-- ko text: $t('(Please provide a card with the type from the list above)')--><!-- /ko --></p>
114 115 116 117 118 119 120 121 122
                        <input type="hidden"
                               name="payment[cc_type]"
                               class="input-text"
                               value=""
                               data-bind="attr: {id: getCode() + '_cc_type', 'data-container': getCode() + '-cc-type'},
                           value: creditCardType
                           ">
                    </div>
                </div>
123 124
                <div class="field number cardContainerField">
                    <div afterRender="renderSecureFields()" data-bind="attr: { id: 'cardContainer'}" ></div>
125
                </div>
126 127


rikterbeek's avatar
rikterbeek committed
128

129 130 131

                <!-- ko if: (hasInstallments())-->

132 133
                <div class="field required"
                     data-bind="attr: {id: getCode() + '_installments_div'}, visible: getInstallments().length > 0">
134 135 136 137
                    <label data-bind="attr: {for: getCode() + '_installments'}" class="label">
                        <span><!-- ko text: $t('Installments')--><!-- /ko --></span>
                    </label>
                    <div class="control">
Alessio Zampatti's avatar
Alessio Zampatti committed
138 139 140 141 142

                        <select  class="select"
                                 name="payment[number_of_installments]"
                                 data-bind="attr: {id: getCode() + '_installments', 'data-container': getCode() + '-installments', 'data-validate': JSON.stringify({required:false})},

143 144 145 146
                                        enable: isActive($parents),
                                        options: getInstallments,
                                        optionsValue: 'value',
                                        optionsText: 'key',
Alessio Zampatti's avatar
Alessio Zampatti committed
147
                                        optionsCaption: $t('Do not use Installments'),
148
                                        value: installment"
149
                                data-validate="{required:true}">
150 151 152 153 154 155 156 157
                        </select>
                    </div>
                </div>


                <!-- /ko -->


158 159 160 161 162 163 164
                <!-- ko if: (canCreateBillingAgreement())-->

                <div class="field choice">
                    <input type="checkbox"
                           name="payment[store_cc]"
                           autocomplete="off"
                           class="checkbox"
165
                           data-bind="attr: {title: $t('Remember Me')}, checked: setStoreCc"
166
                    />
167 168 169
                    <label data-bind="attr: {for: getCode() + '_remember_details'}" class="label">
                        <span><!-- ko text: $t('Remember these details')--><!-- /ko --></span>
                    </label>
170
                </div>
171

172
                <!-- /ko -->
173 174


175 176 177 178 179 180 181 182
                <input type="hidden"
                       name="payment[generationtime]"
                       class="input-text"
                       value=""
                       data-encrypted-name="generationtime"
                       data-bind="attr: {id: getCode() + '_generationtime', 'data-container': getCode() + '-generationtime'},
                           value: getGenerationTime()"
                />
183
            </fieldset>
184
        </form>
rikterbeek's avatar
rikterbeek committed
185

186 187 188 189 190
        <div class="checkout-agreements-block">
            <!-- ko foreach: $parent.getRegion('before-place-order') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
191 192


193 194 195 196
        <div class="actions-toolbar">
            <div class="primary">
                <button class="action primary checkout"
                        type="submit"
197
                        data-bind="click: placeOrder,
198
                        attr: {title: $t('Place Order')},
199
                        enable: isButtonActive()"
200 201 202
                        disabled>
                    <span data-bind="text: $t('Place Order')"></span>
                </button>
rikterbeek's avatar
rikterbeek committed
203
            </div>
204
        </div>
rikterbeek's avatar
rikterbeek committed
205 206
    </div>
</div>
207