#Dupelet-checkout

1 messages ยท Page 1 of 1 (latest)

burnt dagger
#

Hello! Give me a few minutes and I can take a look

midnight sable
#

No rush! More info:
The issue started when I started using the function price.putExtraParam(metadataKey, metadataValue);
in my PriceData builder

burnt dagger
#

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

midnight sable
#

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 ๐Ÿ˜›

burnt dagger
#

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

midnight sable
#

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

  1. TShirt, 'metadata MsgOnShirt1'
  2. TShirt, 'metadata MsgOnShirt2'
burnt dagger
#

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_data to 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)
midnight sable
#

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

burnt dagger
#

That's correct

midnight sable
#

๐Ÿ˜ข
Thanks for your help

burnt dagger
#

Sorry there isn't a better solution ๐Ÿ˜ฆ