@@ -10749,9 +10749,23 @@ where
10749
10749
#[cfg(c_bindings)]
10750
10750
create_refund_builder!(self, RefundMaybeWithDerivedMetadataBuilder);
10751
10751
10752
+ /// Retrieve our cached [`Offer`]s for receiving async payments as an often-offline recipient.
10753
+ /// Will only be set if [`UserConfig::paths_to_static_invoice_server`] is set and we succeeded in
10754
+ /// interactively building a [`StaticInvoice`] with the static invoice server.
10755
+ ///
10756
+ /// Useful for posting offers to receive payments later, such as posting an offer on a website.
10757
+ #[cfg(async_payments)]
10758
+ pub fn get_cached_async_receive_offers(&self) -> Vec<Offer> {
10759
+ self.flow.get_cached_async_receive_offers()
10760
+ }
10761
+
10752
10762
/// Create an offer for receiving async payments as an often-offline recipient.
10753
10763
///
10754
- /// Because we may be offline when the payer attempts to request an invoice, you MUST:
10764
+ /// Instead of using this method, it is preferable to set
10765
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10766
+ /// [`Self::get_cached_async_receive_offers`].
10767
+ ///
10768
+ /// If you want to build the [`StaticInvoice`] manually using this method instead, you MUST:
10755
10769
/// 1. Provide at least 1 [`BlindedMessagePath`] terminating at an always-online node that will
10756
10770
/// serve the [`StaticInvoice`] created from this offer on our behalf.
10757
10771
/// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
@@ -10768,6 +10782,10 @@ where
10768
10782
/// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
10769
10783
/// created via [`Self::create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
10770
10784
/// invoice's expiry will default to [`STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY`].
10785
+ ///
10786
+ /// Instead of using this method to manually build the invoice, it is preferable to set
10787
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10788
+ /// [`Self::get_cached_async_receive_offers`].
10771
10789
#[cfg(async_payments)]
10772
10790
pub fn create_static_invoice_builder<'a>(
10773
10791
&self, offer: &'a Offer, offer_nonce: Nonce, relative_expiry: Option<Duration>,
0 commit comments