solidusio / solidus_stripe

💳 Integrate Solidus with Stripe
https://stripe.com
BSD 3-Clause "New" or "Revised" License
36 stars 61 forks source link

Handle `payment_intent.succeeded` webhook event #179

Closed waiting-for-dev closed 1 year ago

waiting-for-dev commented 1 year ago

We'll get a payment_intent.succeeded webhook event whenever:

We must update the Solidus counterpart for the first scenario by triggering the complete transition from the Solidus payments state machine. However, we need to be resilient because of the other two scenarios and the lack of guarantee that a webhook will only be received once and do nothing if the payment is already completed.

There's one caveat: Stripe allows to partially capture a payment, while Solidus doesn't. For that case, we'll update the Spree::Payment#amount field, and let's consider if we can add a log entry.

Partially replaces #160

waiting-for-dev commented 1 year ago

Leaving out handling partial captures, as that might require more thought. See https://github.com/solidusio/solidus_stripe/issues/221.