ECPayInvoice.B2CInvoice (ecpay_invoice v0.0.2-beta3)

Link to this section Summary

Functions

Callback implementation for ECPayInvoice.Request.endpoint/0.

Issues invoice, sends notification if the requests succeeded, and returns the response tuple from the original invoice issuance request.

Link to this section Types

Specs

t() :: %ECPayInvoice.B2CInvoice{
  customer_data: ECPayInvoice.CustomerData.t() | nil,
  donate: boolean(),
  items: [ECPayInvoice.InvoiceItem.t()],
  love_code: binary() | nil,
  order_id: String.t() | nil,
  print: boolean()
}

Link to this section Functions

Link to this function

add_item(invoice, item)

Specs

add_item(invoice :: t(), item :: map() | ECPayInvoice.InvoiceItem) :: t()

Callback implementation for ECPayInvoice.Request.endpoint/0.

Link to this function

issue_and_notify(data, profile)

Specs

issue_and_notify(data :: t(), profile :: atom()) ::
  {:ok, map()} | {:error, term()}

Issues invoice, sends notification if the requests succeeded, and returns the response tuple from the original invoice issuance request.

Link to this function

new(data \\ %{})

Specs

new(data :: map()) :: t()
Link to this function

to_api_payload(invoice, profile \\ :staging)

Callback implementation for ECPayInvoice.Request.to_api_payload/2.