Skip to content

Commit

Permalink
fix(authorizenet): CC last 4 is too short (#2639)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Dec 7, 2023
1 parent a84491e commit 6ff51a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('AuthorizeNet | Drivers | Magento | Transformers', () => {
dataDescriptor: null,
},
};
const ccNumber = '1243123412341234';
const ccNumber = '1243112341234';
const ccLast4 = '1234';
expect(transformMagentoAuthorizeNetResponse(authorizeNetResponse, ccNumber)).toEqual(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function transformMagentoAuthorizeNetResponse(response: AuthorizeNetRespo
return {
code: 'authorizenet_acceptjs',
authorizenet_acceptjs: {
cc_last_4: parseInt(ccNumber.slice(12), 10),
cc_last_4: parseInt(ccNumber.slice(ccNumber.length - 4), 10),
opaque_data_descriptor: 'COMMON.ACCEPT.INAPP.PAYMENT',
opaque_data_value: response.opaqueData.dataValue,
},
Expand Down

0 comments on commit 6ff51a6

Please sign in to comment.