Reputation: 1947
Scenario
I'm trying to use stripe to set up payments on my application, but when i try to setup webhooks it throws an error because its trying to send to a site that technically doesn't exist (because it exists locally).
obviously internally i can provide the domain name but from an external source "mysite.test" doesnt exist.
Is there a way to get the IP address / port for my specific laravel valet site? I tried pinging "mysite.test" and it returned 127.0.0.1 but my guess is that is the valet server not the specific website because im tyring to link to stripe.
The error in question: "Test webhook error: Domain unknown"
Upvotes: 1
Views: 789
Reputation: 783
Stripe now offers a CLI that makes it easy to handle Webhooks in Laravel Valet. There are a few gotchas explained here: https://timleland.com/how-to-use-stripe-cli-with-laravel-valet/
brew install stripe/stripe-cli/stripe
sudo nano /private/etc/hosts
and add a host record for your local site: 127.0.0.1 AddYourSiteHere.test
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
stripe listen –skip-verify –forward-to https://AddYourSiteHere.test/stripe/webhook
STRIPE_WEBHOOK_SECRET
env value matches the output from Stripe CLI from step 5.Upvotes: 1