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.
Files changed (250) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +12 -3
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Checkout/api/index.js +254 -0
  4. package/lib/commonjs/Checkout/api/index.js.map +1 -0
  5. package/lib/commonjs/Checkout/components/AccountSummaryCard.js +274 -0
  6. package/lib/commonjs/Checkout/components/AccountSummaryCard.js.map +1 -0
  7. package/lib/commonjs/Checkout/components/ItemSummaryCard.js +56 -0
  8. package/lib/commonjs/Checkout/components/ItemSummaryCard.js.map +1 -0
  9. package/lib/commonjs/Checkout/components/OrderSummaryCard.js +84 -0
  10. package/lib/commonjs/Checkout/components/OrderSummaryCard.js.map +1 -0
  11. package/lib/commonjs/Checkout/index.js +590 -0
  12. package/lib/commonjs/Checkout/index.js.map +1 -0
  13. package/lib/commonjs/Components/Button.js +11 -3
  14. package/lib/commonjs/Components/Button.js.map +1 -1
  15. package/lib/commonjs/Components/Checkbox.js +6 -2
  16. package/lib/commonjs/Components/Checkbox.js.map +1 -1
  17. package/lib/commonjs/Components/Icons.js +441 -4
  18. package/lib/commonjs/Components/Icons.js.map +1 -1
  19. package/lib/commonjs/Components/Spring.js +6 -5
  20. package/lib/commonjs/Components/Spring.js.map +1 -1
  21. package/lib/commonjs/LocationTracker/LocationStatus.js +95 -0
  22. package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -0
  23. package/lib/commonjs/LocationTracker/api/index.js +124 -0
  24. package/lib/commonjs/LocationTracker/api/index.js.map +1 -0
  25. package/lib/commonjs/LocationTracker/index.js +207 -0
  26. package/lib/commonjs/LocationTracker/index.js.map +1 -0
  27. package/lib/commonjs/Observer/Observer.js +2 -0
  28. package/lib/commonjs/Observer/Observer.js.map +1 -1
  29. package/lib/commonjs/Wallet/api/index.js +621 -0
  30. package/lib/commonjs/Wallet/api/index.js.map +1 -0
  31. package/lib/commonjs/Wallet/components/ACHAdd.js +63 -0
  32. package/lib/commonjs/Wallet/components/ACHAdd.js.map +1 -0
  33. package/lib/commonjs/Wallet/components/AccountCard.js +137 -0
  34. package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -0
  35. package/lib/commonjs/Wallet/components/AccountLimitManager.js +321 -0
  36. package/lib/commonjs/Wallet/components/AccountLimitManager.js.map +1 -0
  37. package/lib/commonjs/Wallet/components/AccountManager.js +202 -0
  38. package/lib/commonjs/Wallet/components/AccountManager.js.map +1 -0
  39. package/lib/commonjs/Wallet/components/AccountSnoozeManager.js +263 -0
  40. package/lib/commonjs/Wallet/components/AccountSnoozeManager.js.map +1 -0
  41. package/lib/commonjs/Wallet/components/AddressCard.js +56 -0
  42. package/lib/commonjs/Wallet/components/AddressCard.js.map +1 -0
  43. package/lib/commonjs/Wallet/components/AddressManager.js +365 -0
  44. package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -0
  45. package/lib/commonjs/Wallet/components/DepositCard.js +195 -0
  46. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -0
  47. package/lib/commonjs/Wallet/components/LinkAccountManager.js +167 -0
  48. package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -0
  49. package/lib/commonjs/Wallet/components/ManageAccountCard.js +216 -0
  50. package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -0
  51. package/lib/commonjs/Wallet/components/ManualACHAdd.js +270 -0
  52. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -0
  53. package/lib/commonjs/Wallet/components/ManualCardAdd.js +337 -0
  54. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -0
  55. package/lib/commonjs/Wallet/components/MyBalance.js +73 -0
  56. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -0
  57. package/lib/commonjs/Wallet/components/PayPalOrderCapture.js +68 -0
  58. package/lib/commonjs/Wallet/components/PayPalOrderCapture.js.map +1 -0
  59. package/lib/commonjs/Wallet/components/RemoveAccount.js +108 -0
  60. package/lib/commonjs/Wallet/components/RemoveAccount.js.map +1 -0
  61. package/lib/commonjs/Wallet/components/VerifyACHAccount.js +196 -0
  62. package/lib/commonjs/Wallet/components/VerifyACHAccount.js.map +1 -0
  63. package/lib/commonjs/Wallet/components/WalletSetup.js +316 -0
  64. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -0
  65. package/lib/commonjs/Wallet/components/WithdrawCard.js +336 -0
  66. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -0
  67. package/lib/commonjs/Wallet/index.js +221 -0
  68. package/lib/commonjs/Wallet/index.js.map +1 -0
  69. package/lib/commonjs/constants/colors.js +3 -0
  70. package/lib/commonjs/constants/colors.js.map +1 -1
  71. package/lib/commonjs/index.js +21 -0
  72. package/lib/commonjs/index.js.map +1 -1
  73. package/lib/module/ApiOverrides/index.js +12 -3
  74. package/lib/module/ApiOverrides/index.js.map +1 -1
  75. package/lib/module/Checkout/api/index.js +248 -0
  76. package/lib/module/Checkout/api/index.js.map +1 -0
  77. package/lib/module/Checkout/components/AccountSummaryCard.js +267 -0
  78. package/lib/module/Checkout/components/AccountSummaryCard.js.map +1 -0
  79. package/lib/module/Checkout/components/ItemSummaryCard.js +49 -0
  80. package/lib/module/Checkout/components/ItemSummaryCard.js.map +1 -0
  81. package/lib/module/Checkout/components/OrderSummaryCard.js +77 -0
  82. package/lib/module/Checkout/components/OrderSummaryCard.js.map +1 -0
  83. package/lib/module/Checkout/index.js +581 -0
  84. package/lib/module/Checkout/index.js.map +1 -0
  85. package/lib/module/Components/Button.js +11 -3
  86. package/lib/module/Components/Button.js.map +1 -1
  87. package/lib/module/Components/Checkbox.js +6 -2
  88. package/lib/module/Components/Checkbox.js.map +1 -1
  89. package/lib/module/Components/Icons.js +441 -4
  90. package/lib/module/Components/Icons.js.map +1 -1
  91. package/lib/module/Components/Spring.js +6 -5
  92. package/lib/module/Components/Spring.js.map +1 -1
  93. package/lib/module/LocationTracker/LocationStatus.js +88 -0
  94. package/lib/module/LocationTracker/LocationStatus.js.map +1 -0
  95. package/lib/module/LocationTracker/api/index.js +118 -0
  96. package/lib/module/LocationTracker/api/index.js.map +1 -0
  97. package/lib/module/LocationTracker/index.js +200 -0
  98. package/lib/module/LocationTracker/index.js.map +1 -0
  99. package/lib/module/Observer/Observer.js +2 -0
  100. package/lib/module/Observer/Observer.js.map +1 -1
  101. package/lib/module/Wallet/api/index.js +615 -0
  102. package/lib/module/Wallet/api/index.js.map +1 -0
  103. package/lib/module/Wallet/components/ACHAdd.js +56 -0
  104. package/lib/module/Wallet/components/ACHAdd.js.map +1 -0
  105. package/lib/module/Wallet/components/AccountCard.js +130 -0
  106. package/lib/module/Wallet/components/AccountCard.js.map +1 -0
  107. package/lib/module/Wallet/components/AccountLimitManager.js +312 -0
  108. package/lib/module/Wallet/components/AccountLimitManager.js.map +1 -0
  109. package/lib/module/Wallet/components/AccountManager.js +195 -0
  110. package/lib/module/Wallet/components/AccountManager.js.map +1 -0
  111. package/lib/module/Wallet/components/AccountSnoozeManager.js +254 -0
  112. package/lib/module/Wallet/components/AccountSnoozeManager.js.map +1 -0
  113. package/lib/module/Wallet/components/AddressCard.js +49 -0
  114. package/lib/module/Wallet/components/AddressCard.js.map +1 -0
  115. package/lib/module/Wallet/components/AddressManager.js +356 -0
  116. package/lib/module/Wallet/components/AddressManager.js.map +1 -0
  117. package/lib/module/Wallet/components/DepositCard.js +186 -0
  118. package/lib/module/Wallet/components/DepositCard.js.map +1 -0
  119. package/lib/module/Wallet/components/LinkAccountManager.js +158 -0
  120. package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -0
  121. package/lib/module/Wallet/components/ManageAccountCard.js +207 -0
  122. package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -0
  123. package/lib/module/Wallet/components/ManualACHAdd.js +261 -0
  124. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -0
  125. package/lib/module/Wallet/components/ManualCardAdd.js +328 -0
  126. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -0
  127. package/lib/module/Wallet/components/MyBalance.js +66 -0
  128. package/lib/module/Wallet/components/MyBalance.js.map +1 -0
  129. package/lib/module/Wallet/components/PayPalOrderCapture.js +61 -0
  130. package/lib/module/Wallet/components/PayPalOrderCapture.js.map +1 -0
  131. package/lib/module/Wallet/components/RemoveAccount.js +100 -0
  132. package/lib/module/Wallet/components/RemoveAccount.js.map +1 -0
  133. package/lib/module/Wallet/components/VerifyACHAccount.js +187 -0
  134. package/lib/module/Wallet/components/VerifyACHAccount.js.map +1 -0
  135. package/lib/module/Wallet/components/WalletSetup.js +307 -0
  136. package/lib/module/Wallet/components/WalletSetup.js.map +1 -0
  137. package/lib/module/Wallet/components/WithdrawCard.js +327 -0
  138. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -0
  139. package/lib/module/Wallet/index.js +212 -0
  140. package/lib/module/Wallet/index.js.map +1 -0
  141. package/lib/module/constants/colors.js +3 -0
  142. package/lib/module/constants/colors.js.map +1 -1
  143. package/lib/module/index.js +4 -1
  144. package/lib/module/index.js.map +1 -1
  145. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  146. package/lib/typescript/src/Checkout/api/index.d.ts +49 -0
  147. package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -0
  148. package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts +18 -0
  149. package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts.map +1 -0
  150. package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts +8 -0
  151. package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts.map +1 -0
  152. package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts +8 -0
  153. package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts.map +1 -0
  154. package/lib/typescript/src/Checkout/index.d.ts +12 -0
  155. package/lib/typescript/src/Checkout/index.d.ts.map +1 -0
  156. package/lib/typescript/src/Components/Button.d.ts.map +1 -1
  157. package/lib/typescript/src/Components/Checkbox.d.ts +3 -1
  158. package/lib/typescript/src/Components/Checkbox.d.ts.map +1 -1
  159. package/lib/typescript/src/Components/Icons.d.ts +8 -1
  160. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  161. package/lib/typescript/src/Components/Spring.d.ts.map +1 -1
  162. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts +21 -0
  163. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -0
  164. package/lib/typescript/src/LocationTracker/api/index.d.ts +19 -0
  165. package/lib/typescript/src/LocationTracker/api/index.d.ts.map +1 -0
  166. package/lib/typescript/src/LocationTracker/index.d.ts +22 -0
  167. package/lib/typescript/src/LocationTracker/index.d.ts.map +1 -0
  168. package/lib/typescript/src/Observer/Observer.d.ts.map +1 -1
  169. package/lib/typescript/src/Wallet/api/index.d.ts +94 -0
  170. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -0
  171. package/lib/typescript/src/Wallet/components/ACHAdd.d.ts +13 -0
  172. package/lib/typescript/src/Wallet/components/ACHAdd.d.ts.map +1 -0
  173. package/lib/typescript/src/Wallet/components/AccountCard.d.ts +10 -0
  174. package/lib/typescript/src/Wallet/components/AccountCard.d.ts.map +1 -0
  175. package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts +10 -0
  176. package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts.map +1 -0
  177. package/lib/typescript/src/Wallet/components/AccountManager.d.ts +13 -0
  178. package/lib/typescript/src/Wallet/components/AccountManager.d.ts.map +1 -0
  179. package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts +10 -0
  180. package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts.map +1 -0
  181. package/lib/typescript/src/Wallet/components/AddressCard.d.ts +10 -0
  182. package/lib/typescript/src/Wallet/components/AddressCard.d.ts.map +1 -0
  183. package/lib/typescript/src/Wallet/components/AddressManager.d.ts +23 -0
  184. package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -0
  185. package/lib/typescript/src/Wallet/components/DepositCard.d.ts +14 -0
  186. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -0
  187. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts +10 -0
  188. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -0
  189. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +17 -0
  190. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -0
  191. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +11 -0
  192. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -0
  193. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +11 -0
  194. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -0
  195. package/lib/typescript/src/Wallet/components/MyBalance.d.ts +14 -0
  196. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -0
  197. package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts +16 -0
  198. package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts.map +1 -0
  199. package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts +10 -0
  200. package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts.map +1 -0
  201. package/lib/typescript/src/Wallet/components/VerifyACHAccount.d.ts +10 -0
  202. package/lib/typescript/src/Wallet/components/VerifyACHAccount.d.ts.map +1 -0
  203. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +11 -0
  204. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -0
  205. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +16 -0
  206. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -0
  207. package/lib/typescript/src/Wallet/index.d.ts +10 -0
  208. package/lib/typescript/src/Wallet/index.d.ts.map +1 -0
  209. package/lib/typescript/src/constants/colors.d.ts +3 -0
  210. package/lib/typescript/src/constants/colors.d.ts.map +1 -1
  211. package/lib/typescript/src/index.d.ts +4 -1
  212. package/lib/typescript/src/index.d.ts.map +1 -1
  213. package/package.json +4 -1
  214. package/src/ApiOverrides/index.ts +13 -3
  215. package/src/Checkout/api/index.tsx +199 -0
  216. package/src/Checkout/components/AccountSummaryCard.tsx +169 -0
  217. package/src/Checkout/components/ItemSummaryCard.tsx +34 -0
  218. package/src/Checkout/components/OrderSummaryCard.tsx +40 -0
  219. package/src/Checkout/index.tsx +398 -0
  220. package/src/Components/Button.tsx +5 -4
  221. package/src/Components/Checkbox.tsx +5 -2
  222. package/src/Components/Icons.tsx +196 -3
  223. package/src/Components/Spring.tsx +4 -3
  224. package/src/LocationTracker/LocationStatus.tsx +96 -0
  225. package/src/LocationTracker/api/index.tsx +114 -0
  226. package/src/LocationTracker/index.tsx +130 -0
  227. package/src/Observer/Observer.tsx +2 -1
  228. package/src/Wallet/api/index.ts +461 -0
  229. package/src/Wallet/components/ACHAdd.tsx +49 -0
  230. package/src/Wallet/components/AccountCard.tsx +92 -0
  231. package/src/Wallet/components/AccountLimitManager.tsx +212 -0
  232. package/src/Wallet/components/AccountManager.tsx +103 -0
  233. package/src/Wallet/components/AccountSnoozeManager.tsx +153 -0
  234. package/src/Wallet/components/AddressCard.tsx +31 -0
  235. package/src/Wallet/components/AddressManager.tsx +203 -0
  236. package/src/Wallet/components/DepositCard.tsx +107 -0
  237. package/src/Wallet/components/LinkAccountManager.tsx +119 -0
  238. package/src/Wallet/components/ManageAccountCard.tsx +146 -0
  239. package/src/Wallet/components/ManualACHAdd.tsx +164 -0
  240. package/src/Wallet/components/ManualCardAdd.tsx +185 -0
  241. package/src/Wallet/components/MyBalance.tsx +64 -0
  242. package/src/Wallet/components/PayPalOrderCapture.tsx +59 -0
  243. package/src/Wallet/components/RemoveAccount.tsx +68 -0
  244. package/src/Wallet/components/VerifyACHAccount.tsx +140 -0
  245. package/src/Wallet/components/WalletSetup.tsx +197 -0
  246. package/src/Wallet/components/WithdrawCard.tsx +145 -0
  247. package/src/Wallet/index.tsx +229 -0
  248. package/src/constants/colors.ts +3 -0
  249. package/src/index.tsx +7 -2
  250. package/src/types.d.ts +296 -1
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { MyPlayerProps, PlayerBalanceProps } from '../../ProfileManager/api/types';
3
+ import type { AccountProps } from '../../types';
4
+ type MyBalanceProps = {
5
+ player: MyPlayerProps;
6
+ player_balance: PlayerBalanceProps;
7
+ balance_account?: AccountProps;
8
+ walkthrough?: boolean;
9
+ onClose: () => void;
10
+ onNext: () => void;
11
+ };
12
+ declare const MyBalance: ({ player, balance_account, player_balance, walkthrough, onClose, onNext }: MyBalanceProps) => React.JSX.Element;
13
+ export default MyBalance;
14
+ //# sourceMappingURL=MyBalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MyBalance.d.ts","sourceRoot":"","sources":["../../../../../src/Wallet/components/MyBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,KAAK,cAAc,GAAG;IAClB,MAAM,EAAC,aAAa,CAAC;IACrB,cAAc,EAAC,kBAAkB,CAAC;IAClC,eAAe,CAAC,EAAC,YAAY,CAAC;IAC9B,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,MAAM,EAAC,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,QAAA,MAAM,SAAS,8EAA8E,cAAc,sBA4C1G,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { AccountProps, ItemOrderProps, ItemProps, TransactionProps } from '../../types';
3
+ type PayPalOrderCaptureProps = {
4
+ paypal_account: AccountProps;
5
+ items: ItemProps[];
6
+ region?: string;
7
+ coordinates?: any;
8
+ draft_item_order: ItemOrderProps;
9
+ button_height?: number;
10
+ order_valid?: boolean;
11
+ onOrderUpdate: (item_order: ItemOrderProps, transaction: TransactionProps) => void;
12
+ onCancel: () => void;
13
+ };
14
+ declare const PayPalOrderCapture: ({ draft_item_order, region, coordinates, items, paypal_account, button_height, order_valid, onOrderUpdate, onCancel }: PayPalOrderCaptureProps) => React.JSX.Element;
15
+ export default PayPalOrderCapture;
16
+ //# sourceMappingURL=PayPalOrderCapture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayPalOrderCapture.d.ts","sourceRoot":"","sources":["../../../../../src/Wallet/components/PayPalOrderCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG7F,KAAK,uBAAuB,GAAG;IAC3B,cAAc,EAAC,YAAY,CAAC;IAC5B,KAAK,EAAC,SAAS,EAAE,CAAC;IAClB,MAAM,CAAC,EAAC,MAAM,CAAC;IACf,WAAW,CAAC,EAAC,GAAG,CAAC;IACjB,gBAAgB,EAAC,cAAc,CAAC;IAChC,aAAa,CAAC,EAAC,MAAM,CAAC;IACtB,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,aAAa,EAAC,CAAC,UAAU,EAAC,cAAc,EAAE,WAAW,EAAC,gBAAgB,KAAK,IAAI,CAAC;IAChF,QAAQ,EAAC,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,QAAA,MAAM,kBAAkB,0HAA0H,uBAAuB,sBAsCxK,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { AccountProps } from '../../types';
3
+ type UnlinkAccountCardProps = {
4
+ account: AccountProps;
5
+ onCancel: () => void;
6
+ onRemove: (acct: AccountProps) => void;
7
+ };
8
+ declare const RemoveAccountCard: ({ account, onCancel, onRemove }: UnlinkAccountCardProps) => React.JSX.Element;
9
+ export default RemoveAccountCard;
10
+ //# sourceMappingURL=RemoveAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoveAccount.d.ts","sourceRoot":"","sources":["../../../../../src/Wallet/components/RemoveAccount.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,KAAK,sBAAsB,GAAG;IAC1B,OAAO,EAAC,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAC,YAAY,KAAK,IAAI,CAAA;CACxC,CAAA;AAED,QAAA,MAAM,iBAAiB,oCAAoC,sBAAsB,sBAmDhF,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { AccountProps } from '../../types';
3
+ type VerifyACHWidgetProps = {
4
+ account: AccountProps;
5
+ onUpdateAccount: (account: AccountProps) => void;
6
+ onClose: () => void;
7
+ };
8
+ declare const VerifyACHAccount: ({ account, onClose, onUpdateAccount }: VerifyACHWidgetProps) => React.JSX.Element;
9
+ export default VerifyACHAccount;
10
+ //# sourceMappingURL=VerifyACHAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerifyACHAccount.d.ts","sourceRoot":"","sources":["../../../../../src/Wallet/components/VerifyACHAccount.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,oBAAoB,GAAG;IACxB,OAAO,EAAC,YAAY,CAAC;IACrB,eAAe,EAAC,CAAC,OAAO,EAAC,YAAY,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAA;AAED,QAAA,MAAM,gBAAgB,0CAA0C,oBAAoB,sBA2HnF,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { WalletSettingsProps } from '../../types';
3
+ import type { MyPlayerProps } from '../../ProfileManager/api/types';
4
+ type WalletSetupProps = {
5
+ player: MyPlayerProps;
6
+ wallet_settings: WalletSettingsProps;
7
+ onSettingsUpdate: (ws: WalletSettingsProps) => void;
8
+ };
9
+ declare const WalletSetup: ({ wallet_settings, onSettingsUpdate }: WalletSetupProps) => React.JSX.Element;
10
+ export default WalletSetup;
11
+ //# sourceMappingURL=WalletSetup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletSetup.d.ts","sourceRoot":"","sources":["../../../../../src/Wallet/components/WalletSetup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAIpE,KAAK,gBAAgB,GAAG;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,eAAe,EAAE,mBAAmB,CAAC;IACrC,gBAAgB,EAAC,CAAC,EAAE,EAAC,mBAAmB,KAAK,IAAI,CAAC;CACrD,CAAA;AAED,QAAA,MAAM,WAAW,0CAA0C,gBAAgB,sBAmL1E,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { AccountProps, ItemOrderProps, PlayerDepositLimitProps, PlayerWithdrawLimitProps, WalletSettingsProps } from '../../types';
3
+ import type { MyPlayerProps, PlayerBalanceProps } from '../../ProfileManager/api/types';
4
+ type WithdrawCardProps = {
5
+ player: MyPlayerProps;
6
+ wallet_settings: WalletSettingsProps;
7
+ player_balance: PlayerBalanceProps;
8
+ account: AccountProps;
9
+ deposit_limit: PlayerDepositLimitProps;
10
+ withdraw_limit: PlayerWithdrawLimitProps;
11
+ onTransact: (draft_order: ItemOrderProps) => void;
12
+ onCancel: () => void;
13
+ };
14
+ declare const WithdrawCard: ({ wallet_settings, onTransact, player_balance, account, withdraw_limit, deposit_limit, onCancel }: WithdrawCardProps) => React.JSX.Element;
15
+ export default WithdrawCard;
16
+ //# sourceMappingURL=WithdrawCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawCard.d.ts","sourceRoot":"","sources":["../../../../../src/Wallet/components/WithdrawCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAExI,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAMxF,KAAK,iBAAiB,GAAG;IACrB,MAAM,EAAC,aAAa,CAAC;IACrB,eAAe,EAAC,mBAAmB,CAAC;IACpC,cAAc,EAAC,kBAAkB,CAAC;IAClC,OAAO,EAAC,YAAY,CAAC;IACrB,aAAa,EAAC,uBAAuB,CAAC;IACtC,cAAc,EAAC,wBAAwB,CAAC;IACxC,UAAU,EAAC,CAAC,WAAW,EAAC,cAAc,KAAK,IAAI,CAAC;IAChD,QAAQ,EAAC,MAAM,IAAI,CAAA;CACtB,CAAA;AACD,QAAA,MAAM,YAAY,sGAAsG,iBAAiB,sBA0HxI,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { ItemOrderProps } from '../types';
3
+ type MyWalletProps = {
4
+ account_id?: string;
5
+ onClose: () => void;
6
+ onTransact: (item_order: ItemOrderProps, account_id?: string) => void;
7
+ };
8
+ declare const MyWallet: ({ account_id, onTransact, onClose }: MyWalletProps) => React.JSX.Element;
9
+ export default MyWallet;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Wallet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,OAAO,KAAK,EAAgB,cAAc,EAA8F,MAAM,UAAU,CAAC;AAezJ,KAAK,aAAa,GAAG;IACjB,UAAU,CAAC,EAAC,MAAM,CAAC;IACnB,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,CAAC,UAAU,EAAC,cAAc,EAAE,UAAU,CAAC,EAAC,MAAM,KAAK,IAAI,CAAA;CACtE,CAAA;AAED,QAAA,MAAM,QAAQ,wCAAwC,aAAa,sBAsMlE,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -15,6 +15,9 @@ declare const Colors: {
15
15
  cyan: string;
16
16
  electric: string;
17
17
  };
18
+ company: {
19
+ paypal: string;
20
+ };
18
21
  shades: {
19
22
  white: string;
20
23
  shade100: string;
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/constants/colors.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DT,CAAA;AACD,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/constants/colors.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DT,CAAA;AACD,eAAe,MAAM,CAAA"}
@@ -7,5 +7,8 @@ import LinearGradient from "react-native-linear-gradient";
7
7
  import Colors from "./constants/colors";
8
8
  import Observer, { BEEventApi, BELinkApi } from './Observer';
9
9
  import BettorSearch from "./BettorSearch";
10
- export { Authenticator, Observer, BEEventApi, BELinkApi, ProfileManager, Components, SocialComponents, APIOverrides, LinearGradient, BettorSearch, Colors };
10
+ import MyWallet from "./Wallet";
11
+ import Checkout from "./Checkout";
12
+ import { usePlayerLocation } from "./LocationTracker/LocationStatus";
13
+ export { Authenticator, Observer, BEEventApi, BELinkApi, ProfileManager, Components, SocialComponents, APIOverrides, LinearGradient, usePlayerLocation, BettorSearch, Colors, MyWallet, Checkout };
11
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,EACP,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-components",
3
- "version": "0.4.9",
3
+ "version": "0.5.1",
4
4
  "description": "Components for BettorEdge Apps",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -157,7 +157,9 @@
157
157
  ]
158
158
  },
159
159
  "dependencies": {
160
+ "@paypal/react-paypal-js": "^8.3.0",
160
161
  "@react-native-async-storage/async-storage": "^1.23.1",
162
+ "@react-native-community/geolocation": "^3.2.1",
161
163
  "@react-spring/web": "^9.7.3",
162
164
  "@types/uuid": "^9.0.8",
163
165
  "axios": "^1.6.8",
@@ -165,6 +167,7 @@
165
167
  "react-device-detect": "^2.2.3",
166
168
  "react-native-linear-gradient": "^2.8.3",
167
169
  "react-native-web-linear-gradient": "^1.1.2",
170
+ "us-bank-account-validator": "^1.0.0",
168
171
  "uuid": "^9.0.1"
169
172
  },
170
173
  "directories": {
@@ -11,7 +11,11 @@ const ENVIRONMENT_ENDPOINTS = {
11
11
  VOUCHED_CALLBACK_URL: 'https://1f9b-64-159-204-178.ngrok-free.app/v1/players/vouch/hook',
12
12
  VOUCHED_SANDBOX: true,
13
13
  EVENT_SVC_API: 'http://localhost:3002',
14
- SOCIAL_SVC_API: 'http://localhost:3011'
14
+ SOCIAL_SVC_API: 'http://localhost:3011',
15
+ WALLET_SVC_API: 'http://localhost:3012',
16
+ LOCATION_API: 'AIzaSyAZwcca9MedBHEedDdQmQG3AL9FMUwTvP0',
17
+ PAYPAL_CLIENT_ID: 'AWSlToJzIYpEfvKMPB6vSyi54Sc9LEv6R0axuLUsAiJTo42vhHMpdUkLKv3zeGuayhL-05dKgC09iaS6'
18
+
15
19
  },
16
20
  STAGING: {
17
21
  AUTH_SVC_API: 'https://stage-be-auth-svc.herokuapp.com',
@@ -19,7 +23,10 @@ const ENVIRONMENT_ENDPOINTS = {
19
23
  VOUCHED_CALLBACK_URL: 'https://stage-be-auth-svc.herokuapp.com/v1/players/vouch/hook',
20
24
  VOUCHED_SANDBOX: true,
21
25
  EVENT_SVC_API: 'https://stage-be-sr-svc.herokuapp.com',
22
- SOCIAL_SVC_API: 'https://stage-be-soc-svc.herokuapp.com'
26
+ SOCIAL_SVC_API: 'https://stage-be-soc-svc.herokuapp.com',
27
+ WALLET_SVC_API: 'https://stage-be-pay-svc.herokuapp.com',
28
+ LOCATION_API: 'AIzaSyAZwcca9MedBHEedDdQmQG3AL9FMUwTvP0',
29
+ PAYPAL_CLIENT_ID: 'AWSlToJzIYpEfvKMPB6vSyi54Sc9LEv6R0axuLUsAiJTo42vhHMpdUkLKv3zeGuayhL-05dKgC09iaS6'
23
30
 
24
31
  },
25
32
  PRODUCTION: {
@@ -28,7 +35,10 @@ const ENVIRONMENT_ENDPOINTS = {
28
35
  VOUCHED_CALLBACK_URL: 'https://be-auth-svc.herokuapp.com/v1/players/vouch/hook',
29
36
  VOUCHED_SANDBOX: false,
30
37
  EVENT_SVC_API: 'https://api.events.bettoredge.com',
31
- SOCIAL_SVC_API: 'https://api.social.bettoredge.com'
38
+ SOCIAL_SVC_API: 'https://api.social.bettoredge.com',
39
+ WALLET_SVC_API: 'https://be-pay-svc.herokuapp.com',
40
+ LOCATION_API: 'AIzaSyAZwcca9MedBHEedDdQmQG3AL9FMUwTvP0',
41
+ PAYPAL_CLIENT_ID: 'AUZbVk4xEx5hlDu52ogVyUr4LhPF7eIYWrvxqEh_ebiAlbdg8HUvCZHnNgnW9_gmkI2lx4nX095STlAr'
32
42
  }
33
43
  }
34
44
 
@@ -0,0 +1,199 @@
1
+ import axios from "axios";
2
+ import { APIOverrides } from "../../ApiOverrides";
3
+ import type { AccountProps, ItemOrderProps, ItemProps, LocationProps, PlayerAddressProps, TransactionDetailProps, TransactionProps } from "../../types";
4
+ import type { MyPlayerProps } from "../../ProfileManager/api/types";
5
+ import moment from "moment-mini";
6
+
7
+
8
+ let WALLET_SVC_API = ''
9
+ let AUTH_SVC_API = ''
10
+ let PAYPAL_CLIENT_ID = ''
11
+
12
+ export { CheckoutApi, CheckoutHelpers }
13
+
14
+ const CheckoutApi = {
15
+ setEnvironment: () => {
16
+ const endpoints = APIOverrides.getEndpoints();
17
+ WALLET_SVC_API = endpoints['WALLET_SVC_API'] as string;
18
+ AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
19
+ PAYPAL_CLIENT_ID = endpoints['PAYPAL_CLIENT_ID'] as string;
20
+ },
21
+ getPayPalClientId: () => {
22
+ return PAYPAL_CLIENT_ID
23
+ },
24
+ getMyDetails: async():Promise<MyPlayerProps> => {
25
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/me`)
26
+ return resp.data.player
27
+ },
28
+ getMyAddresses: async():Promise<PlayerAddressProps[]> => {
29
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/addresses/me`)
30
+ return resp.data.player_addresses
31
+ },
32
+ updateAccountDefaultAddress: async(account_id:string, player_address_id?:string):Promise<AccountProps> => {
33
+ const resp = await axios.post(`${WALLET_SVC_API}/v1/accounts/account/address/default`, { account_id, player_address_id })
34
+ return resp.data.account
35
+ },
36
+ getAddressById: async(player_address_id:string):Promise<PlayerAddressProps> => {
37
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/addresses/address/${player_address_id}`)
38
+ return resp.data.player_address
39
+ },
40
+ getMyAccounts: async():Promise<AccountProps[]> => {
41
+ const resp = await axios.get(`${WALLET_SVC_API}/v1/accounts/me`);
42
+ return resp.data.accounts
43
+ },
44
+ getAccountById: async(account_id:string):Promise<AccountProps> => {
45
+ const resp = await axios.get(`${WALLET_SVC_API}/v1/accounts/account/${account_id}`)
46
+ return resp.data.account
47
+ },
48
+ updateDefaultAccount:async(account_id:string):Promise<AccountProps[]> => {
49
+ const resp = await axios.post(`${WALLET_SVC_API}/v1/accounts/account/default`, { account_id })
50
+ return resp.data.accounts
51
+ },
52
+ getItemById: async(item_id:string):Promise<ItemProps> => {
53
+ const resp = await axios.get(`${WALLET_SVC_API}/v1/items/item/${item_id}`)
54
+ return resp.data.item
55
+ },
56
+ getItemsByIds: async(item_ids:string[]):Promise<ItemProps[]> => {
57
+ const resp = await axios.post(`${WALLET_SVC_API}/v1/items/bulk/get`, { item_ids })
58
+ return resp.data.items
59
+ },
60
+ getTransactionById: async(transaction_id:string):Promise<{ transaction:TransactionProps, transaction_details:TransactionDetailProps[] }> => {
61
+ const resp = await axios.get(`${WALLET_SVC_API}/v1/transactions/transaction/${transaction_id}`)
62
+ return resp.data
63
+ },
64
+ cancelTransaction: async(transaction_id?:string, external_id?:string):Promise<{ item_order:ItemOrderProps, transaction:TransactionProps }> => {
65
+ const resp = await axios.post(`${WALLET_SVC_API}/v1/transactions/transaction/cancel`, { transaction_id, external_id })
66
+ return resp.data
67
+ },
68
+ capturePayPalTransaction : async(external_id:string):Promise<{ item_order:ItemOrderProps, transaction:TransactionProps }> => {
69
+ const resp = await axios.post(`${WALLET_SVC_API}/v1/transactions/transaction/paypal/capture`, { external_id })
70
+ return resp.data
71
+ },
72
+ createOrder: async(item_order:ItemOrderProps, transaction:TransactionProps):Promise<{ item_order:ItemOrderProps, transaction:TransactionProps }> => {
73
+ const resp = await axios.post(`${WALLET_SVC_API}/v1/orders/order/create`, { item_order, transaction })
74
+ return { item_order: resp.data.item_order, transaction:resp.data.transaction }
75
+ },
76
+ getMyOrders: async(offset:number):Promise<{item_orders:ItemOrderProps[], items:ItemProps[]}> => {
77
+ const resp = await axios.get(`${WALLET_SVC_API}/v1/orders/me?offset=${offset}`)
78
+ return { item_orders: resp.data.item_orders, items: resp.data.items }
79
+ }
80
+ }
81
+
82
+
83
+ const CheckoutHelpers = {
84
+ filterMyPurchaseAccounts: (accounts:AccountProps[], items:ItemProps[]) => {
85
+ let filtered_accounts = accounts.sort((a,b) => moment(a.create_datetime).unix() - moment(b.create_datetime).unix());
86
+ let wallet_excluded = items.find(i => !i.wallet_allowed) ? true : false
87
+ if(wallet_excluded){
88
+ filtered_accounts = filtered_accounts.filter(a => a.account_type != 'bettoredge');
89
+ }
90
+ let ach_only = items.find(i => i.identifier == 'withdraw') ? true : false
91
+ if(ach_only){ filtered_accounts = filtered_accounts.filter(a => a.account_type=='ach' && !a.ibt_placeholder) }
92
+
93
+ let items_restricting_accounts = items.find(i => i.restricted_account_types)
94
+ if(items_restricting_accounts?.restricted_account_types && items_restricting_accounts.restricted_account_types.includes('card')){
95
+ filtered_accounts = filtered_accounts.filter(a => a.account_type == 'card')
96
+ }
97
+ if(items_restricting_accounts?.restricted_account_types && items_restricting_accounts.restricted_account_types.includes('ach')){
98
+ filtered_accounts = filtered_accounts.filter(a => a.account_type == 'ach')
99
+ }
100
+
101
+ return filtered_accounts.sort((a,b) => {
102
+ if(b.default_account && !a.default_account){ return 2 }
103
+ if(b.ibt_placeholder && !a.ibt_placeholder){ return -5 }
104
+ if(b.account_type == 'ach' && a.account_type != 'ach'){ return 1 }
105
+ if(b.account_type == 'card' && a.account_type != 'card'){ return -1 }
106
+ if(b.account_type == 'paypal' && a.account_type != 'paypal'){ return -2 }
107
+ return 0
108
+ })
109
+ },
110
+ isShippingRequired: (items:ItemProps[]) => {
111
+ return items.find(i => i.shipping_address_required) ? true : false
112
+ },
113
+ isBillingAddressRequired:(items:ItemProps[], account?:AccountProps) => {
114
+ let item_decision = items.find(i => i.billing_address_required) ? true : false
115
+ if(account && account.account_type == 'paypal'){ return false }
116
+ return item_decision
117
+ },
118
+ isLocationRequired: (items:ItemProps[]) => {
119
+ return items.find(i => i.location_required) ? true : false
120
+ },
121
+ isLocationRestrictedToLegalStates : (items:ItemProps[]) => {
122
+ return items.find(i => i.location_restricted) ? true : false
123
+ },
124
+ isCVVValid: (account:AccountProps, cvv?:string):boolean => {
125
+ if(!cvv){ return false }
126
+ if(!account.card_detail){ return false }
127
+ if(account.card_detail.card_brand?.toLowerCase() != 'amex' && cvv.length != 3){ return false }
128
+ if(account.card_detail.card_brand?.toLocaleLowerCase() == 'amex' && cvv.length != 4){ return false }
129
+ return true
130
+ },
131
+ isOrderValid: (draft_order:ItemOrderProps, items:ItemProps[], account?:AccountProps, cvv?:string, billing_address?:PlayerAddressProps, shipping_address?:PlayerAddressProps, player_location?:LocationProps, coords?:any):string[] => {
132
+ let errors:string[] = []
133
+ if(!account){ return ['Please select a pay with account or add a new account to complete order'] }
134
+ const shipping_address_required = CheckoutHelpers.isShippingRequired(items);
135
+ const billing_address_required = CheckoutHelpers.isBillingAddressRequired(items, account);
136
+ if(billing_address_required && !billing_address){ errors.push('Billing address is required') }
137
+ if(shipping_address_required && !shipping_address){ errors.push('Shipping address is required') }
138
+ if(account.account_type == 'card' && !CheckoutHelpers.isCVVValid(account, cvv)){ errors.push('CVV is not valid') }
139
+ let amount = parseFloat(draft_order.amount as string);
140
+ if(isNaN(amount)){ errors.push('Amount is not valid') }
141
+ if(draft_order.items.length == 0){ errors.push('Items are required') }
142
+
143
+ if(CheckoutHelpers.isLocationRequired(items) && !coords?.latitude){ errors.push('Location is required for an item being purchased') }
144
+ if(CheckoutHelpers.isLocationRestrictedToLegalStates(items) && player_location &&!player_location.legal_ind){ errors.push('Your current location is not eligible for this purchase') }
145
+ return errors
146
+ },
147
+ getTransactionFromItemAndAccountId: (item:ItemProps, account_id:string):TransactionProps => {
148
+ const be_client_id = Math.random().toString()//uuid.v4()
149
+ return {
150
+ transaction_id: '',
151
+ transaction_type: item.transaction_type,
152
+ account_id:account_id,
153
+ amount: item.price,
154
+ currency: 'USD',
155
+ description: item.description,
156
+ external_id: '',
157
+ session_id: '',
158
+ be_client_id,
159
+ player_id: '',
160
+ status: 'pending',
161
+ create_datetime: '',
162
+ last_update_datetime:''
163
+ }
164
+ },
165
+ genItemOrder: (draft_order:ItemOrderProps, items:ItemProps[], account:AccountProps):ItemOrderProps => {
166
+ let amount = parseFloat(draft_order.amount as string);
167
+ let fee_1 = 0
168
+ let no_fee = items.find(i => i.no_fees) ? true : false
169
+ if(!no_fee){ fee_1 = Math.round(((account.transaction_fee * amount) + Number.EPSILON) * 100) / 100 }
170
+ let total_amount = amount + fee_1
171
+ return {
172
+ ...draft_order,
173
+ fee_1_amount: fee_1,
174
+
175
+ total_amount
176
+ }
177
+ },
178
+ genTransactionFromItemOrder : (item_order:ItemOrderProps, items:ItemProps[], account_id?:string, cvv?:string):TransactionProps => {
179
+ const be_client_id = Math.random().toString()//uuid.v4()
180
+ let credit_item = items.find(i => i.transaction_type == 'credit') ? true : false
181
+ return {
182
+ transaction_id: '',
183
+ transaction_type: credit_item ? 'credit' : 'debit',
184
+ account_id:account_id??'',
185
+ amount: item_order.total_amount,
186
+ currency: 'USD',
187
+ description: item_order.description,
188
+
189
+ external_id: '',
190
+ cvv,
191
+ session_id: '',
192
+ be_client_id,
193
+ player_id: '',
194
+ status: 'pending',
195
+ create_datetime: '',
196
+ last_update_datetime:''
197
+ }
198
+ }
199
+ }
@@ -0,0 +1,169 @@
1
+ import React from 'react';
2
+ import { View, TouchableOpacity, Image } from "react-native";
3
+ import { Button, Checkbox, Icons, Text, TextInput } from '../../Components';
4
+ import type { AccountProps, ItemProps, PlayerAddressProps } from '../../types';
5
+ import Colors from '../../constants/colors';
6
+ import { CheckoutApi, CheckoutHelpers } from '../api';
7
+ import moment from 'moment-mini';
8
+
9
+ type AccountSummaryCardProps = {
10
+ selected_account?:AccountProps,
11
+ accounts:AccountProps[],
12
+ cvv?:string,
13
+ items:ItemProps[],
14
+ player_address?:PlayerAddressProps,
15
+ billing_address_required?:boolean,
16
+ onRequestNewAccount:() => void,
17
+ onCVVChange:(new_cvv:string) => void,
18
+ onChangeAddress:() => void
19
+ onAccountsUpdate:(accounts:AccountProps[]) => void,
20
+ onSelectAccount:(account:AccountProps) => void
21
+ }
22
+ const AccountSummaryCard = ({ accounts, cvv, items, selected_account, billing_address_required, player_address, onRequestNewAccount, onCVVChange, onAccountsUpdate, onSelectAccount, onChangeAddress }:AccountSummaryCardProps) => {
23
+
24
+ const my_accounts = CheckoutHelpers.filterMyPurchaseAccounts(accounts, items);
25
+
26
+
27
+ const getLabel = (account:AccountProps) => {
28
+ switch(account.account_type){
29
+ case 'ach':
30
+ if(account.ibt_placeholder){
31
+ return (
32
+ <View style={{ flexDirection:'row', alignItems:'center', padding:4 }}>
33
+ <Image
34
+ source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1695821528/1630344814441_wjq98b.png' }}
35
+ style={{ width:50, height:30 }}
36
+ resizeMode='cover'
37
+ />
38
+ </View>
39
+ )
40
+ }
41
+ if(account.ach_detail?.payment_provider == 'nuvei'){
42
+ return (
43
+ <View style={{ flexDirection:'row', alignItems:'center', padding:4 }}>
44
+ <Icons.BankInstantIcon size={22} color={Colors.brand.midnight}/>
45
+ <Text style={{ marginLeft:3 }} size={12} color={Colors.brand.midnight} weight='semibold'>{account.ach_detail?.bank_name}</Text>
46
+ </View>
47
+ )
48
+ }
49
+ return (
50
+ <View style={{ flexDirection:'row', alignItems:'center', padding:4 }}>
51
+ <Icons.BankIcon size={22} color={Colors.brand.midnight}/>
52
+ <Text style={{ marginLeft:3 }} size={12} color={Colors.brand.midnight} weight='semibold'>{account.ach_detail?.bank_name}</Text>
53
+ </View>
54
+ )
55
+ case 'card':
56
+ return renderCardIcon(account.card_detail?.card_brand)
57
+ case 'paypal':
58
+ return (
59
+ <View style={{ flexDirection:'row', alignItems:'center', padding:4, backgroundColor:Colors.company.paypal }}>
60
+ <Icons.PayPalIcon size={50} color={Colors.brand.midnight}/>
61
+ </View>
62
+ )
63
+ default: return <></>
64
+
65
+ }
66
+ }
67
+
68
+ const renderCardIcon = (brand?:string) => {
69
+ switch(brand?.toLowerCase()){
70
+ case 'amex':
71
+ return <Icons.AmexCardIcon size={50} />
72
+ case 'visa':
73
+ return <Icons.VisaCardIcon size={50} />
74
+ case 'mastercard':
75
+ return <Icons.MasterCardIcon size={50} />
76
+ case 'discover':
77
+ return <Icons.DiscoverCardIcon size={50} />
78
+ default:
79
+ return <Icons.CreditCardIcon size={50} color={Colors.brand.midnight}/>
80
+ }
81
+ }
82
+
83
+
84
+ const renderAccounts = (data: { item:AccountProps, index:number }) => {
85
+ const selected = data.item.account_id == selected_account?.account_id ? true : false
86
+ return (
87
+ <TouchableOpacity
88
+ style={{ margin:3, flexDirection:'row', backgroundColor:selected?Colors.highlights.highlight400Faded:'transparent', borderWidth:selected?2:1, borderColor:selected?Colors.brand.electric:Colors.shades.shade600, borderRadius:4 }}
89
+ onPress={() => onSelectAccount(data.item)}>
90
+ {getLabel(data.item)}
91
+ </TouchableOpacity>
92
+ )
93
+ }
94
+
95
+ const handleUpdateDefault = async(account_id:string) => {
96
+ const updated_accounts = await CheckoutApi.updateDefaultAccount(account_id);
97
+ onAccountsUpdate(updated_accounts)
98
+ }
99
+
100
+ return (
101
+ <View style={{ padding:5 }}>
102
+ <View style={{ padding:5, paddingTop:10, paddingBottom:10, flexDirection:'row', alignItems:'center' }}>
103
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='semibold'>Account</Text>
104
+ <Button
105
+ title='Add New Account'
106
+ title_color={Colors.brand.electric}
107
+ backgroundColor='transparent'
108
+ onPress={() => onRequestNewAccount()}
109
+ />
110
+ </View>
111
+ <View nativeID='account_selector' style={{ flexDirection:'row', flexWrap:'wrap' }}>
112
+ {my_accounts.map((a,i) => {
113
+ return renderAccounts({ item: a, index:i })
114
+ })}
115
+ </View>
116
+ {selected_account ?
117
+ <View style={{ padding:10, marginTop:5 }}>
118
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
119
+ <View style={{ flex:1, marginRight:5 }}>
120
+ <Text size={14} weight='bold'>{selected_account.account_label}</Text>
121
+ {selected_account.account_type == 'card' && selected_account.card_detail ?
122
+ <Text style={{ marginTop:3 }} size={12} color={Colors.brand.slate}>EXP: {moment(selected_account.card_detail.expiration_date).format('MM/YYYY')}</Text>
123
+ :<></>}
124
+ </View>
125
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
126
+ <Text style={{ marginRight:5 }} size={14} color={Colors.brand.midnight}>Default</Text>
127
+ <Checkbox
128
+ checked={selected_account.default_account ? true : false}
129
+ onSelect={() => handleUpdateDefault(selected_account.account_id)}
130
+ size={20}
131
+ />
132
+ </View>
133
+ </View>
134
+ {selected_account.account_type == 'card' ?
135
+ <View style={{ flexDirection:'row', alignItems:'center', marginTop:10 }}>
136
+ <Text style={{ flex:1 }} color={Colors.brand.midnight} size={12}>Enter CVV</Text>
137
+ <TextInput
138
+ style={{ textAlign:'center', width:100, padding:10, borderRadius:4 }}
139
+ placeholderTextColor={Colors.brand.slate}
140
+ placeholder='123'
141
+ value={cvv}
142
+ onChangeText={(text) => onCVVChange(text)}
143
+ />
144
+ </View>
145
+ :<></>}
146
+ {billing_address_required ?
147
+ <View style={{ marginTop:15, flexDirection:'row', alignItems:'center' }}>
148
+ {player_address ?
149
+ <View style={{ flex:1 }}>
150
+ <Text size={12} color={Colors.brand.midnight}>{player_address.street}</Text>
151
+ <Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight}>{player_address.city}, {player_address.state} {player_address.zip}</Text>
152
+ </View>
153
+ :<View style={{flex:1}} />}
154
+ <Button
155
+ title={player_address ? 'CHANGE':'ADD BILLING ADDRESS'}
156
+ title_color={Colors.brand.electric}
157
+ padding={5}
158
+ onPress={() => onChangeAddress()}
159
+ />
160
+ </View>
161
+ :<></>}
162
+ </View>
163
+ :<></>}
164
+
165
+ </View>
166
+ )
167
+ }
168
+
169
+ export default AccountSummaryCard
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Image, View } from "react-native";
3
+ import type { ItemProps } from "../../types";
4
+ import { Text } from '../../Components';
5
+ import Colors from '../../constants/colors';
6
+
7
+ type ItemSummaryCardProps = {
8
+ items:ItemProps[]
9
+ }
10
+ const ItemSummaryCard = ({ items }:ItemSummaryCardProps) => {
11
+
12
+ const default_item = items[0]
13
+
14
+ if(!default_item){ return <></> }
15
+ return (
16
+ <View>
17
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
18
+ <View style={{ padding:5, marginRight:10 }}>
19
+ <Image
20
+ source={{ uri: default_item.images.find(i => i.default)?.url }}
21
+ style={{ height:50, width:50 }}
22
+ resizeMode='cover'
23
+ />
24
+ </View>
25
+ <View style={{ flex:1 }}>
26
+ <Text size={16} color={Colors.brand.midnight} weight='bold'>{default_item.name}</Text>
27
+ <Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular'>{default_item.description}</Text>
28
+ </View>
29
+ </View>
30
+ </View>
31
+ )
32
+ }
33
+
34
+ export default ItemSummaryCard