BepaidEx v0.9.1 Bepaid.Gateway

Utility module for the bePaid API

Provides API wrapper functions for remote API.

Examples:

iex> {"uid" => uid} = Gateway.put_authorization(%Payment{amount: 10})
%{...}
iex> Gateway.void_authorization(uid, 10)
%{...}
iex> {"uid" => uid} = Gateway.put_charge(%Payment{amount: 10})
%{...}

Link to this section Summary

Functions

Executes API request to bePaid API server. Accepts :get or :post atom as a first argument

Load transaction: https://docs.bepaid.by/ru/gateway/transactions/query

Wrapper for exec(:post, url, params). Handy for piping

Put authorization: https://docs.bepaid.by/ru/beyag/transactions/authorization

Put charge: https://docs.bepaid.by/ru/gateway/transactions/payment

Put refund: https://docs.bepaid.by/ru/gateway/transactions/refund

Void authorization: https://docs.bepaid.by/ru/gateway/transactions/void

Link to this section Functions

Link to this function exec(url, params)

Callback implementation for Bepaid.GatewayBehaviour.exec/2.

Link to this function exec(arg1, url, params)

Executes API request to bePaid API server. Accepts :get or :post atom as a first argument.

Returns {:ok, data} or {:error, error, data}.

Link to this function get_transaction(uid)

Load transaction: https://docs.bepaid.by/ru/gateway/transactions/query

Accepts UID of payment or authorization transaction.

Link to this function post_request(data, url)

Wrapper for exec(:post, url, params). Handy for piping.

Link to this function put_authorization(payment)

Put authorization: https://docs.bepaid.by/ru/beyag/transactions/authorization

Accepts Payment struct with credit card and customer info.

Link to this function put_charge(payment)

Put charge: https://docs.bepaid.by/ru/gateway/transactions/payment

Accepts Payment struct with credit card and customer info.

Link to this function put_refund(data)

Callback implementation for Bepaid.GatewayBehaviour.put_refund/1.

Link to this function put_refund(uid, amount, reason \\ "Возврат средств")

Put refund: https://docs.bepaid.by/ru/gateway/transactions/refund

Accepts UID of transaction, amount in cents and reason (optionally).

Link to this function void_authorization(uid, amount)

Void authorization: https://docs.bepaid.by/ru/gateway/transactions/void

Accepts UID of authorization transaction and amount in cents.