WechatPay v0.9.0 WechatPay.App View Source
The App payment method.
Example
Set up a client:
{:ok, client} = WechatPay.Client.new(
app_id: "the-app_id",
mch_id: "the-mch-id",
api_key: "the-api_key",
ssl: [
ca_cert: File.read!("fixture/certs/rootca.pem"),
cert: File.read!("fixture/certs/apiclient_cert.pem"),
key: File.read!("fixture/certs/apiclient_key.pem")
]
)
Place an order:
WechatPay.App.place_order(client, %{
body: "Plan 1",
out_trade_no: "12345",
fee_type: "CNY",
total_fee: "600",
spbill_create_ip: Void.Utils.get_system_ip(),
notify_url: "http://example.com/",
trade_type: "APP",
product_id: "12345"
})
Link to this section Summary
Functions
Query comments in a batch
Close the order
Download bill
Download fund flow
Generate pay request info, which is required for the App SDK
Place an order
Query the order
Query the refund
Request to refund
Link to this section Functions
Specs
batch_query_comments(WechatPay.Client.t(), map(), keyword()) :: {:ok, String.t()} | {:error, HTTPoison.Error.t()}
Query comments in a batch
Specs
close_order(WechatPay.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}
Close the order
Specs
download_bill(WechatPay.Client.t(), map(), keyword()) :: {:ok, String.t()} | {:error, HTTPoison.Error.t()}
Download bill
Specs
download_fund_flow(WechatPay.Client.t(), map(), keyword()) :: {:ok, String.t()} | {:error, HTTPoison.Error.t()}
Download fund flow
Specs
generate_pay_request(WechatPay.Client.t(), String.t()) :: map()
Generate pay request info, which is required for the App SDK
Specs
place_order(WechatPay.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}
Place an order
Specs
query_order(WechatPay.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}
Query the order
Specs
query_refund(WechatPay.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}
Query the refund
Specs
refund(WechatPay.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}
Request to refund
Specs
report(WechatPay.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}
Report