Skip to content

Commit

Permalink
always send merchantId to cpnw if not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
surekhaw committed Oct 9, 2023
1 parent 4ded2eb commit 8c33c2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/library/zoid/message/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ export default {
const isInvalid = merchantId.split(',').some(id => id.length !== 13 && id.length !== 10);
if (isInvalid) {
logInvalid('merchantId', 'Ensure the correct Merchant ID has been entered.');
} else {
return merchantId;
}
return merchantId;
}
}
return undefined;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/spec/src/zoid/message/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('validate', () => {

merchantId = validate.merchantId({ props: { merchantId: 'DEV00000000,DEV00000001NI' } });

expect(merchantId).toBeUndefined();
expect(merchantId).toEqual(merchantId);
expect(console.warn).toHaveBeenCalledTimes(1);
expect(console.warn).toHaveBeenLastCalledWith(
expect.stringContaining('invalid_option_value'),
Expand All @@ -71,7 +71,7 @@ describe('validate', () => {

merchantId = validate.merchantId({ props: { merchantId: 'client-id:test_client_id' } });

expect(merchantId).toBeUndefined();
expect(merchantId).toEqual(merchantId);
expect(console.warn).toHaveBeenCalledTimes(1);
expect(console.warn).toHaveBeenLastCalledWith(
expect.stringContaining('invalid_option_value'),
Expand Down

0 comments on commit 8c33c2f

Please sign in to comment.