- Issue created by @tonytheferg
Maybe we should fall back to
$capture
if$intent->capture_method
is not set.Maybe overly explicit, but I wanted to be safe rather than sorry.
- πΊπΈUnited States TomTech
Hi @tonytheferg !
Thanks for the report.
I was actually working on something similar for this and a few other properties.
A few items to note:
1. Looks like this fix is specific for the Card Element. We'll need a solution for both card element and payment element.
2. This solution does not take into account Stripe's new "automatic_async" value for capture_method.
3. It would be a good idea to have a fallback, in case there is a new capture_method in the future. I'm leaning towards falling back to manual, as that would allow a CSR/Admin to at least attempt to capture in that scenario. (And if it actually already was captured, then no harm, no foul...) The alternative would be to presume automatic, but if it isn't, then there is no easy way to capture.
4. While handling this particular scenario makes sense, there are other alters that can be done to the PaymentIntent that we won't be able to account for in the module. I would say this issue is mostly aimed at areas where
$next_state = $capture ? 'completed' : 'authorization';
is set without checking the related transaction event. This was the only place I found where this happens.It appears to me that the payment element already gets the
$next_state
off the data from the capture method, not strictly from the$capture
variable passed throughcreatePayment()
as is the case with the card element.See: https://git.drupalcode.org/project/commerce_stripe/-/blob/8.x-1.x/src/Pl...
-
tomtech β
committed 253e7b76 on 8.x-1.x authored by
tonytheferg β
Issue #3497195 by tonytheferg, tomtech: Use intent to set payment state...
-
tomtech β
committed 253e7b76 on 8.x-1.x authored by
tonytheferg β
Automatically closed - issue fixed for 2 weeks with no activity.