open_payments/incoming_payment

Types

The options for creating an incoming payment.

pub type CreateOptions {
  CreateOptions(
    resource_server: String,
    wallet_address: String,
    incoming_amount: option.Option(types.Amount),
    expires_at: option.Option(String),
    metadata: option.Option(json.Json),
  )
}

Constructors

The ILP details a sender uses to pay into an incoming payment.

pub type IlpPaymentMethod {
  IlpPaymentMethod(ilp_address: String, shared_secret: String)
}

Constructors

  • IlpPaymentMethod(ilp_address: String, shared_secret: String)

See https://openpayments.dev/apis/resource-server/operations/get-incoming-payment/

pub type IncomingPayment {
  IncomingPayment(
    id: String,
    wallet_address: String,
    completed: Bool,
    incoming_amount: option.Option(types.Amount),
    received_amount: types.Amount,
    expires_at: option.Option(String),
    metadata: option.Option(dynamic.Dynamic),
    created_at: String,
    methods: List(IlpPaymentMethod),
  )
}

Constructors

A page of incoming payments, as returned by list.

pub type IncomingPaymentList {
  IncomingPaymentList(
    pagination: types.PageInfo,
    result: List(IncomingPayment),
  )
}

Constructors

The options for listing incoming payments.

pub type ListOptions {
  ListOptions(
    resource_server: String,
    wallet_address: String,
    cursor: option.Option(String),
    first: option.Option(Int),
    last: option.Option(Int),
  )
}

Constructors

Values

pub fn complete(
  client: client.Client,
  access_token: String,
  id: String,
) -> Result(IncomingPayment, error.OpenPaymentsError)

Marks an incoming payment as completed, so that it will no longer accept any further payments. id is the full incoming payment URL, as returned by create. See https://openpayments.dev/apis/resource-server/operations/complete-incoming-payment/

pub fn create(
  client: client.Client,
  access_token: String,
  options: CreateOptions,
) -> Result(IncomingPayment, error.OpenPaymentsError)

Creates a new incoming payment on the given wallet address. See https://openpayments.dev/apis/resource-server/operations/create-incoming-payment/

pub fn get(
  client: client.Client,
  access_token: String,
  id: String,
) -> Result(IncomingPayment, error.OpenPaymentsError)

Fetches the latest state of an incoming payment. id is the full incoming payment URL, as returned by create. See https://openpayments.dev/apis/resource-server/operations/get-incoming-payment/

pub fn list(
  client: client.Client,
  access_token: String,
  options: ListOptions,
) -> Result(IncomingPaymentList, error.OpenPaymentsError)

Lists the incoming payments on the given wallet address. See https://openpayments.dev/apis/resource-server/operations/list-incoming-payments/

Search Document