ordering-ui-react-native 0.21.96 → 0.21.98

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.21.96",
3
+ "version": "0.21.98",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -3,7 +3,6 @@ import { useLanguage, useConfig, useOrder } from 'ordering-components/native'
3
3
  import { useGooglePay, useApplePay } from '@stripe/stripe-react-native'
4
4
  import { Platform } from 'react-native';
5
5
  import { StripeMethodFormParams } from '../../types';
6
- import { android_app_id } from '../../config.json'
7
6
 
8
7
  export const StripeMethodForm = (props: StripeMethodFormParams) => {
9
8
  const {
@@ -17,7 +16,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
17
16
  placeByMethodPay,
18
17
  methodPaySupported,
19
18
  setPlaceByMethodPay,
20
- cartTotal
19
+ cartTotal,
20
+ androidAppId
21
21
  } = props
22
22
  const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
23
23
  const { presentApplePay, isApplePaySupported } = useApplePay();
@@ -61,7 +61,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
61
61
  })
62
62
  const { error } = await initGooglePay({
63
63
  testEnv: devMode,
64
- merchantName: android_app_id,
64
+ merchantName: androidAppId,
65
65
  countryCode: 'US',
66
66
  billingAddressConfig: {
67
67
  format: 'FULL',
@@ -494,5 +494,6 @@ export interface StripeMethodFormParams {
494
494
  placeByMethodPay?: any
495
495
  methodPaySupported?: any,
496
496
  setPlaceByMethodPay?: any,
497
- cartTotal?: number
497
+ cartTotal?: number,
498
+ androidAppId?: string
498
499
  }
@@ -200,7 +200,11 @@ const CartUI = (props: any) => {
200
200
  if (cart?.business_id) {
201
201
  setOpenUpselling(true)
202
202
  } else {
203
- handleUpsellingPage(cart)
203
+ onNavigationRedirect('CheckoutNavigator', {
204
+ screen: 'CheckoutPage',
205
+ cartUuid: cart?.uuid,
206
+ cartTotal: cart?.total
207
+ }, true)
204
208
  }
205
209
  }
206
210
 
@@ -101,7 +101,9 @@ const CheckoutUI = (props: any) => {
101
101
  currency,
102
102
  merchantId,
103
103
  setPlaceSpotNumber,
104
- maxDate
104
+ maxDate,
105
+ androidAppId,
106
+ urlscheme
105
107
  } = props
106
108
 
107
109
  const theme = useTheme();
@@ -817,6 +819,8 @@ const CheckoutUI = (props: any) => {
817
819
  handlePaymentMethodClickCustom={handlePaymentMethodClick}
818
820
  handlePlaceOrder={handlePlaceOrder}
819
821
  merchantId={merchantId}
822
+ urlscheme={urlscheme}
823
+ androidAppId={androidAppId}
820
824
  setMethodPaySupported={setMethodPaySupported}
821
825
  methodPaySupported={methodPaySupported}
822
826
  placeByMethodPay={placeByMethodPay}
@@ -58,8 +58,8 @@ const OrderProgressUI = (props: any) => {
58
58
  shadowOpacity: 0.2,
59
59
  shadowRadius: 2,
60
60
  elevation: 3,
61
- borderWidth: Platform.OS === 'android' && Number(DeviceInfo?.getSystemVersion?.()) < 5 ? 1 : 0,
62
- borderColor: 'rgba(0,0,0,0.2)'
61
+ borderWidth: 1,
62
+ borderColor: 'rgba(0,0,0,0.1)'
63
63
  },
64
64
  logoWrapper: {
65
65
  overflow: 'hidden',
@@ -65,6 +65,7 @@ const PaymentOptionsUI = (props: any) => {
65
65
  handlePaymentMethodClickCustom,
66
66
  handlePlaceOrder,
67
67
  merchantId,
68
+ urlscheme,
68
69
  setMethodPaySupported,
69
70
  placeByMethodPay,
70
71
  methodPaySupported,
@@ -74,7 +75,8 @@ const PaymentOptionsUI = (props: any) => {
74
75
  requiredFields,
75
76
  openUserModal,
76
77
  paymethodClicked,
77
- setPaymethodClicked
78
+ setPaymethodClicked,
79
+ androidAppId
78
80
  } = props
79
81
 
80
82
  const theme = useTheme();
@@ -360,6 +362,8 @@ const PaymentOptionsUI = (props: any) => {
360
362
  handleSource={handlePaymethodDataChange}
361
363
  onCancel={() => handlePaymethodClick(null)}
362
364
  merchantId={merchantId}
365
+ urlscheme={urlscheme}
366
+ androidAppId={androidAppId}
363
367
  setMethodPaySupported={setMethodPaySupported}
364
368
  methodPaySupported={methodPaySupported}
365
369
  placeByMethodPay={placeByMethodPay}
@@ -407,6 +411,8 @@ const PaymentOptionsUI = (props: any) => {
407
411
  handleSource={handlePaymethodDataChange}
408
412
  onCancel={() => handlePaymethodClick(null)}
409
413
  merchantId={merchantId}
414
+ urlscheme={urlscheme}
415
+ androidAppId={androidAppId}
410
416
  publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable}
411
417
  />
412
418
  </KeyboardAvoidingView>
@@ -34,7 +34,9 @@ const StripeElementsFormUI = (props: any) => {
34
34
  methodPaySupported,
35
35
  setPlaceByMethodPay,
36
36
  cartTotal,
37
- publicKeyAddCard
37
+ publicKeyAddCard,
38
+ urlScheme,
39
+ androidAppId
38
40
  } = props;
39
41
 
40
42
  const theme = useTheme();
@@ -204,7 +206,7 @@ const StripeElementsFormUI = (props: any) => {
204
206
  <StripeProvider
205
207
  publishableKey={isToSave}
206
208
  merchantIdentifier={merchantId}
207
- urlScheme={merchantId}
209
+ urlScheme={`${urlScheme}://checkout/${cart?.uuid}`}
208
210
  >
209
211
  {methodsPay?.includes(paymethod) ? (
210
212
  <StripeMethodForm
@@ -219,6 +221,7 @@ const StripeElementsFormUI = (props: any) => {
219
221
  placeByMethodPay={placeByMethodPay}
220
222
  methodPaySupported={methodPaySupported}
221
223
  setPlaceByMethodPay={setPlaceByMethodPay}
224
+ androidAppId={androidAppId}
222
225
  />
223
226
  ) : (
224
227
  <CardField