From 01b101008837fc935f6d7e4708a9007037f96d56 Mon Sep 17 00:00:00 2001 From: Justyn Oh Date: Thu, 1 Jun 2023 10:59:54 +0800 Subject: [PATCH] chore: remove support for legacy stripe 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 c25f43081d..0de31a075d 100644 --- a/src/app/modules/payments/stripe.utils.ts +++ b/src/app/modules/payments/stripe.utils.ts @@ -89,7 +89,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') && @@ -131,10 +131,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)