I created the localhost alias webhook on the stripe dashboard, in my command promt i ran the listener fro Stripe CLI
C:\MAMP\htdocs\bla> stripe listen --load-from-webhooks-api --forward-to https://bla.dev.com --skip-verify
> Ready! You are using Stripe API Version [2022-08-01]. Your webhook signing secret is whsec_XXXXXXXXXXXXXXXXXXXXXXXX55 (^C to quit)
when i test the payments i get this in my command prompt
2022-12-14 15:16:25 --> checkout.session.completed [evt_1MEpCWDT9pjYXXXXX]
2022-12-14 15:16:25 <-- [200] POST https://bla.dev.com/frontend/web/payment/stripe/endpoint/ [evt_3MEpCKDT9pjYPnbXXXX]
2022-12-14 15:16:25 --> charge.succeeded [evt_3MEpCKDT9pjYXXXXXX]
2022-12-14 15:16:26 <-- [200] POST https://bla.dev.com/frontend/web/payment/stripe/checkout/endpoint/ [evt_1MEpCWDT9pXXXXX]
but when i check my stripe dashboard, it shows this error
Connection to remote host denied (please contact support at https://support.stripe.com/contact/)
The url https://bla.dev.com/frontend/web/payment/stripe/endpoint/
is valid Alias, when i type it into browser i get a 405
error, because it only allows POST
Any idea how to fix this? it worked before, not sure what broke.
CodePudding user response:
Forwarding the events in CLI to Webhook URL and setting Webhook URL in Dashboard are two different locations to Stripe and the event will be sent to both.
- Forwarding the event from CLI goes through: Stripe -> local -> Your webhook URL
- Setting Webhook URL in Dashboard has events goes through: Stripe -> Your webhook URL
With Connection to remote host denied
, it's likely that your Webhook URL is not publicly accessible. Common reason can be that the domain is not accessible from external and only works in your location machine.