Skip to content

Commit

Permalink
feat(payments): INT-835 Update braintree payment methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Lopez committed Oct 5, 2018
1 parent 803ee2b commit df6d38a
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,3 +2,4 @@ export const BRAINTREE = 'braintree';
export const BRAINTREE_PAYPAL = 'braintreepaypal';
export const BRAINTREE_PAYPAL_CREDIT = 'braintreepaypalcredit';
export const BRAINTREE_VISACHECKOUT = 'braintreevisacheckout';
export const BRAINTREE_GOOGLEPAY = 'googlepaybraintree';
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MULTI_OPTION } from '../payment-method-types';
import {
BRAINTREE,
BRAINTREE_GOOGLEPAY,
BRAINTREE_PAYPAL,
BRAINTREE_PAYPAL_CREDIT,
BRAINTREE_VISACHECKOUT,
Expand All @@ -15,6 +16,7 @@ function isBraintreePaymentMethod(id) {
case BRAINTREE_PAYPAL:
case BRAINTREE_PAYPAL_CREDIT:
case BRAINTREE_VISACHECKOUT:
case BRAINTREE_GOOGLEPAY:
return true;
default:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ describe('PaymentMethodIdMapper', () => {
paymentMethod = { id: PAYMENT_METHODS.BRAINTREE_VISACHECKOUT };
expect(paymentMethodIdMapper.mapToId(paymentMethod)).toEqual(PAYMENT_METHODS.BRAINTREE);
});

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

0 comments on commit df6d38a

Please sign in to comment.