Skip to content

Commit 7e33903

Browse files
committed
add pastDue to valid billing statuses
1 parent 454fc6a commit 7e33903

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/account-abstraction/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export default async function Page(props: {
3030
);
3131

3232
const hasSmartWalletsWithoutBilling =
33-
isBundlerServiceEnabled && team.billingStatus !== "validPayment";
33+
isBundlerServiceEnabled &&
34+
team.billingStatus !== "validPayment" &&
35+
team.billingStatus !== "pastDue";
3436

3537
const userOpStats = await getAggregateUserOpUsage({
3638
teamId: team.id,

apps/dashboard/src/app/team/components/TeamHeader/getValidTeamPlan.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import type { Team } from "@/api/team";
22

33
export function getValidTeamPlan(team: Team): Team["billingPlan"] {
4-
if (team.billingStatus !== "validPayment") {
4+
if (
5+
team.billingStatus !== "validPayment" &&
6+
team.billingStatus !== "pastDue"
7+
) {
58
return "free";
69
}
710

apps/dashboard/src/components/settings/Account/Billing/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export const Billing: React.FC<BillingProps> = ({
2424
subscriptions,
2525
twAccount,
2626
}) => {
27-
const validPayment = team.billingStatus === "validPayment";
27+
const validPayment =
28+
team.billingStatus === "validPayment" || team.billingStatus === "pastDue";
2829
const validPlan = getValidTeamPlan(team);
2930

3031
const planSubscription = subscriptions.find((sub) => sub.type === "PLAN");

packages/service-utils/src/core/api.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@ export type TeamResponse = {
5050
createdAt: string;
5151
updatedAt: string | null;
5252
billingEmail: string | null;
53-
billingStatus: "noPayment" | "validPayment" | "invalidPayment" | null;
53+
// noPayment = no payment method on file for customer => expected state for new customers without an active subscription
54+
// validPayment = payment method on file and valid => good state
55+
// invalidPayment = payment method not valid (billing failing repeatedly) => error state
56+
// pastDue = payment method on file but has past due payments => warning state
57+
billingStatus:
58+
| "noPayment"
59+
| "validPayment"
60+
| "invalidPayment"
61+
| "pastDue"
62+
| null;
5463
growthTrialEligible: false;
5564
canCreatePublicChains: boolean | null;
5665
enabledScopes: ServiceName[];

0 commit comments

Comments
 (0)