ordering-ui-react-native 0.15.11 → 0.15.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
PaymentOptions as PaymentOptionsController,
|
|
11
11
|
useLanguage,
|
|
12
|
+
ToastType,
|
|
13
|
+
useToast,
|
|
12
14
|
} from 'ordering-components/native';
|
|
13
15
|
import { useTheme } from 'styled-components/native';
|
|
14
16
|
import { PaymentOptionCash } from '../PaymentOptionCash';
|
|
@@ -59,7 +61,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
59
61
|
} = props
|
|
60
62
|
|
|
61
63
|
const theme = useTheme();
|
|
62
|
-
|
|
64
|
+
const [, { showToast }] = useToast();
|
|
63
65
|
|
|
64
66
|
const getPayIcon = (method: string) => {
|
|
65
67
|
switch (method) {
|
|
@@ -95,11 +97,18 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
95
97
|
// ]
|
|
96
98
|
|
|
97
99
|
const handlePaymentMethodClick = (paymethod: any) => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
if (cart?.balance > 0) {
|
|
101
|
+
const isPopupMethod = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect', 'paypal'].includes(paymethod?.gateway)
|
|
102
|
+
if (webViewPaymentGateway.includes(paymethod?.gateway)) {
|
|
103
|
+
handlePaymentMethodClickCustom(paymethod)
|
|
104
|
+
}
|
|
105
|
+
handlePaymethodClick(paymethod, isPopupMethod)
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
showToast(
|
|
109
|
+
ToastType.Error,
|
|
110
|
+
t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method'))
|
|
111
|
+
;
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
useEffect(() => {
|