ordering-ui-react-native 0.15.25 → 0.15.28
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 +1 -1
- package/src/components/StripeMethodForm/index.tsx +17 -12
- package/themes/original/src/components/Checkout/index.tsx +3 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +2 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components/native'
|
|
3
3
|
import { useGooglePay, ApplePayButton, useApplePay } from '@stripe/stripe-react-native'
|
|
4
|
-
import { OButton } from '../shared';
|
|
4
|
+
import { OButton, OText } from '../shared';
|
|
5
5
|
import { Platform, View } from 'react-native';
|
|
6
6
|
import { StripeMethodFormParams } from '../../types';
|
|
7
7
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
@@ -146,17 +146,22 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
146
146
|
</View>
|
|
147
147
|
) : (
|
|
148
148
|
<View>
|
|
149
|
-
{isApplePaySupported
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
149
|
+
{isApplePaySupported ? (
|
|
150
|
+
<>
|
|
151
|
+
<OText>{t('APPLE_PAY_PAYMENT', 'Apple pay payment')}</OText>
|
|
152
|
+
<ApplePayButton
|
|
153
|
+
onPress={pay}
|
|
154
|
+
type="plain"
|
|
155
|
+
buttonStyle="black"
|
|
156
|
+
borderRadius={4}
|
|
157
|
+
style={{
|
|
158
|
+
width: '100%',
|
|
159
|
+
height: 50,
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
</>
|
|
163
|
+
) : (
|
|
164
|
+
<OText>{t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported')}</OText>
|
|
160
165
|
)}
|
|
161
166
|
</View>
|
|
162
167
|
)}
|
|
@@ -85,7 +85,8 @@ const CheckoutUI = (props: any) => {
|
|
|
85
85
|
deliveryOptionSelected,
|
|
86
86
|
instructionsOptions,
|
|
87
87
|
handleChangeDeliveryOption,
|
|
88
|
-
currency
|
|
88
|
+
currency,
|
|
89
|
+
merchantId
|
|
89
90
|
} = props
|
|
90
91
|
|
|
91
92
|
const theme = useTheme();
|
|
@@ -547,6 +548,7 @@ const CheckoutUI = (props: any) => {
|
|
|
547
548
|
paySelected={paymethodSelected}
|
|
548
549
|
handlePaymentMethodClickCustom={handlePaymentMethodClick}
|
|
549
550
|
handlePlaceOrder={handlePlaceOrder}
|
|
551
|
+
merchantId={merchantId}
|
|
550
552
|
/>
|
|
551
553
|
</ChPaymethods>
|
|
552
554
|
</ChSection>
|
|
@@ -57,7 +57,8 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
57
57
|
handlePaymethodDataChange,
|
|
58
58
|
isOpenMethod,
|
|
59
59
|
handlePaymentMethodClickCustom,
|
|
60
|
-
handlePlaceOrder
|
|
60
|
+
handlePlaceOrder,
|
|
61
|
+
merchantId
|
|
61
62
|
} = props
|
|
62
63
|
|
|
63
64
|
const theme = useTheme();
|
|
@@ -316,6 +317,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
316
317
|
publicKey={isOpenMethod?.paymethod?.credentials?.publishable || isOpenMethod?.paymethod?.credentials?.publishable_key}
|
|
317
318
|
handleSource={handlePaymethodDataChange}
|
|
318
319
|
onCancel={() => handlePaymethodClick(null)}
|
|
320
|
+
merchantId={merchantId}
|
|
319
321
|
/>
|
|
320
322
|
</KeyboardAvoidingView>
|
|
321
323
|
</OModal>
|
|
@@ -86,6 +86,10 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
|
|
|
86
86
|
id: order?.id,
|
|
87
87
|
business_id: order?.business_id,
|
|
88
88
|
logo: order.business?.logo,
|
|
89
|
+
driver: order?.driver,
|
|
90
|
+
products: order?.products,
|
|
91
|
+
review: order?.review,
|
|
92
|
+
user_review: order?.user_review
|
|
89
93
|
},
|
|
90
94
|
});
|
|
91
95
|
};
|
|
@@ -27,6 +27,7 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
27
27
|
paymethod,
|
|
28
28
|
onCancel,
|
|
29
29
|
cart,
|
|
30
|
+
merchantId
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
const theme = useTheme();
|
|
@@ -160,7 +161,7 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
160
161
|
<View style={{ flex: 1 }}>
|
|
161
162
|
<StripeProvider
|
|
162
163
|
publishableKey={publicKey}
|
|
163
|
-
merchantIdentifier={`merchant.${
|
|
164
|
+
merchantIdentifier={`merchant.${merchantId}`}
|
|
164
165
|
>
|
|
165
166
|
{methodsPay?.includes(paymethod) ? (
|
|
166
167
|
<StripeMethodForm
|
|
@@ -157,6 +157,12 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
157
157
|
</TopActions>
|
|
158
158
|
</TopBar>
|
|
159
159
|
<ScrollView style={{ marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|
|
160
|
+
{productsList.length > 0 &&
|
|
161
|
+
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
162
|
+
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
163
|
+
<UpsellingLayout />
|
|
164
|
+
</View>
|
|
165
|
+
}
|
|
160
166
|
<View style={{ paddingHorizontal: 40 }}>
|
|
161
167
|
<OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
|
|
162
168
|
<OrderSummary
|
|
@@ -165,12 +171,6 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
165
171
|
onNavigationRedirect={onNavigationRedirect}
|
|
166
172
|
/>
|
|
167
173
|
</View>
|
|
168
|
-
{productsList.length > 0 &&
|
|
169
|
-
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
170
|
-
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
171
|
-
<UpsellingLayout />
|
|
172
|
-
</View>
|
|
173
|
-
}
|
|
174
174
|
</ScrollView>
|
|
175
175
|
<View
|
|
176
176
|
style={{
|