be-components 0.4.9 → 0.5.1
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/lib/commonjs/ApiOverrides/index.js +12 -3
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Checkout/api/index.js +254 -0
- package/lib/commonjs/Checkout/api/index.js.map +1 -0
- package/lib/commonjs/Checkout/components/AccountSummaryCard.js +274 -0
- package/lib/commonjs/Checkout/components/AccountSummaryCard.js.map +1 -0
- package/lib/commonjs/Checkout/components/ItemSummaryCard.js +56 -0
- package/lib/commonjs/Checkout/components/ItemSummaryCard.js.map +1 -0
- package/lib/commonjs/Checkout/components/OrderSummaryCard.js +84 -0
- package/lib/commonjs/Checkout/components/OrderSummaryCard.js.map +1 -0
- package/lib/commonjs/Checkout/index.js +590 -0
- package/lib/commonjs/Checkout/index.js.map +1 -0
- package/lib/commonjs/Components/Button.js +11 -3
- package/lib/commonjs/Components/Button.js.map +1 -1
- package/lib/commonjs/Components/Checkbox.js +6 -2
- package/lib/commonjs/Components/Checkbox.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +441 -4
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/Spring.js +6 -5
- package/lib/commonjs/Components/Spring.js.map +1 -1
- package/lib/commonjs/LocationTracker/LocationStatus.js +95 -0
- package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -0
- package/lib/commonjs/LocationTracker/api/index.js +124 -0
- package/lib/commonjs/LocationTracker/api/index.js.map +1 -0
- package/lib/commonjs/LocationTracker/index.js +207 -0
- package/lib/commonjs/LocationTracker/index.js.map +1 -0
- package/lib/commonjs/Observer/Observer.js +2 -0
- package/lib/commonjs/Observer/Observer.js.map +1 -1
- package/lib/commonjs/Wallet/api/index.js +621 -0
- package/lib/commonjs/Wallet/api/index.js.map +1 -0
- package/lib/commonjs/Wallet/components/ACHAdd.js +63 -0
- package/lib/commonjs/Wallet/components/ACHAdd.js.map +1 -0
- package/lib/commonjs/Wallet/components/AccountCard.js +137 -0
- package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -0
- package/lib/commonjs/Wallet/components/AccountLimitManager.js +321 -0
- package/lib/commonjs/Wallet/components/AccountLimitManager.js.map +1 -0
- package/lib/commonjs/Wallet/components/AccountManager.js +202 -0
- package/lib/commonjs/Wallet/components/AccountManager.js.map +1 -0
- package/lib/commonjs/Wallet/components/AccountSnoozeManager.js +263 -0
- package/lib/commonjs/Wallet/components/AccountSnoozeManager.js.map +1 -0
- package/lib/commonjs/Wallet/components/AddressCard.js +56 -0
- package/lib/commonjs/Wallet/components/AddressCard.js.map +1 -0
- package/lib/commonjs/Wallet/components/AddressManager.js +365 -0
- package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -0
- package/lib/commonjs/Wallet/components/DepositCard.js +195 -0
- package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -0
- package/lib/commonjs/Wallet/components/LinkAccountManager.js +167 -0
- package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -0
- package/lib/commonjs/Wallet/components/ManageAccountCard.js +216 -0
- package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -0
- package/lib/commonjs/Wallet/components/ManualACHAdd.js +270 -0
- package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -0
- package/lib/commonjs/Wallet/components/ManualCardAdd.js +337 -0
- package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -0
- package/lib/commonjs/Wallet/components/MyBalance.js +73 -0
- package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -0
- package/lib/commonjs/Wallet/components/PayPalOrderCapture.js +68 -0
- package/lib/commonjs/Wallet/components/PayPalOrderCapture.js.map +1 -0
- package/lib/commonjs/Wallet/components/RemoveAccount.js +108 -0
- package/lib/commonjs/Wallet/components/RemoveAccount.js.map +1 -0
- package/lib/commonjs/Wallet/components/VerifyACHAccount.js +196 -0
- package/lib/commonjs/Wallet/components/VerifyACHAccount.js.map +1 -0
- package/lib/commonjs/Wallet/components/WalletSetup.js +316 -0
- package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -0
- package/lib/commonjs/Wallet/components/WithdrawCard.js +336 -0
- package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -0
- package/lib/commonjs/Wallet/index.js +221 -0
- package/lib/commonjs/Wallet/index.js.map +1 -0
- package/lib/commonjs/constants/colors.js +3 -0
- package/lib/commonjs/constants/colors.js.map +1 -1
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +12 -3
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Checkout/api/index.js +248 -0
- package/lib/module/Checkout/api/index.js.map +1 -0
- package/lib/module/Checkout/components/AccountSummaryCard.js +267 -0
- package/lib/module/Checkout/components/AccountSummaryCard.js.map +1 -0
- package/lib/module/Checkout/components/ItemSummaryCard.js +49 -0
- package/lib/module/Checkout/components/ItemSummaryCard.js.map +1 -0
- package/lib/module/Checkout/components/OrderSummaryCard.js +77 -0
- package/lib/module/Checkout/components/OrderSummaryCard.js.map +1 -0
- package/lib/module/Checkout/index.js +581 -0
- package/lib/module/Checkout/index.js.map +1 -0
- package/lib/module/Components/Button.js +11 -3
- package/lib/module/Components/Button.js.map +1 -1
- package/lib/module/Components/Checkbox.js +6 -2
- package/lib/module/Components/Checkbox.js.map +1 -1
- package/lib/module/Components/Icons.js +441 -4
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/Spring.js +6 -5
- package/lib/module/Components/Spring.js.map +1 -1
- package/lib/module/LocationTracker/LocationStatus.js +88 -0
- package/lib/module/LocationTracker/LocationStatus.js.map +1 -0
- package/lib/module/LocationTracker/api/index.js +118 -0
- package/lib/module/LocationTracker/api/index.js.map +1 -0
- package/lib/module/LocationTracker/index.js +200 -0
- package/lib/module/LocationTracker/index.js.map +1 -0
- package/lib/module/Observer/Observer.js +2 -0
- package/lib/module/Observer/Observer.js.map +1 -1
- package/lib/module/Wallet/api/index.js +615 -0
- package/lib/module/Wallet/api/index.js.map +1 -0
- package/lib/module/Wallet/components/ACHAdd.js +56 -0
- package/lib/module/Wallet/components/ACHAdd.js.map +1 -0
- package/lib/module/Wallet/components/AccountCard.js +130 -0
- package/lib/module/Wallet/components/AccountCard.js.map +1 -0
- package/lib/module/Wallet/components/AccountLimitManager.js +312 -0
- package/lib/module/Wallet/components/AccountLimitManager.js.map +1 -0
- package/lib/module/Wallet/components/AccountManager.js +195 -0
- package/lib/module/Wallet/components/AccountManager.js.map +1 -0
- package/lib/module/Wallet/components/AccountSnoozeManager.js +254 -0
- package/lib/module/Wallet/components/AccountSnoozeManager.js.map +1 -0
- package/lib/module/Wallet/components/AddressCard.js +49 -0
- package/lib/module/Wallet/components/AddressCard.js.map +1 -0
- package/lib/module/Wallet/components/AddressManager.js +356 -0
- package/lib/module/Wallet/components/AddressManager.js.map +1 -0
- package/lib/module/Wallet/components/DepositCard.js +186 -0
- package/lib/module/Wallet/components/DepositCard.js.map +1 -0
- package/lib/module/Wallet/components/LinkAccountManager.js +158 -0
- package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -0
- package/lib/module/Wallet/components/ManageAccountCard.js +207 -0
- package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -0
- package/lib/module/Wallet/components/ManualACHAdd.js +261 -0
- package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -0
- package/lib/module/Wallet/components/ManualCardAdd.js +328 -0
- package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -0
- package/lib/module/Wallet/components/MyBalance.js +66 -0
- package/lib/module/Wallet/components/MyBalance.js.map +1 -0
- package/lib/module/Wallet/components/PayPalOrderCapture.js +61 -0
- package/lib/module/Wallet/components/PayPalOrderCapture.js.map +1 -0
- package/lib/module/Wallet/components/RemoveAccount.js +100 -0
- package/lib/module/Wallet/components/RemoveAccount.js.map +1 -0
- package/lib/module/Wallet/components/VerifyACHAccount.js +187 -0
- package/lib/module/Wallet/components/VerifyACHAccount.js.map +1 -0
- package/lib/module/Wallet/components/WalletSetup.js +307 -0
- package/lib/module/Wallet/components/WalletSetup.js.map +1 -0
- package/lib/module/Wallet/components/WithdrawCard.js +327 -0
- package/lib/module/Wallet/components/WithdrawCard.js.map +1 -0
- package/lib/module/Wallet/index.js +212 -0
- package/lib/module/Wallet/index.js.map +1 -0
- package/lib/module/constants/colors.js +3 -0
- package/lib/module/constants/colors.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/Checkout/api/index.d.ts +49 -0
- package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts +18 -0
- package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts.map +1 -0
- package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts +8 -0
- package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts.map +1 -0
- package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts +8 -0
- package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts.map +1 -0
- package/lib/typescript/src/Checkout/index.d.ts +12 -0
- package/lib/typescript/src/Checkout/index.d.ts.map +1 -0
- package/lib/typescript/src/Components/Button.d.ts.map +1 -1
- package/lib/typescript/src/Components/Checkbox.d.ts +3 -1
- package/lib/typescript/src/Components/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +8 -1
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/Spring.d.ts.map +1 -1
- package/lib/typescript/src/LocationTracker/LocationStatus.d.ts +21 -0
- package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -0
- package/lib/typescript/src/LocationTracker/api/index.d.ts +19 -0
- package/lib/typescript/src/LocationTracker/api/index.d.ts.map +1 -0
- package/lib/typescript/src/LocationTracker/index.d.ts +22 -0
- package/lib/typescript/src/LocationTracker/index.d.ts.map +1 -0
- package/lib/typescript/src/Observer/Observer.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/api/index.d.ts +94 -0
- package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/ACHAdd.d.ts +13 -0
- package/lib/typescript/src/Wallet/components/ACHAdd.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/AccountCard.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/AccountCard.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/AccountManager.d.ts +13 -0
- package/lib/typescript/src/Wallet/components/AccountManager.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/AddressCard.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/AddressCard.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/AddressManager.d.ts +23 -0
- package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/DepositCard.d.ts +14 -0
- package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +17 -0
- package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +11 -0
- package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +11 -0
- package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/MyBalance.d.ts +14 -0
- package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts +16 -0
- package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/VerifyACHAccount.d.ts +10 -0
- package/lib/typescript/src/Wallet/components/VerifyACHAccount.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +11 -0
- package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +16 -0
- package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -0
- package/lib/typescript/src/Wallet/index.d.ts +10 -0
- package/lib/typescript/src/Wallet/index.d.ts.map +1 -0
- package/lib/typescript/src/constants/colors.d.ts +3 -0
- package/lib/typescript/src/constants/colors.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/ApiOverrides/index.ts +13 -3
- package/src/Checkout/api/index.tsx +199 -0
- package/src/Checkout/components/AccountSummaryCard.tsx +169 -0
- package/src/Checkout/components/ItemSummaryCard.tsx +34 -0
- package/src/Checkout/components/OrderSummaryCard.tsx +40 -0
- package/src/Checkout/index.tsx +398 -0
- package/src/Components/Button.tsx +5 -4
- package/src/Components/Checkbox.tsx +5 -2
- package/src/Components/Icons.tsx +196 -3
- package/src/Components/Spring.tsx +4 -3
- package/src/LocationTracker/LocationStatus.tsx +96 -0
- package/src/LocationTracker/api/index.tsx +114 -0
- package/src/LocationTracker/index.tsx +130 -0
- package/src/Observer/Observer.tsx +2 -1
- package/src/Wallet/api/index.ts +461 -0
- package/src/Wallet/components/ACHAdd.tsx +49 -0
- package/src/Wallet/components/AccountCard.tsx +92 -0
- package/src/Wallet/components/AccountLimitManager.tsx +212 -0
- package/src/Wallet/components/AccountManager.tsx +103 -0
- package/src/Wallet/components/AccountSnoozeManager.tsx +153 -0
- package/src/Wallet/components/AddressCard.tsx +31 -0
- package/src/Wallet/components/AddressManager.tsx +203 -0
- package/src/Wallet/components/DepositCard.tsx +107 -0
- package/src/Wallet/components/LinkAccountManager.tsx +119 -0
- package/src/Wallet/components/ManageAccountCard.tsx +146 -0
- package/src/Wallet/components/ManualACHAdd.tsx +164 -0
- package/src/Wallet/components/ManualCardAdd.tsx +185 -0
- package/src/Wallet/components/MyBalance.tsx +64 -0
- package/src/Wallet/components/PayPalOrderCapture.tsx +59 -0
- package/src/Wallet/components/RemoveAccount.tsx +68 -0
- package/src/Wallet/components/VerifyACHAccount.tsx +140 -0
- package/src/Wallet/components/WalletSetup.tsx +197 -0
- package/src/Wallet/components/WithdrawCard.tsx +145 -0
- package/src/Wallet/index.tsx +229 -0
- package/src/constants/colors.ts +3 -0
- package/src/index.tsx +7 -2
- package/src/types.d.ts +296 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import Colors from '../../constants/colors';
|
|
4
|
+
import { Text } from '../../Components';
|
|
5
|
+
const OrderSummaryCard = ({
|
|
6
|
+
item_order
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
|
|
9
|
+
style: {
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
padding: 5,
|
|
12
|
+
paddingRight: 10,
|
|
13
|
+
paddingLeft: 10
|
|
14
|
+
}
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
16
|
+
style: {
|
|
17
|
+
flex: 1
|
|
18
|
+
},
|
|
19
|
+
size: 14,
|
|
20
|
+
color: Colors.brand.midnight
|
|
21
|
+
}, "Subtotal"), /*#__PURE__*/React.createElement(Text, {
|
|
22
|
+
size: 14,
|
|
23
|
+
color: Colors.brand.midnight
|
|
24
|
+
}, "$", item_order.amount)), item_order.fee_1 ? /*#__PURE__*/React.createElement(View, {
|
|
25
|
+
style: {
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
padding: 5,
|
|
28
|
+
paddingRight: 10,
|
|
29
|
+
paddingLeft: 10
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
32
|
+
style: {
|
|
33
|
+
flex: 1
|
|
34
|
+
},
|
|
35
|
+
size: 14,
|
|
36
|
+
color: Colors.brand.midnight
|
|
37
|
+
}, item_order.fee_1), /*#__PURE__*/React.createElement(Text, {
|
|
38
|
+
size: 14,
|
|
39
|
+
color: Colors.brand.midnight
|
|
40
|
+
}, "$", item_order.fee_1_amount)) : /*#__PURE__*/React.createElement(React.Fragment, null), item_order.fee_2 ? /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: {
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
padding: 5,
|
|
44
|
+
paddingRight: 10,
|
|
45
|
+
paddingLeft: 10
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
48
|
+
style: {
|
|
49
|
+
flex: 1
|
|
50
|
+
},
|
|
51
|
+
size: 14,
|
|
52
|
+
color: Colors.brand.midnight
|
|
53
|
+
}, item_order.fee_2), /*#__PURE__*/React.createElement(Text, {
|
|
54
|
+
size: 14,
|
|
55
|
+
color: Colors.brand.midnight
|
|
56
|
+
}, "$", item_order.fee_2_amount)) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
|
|
57
|
+
style: {
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
padding: 5,
|
|
60
|
+
paddingRight: 10,
|
|
61
|
+
paddingLeft: 10
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
64
|
+
style: {
|
|
65
|
+
flex: 1
|
|
66
|
+
},
|
|
67
|
+
size: 14,
|
|
68
|
+
color: Colors.brand.midnight,
|
|
69
|
+
weight: "bold"
|
|
70
|
+
}, "Total"), /*#__PURE__*/React.createElement(Text, {
|
|
71
|
+
size: 14,
|
|
72
|
+
color: Colors.brand.midnight,
|
|
73
|
+
weight: "bold"
|
|
74
|
+
}, "$", item_order.total_amount)));
|
|
75
|
+
};
|
|
76
|
+
export default OrderSummaryCard;
|
|
77
|
+
//# sourceMappingURL=OrderSummaryCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Colors","Text","OrderSummaryCard","item_order","createElement","style","flexDirection","padding","paddingRight","paddingLeft","flex","size","color","brand","midnight","amount","fee_1","fee_1_amount","Fragment","fee_2","fee_2_amount","weight","total_amount"],"sourceRoot":"../../../../src","sources":["Checkout/components/OrderSummaryCard.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, StyleSheet, Linking } from "react-native";
|
|
3
|
+
import { Button, Icons, Text } from '../Components';
|
|
4
|
+
import { CheckoutApi, CheckoutHelpers } from './api';
|
|
5
|
+
import ItemSummaryCard from './components/ItemSummaryCard';
|
|
6
|
+
import OrderSummaryCard from './components/OrderSummaryCard';
|
|
7
|
+
import AccountSummaryCard from './components/AccountSummaryCard';
|
|
8
|
+
import Colors from '../constants/colors';
|
|
9
|
+
import AddressManager from '../Wallet/components/AddressManager';
|
|
10
|
+
import { PayPalScriptProvider } from '@paypal/react-paypal-js';
|
|
11
|
+
import PayPalOrderCapture from '../Wallet/components/PayPalOrderCapture';
|
|
12
|
+
import SpringView from '../Components/Spring';
|
|
13
|
+
import { usePlayerLocation } from '../LocationTracker/LocationStatus';
|
|
14
|
+
import LocationTracker from '../LocationTracker';
|
|
15
|
+
import { view_styles } from '../constants/styles';
|
|
16
|
+
import { WalletApi } from '../Wallet/api';
|
|
17
|
+
const Checkout = ({
|
|
18
|
+
item_order,
|
|
19
|
+
account_id,
|
|
20
|
+
onCancel,
|
|
21
|
+
onCompleteOrder,
|
|
22
|
+
onRequestNewAccount
|
|
23
|
+
}) => {
|
|
24
|
+
const [loading, setLoading] = useState(false);
|
|
25
|
+
const [completing, setCompleting] = useState(false);
|
|
26
|
+
const [show_addresses, setShowAddresses] = useState(false);
|
|
27
|
+
const [cvv, setCVV] = useState();
|
|
28
|
+
const [show_location, setShowLocation] = useState(false);
|
|
29
|
+
const {
|
|
30
|
+
permission,
|
|
31
|
+
location,
|
|
32
|
+
getLocation,
|
|
33
|
+
checkPermissions
|
|
34
|
+
} = usePlayerLocation();
|
|
35
|
+
const [checkout_data, setCheckoutData] = useState({
|
|
36
|
+
loaded: false,
|
|
37
|
+
items: [],
|
|
38
|
+
player_addresses: [],
|
|
39
|
+
accounts: []
|
|
40
|
+
});
|
|
41
|
+
const [checkout, setCheckout] = useState({});
|
|
42
|
+
const [draft_order, setDraftOrder] = useState();
|
|
43
|
+
const {
|
|
44
|
+
player,
|
|
45
|
+
accounts,
|
|
46
|
+
items,
|
|
47
|
+
player_addresses,
|
|
48
|
+
selected_account,
|
|
49
|
+
billing_address
|
|
50
|
+
} = checkout_data;
|
|
51
|
+
const {
|
|
52
|
+
ip_item_order,
|
|
53
|
+
ip_transaction
|
|
54
|
+
} = checkout;
|
|
55
|
+
|
|
56
|
+
//const shipping_address_required = CheckoutHelpers.isShippingRequired(items);
|
|
57
|
+
const billing_address_required = CheckoutHelpers.isBillingAddressRequired(items, selected_account);
|
|
58
|
+
|
|
59
|
+
//const isLocationRequired = CheckoutHelpers.isLocationRequired(items);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
CheckoutApi.setEnvironment();
|
|
63
|
+
WalletApi.setEnvironment();
|
|
64
|
+
if (!item_order) {
|
|
65
|
+
return setDraftOrder(undefined);
|
|
66
|
+
}
|
|
67
|
+
getDetailsFromServer(item_order, account_id);
|
|
68
|
+
}, [item_order]);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!permission.checked) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (permission.permission != 'granted') {
|
|
74
|
+
return setShowLocation(true);
|
|
75
|
+
}
|
|
76
|
+
}, [permission]);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get all necessary checkout data from the server
|
|
80
|
+
* @param item_order
|
|
81
|
+
* @param account_id
|
|
82
|
+
*/
|
|
83
|
+
const getDetailsFromServer = async (item_order, account_id) => {
|
|
84
|
+
checkPermissions({
|
|
85
|
+
auto_on_granted: true
|
|
86
|
+
});
|
|
87
|
+
const player = await CheckoutApi.getMyDetails();
|
|
88
|
+
const order_items = await CheckoutApi.getItemsByIds(item_order.items.map(i => i.item_id));
|
|
89
|
+
const accounts = await CheckoutApi.getMyAccounts();
|
|
90
|
+
let eligible_accounts = CheckoutHelpers.filterMyPurchaseAccounts(accounts, order_items);
|
|
91
|
+
const addresses = await CheckoutApi.getMyAddresses();
|
|
92
|
+
let a = eligible_accounts.find(a => a.account_id == account_id);
|
|
93
|
+
if (!a) {
|
|
94
|
+
a = eligible_accounts.find(a => a.default_account);
|
|
95
|
+
}
|
|
96
|
+
let ba = addresses.find(addy => addy.player_address_id == a?.default_billing_address_id);
|
|
97
|
+
if (a) {
|
|
98
|
+
item_order = CheckoutHelpers.genItemOrder(item_order, order_items, a);
|
|
99
|
+
}
|
|
100
|
+
setDraftOrder(item_order);
|
|
101
|
+
setCheckoutData({
|
|
102
|
+
loaded: true,
|
|
103
|
+
player,
|
|
104
|
+
selected_account: a,
|
|
105
|
+
player_addresses: addresses,
|
|
106
|
+
billing_address: ba,
|
|
107
|
+
items: order_items,
|
|
108
|
+
accounts: accounts
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
const order_errors = !draft_order ? [] : CheckoutHelpers.isOrderValid(draft_order, items, selected_account, cvv, billing_address, undefined, location.location, location.coordinates);
|
|
112
|
+
const handleConfirm = async () => {
|
|
113
|
+
if (!draft_order || order_errors.length > 0) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
setLoading(true);
|
|
117
|
+
const draft_transaction = CheckoutHelpers.genTransactionFromItemOrder(draft_order, items, selected_account?.account_id, cvv);
|
|
118
|
+
const resp = await CheckoutApi.createOrder({
|
|
119
|
+
...draft_order,
|
|
120
|
+
region: location.region,
|
|
121
|
+
location: location.coordinates
|
|
122
|
+
}, {
|
|
123
|
+
...draft_transaction,
|
|
124
|
+
billing_address_id: billing_address?.player_address_id
|
|
125
|
+
});
|
|
126
|
+
setCheckout({
|
|
127
|
+
ip_item_order: resp.item_order,
|
|
128
|
+
ip_transaction: resp.transaction
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
const handleCancel = async () => {
|
|
132
|
+
if (!ip_transaction) {
|
|
133
|
+
return onCancel();
|
|
134
|
+
}
|
|
135
|
+
await CheckoutApi.cancelTransaction(ip_transaction.transaction_id);
|
|
136
|
+
setCheckout({});
|
|
137
|
+
onCancel();
|
|
138
|
+
};
|
|
139
|
+
const checkTransactionStatus = async () => {
|
|
140
|
+
if (!ip_transaction) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const resp = await CheckoutApi.getTransactionById(ip_transaction.transaction_id);
|
|
144
|
+
setCheckout({
|
|
145
|
+
...checkout,
|
|
146
|
+
ip_transaction: resp.transaction
|
|
147
|
+
});
|
|
148
|
+
if (resp.transaction.status == 'redirect') {
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
console.log('checking tran status');
|
|
151
|
+
checkTransactionStatus();
|
|
152
|
+
}, 2000);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const handleChangeAccount = async account => {
|
|
156
|
+
let new_address = player_addresses.find(pa => pa.player_address_id == account.default_billing_address_id);
|
|
157
|
+
setCheckoutData({
|
|
158
|
+
...checkout_data,
|
|
159
|
+
selected_account: account,
|
|
160
|
+
billing_address: new_address ? new_address : billing_address
|
|
161
|
+
});
|
|
162
|
+
if (draft_order) {
|
|
163
|
+
let new_draft_order = CheckoutHelpers.genItemOrder(draft_order, items, account);
|
|
164
|
+
setDraftOrder(new_draft_order);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const handleChangeBillingAddress = async address => {
|
|
168
|
+
if (selected_account) {
|
|
169
|
+
await CheckoutApi.updateAccountDefaultAddress(selected_account.account_id, address.player_address_id);
|
|
170
|
+
}
|
|
171
|
+
setCheckoutData({
|
|
172
|
+
...checkout_data,
|
|
173
|
+
billing_address: address,
|
|
174
|
+
player_addresses: player_addresses.filter(pa => pa.player_address_id != address.player_address_id).concat(address)
|
|
175
|
+
});
|
|
176
|
+
setShowAddresses(false);
|
|
177
|
+
};
|
|
178
|
+
const handleRedirect = async () => {
|
|
179
|
+
if (!ip_transaction?.redirect_url) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (completing) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
setCompleting(true);
|
|
186
|
+
Linking.openURL(ip_transaction.redirect_url);
|
|
187
|
+
setTimeout(() => {
|
|
188
|
+
console.log('checking tran status!');
|
|
189
|
+
checkTransactionStatus();
|
|
190
|
+
}, 5000);
|
|
191
|
+
};
|
|
192
|
+
if (!draft_order || !player) {
|
|
193
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
194
|
+
}
|
|
195
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
196
|
+
style: {
|
|
197
|
+
flex: 1
|
|
198
|
+
}
|
|
199
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
200
|
+
style: {
|
|
201
|
+
flex: 1
|
|
202
|
+
}
|
|
203
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
204
|
+
nativeID: "items",
|
|
205
|
+
style: {
|
|
206
|
+
...local_styles.section,
|
|
207
|
+
borderBottomWidth: 1,
|
|
208
|
+
borderBottomColor: Colors.shades.shade600
|
|
209
|
+
}
|
|
210
|
+
}, /*#__PURE__*/React.createElement(ItemSummaryCard, {
|
|
211
|
+
items: items
|
|
212
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
213
|
+
nativeID: "order_summary",
|
|
214
|
+
style: {
|
|
215
|
+
...local_styles.section,
|
|
216
|
+
borderBottomWidth: 1,
|
|
217
|
+
borderBottomColor: Colors.shades.shade600
|
|
218
|
+
}
|
|
219
|
+
}, /*#__PURE__*/React.createElement(OrderSummaryCard, {
|
|
220
|
+
item_order: draft_order
|
|
221
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
222
|
+
nativeID: "account_summary",
|
|
223
|
+
style: {
|
|
224
|
+
...local_styles.section,
|
|
225
|
+
borderBottomWidth: 1,
|
|
226
|
+
borderBottomColor: Colors.shades.shade600
|
|
227
|
+
}
|
|
228
|
+
}, /*#__PURE__*/React.createElement(AccountSummaryCard, {
|
|
229
|
+
accounts: accounts,
|
|
230
|
+
items: items,
|
|
231
|
+
selected_account: selected_account,
|
|
232
|
+
player_address: billing_address,
|
|
233
|
+
billing_address_required: billing_address_required,
|
|
234
|
+
cvv: cvv,
|
|
235
|
+
onRequestNewAccount: onRequestNewAccount,
|
|
236
|
+
onCVVChange: new_cvv => setCVV(new_cvv),
|
|
237
|
+
onAccountsUpdate: accts => {
|
|
238
|
+
setCheckoutData({
|
|
239
|
+
...checkout_data,
|
|
240
|
+
selected_account: accts.find(a => a.account_id == selected_account?.account_id),
|
|
241
|
+
accounts: accounts.filter(a => !accts.find(na => na.account_id == a.account_id)).concat(accts)
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
onChangeAddress: () => setShowAddresses(true),
|
|
245
|
+
onSelectAccount: account => handleChangeAccount(account)
|
|
246
|
+
}))), order_errors.length > 0 ? /*#__PURE__*/React.createElement(View, {
|
|
247
|
+
style: {
|
|
248
|
+
margin: 10,
|
|
249
|
+
borderRadius: 4,
|
|
250
|
+
padding: 10,
|
|
251
|
+
backgroundColor: Colors.shades.white,
|
|
252
|
+
...view_styles.float
|
|
253
|
+
}
|
|
254
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
255
|
+
style: {
|
|
256
|
+
marginBottom: 5
|
|
257
|
+
},
|
|
258
|
+
size: 14,
|
|
259
|
+
color: Colors.brand.midnight,
|
|
260
|
+
weight: "semibold"
|
|
261
|
+
}, "Please fix the following before continuing"), order_errors.map(e => {
|
|
262
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
263
|
+
style: {
|
|
264
|
+
padding: 4
|
|
265
|
+
},
|
|
266
|
+
size: 12,
|
|
267
|
+
color: Colors.utility.warning,
|
|
268
|
+
weight: "bold"
|
|
269
|
+
}, e);
|
|
270
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(PayPalScriptProvider, {
|
|
271
|
+
options: {
|
|
272
|
+
clientId: CheckoutApi.getPayPalClientId()
|
|
273
|
+
}
|
|
274
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
275
|
+
style: {
|
|
276
|
+
padding: 20
|
|
277
|
+
}
|
|
278
|
+
}, !ip_transaction ? /*#__PURE__*/React.createElement(View, {
|
|
279
|
+
nativeID: "action_row",
|
|
280
|
+
style: {
|
|
281
|
+
flexDirection: 'row',
|
|
282
|
+
alignItems: 'center'
|
|
283
|
+
}
|
|
284
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
285
|
+
style: {
|
|
286
|
+
flex: 1,
|
|
287
|
+
marginRight: 5,
|
|
288
|
+
opacity: loading ? 0.5 : 1
|
|
289
|
+
},
|
|
290
|
+
title: "CANCEL",
|
|
291
|
+
disabled: loading,
|
|
292
|
+
title_color: Colors.utility.error,
|
|
293
|
+
borderWidth: 1,
|
|
294
|
+
borderColor: Colors.utility.error,
|
|
295
|
+
padding: 15,
|
|
296
|
+
onPress: () => handleCancel()
|
|
297
|
+
}), selected_account?.account_type == 'paypal' ? /*#__PURE__*/React.createElement(PayPalOrderCapture, {
|
|
298
|
+
draft_item_order: draft_order,
|
|
299
|
+
paypal_account: selected_account,
|
|
300
|
+
region: location.region,
|
|
301
|
+
coordinates: location.coordinates,
|
|
302
|
+
button_height: 48,
|
|
303
|
+
items: items,
|
|
304
|
+
order_valid: order_errors.length == 0 ? true : false,
|
|
305
|
+
onOrderUpdate: (item_order, transaction) => setCheckout({
|
|
306
|
+
ip_item_order: item_order,
|
|
307
|
+
ip_transaction: transaction
|
|
308
|
+
}),
|
|
309
|
+
onCancel: () => console.log('DONE!')
|
|
310
|
+
}) : /*#__PURE__*/React.createElement(Button, {
|
|
311
|
+
style: {
|
|
312
|
+
flex: 3,
|
|
313
|
+
opacity: loading || order_errors.length > 0 ? 0.5 : 1
|
|
314
|
+
},
|
|
315
|
+
loading: loading || location.loading,
|
|
316
|
+
disabled: loading || order_errors.length > 0,
|
|
317
|
+
title: location.loading ? 'VERIFYING LOCATION' : 'CONFIRM & CONTINUE',
|
|
318
|
+
title_color: Colors.shades.white,
|
|
319
|
+
backgroundColor: Colors.brand.electric,
|
|
320
|
+
padding: 15,
|
|
321
|
+
onPress: () => handleConfirm()
|
|
322
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null))), show_addresses ? /*#__PURE__*/React.createElement(View, {
|
|
323
|
+
style: {
|
|
324
|
+
position: 'absolute',
|
|
325
|
+
top: 0,
|
|
326
|
+
bottom: 0,
|
|
327
|
+
left: 0,
|
|
328
|
+
right: 0,
|
|
329
|
+
backgroundColor: Colors.shades.black_faded,
|
|
330
|
+
justifyContent: 'flex-end'
|
|
331
|
+
}
|
|
332
|
+
}, /*#__PURE__*/React.createElement(SpringView, {
|
|
333
|
+
to: 0,
|
|
334
|
+
from: 500,
|
|
335
|
+
slide: "vertical",
|
|
336
|
+
style: {
|
|
337
|
+
backgroundColor: Colors.shades.white,
|
|
338
|
+
borderTopRightRadius: 40,
|
|
339
|
+
borderTopLeftRadius: 40
|
|
340
|
+
}
|
|
341
|
+
}, /*#__PURE__*/React.createElement(AddressManager, {
|
|
342
|
+
player: player,
|
|
343
|
+
player_addresses: player_addresses,
|
|
344
|
+
location: location,
|
|
345
|
+
onCancel: () => setShowAddresses(false),
|
|
346
|
+
onRemoveAddress: addy => {
|
|
347
|
+
let selected_addy = billing_address && billing_address.player_address_id == addy.player_address_id ? undefined : billing_address;
|
|
348
|
+
setCheckoutData({
|
|
349
|
+
...checkout_data,
|
|
350
|
+
billing_address: selected_addy,
|
|
351
|
+
player_addresses: player_addresses.filter(pa => pa.player_address_id != addy.player_address_id)
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
onAddAddress: addy => handleChangeBillingAddress(addy),
|
|
355
|
+
onSelect: addy => handleChangeBillingAddress(addy)
|
|
356
|
+
}))) : /*#__PURE__*/React.createElement(React.Fragment, null), ip_item_order && ip_transaction ? /*#__PURE__*/React.createElement(View, {
|
|
357
|
+
style: {
|
|
358
|
+
position: 'absolute',
|
|
359
|
+
top: 0,
|
|
360
|
+
left: 0,
|
|
361
|
+
right: 0,
|
|
362
|
+
bottom: 0,
|
|
363
|
+
backgroundColor: Colors.shades.black_faded,
|
|
364
|
+
justifyContent: 'flex-end'
|
|
365
|
+
}
|
|
366
|
+
}, /*#__PURE__*/React.createElement(SpringView, {
|
|
367
|
+
slide: "vertical",
|
|
368
|
+
from: 500,
|
|
369
|
+
to: 0,
|
|
370
|
+
style: {
|
|
371
|
+
borderTopRightRadius: 40,
|
|
372
|
+
borderTopLeftRadius: 40,
|
|
373
|
+
backgroundColor: Colors.shades.white
|
|
374
|
+
}
|
|
375
|
+
}, ip_transaction.status == 'posted' ? /*#__PURE__*/React.createElement(View, {
|
|
376
|
+
style: {
|
|
377
|
+
flex: 1,
|
|
378
|
+
padding: 10,
|
|
379
|
+
paddingTop: 30,
|
|
380
|
+
paddingBottom: 30,
|
|
381
|
+
justifyContent: 'center',
|
|
382
|
+
alignItems: 'center'
|
|
383
|
+
}
|
|
384
|
+
}, /*#__PURE__*/React.createElement(Icons.TransactionSuccessIcon, {
|
|
385
|
+
size: 150
|
|
386
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
387
|
+
style: {
|
|
388
|
+
padding: 20,
|
|
389
|
+
borderRadius: 8,
|
|
390
|
+
borderWidth: 1,
|
|
391
|
+
borderColor: Colors.utility.success,
|
|
392
|
+
marginTop: 20
|
|
393
|
+
}
|
|
394
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
395
|
+
size: 20,
|
|
396
|
+
color: Colors.utility.success,
|
|
397
|
+
weight: "bold",
|
|
398
|
+
textAlign: "center"
|
|
399
|
+
}, "Order Successful"), /*#__PURE__*/React.createElement(Text, {
|
|
400
|
+
style: {
|
|
401
|
+
marginTop: 10
|
|
402
|
+
},
|
|
403
|
+
size: 16,
|
|
404
|
+
color: Colors.brand.cobalt,
|
|
405
|
+
weight: "regular",
|
|
406
|
+
textAlign: "center"
|
|
407
|
+
}, "Your order was successfully processed. An email confirmation has been sent. Please select close below to continue."))) : ip_transaction.status == 'failed' ? /*#__PURE__*/React.createElement(View, {
|
|
408
|
+
style: {
|
|
409
|
+
flex: 1,
|
|
410
|
+
padding: 10,
|
|
411
|
+
paddingTop: 30,
|
|
412
|
+
paddingBottom: 30,
|
|
413
|
+
justifyContent: 'center',
|
|
414
|
+
alignItems: 'center'
|
|
415
|
+
}
|
|
416
|
+
}, /*#__PURE__*/React.createElement(Icons.TransactionErrorIcon, {
|
|
417
|
+
size: 150
|
|
418
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
419
|
+
style: {
|
|
420
|
+
padding: 20,
|
|
421
|
+
borderRadius: 8,
|
|
422
|
+
borderWidth: 1,
|
|
423
|
+
borderColor: Colors.utility.error,
|
|
424
|
+
marginTop: 20
|
|
425
|
+
}
|
|
426
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
427
|
+
size: 20,
|
|
428
|
+
color: Colors.utility.error,
|
|
429
|
+
weight: "bold",
|
|
430
|
+
textAlign: "center"
|
|
431
|
+
}, "Order Failed"), /*#__PURE__*/React.createElement(Text, {
|
|
432
|
+
style: {
|
|
433
|
+
marginTop: 10
|
|
434
|
+
},
|
|
435
|
+
size: 16,
|
|
436
|
+
color: Colors.brand.cobalt,
|
|
437
|
+
weight: "regular",
|
|
438
|
+
textAlign: "center"
|
|
439
|
+
}, "Sorry, we were unable to process your order at this time. Please try again or reach out to support for help."))) : ip_transaction.status == 'cancelled' ? /*#__PURE__*/React.createElement(View, {
|
|
440
|
+
style: {
|
|
441
|
+
flex: 1,
|
|
442
|
+
padding: 10,
|
|
443
|
+
paddingTop: 30,
|
|
444
|
+
paddingBottom: 30,
|
|
445
|
+
justifyContent: 'center',
|
|
446
|
+
alignItems: 'center'
|
|
447
|
+
}
|
|
448
|
+
}, /*#__PURE__*/React.createElement(Icons.TransactionErrorIcon, {
|
|
449
|
+
size: 150
|
|
450
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
451
|
+
style: {
|
|
452
|
+
padding: 20,
|
|
453
|
+
borderRadius: 8,
|
|
454
|
+
borderWidth: 1,
|
|
455
|
+
borderColor: Colors.utility.error,
|
|
456
|
+
marginTop: 20
|
|
457
|
+
}
|
|
458
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
459
|
+
size: 20,
|
|
460
|
+
color: Colors.utility.error,
|
|
461
|
+
weight: "bold",
|
|
462
|
+
textAlign: "center"
|
|
463
|
+
}, "Order Cancelled"), /*#__PURE__*/React.createElement(Text, {
|
|
464
|
+
style: {
|
|
465
|
+
marginTop: 10
|
|
466
|
+
},
|
|
467
|
+
size: 16,
|
|
468
|
+
color: Colors.brand.cobalt,
|
|
469
|
+
weight: "regular",
|
|
470
|
+
textAlign: "center"
|
|
471
|
+
}, "Your order was cancelled. Please try again."))) : ip_transaction.status == 'redirect' ? /*#__PURE__*/React.createElement(View, {
|
|
472
|
+
style: {
|
|
473
|
+
flex: 1,
|
|
474
|
+
padding: 10,
|
|
475
|
+
paddingTop: 30,
|
|
476
|
+
paddingBottom: 30,
|
|
477
|
+
justifyContent: 'center',
|
|
478
|
+
alignItems: 'center'
|
|
479
|
+
}
|
|
480
|
+
}, /*#__PURE__*/React.createElement(Icons.IBTFLowIcon, {
|
|
481
|
+
size: 300
|
|
482
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
483
|
+
style: {
|
|
484
|
+
padding: 20,
|
|
485
|
+
borderRadius: 8,
|
|
486
|
+
borderWidth: 1,
|
|
487
|
+
borderColor: Colors.shades.shade600,
|
|
488
|
+
marginTop: 20
|
|
489
|
+
}
|
|
490
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
491
|
+
size: 20,
|
|
492
|
+
color: Colors.brand.cobalt,
|
|
493
|
+
weight: "bold",
|
|
494
|
+
textAlign: "center"
|
|
495
|
+
}, "Finish With Plaid"), /*#__PURE__*/React.createElement(Text, {
|
|
496
|
+
style: {
|
|
497
|
+
marginTop: 10
|
|
498
|
+
},
|
|
499
|
+
size: 16,
|
|
500
|
+
color: Colors.brand.cobalt,
|
|
501
|
+
weight: "regular",
|
|
502
|
+
textAlign: "center"
|
|
503
|
+
}, "Select Complete Order below to complete the transaction through Plaid"))) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
|
|
504
|
+
nativeID: "action_row",
|
|
505
|
+
style: {
|
|
506
|
+
flexDirection: 'row',
|
|
507
|
+
padding: 20
|
|
508
|
+
}
|
|
509
|
+
}, ip_transaction.status == 'redirect' || ip_transaction.status == 'pending' ? /*#__PURE__*/React.createElement(Button, {
|
|
510
|
+
style: {
|
|
511
|
+
flex: 1,
|
|
512
|
+
marginRight: 5,
|
|
513
|
+
opacity: 1
|
|
514
|
+
},
|
|
515
|
+
title: "CANCEL"
|
|
516
|
+
//disabled={loading}
|
|
517
|
+
,
|
|
518
|
+
title_color: Colors.utility.error,
|
|
519
|
+
borderWidth: 1,
|
|
520
|
+
borderColor: Colors.utility.error,
|
|
521
|
+
padding: 15,
|
|
522
|
+
onPress: () => handleCancel()
|
|
523
|
+
}) : /*#__PURE__*/React.createElement(Button, {
|
|
524
|
+
style: {
|
|
525
|
+
flex: 1,
|
|
526
|
+
opacity: 1
|
|
527
|
+
},
|
|
528
|
+
title: "CLOSE"
|
|
529
|
+
//disabled={loading}
|
|
530
|
+
,
|
|
531
|
+
title_color: Colors.utility.error,
|
|
532
|
+
borderWidth: 1,
|
|
533
|
+
borderColor: Colors.utility.error,
|
|
534
|
+
padding: 15,
|
|
535
|
+
onPress: () => onCompleteOrder(ip_item_order, ip_transaction)
|
|
536
|
+
}), ip_transaction.status == 'redirect' ? /*#__PURE__*/React.createElement(Button, {
|
|
537
|
+
style: {
|
|
538
|
+
flex: 3,
|
|
539
|
+
opacity: completing ? 0.5 : 1
|
|
540
|
+
},
|
|
541
|
+
loading: completing,
|
|
542
|
+
disabled: completing,
|
|
543
|
+
title: "COMPLETE ORDER",
|
|
544
|
+
title_color: Colors.shades.white,
|
|
545
|
+
backgroundColor: Colors.brand.electric,
|
|
546
|
+
padding: 15,
|
|
547
|
+
onPress: () => handleRedirect()
|
|
548
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null)))) : /*#__PURE__*/React.createElement(React.Fragment, null), show_location ? /*#__PURE__*/React.createElement(View, {
|
|
549
|
+
style: {
|
|
550
|
+
position: 'absolute',
|
|
551
|
+
top: 0,
|
|
552
|
+
bottom: 0,
|
|
553
|
+
left: 0,
|
|
554
|
+
right: 0,
|
|
555
|
+
backgroundColor: Colors.shades.black_faded,
|
|
556
|
+
justifyContent: 'flex-end'
|
|
557
|
+
}
|
|
558
|
+
}, /*#__PURE__*/React.createElement(SpringView, {
|
|
559
|
+
to: 0,
|
|
560
|
+
from: 500,
|
|
561
|
+
slide: "vertical",
|
|
562
|
+
style: {
|
|
563
|
+
backgroundColor: Colors.shades.white,
|
|
564
|
+
borderTopRightRadius: 40,
|
|
565
|
+
borderTopLeftRadius: 40
|
|
566
|
+
}
|
|
567
|
+
}, /*#__PURE__*/React.createElement(LocationTracker, {
|
|
568
|
+
location: location,
|
|
569
|
+
permission: permission,
|
|
570
|
+
onGetLocation: getLocation,
|
|
571
|
+
onClose: () => setShowLocation(false)
|
|
572
|
+
}))) : /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
573
|
+
};
|
|
574
|
+
const local_styles = StyleSheet.create({
|
|
575
|
+
section: {
|
|
576
|
+
padding: 10,
|
|
577
|
+
margin: 5
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
export default Checkout;
|
|
581
|
+
//# sourceMappingURL=index.js.map
|