#tounka

1 messages · Page 1 of 1 (latest)

dapper lanceBOT
azure rune
wheat fractal
#

i was trying to avoid having to make an extra API call. i would need to make this call every time i receive the checkout.session.completed event

#

do you not recommend passing the price_id as metadata?

azure rune
#

Setting price_id as metadata is fine

wheat fractal
#

cool, so the price_id metadata in the event would be the same as if i made the API call?

azure rune
#

Yes!

wheat fractal
#

Also, when creating a new checkout session, let's say i add an internal ID to the metadata. Later a user changes their subscription from monthly to yearly. When i get the customer.subscription.updated event, will the subscription object still have that internalID i originally added in the metadata?

#

since the subscription object is different does the metadata still carry over

azure rune
wheat fractal
#

got you. so setting the price_id as metadata on the subscription object would be a bad idea in this case

azure rune
#

Yup, unless you also update the metadata when changing the subscription

wheat fractal
#

i plan on using the customer portal, so not sure how i would do that

#

on another note, will setting the price_id in the metadata on checkout session creation, have any gotchas like this scenario you just mentioned?

#

i'm assuming not since the checkout.session.completed event is not recurring right and i only receive it once each time a user checks out

azure rune
#

i plan on using the customer portal, so not sure how i would do that
Using won't be possible to update subscription's metadata in such case

#

on another note, will setting the price_id in the metadata on checkout session creation, have any gotchas like this scenario you just mentioned?
if it's one-time payment, i.e. mode: payment, setting price_id in metadata shouldn't be a problem

wheat fractal
#

where do i confirm if its a one-time payment? i'm pretty sure it is. its monthly or yearly subscription

azure rune
wheat fractal
#

my mode is CheckoutSessionModeSubscription

#

could this be a problem?

azure rune
#

Do you use third-party plugin or direct integration with Stripe?

wheat fractal
#

direction integration with stripe

boreal sigil
#

Hi @wheat fractal I'm taking over

#

You should set mode to subscription when creating a checkout session that includes recurring payment prices in the line_items

wheat fractal
#

hey

#

river mentioned "if it's one-time payment, i.e. mode: payment, setting price_id in metadata shouldn't be a problem"

#

my concern is that my mode is CheckoutSessionModeSubscription so will setting price_id as metadata when creating the checkout session cause any problems

boreal sigil
#

No I don't see this as a problem.