ordering-ui-react-native 0.22.75 → 0.22.76-release
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 +5 -7
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +40 -39
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/context/OfflineActions/index.tsx +236 -0
- package/src/providers/AlertProvider.tsx +3 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +5 -3
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessController/index.tsx +8 -3
- package/themes/business/src/components/BusinessProductList/index.tsx +3 -2
- package/themes/business/src/components/Chat/index.tsx +15 -3
- package/themes/business/src/components/DriverMap/index.tsx +44 -33
- package/themes/business/src/components/FloatingButton/index.tsx +3 -2
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -1
- package/themes/business/src/components/LoginForm/index.tsx +123 -98
- package/themes/business/src/components/LogoutButton/index.tsx +13 -4
- package/themes/business/src/components/MapView/RenderMarker.tsx +146 -0
- package/themes/business/src/components/MapView/index.tsx +68 -142
- package/themes/business/src/components/NewOrderNotification/index.tsx +38 -54
- package/themes/business/src/components/OrderDetails/Business.tsx +56 -20
- package/themes/business/src/components/OrderDetails/Delivery.tsx +111 -42
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +146 -36
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +51 -28
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +17 -16
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
- package/themes/business/src/components/OrderSummary/index.tsx +271 -176
- package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
- package/themes/business/src/components/OrdersOption/index.tsx +207 -144
- package/themes/business/src/components/OrdersOption/styles.tsx +14 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +20 -8
- package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
- package/themes/business/src/components/PreviousOrders/styles.tsx +2 -1
- package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +143 -75
- package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +1 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +15 -16
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +48 -10
- package/themes/business/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/config/currency.tsx +1010 -0
- package/themes/business/src/hooks/useLocation.tsx +16 -12
- package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
- package/themes/business/src/types/index.tsx +26 -4
- package/themes/business/src/utils/index.tsx +26 -2
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +9 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +121 -57
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +223 -219
- package/themes/original/src/components/AddressForm/index.tsx +56 -17
- package/themes/original/src/components/AppleLogin/index.tsx +3 -4
- package/themes/original/src/components/BusinessController/index.tsx +4 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +102 -90
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +7 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +8 -13
- package/themes/original/src/components/BusinessPreorder/index.tsx +30 -17
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +72 -69
- package/themes/original/src/components/BusinessProductsList/index.tsx +4 -5
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -4
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +1 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -1
- package/themes/original/src/components/Cart/index.tsx +43 -12
- package/themes/original/src/components/Checkout/index.tsx +126 -98
- package/themes/original/src/components/FloatingButton/index.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +2 -1
- package/themes/original/src/components/GoogleMap/index.tsx +3 -2
- package/themes/original/src/components/Help/functions.tsx +76 -0
- package/themes/original/src/components/Help/index.tsx +74 -29
- package/themes/original/src/components/Help/styles.tsx +4 -1
- package/themes/original/src/components/HelpOptions/index.tsx +53 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +36 -11
- package/themes/original/src/components/LastOrder/index.tsx +1 -1
- package/themes/original/src/components/LoginForm/index.tsx +11 -5
- package/themes/original/src/components/MessageListing/index.tsx +1 -1
- package/themes/original/src/components/Messages/index.tsx +562 -555
- package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
- package/themes/original/src/components/MomentOption/index.tsx +141 -61
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/MomentSelector/index.tsx +5 -2
- package/themes/original/src/components/MultiCheckout/index.tsx +78 -33
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +2 -2
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -2
- package/themes/original/src/components/NavBar/index.tsx +6 -2
- package/themes/original/src/components/NotFoundSource/index.tsx +40 -39
- package/themes/original/src/components/NotFoundSource/styles.tsx +18 -9
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +11 -4
- package/themes/original/src/components/OrderDetails/index.tsx +44 -20
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +5 -4
- package/themes/original/src/components/OrderSummary/index.tsx +32 -11
- package/themes/original/src/components/OrderTypeSelector/index.tsx +120 -120
- package/themes/original/src/components/OrdersOption/index.tsx +325 -325
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -0
- package/themes/original/src/components/PaymentOptions/index.tsx +471 -459
- package/themes/original/src/components/PhoneInputNumber/index.tsx +92 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +28 -37
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +15 -14
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/SignupForm/index.tsx +40 -24
- package/themes/original/src/components/SingleOrderCard/index.tsx +8 -5
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -1
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +7 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +2 -2
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +7 -2
- package/themes/original/src/components/UserDetails/index.tsx +17 -16
- package/themes/original/src/components/UserFormDetails/index.tsx +109 -67
- package/themes/original/src/components/UserVerification/index.tsx +18 -5
- package/themes/original/src/components/VerifyPhone/index.tsx +1 -1
- package/themes/original/src/components/shared/OInput.tsx +97 -97
- package/themes/original/src/components/shared/OModal.tsx +7 -2
- package/themes/original/src/providers/AlertProvider.tsx +1 -1
- package/themes/original/src/types/index.tsx +700 -695
- package/themes/original/src/utils/index.tsx +50 -34
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +0 -62
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +0 -12
- package/themes/original/src/components/HelpGuide/index.tsx +0 -68
- package/themes/original/src/components/HelpGuide/styles.tsx +0 -12
- package/themes/original/src/components/HelpOrder/index.tsx +0 -71
- package/themes/original/src/components/HelpOrder/styles.tsx +0 -13
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { FlatList, TouchableOpacity, View, StyleSheet, KeyboardAvoidingView, Platform } from 'react-native';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Placeholder,
|
|
5
|
+
PlaceholderLine,
|
|
6
|
+
Fade
|
|
7
7
|
} from "rn-placeholder";
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
PaymentOptions as PaymentOptionsController,
|
|
11
|
+
useLanguage,
|
|
12
|
+
ToastType,
|
|
13
|
+
useToast,
|
|
14
|
+
useSession
|
|
15
15
|
} from 'ordering-components/native';
|
|
16
16
|
import { useTheme } from 'styled-components/native';
|
|
17
17
|
import { PaymentOptionCash } from '../PaymentOptionCash';
|
|
@@ -27,10 +27,10 @@ import { PaymentOptionCard } from '../PaymentOptionCard'
|
|
|
27
27
|
import { OText, OIcon, OModal, OButton } from '../shared';
|
|
28
28
|
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
PMContainer,
|
|
31
|
+
PMItem,
|
|
32
|
+
PMCardSelected,
|
|
33
|
+
PMCardItemContent
|
|
34
34
|
} from './styles'
|
|
35
35
|
import { getIconCard, flatArray } from '../../utils';
|
|
36
36
|
import { useApplePay } from '@stripe/stripe-react-native';
|
|
@@ -48,248 +48,258 @@ const stripeDirectMethods = ['stripe_direct']
|
|
|
48
48
|
const webViewPaymentGateway: any = ['paypal', 'square']
|
|
49
49
|
const multiCheckoutMethods = ['global_google_pay', 'global_apple_pay']
|
|
50
50
|
const cardsPaymethods = ['credomatic']
|
|
51
|
+
const guestNotSupportedMethods = ['stripe', 'stripe_connect', 'stripe_redirect']
|
|
52
|
+
const popupMethods = [...guestNotSupportedMethods, 'stripe_direct', 'paypal']
|
|
51
53
|
|
|
52
54
|
const PaymentOptionsUI = (props: any) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
55
|
+
const {
|
|
56
|
+
cart,
|
|
57
|
+
errorCash,
|
|
58
|
+
isLoading,
|
|
59
|
+
isDisabled,
|
|
60
|
+
paymethodData,
|
|
61
|
+
paymethodsList,
|
|
62
|
+
setPaymethodData,
|
|
63
|
+
onNavigationRedirect,
|
|
64
|
+
handlePaymethodClick,
|
|
65
|
+
handlePaymethodDataChange,
|
|
66
|
+
isOpenMethod,
|
|
67
|
+
handlePaymentMethodClickCustom,
|
|
68
|
+
handlePlaceOrder,
|
|
69
|
+
merchantId,
|
|
70
|
+
urlscheme,
|
|
71
|
+
setMethodPaySupported,
|
|
72
|
+
placeByMethodPay,
|
|
73
|
+
methodPaySupported,
|
|
74
|
+
setPlaceByMethodPay,
|
|
75
|
+
setCardList,
|
|
76
|
+
onPaymentChange,
|
|
77
|
+
requiredFields,
|
|
78
|
+
openUserModal,
|
|
79
|
+
paymethodClicked,
|
|
80
|
+
setPaymethodClicked,
|
|
81
|
+
androidAppId,
|
|
82
|
+
setUserHasCards,
|
|
83
|
+
guestDisabledError,
|
|
84
|
+
handleOpenGuestSignup
|
|
85
|
+
} = props
|
|
86
|
+
|
|
87
|
+
const theme = useTheme();
|
|
88
|
+
const [, { showToast }] = useToast();
|
|
89
|
+
const [{ user }] = useSession()
|
|
90
|
+
const { confirmApplePayPayment } = useApplePay()
|
|
91
|
+
|
|
92
|
+
const getPayIcon = (method: string) => {
|
|
93
|
+
switch (method) {
|
|
94
|
+
case 'cash':
|
|
95
|
+
return theme.images.general.cash
|
|
96
|
+
case 'card_delivery':
|
|
97
|
+
return theme.images.general.carddelivery
|
|
98
|
+
case 'paypal':
|
|
99
|
+
return theme.images.general.paypal
|
|
100
|
+
case 'stripe':
|
|
101
|
+
return theme.images.general.creditCard
|
|
102
|
+
case 'stripe_direct':
|
|
103
|
+
return theme.images.general.stripecc
|
|
104
|
+
case 'stripe_connect':
|
|
105
|
+
return theme.images.general.stripes
|
|
106
|
+
case 'stripe_redirect':
|
|
107
|
+
return theme.images.general.stripesb
|
|
108
|
+
case 'apple_pay':
|
|
109
|
+
return theme.images.general.applePayMark
|
|
110
|
+
case 'google_pay':
|
|
111
|
+
return theme.images.general.googlePayMark
|
|
112
|
+
default:
|
|
113
|
+
return theme.images.general.creditCard
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const [, t] = useLanguage();
|
|
118
|
+
|
|
119
|
+
const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false, card: false });
|
|
120
|
+
const paymethodSelected = props.paySelected || props.paymethodSelected || isOpenMethod?.paymethod
|
|
121
|
+
// const [{ token }] = useSession()
|
|
122
|
+
|
|
123
|
+
// const [card, setCard] = useState(null);
|
|
124
|
+
|
|
125
|
+
// const stripeRedirectValues = [
|
|
126
|
+
// { name: t('SELECT_A_PAYMENT_METHOD', 'Select a payment method'), value: '-1' },
|
|
127
|
+
// ]
|
|
128
|
+
|
|
129
|
+
const paymethodsFieldRequired = ['paypal', 'apple_pay', 'global_apple_pay']
|
|
130
|
+
|
|
131
|
+
const handlePaymentMethodClick = (paymethod: any) => {
|
|
132
|
+
const _guestNotSupportedMethods = guestDisabledError ? popupMethods : guestNotSupportedMethods
|
|
133
|
+
if (handleOpenGuestSignup && _guestNotSupportedMethods.includes(paymethod?.gateway) && !!user?.guest_id) {
|
|
134
|
+
handleOpenGuestSignup()
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
if (cart?.balance > 0 || !!user?.guest_id) {
|
|
138
|
+
if (paymethodsFieldRequired.includes(paymethod?.gateway) && requiredFields.length > 0) {
|
|
139
|
+
openUserModal && openUserModal(true)
|
|
140
|
+
setPaymethodClicked({
|
|
141
|
+
confirmed: false,
|
|
142
|
+
paymethod
|
|
143
|
+
})
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
const isPopupMethod = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect', 'paypal'].includes(paymethod?.gateway)
|
|
147
|
+
if (webViewPaymentGateway.includes(paymethod?.gateway)) {
|
|
148
|
+
handlePaymentMethodClickCustom(paymethod)
|
|
149
|
+
}
|
|
150
|
+
handlePaymethodClick(paymethod, isPopupMethod)
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
showToast(
|
|
154
|
+
ToastType.Error,
|
|
155
|
+
t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method'))
|
|
156
|
+
;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (cart?.balance === 0) {
|
|
161
|
+
handlePaymethodClick(null)
|
|
162
|
+
}
|
|
163
|
+
}, [cart?.balance])
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (paymethodsList.paymethods.length === 1) {
|
|
167
|
+
handlePaymethodClick && handlePaymethodClick(paymethodsList.paymethods[0])
|
|
168
|
+
}
|
|
169
|
+
}, [paymethodsList.paymethods])
|
|
170
|
+
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if (paymethodSelected?.gateway !== 'cash' && errorCash) {
|
|
173
|
+
props.setErrorCash(false)
|
|
174
|
+
}
|
|
175
|
+
}, [paymethodSelected])
|
|
176
|
+
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (props.paySelected && props.paySelected?.data) {
|
|
179
|
+
requestAnimationFrame(() => {
|
|
180
|
+
setPaymethodData && setPaymethodData(props.paySelected?.data)
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
}, [props.paySelected])
|
|
184
|
+
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
if (methodsPay.includes(paymethodSelected?.gateway) && paymethodData?.id && paymethodSelected?.data?.card) {
|
|
187
|
+
handlePlaceOrder(confirmApplePayPayment)
|
|
188
|
+
}
|
|
189
|
+
}, [paymethodData, paymethodSelected])
|
|
190
|
+
|
|
191
|
+
useEffect(() => {
|
|
192
|
+
if (paymethodClicked?.confirmed) {
|
|
193
|
+
handlePaymentMethodClickCustom(paymethodClicked?.paymethod)
|
|
194
|
+
}
|
|
195
|
+
}, [paymethodClicked?.confirmed])
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
const renderPaymethods = ({ item }: any) => {
|
|
199
|
+
return (
|
|
200
|
+
<>
|
|
201
|
+
{methodsPay.includes(item?.gateway) ? (
|
|
202
|
+
<TouchableOpacity
|
|
203
|
+
onPress={() => handlePaymentMethodClick(item)}
|
|
204
|
+
>
|
|
205
|
+
<OIcon
|
|
206
|
+
src={getPayIcon(item.gateway)}
|
|
207
|
+
width={70}
|
|
208
|
+
height={70}
|
|
209
|
+
style={{ marginRight: 10 }}
|
|
210
|
+
/>
|
|
211
|
+
</TouchableOpacity>
|
|
212
|
+
) : (
|
|
213
|
+
<TouchableOpacity
|
|
214
|
+
onPress={() => handlePaymentMethodClick(item)}
|
|
215
|
+
>
|
|
216
|
+
<PMItem
|
|
217
|
+
key={item.id}
|
|
218
|
+
isDisabled={isDisabled}
|
|
219
|
+
isActive={paymethodSelected?.id === item.id}
|
|
220
|
+
>
|
|
221
|
+
<OIcon
|
|
222
|
+
src={getPayIcon(item.gateway)}
|
|
223
|
+
width={20}
|
|
224
|
+
height={20}
|
|
225
|
+
color={item?.gateway === 'apple_pay' ? '' : paymethodSelected?.id === item.id ? theme.colors.white : theme.colors.backgroundDark}
|
|
226
|
+
/>
|
|
227
|
+
<OText
|
|
228
|
+
size={10}
|
|
229
|
+
style={{ margin: 0, marginTop: 4 }}
|
|
230
|
+
color={paymethodSelected?.id === item.id ? theme.colors.white : '#000'}
|
|
231
|
+
>
|
|
232
|
+
{t(item?.gateway?.toUpperCase(), item.name)}
|
|
233
|
+
</OText>
|
|
234
|
+
</PMItem>
|
|
235
|
+
</TouchableOpacity>
|
|
236
|
+
)}
|
|
237
|
+
</>
|
|
238
|
+
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const excludeIds: any = [32]; //exclude paypal & connect & redirect
|
|
243
|
+
const filterMethodsPay = (gateway: string) => Platform.OS === 'ios' ? gateway !== 'google_pay' : gateway !== 'apple_pay'
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<PMContainer>
|
|
247
|
+
{paymethodsList.paymethods.length > 0 && (
|
|
248
|
+
<FlatList
|
|
249
|
+
horizontal
|
|
250
|
+
showsHorizontalScrollIndicator={false}
|
|
251
|
+
// data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id)}
|
|
252
|
+
data={paymethodsList.paymethods.sort((a: any, b: any) => a.id - b.id)
|
|
253
|
+
.filter((p: any) =>
|
|
254
|
+
!multiCheckoutMethods.includes(p.gateway) &&
|
|
255
|
+
filterMethodsPay(p.gateway) &&
|
|
256
|
+
!excludeIds.includes(p.id))}
|
|
257
|
+
renderItem={renderPaymethods}
|
|
258
|
+
keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
|
|
259
|
+
/>
|
|
260
|
+
)}
|
|
261
|
+
|
|
262
|
+
{(paymethodsList.loading || isLoading) && (
|
|
263
|
+
<Placeholder style={{ marginTop: 10 }} Animation={Fade}>
|
|
264
|
+
<View style={{ display: 'flex', flexDirection: 'row' }}>
|
|
265
|
+
{[...Array(3)].map((_, i) => (
|
|
266
|
+
<PlaceholderLine
|
|
267
|
+
key={i}
|
|
268
|
+
width={37}
|
|
269
|
+
height={80}
|
|
270
|
+
noMargin
|
|
271
|
+
style={{ borderRadius: 10, marginRight: 10 }}
|
|
272
|
+
/>
|
|
273
|
+
))}
|
|
274
|
+
</View>
|
|
275
|
+
</Placeholder>
|
|
276
|
+
)}
|
|
277
|
+
|
|
278
|
+
{paymethodsList.error && paymethodsList.error.length > 0 && (
|
|
279
|
+
<OText size={12} style={{ margin: 0 }}>
|
|
280
|
+
{paymethodsList?.error[0]?.message || paymethodsList?.error[0]}
|
|
281
|
+
</OText>
|
|
282
|
+
)}
|
|
283
|
+
|
|
284
|
+
{!(paymethodsList.loading || isLoading) &&
|
|
285
|
+
!paymethodsList.error &&
|
|
286
|
+
(!paymethodsList?.paymethods || paymethodsList.paymethods.length === 0) &&
|
|
287
|
+
(
|
|
288
|
+
<OText size={12} style={{ margin: 0 }}>
|
|
289
|
+
{t('NO_PAYMENT_METHODS', 'No payment methods!')}
|
|
290
|
+
</OText>
|
|
291
|
+
)}
|
|
292
|
+
|
|
293
|
+
{paymethodSelected?.gateway === 'cash' && (
|
|
294
|
+
<PaymentOptionCash
|
|
295
|
+
orderTotal={cart.balance ?? cart.total}
|
|
296
|
+
defaultValue={paymethodSelected?.data?.cash}
|
|
297
|
+
onChangeData={handlePaymethodDataChange}
|
|
298
|
+
setErrorCash={props.setErrorCash}
|
|
299
|
+
/>
|
|
300
|
+
)}
|
|
301
|
+
|
|
302
|
+
{/* {stripeOptions.includes(paymethodSelected?.gateway) &&
|
|
293
303
|
(paymethodData?.brand || paymethodData?.card?.brand) &&
|
|
294
304
|
(paymethodData?.last4 || paymethodData?.card?.last4) &&
|
|
295
305
|
(
|
|
@@ -320,186 +330,188 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
320
330
|
</PMCardSelected>
|
|
321
331
|
)} */}
|
|
322
332
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
333
|
+
{/* Stripe */}
|
|
334
|
+
{isOpenMethod?.paymethod?.gateway === 'stripe' && (
|
|
335
|
+
<View>
|
|
336
|
+
<OButton
|
|
337
|
+
text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
|
|
338
|
+
bgColor={theme.colors.white}
|
|
339
|
+
style={styles.btnAddStyle}
|
|
340
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
341
|
+
imgRightSrc={null}
|
|
342
|
+
onClick={() => setAddCardOpen({ ...addCardOpen, stripe: true })}
|
|
343
|
+
/>
|
|
344
|
+
<StripeCardsList
|
|
345
|
+
paymethod={isOpenMethod?.paymethod}
|
|
346
|
+
businessId={props.businessId}
|
|
347
|
+
publicKey={isOpenMethod?.paymethod?.credentials?.publishable}
|
|
348
|
+
payType={paymethodsList?.name}
|
|
349
|
+
onSelectCard={handlePaymethodDataChange}
|
|
350
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
351
|
+
paymethodCardId={paymethodData?.id}
|
|
352
|
+
onCancel={() => handlePaymethodClick(null)}
|
|
353
|
+
setAddCardOpen={setAddCardOpen}
|
|
354
|
+
addCardOpen={addCardOpen}
|
|
355
|
+
isOpenMethod={isOpenMethod}
|
|
356
|
+
handleSource={handlePaymethodDataChange}
|
|
357
|
+
clientSecret={props.clientSecret}
|
|
358
|
+
businessId={props.businessId}
|
|
359
|
+
onPaymentChange={onPaymentChange}
|
|
360
|
+
paySelected={props.paySelected}
|
|
361
|
+
setUserHasCards={setUserHasCards}
|
|
362
|
+
/>
|
|
363
|
+
</View>
|
|
364
|
+
)}
|
|
365
|
+
{/* Google pay, Apple pay */}
|
|
366
|
+
{methodsPay.includes(isOpenMethod?.paymethod?.gateway) && (
|
|
367
|
+
<StripeElementsForm
|
|
368
|
+
cart={cart}
|
|
369
|
+
paymethod={isOpenMethod?.paymethod?.gateway}
|
|
370
|
+
methodsPay={methodsPay}
|
|
371
|
+
businessId={props.businessId}
|
|
372
|
+
publicKey={isOpenMethod?.paymethod?.credentials?.publishable || isOpenMethod?.paymethod?.credentials?.publishable_key}
|
|
373
|
+
handleSource={handlePaymethodDataChange}
|
|
374
|
+
onCancel={() => handlePaymethodClick(null)}
|
|
375
|
+
merchantId={merchantId}
|
|
376
|
+
urlscheme={urlscheme}
|
|
377
|
+
androidAppId={androidAppId}
|
|
378
|
+
setMethodPaySupported={setMethodPaySupported}
|
|
379
|
+
methodPaySupported={methodPaySupported}
|
|
380
|
+
placeByMethodPay={placeByMethodPay}
|
|
381
|
+
setPlaceByMethodPay={setPlaceByMethodPay}
|
|
382
|
+
publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
383
|
+
/>
|
|
384
|
+
)}
|
|
385
|
+
|
|
386
|
+
{(cardsPaymethods.includes(isOpenMethod?.paymethod?.gateway) || cardsPaymethods.includes(paymethodSelected?.gateway)) && (
|
|
387
|
+
<PaymentOptionCard
|
|
388
|
+
setCardList={setCardList}
|
|
389
|
+
paymethod={isOpenMethod?.paymethod}
|
|
390
|
+
businessId={props.businessId}
|
|
391
|
+
publicKey={isOpenMethod?.paymethod?.credentials?.publishable}
|
|
392
|
+
gateway={isOpenMethod?.paymethod?.gateway || paymethodSelected?.gateway}
|
|
393
|
+
onPaymentChange={onPaymentChange}
|
|
394
|
+
payType={isOpenMethod?.paymethod?.name}
|
|
395
|
+
onSelectCard={handlePaymethodDataChange}
|
|
396
|
+
addCardOpen={addCardOpen}
|
|
397
|
+
setAddCardOpen={setAddCardOpen}
|
|
398
|
+
onCancel={() => handlePaymethodClick(null)}
|
|
399
|
+
paymethodSelected={paymethodSelected?.data?.id}
|
|
400
|
+
handlePaymentMethodClick={handlePaymentMethodClick}
|
|
401
|
+
/>
|
|
402
|
+
)}
|
|
403
|
+
|
|
404
|
+
{/* Stripe direct */}
|
|
405
|
+
<OModal
|
|
406
|
+
entireModal
|
|
407
|
+
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
408
|
+
open={stripeDirectMethods?.includes(isOpenMethod?.paymethod?.gateway) && !paymethodData.id}
|
|
409
|
+
onClose={() => handlePaymethodClick(null)}
|
|
410
|
+
>
|
|
411
|
+
<KeyboardAvoidingView
|
|
412
|
+
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
413
|
+
keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
|
|
414
|
+
enabled={Platform.OS === 'ios' ? true : false}
|
|
415
|
+
>
|
|
416
|
+
<StripeElementsForm
|
|
417
|
+
cart={cart}
|
|
418
|
+
paymethod={isOpenMethod?.paymethod?.gateway}
|
|
419
|
+
methodsPay={methodsPay}
|
|
420
|
+
businessId={props.businessId}
|
|
421
|
+
publicKey={isOpenMethod?.paymethod?.credentials?.publishable || isOpenMethod?.paymethod?.credentials?.publishable_key}
|
|
422
|
+
handleSource={handlePaymethodDataChange}
|
|
423
|
+
onCancel={() => handlePaymethodClick(null)}
|
|
424
|
+
merchantId={merchantId}
|
|
425
|
+
urlscheme={urlscheme}
|
|
426
|
+
androidAppId={androidAppId}
|
|
427
|
+
publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
428
|
+
paySelected={props.paySelected}
|
|
429
|
+
/>
|
|
430
|
+
</KeyboardAvoidingView>
|
|
431
|
+
</OModal>
|
|
432
|
+
|
|
433
|
+
{/* Stripe Connect */}
|
|
434
|
+
{isOpenMethod?.paymethod?.gateway === 'stripe_connect' && (
|
|
435
|
+
<View>
|
|
436
|
+
<OButton
|
|
437
|
+
text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
|
|
438
|
+
bgColor={theme.colors.white}
|
|
439
|
+
style={styles.btnAddStyle}
|
|
440
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
441
|
+
imgRightSrc={null}
|
|
442
|
+
onClick={() => setAddCardOpen({ ...addCardOpen, stripeConnect: true })}
|
|
443
|
+
/>
|
|
444
|
+
<StripeCardsList
|
|
445
|
+
paymethod={isOpenMethod?.paymethod}
|
|
446
|
+
businessId={props.businessId}
|
|
447
|
+
payType={paymethodsList?.name}
|
|
448
|
+
onSelectCard={handlePaymethodDataChange}
|
|
449
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
450
|
+
onCancel={() => handlePaymethodClick(null)}
|
|
451
|
+
publicKey={isOpenMethod?.paymethod?.credentials.publishable}
|
|
452
|
+
publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
453
|
+
paySelected={props.paySelected}
|
|
454
|
+
setUserHasCards={setUserHasCards}
|
|
455
|
+
/>
|
|
456
|
+
</View>
|
|
457
|
+
)}
|
|
458
|
+
{/** Stripe connect add cards */}
|
|
459
|
+
<OModal
|
|
460
|
+
entireModal
|
|
461
|
+
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
462
|
+
open={addCardOpen.stripeConnect}
|
|
463
|
+
onClose={() => setAddCardOpen({ ...addCardOpen, stripeConnect: false })}
|
|
464
|
+
>
|
|
465
|
+
<KeyboardAvoidingView
|
|
466
|
+
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
467
|
+
keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
|
|
468
|
+
enabled={Platform.OS === 'ios' ? true : false}
|
|
469
|
+
>
|
|
470
|
+
<StripeElementsForm
|
|
471
|
+
openCarts={props.openCarts}
|
|
472
|
+
toSave
|
|
473
|
+
businessId={props.businessId}
|
|
474
|
+
publicKey={isOpenMethod?.paymethod?.credentials?.stripe?.publishable}
|
|
475
|
+
requirements={isOpenMethod?.paymethod?.credentials?.publishable}
|
|
476
|
+
accountId={isOpenMethod?.paymethod?.credentials?.user}
|
|
477
|
+
onSelectCard={handlePaymethodDataChange}
|
|
478
|
+
onCancel={() => setAddCardOpen({ ...addCardOpen, stripeConnect: false })}
|
|
479
|
+
publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
480
|
+
/>
|
|
481
|
+
</KeyboardAvoidingView>
|
|
482
|
+
</OModal>
|
|
483
|
+
|
|
484
|
+
{/* Stripe Add card */}
|
|
485
|
+
<OModal
|
|
486
|
+
entireModal
|
|
487
|
+
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
488
|
+
open={addCardOpen?.stripe}
|
|
489
|
+
onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
490
|
+
style={{ backgroundColor: 'red' }}
|
|
491
|
+
>
|
|
492
|
+
<KeyboardAvoidingView
|
|
493
|
+
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
494
|
+
keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
|
|
495
|
+
enabled={Platform.OS === 'ios' ? true : false}
|
|
496
|
+
>
|
|
497
|
+
<StripeElementsForm
|
|
498
|
+
openCarts={props.openCarts}
|
|
499
|
+
toSave
|
|
500
|
+
businessId={props.businessId}
|
|
501
|
+
businessIds={props.businessIds}
|
|
502
|
+
publicKey={props.publicKey || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
503
|
+
setCardsList={setCardList}
|
|
504
|
+
requirements={props.clientSecret}
|
|
505
|
+
handleSource={handlePaymethodDataChange}
|
|
506
|
+
onSelectCard={handlePaymethodDataChange}
|
|
507
|
+
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
508
|
+
publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
509
|
+
/>
|
|
510
|
+
</KeyboardAvoidingView>
|
|
511
|
+
</OModal>
|
|
512
|
+
|
|
513
|
+
{/* Stripe Redirect */}
|
|
514
|
+
{/* <OModal
|
|
503
515
|
isNotDecoration
|
|
504
516
|
open={['stripe_redirect'].includes(paymethodSelected?.gateway) && !paymethodData.type}
|
|
505
517
|
title={t('STRIPE_REDIRECT', 'Stripe Redirect')}
|
|
@@ -515,8 +527,8 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
515
527
|
/>
|
|
516
528
|
</OModal> */}
|
|
517
529
|
|
|
518
|
-
|
|
519
|
-
|
|
530
|
+
{/* Paypal */}
|
|
531
|
+
{/* <Modal
|
|
520
532
|
className='modal-info'
|
|
521
533
|
open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
|
|
522
534
|
onClose={() => handlePaymethodClick(null)}
|
|
@@ -541,35 +553,35 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
541
553
|
/>
|
|
542
554
|
)}
|
|
543
555
|
</Modal> */}
|
|
544
|
-
|
|
545
|
-
|
|
556
|
+
</PMContainer>
|
|
557
|
+
)
|
|
546
558
|
}
|
|
547
559
|
|
|
548
560
|
const styles = StyleSheet.create({
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
561
|
+
viewStyle: {
|
|
562
|
+
marginRight: 10
|
|
563
|
+
},
|
|
564
|
+
cardsList: {
|
|
565
|
+
borderWidth: 1,
|
|
566
|
+
borderColor: 'red',
|
|
567
|
+
flex: 1,
|
|
568
|
+
height: 120
|
|
569
|
+
},
|
|
570
|
+
btnAddStyle: {
|
|
571
|
+
marginVertical: 20,
|
|
572
|
+
borderRadius: 7.6,
|
|
573
|
+
shadowOpacity: 0,
|
|
574
|
+
height: 44,
|
|
575
|
+
borderWidth: 1
|
|
576
|
+
},
|
|
565
577
|
})
|
|
566
578
|
|
|
567
579
|
export const PaymentOptions = (props: any) => {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
580
|
+
const paymentOptions = {
|
|
581
|
+
...props,
|
|
582
|
+
UIComponent: PaymentOptionsUI
|
|
583
|
+
}
|
|
584
|
+
return (
|
|
585
|
+
<PaymentOptionsController {...paymentOptions} />
|
|
586
|
+
)
|
|
575
587
|
}
|