WeChat.ServerMessage.EventHelper (wechat v0.9.0) View Source

微信推送消息处理

API Docs

Link to this section Summary

Link to this section Types

Specs

data_type() :: :plaqin_text | :encrypted_xml | :encrypted_json

Specs

encrypt_content() :: String.t()

Specs

json() :: map()

Specs

json_string() :: String.t()

Specs

nonce() :: String.t()

Specs

signature() :: String.t()

Specs

status() :: Plug.Conn.status()

Specs

xml() :: map()

Specs

xml_string() :: String.t()

Link to this section Functions

Link to this function

check_msg_signature?(encrypt_content, params, token)

View Source

Specs

check_msg_signature?(encrypt_content(), params(), WeChat.token()) :: boolean()
Link to this function

check_signature?(params, token)

View Source

Specs

check_signature?(params(), WeChat.token()) :: boolean()

验证消息的确来自微信服务器

Link to this function

decrypt_json_msg(encrypt_content, params, client)

View Source

Specs

decrypt_json_msg(encrypt_content(), params(), WeChat.client()) ::
  {:ok, :encrypted, json_string()} | {:error, String.t()}
Link to this function

decrypt_json_msg(encrypt_content, params, appid, token, aes_key)

View Source

Specs

decrypt_json_msg(
  encrypt_content(),
  params(),
  WeChat.appid(),
  WeChat.token(),
  WeChat.ServerMessage.Encryptor.aes_key()
) :: {:ok, :encrypted, json_string()} | {:error, String.t()}
Link to this function

decrypt_xml_msg(encrypt_content, params, client)

View Source

Specs

decrypt_xml_msg(encrypt_content(), params(), WeChat.client()) ::
  {:ok, :encrypted, xml_string()} | {:error, String.t()}
Link to this function

decrypt_xml_msg(encrypt_content, params, appid, token, aes_key)

View Source

Specs

decrypt_xml_msg(
  encrypt_content(),
  params(),
  WeChat.appid(),
  WeChat.token(),
  WeChat.ServerMessage.Encryptor.aes_key()
) :: {:ok, :encrypted, xml_string()} | {:error, String.t()}
Link to this function

encrypt_xml_msg(xml_string, timestamp, client)

View Source

Specs

encrypt_xml_msg(xml_string(), timestamp(), WeChat.client()) :: String.t()
Link to this function

encrypt_xml_msg(xml_string, timestamp, appid, token, aes_key)

View Source

Specs

encrypt_xml_msg(
  xml_string(),
  timestamp(),
  WeChat.appid(),
  WeChat.token(),
  WeChat.ServerMessage.Encryptor.aes_key()
) :: String.t()
Link to this function

handle_component_event(message, client)

View Source

处理第三方平台推送通知

Link to this function

parse_json_event(params, body, client)

View Source

Specs

parse_json_event(params(), body :: String.t(), WeChat.client()) ::
  {:ok, data_type(), json()} | {:error, String.t()}
Link to this function

parse_work_xml_event(params, body, client, agent)

View Source

Specs

parse_work_xml_event(
  params(),
  body :: String.t() | map(),
  WeChat.client(),
  WeChat.Work.Agent.t()
) :: {:ok, data_type(), xml()} | {:error, String.t()}

parse xml format event message for work

Link to this function

parse_xml_event(params, body, client)

View Source

Specs

parse_xml_event(params(), body :: String.t() | map(), WeChat.client()) ::
  {:ok, data_type(), xml()} | {:error, String.t()}

parse xml format event message for official_account