| 1 |
|
| 2 |
/** |
| 3 |
* |
| 4 |
* to check if current browser support ApplePay |
| 5 |
* @param {boolean} |
| 6 |
* if @returns {false} attach error message Your Device Dose Not Support ApplePay |
| 7 |
*/ |
| 8 |
if (!window.ApplePaySession && dataObj.payment_brands.includes('APPLEPAY')) { |
| 9 |
jQuery('.woocommerce-notices-wrapper') |
| 10 |
.append(`<ul class="woocommerce-error" role="alert"><li> ${dataObj.is_arabic ? 'جهازك او � |
| 11 |
تصفحك لا يدع� |
| 12 |
الدفع عن طريق ابل' : 'Your Device Or Browser Dose Not Support ApplePay'} </li></ul>`) |
| 13 |
} |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* initiate wpwlOptions |
| 18 |
*/ |
| 19 |
var wpwlOptions = { |
| 20 |
|
| 21 |
onReady: function () { |
| 22 |
|
| 23 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-qrcode').hide(); |
| 24 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile').hide(); |
| 25 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-group-paymentMode').hide(); |
| 26 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-group-mobilePhone').show(); |
| 27 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile .wpwl-control-radio-mobile').attr('checked', true); |
| 28 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile .wpwl-control-radio-mobile').trigger('click'); |
| 29 |
|
| 30 |
}, |
| 31 |
style: dataObj.style, // <== this style comes from settings page of gateways |
| 32 |
paymentTarget: "_top", |
| 33 |
locale: dataObj.is_arabic ? 'ar' : 'en', |
| 34 |
registrations: { |
| 35 |
hideInitialPaymentForms: true, |
| 36 |
requireCvv: "true" |
| 37 |
}, |
| 38 |
browser: { |
| 39 |
threeDChallengeWindow: 5 |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
if (dataObj.supported_network) { |
| 47 |
wpwlOptions.applePay = { |
| 48 |
supportedNetworks: dataObj.supported_network |
| 49 |
} |
| 50 |
} |
| 51 |
|