Skip to content

Commit

Permalink
handle lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gilv93 committed Sep 19, 2024
1 parent 7477e12 commit a6069aa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
1 change: 0 additions & 1 deletion lib/recurly/alternative-payment-methods/gateways/adyen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isBindingElement } from 'typescript';
import Base from './base';

class AdyenGateway extends Base {
Expand Down
6 changes: 3 additions & 3 deletions lib/recurly/risk/risk.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export class Risk {
*/
static preflight ({ recurly, number, month, year, cvv }) {
function resolveRoute (recurly) {
let route = '/risk/preflights'
let route = '/risk/preflights';
if (recurly.config.risk.threeDSecure.proactive.enabled) {
route += `?proactive=true&gatewayCode=${recurly.config.risk.threeDSecure.proactive.gateway_code}`
route += `?proactive=true&gatewayCode=${recurly.config.risk.threeDSecure.proactive.gateway_code}`;
}
return route
return route;
}

return recurly.request.get({ route: resolveRoute(recurly) })
Expand Down
9 changes: 5 additions & 4 deletions lib/recurly/risk/three-d-secure/strategy/braintree.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default class BraintreeStrategy extends ThreeDSecureStrategy {
return Promise.resolve();
}

const { PREFLIGHT_TIMEOUT } = BraintreeStrategy;
const data = {
gatewayType: BraintreeStrategy.strategyName,
gatewayCode: proactive.gateway_code,
Expand All @@ -29,12 +28,14 @@ export default class BraintreeStrategy extends ThreeDSecureStrategy {

// we don't really need to do anything once we get a response except resolve with relevant data instead of session_id
return recurly.request.post({ route: '/risk/authentications', data })
.then(({ paymentMethodNonce, clientToken, bin }) => ({
.then(({ paymentMethodNonce, clientToken, bin }) => (
{
payment_method_nonce: paymentMethodNonce,
client_token: clientToken,
bin,
proactive: true
}));
}
));
}


Expand All @@ -50,7 +51,7 @@ export default class BraintreeStrategy extends ThreeDSecureStrategy {
}

get braintreeClientToken () {
return this.actionToken.three_d_secure.params.client_token
return this.actionToken.three_d_secure.params.client_token;
}

get nonce () {
Expand Down
6 changes: 3 additions & 3 deletions lib/recurly/risk/three-d-secure/three-d-secure.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class ThreeDSecure extends RiskConcern {
return new strategy({ threeDSecure: this, actionToken });
}

getStrategyForProactiveToken(token) {
getStrategyForProactiveToken (token) {
const strategy = ThreeDSecure.getStrategyForGatewayType(token.three_d_secure.gateway.type);
return new strategy({ threeDSecure: this, proactiveToken: token });
}
Expand Down Expand Up @@ -230,13 +230,13 @@ export class ThreeDSecure extends RiskConcern {
return this.actionTokenId || this.proactiveTokenId;
}

resolveActionToken(token) {
resolveActionToken (token) {
assertIsActionToken(token);
this.strategy = this.getStrategyForActionToken(token);
this.strategy.on('done', (...args) => this.onStrategyDone(...args));
}

resolveProactiveToken(token) {
resolveProactiveToken (token) {
this.strategy = this.getStrategyForProactiveToken(token);
this.strategy.on('done', (...args) => this.onStrategyDone(...args));
}
Expand Down
8 changes: 4 additions & 4 deletions lib/recurly/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function token (customerData, bus, done) {
const { number, month, year, cvv } = inputs;
Risk.preflight({ recurly: this, number, month, year, cvv })
.then(results => {
enrichInputs(this, inputs, results)
enrichInputs(this, inputs, results);
})
.then(() => this.request.post({ route: '/token', data: inputs, done: complete }))
.done();
Expand All @@ -189,10 +189,10 @@ function token (customerData, bus, done) {
done(null, res);
}

function enrichInputs(recurly, inputs, results) {
function enrichInputs (recurly, inputs, results) {
if (results.length === 0) return;

inputs.risk = []
inputs.risk = [];

results.forEach(result => {
if (result.processor === 'braintree_blue') {
Expand All @@ -201,6 +201,6 @@ function token (customerData, bus, done) {
} else {
inputs.risk.push(result);
}
})
});
}
}

0 comments on commit a6069aa

Please sign in to comment.