#one-love_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1216621557749776404
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- one-love_code, 2 days ago, 22 messages
- one-love_best-practices, 4 days ago, 5 messages
- one-love_unexpected, 5 days ago, 24 messages
- one-love_api, 5 days ago, 16 messages
https://dashboard.stripe.com/test/events/evt_1Ot1KVIIYLWrOwdxHavqco04 I don't see any error here
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
With the sample code what should I be seeing in the response? When I click on the Webhook tab and click on the webhook url - to the right there is a response that states.
HTTP status code
200 (OK)
โ ๏ธ Webhook error while validating signature.
What does that mean?
Isn't correct validation of the signature important?
It states this error on all of my attempts.
I'm assuming the 200(ok) is coming from the last line of the sample code, but the error, I have no idea.
"When I click on the Webhook tab and click on the webhook url" Which page do you refer to here?
The link you sent is a checkout.session.complete event. I've been sending payment_intent.succeeded events when I see the error.
The page I am referring to is in the Developers section of dashboard. Which shows my webhook url in big bold type. If I click on that it shows different requests. The requests show the error I've mentioned.
Alright, can you share the exact event id you are seeing there?
There are only payment_intent.succeeded events there
Yes but you provided evt_1Ot1KVIIYLWrOwdxHavqco04 which isn't there
Sorry. I'll look again.
No worries. Anyway evt_1Ot1KVIIYLWrOwdxHavqco04 is a checkout.session.completed which is not handled by your webhook endpoint. Your webhook endpoint only listen to payment_intent.succeeded
evt_3Ot1KTIIYLWrOwdx1F7s2Yhk
there is the correct evt. What is the best event I should listen for - to confirm a one time payment?
Alright this one is a payment_intent.succeeded LGTM
If you are using Checkout, then checkout.session.completed is correct
I'll change my event listener to checkout.session.complete. Shouldn't payment_intent.suceeded work also?
Yes it should, but it will also be sent for transactions not via Checkout
You don't see a problem. Should I delete my old webhook url with payment intent event - and create a new one with checkout.session.complete?
Can you just update the endpoint to include the new event type?
I don't see a section to update. I deleted and recreated it. Just testing it now. I'll send you the evt
I received the same error using checkout.session.completed. The evt is evt_1Ot2CFIIYLWrOwdxyEGRVlCt
Okie I see it returns 200 which is fine to Stripe. Your server somehow also outputted Webhook error while validating signature.
Did your code output that somewhere?
I didn't code that message.
Can you share your code>?
how do I do that? Just cut and paste it? Isn't there a character limit?
Yeah checking
Alright looks good though. Can you add some debug here to see where did it go?
ie. after $event = \Stripe\Webhook::constructEvent to see how $event looks like
Also when this is checkout.session.completed, then $event->data->object won't likely be a PaymentIntent anymore
What do you mean? You should make sure your code runs well in Test environment first
I figured that, but that wouldn't cause the error. I'll comment it out, and try again. $paymentIntent is only the variable name.
$event->data->object doesn't change does it?
Do you see anything else wrong with this sample code.
Will it connect to my localhost? Do I have to change any settings for it to connect to localhost?
My site is in test mode.
Are you there?
Yes but sorry the last few sentences didn't make sense. I would say you want to test this code on your localhost first, and use the forward command on Stripe CLI to test it before deploying to a server
But sure it's up to you to test directly in the server, it would just be difficult in compare to testing in local
Just add some log
I'm new to CLI and the forward command. Are there instructions for testing locally?
I was using friendly-url settings in my htaccess file. It may be working now. Can you check this evt_3Ot2m9IIYLWrOwdx0rw2SuJZ
It looks like succeded after a few retries
I think it's working. I'm having problems finding syntax examples for getting the returned values from the payment intent. Is there documentation showing the syntax? Is this XML?
It's in JSON ๐
Here you go https://docs.stripe.com/api/payment_intents/object for PaymentIntent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.