From a3f339aaf673104debdc24586fcef40a541ba9d9 Mon Sep 17 00:00:00 2001 From: giancarlo Date: Wed, 5 Jun 2024 19:15:21 +0700 Subject: [PATCH] Fix issues with Lemon Squeezy and i18n issue requiring a parameter we do not pass. --- apps/web/public/locales/en/billing.json | 2 +- .../lemon-squeezy-webhook-handler.service.ts | 19 ------------------- turbo/generators/templates/env/generator.ts | 6 +++--- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/apps/web/public/locales/en/billing.json b/apps/web/public/locales/en/billing.json index 7cf727a41..6cba529dd 100644 --- a/apps/web/public/locales/en/billing.json +++ b/apps/web/public/locales/en/billing.json @@ -66,7 +66,7 @@ "trialing": { "badge": "Trial", "heading": "You're on a trial", - "description": "Your trial will end on {{- trialEndDate }}." + "description": "You can enjoy the benefits of plan until the trial ends" }, "past_due": { "badge": "Past Due", diff --git a/packages/billing/lemon-squeezy/src/services/lemon-squeezy-webhook-handler.service.ts b/packages/billing/lemon-squeezy/src/services/lemon-squeezy-webhook-handler.service.ts index b4ed4c5e1..8b9aa16e8 100644 --- a/packages/billing/lemon-squeezy/src/services/lemon-squeezy-webhook-handler.service.ts +++ b/packages/billing/lemon-squeezy/src/services/lemon-squeezy-webhook-handler.service.ts @@ -132,13 +132,6 @@ export class LemonSqueezyWebhookHandlerService ); } - case 'subscription_payment_success': { - return this.handleInvoicePaid( - event as SubscriptionWebhook, - params.onInvoicePaid, - ); - } - default: { const logger = await getLogger(); @@ -287,18 +280,6 @@ export class LemonSqueezyWebhookHandlerService ); } - private handleInvoicePaid( - subscription: SubscriptionWebhook, - onInvoicePaidCallback: ( - subscription: UpsertSubscriptionParams, - ) => Promise, - ) { - return this.handleSubscriptionCreatedEvent( - subscription, - onInvoicePaidCallback, - ); - } - private handleSubscriptionDeletedEvent( subscription: SubscriptionWebhook, onSubscriptionDeletedCallback: (subscriptionId: string) => Promise, diff --git a/turbo/generators/templates/env/generator.ts b/turbo/generators/templates/env/generator.ts index 4c37e5799..e12e45626 100644 --- a/turbo/generators/templates/env/generator.ts +++ b/turbo/generators/templates/env/generator.ts @@ -1,5 +1,4 @@ import type { PlopTypes } from '@turbo/gen'; -import { execSync } from 'node:child_process'; import { writeFileSync } from 'node:fs'; export function createEnvironmentVariablesGenerator( @@ -23,7 +22,7 @@ export function createEnvironmentVariablesGenerator( writeFileSync('turbo/generators/templates/env/.env.local', env); - return 'Environment variables generated at turbo/generators/templates/env/.env.local. Please double check and use this file in your hosting provider to set the environment variables. Never commit this file, it contains secrets!'; + return 'Environment variables generated at /turbo/generators/templates/env/.env.local.\nPlease double check and use this file in your hosting provider to set the environment variables. \nNever commit this file, it contains secrets!'; }, ], prompts: [ @@ -271,7 +270,8 @@ export function createEnvironmentVariablesGenerator( when: (answers) => answers.values.MAILER_PROVIDER === 'nodemailer', type: 'input', name: 'values.EMAIL_TLS', - message: 'Do you want to enable TLS? (leave empty for true)', + message: + 'Do you want to enable TLS for your emails? (leave empty for true)', default: 'true', }, ],