diff --git a/src/lib/components/billing/alerts/newDevUpgradePro.svelte b/src/lib/components/billing/alerts/newDevUpgradePro.svelte index c58ad7268..8e4637a65 100644 --- a/src/lib/components/billing/alerts/newDevUpgradePro.svelte +++ b/src/lib/components/billing/alerts/newDevUpgradePro.svelte @@ -2,7 +2,7 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import { trackEvent } from '$lib/actions/analytics'; - import { BillingPlan } from '$lib/constants'; + import { BillingPlan, NEW_DEV_PRO_UPGRADE_CUPON } from '$lib/constants'; import { Button } from '$lib/elements/forms'; import { organization } from '$lib/stores/organization'; import { activeHeaderAlert } from '$routes/(console)/store'; @@ -29,7 +29,7 @@ secondary fullWidthMobile class="u-line-height-1" - href={`${base}/apply-credit?code=appw50&org=${$organization.$id}`} + href={`${base}/apply-credit?code=${NEW_DEV_PRO_UPGRADE_CUPON}&org=${$organization.$id}`} on:click={() => { trackEvent('click_credits_redeem', { from: 'button', diff --git a/src/lib/constants.ts b/src/lib/constants.ts index c77f213b5..f69f74d89 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,6 +1,7 @@ export const PAGE_LIMIT = 12; // default page limit export const CARD_LIMIT = 6; // default card limit export const INTERVAL = 5 * 60000; // default interval to check for feedback +export const NEW_DEV_PRO_UPGRADE_CUPON = 'appw50'; export enum Dependencies { FACTORS = 'dependency:factors', diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index ffe2f1e82..a619d8262 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -22,7 +22,7 @@ import { goto } from '$app/navigation'; import { base } from '$app/paths'; import { activeHeaderAlert, orgMissingPaymentMethod } from '$routes/(console)/store'; import MarkedForDeletion from '$lib/components/billing/alerts/markedForDeletion.svelte'; -import { BillingPlan } from '$lib/constants'; +import { BillingPlan, NEW_DEV_PRO_UPGRADE_CUPON } from '$lib/constants'; import PaymentMandate from '$lib/components/billing/alerts/paymentMandate.svelte'; import MissingPaymentMethod from '$lib/components/billing/alerts/missingPaymentMethod.svelte'; import LimitReached from '$lib/components/billing/alerts/limitReached.svelte'; @@ -465,7 +465,7 @@ export async function checkForNewDevUpgradePro(org: Organization) { if (isDismissed) return; // check if coupon already applied try { - await sdk.forConsole.billing.getCoupon('appw50'); + await sdk.forConsole.billing.getCoupon(NEW_DEV_PRO_UPGRADE_CUPON); } catch (e) { return; }