@@ -7134,18 +7134,26 @@ where
7134
7134
Ok(builder)
7135
7135
}
7136
7136
7137
- /// Creates an [`InvoiceRequest`] for an [`Offer`] from the given parameters and enqueues it to
7138
- /// be sent via an onion message.
7137
+ /// Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
7138
+ /// enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
7139
+ /// [`Bolt12Invoice`] once it is received.
7139
7140
///
7140
7141
/// Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
7141
- /// the [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the request.
7142
+ /// the [`ChannelManager`] when handling a [`Bolt12Invoice`] message for the request. The
7143
+ /// optional parameters are used in the builder, if `Some`:
7144
+ /// - `quantity` for [`InvoiceRequest::quantity`] which may be set if
7145
+ /// [`Offer::expects_quantity`] is `true`.
7146
+ /// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
7147
+ /// - `payer_note` for [`InvoiceRequest::payer_note`].
7142
7148
///
7143
7149
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request.
7144
7150
///
7145
7151
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
7152
+ /// [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
7153
+ /// [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
7146
7154
/// [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
7147
7155
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
7148
- pub fn request_invoice (
7156
+ pub fn pay_for_offer (
7149
7157
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
7150
7158
payer_note: Option<String>, payment_id: PaymentId, retry_strategy: Retry,
7151
7159
max_total_routing_fee_msat: Option<u64>
0 commit comments