| 1 |
/** |
| 2 |
* |
| 3 |
* to check if current browser support ApplePay |
| 4 |
* @param {boolean} |
| 5 |
* if @returns {false} attach error message Your Device Dose Not Support ApplePay |
| 6 |
*/ |
| 7 |
if (!window.ApplePaySession && dataObj.payment_brands.includes('APPLEPAY')) { |
| 8 |
jQuery('.woocommerce-notices-wrapper') |
| 9 |
.append(`<ul class="woocommerce-error" role="alert"><li> ${dataObj.is_arabic ? 'جهازك او � |
| 10 |
تصفحك لا يدع� |
| 11 |
الدفع عن طريق ابل' : 'Your Device Or Browser Dose Not Support ApplePay'} </li></ul>`) |
| 12 |
} |
| 13 |
|
| 14 |
var wpwlOptions = { |
| 15 |
|
| 16 |
onReady: function () { |
| 17 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-qrcode').hide(); |
| 18 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-wrapper-radio-mobile').hide(); |
| 19 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-group-paymentMode').hide(); |
| 20 |
jQuery('.wpwl-form-virtualAccount-STC_PAY .wpwl-group-mobilePhone').show(); |
| 21 |
jQuery('.wpwl-group.wpwl-group-brand').hide() ; |
| 22 |
}, |
| 23 |
onBlurCardNumber: function (isValid) { |
| 24 |
let paymentBrand = this.$form.find('.wpwl-control-brand').val(); |
| 25 |
if (dataObj.id != 'hyperpay_mada' && paymentBrand == "MADA") { |
| 26 |
setTimeout(function () { |
| 27 |
jQuery('.wpwl-hint-cardNumberError').remove(); |
| 28 |
jQuery('.wpwl-control-cardNumber').removeClass('wpwl-has-error'); |
| 29 |
jQuery('.wpwl-control-cardNumber').addClass('wpwl-has-error').after('<div class="wpwl-hint wpwl-hint-cardNumberError">mada card is not allowed, please choose mada debit card from the payment options</div>'); |
| 30 |
jQuery('.wpwl-button-pay').prop('disabled', true); |
| 31 |
}, 5); |
| 32 |
} |
| 33 |
}, |
| 34 |
style: dataObj.style, // <== this style comes from settings page of gateways |
| 35 |
paymentTarget: "_top", |
| 36 |
locale: dataObj.is_arabic ? 'ar' : 'en', |
| 37 |
registrations: { |
| 38 |
hideInitialPaymentForms: true, |
| 39 |
requireCvv: "true" |
| 40 |
}, |
| 41 |
browser: { |
| 42 |
threeDChallengeWindow: 5 |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
if (dataObj.supported_network) { |
| 49 |
wpwlOptions.applePay = { |
| 50 |
supportedNetworks: dataObj.supported_network |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
|