We'll get a payment_intent.succeeded webhook event whenever:
A payment intent is captured from Stripe's dashboard
A Solidus payment is manually captured from the admin interface (see #158)
TODO: auto-capture is on, and an order is completed through a regular checkout (see #178)
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.
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