Skip to content

Commit

Permalink
HACK: show payment failure always
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewHEguardian committed Nov 24, 2023
1 parent 1a13b30 commit 2c0b622
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,22 @@ router.get(
),
)
.then((productDetails) => {
mdapiResponse.products = productDetails;
mdapiResponse.products = productDetails.map((productDetail) => {
productDetail.alertText = 'payment failure';
return productDetail;
});
response.json(mdapiResponse);
})
.catch((error) => {
const errorMessage = `Unexpected error when augmenting members-data-api response with 'deliveryAddressChangeEffectiveDate' error message was ${error}`;
log.error(errorMessage, error);
Sentry.captureMessage(errorMessage);
mdapiResponse.products = augmentedWithTestUser;
mdapiResponse.products = augmentedWithTestUser.map(
(productDetail) => {
productDetail.alertText = 'payment failure';
return productDetail;
},
);
response.json(mdapiResponse); // fallback to sending the response augmented with just isTestUser
});
})(
Expand Down

0 comments on commit 2c0b622

Please sign in to comment.