Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gilv93 committed Oct 25, 2024
1 parent 269d55f commit 9d67a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AlternativePaymentMethods extends Emitter {
}

async submit ({ billingAddress } = {}) {
this.validateBillingAddress(billingAddress);
AlternativePaymentMethods.validateBillingAddress(billingAddress);
if (this.gatewayStrategy.data?.paymentMethod?.type == 'cashapp') {
return await this.gatewayStrategy.submitWebComponent(billingAddress);
}
Expand Down Expand Up @@ -185,7 +185,7 @@ class AlternativePaymentMethods extends Emitter {
});
}

validateBillingAddress (billingAddress) {
static validateBillingAddress (billingAddress) {
if (!billingAddress) {
return;
}
Expand Down
4 changes: 3 additions & 1 deletion lib/recurly/alternative-payment-methods/gateways/adyen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Base from './base';
import AlternativePaymentMethods from '../alternative-payment-methods';


class AdyenGateway extends Base {
constructor (options, recurly) {
Expand All @@ -10,7 +12,7 @@ class AdyenGateway extends Base {
this.customerBillingAddress = undefined;

if (options.customer?.billingAddress) {
super.validateBillingAddress(options.customer.billingAddress);
AlternativePaymentMethods.validateBillingAddress(options.customer.billingAddress);
this.customerBillingAddress = options.customer.billingAddress;
}
}
Expand Down

0 comments on commit 9d67a4f

Please sign in to comment.