WechatPay v0.9.0 WechatPay.Utils.Signature View Source
Module to sign data
Link to this section Summary
Link to this section Functions
Specs
Generate the signature of data with API key
Example
iex> WechatPay.Utils.Signature.sign(%{...}, "wx9999")
...> "02696FC7E3E19F852A0335F2F007DD3E"
Specs
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