MoneyHub.PayLinks (MoneyHub v1.0.0)

Copy Markdown View Source

Pay Links: shareable, hosted single-payment links that don't require embedding a widget yourself - useful for invoicing flows where you just need to send a customer a URL.

See Pay Link Widget and Create Pay Link.

Summary

Functions

Cancels (expires) a pay link before it has been paid.

Creates a pay link. attrs typically includes the amount, currency, reference, and the payee (or creditor account) to receive funds. Returns a pay_link map containing a hosted "url" to share with the payer.

Fetches a pay link's current status by id.

Types

pay_link()

@type pay_link() :: map()

Functions

cancel(config, token, pay_link_id)

@spec cancel(MoneyHub.Config.t(), String.t(), String.t()) ::
  :ok | {:error, MoneyHub.Error.t()}

Cancels (expires) a pay link before it has been paid.

create(config, token, attrs)

@spec create(MoneyHub.Config.t(), String.t(), map()) ::
  {:ok, pay_link()} | {:error, MoneyHub.Error.t()}

Creates a pay link. attrs typically includes the amount, currency, reference, and the payee (or creditor account) to receive funds. Returns a pay_link map containing a hosted "url" to share with the payer.

get(config, token, pay_link_id)

@spec get(MoneyHub.Config.t(), String.t(), String.t()) ::
  {:ok, pay_link()} | {:error, MoneyHub.Error.t()}

Fetches a pay link's current status by id.