ordering-ui-react-native 0.16.39 → 0.16.40

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.16.39",
3
+ "version": "0.16.40",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -361,7 +361,7 @@ const CartUI = (props: any) => {
361
361
  {t('TOTAL', 'Total')}
362
362
  </OText>
363
363
  <OText size={14} lineHeight={21} weight={'600'}>
364
- {parsePrice(cart?.total >= 0 ? cart?.total : 0)}
364
+ {parsePrice(cart?.balance >= 0 ? cart?.balance : 0)}
365
365
  </OText>
366
366
  </OSTable>
367
367
  </OSTotal>
@@ -299,7 +299,7 @@ const OrderSummaryUI = (props: any) => {
299
299
  {t('TOTAL', 'Total')}
300
300
  </OText>
301
301
  <OText size={14} style={{ fontWeight: 'bold' }} >
302
- {parsePrice(cart?.total >= 0 ? cart?.total : 0)}
302
+ {parsePrice(cart?.balance >= 0 ? cart?.balance : 0)}
303
303
  </OText>
304
304
  </OSTable>
305
305
  </View>
@@ -61,13 +61,13 @@ const StripeElementsFormUI = (props: any) => {
61
61
  }
62
62
 
63
63
  if (user?.address) {
64
- billingDetails.addressLine1 = user?.address
64
+ billingDetails.address.line1 = user?.address
65
65
  }
66
66
 
67
67
  const createPayMethod = async () => {
68
- const params: any = { type: 'Card' }
68
+ const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
69
69
  if (Object.keys(billingDetails).length > 0) {
70
- params.billingDetails = billingDetails
70
+ params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
71
71
  }
72
72
  try {
73
73
  setCreatePmLoading(true)
@@ -94,16 +94,16 @@ const StripeElementsFormUI = (props: any) => {
94
94
  setErrors(error?.message || error?.toString());
95
95
  }
96
96
  }
97
-
97
+
98
98
  const handleSaveCard = async () => {
99
99
  setErrors('');
100
100
  if (!requirements) {
101
101
  createPayMethod();
102
102
  return
103
103
  }
104
- const params: any = { type: 'Card' }
104
+ const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
105
105
  if (Object.keys(billingDetails).length > 0) {
106
- params.billingDetails = billingDetails
106
+ params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
107
107
  }
108
108
  try {
109
109
  const { setupIntent, error } = await confirmSetupIntent(requirements, params);