Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stripe-function-handler.ts #69

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export function stripeFunctionHandler({
accountId,
customerId,
billingEmail,
defaultTrialDays,
defaultPlanId,
subscriptionId,
}) {
const customer = await findOrCreateCustomer(stripeClient, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}