From bf73136a3fd9feedcacbd5bd72ca01fc8036106a Mon Sep 17 00:00:00 2001 From: Justyn Oh Date: Thu, 4 May 2023 15:25:36 +0800 Subject: [PATCH] chore: remove support for legacy metadata --- src/app/modules/payments/stripe.utils.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/modules/payments/stripe.utils.ts b/src/app/modules/payments/stripe.utils.ts index 651cdc491d..b3c106156b 100644 --- a/src/app/modules/payments/stripe.utils.ts +++ b/src/app/modules/payments/stripe.utils.ts @@ -81,7 +81,7 @@ export const getChargeIdFromNestedCharge = ( const isStripeMetadata = ( obj: Stripe.Metadata, ): obj is StripePaymentMetadataDto => - // hasProp(obj, 'env') && // TODO: Make this required later + hasProp(obj, 'env') && hasProp(obj, 'formTitle') && hasProp(obj, 'formId') && hasProp(obj, 'submissionId') && @@ -123,10 +123,7 @@ export const getMetadataPaymentId = ( }) return err(new StripeMetadataValidPaymentIdNotFoundError()) } - // Explicit check for metadata.env to ensure that legacy metadata which does - // not have the env value still gets processed. - // TODO: remove the existence check later. - if (metadata.env && metadata.env !== config.envSiteName) { + if (metadata.env !== config.envSiteName) { return err(new StripeMetadataIncorrectEnvError()) } return ok(metadata.paymentId)