From 36fcecab18ef28950149ef57cd8ed2ba156182cc Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 5 Dec 2023 14:36:26 +0100 Subject: [PATCH] logs, credits --- src/routes/console/+layout.svelte | 1 + .../billing/wizard/addCredit.svelte | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/console/+layout.svelte b/src/routes/console/+layout.svelte index 75de9ad02..5667d6470 100644 --- a/src/routes/console/+layout.svelte +++ b/src/routes/console/+layout.svelte @@ -255,6 +255,7 @@ console.log('Environment is not Cloud or Stripe public key not deteted'); console.log('isCloud:', isCloud); console.log('hasStripePublicKey:', hasStripePublicKey); + console.log('Stripe key:', VARS.STRIPE_PUBLIC_KEY); } }); diff --git a/src/routes/console/organization-[organization]/billing/wizard/addCredit.svelte b/src/routes/console/organization-[organization]/billing/wizard/addCredit.svelte index 6bdab8ebf..1900492cb 100644 --- a/src/routes/console/organization-[organization]/billing/wizard/addCredit.svelte +++ b/src/routes/console/organization-[organization]/billing/wizard/addCredit.svelte @@ -13,6 +13,7 @@ }; async function validateCoupon() { + if (couponData?.status === 'active') return; try { const response = await sdk.forConsole.billing.getCoupon(coupon); couponData = response; @@ -21,7 +22,7 @@ console.log('test'); couponData.code = coupon; couponData.status = 'error'; - return; + throw new Error(`${coupon} is not a valid promo code`); } }