Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/actions/ebs-sync/ebs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { resolveVbndReasonCode } from './discount-reason-codes.js';
const TRANSIENT_ERROR_PATTERN = /timeout|timed out|aborted|fetch failed|network|ECONNRESET|ENOTFOUND|ETIMEDOUT|EAI_AGAIN/i;

const CHASE_AVS_UNVALIDATED_CODES = new Set([
'1', '2', '3', '4', '5', '6', '8', 'G', 'J', 'M1', 'M8', 'N4', 'N6', 'R', 'UK',
'1', '2', '3', '4', '5', '6', '8', 'G', 'J', 'M1', 'M8', 'N4', 'N6', 'R', 'UK', 'UNKNOWN',
]);

/**
Expand Down Expand Up @@ -436,7 +436,7 @@ function resolveShippingIsValidated(order) {
function resolveBillingIsValidated(paymentSnapshot) {
if (paymentSnapshot?.method !== 'chasehpp') return true;
if (Number(paymentSnapshot.amount || 0) === 0) return true;
return !CHASE_AVS_UNVALIDATED_CODES.has(String(paymentSnapshot.avsMatch || '').trim());
return !CHASE_AVS_UNVALIDATED_CODES.has(String(paymentSnapshot.avsMatch || '').trim().toUpperCase());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/ebs-sync/ebs-e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ describe('ebs-sync e2e', () => {
expect(addressValidation(xml, 'BillTo')).toBe('true');
});

test.each(['1', '2 ', 'G', 'M1', 'UK'])('BillTo IsValidated is false for Chase AVS %s', async (avsMatch) => {
test.each(['1', '2 ', 'G', 'M1', 'UK', 'Unknown'])('BillTo IsValidated is false for Chase AVS %s', async (avsMatch) => {
const xml = await buildXml(
clone(CC_APPROVED_ORDER),
withCompletedPayment(loadJournal('journal-cc-approved.ndjson'), { avsMatch }),
Expand Down
Loading