#thekents
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
yes you can update the metadata of a checkout session after being completed
oh sorry my bad!
I was thinking of PaymentIntents there ๐ฆ my bad
you can't update the Checkout Session's metadata but rather the underlying PaymentIntent's metadata
if you tell me what's your use case I might be able to help you figure out the best integration path for your use case
oh sorry, didn't notice your message
well I want it to make so that when checkout session is completed, webhook generates a promotion code for their next purchase
and why do you need to update the Checkout Session metadata?
I would like to know which promotion code was created from which checkout session
Each user would have their own specific code
you can do the opposite in this case, and add the checkout session ID as a metadata to the coupon
That wont show up under Checkout details right?
Only when i go find checkout id under coupon codes right
I would like to have them all in one place
Im thinking of generating that code and then adding it as an extra to an order to Firebase database, I anyway have to update product amount after purchase
you can create the coupon when creating the checkout
and only making it available on the checkout.session.completed event
and on cancelation deleting that created coupon code?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you don't really care because it's inactive
I guess, I just have OCD about having hundreds of useless inactive codes under my coupon ๐
But yes, your option works too
But perhaps i will still go with the firebase database since I have admin panel anyways
So order list would be a nice extra to that ๐
it's really up to you to decide which approach to choose
Yea, thank you still for helping
let me know if you need any more help