WeChat.ServerMessage.EventHelper (wechat v0.9.0) View Source
微信推送消息处理
API Docs
Link to this section Summary
Functions
验证消息的确来自微信服务器
处理第三方平台推送通知
parse xml format event message for work
parse xml format event message for official_account
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
Specs
check_msg_signature?(encrypt_content(), params(), WeChat.token()) :: boolean()
Specs
check_signature?(params(), WeChat.token()) :: boolean()
验证消息的确来自微信服务器
Specs
decrypt_json_msg(encrypt_content(), params(), WeChat.client()) :: {:ok, :encrypted, json_string()} | {:error, String.t()}
Specs
decrypt_json_msg( encrypt_content(), params(), WeChat.appid(), WeChat.token(), WeChat.ServerMessage.Encryptor.aes_key() ) :: {:ok, :encrypted, json_string()} | {:error, String.t()}
Specs
decrypt_xml_msg(encrypt_content(), params(), WeChat.client()) :: {:ok, :encrypted, xml_string()} | {:error, String.t()}
Specs
decrypt_xml_msg( encrypt_content(), params(), WeChat.appid(), WeChat.token(), WeChat.ServerMessage.Encryptor.aes_key() ) :: {:ok, :encrypted, xml_string()} | {:error, String.t()}
Specs
encrypt_xml_msg(xml_string(), timestamp(), WeChat.client()) :: String.t()
Specs
encrypt_xml_msg( xml_string(), timestamp(), WeChat.appid(), WeChat.token(), WeChat.ServerMessage.Encryptor.aes_key() ) :: String.t()
处理第三方平台推送通知
Specs
parse_json_event(params(), body :: String.t(), WeChat.client()) :: {:ok, data_type(), json()} | {:error, String.t()}
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
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