PHP Класс DrewM\MailChimp\Webhook

How to Set Up Webhooks: http://eepurl.com/bs-j_T
Автор: Drew McLellan ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
receive ( string $input = null ) : array | false Retrieve the incoming webhook request as sent.
subscribe ( string $event, callable $callback ) : void Subscribe to an incoming webhook request. The callback will be invoked when a matching webhook is received.

Приватные методы

Метод Описание
dispatchWebhookEvent ( string $event, array $data ) : void Call any subscribed callbacks for this event
processWebhook ( string $input ) : array | false Process the raw request into a PHP array and dispatch any matching subscription callbacks

Описание методов

receive() публичный статический Метод

Retrieve the incoming webhook request as sent.
public static receive ( string $input = null ) : array | false
$input string An optional raw POST body to use instead of php://input - mainly for unit testing.
Результат array | false An associative array containing the details of the received webhook

subscribe() публичный статический Метод

Subscribe to an incoming webhook request. The callback will be invoked when a matching webhook is received.
public static subscribe ( string $event, callable $callback ) : void
$event string Name of the webhook event, e.g. subscribe, unsubscribe, campaign
$callback callable A callable function to invoke with the data from the received webhook
Результат void