#apax3058
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
have you seen this feature before https://stripe.com/docs/payments/checkout/pricing-table
I have seen that, but I need to include subscription_data metadata when creating the subscription, so therefore i chose not to use that one.
Maybe it's possible to add subscription_data when using pricing table?
const session = await stripe.checkout.sessions.create({
mode: "subscription",
locale: "auto",
payment_method_types: ["card"],
line_items: [
{
price: "price_1OWRo7Dit1MkL9lioNAdQCxP",
quantity: 1,
},
{
price: "price_1OWRopDit1MkL9lisSuU2eAt",
quantity: 1,
},
],
subscription_data: {
description: `ID: "${device?.device_id}"`,
metadata: {
supabase_device_id: supabaseDeviceId,
internal_device_id: internalDeviceId,
supabase_user_id: user.id,
},
},
customer: profile.stripe_customer_id,
success_url: successUrl,
cancel_url: cancelUrl,
});
Here's the full snippet of my current code.
I see you're passing the customer Object here
if that's a requirement maybe Pricing Tables aren't the best option here
let me ask you this, is the second price an upsell of the first one?
something like this https://stripe.com/docs/payments/checkout/upsells I mean
Yes, the second price is an upgrade to the first price. Thank you. I'll look into this!
let me know if you need any more help
Thanks ๐