@param $payload

@return \Kerox\Messenger\Event\DeliveryEvent
438009
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $delivery = Delivery::create($payload['delivery']);

        return new static($senderId, $recipientId, $delivery);
    }
972868
public function queue($eventName, $payload = array())
    {
        $me = $this;

        $this->subscribe($eventName . self::QUEUE_NAME, function () use ($me, $eventName, $payload) {
            return $me->dispatch($eventName, $payload);
        });
    }
921627
public static function createMessageReadEvent(array $payload)
    {
        $read = Read::create($payload['read']);
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];

        return new MessageReadEvent($senderId, $recipientId, $timestamp, $read);
    }
462422
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $passThreadControl = PassThreadControl::create($payload['pass_thread_control']);

        return new static($senderId, $recipientId, $timestamp, $passThreadControl);
    }
3992
public static function createMessageEchoEvent(array $payload)
    {
        $message = MessageEcho::create($payload['message']);
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];

        return new MessageEchoEvent($senderId, $recipientId, $timestamp, $message);
    }
264022
public static function createReferralEvent(array $payload)
    {
        $referral = Referral::create($payload['referral']);
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];

        return new ReferralEvent($senderId, $recipientId, $timestamp, $referral);
    }
812677
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $accountLinking = AccountLinking::create($payload['account_linking']);

        return new static($senderId, $recipientId, $timestamp, $accountLinking);
    }
341079
function post($payload)
    {
        $this->requestDecorator->setPayload($payload);
        $result = $this->client->post($this->requestDecorator->makeResource(), $this->requestDecorator->makePayload(), $this->requestDecorator->makeHeaders());
        $this->refresh();
        return $result;
    }
994908
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $payment = Payment::create($payload['payment']);

        return new static($senderId, $recipientId, $timestamp, $payment);
    }
191572
public function handle($payload = null)
    {
        if ($decrypted = $this->app['request']->get('echostr')) {
            $str = $this->app['encryptor_corp']->decrypt(
                $decrypted,
                $this->app['request']->get('msg_signature'),
                $this->app['request']->get('nonce'),
                $this->app['request']->get('timestamp')
            );

            return new FinallyResult($str);
        }
        //把SuiteTicket缓存起来
        if (!empty($payload['SuiteTicket'])) {
            $this->app['suite_ticket']->setTicket($payload['SuiteTicket']);
        }
    }
1066647
public function setPayload(string $payload): self
    {
        $this->checkContentType();
        $this->isValidString($payload, 1000);

        $this->payload = $payload;

        return $this;
    }
386159
private function performPostRequest($payload)
	{
	    $payload[] = ['type' => $this->apiXType, 'routing' => $this->apiXRoute, 'token' => $this->apiXToken];
		$this->response = $this->client->request('POST', [
            'query' => $payload
        ]);
	}
814371
public function withPayload($payload): self
    {
        $payload = \is_string($payload) ? $payload : $this->jsonConverter->encode($payload);
        if (false === \mb_detect_encoding($payload, 'UTF-8', true)) {
            throw new \InvalidArgumentException('The payload must be encoded in UTF-8');
        }
        $clone = clone $this;
        $clone->payload = $payload;

        return $clone;
    }
48093
public function recreate($payload, $queue = null, $delay)
    {
        $options = array('delay' => $this->getSeconds($delay));

        return $this->pushRaw($payload, $queue, $options);
    }
820529
public function serialize($payload)
    {
        $serialized = '';
        foreach ($payload as $line) {
            $serialized .= '"' . implode('","', $line) . '"' . "\n";
        }
        return $serialized;
    }
1358418
public function serviceDiscoveryEvent(array $payload)
    {
        $this->producer = $this->eventProducer->setTargetServiceName('serviceDiscovery');

        $this->send('serviceDiscovery', $payload);

        return $this;
    }
1324659
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $message = Message::create($payload['message']);

        return new static($senderId, $recipientId, $timestamp, $message);
    }