retry behavior

This commit is contained in:
Brandon Thomas committed 2025-09-12 01:00:03 -04:00
1 parent b3e74e25f6
commit e48ee589ad
2 files changed
+11 -4

No files matched your search

@@ -67,7 +67,7 @@ pub async fn open_storyteller_billing_window(
).await?
},
};
do_open_window(args.app, args.app_data_root, checkout_url).await?;
Ok(())
@@ -133,7 +133,7 @@ async fn do_open_window(
info!("Opening checkout window...");
// TODO(bt,2025-09-01): We probably need to open this in a real browser to get autocomplete.
let window = WebviewWindowBuilder::new(app, BILLING_WINDOW_NAME, url)
let _window = WebviewWindowBuilder::new(app, BILLING_WINDOW_NAME, url)
.always_on_top(false)
.title("ArtCraft Billing")
.center()
@@ -1,9 +1,10 @@
use crate::endpoints::webhook::webhook_event_handlers::stripe_artcraft_webhook_error::StripeArtcraftWebhookError;
use crate::utils::expand_ids::expand_product_id::expand_product_id;
use log::{error, warn};
use stripe::Client;
use stripe::{Client, RequestStrategy, StripeRequest};
use stripe_checkout::checkout_session::{ListCheckoutSession, ListLineItemsCheckoutSession};
use stripe_shared::PriceType;
use stripe_shared::{CheckoutSession, CheckoutSessionItem, PriceType};
use stripe_types::List;
#[derive(Debug, Clone)]
pub struct PurchaseSummary {
@@ -24,6 +25,9 @@ pub async fn lookup_purchase_from_payment_intent_success(
let result = ListCheckoutSession::new()
.payment_intent(payment_intent_id)
.limit(1)
.build()
.customize::<List<CheckoutSession>>()
.request_strategy(RequestStrategy::ExponentialBackoff(3))
.send(stripe_client)
.await
.map_err(|err| {
@@ -50,6 +54,9 @@ pub async fn lookup_purchase_from_payment_intent_success(
.ok_or_else(|| anyhow::anyhow!("No items in ListCheckoutSession request."))?;
let line_items = ListLineItemsCheckoutSession::new(checkout_session_id)
.build()
.customize::<List<CheckoutSessionItem>>()
.request_strategy(RequestStrategy::ExponentialBackoff(3))
.send(stripe_client)
.await
.map_err(|err| {