Add new payment and shipping parsers for various integrations
- Implemented Google Pay parser in bongooglepay.js - Added Buckaroo 3 payment parser in buckaroo3.js - Introduced DataTrans CW Mastercard parser in datatranscw.js - Created DataTrans CW Credit Card parser in datatranscw_creditcard.js - Developed DHL Assistant shipping parser in dhlassistant.js - Added Estimated Delivery parser in estimateddelivery.js - Implemented Floapay payment parser in floapay.js - Created FS Pickup at Store shipping parser in fspickupatstore.js - Developed Generic Iframe parser in generic_iframe_parser.js - Added Geodis Officiel shipping parser in geodisofficiel.js - Implemented Glob Kurier module shipping parser in globkuriermodule.js - Created Latvija Post Express Pickup Terminal parser in latvijaspastsexpresspastspostterminalslv.js - Developed LP Shipping parser in lpshipping.js - Added Mijora Venipak parser in mijoravenipak.js - Implemented Apple Pay parser in pm_applepay.js - Created Przelewy24 payment parser in przelewy24.js - Developed Pshugls shipping parser in pshugls.js - Added Redsys Insite payment parser in redsysinsite.js - Implemented Tpay payment parser in tpay.js - Updated third-party integration documentation for FedEx DotCom
This commit is contained in:
@@ -8,52 +8,37 @@
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
*/
|
||||
|
||||
checkoutPaymentParser.stripejs_removed = {
|
||||
/* tested with Stripe Payment Pro v4.6.0 - by NTS - on 12.03.2024, when embedded payment is enabled */
|
||||
checkoutPaymentParser.stripejs = {
|
||||
|
||||
initiatePayment: function() {
|
||||
if (typeof StripePubKey !=='undefined') {
|
||||
var stripe = Stripe(StripePubKey,{locale: lang_iso_code});
|
||||
var stripe_pm = document.getElementById('selected_pm').value;
|
||||
var quickPay = ((stripe_pm!=1) ? 1 : 0);
|
||||
// after_load_callback: function() {
|
||||
// if (typeof initiateStripePayment !== 'undefined') {
|
||||
// initiateStripePayment();
|
||||
// }
|
||||
// },
|
||||
|
||||
$('input[name=payment-option]:checked').focus();
|
||||
$('#stripe-ajax-loader,#stripe-payment-form').toggle();
|
||||
$('#payment-confirmation button[type=submit]').prop("disabled", true);
|
||||
var toggle_selector = '#stripe-ajax-loader,#stripe-payment-form';
|
||||
var error_selector = '#card-errors';
|
||||
container: function (element) {
|
||||
payment.setPopupPaymentType(element);
|
||||
|
||||
handlePI('checkout', function(res_status){
|
||||
if(res_status.code==1) {
|
||||
$('#checkout-success').show();
|
||||
stripe.redirectToCheckout({
|
||||
sessionId: res_status.sess_id
|
||||
}).then(function (result) {
|
||||
$('#checkout-success').hide();
|
||||
var err_msg = showStripePayError(toggle_selector, 0, result.error.message, error_selector);
|
||||
alert(result.error.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
// Add CSS rule to hide payment form in payment methods list
|
||||
var cssEl = document.createElement('style'),sheet;
|
||||
document.head.appendChild(cssEl);
|
||||
cssEl.sheet.insertRule(`
|
||||
section#checkout-payment-step [data-payment-module=stripejs] > .additional-information {
|
||||
display: none!important;
|
||||
}
|
||||
`);
|
||||
},
|
||||
|
||||
popup_onopen_callback: function () {
|
||||
if (typeof initiateStripePayment !== 'undefined') {
|
||||
|
||||
// out of some reason stripe_allow_prbutton is always false on initial page load
|
||||
if ($('[data-module-name^=stripePRButton]').length && typeof stripe_allow_prbutton !== 'undefined') {
|
||||
stripe_allow_prbutton = true;
|
||||
}
|
||||
initiateStripePayment();
|
||||
}
|
||||
},
|
||||
|
||||
after_load_callback: function() {
|
||||
// $.getScript(tcModuleBaseUrl + '/../stripejs/views/js/stripe-prestashop.js');
|
||||
|
||||
},
|
||||
|
||||
all_hooks_content: function (content) {
|
||||
|
||||
},
|
||||
|
||||
container: function (element) {
|
||||
|
||||
},
|
||||
|
||||
form: function (element) {
|
||||
let form = element.find('form');
|
||||
let onSubmitAction = 'javascript:checkoutPaymentParser.stripejs.initiatePayment()';
|
||||
form.attr('action', 'javascript:void(0);');
|
||||
form.attr('onsubmit', onSubmitAction);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user