Skip to content

Commit

Permalink
added additional params for braintree 3DS
Browse files Browse the repository at this point in the history
  • Loading branch information
arzitney committed Mar 28, 2024
1 parent fd9e578 commit eac3936
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/recurly/risk/three-d-secure/strategy/braintree.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export default class BraintreeStrategy extends ThreeDSecureStrategy {
return this.actionToken.transaction.amount;
}

get billingInfo () {
return this.actionToken.billing_info
}

get bin () {
return this.actionToken.three_d_secure.params.bin;
}
Expand All @@ -51,7 +55,7 @@ export default class BraintreeStrategy extends ThreeDSecureStrategy {
this.whenReady(() => {
debug('Attempting to load braintree');

const { braintree, braintreeClientToken, amount, nonce, bin } = this;
const { braintree, braintreeClientToken, amount, nonce, bin, billingInfo } = this;

braintree.client.create({
authorization: braintreeClientToken
Expand All @@ -66,6 +70,18 @@ export default class BraintreeStrategy extends ThreeDSecureStrategy {
nonce: nonce,
bin: bin,
challengeRequested: true,
collectDeviceData: true,
billingAddress: {
givenName: billingInfo.first_name,
surname: billingInfo.last_name,
phoneNumber: billingInfo.phone,
streetAddress: billingInfo.address1,
extendedAddress: billingInfo.address2,
locality: billingInfo.city,
region: billingInfo.state,
postalCode: billingInfo.zip,
countryCodeAlpha2: billingInfo.country
},
onLookupComplete: (data, next) => {
next();
}
Expand Down

0 comments on commit eac3936

Please sign in to comment.