Esempio n. 1
0
 /**
  * Parse message array from raw php input.
  *
  * @param string|resource $content
  *
  * @throws \EasyWeChat\Core\Exceptions\RuntimeException
  * @throws \EasyWeChat\Encryption\EncryptionException
  *
  * @return Collection
  */
 protected function parseMessageFromRequest($content)
 {
     $content = (string) $content;
     $encryptor = new Encryptor($this->config->get('app_id'), $this->config->get('token'), $this->config->get('aes_key'));
     $message = $encryptor->decryptMsg($this->request->get('msg_signature'), $this->request->get('nonce'), $this->request->get('timestamp'), $content);
     return new Collection($message);
 }
 /**
  * {@inheritdoc}.
  */
 protected function getPreCodeFields($preCode)
 {
     return ['component_appid' => $this->config->get('app_id'), 'pre_auth_code' => $preCode, 'redirect_uri' => $this->redirectUrl];
 }
 public function __construct(Config $config, Ticket $ticket, Cache $cache = null)
 {
     parent::__construct($config->get('app_id'), $config->get('secret'), $cache);
     $this->ticket = $ticket;
 }