Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

When is the cancel_url called by Stripe?

When calling the checkout session creation :

\Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
$checkout_session = \Stripe\Checkout\Session::create([
                                                       'line_items' => [
                                                                         [
                                                                           'price_data' => [
                                                                                    'currency' => $currency,
                                                                                    'product_data' => [
                                                                                        'name' => token_symbol() . ' Token',
                                                                                    ],
                                                                                    'unit_amount_decimal' => ($trnx_amount / $token)*100
                                                                            ],
                                                                            'quantity' => $token
                                                                         ]
                                                                      ],
                                                                      'mode' => 'payment',
                                                                      'success_url' => route('payment.stripe.success'),
                                                                      'cancel_url' => route('stripe.cancel')
                                                    ]);

The Stripe payment form does not have a cancel button even after clicking the "Pay" button. So what is the circumstance where the cancel_url is called ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You customer will be directed to cancel_url when they click the back button on the Checkout page. Read the API reference for more details.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading