summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/app/src')
-rw-r--r--packages/console/app/src/routes/stripe/webhook.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts
index c28d9ebbb..5302a6984 100644
--- a/packages/console/app/src/routes/stripe/webhook.ts
+++ b/packages/console/app/src/routes/stripe/webhook.ts
@@ -160,8 +160,16 @@ export async function POST(input: APIEvent) {
userID: userID,
})
- if (userEmail && coupon === LiteData.firstMonth100Coupon) {
- await Billing.redeemCoupon(userEmail, "GOFREEMONTH")
+ if (userEmail) {
+ if (coupon === LiteData.firstMonth100Coupon) {
+ await Billing.redeemCoupon(userEmail, "GOFREEMONTH")
+ } else if (coupon === LiteData.threeMonths100Coupon) {
+ await Billing.redeemCoupon(userEmail, "GO3MONTHS100")
+ } else if (coupon === LiteData.sixMonths100Coupon) {
+ await Billing.redeemCoupon(userEmail, "GO6MONTHS100")
+ } else if (coupon === LiteData.twelveMonths100Coupon) {
+ await Billing.redeemCoupon(userEmail, "GO12MONTHS100")
+ }
}
})
})