Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Can't you just use a VPN and select a US server?
If the DOM is not fully loaded at the time when the payment is completed, the btn_submit button may not be fully available in the DOM, causing the click() method to not trigger. This happens when the JavaScript executes too early, before the button has been added to the page.
Can you check the following codes?
checkout.js line 48
PHP Code:
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
to
PHP Code:
const interval = setInterval(function() {
const btnSubmit = document.getElementById("btn_submit");
if (btnSubmit) {
btnSubmit.click();
clearInterval(interval);
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
}
}, 100); // 100ms
Re: Stripe payment module - Duplicate charges, no order
I do not quote follow. Are you saying you found the issue?
What is "DOM"?
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
I do not quote follow. Are you saying you found the issue?
What is "DOM"?
There are two buttons on the checkout confirmation screen:
The Zen Cart "Confirm" button.(Hidden when Stripe payment is selected)
The Stripe "Confirm" button (displayed only if Stripe is selected as the payment method).
For Amazon Pay, the user is redirected to another screen, which causes the checkout confirmation display to disappear. When they return, the checkout confirmation screen is reloaded, and checkout.js executes the click() command to press the Zen Cart "Confirm" button.
Issue
If the click() command runs before the Zen Cart "Confirm" button appears, the purchase process cannot proceed.
Fix
This update ensures that the click() command waits until the Zen Cart "Confirm" button is displayed before executing.
At this stage, we are not 100% certain that this is the root cause, but it is a highly probable and common issue.
Re: Stripe payment module - Duplicate charges, no order
It's been a week, and there haven't been any issues, right? So, I guess 'no news is good news'?:blush:
Re: Stripe payment module - Duplicate charges, no order
Sorry, I have been consumed on another effort.
I just put the code in place.
Enabled Cash App on Stripe.
Went to the Zen checkout page. Selected Cash App, which I have never used. Clicked "confirm"
The page changed, it was overall darkened, as if a pop up blocker was at work. No QR code was displayed
After a few seconds, I got the Zen Order Confirmation page.
On Stripe is shows the order was incomplete
I reverted the code back and disabled Cash App.
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Sorry, I have been consumed on another effort.
I just put the code in place.
Enabled Cash App on Stripe.
Went to the Zen checkout page. Selected Cash App, which I have never used. Clicked "confirm"
The page changed, it was overall darkened, as if a pop up blocker was at work. No QR code was displayed
After a few seconds, I got the Zen Order Confirmation page.
On Stripe is shows the order was incomplete
I reverted the code back and disabled Cash App.
If that's the case, the issue might be on Stripe's side.
It is just a possibility, but...
File: includes/modules/payment/stripepay/create.php (Line 34)
Even if automatic_payment_methods is set to true, there are cases where Cash App is not included as an available payment method.
Therefore, it is necessary to explicitly specify payment_method_types.
PHP Code:
'automatic_payment_methods' => [
'enabled' => true,
],
to
PHP Code:
'payment_method_types' => ['card', 'cashapp'],
'automatic_payment_methods' => [
'enabled' => true,
],
File: checkout.js (Line 41)
When using if_required, Stripe may determine that a redirect is not necessary, which could cause the QR code to be skipped.
PHP Code:
redirect: 'if_required'
to
PHP Code:
redirect: 'always'
I apologize for making you try multiple times. Creating code is a process of trial and error, and since I can't see the results directly myself, it's making it even more challenging.:frusty:
Re: Stripe payment module - Duplicate charges, no order
I appreciate all you effort, but I'm going to say Credit cards are good enough.
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
I appreciate all you effort, but I'm going to say Credit cards are good enough.
OK
I understand.
but I'll put this code 'payment_method_types' => ['card', 'cashapp'], in the checkout.js next update.
Re: Stripe payment module - Duplicate charges, no order
I have obtained Stripe support, and I'll modify checkout.js in the next update."
Re: Stripe payment module - Duplicate charges, no order
I have never used Cash App. When I go to checkout its shown as an option, which is why I was able to click on it and induce and error.
If you are in Japan and you use a VPN with a US location, you should be able to see and induce the error I saw.