#nikivi
1 messages · Page 1 of 1 (latest)
for example I wanted to run this on userCreate
No the urls expire after 24 hours without payment
ok i see, thank you
Sounds like payment links would be better for you: https://stripe.com/payments/payment-links
As you get a permanent link
they work on subscriptions too
with metadata passing?
You can use Payment Links to sell a product or service, start a subscription
ok seems to be perfect indeed
or actually
this doesn't make sense
how can metadata be passed
with perma link
try {
const normalSubscription = await stripe.checkout.sessions.create({
success_url: process.env.STRIPE_SUCCESS_URL!,
mode: "subscription",
metadata: {
userDetailsId: userDetailsId,
},
line_items: [
{
quantity: 1,
price: process.env.STRIPE_10_SUBSCRIPTION!,
},
],
})
userDetailsId is unique to user trying to pay
If you need metadata then just use checkout
payment links are more convenient for no-code users
so stripe.checkout.sessions.create
but don't have as much functionality