Skip to content

Commit

Permalink
feat(payments): PAYPAL-2449 added braintreelocalmethods
Browse files Browse the repository at this point in the history
  • Loading branch information
andriiVitvitskyi1990 committed May 30, 2023
1 parent b397a5e commit 690a9d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/payment/payment-method-ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const BRAINTREE = 'braintree';
export const BRAINTREE_PAYPAL = 'braintreepaypal';
export const BRAINTREE_PAYPAL_CREDIT = 'braintreepaypalcredit';
export const BRAINTREE_VISACHECKOUT = 'braintreevisacheckout';
export const BRAINTREE_LOCAL_METHODS = 'braintreelocalmethods';
export const BRAINTREE_GOOGLEPAY = 'googlepaybraintree';
export const BRAINTREE_ACH = 'braintreeach';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
BRAINTREE_PAYPAL,
BRAINTREE_PAYPAL_CREDIT,
BRAINTREE_VISACHECKOUT,
BRAINTREE_LOCAL_METHODS,
PAYPAL_COMMERCE,
PAYPAL_COMMERCE_CREDIT,
PAYPAL_COMMERCE_CREDIT_CARDS,
Expand All @@ -24,6 +25,7 @@ function isBraintreePaymentMethod(id) {
case BRAINTREE_VISACHECKOUT:
case BRAINTREE_GOOGLEPAY:
case BRAINTREE_ACH:
case BRAINTREE_LOCAL_METHODS:
return true;
default:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ describe('PaymentMethodIdMapper', () => {
paymentMethod = { id: PAYMENT_METHODS.PAYPAL_COMMERCE_VENMO };
expect(paymentMethodIdMapper.mapToId(paymentMethod)).toEqual(PAYMENT_METHODS.PAYPAL_COMMERCE);
});

it('returns "braintree" if the payment method is "braintreelocalmethods"', () => {
paymentMethod = { id: PAYMENT_METHODS.BRAINTREE_LOCAL_METHODS };
expect(paymentMethodIdMapper.mapToId(paymentMethod)).toEqual(PAYMENT_METHODS.BRAINTREE);
});
});

0 comments on commit 690a9d5

Please sign in to comment.