How to catch the HTTP POST request sent by a Shopify Webhook

前端 未结 5 620
时光取名叫无心
时光取名叫无心 2021-01-31 05:50

I\'m somewhat of a noob, and not afraid to admit that, I\'m working on this project as a learning experience to get better with php and serverside script/ing handling.

I

5条回答
  •  清酒与你
    2021-01-31 06:20

    Create a public URL at http://example.com/whatever.php, where example.com is your domain name and whatever.php is a PHP file that you can edit.

    Then put this code into whatever.php:

    
    

    Then in the Shopify admin you can create a new webhook and point it at http://example.com/whatever.php, and when you click the 'test webhook' button in the Shopify admin, Shopify will POST to your script above, which should in turn write the body of the webhook to your PHP error log.

提交回复
热议问题