diff --git a/examples/client/Locomotion/src/pages/ActiveRide/RideDrawer/RideOptions/index.tsx b/examples/client/Locomotion/src/pages/ActiveRide/RideDrawer/RideOptions/index.tsx index 8a565b81a..6af916ef3 100644 --- a/examples/client/Locomotion/src/pages/ActiveRide/RideDrawer/RideOptions/index.tsx +++ b/examples/client/Locomotion/src/pages/ActiveRide/RideDrawer/RideOptions/index.tsx @@ -123,9 +123,7 @@ const RideOptions = () => { }} showCash={showCash} showOffline={showOffline} - selected={ride?.paymentMethodId - && usePayments.paymentMethods.find((pm: any) => ride.paymentMethodId === pm.id) - ? ride.paymentMethodId : defaultPaymentMethod?.id} + selected={ride?.paymentMethodId || defaultPaymentMethod?.id} rideFlow isVisible={popupToShow === 'payment'} onCancel={() => clearPopup()} diff --git a/examples/client/Locomotion/src/popups/ChoosePaymentMethod/index.tsx b/examples/client/Locomotion/src/popups/ChoosePaymentMethod/index.tsx index 9dc23512e..e169b142a 100644 --- a/examples/client/Locomotion/src/popups/ChoosePaymentMethod/index.tsx +++ b/examples/client/Locomotion/src/popups/ChoosePaymentMethod/index.tsx @@ -1,6 +1,5 @@ /* eslint-disable no-unused-expressions */ import React, { useContext, useEffect, useState } from 'react'; -import { View } from 'react-native'; import PropTypes from 'prop-types'; import Modal from 'react-native-modal'; import { useNavigation } from '@react-navigation/native'; @@ -84,7 +83,11 @@ const PaymentMethodPopup = ({ useEffect(() => { const updateDefaultPaymentMethod = async () => { if (selected) { - setSelectedPaymentId(selected); + if (selected === offlinePaymentMethod.id && selectedBusinessAccountId) { + setSelectedPaymentId(selectedBusinessAccountId); + } else { + setSelectedPaymentId(selected); + } } else { const paymentMethod = await usePayments.getClientDefaultMethod(); if (paymentMethod?.id) { @@ -149,8 +152,6 @@ const PaymentMethodPopup = ({ {i18n.t('popups.choosePaymentMethod.title')} { onCancel(); - setSelectedPaymentId(selected - || (await usePayments.getClientDefaultMethod())?.id); rideFlow ? navigationService.navigate(MAIN_ROUTES.HOME) : navigationService.navigate(MAIN_ROUTES.PAYMENT);