slince / shopify-api-php

:rocket: Shopify API Client for PHP
MIT License
128 stars 47 forks source link

Documentation for using webhooks? #105

Open nhtahoe opened 2 years ago

nhtahoe commented 2 years ago

Greate package, saving me a ton of time!

Question: I see webhooks mentioned several places, but no information about how to use this package to manage them.

Eg. in the config, I see

    'route_names'       => [
        'webhook'              => env('SHOPIFY_ROUTE_NAME_WEBHOOK', 'webhook'),
        ...

and

    /*
    |--------------------------------------------------------------------------
    | Shopify Webhooks
    |--------------------------------------------------------------------------
    |
    | This option is for defining webhooks.
    | Key is for the Shopify webhook event
    | Value is for the endpoint to call
    |
    */

    'webhooks' => [
        /*
            [
                'topic' => env('SHOPIFY_WEBHOOK_1_TOPIC', 'orders/create'),
                'address' => env('SHOPIFY_WEBHOOK_1_ADDRESS', 'https://some-app.com/webhook/orders-create')
            ],
            ...
        */
    ],

But how do I use these? For instance to set up a webhook endpoint for my app that listens for Order payment and extracts the information from that hook.

slince commented 2 years ago

You can us webhook service like others. Events/WebhookManager