#grand27-ReactJS

1 messages · Page 1 of 1 (latest)

olive cedar
#

Thanks for providing code in such a nice format. Can you elaborate on what is not working for you?

#

I see you have setup the cancel_url and prepared Cancel.js. Do you see any error

noble warren
#

hey!

#

so basically no errors

#

but i dont want to allow to anybody directly access to /canceled

#

thats why I've tried to do with sessionid, but that seems not to work with canceled payments

#

so what i mean the user not allowed to go directly to canceled, just if the payment was really canceled

#

this is what i mean

#

@olive cedar

boreal kestrel
#

I don't think you can prevent that really, it's just something you have to take into account

#

there might be some options like setting a cookie before redirecting to Checkout and then checking for it on the cancelled page, but it's really out of scope of Stripe and is more about your own site.

noble warren
#

@boreal kestrel so basically i can just return to /?

#

or this is a very lazy solution?

#

oh and i found something:

#

this errors comes if i put wrong session id in success url

boreal kestrel
#

you can return to / if that makes sense for your application

#

might be confusing for the user!

#

really this is all up to you

noble warren
#

you know i just dont understand why Stripe not generating any session id for canceled session

#

why just for success?

#

in the future would be a great feature

#

and of course saving a lot of time

boreal kestrel
#

it should though, you control that

#

the only reason there's a session ID in the URL for success is that it has the magic string {CHECKOUT_SESSION_ID} in it

#

you can simply do the same thing for the cancel URL

noble warren
#

i mean give an id for canceled session

#

like for success

#

wait

#

so {CHECKOUT_SESSION_ID} would work with canceled too?

#

😮

#

so to prevent invalid session_ids i'm going to save them in my database

#

thanks for your help @boreal kestrel !