pub struct Bolt12Payment { /* private fields */ }Expand description
A payment handler allowing to create and pay BOLT 12 offers and refunds.
Should be retrieved by calling Node::bolt12_payment.
Implementations§
Source§impl Bolt12Payment
impl Bolt12Payment
Sourcepub fn send(
&self,
offer: &Offer,
quantity: Option<u64>,
payer_note: Option<String>,
) -> Result<PaymentId, Error>
pub fn send( &self, offer: &Offer, quantity: Option<u64>, payer_note: Option<String>, ) -> Result<PaymentId, Error>
Send a payment given an offer.
If payer_note is Some it will be seen by the recipient and reflected back in the invoice
response.
If quantity is Some it represents the number of items requested.
Sourcepub fn send_using_amount(
&self,
offer: &Offer,
amount_msat: u64,
quantity: Option<u64>,
payer_note: Option<String>,
) -> Result<PaymentId, Error>
pub fn send_using_amount( &self, offer: &Offer, amount_msat: u64, quantity: Option<u64>, payer_note: Option<String>, ) -> Result<PaymentId, Error>
Send a payment given an offer and an amount in millisatoshi.
This will fail if the amount given is less than the value required by the given offer.
This can be used to pay a so-called “zero-amount” offers, i.e., an offer that leaves the amount paid to be determined by the user.
If payer_note is Some it will be seen by the recipient and reflected back in the invoice
response.
Sourcepub fn receive(
&self,
amount_msat: u64,
description: &str,
expiry_secs: Option<u32>,
quantity: Option<u64>,
) -> Result<Offer, Error>
pub fn receive( &self, amount_msat: u64, description: &str, expiry_secs: Option<u32>, quantity: Option<u64>, ) -> Result<Offer, Error>
Returns a payable offer that can be used to request and receive a payment of the amount given.
Sourcepub fn receive_variable_amount(
&self,
description: &str,
expiry_secs: Option<u32>,
) -> Result<Offer, Error>
pub fn receive_variable_amount( &self, description: &str, expiry_secs: Option<u32>, ) -> Result<Offer, Error>
Returns a payable offer that can be used to request and receive a payment for which the amount is to be determined by the user, also known as a “zero-amount” offer.
Sourcepub fn request_refund_payment(
&self,
refund: &Refund,
) -> Result<Bolt12Invoice, Error>
pub fn request_refund_payment( &self, refund: &Refund, ) -> Result<Bolt12Invoice, Error>
Requests a refund payment for the given Refund.
The returned Bolt12Invoice is for informational purposes only (i.e., isn’t needed to
retrieve the refund).
Auto Trait Implementations§
impl Freeze for Bolt12Payment
impl !RefUnwindSafe for Bolt12Payment
impl Send for Bolt12Payment
impl Sync for Bolt12Payment
impl Unpin for Bolt12Payment
impl !UnwindSafe for Bolt12Payment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more