Skip to main content

Duplicate orders with Stripe card payments when purchasing virtual products

2 weeks 6 days ago #100000277 by totama
-- url of the page with the problem -- : metzdaniel.hu
-- HikaShop version -- : 6.6.0
-- Joomla version -- : 5.4.10
-- PHP version -- : 8.3.35
-- Browser(s) name and version -- : Firefox 158.0
-- Error-message(debug-mod must be tuned on) -- : Contents of the error log:

OKOK - already confirmedOKOKOKOKOK
10.18.26 11:58:15 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1oRSGJWdJ6T5YOz7E0RODSekIxoGixBHcQn0JIv9V2DJOpi9EQniCmZJI
10.18.26 11:58:16 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1BabBDpvhILgDJu3Xc9WzVV7cyK2un8XarqHuNuxtxcSiNBE2omQEj0P8OK
10.18.26 12:04:59 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1rPsWd1AMvgMekTjfeZ2nQZWklZ0QSBU6R59tMnfxA3pNnjjh0n6CAFCM
10.18.26 12:05:01 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1LDOzTLYS1n6NLPyK2NeDgPB8312zONiNUVsP6Nik7OpWPq4fsiH0g6P8OK
10.18.26 12:22:19 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1nAnQnw9NWfmRzQiacl2GwEPpmyV5Rf9Eju5Z2C5BXvqc5azo49wEBbpU
10.18.26 12:22:21 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1UZece0Z15F5eyVps0ECyO9VOOZdC1Z2fb7NHe0oEee2MA26uFVkKdZUJOK
10.18.26 12:24:08 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1Q2nkjw6TmHQWUqxg5tGpPblBCBwh9lK3G9v17GydZ0eVKcrW7Z2Bd9vd
10.18.26 12:24:10 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a19num2ecyJxrI7kh2LOqCxSheigzlC3ff6UT1mZHKdoxxtxXhmhEizYvGOK
10.18.26 12:27:54 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a188gzoUtDVyPQwcpbsczM4DugWUizyuHIm9QX645ivsNtOeeyWl0khrRi
10.18.26 12:27:56 - stripecheckout
Stripe Checkout session created. Session ID: cs_test_a1RcFQQuWLrXfuWJITUHoZKTBUaYkyFQ5FR02CcVUJ60onO8bIXousUHnqOK
The issue is that purchasing a single virtual product via Stripe (credit/debit card payment) results in the creation of two separate orders, which is confusing in itself. Furthermore, two items are deducted from stock instead of one—which is a clear error. 
The first order has a status of "created," while the second is marked as "confirmed." The customer receives an email for both orders, which is also confusing. Naturally, only the email for the second, "confirmed" order contains the download link. 
How can this duplicate order issue be resolved?
Thomas

Please Log in or Create an account to join the conversation.

2 weeks 6 days ago #100000282 by nicolas
Hi,

The second order comes from the confirmation page of the checkout being requested a second time. In HikaShop 6.6.0, every request to that page turns the cart into a new order, as long as the cart is still there, and with Stripe Checkout the cart is only emptied once the payment is confirmed. So when that page is loaded twice (a reload, a second click on the Finish button, or the browser asking for it again), a first order is created and left in the "created" status, a second one is created right after, the customer is sent to Stripe for the second one and pays it. Each order sends its own creation email and takes its products from the stock, which is why you see two emails and two units missing. Your error log shows this: two Stripe sessions are created one or two seconds apart for each purchase, one per order.

HikaShop 6.7.0 handles this: when the confirmation page runs again for the same cart, it shows the order that already exists, with a new Stripe payment page for it, instead of creating another one. If the payment arrived in the meantime, the customer goes to the thank-you page instead. You can update by downloading it from your account on our website. Stripe Checkout itself doesn't need any change.

For the orders already created this way, change the status of the unpaid "created" duplicates to "cancelled" in Orders. HikaShop puts their products back in stock when an unpaid order is cancelled, unless you turned on "Update the product stock on confirmed status" in the configuration, in which case the stock wasn't taken for them in the first place: www.hikashop.com/support/documentation/54-hikashop-config.html

If you would rather your customers didn't get an email before they pay, you can unpublish the "Order creation notification" email in System > Emails. They will still get the email for the order status change, which carries the download link: www.hikashop.com/support/documentation/2...p-email-listing.html

If you still get a duplicate after the update, please tell us whether it happens on every purchase, and send us the lines of your server's access log for the minute of one duplicate purchase (the requests with "checkout" in their address). They will show what sends the confirmation twice: the same request sent twice at the same moment (a double click, for instance) is a different case from a reload.

Please Log in or Create an account to join the conversation.

2 weeks 6 days ago #100000284 by totama
Thank you very much; I will update and give it a try.

Please Log in or Create an account to join the conversation.

2 weeks 5 days ago #100000286 by totama
Another problem has come up! We updated to version 6.7, and—following your advice—we haven't touched any of the settings. But now, it’s impossible to place an order at all. When I click the "Place Order" button, nothing happens. Not even an error message appears.

Please Log in or Create an account to join the conversation.

2 weeks 5 days ago #100000287 by totama
Please accept my apologies; I wrote something incorrect in my previous message. It was a mistake—I failed to fill in one of the fields before submitting the order.

In fact, the order went through successfully; the test purchase and payment were completed, and the link for the virtual product arrived via email.

Only one order was created, and only one unit of the product was deducted from inventory.

Thank you very much for your help,the problem has been solved.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum