DrewM\MailChimp\Webhook::receive PHP Method

receive() public static method

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.
return array | false An associative array containing the details of the received webhook
    public static function receive($input = null)
    {
        if (is_null($input)) {
            if (self::$receivedWebhook !== null) {
                $input = self::$receivedWebhook;
            } else {
                $input = file_get_contents("php://input");
            }
        }
        if (!is_null($input) && $input != '') {
            return self::processWebhook($input);
        }
        return false;
    }