PluginProbe
HyperPay Payments / 2.3.3
HyperPay Payments v2.3.3
6.6.0 trunk 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.5 4.0.0 4.0.2 All 34 releases
hyperpay-gateways / assets / js / script.js

script.js in HyperPay Payments 2.3.3, at assets/js/script.js

49 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 let form = jQuery('<form></form>')
2 /**
3 * create a HTML from and insert it after order_details class
4 * This form must be created to replace it with CopyAndPay form
5 */
6 form.attr('action', dataObj.postbackURL)
7 .addClass('paymentWidgets')
8 .attr('data-brands', dataObj.payment_brands)
9 jQuery('.order_details').after(form)
10
11 /**
12 *
13 * to check if current broswer support ApplePay
14 * @param {boolean}
15 * if @returns {false} attach error message Your Device Dose Not Support ApplePay
16 */
17 if (!window.ApplePaySession && dataObj.payment_brands.includes('APPLEPAY')) {
18 jQuery('.woocommerce-notices-wrapper')
19 .append(`<ul class="woocommerce-error" role="alert"><li> ${ dataObj.is_arabic ? 'جهازك او �
20 تصفحك لا يدع�
21 الدفع عن طريق ابل' : 'Your Device Or Browser Dose Not Support ApplePay' } </li></ul>`)
22 }
23
24 /**
25 * initiate wpwlOptions
26 */
27 var wpwlOptions = {
28
29 onReady: function () {
30
31 jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-qrcode').hide();
32 jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile').hide();
33 jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-group-paymentMode').hide();
34 jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-group-mobilePhone').show();
35 jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile .wpwl-control-radio-mobile').attr('checked', true);
36 jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile .wpwl-control-radio-mobile').trigger('click');
37
38 },
39 "style": dataObj.style, // <== this style comes from settings page of gateways
40 "paymentTarget": "_top",
41 "locale" : dataObj.is_arabic ? 'ar' : 'en',
42 "registrations": {
43 "hideInitialPaymentForms": "true",
44 "requireCvv": "true"
45 }
46
47
48 }
49