Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove support for legacy stripe metadata #6264

Merged
merged 1 commit into from
May 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -87,7 +87,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 @@ -129,10 +129,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