Problem/Motivation
The commerce_payment_sync module currently supports payment synchronization for some gateways such as PayPal and Sermepa, but it does not provide support for Stripe Checkout.
This means that if a Stripe Checkout payment is successfully completed in Stripe but the normal callback or webhook flow fails to correctly attach the payment to the Drupal Commerce order, the order can remain pending even though the customer has already paid.
Adding support for Stripe Checkout would make it possible to recover those payments
Proposed resolution
Add a new commerce_payment_sync plugin for Stripe Checkout.
The plugin would:
- Load the Stripe Checkout Session using a stored
checkout_session_idfrom the order. - Retrieve the related payment information from the session, including the PaymentIntent and Invoice when available.
- Validate that the remote transaction belongs to the Commerce order.
- Create or update the corresponding
commerce_paymententity. - Allow pending orders to be synchronized and marked as paid when the payment was successfully completed in Stripe.
Note
This feature requires the Checkout Session ID to be stored on the order.
By default, commerce_stripe_checkout does not persist checkout_session_id in order data, so the payment cannot be recovered later through the Stripe API.
For that reason, this feature depends on the patch from:
https://www.drupal.org/project/commerce_stripe_checkout/issues/3436233
Issue fork commerce_payment_synchronization-3580945
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bryan toapanta commentedComment #5
omarlopesinoIt is good for me . There are static analysis errors that will be fixed in future releases, I didn't want to review them know because there is a mix of the new and old errors. It will be ready in 1.0.6