WechatPay v0.8.0 WechatPay.Utils.Signature View Source
Module to sign data
Link to this section Summary
Link to this section Functions
Link to this function
sign(data, api_key, arg3) View Source
Generate the signature of data with API key
Example
iex> WechatPay.Utils.Signature.sign(%{...}, "wx9999")
...> "02696FC7E3E19F852A0335F2F007DD3E"
Link to this function
verify(data, api_key, sign_type)
View Source
verify(data, api_key, sign_type)
View Source
verify(map(), String.t(), :md5 | :sha256) ::
:ok | {:error, WechatPay.Error.t()}
verify(map(), String.t(), :md5 | :sha256) :: :ok | {:error, WechatPay.Error.t()}
Verify the signature of Wechat's response
Example
iex > WechatPay.Utils.Signature.verify(%{sign: "foobar"}, "a45a313dfbf0494288c3e56bcacf30daa")
... > :ok