Skip to content

Commit c63a549

Browse files
fix: handle Zaprite upgrade review and irreversible statuses
Surface PAID_NEEDS_REVIEW copy and treat REFUNDED/REVOKED as terminal so the client matches the billing-server money-path states.
1 parent 774b9e4 commit c63a549

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

frontend/src/billing/zapriteUpgrade.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export const ZAPRITE_UPGRADE_TERMINAL_STATUSES = [
44
"COMPLETED",
55
"EXPIRED",
66
"CANCELED",
7-
"FAILED"
7+
"FAILED",
8+
"REFUNDED",
9+
"REVOKED"
810
] as const;
911

1012
export type ZapriteUpgradeStatus =
@@ -18,7 +20,10 @@ export type ZapriteUpgradeStatus =
1820
| "COMPLETED"
1921
| "EXPIRED"
2022
| "CANCELED"
21-
| "FAILED";
23+
| "FAILED"
24+
| "PAID_NEEDS_REVIEW"
25+
| "REFUNDED"
26+
| "REVOKED";
2227

2328
export type ZapriteUpgradePlanSummary = {
2429
product_id: string;

frontend/src/components/ZapriteUpgradeDialog.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ function statusCopy(status: string): string {
4545
return "This upgrade was canceled. Your current plan is unchanged.";
4646
case "FAILED":
4747
return "This upgrade could not be completed. Your current plan is unchanged.";
48+
case "PAID_NEEDS_REVIEW":
49+
return "Payment was received and needs a short review before the plan change is applied. Your current plan is unchanged.";
50+
case "REFUNDED":
51+
case "REVOKED":
52+
return "This upgrade is no longer active. Your current plan is unchanged.";
4853
default:
4954
return "Preparing Bitcoin checkout.";
5055
}

0 commit comments

Comments
 (0)