Remove some stripe proxy methods
This commit is contained in:
@@ -14,8 +14,8 @@ pub async fn list_tenant_invoices(
|
||||
let tenant = api.get_tenant_or_404(&pubkey).await?;
|
||||
|
||||
let invoices = api
|
||||
.billing
|
||||
.stripe_list_invoices(&tenant.stripe_customer_id)
|
||||
.stripe
|
||||
.list_invoices(&tenant.stripe_customer_id)
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
ok(invoices)
|
||||
|
||||
@@ -25,8 +25,8 @@ pub async fn create_stripe_session(
|
||||
let tenant = api.get_tenant_or_404(&pubkey).await?;
|
||||
|
||||
let url = api
|
||||
.billing
|
||||
.stripe_create_portal_session(&tenant.stripe_customer_id, params.return_url.as_deref())
|
||||
.stripe
|
||||
.create_portal_session(&tenant.stripe_customer_id, params.return_url.as_deref())
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
ok(serde_json::json!({ "url": url }))
|
||||
|
||||
@@ -65,9 +65,15 @@ pub async fn create_tenant(
|
||||
return ok(TenantResponse::from(t));
|
||||
}
|
||||
|
||||
let display_name = api
|
||||
.robot
|
||||
.fetch_nostr_name(&pubkey)
|
||||
.await
|
||||
.unwrap_or(pubkey.chars().take(8).collect());
|
||||
|
||||
let stripe_customer_id = api
|
||||
.billing
|
||||
.stripe_create_customer(&pubkey)
|
||||
.stripe
|
||||
.create_customer(&pubkey, &display_name)
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user