#Mike.7189-cancel
1 messages · Page 1 of 1 (latest)
@bleak socket it's up to you, the only reason the success URL might have a session ID is in our examples we put the magic {CHECKOUT_SESSION_ID} string in it(it's not built in or inherent to the success URL, it's just how the examples do it), you can add that to the cancel URL as well if you wish
yes, but can I still retrieve session? What will I have in the cancelled session object?
is there any point to do so?
or can I write something like:
you've cancelled your order
And that would be it?
sure, you retrieve it the same way as the success page(everything at https://stripe.com/docs/payments/checkout/custom-success-page applies). You'd have a CheckoutSession object where payment_status is not paid)
that's one option, or maybe redirect them to the shopping cart on your site, or whatever makes sense for you
ikr, I did do stuff with /success?session_id='foo'
no shopping cart implemented there hehe.
So back where they were. $router.go(-2) or something
so session object is empty if order were cancelled and wouldn't serve any purpose?
hmm no, it wouldn't be 'empty', the object is still there
you don't have to do anything with it if you don't want to
I'd highly suggest just taking some time to test things out to get a feel for it
the cancel URL is visited when you hit the button in the top left of the Checkout page
yeah i know
here's my placeholder for that 🙂
I thought that cancelled session object would have some link for like uncancel and continue the session or anything else that can be used
or maybe like read more about stripe if the session were cancelled simply because they don't know what's stripe and therefore don't find it trustworthy
Excellent idea! how long does the session last? Before it expires.