#Sophia Wong
1 messages ยท Page 1 of 1 (latest)
Probably you haven't set up HTTP_STRIPE_SIGNATURE in your server's environment?
How to set that ๐ , in configuration ? set to what? any instructions?
It's a local environment. I'm testing. I use a Nginx server.
Linux then https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/ for example
Oh I know how to set up a env variable. but what's the value I should set it to?
Oh, the signing secret of the webhook endpoint registered in https://dashboard.stripe.com/test/webhooks!
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
If you are looking at the local listeners, it should outputed in the terminal already
For now, I followed instructions in this page: https://dashboard.stripe.com/test/webhooks/create?endpoint_location=local
I copied the sample code. and triggered events, here is the output in termical:
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
What caused a 404 response? I can access http://quiz.test.webhook from a browser. I cannot debug, even the log message I write at the top didn't go to my log file.
When you access quiz.test.webhook on your browser, you actually making a GET request
while Stripe webhook is a POST request
oh my god. I realized the route error.
Oh sorry about HTTP_STRIPE_SIGNATURE, it wasn't the signing secret, it should come automatically from Stripe's request
Hah, that's all right. I think I'm getting closer to success. After resetting the route method to post, now the terminal output 500 response.
Yep now checks your server log
VENDORPATH/stripe/stripe-php/lib/WebhookSignature.php is official library file, I hope nothing wrong with that file ๐
Oh Finally! it was because I rewrite payload variable to Codeigniter helper function. Now it's OK.
Payload is a string not a jsonlike data. ๐ Well๏ผ I'll dig in more with this webhook. Thank you very much !