ordering-ui-react-native 0.15.28 → 0.15.29

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.15.28",
3
+ "version": "0.15.29",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useLanguage } from 'ordering-components/native'
2
+ import { useLanguage, useConfig } from 'ordering-components/native'
3
3
  import { useGooglePay, ApplePayButton, useApplePay } from '@stripe/stripe-react-native'
4
4
  import { OButton, OText } from '../shared';
5
5
  import { Platform, View } from 'react-native';
@@ -20,6 +20,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
20
20
  const [initialized, setInitialized] = useState(false);
21
21
  const [loadingGooglePayment, setLoadingGooglePayment] = useState(false)
22
22
  const [, t] = useLanguage()
23
+ const [configs] = useConfig()
23
24
 
24
25
  useEffect(() => {
25
26
  if (paymethod !== 'google_pay' || !initGooglePay) return
@@ -66,7 +67,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
66
67
  setLoadingGooglePayment(true)
67
68
  const { error, paymentMethod } = await createGooglePayPaymentMethod({
68
69
  amount: cart?.balance ?? cart?.total,
69
- currencyCode: 'USD',
70
+ currencyCode: configs?.stripe_currency?.value ?? 'USD',
70
71
  });
71
72
  if (error) {
72
73
  setErrors(error.code + ' - ' + error.message);
@@ -97,7 +98,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
97
98
  const { error, paymentMethod } = await presentApplePay({
98
99
  cartItems: cart?.products?.map((product: any) => ({ label: product?.name, amount: product?.price?.toString?.() })),
99
100
  country: 'US',
100
- currency: 'USD',
101
+ currency: configs?.stripe_currency?.value ?? 'USD',
101
102
  shippingMethods: [
102
103
  {
103
104
  amount: cart?.balance?.toString() ?? cart?.total?.toString?.(),
@@ -162,6 +162,7 @@ const StripeElementsFormUI = (props: any) => {
162
162
  <StripeProvider
163
163
  publishableKey={publicKey}
164
164
  merchantIdentifier={`merchant.${merchantId}`}
165
+ urlScheme={merchantId}
165
166
  >
166
167
  {methodsPay?.includes(paymethod) ? (
167
168
  <StripeMethodForm