@@ -4876,7 +4876,7 @@ where
4876
4876
///
4877
4877
/// # Custom Routing Parameters
4878
4878
/// Users can customize routing parameters via [`RouteParametersConfig`].
4879
- /// To use default settings, call the function with `RouteParametersConfig::default()` .
4879
+ /// To use default settings, call the function with [ `RouteParametersConfig::default`] .
4880
4880
pub fn pay_for_bolt11_invoice(
4881
4881
&self, invoice: &Bolt11Invoice, payment_id: PaymentId, amount_msats: Option<u64>,
4882
4882
route_params_config: RouteParametersConfig, retry_strategy: Retry
@@ -10390,8 +10390,10 @@ where
10390
10390
/// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
10391
10391
/// - `payer_note` for [`InvoiceRequest::payer_note`].
10392
10392
///
10393
- /// If `max_total_routing_fee_msat` is not specified, The default from
10394
- /// [`RouteParameters::from_payment_params_and_value`] is applied.
10393
+ /// # Custom Routing Parameters
10394
+ ///
10395
+ /// Users can customize routing parameters via [`RouteParametersConfig`].
10396
+ /// To use default settings, call the function with [`RouteParametersConfig::default`].
10395
10397
///
10396
10398
/// # Payment
10397
10399
///
@@ -10545,15 +10547,17 @@ where
10545
10547
}
10546
10548
10547
10549
/// Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS
10548
- /// resolver(s) at `dns_resolvers` which resolve names according to bLIP 32.
10550
+ /// resolver(s) at `dns_resolvers` which resolve names according to [ bLIP 32] .
10549
10551
///
10550
10552
/// If the wallet supports paying on-chain schemes, you should instead use
10551
10553
/// [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by
10552
10554
/// implementing [`DNSResolverMessageHandler`]) directly to look up a URI and then delegate to
10553
10555
/// your normal URI handling.
10554
10556
///
10555
- /// If `max_total_routing_fee_msat` is not specified, the default from
10556
- /// [`RouteParameters::from_payment_params_and_value`] is applied.
10557
+ /// # Custom Routing Parameters
10558
+ ///
10559
+ /// Users can customize routing parameters via [`RouteParametersConfig`].
10560
+ /// To use default settings, call the function with [`RouteParametersConfig::default`].
10557
10561
///
10558
10562
/// # Payment
10559
10563
///
@@ -10563,40 +10567,46 @@ where
10563
10567
///
10564
10568
/// To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
10565
10569
/// invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
10566
- /// payment will fail with an [`Event::InvoiceRequestFailed`].
10570
+ /// payment will fail with an [`PaymentFailureReason::UserAbandoned`] or
10571
+ /// [`PaymentFailureReason::InvoiceRequestExpired`], respectively.
10567
10572
///
10568
10573
/// # Privacy
10569
10574
///
10570
10575
/// For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
10571
- /// to construct a [`BlindedPath `] for the reply path. For further privacy implications, see the
10576
+ /// to construct a [`BlindedMessagePath `] for the reply path. For further privacy implications, see the
10572
10577
/// docs of the parameterized [`Router`], which implements [`MessageRouter`].
10573
10578
///
10574
10579
/// # Limitations
10575
10580
///
10576
10581
/// Requires a direct connection to the given [`Destination`] as well as an introduction node in
10577
- /// [`Offer::paths`] or to [`Offer::signing_pubkey `], if empty. A similar restriction applies to
10582
+ /// [`Offer::paths`] or to [`Offer::issuer_signing_pubkey `], if empty. A similar restriction applies to
10578
10583
/// the responding [`Bolt12Invoice::payment_paths`].
10579
10584
///
10580
10585
/// # Errors
10581
10586
///
10582
10587
/// Errors if:
10583
10588
/// - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
10584
10589
///
10590
+ /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
10591
+ /// [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
10585
10592
/// [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
10586
10593
/// [`OMNameResolver::resolve_name`]: crate::onion_message::dns_resolution::OMNameResolver::resolve_name
10587
10594
/// [`OMNameResolver::handle_dnssec_proof_for_uri`]: crate::onion_message::dns_resolution::OMNameResolver::handle_dnssec_proof_for_uri
10588
10595
/// [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
10596
+ /// [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
10597
+ /// [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned
10598
+ /// [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected
10589
10599
#[cfg(feature = "dnssec")]
10590
10600
pub fn pay_for_offer_from_human_readable_name(
10591
- &self, name: HumanReadableName, amount_msats: u64, payment_id: PaymentId,
10601
+ &self, name: HumanReadableName, amount_msats: u64, payment_id: PaymentId, payer_note: Option<String>,
10592
10602
retry_strategy: Retry, route_params_config: RouteParametersConfig,
10593
10603
dns_resolvers: Vec<Destination>,
10594
10604
) -> Result<(), ()> {
10595
10605
let (onion_message, context) =
10596
10606
self.flow.hrn_resolver.resolve_name(payment_id, name, &*self.entropy_source)?;
10597
10607
10598
10608
let expiration = StaleExpiration::TimerTicks(1);
10599
- self.pending_outbound_payments.add_new_awaiting_offer(payment_id, expiration, retry_strategy, route_params_config, amount_msats)?;
10609
+ self.pending_outbound_payments.add_new_awaiting_offer(payment_id, expiration, retry_strategy, route_params_config, amount_msats, payer_note )?;
10600
10610
10601
10611
self.flow.enqueue_dns_onion_message(
10602
10612
onion_message, context, dns_resolvers,
@@ -12463,9 +12473,9 @@ where
12463
12473
// offer, but tests can deal with that.
12464
12474
offer = replacement_offer;
12465
12475
}
12466
- if let Ok(amt_msats) = self.pending_outbound_payments.amt_msats_for_payment_awaiting_offer (payment_id) {
12476
+ if let Ok(( amt_msats, payer_note)) = self.pending_outbound_payments.params_for_payment_awaiting_offer (payment_id) {
12467
12477
let offer_pay_res =
12468
- self.pay_for_offer_intern(&offer, None, Some(amt_msats), None , payment_id, Some(name),
12478
+ self.pay_for_offer_intern(&offer, None, Some(amt_msats), payer_note , payment_id, Some(name),
12469
12479
|invoice_request, nonce| {
12470
12480
let retryable_invoice_request = RetryableInvoiceRequest {
12471
12481
invoice_request: invoice_request.clone(),
0 commit comments