
Originally Posted by
split63
Gozzandes,
Are you still believing that the issue with non-CC transaction is a session issue?
If so, why are the CC transactions not affected?
I have not had an issue since I turned off all the non-CC payment methods
I've read stripe documents for developers.
Following code are external payment page for devido.
the codes are redirect to devido page and back to the confirmation page.
if you want to use gcash, following code will be change from extermal_divido to external_gcash.
I have to check it but I do not use Stripe payment in my EC shop.
Code:
elements = stripe.elements({ clientSecret });
Code:
elements = stripe.elements({
clientSecret: clientSecret,
externalPaymentMethodTypes: ['external_divido']
});
Code:
paymentElement.mount("#payment-element");
Code:
paymentElement.mount("#payment-element");
// Track selected payment method
let selectedPaymentMethod;
paymentElement.on('change', (event) => {
selectedPaymentMethod = event?.value?.type;
});
Code:
async function handleSubmit(e) {
e.preventDefault();
setLoading(true);
const response = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: confirmationURL,
},
redirect: 'if_required'
}
)
if (response.error) {
showMessage(response.error.message);
} else {
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
}
setLoading(false);
}
Code:
async function handleSubmit(e) {
if (selectedPaymentMethod === 'external_divido') {
// Redirect customer to the Divido checkout page to complete the transaction
const dividoRedirectUrl = "<< fill the Divido redirect URL here >>";
window.location.href = dividoRedirectUrl;
} else {
e.preventDefault();
setLoading(true);
const response = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: confirmationURL,
},
redirect: 'if_required'
}
)
if (response.error) {
showMessage(response.error.message);
} else {
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
}
setLoading(false);
}
}
Bookmarks