price cards

This commit is contained in:
Alex Holliday committed 2025-12-02 20:52:27 +00:00
1 parent 07efd08837
commit 53355cad04
7 files changed
+155 -33

No files matched your search

+11 -1
View File
@@ -31,7 +31,17 @@ class BillingService implements IBillingService {
}
listPlans = async () => {
const order: PlanKey[] = ["free", "pro", "business", "enterprise"];
return order.map((key) => Plans[key]);
const prices = await this.stripeClient.prices.list({});
const plans = order.map((key) => {
const plan = Plans[key];
plan.price =
prices.data.find((p) => p.lookup_key === key)?.unit_amount || 0;
return plan;
});
console.log("Available plans:", plans);
return plans;
};
private buildSuccessUrl = (planKey: PlanKey) =>