Skip to content

Commit

Permalink
feat(payments): INT-1479 Add extraData to credit card payload
Browse files Browse the repository at this point in the history
  • Loading branch information
josesonora authored and BC-JMolina committed Jun 5, 2019
1 parent 7124f2d commit a962d0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/payment/v1/payment-mappers/payment-mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default class PaymentMapper {
verification_value: payment.ccCvv,
year: payment.ccExpiry ? toNumber(payment.ccExpiry.year) : null,
customer_code: payment.ccCustomerCode,
three_d_secure: payment.threeDSecure,
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/typedefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
* @property {string} ccNumber
* @property {?boolean} shouldSaveInstrument
* @property {?string} instrumentId
* @property {?ThreeDSecure} threeDSecure
*/

/**
Expand Down Expand Up @@ -148,6 +149,7 @@
* @property {string} cavv
* @property {string} eci
* @property {string} xid
* @property {string} token
*/

/**
Expand Down
3 changes: 3 additions & 0 deletions test/mocks/payment-request-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ const paymentRequestDataMock = {
ccCustomerCode: 'XYZ',
deviceSessionId: 'fakeDeviceSessionId',
shouldSaveInstrument: false,
threeDSecure: {
token: 'aaa.bbb.ccc',
},
},
paymentMethod: {
id: 'paypalprous',
Expand Down
1 change: 1 addition & 0 deletions test/payment/v1/payment-mappers/payment-mapper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('PaymentMapper', () => {
verification_value: data.payment.ccCvv,
year: parseInt(data.payment.ccExpiry.year, 10),
customer_code: data.payment.ccCustomerCode,
three_d_secure: data.payment.threeDSecure,
},
device: {
fingerprint_id: data.orderMeta.deviceFingerprint,
Expand Down

0 comments on commit a962d0f

Please sign in to comment.