go back to the shop and maybe choose another gateway.
cancel his payment
As I write these words the behaviour of the cancel_url is the one describe bellow.
Technically it is done by this line of code
In fact this status normally corresponds to a payment in the "new" state, but since this line of code is reached only during the second capture call, it then corresponds to the return of the client using the URL cancel_url (Only if $token->getAfterUrl() is a capture url).
A better solution could be to add something to the cancel_url and detect it, to change the PaymentIntent to the more appropriate status : canceled (PaymentIntent::STATUS_CANCELED).
But I'm not really fan of this technique as the URL of the host could be restricted to the base Payum URL pattern like: /capture.php?token_hash= or an other restriction could be in place to disallow adding something to the capture URL.
Payum has also the possibility to call a dedicated cancel url but this URL is not available in all Payum projects (ex: Sylius never activate this route payum_cancel_do).
So right now I did not found better solution to handle it...
Cancel url means the customer wants to :
As I write these words the behaviour of the
cancel_url
is the one describe bellow. Technically it is done by this line of code In fact this status normally corresponds to a payment in the "new" state, but since this line of code is reached only during the secondcapture
call, it then corresponds to the return of the client using the URLcancel_url
(Only if$token->getAfterUrl()
is a capture url).A better solution could be to add something to the
cancel_url
and detect it, to change thePaymentIntent
to the more appropriatestatus
:canceled
(PaymentIntent::STATUS_CANCELED
). But I'm not really fan of this technique as the URL of the host could be restricted to the base Payum URL pattern like:/capture.php?token_hash=
or an other restriction could be in place to disallow adding something to the capture URL. Payum has also the possibility to call a dedicated cancel url but this URL is not available in all Payum projects (ex: Sylius never activate this routepayum_cancel_do
). So right now I did not found better solution to handle it...