- Issue created by @farhadhf
- @farhadhf opened merge request.
Sending a request to `/commerce/payment/capture/${orderId}/${paymentId}` after confirming the payment using Stripe.js v3 on the client side results in getting 400 Bad Request response from the server with this body:
{"message":"Couldn't load payment data."}
Explained above.
Seems like commerce_decoupled_stripe is using an older version of the "stripe/stripe-php" package. Probably some time in the past Stripe stopped sending "$intent->charges" in its response, and the $intent object doesn't contain any information about the card that was used to make the payment, but it does include the "latest_charge" ID. The only way to retrieve this data seems to be by sending a separate request to retrieve the charge, but $intent->latest_charge is undefined because of the old version of the "stripe/stripe-php" package.
The merge request updates the "stripe/stripe-php" package to "~10.0".
StripeGateway::capturePayment() checks to see if $intent->charges exists, and if so, it won't do anything and continues as before.
If it doesn't exist, it'll look for $intent->latest_charge and if it's not empty, it'll retrieve it.
If $intent->latest_charge is also empty, it'll return the same "Couldn't load payment data" error.
none
none
none
none
Active
1.0
Code