Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(authorizenet): CC last 4 is too short #2639

Merged
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
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