We’ve been trying to work out why our stock keeps getting out of sync (dissapearing) so we installed product change log addon which identified the Stripe checkout as the issue.
When a customer checks out with Stripe 3 emails are sent to us and 3 emails to the customer. Sometimes all 3 trigger stock deduction correctly (example stock from 2 to 1) and sometimes it will deduct the stock multiple times.
Both inventory and emails are triggered based on the change in order status so you need to look into seeing why the order status is changing frequently.
No the order status is not changing, this appears to be Stripe sending multiple confirmations. Stripe do this for reliability I assume, but clearly state that payment processing software should handle it.
I suspect the reason it only changes occasionally the stock multiple times is as it needs the database to update and the requests are sent fast.
This is a bug, and it’s not a user error from my part using their software.
The return webhook runs each time a confirmation is sent and sends a new email, re-sets the status, and sets the new stock numbers based on what is currently in the database.
After the first 1 or 2 requests the database has updated and the 2nd / 3rd requests will see lower stock and as a result deduct stock again.
What the stripe webhook should do is only take action on the first payment confirmation and ignore the subsequent ones.
It’s definitly a bug? It doesn’t happen with PayPal or other payment methods.
I don’t think so this issue with Stripe has been going on for some time over many updates. I’ve only just been annoyed enough as the product range grows to see if it can be resolved.
There are three webhooks on stripe but each has a different signing secret key as per the image. I assume this is because we have Stipe, Apple pay and Google pay all configured via Stripe checkout? Or is it a different issue.
I believe they are using the same keys even though the signing key is different. Do we need to use differen
That did not solve the issue. I disabled two of the three webhooks on Stripe.
That has resulted in the first two orders only getting 1 email, but the next order got 2 emails instead of three (but not 1).
Also one of the orders remained in open status not paid even after disabling two of the webhooks.
It seems google and apple pay still work with two webhooks turned off.
So something funny is still happening but it’s at least a bit better.
The patch couldn’t find two files to patch apparently but it did the rest. I don’t know if that’s normal?
[root@mail modelrockets]# patch -p1 < ebf28a348e25ff0cf3e65ccbd07a5e5e8b74dc21.diff
patching file app/addons/stripe/payments/stripe.php
patching file app/addons/stripe/src/Webhook/Handlers/CheckoutSessionAsyncPaymentSucceeded.php
patching file app/addons/stripe/src/Webhook/Handlers/PaymentIntentSucceeded.php
can't find file to patch at input line 126
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentCanceled.php b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentCanceled.php
|index 8a3cbf9ff56784b4cc7c6e064849e62fffd246ed..a66125bb7402dcf7a0d28b4655c00b88c008807b 100644
|--- a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentCanceled.php
|+++ b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentCanceled.php
--------------------------
File to patch:
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 139
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php
|index 7c431a20ccfa51c66b428314c47b21a83e95c8ce..1d80cd53a804a1ddc83ea0d2222696db5ec4be76 100644
|--- a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php
|+++ b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php
--------------------------
File to patch:
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 166
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/app/addons/stripe_connect/payments/stripe_connect.php b/app/addons/stripe_connect/payments/stripe_connect.php
|index f3ae32fc0ecf1c9e86626cae450bf8ece8609810..4569517ed335ef19796d8e3ec762ea4d68640959 100644
|--- a/app/addons/stripe_connect/payments/stripe_connect.php
|+++ b/app/addons/stripe_connect/payments/stripe_connect.php
--------------------------
File to patch:
Skip this patch? [y] y
Skipping patch.
2 out of 2 hunks ignored
I can confirm that this patch does not effect orders staying open with Stripe, or the multiple emails / stock deduction problem.
I’ve left just the one webhook running (Why did it make three?) which seems to resolve the multiple emails. But we’ve still noticed one item stock not be correct and several orders remain in Open status instead of paid. We’ve also had one order go to back order because it took the stock out twice and then there was not enough stock left so it back ordered.
There seems to be a significant issue with the Stripe checkout.
The only reason that I see, is that you have used the same API credentials for several different payment methods.
I’m afraid there have been no similar reports from anyone else. And I’m afraid there’s not enough information in your report for me to reproduce it. So this report cannot be confirmed as a bug at this time.
We have stripe issues in our both stores,actually we are at 4.17.2.SP2 and due to problems with stripe addon we hold all upgrades.We were also getting multiple emails,statuses did not change as it should,switching often to BACKORDER status.It was fixed by cs-cart team couple of times,but still does not work correct.After succesful payment order stay at Open status,but at least does not switch to Backorder anymore after latest fix.I think cs-cart should really take care and fix complete Stripe payment plugin.