#RzSlim
1 messages ยท Page 1 of 1 (latest)
Hello! Do you have a question about that?
yeah one sec, let me add images
I've got 4 identical prices that represent sizes
but i have no clue which price was purchased 0.o
I can see that's test mode, but I'm not sure if that's real info or not (like the address and stuff). This is a public server, so you may want to delete those images if so?
Was this through Stripe Checkout?
You can look at the Checkout Session's line items to see which specific Price was used.
but how do i access that from the dashboard ?
You can look at the request logs in Developer > Logs, but it's easier to retrieve the Checkout Session from the API and expand line_items: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
That's fine, the problem is this is for a client,
she uses the dashboard to see her sales
when people checkout prices are added to the line items, but i get not information concerning the "particular" price that is added as a line item
it's only general infomration concerning the parent product
The only information that belongs to the price "itself" is the Unit amount, but can i not get any other information unique to the price ?
the nickname, or the price id even ?
You can if you scroll down to the Events and logs section and find the original Checkout Session creation at the bottom. That will show the Price IDs used.
ok let me look for that quickly, thanks for your help by the way
No problem. Products in Stripe are designed to represent a thing people buy, and Prices are designed to represent what they pay for that thing. If you have different things (like two sizes of a thing) that should be two separate Products, not two Prices under a single Product.
yeah i realise that now, i was under the impression that prices could be used for product variants
but i realise now that's not a good usage of prices
Ok, i see it in the events logs in the Checkout session completed event
can i add data to this custom fields attribute when the checkout session is created to make it more accessable once the purchase is completed LOL
No, Checkout Sessions can't be modified after they're created like that, and those custom_fields are used to present actual fields on the Checkout page anyway.
However, what you can do is set metadata on the Payment Intent: https://stripe.com/docs/api/payment_intents/update#update_payment_intent-metadata
do those custom fields show up on the invoice ????
You could set a key like size to large for example, and that will show up in the Dashboard.
and can i set them as read-only ?
Metadata can be edited in the Dashboard, if that's what you mean?
Metadata is only visible to you, not the customer.
yeah the meta data doesnt provide any value because i need to add the Price nickname as "Data" when i create the checkout session
because i just need to client to see WHICH prices were actually purchased
because those represent sizes
can i try custom field and you leave this thread open ?
To clarify, you just want your client to be able to easily see what size was purchased in the Stripe Dashboard?
Yeah exactly !
Right, so use metadata.
yeah ?
Yes.
Set it on the Payment Intent when you receive the checkout.session.completed Event.
it'l show up somewhere in th epayment details ?
Yes.
I'm not using webhooks i'm just create the session on the server and sending the Session id back to the client
then i use stripe front end to redirect to checkout
If you're not using webhooks how are you handling fulfillment?
This is how it would show up in the Dashboard:
That's with a key set to size and a value set to large.
Since you're not using webhooks you can set the metadata on the Payment Intent when you create the Checkout Session here: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
ok was gonna say bc setting it on the checkout session doesnt work,
Correct.
Nah, I wish the Checkout Session metadata propigated to the Payment Intent.
I think it would make more intuitive sense if it did that. ๐
lol
alright so payment_intent_data and then metadata im assuming
siiick
you're a lifesaver
let me try that real quick
Yep.
Solid, i'll abuse this little as a reflection of the cart basically
Thank you so much , 5 Star review for you brother
Happy to help!
Cheers!