#Dupelet-checkout
1 messages ยท Page 1 of 1 (latest)
No rush! More info:
The issue started when I started using the function price.putExtraParam(metadataKey, metadataValue);
in my PriceData builder
What are you trying to set the metadata for? I don't think we allow you to set price_data.metadata for Checkout Session line items
I'm basically attaching some product-specific info that I need for the webhook to complete the post-purchase sequence later
How does the PriceData.builder().putExtraParam() function work, then? Am I using it incorrectly?
Busy day/night, huh. I can see several threads in progress ๐
Are you okay with setting metadata on the Product instead of the price? Again, Checkout doesn't allow you to set metadata for the Price, but we do allow you to set it on the product instead
I'm fine if it supports my use case. E.g. right now, I create a checkout session containing 2 instances of the same product. Can I have different metadata for each product?
Basically, a customer checks out
- TShirt, 'metadata MsgOnShirt1'
- TShirt, 'metadata MsgOnShirt2'
Let me back up and clarify - right now the Checkout API doesn't support line_items.price_data.metadata so the only option is to look into workarounds. Some of the one I can think of are:
- Put this information in the Checkout Session metadata instead of on the price
- Not use an existing Product and leverage all the option sin
line_items.price_data.product_datato set things like metadata or description on a newly created Product (but this option wouldn't allow you to use the same product for both of your line items)
I was using the first option previously. I ran into issues when multiple instances of the same product resulted in overwriting the same key to the metadata map, so I would only have the last instance of the metadata available
The 2nd one would work, but that would basically make me unable to view TShirt purchases from the Stripe dashboard, correct?
As both the price and product would be generated dynamically, so no way to group them in the dashboard
That's correct
๐ข
Thanks for your help
Sorry there isn't a better solution ๐ฆ