WechatPay v0.8.0 WechatPay.Client View Source
API client.
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
new(opts)
View Source
new(opts)
View Source
new(Enum.t()) :: {:ok, WechatPay.Client.t()} | {:error, binary()}
new(Enum.t()) :: {:ok, WechatPay.Client.t()} | {:error, binary()}
Build a new client from options
Example
iex>WechatPay.Client.new(app_id: "APP_ID", mch_id: "MCH_ID", api_key: "API_KEY", sign_type: :sha256)
{:ok,
%WechatPay.Client{
api_host: "https://api.mch.weixin.qq.com/",
api_key: "API_KEY",
app_id: "APP_ID",
mch_id: "MCH_ID",
sign_type: :sha256,
ssl: nil
}}