ordering-ui-react-native 0.15.27 → 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
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>
|
|
@@ -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
|