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

The Native payment method behaviour.

Link to this section Summary

Callbacks

Close the order

Download bill

Place an order

Query the order

Query the refund

Request to refund

Report

Shorten the URL to reduce the QR image size

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 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

Link to this callback shorten_url(url) View Source
shorten_url(url :: String.t()) ::
  {:ok, String.t()} | {:error, WechatPay.Error.t() | HTTPoison.Error.t()}

Shorten the URL to reduce the QR image size

Official document