#vporto01
1 messages · Page 1 of 1 (latest)
Hello vporto01, we'll be with you shortly! 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.
• https://discord.com/channels/841573134531821608/1163504262232408074, 1 days ago, 51 messages
Can you share more details? There should be an event ID (that looks like "evt_...") in your Dashboard. Can you copy/paste that ID here?
Hi man
[sure
evt_1O2KurLtJnmsejmmJU1bQ4u6
and here's a line from the heroku logs:
2023-10-17T21:35:05.044758+00:00 app[web.1]: [17/Oct/2023 21:35:05] "POST /webhooks HTTP/1.1" 404 179
Thanks, sorry for the delay
So we're trying to reach your endpoint server but that ...herokuapp.com/webhooks URL is returning a 404 when we try to make a POST call to it
Any servers you use for live mode endpoints should be publicly accessible and able to receive POST calls from Stripe
I'm not super familiar with Heroku but for live mode, you'll need to control/own the server you use
No idea, all we know is we're receiving a 404 when we try to reach that URL.
even get requests to that URL return a 404; you can try by navigating to your endpoint URL in your browser
same
url not found
I deployed it to heroku just for the porpouse of testing it with my client
I'm starting to think heroku is the problem
are you a dev?
I am
will it be helpful if I share some python/django codes with you? maybe you find something I'm doing wrong
I don't think that will be relevant.
Is what done?
Just to recap, the fact that this is hosted on heroku shouldn't necessarily be a factor here. As long as the URL/endpoint you're using can be accessed publicly and can accept POST requests, using a heroku-hosted server should be fine.
This ticket
Ok
I’m struggling on this
I’ve read the documentation and I can’t find a solution for that
my django web app has a sub-app called payments, so just to make sure I created another url and another endpoint that points to ...herokuapp.com/payments/webhooks
both got error.. /payments/webhooks gets 500 and /webhooks gets 404
Hello! I'm taking over and catching up...
doesnt make sense since it works on my localhost (when I type .\stripe.exe listen --forward-to 127.0.0.1:8000/webhooks
It sounds like you need to figure out why these URLs aren't working after being deployed. Can you try using curl -v to hit the URLs and see the raw response you get back? Can you check the logs on your server for more information, especially in the case of the 500?
The Heroku URL where you've having issues.
No sense testing the localhost URL if that's working.
- Trying 18.208.60.216:443...
- Connected to om-quant-betting-6ead114c71cf.herokuapp.com (18.208.60.216) port 443 (#0)
- schannel: disabled automatic use of client certificate
- ALPN: offers http/1.1
- ALPN: server did not agree on a protocol. Uses default.
- using HTTP/1.x
GET /webhooks HTTP/1.1
Host: om-quant-betting-6ead114c71cf.herokuapp.com
User-Agent: curl/8.0.1
Accept: /
< HTTP/1.1 404 Not Found
< Report-To: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1697582040&sid=1b10b0ff-8a76-4548-befa-353fc6c6c045&s=OjG7tugKp5yfbjzTp9fF9yW2fTWxZ2ia2lwyPj8Ho1k%3D"}]}
< Reporting-Endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1697582040&sid=1b10b0ff-8a76-4548-befa-353fc6c6c045&s=OjG7tugKp5yfbjzTp9fF9yW2fTWxZ2ia2lwyPj8Ho1k%3D
< Nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}
< Connection: keep-alive
< Date: Tue, 17 Oct 2023 22:34:00 GMT
< Server: WSGIServer/0.2 CPython/3.11.5
< Content-Type: text/html; charset=utf-8
< Vary: origin
< X-Frame-Options: DENY
< Content-Length: 179
< X-Content-Type-Options: nosniff
< Referrer-Policy: same-origin
< Cross-Origin-Opener-Policy: same-origin
< Via: 1.1 vegur
<
<!doctype html>
<html lang="en">
<head>
<title>Not Found</title>
</head>
<body>
<h1>Not Found</h1><p>The requested resource was not found on this server.</p>
</body>
</html>
- Connection #0 to host om-quant-betting-6ead114c71cf.herokuapp.com left intact
that was on /webhooks
now /payments/webhooks
The 404 indicates the URL you're trying to reach doesn't exist. The 500 indicates an internal server error, and you should see details about that in your server logs.
Can you add logging to your code so you know how far it gets before it fails?
now even in my localhost its returning 404
Any idea why that might be? Is the server running? Did you restart the server process after making changes to your code?
Sure.
I think i found the error
look at this log:
line 78, in stripe_webhook
sig_header = request.META['HTTPS_STRIPE_SIGNATURE']
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'HTTPS_STRIPE_SIGNATURE'
when I switched it to HTTP, it worked!
I'll git push it and see if it works, and I text you back
2023-10-17T23:23:13.306990+00:00 app[web.1]: No signatures found matching the expected signature for payload
2023-10-17T23:23:13.307177+00:00 app[web.1]: Bad Request: /webhooks
2023-10-17T23:23:13.307365+00:00 app[web.1]: [17/Oct/2023 23:23:13] "POST /webhooks HTTP/1.1" 400 0
got different log
and not got 400, not 404
Ah, okay, so something is wrong with your signature validation.
Most likely you're either using the wrong Webhook Signing Secret, or you're not passing the raw body to the Event creation function.
I'm passing request.body, not the raw body..
Ah, that'll do it. You must pass the raw, unaltered, unparsed body.
I saw a post on stackoverflow that a user fixed it by using utf-8 decode
Maybe that’s the issue, I’ll try it
Are you using Node on your backend?
Django
Ah, okay.
got same error, No signatures found matching the expected signature for payload
so it must be the webhook signing secret
Are you using the one from the Stripe Dashboard?
Thanks a lot!