Closed dragosprotung closed 9 months ago
Thank you very much @dragosprotung, I was expecting Stripe standardize this part one day because the subscription and setup intent are acting the same way. Are you able to start a PR about it ? If not I will create it as soon as possible.
The way to handle it can be to check for the object name contains in the $model['object']
and directly expire the session if the object found is a checkout session.
To keep backward compatibility we can :
FluxSE\PayumStripe\Action\StripeCheckoutSession\CancelAction
to LegacyCancelAction
supports
method saying if ($model->offsetExists('object') && $model->offsetGet('object') === \Stripe\PaymentIntent::OBJECT_NAME)
LegacyCancelAction
to CancelAction
and change the support
condition to : if ($model->offsetExists('object') && $model->offsetGet('object') === \Stripe\Checkout\Session::OBJECT_NAME)
@dragosprotung are you able to review the PR or test it ?
@Prometee you were fast :) I tested the PR in my environment and it looks good. :+1:
I was an easy one this time :D
Since Stripe version
2022-08-01
cancelling a payment ($gateway->execute(new Cancel($cancelToken))
) is no longer working.See https://stripe.com/docs/upgrades#2022-08-01 for changelog. The change affecting the cancel action:
\FluxSE\PayumStripe\Action\StripeCheckoutSession\CancelAction
and\FluxSE\PayumStripe\Action\CancelAction
check for thecapture_method
and rely on thePaymentIntent
that is never created.