Skip to content

Commit

Permalink
on submit AUT-18223 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerGery committed Jan 9, 2024
1 parent 056ef46 commit 446eede
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,18 @@ const PaymentMethodPopup = ({
updateDefaultPaymentMethod();
}, [usePayments.paymentMethods, selected, chosenService]);

const onSave = (id?: string) => {
if (isBusinessMode) {
const onSave = () => {
const businessPaymentSelected = showBusinessPaymentMethods
&& usePayments.businessPaymentMethods.some(
(paymentMethod: any) => paymentMethod.id === selectedPaymentId,
);
if (businessPaymentSelected) {
onSubmit({
id: selectedPaymentId,
isBusiness: true,
});
} else {
onSubmit(id || selectedPaymentId);
onSubmit(selectedPaymentId);
}
onCancel();
};
Expand Down Expand Up @@ -187,6 +191,7 @@ const PaymentMethodPopup = ({
<Footer>
<FlexCont style={{ justifyContent: 'center' }}>
<SelectButton
disabled={!selectedPaymentId}
testID="selectCard"
type="confirm"
onPress={() => {
Expand Down

0 comments on commit 446eede

Please sign in to comment.