@@ -10356,9 +10356,23 @@ where
10356
10356
#[cfg(c_bindings)]
10357
10357
create_refund_builder!(self, RefundMaybeWithDerivedMetadataBuilder);
10358
10358
10359
+ /// Retrieve our cached [`Offer`]s for receiving async payments as an often-offline recipient.
10360
+ /// Will only be set if [`UserConfig::paths_to_static_invoice_server`] is set and we succeeded in
10361
+ /// interactively building a [`StaticInvoice`] with the static invoice server.
10362
+ ///
10363
+ /// Useful for posting offers to receive payments later, such as posting an offer on a website.
10364
+ #[cfg(async_payments)]
10365
+ pub fn get_cached_async_receive_offers(&self) -> Vec<Offer> {
10366
+ self.flow.get_cached_async_receive_offers()
10367
+ }
10368
+
10359
10369
/// Create an offer for receiving async payments as an often-offline recipient.
10360
10370
///
10361
- /// Because we may be offline when the payer attempts to request an invoice, you MUST:
10371
+ /// Instead of using this method, it is preferable to set
10372
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10373
+ /// [`Self::get_cached_async_receive_offers`].
10374
+ ///
10375
+ /// If you want to build the [`StaticInvoice`] manually using this method instead, you MUST:
10362
10376
/// 1. Provide at least 1 [`BlindedMessagePath`] terminating at an always-online node that will
10363
10377
/// serve the [`StaticInvoice`] created from this offer on our behalf.
10364
10378
/// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
@@ -10374,6 +10388,10 @@ where
10374
10388
/// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
10375
10389
/// created via [`Self::create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
10376
10390
/// invoice's expiry will default to [`STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY`].
10391
+ ///
10392
+ /// Instead of using this method to manually build the invoice, it is preferable to set
10393
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10394
+ /// [`Self::get_cached_async_receive_offers`].
10377
10395
#[cfg(async_payments)]
10378
10396
pub fn create_static_invoice_builder<'a>(
10379
10397
&self, offer: &'a Offer, offer_nonce: Nonce, relative_expiry: Option<Duration>
0 commit comments