@fantastic.dev/better-stripe 0.7.0 → 0.8.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 (343) hide show
  1. package/CHANGELOG.md +23 -18
  2. package/README.md +122 -90
  3. package/dist/client/billing/checkout.d.ts +1 -1
  4. package/dist/client/billing/checkout.d.ts.map +1 -1
  5. package/dist/client/billing/checkout.js +7 -2
  6. package/dist/client/billing/checkout.js.map +1 -1
  7. package/dist/client/connect/paymentMethods.d.ts.map +1 -1
  8. package/dist/client/connect/paymentMethods.js.map +1 -1
  9. package/dist/client/connect/refundActor.d.ts.map +1 -1
  10. package/dist/client/connect/refundActor.js.map +1 -1
  11. package/dist/client/connect/refunds.d.ts.map +1 -1
  12. package/dist/client/connect/refunds.js.map +1 -1
  13. package/dist/client/connect/transfers.d.ts.map +1 -1
  14. package/dist/client/connect/transfers.js +15 -4
  15. package/dist/client/connect/transfers.js.map +1 -1
  16. package/dist/client/core/accountDefaults.d.ts +6 -0
  17. package/dist/client/core/accountDefaults.d.ts.map +1 -0
  18. package/dist/client/core/accountDefaults.js +15 -0
  19. package/dist/client/core/accountDefaults.js.map +1 -0
  20. package/dist/client/core/accounts.d.ts +1 -5
  21. package/dist/client/core/accounts.d.ts.map +1 -1
  22. package/dist/client/core/accounts.js +2 -14
  23. package/dist/client/core/accounts.js.map +1 -1
  24. package/dist/client/core/fees.d.ts.map +1 -1
  25. package/dist/client/core/fees.js +7 -2
  26. package/dist/client/core/fees.js.map +1 -1
  27. package/dist/client/index.d.ts +1 -1
  28. package/dist/client/index.d.ts.map +1 -1
  29. package/dist/client/products/prices.d.ts.map +1 -1
  30. package/dist/client/products/prices.js.map +1 -1
  31. package/dist/client/products/products.d.ts.map +1 -1
  32. package/dist/client/products/products.js +3 -1
  33. package/dist/client/products/products.js.map +1 -1
  34. package/dist/client/utils/owner.d.ts.map +1 -1
  35. package/dist/client/utils/owner.js +3 -1
  36. package/dist/client/utils/owner.js.map +1 -1
  37. package/dist/client/utils/stripeDashboardUrl.d.ts.map +1 -1
  38. package/dist/client/utils/stripeDashboardUrl.js.map +1 -1
  39. package/dist/client/webhooks/helpers.d.ts +10 -0
  40. package/dist/client/webhooks/helpers.d.ts.map +1 -1
  41. package/dist/client/webhooks/helpers.js +18 -0
  42. package/dist/client/webhooks/helpers.js.map +1 -1
  43. package/dist/client/webhooks/processors.d.ts.map +1 -1
  44. package/dist/client/webhooks/processors.js +1 -19
  45. package/dist/client/webhooks/processors.js.map +1 -1
  46. package/dist/component/connect/mutations.d.ts.map +1 -1
  47. package/dist/component/connect/mutations.js +4 -33
  48. package/dist/component/connect/mutations.js.map +1 -1
  49. package/dist/component/connect/schema.d.ts.map +1 -1
  50. package/dist/component/connect/schema.js.map +1 -1
  51. package/dist/component/lib/paymentSeller.d.ts +3 -0
  52. package/dist/component/lib/paymentSeller.d.ts.map +1 -0
  53. package/dist/component/lib/paymentSeller.js +10 -0
  54. package/dist/component/lib/paymentSeller.js.map +1 -0
  55. package/dist/component/lib/reversals.d.ts +10 -0
  56. package/dist/component/lib/reversals.d.ts.map +1 -1
  57. package/dist/component/lib/reversals.js +17 -0
  58. package/dist/component/lib/reversals.js.map +1 -1
  59. package/dist/react/components/ConnectProvider.d.ts +1 -1
  60. package/dist/react/components/ConnectProvider.d.ts.map +1 -1
  61. package/dist/react/components/ConnectProvider.js +18 -4
  62. package/dist/react/components/ConnectProvider.js.map +1 -1
  63. package/dist/react/components/ConnectStatusBadge.d.ts.map +1 -1
  64. package/dist/react/components/ConnectStatusBadge.js.map +1 -1
  65. package/dist/react/components/EmbeddedDisputes.d.ts +1 -1
  66. package/dist/react/components/EmbeddedDisputes.d.ts.map +1 -1
  67. package/dist/react/components/EmbeddedDisputes.js +1 -1
  68. package/dist/react/components/EmbeddedDisputes.js.map +1 -1
  69. package/dist/react/components/SplitBreakdown.d.ts.map +1 -1
  70. package/dist/react/components/SplitBreakdown.js +12 -2
  71. package/dist/react/components/SplitBreakdown.js.map +1 -1
  72. package/dist/react/hooks/useCheckoutSession.d.ts.map +1 -1
  73. package/dist/react/hooks/useCheckoutSession.js.map +1 -1
  74. package/dist/react/hooks/useConfirmPayment.d.ts.map +1 -1
  75. package/dist/react/hooks/useConfirmPayment.js.map +1 -1
  76. package/dist/react/index.d.ts +1 -0
  77. package/dist/react/index.d.ts.map +1 -1
  78. package/dist/react/index.js +2 -0
  79. package/dist/react/index.js.map +1 -1
  80. package/dist/react/workflows/Account.d.ts +67 -0
  81. package/dist/react/workflows/Account.d.ts.map +1 -0
  82. package/dist/react/workflows/Account.js +74 -0
  83. package/dist/react/workflows/Account.js.map +1 -0
  84. package/dist/react/workflows/Billing.d.ts +60 -0
  85. package/dist/react/workflows/Billing.d.ts.map +1 -0
  86. package/dist/react/workflows/Billing.js +84 -0
  87. package/dist/react/workflows/Billing.js.map +1 -0
  88. package/dist/react/workflows/BillingPlans.d.ts +45 -0
  89. package/dist/react/workflows/BillingPlans.d.ts.map +1 -0
  90. package/dist/react/workflows/BillingPlans.js +51 -0
  91. package/dist/react/workflows/BillingPlans.js.map +1 -0
  92. package/dist/react/workflows/Checkout.d.ts +46 -0
  93. package/dist/react/workflows/Checkout.d.ts.map +1 -0
  94. package/dist/react/workflows/Checkout.js +61 -0
  95. package/dist/react/workflows/Checkout.js.map +1 -0
  96. package/dist/react/workflows/CheckoutChooser.d.ts +20 -0
  97. package/dist/react/workflows/CheckoutChooser.d.ts.map +1 -0
  98. package/dist/react/workflows/CheckoutChooser.js +24 -0
  99. package/dist/react/workflows/CheckoutChooser.js.map +1 -0
  100. package/dist/react/workflows/CheckoutForms.d.ts +26 -0
  101. package/dist/react/workflows/CheckoutForms.d.ts.map +1 -0
  102. package/dist/react/workflows/CheckoutForms.js +126 -0
  103. package/dist/react/workflows/CheckoutForms.js.map +1 -0
  104. package/dist/react/workflows/ClipboardButton.d.ts +17 -0
  105. package/dist/react/workflows/ClipboardButton.d.ts.map +1 -0
  106. package/dist/react/workflows/ClipboardButton.js +35 -0
  107. package/dist/react/workflows/ClipboardButton.js.map +1 -0
  108. package/dist/react/workflows/Collection.d.ts +30 -0
  109. package/dist/react/workflows/Collection.d.ts.map +1 -0
  110. package/dist/react/workflows/Collection.js +25 -0
  111. package/dist/react/workflows/Collection.js.map +1 -0
  112. package/dist/react/workflows/Collections.d.ts +56 -0
  113. package/dist/react/workflows/Collections.d.ts.map +1 -0
  114. package/dist/react/workflows/Collections.js +111 -0
  115. package/dist/react/workflows/Collections.js.map +1 -0
  116. package/dist/react/workflows/Connect.d.ts +19 -0
  117. package/dist/react/workflows/Connect.d.ts.map +1 -0
  118. package/dist/react/workflows/Connect.js +43 -0
  119. package/dist/react/workflows/Connect.js.map +1 -0
  120. package/dist/react/workflows/Costs.d.ts +48 -0
  121. package/dist/react/workflows/Costs.d.ts.map +1 -0
  122. package/dist/react/workflows/Costs.js +66 -0
  123. package/dist/react/workflows/Costs.js.map +1 -0
  124. package/dist/react/workflows/Disputes.d.ts +36 -0
  125. package/dist/react/workflows/Disputes.d.ts.map +1 -0
  126. package/dist/react/workflows/Disputes.js +74 -0
  127. package/dist/react/workflows/Disputes.js.map +1 -0
  128. package/dist/react/workflows/Earnings.d.ts +42 -0
  129. package/dist/react/workflows/Earnings.d.ts.map +1 -0
  130. package/dist/react/workflows/Earnings.js +38 -0
  131. package/dist/react/workflows/Earnings.js.map +1 -0
  132. package/dist/react/workflows/Financials.d.ts +43 -0
  133. package/dist/react/workflows/Financials.d.ts.map +1 -0
  134. package/dist/react/workflows/Financials.js +57 -0
  135. package/dist/react/workflows/Financials.js.map +1 -0
  136. package/dist/react/workflows/IntegrationSwitch.d.ts +23 -0
  137. package/dist/react/workflows/IntegrationSwitch.d.ts.map +1 -0
  138. package/dist/react/workflows/IntegrationSwitch.js +31 -0
  139. package/dist/react/workflows/IntegrationSwitch.js.map +1 -0
  140. package/dist/react/workflows/Onboarding.d.ts +56 -0
  141. package/dist/react/workflows/Onboarding.d.ts.map +1 -0
  142. package/dist/react/workflows/Onboarding.js +86 -0
  143. package/dist/react/workflows/Onboarding.js.map +1 -0
  144. package/dist/react/workflows/Overview.d.ts +51 -0
  145. package/dist/react/workflows/Overview.d.ts.map +1 -0
  146. package/dist/react/workflows/Overview.js +63 -0
  147. package/dist/react/workflows/Overview.js.map +1 -0
  148. package/dist/react/workflows/PaymentMethods.d.ts +35 -0
  149. package/dist/react/workflows/PaymentMethods.d.ts.map +1 -0
  150. package/dist/react/workflows/PaymentMethods.js +63 -0
  151. package/dist/react/workflows/PaymentMethods.js.map +1 -0
  152. package/dist/react/workflows/PaymentReceipt.d.ts +20 -0
  153. package/dist/react/workflows/PaymentReceipt.d.ts.map +1 -0
  154. package/dist/react/workflows/PaymentReceipt.js +24 -0
  155. package/dist/react/workflows/PaymentReceipt.js.map +1 -0
  156. package/dist/react/workflows/Payouts.d.ts +47 -0
  157. package/dist/react/workflows/Payouts.d.ts.map +1 -0
  158. package/dist/react/workflows/Payouts.js +87 -0
  159. package/dist/react/workflows/Payouts.js.map +1 -0
  160. package/dist/react/workflows/Products.d.ts +92 -0
  161. package/dist/react/workflows/Products.d.ts.map +1 -0
  162. package/dist/react/workflows/Products.js +179 -0
  163. package/dist/react/workflows/Products.js.map +1 -0
  164. package/dist/react/workflows/ReferralLinks.d.ts +26 -0
  165. package/dist/react/workflows/ReferralLinks.d.ts.map +1 -0
  166. package/dist/react/workflows/ReferralLinks.js +30 -0
  167. package/dist/react/workflows/ReferralLinks.js.map +1 -0
  168. package/dist/react/workflows/Refunds.d.ts +72 -0
  169. package/dist/react/workflows/Refunds.d.ts.map +1 -0
  170. package/dist/react/workflows/Refunds.js +95 -0
  171. package/dist/react/workflows/Refunds.js.map +1 -0
  172. package/dist/react/workflows/Setup.d.ts +50 -0
  173. package/dist/react/workflows/Setup.d.ts.map +1 -0
  174. package/dist/react/workflows/Setup.js +59 -0
  175. package/dist/react/workflows/Setup.js.map +1 -0
  176. package/dist/react/workflows/Storefront.d.ts +53 -0
  177. package/dist/react/workflows/Storefront.d.ts.map +1 -0
  178. package/dist/react/workflows/Storefront.js +44 -0
  179. package/dist/react/workflows/Storefront.js.map +1 -0
  180. package/dist/react/workflows/SubscriptionOverview.d.ts +13 -0
  181. package/dist/react/workflows/SubscriptionOverview.d.ts.map +1 -0
  182. package/dist/react/workflows/SubscriptionOverview.js +26 -0
  183. package/dist/react/workflows/SubscriptionOverview.js.map +1 -0
  184. package/dist/react/workflows/Subscriptions.d.ts +92 -0
  185. package/dist/react/workflows/Subscriptions.d.ts.map +1 -0
  186. package/dist/react/workflows/Subscriptions.js +149 -0
  187. package/dist/react/workflows/Subscriptions.js.map +1 -0
  188. package/dist/react/workflows/Tasks.d.ts +40 -0
  189. package/dist/react/workflows/Tasks.d.ts.map +1 -0
  190. package/dist/react/workflows/Tasks.js +113 -0
  191. package/dist/react/workflows/Tasks.js.map +1 -0
  192. package/dist/react/workflows/checkout-options.d.ts +37 -0
  193. package/dist/react/workflows/checkout-options.d.ts.map +1 -0
  194. package/dist/react/workflows/checkout-options.js +43 -0
  195. package/dist/react/workflows/checkout-options.js.map +1 -0
  196. package/dist/react/workflows/current-subscription.d.ts +11 -0
  197. package/dist/react/workflows/current-subscription.d.ts.map +1 -0
  198. package/dist/react/workflows/current-subscription.js +14 -0
  199. package/dist/react/workflows/current-subscription.js.map +1 -0
  200. package/dist/react/workflows/filters.d.ts +17 -0
  201. package/dist/react/workflows/filters.d.ts.map +1 -0
  202. package/dist/react/workflows/filters.js +23 -0
  203. package/dist/react/workflows/filters.js.map +1 -0
  204. package/dist/react/workflows/index.d.ts +70 -0
  205. package/dist/react/workflows/index.d.ts.map +1 -0
  206. package/dist/react/workflows/index.js +38 -0
  207. package/dist/react/workflows/index.js.map +1 -0
  208. package/dist/react/workflows/useWorkflowAction.d.ts +11 -0
  209. package/dist/react/workflows/useWorkflowAction.d.ts.map +1 -0
  210. package/dist/react/workflows/useWorkflowAction.js +68 -0
  211. package/dist/react/workflows/useWorkflowAction.js.map +1 -0
  212. package/dist/react/workflows/useWorkflowResource.d.ts +9 -0
  213. package/dist/react/workflows/useWorkflowResource.d.ts.map +1 -0
  214. package/dist/react/workflows/useWorkflowResource.js +67 -0
  215. package/dist/react/workflows/useWorkflowResource.js.map +1 -0
  216. package/docs/react-workflows-audit.md +66 -0
  217. package/docs/react-workflows.md +231 -0
  218. package/package.json +19 -3
  219. package/src/client/billing/checkout-ui-modes.test.ts +49 -0
  220. package/src/client/billing/checkout.ts +8 -3
  221. package/src/client/billing/invoices.test.ts +12 -6
  222. package/src/client/connect/paymentMethods.test.ts +3 -1
  223. package/src/client/connect/paymentMethods.ts +4 -1
  224. package/src/client/connect/refundActor.ts +1 -2
  225. package/src/client/connect/refunds.test.ts +35 -10
  226. package/src/client/connect/refunds.ts +4 -1
  227. package/src/client/connect/transfers.test.ts +66 -12
  228. package/src/client/connect/transfers.ts +32 -8
  229. package/src/client/core/accountDefaults.ts +15 -0
  230. package/src/client/core/accounts.ts +14 -17
  231. package/src/client/core/config.test.ts +2 -1
  232. package/src/client/core/descriptors.test.ts +6 -4
  233. package/src/client/core/fees.test.ts +20 -28
  234. package/src/client/core/fees.ts +9 -2
  235. package/src/client/index.test.ts +22 -22
  236. package/src/client/index.ts +1 -1
  237. package/src/client/products/prices.test.ts +8 -2
  238. package/src/client/products/prices.ts +4 -1
  239. package/src/client/products/products.test.ts +61 -20
  240. package/src/client/products/products.ts +3 -1
  241. package/src/client/utils/data.test.ts +3 -1
  242. package/src/client/utils/owner.test.ts +4 -1
  243. package/src/client/utils/owner.ts +5 -1
  244. package/src/client/utils/stripeDashboardUrl.ts +1 -4
  245. package/src/client/webhooks/handler.test.ts +16 -19
  246. package/src/client/webhooks/helpers.test.ts +26 -13
  247. package/src/client/webhooks/helpers.ts +23 -0
  248. package/src/client/webhooks/hooks.test.ts +1 -2
  249. package/src/client/webhooks/processors.test.ts +18 -34
  250. package/src/client/webhooks/processors.ts +1 -23
  251. package/src/client/webhooks.test.ts +1 -2
  252. package/src/component/_generated/api.ts +2 -0
  253. package/src/component/connect/mutations.ts +5 -46
  254. package/src/component/connect/schema.ts +4 -3
  255. package/src/component/connect.test.ts +1 -5
  256. package/src/component/lib/paymentSeller.ts +15 -0
  257. package/src/component/lib/reversals.ts +30 -2
  258. package/src/component/subscription-scoping.test.ts +5 -1
  259. package/src/component/triggers.test.ts +7 -4
  260. package/src/react/components/BuyerBillingView.render.test.tsx +7 -2
  261. package/src/react/components/ConnectProvider.live.test.tsx +61 -0
  262. package/src/react/components/ConnectProvider.tsx +18 -4
  263. package/src/react/components/ConnectStatusBadge.tsx +1 -4
  264. package/src/react/components/DisputeDetail.render.test.tsx +5 -1
  265. package/src/react/components/EarningsSummary.render.test.tsx +2 -6
  266. package/src/react/components/EmbeddedDisputes.render.test.tsx +7 -5
  267. package/src/react/components/EmbeddedDisputes.tsx +4 -1
  268. package/src/react/components/EvidenceForm.render.test.tsx +2 -8
  269. package/src/react/components/SplitBreakdown.render.test.tsx +28 -5
  270. package/src/react/components/SplitBreakdown.tsx +12 -2
  271. package/src/react/hooks/useCheckoutSession.ts +1 -2
  272. package/src/react/hooks/useConfirmPayment.ts +1 -2
  273. package/src/react/hooks/useEarnings.test.ts +43 -8
  274. package/src/react/hooks/useStripeMode.test.ts +5 -8
  275. package/src/react/index.ts +3 -0
  276. package/src/react/workflows/Account.test.tsx +31 -0
  277. package/src/react/workflows/Account.tsx +183 -0
  278. package/src/react/workflows/Billing.test.tsx +45 -0
  279. package/src/react/workflows/Billing.tsx +213 -0
  280. package/src/react/workflows/BillingPlans.test.tsx +31 -0
  281. package/src/react/workflows/BillingPlans.tsx +130 -0
  282. package/src/react/workflows/Checkout.test.tsx +118 -0
  283. package/src/react/workflows/Checkout.tsx +135 -0
  284. package/src/react/workflows/CheckoutChooser.test.tsx +44 -0
  285. package/src/react/workflows/CheckoutChooser.tsx +77 -0
  286. package/src/react/workflows/CheckoutForm.test.tsx +66 -0
  287. package/src/react/workflows/CheckoutForms.test.tsx +123 -0
  288. package/src/react/workflows/CheckoutForms.tsx +247 -0
  289. package/src/react/workflows/ClipboardButton.test.tsx +34 -0
  290. package/src/react/workflows/ClipboardButton.tsx +67 -0
  291. package/src/react/workflows/Collection.tsx +76 -0
  292. package/src/react/workflows/Collections.test.tsx +86 -0
  293. package/src/react/workflows/Collections.tsx +213 -0
  294. package/src/react/workflows/Connect.test.tsx +50 -0
  295. package/src/react/workflows/Connect.tsx +107 -0
  296. package/src/react/workflows/Costs.test.tsx +41 -0
  297. package/src/react/workflows/Costs.tsx +133 -0
  298. package/src/react/workflows/Disputes.test.tsx +25 -0
  299. package/src/react/workflows/Disputes.tsx +164 -0
  300. package/src/react/workflows/Earnings.test.ts +19 -0
  301. package/src/react/workflows/Earnings.tsx +84 -0
  302. package/src/react/workflows/Financials.test.tsx +35 -0
  303. package/src/react/workflows/Financials.tsx +117 -0
  304. package/src/react/workflows/IntegrationSwitch.test.tsx +36 -0
  305. package/src/react/workflows/IntegrationSwitch.tsx +63 -0
  306. package/src/react/workflows/Onboarding.test.tsx +75 -0
  307. package/src/react/workflows/Onboarding.tsx +171 -0
  308. package/src/react/workflows/Overview.test.tsx +57 -0
  309. package/src/react/workflows/Overview.tsx +123 -0
  310. package/src/react/workflows/PaymentMethods.test.tsx +60 -0
  311. package/src/react/workflows/PaymentMethods.tsx +117 -0
  312. package/src/react/workflows/PaymentReceipt.test.tsx +24 -0
  313. package/src/react/workflows/PaymentReceipt.tsx +46 -0
  314. package/src/react/workflows/Payouts.test.tsx +82 -0
  315. package/src/react/workflows/Payouts.tsx +212 -0
  316. package/src/react/workflows/Products.test.tsx +90 -0
  317. package/src/react/workflows/Products.tsx +377 -0
  318. package/src/react/workflows/ReferralLinks.test.tsx +39 -0
  319. package/src/react/workflows/ReferralLinks.tsx +75 -0
  320. package/src/react/workflows/Refunds.test.tsx +75 -0
  321. package/src/react/workflows/Refunds.tsx +223 -0
  322. package/src/react/workflows/Setup.test.tsx +25 -0
  323. package/src/react/workflows/Setup.tsx +166 -0
  324. package/src/react/workflows/Storefront.test.tsx +82 -0
  325. package/src/react/workflows/Storefront.tsx +138 -0
  326. package/src/react/workflows/SubscriptionOverview.test.tsx +27 -0
  327. package/src/react/workflows/SubscriptionOverview.tsx +48 -0
  328. package/src/react/workflows/Subscriptions.test.tsx +61 -0
  329. package/src/react/workflows/Subscriptions.tsx +282 -0
  330. package/src/react/workflows/Tasks.test.tsx +23 -0
  331. package/src/react/workflows/Tasks.tsx +199 -0
  332. package/src/react/workflows/checkout-options.ts +42 -0
  333. package/src/react/workflows/current-subscription.test.ts +29 -0
  334. package/src/react/workflows/current-subscription.ts +25 -0
  335. package/src/react/workflows/filters.test.ts +12 -0
  336. package/src/react/workflows/filters.ts +22 -0
  337. package/src/react/workflows/index.ts +238 -0
  338. package/src/react/workflows/native-interactions.test.tsx +73 -0
  339. package/src/react/workflows/public-workflows.test.tsx +216 -0
  340. package/src/react/workflows/useWorkflowAction.test.tsx +54 -0
  341. package/src/react/workflows/useWorkflowAction.ts +75 -0
  342. package/src/react/workflows/useWorkflowResource.test.tsx +41 -0
  343. package/src/react/workflows/useWorkflowResource.ts +78 -0
@@ -0,0 +1,56 @@
1
+ import type { CollectionProps, WorkflowColumn } from "./Collection.js";
2
+ export type ResourceCollectionProps<Row> = Omit<CollectionProps<Row>, "columns" | "getKey"> & {
3
+ columns?: WorkflowColumn<Row>[];
4
+ };
5
+ export type SaleRow = {
6
+ _id?: string;
7
+ planId: string;
8
+ paymentIntentId: string;
9
+ chargeId?: string;
10
+ gross: number;
11
+ processingFee: number;
12
+ platformNet: number;
13
+ affiliateNet: number;
14
+ costRecoveryAmount?: number;
15
+ sellerNet: number;
16
+ currency: string;
17
+ status: string;
18
+ };
19
+ export declare function Sales(props: ResourceCollectionProps<SaleRow>): import("react").JSX.Element;
20
+ export type InvoiceRow = {
21
+ stripeInvoiceId: string;
22
+ amountPaid?: number;
23
+ amountDue?: number;
24
+ currency: string;
25
+ status: string;
26
+ hostedInvoiceUrl?: string;
27
+ };
28
+ export declare function Invoices(props: ResourceCollectionProps<InvoiceRow>): import("react").JSX.Element;
29
+ export type RefundRow = {
30
+ /** Unix milliseconds, matching Convex creation timestamps. */
31
+ _creationTime?: number;
32
+ stripeRefundId: string;
33
+ amount: number;
34
+ currency: string;
35
+ status: string;
36
+ reason?: string;
37
+ };
38
+ export declare function RefundHistory(props: ResourceCollectionProps<RefundRow>): import("react").JSX.Element;
39
+ export type ReferredSaleRow = {
40
+ stripeTransferId: string;
41
+ sourceChargeId?: string;
42
+ storeName?: string | null;
43
+ amount: number;
44
+ currency?: string;
45
+ };
46
+ export declare function ReferredSales(props: ResourceCollectionProps<ReferredSaleRow>): import("react").JSX.Element;
47
+ export type WebhookEventRow = {
48
+ stripeEventId: string;
49
+ eventType: string;
50
+ status: string;
51
+ processedAt?: number;
52
+ lastError?: string;
53
+ livemode?: boolean;
54
+ };
55
+ export declare function WebhookEvents<Row extends WebhookEventRow>(props: ResourceCollectionProps<Row>): import("react").JSX.Element;
56
+ //# sourceMappingURL=Collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Collections.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGvE,MAAM,MAAM,uBAAuB,CAAC,GAAG,IAAI,IAAI,CAC7C,eAAe,CAAC,GAAG,CAAC,EACpB,SAAS,GAAG,QAAQ,CACrB,GAAG;IAAE,OAAO,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;CAAE,CAAC;AACxC,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,M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AAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,wBAAgB,aAAa,CAAC,GAAG,SAAS,eAAe,EACvD,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC,+BA6BpC"}
@@ -0,0 +1,111 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Collection } from "./Collection.js";
4
+ import { formatPrice } from "../lib/price-helpers.js";
5
+ export function Sales(props) {
6
+ const columns = [
7
+ { id: "planId", label: "Plan", cell: (row) => row.planId },
8
+ ...[
9
+ ["gross", "Sale"],
10
+ ["processingFee", "Stripe processing"],
11
+ ["platformNet", "Platform"],
12
+ ["affiliateNet", "Affiliate"],
13
+ ["costRecoveryAmount", "Cost recovery"],
14
+ ["sellerNet", "Your earnings"],
15
+ ].map(([field, label]) => ({
16
+ id: field,
17
+ label,
18
+ align: "end",
19
+ cell: (row) => formatPrice(row[field] ?? 0, row.currency),
20
+ })),
21
+ { id: "status", label: "Status", cell: (row) => row.status },
22
+ { id: "payment", label: "Payment", cell: (row) => row.paymentIntentId },
23
+ ];
24
+ return (_jsx(Collection, { emptyLabel: "No sales yet.", ...props, getKey: (row) => row._id ?? row.paymentIntentId, columns: props.columns ?? columns }));
25
+ }
26
+ export function Invoices(props) {
27
+ const columns = [
28
+ { id: "id", label: "Invoice ID", cell: (row) => row.stripeInvoiceId },
29
+ {
30
+ id: "amount",
31
+ label: "Amount",
32
+ align: "end",
33
+ cell: (row) => formatPrice(row.amountPaid ?? row.amountDue ?? 0, row.currency),
34
+ },
35
+ { id: "status", label: "Status", cell: (row) => row.status },
36
+ {
37
+ id: "invoice",
38
+ label: "Invoice",
39
+ cell: (row) => row.hostedInvoiceUrl ? (_jsx("a", { href: row.hostedInvoiceUrl, target: "_blank", rel: "noopener noreferrer", children: "View invoice" })) : ("Unavailable"),
40
+ },
41
+ ];
42
+ return (_jsx(Collection, { emptyLabel: "No invoices yet.", ...props, getKey: (row) => row.stripeInvoiceId, columns: props.columns ?? columns }));
43
+ }
44
+ export function RefundHistory(props) {
45
+ const columns = [
46
+ { id: "id", label: "Refund ID", cell: (row) => row.stripeRefundId },
47
+ {
48
+ id: "amount",
49
+ label: "Amount",
50
+ align: "end",
51
+ cell: (row) => formatPrice(row.amount, row.currency),
52
+ },
53
+ { id: "status", label: "Status", cell: (row) => row.status },
54
+ {
55
+ id: "reason",
56
+ label: "Reason",
57
+ cell: (row) => row.reason ?? "Not supplied",
58
+ },
59
+ {
60
+ id: "created",
61
+ label: "Created",
62
+ cell: (row) => row._creationTime === undefined
63
+ ? "Not supplied"
64
+ : new Date(row._creationTime).toLocaleString(),
65
+ },
66
+ ];
67
+ return (_jsx(Collection, { emptyLabel: "No refunds yet.", ...props, getKey: (row) => row.stripeRefundId, columns: props.columns ?? columns }));
68
+ }
69
+ export function ReferredSales(props) {
70
+ const columns = [
71
+ {
72
+ id: "store",
73
+ label: "Store",
74
+ cell: (row) => row.storeName ?? "Store unavailable",
75
+ },
76
+ {
77
+ id: "payment",
78
+ label: "Payment",
79
+ cell: (row) => row.sourceChargeId ?? row.stripeTransferId,
80
+ },
81
+ {
82
+ id: "commission",
83
+ label: "Commission",
84
+ align: "end",
85
+ cell: (row) => formatPrice(row.amount, row.currency ?? "usd"),
86
+ },
87
+ ];
88
+ return (_jsx(Collection, { emptyLabel: "No referred sales yet.", ...props, getKey: (row) => row.stripeTransferId, columns: props.columns ?? columns }));
89
+ }
90
+ export function WebhookEvents(props) {
91
+ const columns = [
92
+ { id: "type", label: "Type", cell: (row) => row.eventType },
93
+ { id: "status", label: "Status", cell: (row) => row.status },
94
+ { id: "id", label: "Event ID", cell: (row) => row.stripeEventId },
95
+ { id: "error", label: "Error", cell: (row) => row.lastError ?? "None" },
96
+ {
97
+ id: "processed",
98
+ label: "Processed",
99
+ cell: (row) => row.processedAt === undefined
100
+ ? "Not supplied"
101
+ : new Date(row.processedAt).toLocaleString(),
102
+ },
103
+ {
104
+ id: "mode",
105
+ label: "Mode",
106
+ cell: (row) => (row.livemode ? "Live" : "Test"),
107
+ },
108
+ ];
109
+ return (_jsx(Collection, { emptyLabel: "No webhook events yet.", ...props, getKey: (row) => row.stripeEventId, columns: props.columns ?? columns }));
110
+ }
111
+ //# sourceMappingURL=Collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collections.js","sourceRoot":"","sources":["../../../src/react/workflows/Collections.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAmBtD,MAAM,UAAU,KAAK,CAAC,KAAuC;IAC3D,MAAM,OAAO,GAA8B;QACzC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;QAC1D,GACE;YACE,CAAC,OAAO,EAAE,MAAM,CAAC;YACjB,CAAC,eAAe,EAAE,mBAAmB,CAAC;YACtC,CAAC,aAAa,EAAE,UAAU,CAAC;YAC3B,CAAC,cAAc,EAAE,WAAW,CAAC;YAC7B,CAAC,oBAAoB,EAAE,eAAe,CAAC;YACvC,CAAC,WAAW,EAAE,eAAe,CAAC;SAEjC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YACzB,EAAE,EAAE,KAAK;YACT,KAAK;YACL,KAAK,EAAE,KAAc;YACrB,IAAI,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,QAAQ,CA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AE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;QAC5D,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,EAAE;QACjE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,IAAI,MAAM,EAAE;QACvE;YACE,EAAE,EAAE,WAAW;YACf,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACZ,GAAG,CAAC,WAAW,KAAK,SAAS;gBAC3B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,cAAc,EAAE;SACjD;QACD;YACE,EAAE,EAAE,MAAM;YACV,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;SAChD;KACF,CAAC;IACF,OAAO,CACL,KAAC,UAAU,IACT,UAAU,EAAC,wBAAwB,KAC/B,KAAK,EACT,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,EAClC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,OAAO,GACjC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ import { type ConnectProviderProps } from "../components/ConnectProvider.js";
3
+ export type ConnectComponent = "account" | "onboarding" | "payments" | "refunds" | "disputes" | "balances" | "payouts" | "notifications";
4
+ export type ConnectRenderProps = {
5
+ content: ReactNode;
6
+ error: string | null;
7
+ retry: () => void;
8
+ completed: boolean;
9
+ };
10
+ export type ConnectProps = Omit<ConnectProviderProps, "children"> & {
11
+ component: ConnectComponent;
12
+ /** Remounts the Stripe instance when the authenticated account changes. The server must authorize it independently. */
13
+ scopeKey: string;
14
+ onExit?: () => void;
15
+ children?: (state: ConnectRenderProps) => ReactNode;
16
+ };
17
+ /** Unstyled, account-scoped Connect component with session refresh, error recovery, appearance, and locale. */
18
+ export declare function Connect(props: ConnectProps): import("react").JSX.Element;
19
+ //# sourceMappingURL=Connect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Connect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAUjD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,YAAY,GACZ,UAAU,GACV,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,eAAe,CAAC;AACpB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAAG;IAClE,SAAS,EAAE,gBAAgB,CAAC;IAC5B,uHAAuH;IACvH,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC;CACrD,CAAC;AAWF,+GAA+G;AAC/G,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAI1C"}
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { ConnectAccountManagement, ConnectAccountOnboarding, ConnectBalances, ConnectDisputesList, ConnectNotificationBanner, ConnectPayments, ConnectPayouts, } from "@stripe/react-connect-js";
5
+ import { ConnectProvider, } from "../components/ConnectProvider.js";
6
+ const widgets = {
7
+ account: ConnectAccountManagement,
8
+ onboarding: ConnectAccountOnboarding,
9
+ payments: ConnectPayments,
10
+ refunds: ConnectPayments,
11
+ disputes: ConnectDisputesList,
12
+ balances: ConnectBalances,
13
+ payouts: ConnectPayouts,
14
+ notifications: ConnectNotificationBanner,
15
+ };
16
+ /** Unstyled, account-scoped Connect component with session refresh, error recovery, appearance, and locale. */
17
+ export function Connect(props) {
18
+ return (_jsx(ConnectBody, { ...props }, `${props.scopeKey}:${props.component}`));
19
+ }
20
+ function ConnectBody({ component, publishableKey, fetchClientSecret, appearance, locale, onExit, children, }) {
21
+ const [attempt, setAttempt] = useState(0);
22
+ const [error, setError] = useState(null);
23
+ const [completed, setCompleted] = useState(false);
24
+ const Widget = widgets[component];
25
+ const retry = () => {
26
+ setError(null);
27
+ setAttempt((value) => value + 1);
28
+ };
29
+ const content = error ? (_jsxs("div", { role: "alert", children: [_jsx("p", { children: error }), _jsx("button", { type: "button", onClick: retry, children: "Retry" })] })) : (_jsx(ConnectProvider, { publishableKey: publishableKey, appearance: appearance, locale: locale, fetchClientSecret: async () => {
30
+ try {
31
+ return await fetchClientSecret();
32
+ }
33
+ catch (error) {
34
+ setError(error instanceof Error ? error.message : String(error));
35
+ throw error;
36
+ }
37
+ }, children: _jsx(Widget, { onLoadError: ({ error }) => setError(error.message ?? "Stripe could not load this component."), onExit: () => {
38
+ setCompleted(true);
39
+ onExit?.();
40
+ } }) }, attempt));
41
+ return (_jsx(_Fragment, { children: children ? children({ content, error, retry, completed }) : content }));
42
+ }
43
+ //# sourceMappingURL=Connect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Connect.js","sourceRoot":"","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EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CACtB,eAAK,IAAI,EAAC,OAAO,aACf,sBAAI,KAAK,GAAK,EACd,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,KAAK,sBAE3B,IACL,CACP,CAAC,CAAC,CAAC,CACF,KAAC,eAAe,IAEd,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,KAAK,IAAI,EAAE;YAC5B,IAAI,CAAC;gBACH,OAAO,MAAM,iBAAiB,EAAE,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,QAAQ,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBACjE,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC,YAED,KAAC,MAAM,IACL,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CACzB,QAAQ,CAAC,KAAK,CAAC,OAAO,IAAI,uCAAuC,CAAC,EAEpE,MAAM,EAAE,GAAG,EAAE;gBACX,YAAY,CAAC,IAAI,CAAC,CAAC;gBACnB,MAAM,EAAE,EAAE,CAAC;YACb,CAAC,GACD,IArBG,OAAO,CAsBI,CACnB,CAAC;IACF,OAAO,CACL,4BAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,GAAI,CAC3E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { ReactNode } from "react";
2
+ import { type WorkflowColumn } from "./Collection.js";
3
+ import type { ResourceCollectionProps } from "./Collections.js";
4
+ export type CostRecoveryRow = {
5
+ _id?: string;
6
+ id?: string;
7
+ paymentIntentId: string;
8
+ amountDue: number;
9
+ collectedAmount: number;
10
+ invoicedAmount: number;
11
+ outstanding: number;
12
+ currency: string;
13
+ };
14
+ export declare function CostRecovery(props: ResourceCollectionProps<CostRecoveryRow>): import("react").JSX.Element;
15
+ export type ChargebackTransfer = {
16
+ stripeTransferId: string;
17
+ destinationAccountId: string;
18
+ amount: number;
19
+ currency: string;
20
+ role?: string;
21
+ reversedAmount?: number;
22
+ reversalStatus?: string;
23
+ };
24
+ export type ChargebackSummary = {
25
+ dispute: {
26
+ stripeChargeId?: string;
27
+ currency: string;
28
+ status: string;
29
+ };
30
+ transfers: ChargebackTransfer[];
31
+ gross: number;
32
+ reversed: number;
33
+ net: number;
34
+ };
35
+ export type ChargebackLedgerRenderProps = {
36
+ data: ChargebackSummary | null | undefined;
37
+ isLoading: boolean;
38
+ isEmpty: boolean;
39
+ grossLabel: string;
40
+ reversedLabel: string;
41
+ netLabel: string;
42
+ columns: WorkflowColumn<ChargebackTransfer>[];
43
+ };
44
+ export declare function ChargebackLedger({ chargeback, children, }: {
45
+ chargeback: ChargebackSummary | null | undefined;
46
+ children?: (state: ChargebackLedgerRenderProps) => ReactNode;
47
+ }): import("react").JSX.Element;
48
+ //# sourceMappingURL=Costs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Costs.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Costs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,M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AAQ,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,SAAS,CAAC;CAC9D,+BA2DA"}
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Collection } from "./Collection.js";
4
+ import { formatPrice } from "../lib/price-helpers.js";
5
+ export function CostRecovery(props) {
6
+ const columns = [
7
+ { id: "payment", label: "Payment", cell: (row) => row.paymentIntentId },
8
+ ...[
9
+ ["amountDue", "Total cost"],
10
+ ["collectedAmount", "Deducted from earnings"],
11
+ ["invoicedAmount", "Added to invoice"],
12
+ ["outstanding", "Outstanding"],
13
+ ].map(([field, label]) => ({
14
+ id: field,
15
+ label,
16
+ align: "end",
17
+ cell: (row) => formatPrice(row[field], row.currency),
18
+ })),
19
+ ];
20
+ return (_jsx(Collection, { emptyLabel: "No costs yet.", loadingLabel: "Loading costs\u2026", ...props, columns: props.columns ?? columns, getKey: (row) => row._id ?? row.id ?? row.paymentIntentId }));
21
+ }
22
+ export function ChargebackLedger({ chargeback, children, }) {
23
+ const currency = chargeback?.dispute.currency ?? "usd";
24
+ const columns = [
25
+ { id: "transfer", label: "Transfer", cell: (row) => row.stripeTransferId },
26
+ {
27
+ id: "account",
28
+ label: "Recipient",
29
+ cell: (row) => row.destinationAccountId,
30
+ },
31
+ {
32
+ id: "amount",
33
+ label: "Amount",
34
+ align: "end",
35
+ cell: (row) => formatPrice(row.amount, row.currency),
36
+ },
37
+ {
38
+ id: "reversed",
39
+ label: "Reversed",
40
+ align: "end",
41
+ cell: (row) => formatPrice(row.reversedAmount ?? 0, row.currency),
42
+ },
43
+ {
44
+ id: "status",
45
+ label: "Status",
46
+ cell: (row) => row.reversalStatus ?? "Not reversed",
47
+ },
48
+ ];
49
+ const state = {
50
+ data: chargeback,
51
+ isLoading: chargeback === undefined,
52
+ isEmpty: chargeback === null || !chargeback?.dispute.stripeChargeId,
53
+ grossLabel: formatPrice(chargeback?.gross ?? 0, currency),
54
+ reversedLabel: formatPrice(-(chargeback?.reversed ?? 0), currency),
55
+ netLabel: formatPrice(chargeback?.net ?? 0, currency),
56
+ columns,
57
+ };
58
+ if (children)
59
+ return _jsx(_Fragment, { children: children(state) });
60
+ if (state.isLoading)
61
+ return _jsx("p", { role: "status", children: "Loading chargeback transfers\u2026" });
62
+ if (state.isEmpty)
63
+ return _jsx("p", { children: "No linked charge is available yet." });
64
+ return (_jsxs("section", { "data-better-stripe": "chargeback-ledger", children: [_jsx("h3", { children: "Chargeback transfers" }), _jsxs("dl", { children: [_jsx("dt", { children: "Original transfers" }), _jsx("dd", { children: state.grossLabel }), _jsx("dt", { children: "Funds pulled back" }), _jsx("dd", { children: state.reversedLabel }), _jsx("dt", { children: "Recipient net" }), _jsx("dd", { children: state.netLabel })] }), _jsx(Collection, { rows: chargeback.transfers, columns: columns, getKey: (row) => row.stripeTransferId, emptyLabel: "No transfer rows found." })] }));
65
+ }
66
+ //# sourceMappingURL=Costs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Costs.js","sourceRoot":"","sources":["../../../src/react/workflows/Costs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAuB,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAWtD,MAAM,UAAU,YAAY,CAAC,KAA+C;IAC1E,MAAM,OAAO,GAAsC;QACjD,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,EAAE;QACvE,GACE;YACE,CAAC,WAAW,EAAE,YAAY,CAAC;YAC3B,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;YAC7C,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;YACtC,CAAC,aAAa,EAAE,aAAa,CAAC;SAEjC,CAAC,GAAG,CAAC,CAAC,CAAC,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AM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,gBAAgB,EACrC,UAAU,EAAC,yBAAyB,GACpC,IACM,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { type ReactNode } from "react";
2
+ import { type DisputesListRow } from "../components/DisputesList.js";
3
+ import { type EvidenceFormUpdateArgs } from "../components/EvidenceForm.js";
4
+ import type { DisputeWithCountdown } from "../hooks/useDisputeWithCountdown.js";
5
+ import { type ConnectProps } from "./Connect.js";
6
+ export type DisputeResponseOptions = {
7
+ scopeKey: string;
8
+ acceptDispute?: (stripeDisputeId: string) => Promise<unknown>;
9
+ onSelectionChange?: (id: string | undefined) => void;
10
+ };
11
+ export declare function useDisputeResponse(props: DisputeResponseOptions): {
12
+ selectedId: string | undefined;
13
+ setSelectedId: (selectedId: string | undefined) => void;
14
+ acceptStatus: "accepted" | "confirming" | "error" | "idle" | "submitting";
15
+ acceptError: string | null;
16
+ isPending: boolean;
17
+ requestAccept: () => void;
18
+ cancelAccept: () => void;
19
+ accept: () => Promise<boolean | undefined>;
20
+ };
21
+ export type DisputesRenderProps = ReturnType<typeof useDisputeResponse> & {
22
+ disputes: DisputesListRow[] | undefined;
23
+ detail: DisputeWithCountdown | null | undefined;
24
+ };
25
+ export type HeadlessDisputesProps = DisputeResponseOptions & {
26
+ presentation?: "headless";
27
+ disputes: DisputesListRow[] | undefined;
28
+ detail?: DisputeWithCountdown | null;
29
+ onUpdateEvidence: (args: EvidenceFormUpdateArgs) => Promise<unknown>;
30
+ children?: (state: DisputesRenderProps) => ReactNode;
31
+ };
32
+ export type DisputesProps = HeadlessDisputesProps | (Omit<ConnectProps, "component"> & {
33
+ presentation: "embedded";
34
+ });
35
+ export declare function Disputes(props: DisputesProps): import("react").JSX.Element;
36
+ //# sourceMappingURL=Disputes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Disputes.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Disputes.tsx"],"names":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AAC;CACtD,CAAC;AACF,MAAM,MAAM,aAAa,GACrB,qBAAqB,GACrB,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG;IAAE,YAAY,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AACrE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAM5C"}
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { DisputesList, } from "../components/DisputesList.js";
5
+ import { DisputeDetail } from "../components/DisputeDetail.js";
6
+ import { EvidenceForm, } from "../components/EvidenceForm.js";
7
+ import { useWorkflowAction } from "./useWorkflowAction.js";
8
+ import { Connect } from "./Connect.js";
9
+ export function useDisputeResponse(props) {
10
+ const initial = {
11
+ scope: props.scopeKey,
12
+ selectedId: undefined,
13
+ confirming: false,
14
+ };
15
+ const [state, setState] = useState(initial);
16
+ if (state.scope !== props.scopeKey)
17
+ setState(initial);
18
+ const action = useWorkflowAction(async () => {
19
+ if (!state.selectedId || !state.confirming)
20
+ throw new Error("Confirm accepting this dispute first.");
21
+ if (!props.acceptDispute)
22
+ throw new Error("Dispute acceptance is not configured.");
23
+ await props.acceptDispute(state.selectedId);
24
+ return true;
25
+ }, `${props.scopeKey}:${state.selectedId ?? ""}`);
26
+ return {
27
+ selectedId: state.selectedId,
28
+ setSelectedId: (selectedId) => {
29
+ setState((previous) => ({ ...previous, selectedId, confirming: false }));
30
+ props.onSelectionChange?.(selectedId);
31
+ action.reset();
32
+ },
33
+ acceptStatus: action.isPending
34
+ ? "submitting"
35
+ : action.result
36
+ ? "accepted"
37
+ : action.error
38
+ ? "error"
39
+ : state.confirming
40
+ ? "confirming"
41
+ : "idle",
42
+ acceptError: action.error,
43
+ isPending: action.isPending,
44
+ requestAccept: () => {
45
+ action.reset();
46
+ setState((previous) => ({ ...previous, confirming: true }));
47
+ },
48
+ cancelAccept: () => {
49
+ action.reset();
50
+ setState((previous) => ({ ...previous, confirming: false }));
51
+ },
52
+ accept: action.run,
53
+ };
54
+ }
55
+ export function Disputes(props) {
56
+ return props.presentation === "embedded" ? (_jsx(Connect, { ...props, component: "disputes" })) : (_jsx(DisputesBody, { ...props }, props.scopeKey));
57
+ }
58
+ function DisputesBody(props) {
59
+ const state = useDisputeResponse(props);
60
+ const detail = props.detail?.stripeDisputeId === state.selectedId
61
+ ? props.detail
62
+ : undefined;
63
+ if (props.children)
64
+ return (_jsx(_Fragment, { children: props.children({ ...state, disputes: props.disputes, detail }) }));
65
+ return (_jsxs("section", { "data-better-stripe": "disputes", children: [_jsx("h2", { children: "Disputes" }), _jsx(DisputesList, { disputes: props.disputes, isLoading: props.disputes === undefined, renderRow: (row) => (_jsxs("button", { type: "button", "aria-pressed": state.selectedId === row.dispute.stripeDisputeId, onClick: () => state.setSelectedId(row.dispute.stripeDisputeId), children: [row.dispute.stripeDisputeId, " \u00B7 ", row.dispute.status, " ", row.badgeText] }, row.dispute.stripeDisputeId)) }), !state.selectedId ? (_jsx("p", { children: "Select a dispute to respond." })) : (_jsxs(_Fragment, { children: [_jsx(DisputeDetail, { dispute: detail, isLoading: !detail }), props.acceptDispute &&
66
+ (state.acceptStatus === "confirming" ? (_jsxs("div", { children: [_jsx("p", { children: "Accepting permanently closes this dispute. This cannot be undone." }), _jsx("button", { type: "button", disabled: state.isPending, onClick: () => {
67
+ void state.accept();
68
+ }, children: "Yes, accept dispute" }), _jsx("button", { type: "button", onClick: state.cancelAccept, children: "Cancel" })] })) : (_jsx("button", { type: "button", disabled: state.isPending || state.acceptStatus === "accepted", onClick: state.requestAccept, children: state.isPending
69
+ ? "Accepting…"
70
+ : state.acceptStatus === "accepted"
71
+ ? "Dispute accepted"
72
+ : "Accept dispute" }))), state.acceptError && _jsx("p", { role: "alert", children: state.acceptError }), _jsx(EvidenceForm, { stripeDisputeId: state.selectedId, onUpdateDispute: props.onUpdateEvidence }, state.selectedId)] }))] }));
73
+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BACE,KAAC,aAAa,IAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,GAAI,EACrD,KAAK,CAAC,aAAa;wBAClB,CAAC,KAAK,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC,CAAC,CACrC,0BACE,4FAGI,EACJ,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,OAAO,EAAE,GAAG,EAAE;wCACZ,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;oCACtB,CAAC,oCAGM,EACT,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,KAAK,CAAC,YAAY,uBAExC,IACL,CACP,CAAC,CAAC,CAAC,CACF,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,KAAK,UAAU,EAC9D,OAAO,EAAE,KAAK,CAAC,aAAa,YAE3B,KAAK,CAAC,SAAS;gCACd,CAAC,CAAC,YAAY;gCACd,CAAC,CAAC,KAAK,CAAC,YAAY,KAAK,UAAU;oCACjC,CAAC,CAAC,kBAAkB;oCACpB,CAAC,CAAC,gBAAgB,GACf,CACV,CAAC,EACH,KAAK,CAAC,WAAW,IAAI,YAAG,IAAI,EAAC,OAAO,YAAE,KAAK,CAAC,WAAW,GAAK,EAC7D,KAAC,YAAY,IAEX,eAAe,EAAE,KAAK,CAAC,UAAU,EACjC,eAAe,EAAE,KAAK,CAAC,gBAAgB,IAFlC,KAAK,CAAC,UAAU,CAGrB,IACD,CACJ,IACO,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from "react";
2
+ import { type EarningsSummaryProps } from "../components/EarningsSummary.js";
3
+ import { type ConnectProps } from "./Connect.js";
4
+ export type BalanceSnapshot = {
5
+ available: number;
6
+ pending: number;
7
+ currency: string;
8
+ };
9
+ export type StoreEarnings = {
10
+ gross: number;
11
+ reversed: number;
12
+ net: number;
13
+ paidOut: number;
14
+ currency: string;
15
+ };
16
+ /** Recipient funds held plus already paid out, not gross charge revenue. Destination-charge balance display only. */
17
+ export declare function earningsFromBalance(balance: BalanceSnapshot | null, payouts: {
18
+ amount: number;
19
+ status: string;
20
+ currency: string;
21
+ }[]): StoreEarnings;
22
+ export type EarningsMetric = {
23
+ key: "gross" | "reversed" | "net" | "paidOut";
24
+ label: string;
25
+ amount: number;
26
+ formattedValue: string;
27
+ };
28
+ export type EarningsRenderProps = {
29
+ metrics: EarningsMetric[];
30
+ isLoading: boolean;
31
+ currency: string;
32
+ payouts: EarningsSummaryProps["payouts"];
33
+ };
34
+ export type HeadlessEarningsProps = Omit<EarningsSummaryProps, "children"> & {
35
+ presentation?: "headless";
36
+ children?: (state: EarningsRenderProps) => ReactNode;
37
+ };
38
+ export type EarningsProps = HeadlessEarningsProps | (Omit<ConnectProps, "component"> & {
39
+ presentation: "embedded";
40
+ });
41
+ export declare function Earnings(props: EarningsProps): import("react").JSX.Element;
42
+ //# sourceMappingURL=Earnings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Earnings.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Earnings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,qHAAqH;AACrH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAAE,GAC9D,aAAa,CAOf;AACD,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;CAC1C,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAAG;IAC3E,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;CACtD,CAAC;AACF,MAAM,MAAM,aAAa,GACrB,qBAAqB,GACrB,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG;IAAE,YAAY,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AACrE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAgC5C"}
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
+ import { EarningsSummary, } from "../components/EarningsSummary.js";
4
+ import { formatPrice } from "../lib/price-helpers.js";
5
+ import { Connect } from "./Connect.js";
6
+ /** Recipient funds held plus already paid out, not gross charge revenue. Destination-charge balance display only. */
7
+ export function earningsFromBalance(balance, payouts) {
8
+ const currency = balance?.currency ?? payouts[0]?.currency ?? "usd";
9
+ const paidOut = payouts
10
+ .filter((row) => row.currency === currency && row.status === "paid")
11
+ .reduce((sum, row) => sum + row.amount, 0);
12
+ const gross = (balance ? balance.available + balance.pending : 0) + paidOut;
13
+ return { gross, reversed: 0, net: gross, paidOut, currency };
14
+ }
15
+ export function Earnings(props) {
16
+ if (props.presentation === "embedded")
17
+ return _jsx(Connect, { ...props, component: "balances" });
18
+ const { children, ...summary } = props;
19
+ const currency = props.currency ?? "usd";
20
+ const metrics = [
21
+ ["gross", "Gross"],
22
+ ["reversed", "Reversals & adjustments"],
23
+ ["net", "Net"],
24
+ ["paidOut", "Paid out"],
25
+ ].map(([key, label]) => ({
26
+ key,
27
+ label: props.labels?.[key] ?? label,
28
+ amount: props[key],
29
+ formattedValue: formatPrice(props[key], currency, props.locale),
30
+ }));
31
+ return (_jsx(_Fragment, { children: children ? (children({
32
+ metrics,
33
+ isLoading: props.isLoading ?? false,
34
+ currency,
35
+ payouts: props.payouts,
36
+ })) : (_jsx(EarningsSummary, { ...summary })) }));
37
+ }
38
+ //# sourceMappingURL=Earnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Earnings.js","sourceRoot":"","sources":["../../../src/react/workflows/Earnings.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,eAAe,GAEhB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAa1D,qHAAqH;AACrH,MAAM,UAAU,mBAAmB,CACjC,OAA+B,EAC/B,OAA+D;IAE/D,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,KAAK,CAAC;IACpE,MAAM,OAAO,GAAG,OAAO;SACpB,MAAM,CA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