Checkout API how can a customer cancel after redirected to Checkout

I am building a web app, using Checkout API I create a checkout and redirect user to checkout_page_url

But when the customer is on checkout page which is typically

they do not have option to gave up. I would expect a CANCEL button which redirects to my app.
Back button kills my SPA.

How do you guys handle this problem.


Hi @adilatilgan welcome to the forums!

Unfortunately, you are correct, there is no way to really “cancel” the payment once they’re redirected to the checkout API. They can either hit back, or just close out of the page at that point, but there is no way to be redirected back to your web page without paying.

If you want to create a better flow, I would suggest looking into the Square Payment Form, which allows you to fully have it embedded in your own site, so you can control everything that happens. As for the original request, I will update this to be a feature request since it doesn’t technically exist.