Skip to content

Commit

Permalink
Fallback if unknown payment gateway.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura committed Dec 5, 2024
1 parent b13a6e8 commit 2ccb3cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/navigation/checkout/Payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ class CreditCard extends Component {
// https://github.com/coopcycle/coopcycle-app/issues/1697
// 'mercadopago': 'CheckoutMercadopago',
};

const cardRoute = Object.prototype.hasOwnProperty.call(routesByCardGateway, this.props.paymentGateway) ?
routesByCardGateway[this.props.paymentGateway] : 'CheckoutPaymentMethodCard';

const routesByMethod = {
cash_on_delivery: 'CheckoutPaymentMethodCashOnDelivery',
card: routesByCardGateway[this.props.paymentGateway],
card: cardRoute,
edenred: 'CheckoutPaymentMethodEdenred',
'edenred+card': 'CheckoutPaymentMethodEdenred',
};
Expand Down

0 comments on commit 2ccb3cc

Please sign in to comment.