open_payments/quotes
Types
The options for creating a quote.
pub type CreateOptions {
CreateOptions(
resource_server: String,
wallet_address: String,
receiver: String,
amount: types.AmountOption,
)
}
Constructors
-
CreateOptions( resource_server: String, wallet_address: String, receiver: String, amount: types.AmountOption, )
See https://openpayments.dev/apis/resource-server/operations/get-quote/
pub type Quote {
Quote(
id: String,
wallet_address: String,
receiver: String,
debit_amount: types.Amount,
receive_amount: types.Amount,
method: String,
created_at: String,
expires_at: option.Option(String),
)
}
Constructors
-
Quote( id: String, wallet_address: String, receiver: String, debit_amount: types.Amount, receive_amount: types.Amount, method: String, created_at: String, expires_at: option.Option(String), )
Values
pub fn create(
client: client.Client,
access_token: String,
options: CreateOptions,
) -> Result(Quote, error.OpenPaymentsError)
Creates a new quote for a payment to the given incoming payment. See https://openpayments.dev/apis/resource-server/operations/create-quote/
pub fn get(
client: client.Client,
access_token: String,
id: String,
) -> Result(Quote, error.OpenPaymentsError)
Fetches the latest state of a quote.
id is the full quote URL, as returned by create.
See https://openpayments.dev/apis/resource-server/operations/get-quote/