#Khalil-orders-api
1 messages · Page 1 of 1 (latest)
Do you have an example Orders event that did not fire to your webhook listener?
You can find test-mode events here: https://dashboard.stripe.com/test/events
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes
Also, I am executing payments with orders (not payment intents), so no payment_intent.succeeded and charge.succeeded would be triggered, without an order being paid
My stripe listen --forward-to localhost:3000/stripe-webhooks returns
not sure if that's the correct API version, but I didn't add orders_beta=v4 (and don't know where to add it in case I need to)
can you copy/paste one of the event IDs (looks like this --> evt_abc123) to this thread for me to look at?
Which event id do you want me to copy? order related ones (the ones I am not getting), or payment intent ones (the ones I am getting)
The one you're not getting
evt_1LTXvkLEkeoA9qs7adVZnGJz
Hmmm, I thought it was compatible with the [2020-08-27] version, but I could be wrong. Are you able to upgrade to [2022-08-01] and try again?
I am upgrading my stripe cli version first, maybe it's that
the [2020-08-27] works with everything else orders related, so I doubt it just fails to work with the webhook endpoints
That's fair. I'm just not sure what would be causing the webhook not to be sent
Let me reach out internally and see if anyone has any ideas
You said you weren't getting any Orders events through, correct?
Ah, okay, so it looks like unfortunately stripe listen via Stripe CLI doesn't fully support beta webhook events. I figured (because it has been around for long enough) that it would just work, but I got confirmation from the product team that Orders just hasn't been integrated
ah got it! Thanks for asking!
This is really helpful
What is the best way to test my integration then?
Is there a way I can send test events not from the CLI
You would have to configure a webhook endpoint in test-mode, then create test-mode orders
That will send the same test-mode events that CLI would, it just requires more work
- How do I configure a webhook endpoint in test-mode?
- And what do you mean by creating test-mode orders? I am currently running my stripe app in test mode anyway (I am not in live mode)
You would need a real endpoint URL (e.g. a server that can send and receive HTTP requests), which you would configure here: https://dashboard.stripe.com/test/webhooks
Once configured, you would create Orders the same as you might do in live-mode, just using your test-mode API keys.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Here's a good tutorial for the creating the handler: https://stripe.com/docs/webhooks/quickstart
Not sure if that fully answers your questions though. Does the above orient you in the right direction?
Thanks for sending this over - currently giving it a look
Oh I think I already have most of it!
It's just a matter of configuring the webhook and I have the rest
The orders doc says in 2- Register a new webhook endpoint in the Stripe Dashboard with a beta header orders_beta=v4. (see doc here https://stripe.com/docs/orders/create-and-process?html-or-react=react#order-events), is there a specific way of adding a beta header? The main doc about registering a webhook doesn't mention how to add headers (https://stripe.com/docs/webhooks/go-live)
I think I got an answer to my question
In practice, it seems like it will be hard for me to test this, since I am running the code on my local machine. So I think I'll just try to use payment intent events for now and infer which orders they belong to
Do you have a sense when the stripe cli integration will be available?
Ah, I'm not entirely sure. I can't say unfortunately
Sounds good - thank you for the help!
Appreciate the time you spent helping me, and you saved me a bunch of time
I don't love the answer I gave, but I'm happy I could save you some toil nonetheless!
No worries, I know you're not the one responsible for prioritizing the feature 🙂
Here's the workaround I am using for future reference.
1- I am adding a checkout id as a metadata in my order when I create it (checkout_id is internal to my app, but you could imagine adding the order_id)
2- I am capturing the payment intent events in the webhooks.
3- It appears that the orders propagate the metadata to the payment intents. Here is a display of my payment intent captured from the webhook:
metadata: {
checkout_id: 'c24b5af8-16e2-4bb6-9a11-208e1abc3501',
email: 'khalilhajji91@gmail.com'
},
4- I get the checkout_id, which allows me to get the order corresponding to that checkout id