Problem/Motivation
I don't know whether this is related to
https://www.drupal.org/project/commerce_stripe/issues/3132809
π
Stripe sometimes causes commerce_payment to error although it accepts payment
Needs work
, or indeed whether this is an issue in Commerce Stripe or in Commerce itself.
The payment gateway is configured with the Stripe Card Element. It is not really possible to reproduce the issue, most transactions are fine, but we have a case where 1 successful payment has triggered 3 orders to be produced, identical except for order number. Each of the orders shows this as the checkout steps:
Tue, 07/23/2024 - 15:22
Order moved from Draft to Completed by the Place order transition.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Customer completed checkout for this order.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Order moved from Draft to Completed by the Place order transition.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Customer completed checkout for this order.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Order moved from Draft to Completed by the Place order transition.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Payment captured via Stripe for Β£354.99 using Mastercard ending in 7313.
Transaction ID: pi_3PfjaOHjo7D0Eiav0GUtNcdS.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Customer completed checkout for this order.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Payment captured via Stripe for Β£354.99 using Mastercard ending in 7313.
Transaction ID: pi_3PfjaOHjo7D0Eiav0GUtNcdS.
Anonymous (not verified)
Tue, 07/23/2024 - 15:22
Payment captured via Stripe for Β£354.99 using Mastercard ending in 7313.
Transaction ID: pi_3PfjaOHjo7D0Eiav0GUtNcdS.
In the php logs we can see prior to this at 15:21 the following errors:
[Tue Jul 23 15:21:04.849959 2024] [proxy_fcgi:error] [pid 3032433:tid 140362871920384] [remote 2a09:bac2:377e:d2::15:362:41934] AH01071: Got error 'PHP message: Uncaught PHP Exception Drupal\\commerce_payment\\Exception\\InvalidRequestException: "Invalid parameters were supplied to Stripe's API." at /var/www/intarsia_platform/web/modules/contrib/commerce/modules/payment/src/Exception/PaymentGatewayException.php line 36',
[Tue Jul 23 15:21:04.867984 2024] [proxy_fcgi:error] [pid 3032433:tid 140359950636800] [remote 2a09:bac2:377e:d2::15:362:41934] AH01071: Got error 'PHP message: Uncaught PHP Exception Drupal\\commerce_payment\\Exception\\InvalidRequestException: "Invalid parameters were supplied to Stripe's API." at /var/www/intarsia_platform/web/modules/contrib/commerce/modules/payment/src/Exception/PaymentGatewayException.php line 36'
It is not possible to see whether these actually relate to the purchase which has created the duplicate orders but it seems likely - there were no other orders on the site around that time.
Is it an issue with the Commerce Stripe module or the main Commerce module that multiple orders can be created containing identical remote payment ids?