#Velix
1 messages ยท Page 1 of 1 (latest)
Hi,
You can't do that using PaymentLinks, but you can do it using Stripe Checkout Session
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
it's possible to use elements? the new js api?
we're looking this solutions but all online https://stripe.com/docs/payments/save-during-payment#saving-card-without-payment
Yes you can for sure use Elements, which requires more coding. you can refer to this guide:
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
when creating the PaymentIntent you pass the amount that you want to charge the customer without creating a Stripe Price
Oh sorry, I was on the phone.
Stripe Checkout Sessions have a strange expire behaviour ๐ฆ
This guide is for saving a payment method and reuse it later on off session
no worries ๐
Our frontend-guy doesn't want to use Elements ๐ฆ
So you need to use Stripe Checkout
What strange behavior, could you provide more details and see if I can help with ?
The problem is: When the customer closes the stripe checkout session by error, he can click the link we've sent him by mail for 24 hours, then it expires. I know that you can recover those sessions, but the customer needs a new link then.
But this recovered cart lives for 1 months. we want to expire it after 2 weeks.
But you can't let recovered carts expire ๐
The work-around would be to create a new checkout session after the old one expires.
That's more complicated to code, but it seems to be the best way.
Yes, the expiration of a Checkout session is between 30min and 24 hours:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-expires_at
You can set a recovery option so that a recovery URL will be generated to recover this Checkout Session if it expires before a successful transaction is completed. It will be attached to the Checkout Session object upon expiration.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-after_expiration-recovery-enabled
Oh damn. Phone again, I am reappy sorry.
Yeah, 24 hours isn't enough. And I know, the recovery URL... but I can't give the customer a new session URL automatically.
When I give him the recover URL, it lives for 1 month and I cannot cancel it.
So coming back to this one.
Yeah... creating a new session seems to be the easiest one.
Thanks for your time ๐
Np!