#tounka
1 messages · Page 1 of 1 (latest)
i want to show it on the checkout session completed page
Hi, can you confirm what you mean with 'order number'?
a number that can allow us correlate their transaction in the event they email us they should be able to provide some sort of confirmation number
You would need to handle this on your end. Then, you can pass that confirmation number on the metadata of the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata
so i need to generate my own confirmation numbers?
in the stripe dashboard, how will i correlate the confirmation number with their payment
Let me test one thing real quick on my end
no problem thanks
After your Checkout Session completes successfully, you'd listen to this event: https://stripe.com/docs/api/events/types#event_types-checkout.session.completed. On the event, you'll see the Payment Intent Id. Then, you can update the payment Intent's metadata: https://stripe.com/docs/api/payment_intents/update
why would i want to update the payment Intent's metadata?
will i be able to search up PaymentIntentID in the dashboard?
Yeap
You said you wanted to show the confirmation number in the Dashboard and this the way to achieve what you're looking for
so the PaymentIntentID is not on the checkout.session.completed event?
i want to show the confirmation number on the success page after they checkout
The Payment Intent Id is on the checkout.session.completed event.
its showing null for me
can you share the event id with me?
this is in test mode btw
yeap!
and actually its not an event. after the checkout is completed, i make an api call to stripe to get the checkout out session
You can customize the success URL, https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-success_url page here: https://stripe.com/docs/payments/checkout/custom-success-page and show the confirmation that way. Then after getting, checkout.session.completed event, you can update the Payment Intent's metadata to show that confirmation in the Dashboard.
do you mean update the payment intent id or actually add my own key value pair the payment itent metadata?
Add your key value pair by updating the Payment Intent as documented here: https://stripe.com/docs/api/payment_intents/update#update_payment_intent-metadata
so when i search in the dashboard, it can also find data based on metadata?
Yes!
ahhh makes sense
would it be a bad idea to use invoice_prefix as the confirmation number?
I would not do that.
why not
If you're trying to show it in the success page after your session completion, it would add delays.
locally it seems to be working quickly
on each invoice.paid event, will the invoice_prefix be the same?
on the success page, i make a request to my back-end to get the checkout session object, which in turn gets it from stripe. the doc recommends that
Once set the on the customer, and you do not update it, https://stripe.com/docs/api/customers/update#update_customer-invoice_prefix yes.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
once what is set?
When the customer is created, you'll explicitly set it https://stripe.com/docs/api/customers/create#create_customer-invoice_prefix.
i thought its set automatically after the customer pays
but based on the flow i mentioned, will using invoiceprefix as the confirmation number cause any issues
I was under the the impression you wanted to control that number for some reason so you'd set that on the customer creation. However, if not, and if you're going to be making an explicit request to attaint his information, sure. However, I'd test this in your test environment as well just to confirm it's exactly what you're looking for.
got it. and lastly on each invoice.paid event, will the invoice_prefix be the same?
Actually, can you clarify what you mean with 'i thought its set automatically after the customer pays'? I tested this and it's not the case. I'm talking about, https://stripe.com/docs/api/customers/create#create_customer-invoice_prefix on the customer not the invoice number. Are you referring to the invoice number?
so in test mode after i checkout, i retrieve the checkout session object and the invoice prefix is on the event automatically
I tested this via the API directly..
and you're not seeing an invoice_prefix?
So on this question.. 'lastly on each invoice.paid event, will the invoice_prefix be the same?'What do you mean exactly?
I'm testing it with checkout now
will the invoice_prefix ever change after its been created
No it would not.
I tested it with Checkout and I do not have it. Can you share the event id where you're seeing this?
i don't have access it unfortunately. i closed down everything. but i will test this out again and reach back out if i have any issues