Skip to content

Commit

Permalink
chore: remove support for legacy stripe metadata (#6415)
Browse files Browse the repository at this point in the history
  • Loading branch information
justynoh authored Jun 5, 2023
1 parent 45948f3 commit 07ce6ad
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/modules/payments/stripe.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') &&
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 07ce6ad

Please sign in to comment.