diff --git a/supabase/functions/deno-packages/billing-functions/src/billing-functions-wrapper.ts b/supabase/functions/deno-packages/billing-functions/src/billing-functions-wrapper.ts index 68854ee..eebc1c2 100644 --- a/supabase/functions/deno-packages/billing-functions/src/billing-functions-wrapper.ts +++ b/supabase/functions/deno-packages/billing-functions/src/billing-functions-wrapper.ts @@ -13,17 +13,11 @@ type GET_PLANS_ARGS = { type GET_PLANS_RESPONSE = Array<{ id: string; - name: string; - description?: string; - amount: number; + product_name: string; + product_description?: string; + price: number; currency: string; - interval: "month" | "year" | "one_time"; - interval_count: 1; - trial_period_days?: 30; - active?: boolean; - metadata?: { - [key: string]: string; - }; + interval: "month" | "year" | "one_time"; }>; type GET_BILLING_PORTAL_URL_ARGS = { @@ -63,6 +57,7 @@ export type GET_BILLING_STATUS_RESPONSE = { account_role: BASEJUMP_DATABASE_SCHEMA["basejump"]["Tables"]["account_user"]["Row"]["account_role"]; is_primary_owner: boolean; billing_enabled: boolean; + price_id: string; }; type BILLING_FUNCTION_WRAPPER_OPTIONS = { diff --git a/supabase/functions/deno-packages/billing-functions/src/providers/stripe/stripe-function-handler.ts b/supabase/functions/deno-packages/billing-functions/src/providers/stripe/stripe-function-handler.ts index 8c16f06..3a35785 100644 --- a/supabase/functions/deno-packages/billing-functions/src/providers/stripe/stripe-function-handler.ts +++ b/supabase/functions/deno-packages/billing-functions/src/providers/stripe/stripe-function-handler.ts @@ -25,8 +25,6 @@ export function stripeFunctionHandler({ accountId, customerId, billingEmail, - defaultTrialDays, - defaultPlanId, subscriptionId, }) { const customer = await findOrCreateCustomer(stripeClient, { diff --git a/supabase/functions/deno-packages/billing-functions/src/wrappers/get-billing-status.ts b/supabase/functions/deno-packages/billing-functions/src/wrappers/get-billing-status.ts index 51af2c6..779f5d0 100644 --- a/supabase/functions/deno-packages/billing-functions/src/wrappers/get-billing-status.ts +++ b/supabase/functions/deno-packages/billing-functions/src/wrappers/get-billing-status.ts @@ -39,5 +39,6 @@ export default async function getBillingStatus( account_role: roleInfo.account_role, is_primary_owner: roleInfo.is_primary_owner, billing_enabled: roleInfo.billing_enabled, + price_id: billingData?.subscription?.price_id, }; }