Skip to content

Commit

Permalink
feat(payments): PAYPAL-1487 add PayPal Commerce Venmo
Browse files Browse the repository at this point in the history
  • Loading branch information
koa75 committed Jun 1, 2022
1 parent 455dc9b commit a3489ac
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 @@ -8,3 +8,4 @@ export const PAYPAL_COMMERCE = 'paypalcommerce';
export const PAYPAL_COMMERCE_ALTERNATIVE_METHODS = 'paypalcommercealternativemethods';
export const PAYPAL_COMMERCE_CREDIT = 'paypalcommercecredit';
export const PAYPAL_COMMERCE_CREDIT_CARDS = 'paypalcommercecreditcards';
export const PAYPAL_COMMERCE_VENMO = 'paypalcommercevenmo';
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
PAYPAL_COMMERCE_CREDIT,
PAYPAL_COMMERCE_CREDIT_CARDS,
PAYPAL_COMMERCE_ALTERNATIVE_METHODS,
PAYPAL_COMMERCE_VENMO,
} from '../payment-method-ids';

/**
Expand Down Expand Up @@ -36,6 +37,7 @@ function isPaypalCommercePaymentMethod(id) {
case PAYPAL_COMMERCE_CREDIT:
case PAYPAL_COMMERCE_CREDIT_CARDS:
case PAYPAL_COMMERCE_ALTERNATIVE_METHODS:
case PAYPAL_COMMERCE_VENMO:
return true;
default:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,9 @@ describe('PaymentMethodIdMapper', () => {
paymentMethod = { id: PAYMENT_METHODS.PAYPAL_COMMERCE_ALTERNATIVE_METHODS };
expect(paymentMethodIdMapper.mapToId(paymentMethod)).toEqual(PAYMENT_METHODS.PAYPAL_COMMERCE);
});

it('returns "paypalcommerce" if the payment method is "paypalcommercevenmo"', () => {
paymentMethod = { id: PAYMENT_METHODS.PAYPAL_COMMERCE_VENMO };
expect(paymentMethodIdMapper.mapToId(paymentMethod)).toEqual(PAYMENT_METHODS.PAYPAL_COMMERCE);
});
});

0 comments on commit a3489ac

Please sign in to comment.