@@ -10608,9 +10608,23 @@ where
10608
10608
#[cfg(c_bindings)]
10609
10609
create_refund_builder!(self, RefundMaybeWithDerivedMetadataBuilder);
10610
10610
10611
+ /// Retrieve our cached [`Offer`]s for receiving async payments as an often-offline recipient.
10612
+ /// Will only be set if [`UserConfig::paths_to_static_invoice_server`] is set and we succeeded in
10613
+ /// interactively building a [`StaticInvoice`] with the static invoice server.
10614
+ ///
10615
+ /// Useful for posting offers to receive payments later, such as posting an offer on a website.
10616
+ #[cfg(async_payments)]
10617
+ pub fn get_cached_async_receive_offers(&self) -> Vec<Offer> {
10618
+ self.flow.get_cached_async_receive_offers()
10619
+ }
10620
+
10611
10621
/// Create an offer for receiving async payments as an often-offline recipient.
10612
10622
///
10613
- /// Because we may be offline when the payer attempts to request an invoice, you MUST:
10623
+ /// Instead of using this method, it is preferable to set
10624
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10625
+ /// [`Self::get_cached_async_receive_offers`].
10626
+ ///
10627
+ /// If you want to build the [`StaticInvoice`] manually using this method instead, you MUST:
10614
10628
/// 1. Provide at least 1 [`BlindedMessagePath`] terminating at an always-online node that will
10615
10629
/// serve the [`StaticInvoice`] created from this offer on our behalf.
10616
10630
/// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
@@ -10627,6 +10641,10 @@ where
10627
10641
/// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
10628
10642
/// created via [`Self::create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
10629
10643
/// invoice's expiry will default to [`STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY`].
10644
+ ///
10645
+ /// Instead of using this method to manually build the invoice, it is preferable to set
10646
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10647
+ /// [`Self::get_cached_async_receive_offers`].
10630
10648
#[cfg(async_payments)]
10631
10649
#[rustfmt::skip]
10632
10650
pub fn create_static_invoice_builder<'a>(
0 commit comments