Payzum.Payments (Payzum v0.1.0)

Copy Markdown View Source

Invoices on the merchant surface.

Summary

Functions

Create an invoice.

Read one invoice by Payzum payment_id or by your own order_id.

List invoices, newest first by default.

Functions

create(client, params)

@spec create(Payzum.Client.t(), map()) :: {:ok, map()} | {:error, Exception.t()}

Create an invoice.

Amounts are strings so nothing is rounded on the way in. pay_currency accepts an NP code (usdttrc20), a bare symbol combined with network, or "all" to let the buyer pick.

Returns {:error, %Payzum.Errors.MissingInvoiceUrl{}} when the 201 carries no checkout URL: the draft exists, so read it by payment id.

get(client, id_or_order_id)

@spec get(Payzum.Client.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}

Read one invoice by Payzum payment_id or by your own order_id.

list(client, opts \\ [])

@spec list(Payzum.Client.t(), keyword()) :: {:ok, map()} | {:error, Exception.t()}

List invoices, newest first by default.

The arguments are validated strictly, because the server silently falls back to created_at for an unrecognised sort, which turns a typo into quietly wrong ordering.