Enum PaymentMethod
pub enum PaymentMethod {
Onchain {
address: Address,
amount: Option<Amount>,
label: Option<String>,
message: Option<String>,
},
Invoice {
invoice: Invoice,
lud12_comment: Option<String>,
},
Offer {
offer: Offer,
bip321_amount: Option<Amount>,
human_bitcoin_address: Option<String>,
},
LnurlPay {
pay_request: LnurlPayRequest,
lnurl: String,
lightning_address: Option<String>,
},
}Expand description
A single “payment method” – each kind here should correspond with a single linear (outbound) payment flow for a user, where there are no other alternate methods.
For example, a Unified BTC QR code contains a single BIP321 URI, which may contain multiple discrete payment methods (an onchain address, a BOLT11 invoice, a BOLT12 offer).
Compare with ClaimMethod, which is the inbound equivalent.
Variants§
Onchain
Fields
amount: Option<Amount>The amount to pay to the onchain address, if specified.
Parsed from a BIP321 URI or BOLT11 invoice containing the onchain address.
Invoice
Fields
Offer
Fields
LnurlPay
Fields
pay_request: LnurlPayRequestThe LNURL-pay request, which includes information about the amount constraints, callback, etc. associated with the LNURL.
Implementations§
§impl PaymentMethod
impl PaymentMethod
pub fn is_onchain(&self) -> bool
pub fn is_onchain(&self) -> bool
Check if the payment method is an onchain address.
pub fn is_invoice(&self) -> bool
pub fn is_invoice(&self) -> bool
Check if the payment method is a BOLT11 invoice.
pub fn is_lnurl_pay(&self) -> bool
pub fn is_lnurl_pay(&self) -> bool
Check if the payment method is an LNURL-pay endpoint.