WechatPay v0.7.0 WechatPay.App.Behaviour behaviour View Source

The App payment method behaviour.

Link to this section Summary

Callbacks

Close the order

Download bill

Generate pay request info, which is required for the App SDK

Place an order

Query the order

Query the refund

Request to refund

Report

Link to this section Callbacks

Link to this callback close_order(attrs) View Source
close_order(attrs :: map()) ::
  {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Close the order

Official document

Link to this callback download_bill(attrs) View Source
download_bill(attrs :: map()) ::
  {:ok, String.t()} | {:error, HTTPoison.Error.t()}

Download bill

Official document

Link to this callback generate_pay_request(prepay_id) View Source
generate_pay_request(prepay_id :: String.t()) :: map()

Generate pay request info, which is required for the App SDK

Official document

Link to this callback place_order(attrs) View Source
place_order(attrs :: map()) ::
  {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Place an order

Official document

Link to this callback query_order(attrs) View Source
query_order(attrs :: map()) ::
  {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Query the order

Official document

Link to this callback query_refund(attrs) View Source
query_refund(attrs :: map()) ::
  {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Query the refund

Official document

Link to this callback refund(attrs) View Source
refund(attrs :: map()) ::
  {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Request to refund

Official document

Link to this callback report(attrs) View Source
report(attrs :: map()) ::
  {:ok, map()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Report

Official document