From 30b3ed80e21acb2ff52a3f7e02ff7917780c8e51 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 5 Sep 2024 16:56:21 +0200 Subject: [PATCH] fix pricing + stripe payments --- .../components/pricing/PricingCardGeneric.vue | 18 +++-- .../components/pricing/PricingDrawer.vue | 66 ++++++++++++++++++- .../pay/[project_id]/create-onetime.post.ts | 40 +++++++++++ dashboard/server/api/pay/webhook.post.ts | 36 +++++++++- dashboard/server/api/project/plan.ts | 19 ++++++ dashboard/server/services/StripeService.ts | 56 +++++++++++++++- landing/layouts/header.vue | 6 +- landing/nuxt.config.ts | 35 ++++++++++ landing/pages/pricing.vue | 51 +++++++++++++- shared/data/PREMIUM.ts | 18 ++++- 10 files changed, 326 insertions(+), 19 deletions(-) create mode 100644 dashboard/server/api/pay/[project_id]/create-onetime.post.ts create mode 100644 landing/nuxt.config.ts diff --git a/dashboard/components/pricing/PricingCardGeneric.vue b/dashboard/components/pricing/PricingCardGeneric.vue index 1305209..9f4d4e9 100644 --- a/dashboard/components/pricing/PricingCardGeneric.vue +++ b/dashboard/components/pricing/PricingCardGeneric.vue @@ -13,11 +13,11 @@ export type PricingCardProp = { planId: number } -const props = defineProps<{ datas: PricingCardProp[] }>(); +const props = defineProps<{ datas: PricingCardProp[], defaultIndex?: number }>(); const activeProject = useActiveProject(); -const currentIndex = ref(0); +const currentIndex = ref(props.defaultIndex || 0); const data = computed(() => { return props.datas[currentIndex.value]; @@ -37,13 +37,19 @@ async function onUpgradeClick() {