diff --git a/src/CONST.ts b/src/CONST.ts index 0778478c295..3488363922e 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1149,6 +1149,7 @@ const CONST = { MANY_WRITES_ERROR: 665, UNABLE_TO_RETRY: 'unableToRetry', UPDATE_REQUIRED: 426, + INCORRECT_MAGIC_CODE: 451, }, HTTP_STATUS: { // When Cloudflare throttles diff --git a/src/libs/actions/Card.ts b/src/libs/actions/Card.ts index 15d1eadb662..e423af5bb7e 100644 --- a/src/libs/actions/Card.ts +++ b/src/libs/actions/Card.ts @@ -202,7 +202,7 @@ function revealVirtualCardDetails(cardID: number, validateCode: string): Promise API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.REVEAL_EXPENSIFY_CARD_DETAILS, parameters) .then((response) => { if (response?.jsonCode !== CONST.JSON_CODE.SUCCESS) { - if (response?.message === 'Incorrect or invalid magic code. Please try again.') { + if (response?.jsonCode === CONST.JSON_CODE.INCORRECT_MAGIC_CODE) { // eslint-disable-next-line prefer-promise-reject-errors reject('validateCodeForm.error.incorrectMagicCode'); return;