#MadMac

1 messages · Page 1 of 1 (latest)

heavy boughBOT
spiral mural
#

Payment Links is re-usable, i.e. same link can be paid multiple times and isn't meant for a specific customer, so customer can't be set

daring dock
#

Ok. Is there any way that I can make the checkout session last longer than 24 hours?

spiral mural
#

I'd recommend creating a new Checkout Session if the URL is expired

daring dock
#

What happens for the user if they go to an expired CS?
I guess I can just get the button to send them to one of my pages and create a new session then but that is quite a bit slower.

#

Any way to check if it is expired from the browser JS SDK?

spiral mural
#

What happens for the user if they go to an expired CS?
The payment page will show that the payment link is expired and customer can't be paid on that specific link

daring dock
#

Expecting that > 50% will click within 24hrs

spiral mural
#

Any way to check if it is expired from the browser JS SDK?
I'm afraid it's not possible. There are two possible ways to check if a Checkout Session is expired:

  1. Store expires_at in your own database for a Checkout Session ID to determine if it has been expired
  2. Make a server request to retrieve the Checkout Session to check Checkout Session status: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-status
daring dock
#

Ok thanks for that I will store it in my own database and only create a new one if they click after the expiry.

#

Useful response thanks.