be-components 7.5.8 → 7.6.0

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.
Files changed (119) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +5 -1
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/BetRouter/components/MyOpportunities.js +14 -9
  4. package/lib/commonjs/BetRouter/components/MyOpportunities.js.map +1 -1
  5. package/lib/commonjs/BetRouter/components/OpportunityHistory.js +92 -41
  6. package/lib/commonjs/BetRouter/components/OpportunityHistory.js.map +1 -1
  7. package/lib/commonjs/Checkout/api/index.js +11 -3
  8. package/lib/commonjs/Checkout/api/index.js.map +1 -1
  9. package/lib/commonjs/Checkout/components/OrderSummaryCard.js +4 -4
  10. package/lib/commonjs/Checkout/components/OrderSummaryCard.js.map +1 -1
  11. package/lib/commonjs/Checkout/index.js.map +1 -1
  12. package/lib/commonjs/ProfileManager/Components/VouchCard.js +1 -1
  13. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  14. package/lib/commonjs/Wallet/api/index.js +21 -4
  15. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  16. package/lib/commonjs/Wallet/components/LinkAccountManager.js +18 -2
  17. package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -1
  18. package/lib/commonjs/Wallet/components/ManageAccountCard.js +32 -2
  19. package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -1
  20. package/lib/commonjs/Wallet/components/ManualACHAdd.js +47 -5
  21. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -1
  22. package/lib/commonjs/Wallet/components/WalletActionSelector.js +22 -2
  23. package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
  24. package/lib/commonjs/Wallet/components/WithdrawCard.js +56 -5
  25. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
  26. package/lib/commonjs/Wallet/index.js +43 -4
  27. package/lib/commonjs/Wallet/index.js.map +1 -1
  28. package/lib/commonjs/types.d.js.map +1 -1
  29. package/lib/module/ApiOverrides/index.js +5 -1
  30. package/lib/module/ApiOverrides/index.js.map +1 -1
  31. package/lib/module/BetRouter/components/MyOpportunities.js +14 -9
  32. package/lib/module/BetRouter/components/MyOpportunities.js.map +1 -1
  33. package/lib/module/BetRouter/components/OpportunityHistory.js +93 -42
  34. package/lib/module/BetRouter/components/OpportunityHistory.js.map +1 -1
  35. package/lib/module/Checkout/api/index.js +11 -3
  36. package/lib/module/Checkout/api/index.js.map +1 -1
  37. package/lib/module/Checkout/components/OrderSummaryCard.js +4 -4
  38. package/lib/module/Checkout/components/OrderSummaryCard.js.map +1 -1
  39. package/lib/module/Checkout/index.js.map +1 -1
  40. package/lib/module/ProfileManager/Components/VouchCard.js +1 -1
  41. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  42. package/lib/module/Wallet/api/index.js +21 -4
  43. package/lib/module/Wallet/api/index.js.map +1 -1
  44. package/lib/module/Wallet/components/LinkAccountManager.js +18 -2
  45. package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -1
  46. package/lib/module/Wallet/components/ManageAccountCard.js +32 -2
  47. package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -1
  48. package/lib/module/Wallet/components/ManualACHAdd.js +47 -5
  49. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -1
  50. package/lib/module/Wallet/components/WalletActionSelector.js +22 -2
  51. package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
  52. package/lib/module/Wallet/components/WithdrawCard.js +55 -5
  53. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
  54. package/lib/module/Wallet/index.js +43 -4
  55. package/lib/module/Wallet/index.js.map +1 -1
  56. package/lib/module/types.d.js.map +1 -1
  57. package/lib/typescript/lib/commonjs/ApiOverrides/index.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts.map +1 -1
  59. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts +1 -2
  60. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts.map +1 -1
  61. package/lib/typescript/lib/commonjs/Checkout/api/index.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/Wallet/api/index.d.ts +1 -0
  63. package/lib/typescript/lib/commonjs/Wallet/api/index.d.ts.map +1 -1
  64. package/lib/typescript/lib/commonjs/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  65. package/lib/typescript/lib/commonjs/Wallet/components/ManageAccountCard.d.ts.map +1 -1
  66. package/lib/typescript/lib/commonjs/Wallet/components/ManualACHAdd.d.ts +3 -1
  67. package/lib/typescript/lib/commonjs/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  68. package/lib/typescript/lib/commonjs/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  69. package/lib/typescript/lib/commonjs/Wallet/components/WithdrawCard.d.ts +4 -1
  70. package/lib/typescript/lib/commonjs/Wallet/components/WithdrawCard.d.ts.map +1 -1
  71. package/lib/typescript/lib/commonjs/Wallet/index.d.ts.map +1 -1
  72. package/lib/typescript/lib/module/ApiOverrides/index.d.ts.map +1 -1
  73. package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts.map +1 -1
  74. package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts +1 -2
  75. package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts.map +1 -1
  76. package/lib/typescript/lib/module/Checkout/api/index.d.ts.map +1 -1
  77. package/lib/typescript/lib/module/Wallet/api/index.d.ts +1 -0
  78. package/lib/typescript/lib/module/Wallet/api/index.d.ts.map +1 -1
  79. package/lib/typescript/lib/module/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  80. package/lib/typescript/lib/module/Wallet/components/ManageAccountCard.d.ts.map +1 -1
  81. package/lib/typescript/lib/module/Wallet/components/ManualACHAdd.d.ts +3 -1
  82. package/lib/typescript/lib/module/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  83. package/lib/typescript/lib/module/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  84. package/lib/typescript/lib/module/Wallet/components/WithdrawCard.d.ts +4 -1
  85. package/lib/typescript/lib/module/Wallet/components/WithdrawCard.d.ts.map +1 -1
  86. package/lib/typescript/lib/module/Wallet/index.d.ts.map +1 -1
  87. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  88. package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts.map +1 -1
  89. package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts +1 -1
  90. package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts.map +1 -1
  91. package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -1
  92. package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
  93. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  94. package/lib/typescript/src/Wallet/api/index.d.ts +1 -0
  95. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  96. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  97. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -1
  98. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +4 -2
  99. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  100. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  101. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +3 -1
  102. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -1
  103. package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
  104. package/package.json +1 -1
  105. package/src/ApiOverrides/index.ts +5 -1
  106. package/src/BetRouter/components/MyOpportunities.tsx +24 -21
  107. package/src/BetRouter/components/OpportunityHistory.tsx +72 -36
  108. package/src/Checkout/api/index.tsx +10 -2
  109. package/src/Checkout/components/OrderSummaryCard.tsx +4 -4
  110. package/src/Checkout/index.tsx +0 -1
  111. package/src/ProfileManager/Components/VouchCard.tsx +3 -4
  112. package/src/Wallet/api/index.ts +13 -5
  113. package/src/Wallet/components/LinkAccountManager.tsx +14 -6
  114. package/src/Wallet/components/ManageAccountCard.tsx +23 -2
  115. package/src/Wallet/components/ManualACHAdd.tsx +31 -8
  116. package/src/Wallet/components/WalletActionSelector.tsx +12 -2
  117. package/src/Wallet/components/WithdrawCard.tsx +41 -5
  118. package/src/Wallet/index.tsx +28 -1
  119. package/src/types.d.ts +3 -0
@@ -5,6 +5,7 @@ import { ItemOrderApi, ItemOrderHelpers } from '../api';
5
5
  import { Button, Text, TextInput, View } from '../../Components/Themed';
6
6
  import { useColors } from '../../constants/useColors';
7
7
  import { Icons } from '../../Components';
8
+ import ManualACHAdd from './ManualACHAdd';
8
9
 
9
10
 
10
11
  type WithdrawCardProps = {
@@ -12,6 +13,8 @@ type WithdrawCardProps = {
12
13
  wallet_settings:WalletSettingsProps,
13
14
  player_balance:PlayerBalanceProps,
14
15
  account:AccountProps,
16
+ instant?:boolean,
17
+ onAccountUpdate:(account:AccountProps) => void,
15
18
  onFocusPosition?:(pos:FocusPositionProps) => void,
16
19
  deposit_limit:PlayerDepositLimitProps,
17
20
  withdraw_limit:PlayerWithdrawLimitProps,
@@ -19,26 +22,38 @@ type WithdrawCardProps = {
19
22
  onCancel:() => void
20
23
  }
21
24
  const sections = ['header','input','limits']
22
- const WithdrawCard = ({ wallet_settings, onTransact, player_balance, account, withdraw_limit, onFocusPosition, deposit_limit , onCancel}:WithdrawCardProps) => {
25
+ const WithdrawCard = ({ player, wallet_settings, onTransact, instant, player_balance, account, withdraw_limit, onAccountUpdate, onFocusPosition, deposit_limit , onCancel}:WithdrawCardProps) => {
23
26
  const Colors = useColors();
24
27
  const [ draft_order, setDraftOrder ] = useState<ItemOrderProps>();
25
-
28
+ const [ confirm_ach, setConfirmAch ] = useState(false);
29
+ //const [ withdraw_item, setWithdrawItem ] = useState<ItemProps | undefined>(undefined);
26
30
  useEffect(() => {
27
31
  getItemFromServer()
28
32
  },[])
29
33
 
30
34
  const getItemFromServer = async() => {
31
- const item = await ItemOrderApi.getItemByIdentifier('withdraw')
35
+ const item = await ItemOrderApi.getItemByIdentifier(instant?'instant_withdraw':'withdraw');
36
+ //setWithdrawItem(item);
32
37
  setDraftOrder(ItemOrderHelpers.genWithdrawOrder(item, account))
33
38
  }
34
39
 
35
-
40
+
36
41
  const { errors, available_for_withdraw } = ItemOrderHelpers.isWithdrawOrderValid(account, withdraw_limit, deposit_limit, player_balance, wallet_settings, draft_order)
37
42
 
38
43
  const handleTransact = () => {
39
44
  if(!draft_order){ return }
40
45
  if(errors.length > 0){ return }
41
- onTransact({ ...draft_order, total_amount: draft_order.amount as number })
46
+
47
+ //OK LETS CHECK THE ACCOUNT TYPE AND IF WE NEED ACCOUNT NUMBER INFORMATION
48
+ if(!instant){
49
+ if(!account.ach_detail?.account_number){
50
+ return setConfirmAch(true);
51
+ }
52
+ }
53
+ //Lets get the item
54
+ let draft_item = draft_order.items[0]
55
+ if(!draft_item){ return }
56
+ onTransact({ ...draft_order, total_amount: draft_order.amount as number, items: [{ ...draft_item, amount: draft_order.amount as number }] })
42
57
  }
43
58
 
44
59
 
@@ -51,7 +66,9 @@ const WithdrawCard = ({ wallet_settings, onTransact, player_balance, account, wi
51
66
  return (
52
67
  <View nativeID='deposit_rules' style={{ padding:10 }}>
53
68
  <Text size={28} textAlign='center' theme='h1'>Withdraw to your bank</Text>
69
+ {!instant ?
54
70
  <Text style={{ marginTop:10 }} size={14} textAlign='center' theme='description'>Withdraws can take up to 3 business days</Text>
71
+ :<></>}
55
72
  </View>
56
73
  )
57
74
  case 'input':
@@ -181,6 +198,25 @@ const WithdrawCard = ({ wallet_settings, onTransact, player_balance, account, wi
181
198
  onPress={() => handleTransact()}
182
199
  />
183
200
  </View>
201
+ {confirm_ach ?
202
+ <View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, flex:1, padding:20 }}>
203
+ <ManualACHAdd
204
+ account_id={account.account_id}
205
+ player={player}
206
+ onAddAccount={(account) => console.log(account)}
207
+ onUpdateAchDetails={(ach_detail) => {
208
+ console.log('HERE!!!')
209
+ let new_account = { ...account }
210
+ new_account.ach_detail = ach_detail
211
+ console.log(new_account)
212
+ onAccountUpdate(new_account);
213
+ setConfirmAch(false);
214
+ }}
215
+ onCancel={() => setConfirmAch(false)}
216
+ onFocusPosition={onFocusPosition}
217
+ />
218
+ </View>
219
+ :<></>}
184
220
  </View>
185
221
  )
186
222
  }
@@ -291,6 +291,7 @@ const MyWallet = ({ height, new_balance, account_id, view_mode, insets, header_s
291
291
  :walkthrough.step_action == 'manual_ach' ?
292
292
  <ManualACHAdd
293
293
  player={player}
294
+ onUpdateAchDetails={(_) => console.log('')}
294
295
  onFocusPosition={onFocusPosition}
295
296
  onAddAccount={(acct) => {
296
297
  setWallet({ ...wallet, accounts: accounts.concat(acct) })
@@ -343,6 +344,7 @@ const MyWallet = ({ height, new_balance, account_id, view_mode, insets, header_s
343
344
  {walkthrough.step_action == 'manual_ach' ?
344
345
  <ManualACHAdd
345
346
  player={player}
347
+ onUpdateAchDetails={(_) => console.log('')}
346
348
  onFocusPosition={onFocusPosition}
347
349
  onAddAccount={(acct) => setWallet({ ...wallet, accounts: accounts.concat(acct) })}
348
350
  onCancel={() => setWalkthrough({ ...walkthrough, step_action: undefined })}
@@ -485,7 +487,10 @@ const MyWallet = ({ height, new_balance, account_id, view_mode, insets, header_s
485
487
  account={selected_account}
486
488
  deposit_limit={deposit_limit}
487
489
  withdraw_limit={withdraw_limit}
488
- onAccountUpdate={(acct) => setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id) })}
490
+ onAccountUpdate={(acct) => {
491
+ setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id).concat(acct) })
492
+ if(selected_account.account_id == acct.account_id){ setSelectedAccount(acct) }
493
+ }}
489
494
  onClose={() => setView({active_view:'my_accounts'})}
490
495
  onTransact={(o, account_id) => {
491
496
  setView({ active_view: 'my_accounts' });
@@ -516,6 +521,27 @@ const MyWallet = ({ height, new_balance, account_id, view_mode, insets, header_s
516
521
  wallet_settings={wallet_settings}
517
522
  withdraw_limit={withdraw_limit}
518
523
  deposit_limit={deposit_limit}
524
+ onAccountUpdate={(acct) => {
525
+ setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id).concat(acct) })
526
+ if(selected_account.account_id == acct.account_id){ setSelectedAccount(acct) }
527
+ }}
528
+ account={selected_account}
529
+ onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
530
+ onCancel={() => setView({active_view:'my_accounts'})}
531
+ />
532
+ :active_view == 'instant_withdraw' && selected_account ?
533
+ <WithdrawCard
534
+ player={player}
535
+ instant
536
+ onFocusPosition={onFocusPosition}
537
+ player_balance={player_balance}
538
+ wallet_settings={wallet_settings}
539
+ withdraw_limit={withdraw_limit}
540
+ deposit_limit={deposit_limit}
541
+ onAccountUpdate={(acct) => {
542
+ setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id).concat(acct) })
543
+ if(selected_account.account_id == acct.account_id){ setSelectedAccount(acct) }
544
+ }}
519
545
  account={selected_account}
520
546
  onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
521
547
  onCancel={() => setView({active_view:'my_accounts'})}
@@ -546,6 +572,7 @@ const MyWallet = ({ height, new_balance, account_id, view_mode, insets, header_s
546
572
  :active_view == 'add_ach'?
547
573
  <ManualACHAdd
548
574
  player={player}
575
+ onUpdateAchDetails={(_) => console.log('')}
549
576
  onFocusPosition={onFocusPosition}
550
577
  onAddAccount={(acct) => setWallet({ ...wallet, accounts: accounts.concat(acct) })}
551
578
  onCancel={() => setView({active_view:'my_accounts'})}
package/src/types.d.ts CHANGED
@@ -1303,6 +1303,8 @@ export interface ACHDetailProps {
1303
1303
  account_type: 'checking' | 'savings'
1304
1304
  routing_number?:string,
1305
1305
  account_number?:string,
1306
+ manual_withdraw_allowed?:boolean,
1307
+ instant_allowed?:boolean,
1306
1308
  encryption_iv?:string,
1307
1309
  session_id?:string,
1308
1310
  payment_provider:'nuvei' | 'payliance',
@@ -1492,6 +1494,7 @@ export interface ItemProps {
1492
1494
  color_options?: ColorOptionProps[],
1493
1495
  price_editable?:boolean,
1494
1496
  location_required?:boolean,
1497
+ processing_fee?:number,
1495
1498
  location_restricted?:boolean,
1496
1499
  locations_allowed?:string[],
1497
1500
  shipping_address_required:boolean,