#parameter666_payment-link-restrictions

1 messages ยท Page 1 of 1 (latest)

nocturne cedarBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1234841894337642507

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

sleek plank
#

Hi, let me help you with this.

#

There's no built in functionality for this, unfortunately. One idea is to check if a non-expired Checkout Session exists with a given product, and prevent a new Checkout Session from being created.

plush hare
#

Ok. So I was thinking that I need to create a product to achieve this.

I can handle some locking on my side but I think the product probably solves it better.

I haven't tested this yet though.

#

Maybe I can set the products "active" value.

sleek plank
#

You can save your own product ID for locking purposes in Checkout Sessions metadata

sage owl
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away soon.

I'd recommend taking a look at using a Payment Link. When creating them you can now specify the number of completed sessions that they're allowed to lead to:
https://docs.stripe.com/api/payment_links/payment_links/create#create_payment_link-restrictions-completed_sessions-limit
I'd suggest setting that to 1 and test if that behaves the way you're hoping.