Is it possible to set localhost as a Stripe webhook URL?

后端 未结 9 1895
故里飘歌
故里飘歌 2021-02-12 03:36

I am creating a payment gateway using Stripe.

I want to set my localhost url localhost/stripe/webhook.php as my webhook url. Is it possible to set a localho

9条回答
  •  隐瞒了意图╮
    2021-02-12 04:15

    You can use expose.sh to expose your server using a public HTTPS URL.

    Install expose.sh

    For Mac or Linux, go to Expose.sh and copy/paste the installation code shown into a terminal.

    For Windows go to Expose.sh, download the binary and put it somewhere in your PATH.

    Expose your api to the web

    Start your API server. Then run expose where port is the port your API server is running on, like 80 or 8080.

    Expose.sh will generate a random public expose.sh URL. You'll see output like

    https://s3rh.expose.sh is forwarding to localhost:80
    http://s3rh.expose.sh is forwarding to localhost:80
    

    Then you can get Stripe to use the public HTTPS URL, which will forward to localhost. I've written a full guide here

    Disclaimer: I built expose.sh

提交回复
热议问题