Duplicate and Triplicate Stripe Payments for some Checkout Transactions

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
xarga
Posts: 43
Joined: 16 Dec 2019, 22:54

Duplicate and Triplicate Stripe Payments for some Checkout Transactions

Post by xarga » 29 Apr 2020, 02:14

Aimeos 2019.10
Omnipay ^3.0
PHP 7.2
Linux

In about 10-15% of transactions we're seeing duplicate and even triplicate Stripe payments occurring.

Each payment in the stripe dashboard has a different token but the same order No and same date:hour:min

Most of these have happened on the iPhone X running IOS 13 with a few on Mac/Safari and one on chrome.

Wondering if the payment system allows multiple hits on the submit button with no checks to prevent this from happening?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Duplicate and Triplicate Stripe Payments for some Checkout Transactions

Post by aimeos » 29 Apr 2020, 17:09

Stipe documentation suggests to disable the button until an error occurs:
stripe.confirmCardPayment may take several seconds to complete. During that time, disable your form from being resubmitted and show a waiting indicator like a spinner. If you receive an error, show it to the customer, re-enable the form, and hide the waiting indicator.
See https://stripe.com/docs/payments/accept ... it-payment

The current code doesn't seem to do that:
https://github.com/aimeoscom/ai-payment ... #L267-L352

If you can fix the problem, please create a pull request on Github so it can be solved permanently.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cbwswsolns
Posts: 1
Joined: 04 May 2021, 09:48

Re: Duplicate and Triplicate Stripe Payments for some Checkout Transactions

Post by cbwswsolns » 04 May 2021, 09:59

Laravel 5.6, aimeos-laravel 2020.04, PHP version 7.1. Development environment: Laravel Valet on MacOS 10.13.6, High Sierra, nginx.

I believe I have a fix for this issue now following the Stripe guidelines. I would like to run it by an Aimeos administrator before sharing, but I don't seem to have the privileges to see members lists just now.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Duplicate and Triplicate Stripe Payments for some Checkout Transactions

Post by aimeos » 04 May 2021, 10:20

If you have a fix, please create a pull request on Github:
https://github.com/aimeoscom/ai-payments
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply