#abrams_tank.checkout-webhook
1 messages · Page 1 of 1 (latest)
Hi. I am trying to pass the Order ID and get it back from Stripe when the customer completes the purchase successfully. I tried the metadata parameter is the Session object (the root metadata parameter). But I didn't get the Order ID back when I was listening to payment_intent.succeeded. I also tried the client_reference_id of the Session object. I didn't get the Order ID back either when I was listening to payment_intent.succeeded.
So it seems that metadata and client_reference_id are not passed back whenI am listening to payment_intent.succeeded.
But payment_intent.succeeded is the event I should listen to in the webhook, right? It's the event that signifies when the customer completes the purchase successfully and has paid for the purchase, right?
Yep, you're passing metadata when creating the Checkout Session object so those fields exist on that object (not the Payment Intent)
You have 2 options:
- Listen for the
checkout.session.completedevent. - Store the metadata on the Payment Intent when you create the Checkout Session (via
payment_intent_data).
Oh, can I create a payment_intent_data on the fly when I create a Session object by CURL? I am already creating price_data on the fly when I create the Session object. So I can also create a payment_intent_data on the fly like I create the price_data on the fly, when I create the Session object by CURL?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, about the checkout.session.completed event, does this also signify that the customer has successfully paid for the purchase at Stripe's website? Would there be cases where the customer has not successfully paid for the purchase yet, but checkout.session.completed is still triggered?
Nope, that denotes a payment was successful (and payment_intent.succeeded will also be sent simultaneously)
Ok, so both checkout.session.completed and payment_intent.succeeded signify that the customer has successfully completed the purchase and paid for the product. If the customer has not successfully paid for the product, neither checkout.session.completed or payment_intent.succeeded will be sent (I ask this because there are cases in PayPal where the customer completes the checkout but the payment is not successful immediately and PayPal will contact my webserver several days later when the payment is successful, such as e-checks, etc).
Yep, delayed payment methods like that would still trigger checkout.session.completed event
But in those cases you may want to listen for other events: https://stripe.com/docs/api/events/types#event_types-checkout.session.async_payment_succeeded
https://stripe.com/docs/api/events/types#event_types-checkout.session.async_payment_failed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, it seems like payment_intent.succeeded is the event I want to listen to. I only want to receive a notification from Stripe when the product has been successfully paid for. If the payment is delayed, checkout.session.completed is not very useful for me.
Got it!
In that case use the payment_intent_data.metadata parameter when creating the Checkout Session
And it'll be there in your payment_intent.succeeded event payload
Hi. I just tried to create a payment_intent_data on the fly when creating a Session object with a CURL call in .Net 4.0. So everything works for me if I don't include the new payment_intent_data segment when creating the Session object. But when I try to create the Session object and also create the payment_intent_data on the fly, I get "The remote server returned an error: (400) Bad Request." Unfortunately, the Stripe API always gives me the vague "(400) Bad Request" message and doesn't tell me exactly where the problem is.
Can you share the request ID?
I tried adding the following 3 different strings when I create the Session object:
- &payment_intent_data[][metadata][0]=123456
- &payment_intent_data[0][metadata][0]=123456
- &payment_intent_data[][metadata][]=123456
All 3 failed.
How do I share the request ID with you?
Unfortunately, the Stripe API always gives me the vague "(400) Bad Request" message and doesn't tell me exactly where the problem is.
there are full logs at https://dashboard.stripe.com/test/logs that would help
but yeah all your examples are wrong, it would be &payment_intent_data[][metadata][key]=value
Hi, I tried your exact text just now, &payment_intent_data[][metadata][key]=value
It still didn't work
I don't replace [key] with 0, right? I just left it as [key]
i can send you the request ID
I never use curl, I'd use our official library for .NET, so maybe I got it wrong
why aren't you using the library again?
but sure, send the ID please!
This is a long story. I can't get stripe.net.dll to work. I am using an old version of .Net. I am using .Net 4.0 with Visual Studio 2010
But anyways, let me send you the ID. I almost have everything working with CURL, this is the last step
are you sure you want to run a server accepting payments and collecting data from customers on a deprecated stack like that?
@short perch It works fine for PayPal. Everything is working smooth at the moment. I may upgrade later, but not now.
The Request ID is
req_nCnGoQ8J5h1aZw