-
Notifications
You must be signed in to change notification settings - Fork 35
/
buckaroo_magento2_giftcards.html
198 lines (174 loc) · 9.28 KB
/
buckaroo_magento2_giftcards.html
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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
<!-- ko if: isGiftcardsRedirectMode() -->
<div class="buckaroo_magento2_giftcards buckaroo_magento2_giftcards_group payment-method" data-bind="afterRender: checkForPayments,css: {'_active': (getCode() == isChecked())}">
<div class="payment-method-title field choice bk-payment">
<div class="bk-payment-wrap">
<div class="bk-radio-wrap">
<input type="radio"
name="payment[method]"
class="radio"
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
<label class="label" data-bind="attr: {'for': getCode()}" >
<!-- ko text: getTitle() --><!-- /ko -->
<!-- ko if: subtext !== null && subtext.length > 0 -->
<p class="bk-description" data-bind="text: subtext, style: subTextStyle"></p>
<!-- /ko -->
</label>
</div>
<div class="bk-img-wrap">
<img data-bind="attr: { src: require.toUrl('Buckaroo_Magento2/images/svg/giftcards.svg') }" />
</div>
</div>
</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 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 id="button-action-checkout-giftcards-redirect"
class="action primary checkout"
type="submit"
data-bind="
click: placeOrder,
attr: {title: $t('Place Order')},
enable: (getCode() == isChecked()),
css: {disabled: !isPlaceOrderActionAllowed() }
"
disabled>
<span data-bind="i18n: 'Place Order'"></span>
</button>
</div>
</div>
<!-- ko if: payWithBaseCurrency() -->
<div class="buckaroo_magento2_currency-notification">
<span data-bind="text: getPayWithBaseCurrencyText()"></span>
</div>
<!--/ko-->
</div>
</div>
<!-- /ko -->
<!-- ko ifnot: isGiftcardsRedirectMode() -->
<div class="buckaroo_magento2_all_giftcards" data-bind="foreach: { data: allgiftcards, as: 'giftcard', noChildContext: false }">
<div data-bind="attr: { 'class': 'buckaroo_magento2_all_giftcard payment-method buckaroo_magento2_' + code }, css: {'_active': ($parent.getCode() == $parent.isChecked() && $parent.getGiftcardType() == code)}">
<div class="payment-method-title field choice bk-payment">
<div class="bk-payment-wrap">
<div class="bk-radio-wrap">
<input type="radio"
name="payment[method]"
class="radio"
data-bind="attr: {'id': code, 'data-method': 'buckaroo_magento2_giftcards'}, value: code, click: $parent.selectGiftCardPaymentMethod.bind($parent, code), checked: $parent.isCheckedGiftCardPaymentMethod.bind($parent, code), visible: $parent.isRadioButtonVisible()"/>
<label class="label" data-bind="attr: {'for': code}" >
<!-- ko text: title --><!-- /ko -->
</label>
</div>
<div class="bk-img-wrap">
<img data-bind="attr: { src: logo }" />
</div>
</div>
</div>
<div class="payment-method-content">
<!-- ko foreach: $parent.getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion($parent.getBillingAddressFormName()) -->
<!-- ko template: getTemplate()--><!-- /ko -->
<!--/ko-->
</div>
<div class="payment-method-second-col billing-address-form">
<form method="post"
data-role="$parent.save"
data-bind="$parent.submit:$parent.save,
mageInit: { 'validation': [] },
attr: {'data-hasrequired': $t('* Required Fields')}">
<fieldset class="fieldset payment styled">
<div class="fieldset card_front width-100">
<div class="field required width-100" >
<label class="label" for="buckaroo_magento2_giftcards_cardnumber"> <span data-bind="i18n: 'Card number:'"> </span> </label>
<div class="control">
<input type="text"
class="input-text field buckaroo_magento2_giftcards_input"
name="payment[buckaroo_magento2_giftcards][cardnumber]"
data-bind="
valueUpdate: 'blur',
value: $parent.CardNumber,
textInput: $parent.CardNumber(),
attr: { 'data-card': code, 'id': 'buckaroo_magento2_giftcards_cardnumber_' + code, 'data-validate': JSON.stringify({ 'required': true, '$parent.validateCardNumber': true }) },
event: { blur: $parent.checkValidness }">
</div>
</div>
<div class="fieldset width-100">
<div class="magnet_stripe width-100"></div>
<div class="field required card_security width-100" >
<label class="label width-65-l" for="buckaroo_magento2_giftcards_pin"> <span data-bind="i18n: 'PIN / Security code:'"> </span> </label>
<div class="control card-info-input width-25-l">
<input type="text"
class="input-text field buckaroo_magento2_giftcards_input"
name="payment[buckaroo_magento2_giftcards][pin]"
data-bind="
valueUpdate: 'blur',
value: $parent.Pin,
textInput: $parent.Pin(),
attr: { 'id': 'buckaroo_magento2_giftcards_pin_' + code, 'data-validate': JSON.stringify({ 'required': true, '$parent.validatePin': true }) },
event: { blur: $parent.checkValidness }">
</div>
<div class="card_info width-10">
<div class="popup">
</div>
</div>
</div>
</div>
<div class="field width-100">
<span data-bind="i18n: 'Please make sure all fields are filled in correctly before proceeding.' "></span>
<span class="apply-gift-card action primary" data-bind="
click: $parent.applyGiftcard.bind($parent),
i18n: 'Apply Gift Card',
attr: { 'id': 'buckaroo_magento2_giftcards_submit_' + code }
css: {disabled: $parent.buttoncheck()}">
</span>
</div>
</div>
</fieldset>
</form>
</div>
<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 id="button-action-checkout-giftcards"
class="action primary checkout"
type="submit"
data-bind="
click: $parent.placeOrder.bind($parent),
attr: {title: $t('Place Order')},
enable: ($parent.getCode() == $parent.isChecked()),
css: {disabled: !$parent.buttoncheck()}
"
disabled>
<span data-bind="i18n: 'Place Order'"></span>
</button>
</div>
</div>
<!-- ko if: $parent.payWithBaseCurrency() -->
<div class="buckaroo_magento2_currency-notification">
<span data-bind="text: $parent.getPayWithBaseCurrencyText()"></span>
</div>
<!--/ko-->
</div>
</div>
</div>
<!-- /ko -->
<div data-bind='afterRender: checkForPayments'> </div>