@@ -6880,18 +6880,26 @@ where
6880
6880
Ok(builder)
6881
6881
}
6882
6882
6883
- /// Creates an [`InvoiceRequest`] for an [`Offer`] from the given parameters and enqueues it to
6884
- /// be sent via an onion message.
6883
+ /// Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
6884
+ /// enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
6885
+ /// [`Bolt12Invoice`] once it is received.
6885
6886
///
6886
6887
/// Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
6887
- /// the [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the request.
6888
+ /// the [`ChannelManager`] when handling a [`Bolt12Invoice`] message for the request. The
6889
+ /// optional parameters are used in the builder, if `Some`:
6890
+ /// - `quantity` for [`InvoiceRequest::quantity`] which may be set if
6891
+ /// [`Offer::expects_quantity`] is `true`.
6892
+ /// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
6893
+ /// - `payer_note` for [`InvoiceRequest::payer_note`].
6888
6894
///
6889
6895
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request.
6890
6896
///
6891
6897
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6898
+ /// [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
6899
+ /// [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
6892
6900
/// [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
6893
6901
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6894
- pub fn request_invoice (
6902
+ pub fn pay_for_offer (
6895
6903
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
6896
6904
payer_note: Option<String>, payment_id: PaymentId, retry_strategy: Retry
6897
6905
) -> Result<(), Bolt12SemanticError> {
0 commit comments