#arrow-pricingtable-product

1 messages ยท Page 1 of 1 (latest)

gritty ferry
static citrus
#

@gritty ferry Thank you for the quick response but this is for custom retrival I am using webhook ... so when checkout session success event is fire i get response and it does not show meta data for the product bought I don't know how to know for which product the complete session event is for. The document you shared is for retriving the session info and I am not doing that I am using webhook

gritty ferry
#

Sure but what you want to do is impossible. So you need to do what I said instead. When you get the Event on your webhook endpoint, retrieve the Session and get the line_items at the same time and other related data like the Price and the Product. Use the Expand feature I mentioned: https://stripe.com/docs/expand

static citrus
#

cool thx

#

hello sorry to ping you again it's not that metadata key is not present in the response but it's empty for expand does it come empty ?

#

@gritty ferry

arctic spoke
#

Hi there ๐Ÿ‘‹ taking over for @gritty ferry as they had to step away

Give me a couple minutes to get caught up.

#

What are you wanting to do with metadata? That field is used to set arbitrary key/value pairs on different Stripe objects and has nothing to do with Product or Price

gritty ferry
#

just to clarify: you said you put the metadata on the **Product so you have to look on the Product object, not the Checkout Session's metadata

static citrus
#

yes

#

meta is product not checkout session I don't have control over checkout bcz i am using price table

arctic spoke
#

You'll want to expand line_items.data.price.product to get metadata from the Product then.

static citrus
#

I have no information about for which product a user paid for in the current session success event reponse ... I am using price table feature no custom implemenation of anything

arctic spoke
#

You'll want to expand line_items.data.price.product to get metadata from the Product then.
Can you try expanding the Product object and looking there?

static citrus
#

line_items.data is array will it be alway 1 element in array ?

#

even in there meatadata is empty

#

my product does have metadata

#

@arctic spoke

#

also everything is in test mode if needed I can share eventID

arctic spoke
arctic spoke
arctic spoke
static citrus
#

ok I have wrote 0 code for doing any of this. I created 3 products from the dashboard using UI then i created pricing table which contains this 3 products then I created a html file and rendered the price table using the embaded code

Then i created webhook to view the events and know when the payment is completed by user. Then I views the webhook event "checkout.session.completed" and it gave me a response "id": "cs_test_a1jaxsWfcEQW4zK90RFcVbe6BRVsEBiR96tyMchXin7fqGhGJqsxfNFwlv",

this is the ID I don't mind using another event webhook I used this bcz it has custom client ref id so i know which user paid and now I want to know what the used paid for @arctic spoke

arctic spoke
#

Okay, but where/when are you setting metadata? It's not implicit on the object. You have to set it yourself either manually from the Dashboard or via the API in order for anything to populate it

static citrus
#

@arctic spoke

#

@arctic spoke

arctic spoke
#

@static citrus please be patient. The server is busy and I'm juggling a few other threads.

The screenshots you sent did't show Product getting expanded. Can you share (a) the Event ID where you expanded Product and (b) copy/paste the Product ID for me to look at?

static citrus
#

no worries take your time I have shared everything there are 3 screen shorts 1st the lineItem the 2nd with product expand and 3rd which shows metadata is set a dashboard view I am re-replyting in here and I also shared event ID but here it is again

"id": "cs_test_a1jaxsWfcEQW4zK90RFcVbe6BRVsEBiR96tyMchXin7fqGhGJqsxfNFwlv",

and product ID is "prod_MViAugbLD0TmKA" priceID is price_1LmgkGEyoRNqUErOtnRdPzho

static citrus
static citrus
#

@arctic spoke

arctic spoke
#

Right, but Product is not expanded int he 2nd screenshot. It only shows Price object and the ID of the Product

static citrus
#

the second screenshot is output of line_items.data.price and I don't know what you mean by product is not expanded ... I added product is expand as well which give error it can't be expand

#

@arctic spoke

arctic spoke