@fantastic.dev/better-stripe 0.7.0 → 0.8.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 (359) hide show
  1. package/CHANGELOG.md +29 -18
  2. package/README.md +123 -91
  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/disputes.d.ts +1 -1
  8. package/dist/client/connect/disputes.d.ts.map +1 -1
  9. package/dist/client/connect/disputes.js +12 -6
  10. package/dist/client/connect/disputes.js.map +1 -1
  11. package/dist/client/connect/paymentMethods.d.ts.map +1 -1
  12. package/dist/client/connect/paymentMethods.js.map +1 -1
  13. package/dist/client/connect/refundActor.d.ts.map +1 -1
  14. package/dist/client/connect/refundActor.js.map +1 -1
  15. package/dist/client/connect/refunds.d.ts.map +1 -1
  16. package/dist/client/connect/refunds.js.map +1 -1
  17. package/dist/client/connect/transfers.d.ts.map +1 -1
  18. package/dist/client/connect/transfers.js +15 -4
  19. package/dist/client/connect/transfers.js.map +1 -1
  20. package/dist/client/core/accountDefaults.d.ts +6 -0
  21. package/dist/client/core/accountDefaults.d.ts.map +1 -0
  22. package/dist/client/core/accountDefaults.js +15 -0
  23. package/dist/client/core/accountDefaults.js.map +1 -0
  24. package/dist/client/core/accounts.d.ts +1 -5
  25. package/dist/client/core/accounts.d.ts.map +1 -1
  26. package/dist/client/core/accounts.js +2 -14
  27. package/dist/client/core/accounts.js.map +1 -1
  28. package/dist/client/core/fees.d.ts.map +1 -1
  29. package/dist/client/core/fees.js +7 -2
  30. package/dist/client/core/fees.js.map +1 -1
  31. package/dist/client/index.d.ts +1 -1
  32. package/dist/client/index.d.ts.map +1 -1
  33. package/dist/client/products/prices.d.ts.map +1 -1
  34. package/dist/client/products/prices.js.map +1 -1
  35. package/dist/client/products/products.d.ts.map +1 -1
  36. package/dist/client/products/products.js +3 -1
  37. package/dist/client/products/products.js.map +1 -1
  38. package/dist/client/utils/owner.d.ts.map +1 -1
  39. package/dist/client/utils/owner.js +3 -1
  40. package/dist/client/utils/owner.js.map +1 -1
  41. package/dist/client/utils/stripeDashboardUrl.d.ts.map +1 -1
  42. package/dist/client/utils/stripeDashboardUrl.js.map +1 -1
  43. package/dist/client/webhooks/helpers.d.ts +10 -0
  44. package/dist/client/webhooks/helpers.d.ts.map +1 -1
  45. package/dist/client/webhooks/helpers.js +18 -0
  46. package/dist/client/webhooks/helpers.js.map +1 -1
  47. package/dist/client/webhooks/processors.d.ts.map +1 -1
  48. package/dist/client/webhooks/processors.js +1 -19
  49. package/dist/client/webhooks/processors.js.map +1 -1
  50. package/dist/component/connect/mutations.d.ts.map +1 -1
  51. package/dist/component/connect/mutations.js +4 -33
  52. package/dist/component/connect/mutations.js.map +1 -1
  53. package/dist/component/connect/schema.d.ts.map +1 -1
  54. package/dist/component/connect/schema.js.map +1 -1
  55. package/dist/component/lib/paymentSeller.d.ts +3 -0
  56. package/dist/component/lib/paymentSeller.d.ts.map +1 -0
  57. package/dist/component/lib/paymentSeller.js +10 -0
  58. package/dist/component/lib/paymentSeller.js.map +1 -0
  59. package/dist/component/lib/reversals.d.ts +10 -0
  60. package/dist/component/lib/reversals.d.ts.map +1 -1
  61. package/dist/component/lib/reversals.js +17 -0
  62. package/dist/component/lib/reversals.js.map +1 -1
  63. package/dist/react/components/ConnectProvider.d.ts +1 -1
  64. package/dist/react/components/ConnectProvider.d.ts.map +1 -1
  65. package/dist/react/components/ConnectProvider.js +18 -4
  66. package/dist/react/components/ConnectProvider.js.map +1 -1
  67. package/dist/react/components/ConnectStatusBadge.d.ts.map +1 -1
  68. package/dist/react/components/ConnectStatusBadge.js.map +1 -1
  69. package/dist/react/components/DisputeDetail.d.ts +4 -1
  70. package/dist/react/components/DisputeDetail.d.ts.map +1 -1
  71. package/dist/react/components/DisputeDetail.js +12 -6
  72. package/dist/react/components/DisputeDetail.js.map +1 -1
  73. package/dist/react/components/DisputesList.d.ts.map +1 -1
  74. package/dist/react/components/DisputesList.js +2 -1
  75. package/dist/react/components/DisputesList.js.map +1 -1
  76. package/dist/react/components/EmbeddedDisputes.d.ts +1 -1
  77. package/dist/react/components/EmbeddedDisputes.d.ts.map +1 -1
  78. package/dist/react/components/EmbeddedDisputes.js +1 -1
  79. package/dist/react/components/EmbeddedDisputes.js.map +1 -1
  80. package/dist/react/components/SplitBreakdown.d.ts.map +1 -1
  81. package/dist/react/components/SplitBreakdown.js +12 -2
  82. package/dist/react/components/SplitBreakdown.js.map +1 -1
  83. package/dist/react/hooks/useCheckoutSession.d.ts.map +1 -1
  84. package/dist/react/hooks/useCheckoutSession.js.map +1 -1
  85. package/dist/react/hooks/useConfirmPayment.d.ts.map +1 -1
  86. package/dist/react/hooks/useConfirmPayment.js.map +1 -1
  87. package/dist/react/index.d.ts +2 -1
  88. package/dist/react/index.d.ts.map +1 -1
  89. package/dist/react/index.js +3 -1
  90. package/dist/react/index.js.map +1 -1
  91. package/dist/react/workflows/Account.d.ts +67 -0
  92. package/dist/react/workflows/Account.d.ts.map +1 -0
  93. package/dist/react/workflows/Account.js +74 -0
  94. package/dist/react/workflows/Account.js.map +1 -0
  95. package/dist/react/workflows/Billing.d.ts +60 -0
  96. package/dist/react/workflows/Billing.d.ts.map +1 -0
  97. package/dist/react/workflows/Billing.js +84 -0
  98. package/dist/react/workflows/Billing.js.map +1 -0
  99. package/dist/react/workflows/BillingPlans.d.ts +45 -0
  100. package/dist/react/workflows/BillingPlans.d.ts.map +1 -0
  101. package/dist/react/workflows/BillingPlans.js +51 -0
  102. package/dist/react/workflows/BillingPlans.js.map +1 -0
  103. package/dist/react/workflows/Checkout.d.ts +46 -0
  104. package/dist/react/workflows/Checkout.d.ts.map +1 -0
  105. package/dist/react/workflows/Checkout.js +61 -0
  106. package/dist/react/workflows/Checkout.js.map +1 -0
  107. package/dist/react/workflows/CheckoutChooser.d.ts +20 -0
  108. package/dist/react/workflows/CheckoutChooser.d.ts.map +1 -0
  109. package/dist/react/workflows/CheckoutChooser.js +24 -0
  110. package/dist/react/workflows/CheckoutChooser.js.map +1 -0
  111. package/dist/react/workflows/CheckoutForms.d.ts +26 -0
  112. package/dist/react/workflows/CheckoutForms.d.ts.map +1 -0
  113. package/dist/react/workflows/CheckoutForms.js +126 -0
  114. package/dist/react/workflows/CheckoutForms.js.map +1 -0
  115. package/dist/react/workflows/ClipboardButton.d.ts +17 -0
  116. package/dist/react/workflows/ClipboardButton.d.ts.map +1 -0
  117. package/dist/react/workflows/ClipboardButton.js +35 -0
  118. package/dist/react/workflows/ClipboardButton.js.map +1 -0
  119. package/dist/react/workflows/Collection.d.ts +30 -0
  120. package/dist/react/workflows/Collection.d.ts.map +1 -0
  121. package/dist/react/workflows/Collection.js +25 -0
  122. package/dist/react/workflows/Collection.js.map +1 -0
  123. package/dist/react/workflows/Collections.d.ts +56 -0
  124. package/dist/react/workflows/Collections.d.ts.map +1 -0
  125. package/dist/react/workflows/Collections.js +111 -0
  126. package/dist/react/workflows/Collections.js.map +1 -0
  127. package/dist/react/workflows/Connect.d.ts +19 -0
  128. package/dist/react/workflows/Connect.d.ts.map +1 -0
  129. package/dist/react/workflows/Connect.js +43 -0
  130. package/dist/react/workflows/Connect.js.map +1 -0
  131. package/dist/react/workflows/Costs.d.ts +48 -0
  132. package/dist/react/workflows/Costs.d.ts.map +1 -0
  133. package/dist/react/workflows/Costs.js +66 -0
  134. package/dist/react/workflows/Costs.js.map +1 -0
  135. package/dist/react/workflows/Disputes.d.ts +36 -0
  136. package/dist/react/workflows/Disputes.d.ts.map +1 -0
  137. package/dist/react/workflows/Disputes.js +74 -0
  138. package/dist/react/workflows/Disputes.js.map +1 -0
  139. package/dist/react/workflows/Earnings.d.ts +42 -0
  140. package/dist/react/workflows/Earnings.d.ts.map +1 -0
  141. package/dist/react/workflows/Earnings.js +38 -0
  142. package/dist/react/workflows/Earnings.js.map +1 -0
  143. package/dist/react/workflows/Financials.d.ts +43 -0
  144. package/dist/react/workflows/Financials.d.ts.map +1 -0
  145. package/dist/react/workflows/Financials.js +57 -0
  146. package/dist/react/workflows/Financials.js.map +1 -0
  147. package/dist/react/workflows/IntegrationSwitch.d.ts +23 -0
  148. package/dist/react/workflows/IntegrationSwitch.d.ts.map +1 -0
  149. package/dist/react/workflows/IntegrationSwitch.js +31 -0
  150. package/dist/react/workflows/IntegrationSwitch.js.map +1 -0
  151. package/dist/react/workflows/Onboarding.d.ts +56 -0
  152. package/dist/react/workflows/Onboarding.d.ts.map +1 -0
  153. package/dist/react/workflows/Onboarding.js +86 -0
  154. package/dist/react/workflows/Onboarding.js.map +1 -0
  155. package/dist/react/workflows/Overview.d.ts +51 -0
  156. package/dist/react/workflows/Overview.d.ts.map +1 -0
  157. package/dist/react/workflows/Overview.js +63 -0
  158. package/dist/react/workflows/Overview.js.map +1 -0
  159. package/dist/react/workflows/PaymentMethods.d.ts +35 -0
  160. package/dist/react/workflows/PaymentMethods.d.ts.map +1 -0
  161. package/dist/react/workflows/PaymentMethods.js +63 -0
  162. package/dist/react/workflows/PaymentMethods.js.map +1 -0
  163. package/dist/react/workflows/PaymentReceipt.d.ts +20 -0
  164. package/dist/react/workflows/PaymentReceipt.d.ts.map +1 -0
  165. package/dist/react/workflows/PaymentReceipt.js +24 -0
  166. package/dist/react/workflows/PaymentReceipt.js.map +1 -0
  167. package/dist/react/workflows/Payouts.d.ts +48 -0
  168. package/dist/react/workflows/Payouts.d.ts.map +1 -0
  169. package/dist/react/workflows/Payouts.js +88 -0
  170. package/dist/react/workflows/Payouts.js.map +1 -0
  171. package/dist/react/workflows/Products.d.ts +92 -0
  172. package/dist/react/workflows/Products.d.ts.map +1 -0
  173. package/dist/react/workflows/Products.js +179 -0
  174. package/dist/react/workflows/Products.js.map +1 -0
  175. package/dist/react/workflows/ReferralLinks.d.ts +26 -0
  176. package/dist/react/workflows/ReferralLinks.d.ts.map +1 -0
  177. package/dist/react/workflows/ReferralLinks.js +30 -0
  178. package/dist/react/workflows/ReferralLinks.js.map +1 -0
  179. package/dist/react/workflows/Refunds.d.ts +72 -0
  180. package/dist/react/workflows/Refunds.d.ts.map +1 -0
  181. package/dist/react/workflows/Refunds.js +95 -0
  182. package/dist/react/workflows/Refunds.js.map +1 -0
  183. package/dist/react/workflows/Setup.d.ts +50 -0
  184. package/dist/react/workflows/Setup.d.ts.map +1 -0
  185. package/dist/react/workflows/Setup.js +59 -0
  186. package/dist/react/workflows/Setup.js.map +1 -0
  187. package/dist/react/workflows/Storefront.d.ts +53 -0
  188. package/dist/react/workflows/Storefront.d.ts.map +1 -0
  189. package/dist/react/workflows/Storefront.js +44 -0
  190. package/dist/react/workflows/Storefront.js.map +1 -0
  191. package/dist/react/workflows/SubscriptionOverview.d.ts +13 -0
  192. package/dist/react/workflows/SubscriptionOverview.d.ts.map +1 -0
  193. package/dist/react/workflows/SubscriptionOverview.js +26 -0
  194. package/dist/react/workflows/SubscriptionOverview.js.map +1 -0
  195. package/dist/react/workflows/Subscriptions.d.ts +92 -0
  196. package/dist/react/workflows/Subscriptions.d.ts.map +1 -0
  197. package/dist/react/workflows/Subscriptions.js +149 -0
  198. package/dist/react/workflows/Subscriptions.js.map +1 -0
  199. package/dist/react/workflows/Tasks.d.ts +40 -0
  200. package/dist/react/workflows/Tasks.d.ts.map +1 -0
  201. package/dist/react/workflows/Tasks.js +113 -0
  202. package/dist/react/workflows/Tasks.js.map +1 -0
  203. package/dist/react/workflows/checkout-options.d.ts +37 -0
  204. package/dist/react/workflows/checkout-options.d.ts.map +1 -0
  205. package/dist/react/workflows/checkout-options.js +43 -0
  206. package/dist/react/workflows/checkout-options.js.map +1 -0
  207. package/dist/react/workflows/current-subscription.d.ts +11 -0
  208. package/dist/react/workflows/current-subscription.d.ts.map +1 -0
  209. package/dist/react/workflows/current-subscription.js +14 -0
  210. package/dist/react/workflows/current-subscription.js.map +1 -0
  211. package/dist/react/workflows/filters.d.ts +17 -0
  212. package/dist/react/workflows/filters.d.ts.map +1 -0
  213. package/dist/react/workflows/filters.js +23 -0
  214. package/dist/react/workflows/filters.js.map +1 -0
  215. package/dist/react/workflows/index.d.ts +70 -0
  216. package/dist/react/workflows/index.d.ts.map +1 -0
  217. package/dist/react/workflows/index.js +38 -0
  218. package/dist/react/workflows/index.js.map +1 -0
  219. package/dist/react/workflows/useWorkflowAction.d.ts +11 -0
  220. package/dist/react/workflows/useWorkflowAction.d.ts.map +1 -0
  221. package/dist/react/workflows/useWorkflowAction.js +68 -0
  222. package/dist/react/workflows/useWorkflowAction.js.map +1 -0
  223. package/dist/react/workflows/useWorkflowResource.d.ts +9 -0
  224. package/dist/react/workflows/useWorkflowResource.d.ts.map +1 -0
  225. package/dist/react/workflows/useWorkflowResource.js +67 -0
  226. package/dist/react/workflows/useWorkflowResource.js.map +1 -0
  227. package/docs/react-workflows-audit.md +88 -0
  228. package/docs/react-workflows.md +234 -0
  229. package/package.json +19 -3
  230. package/src/client/billing/checkout-ui-modes.test.ts +49 -0
  231. package/src/client/billing/checkout.ts +8 -3
  232. package/src/client/billing/invoices.test.ts +12 -6
  233. package/src/client/connect/disputes.test.ts +15 -0
  234. package/src/client/connect/disputes.ts +13 -7
  235. package/src/client/connect/paymentMethods.test.ts +3 -1
  236. package/src/client/connect/paymentMethods.ts +4 -1
  237. package/src/client/connect/refundActor.ts +1 -2
  238. package/src/client/connect/refunds.test.ts +35 -10
  239. package/src/client/connect/refunds.ts +4 -1
  240. package/src/client/connect/transfers.test.ts +66 -12
  241. package/src/client/connect/transfers.ts +32 -8
  242. package/src/client/core/accountDefaults.ts +15 -0
  243. package/src/client/core/accounts.ts +14 -17
  244. package/src/client/core/config.test.ts +2 -1
  245. package/src/client/core/descriptors.test.ts +6 -4
  246. package/src/client/core/fees.test.ts +20 -28
  247. package/src/client/core/fees.ts +9 -2
  248. package/src/client/index.test.ts +22 -22
  249. package/src/client/index.ts +1 -1
  250. package/src/client/products/prices.test.ts +8 -2
  251. package/src/client/products/prices.ts +4 -1
  252. package/src/client/products/products.test.ts +61 -20
  253. package/src/client/products/products.ts +3 -1
  254. package/src/client/utils/data.test.ts +3 -1
  255. package/src/client/utils/owner.test.ts +4 -1
  256. package/src/client/utils/owner.ts +5 -1
  257. package/src/client/utils/stripeDashboardUrl.ts +1 -4
  258. package/src/client/webhooks/handler.test.ts +16 -19
  259. package/src/client/webhooks/helpers.test.ts +26 -13
  260. package/src/client/webhooks/helpers.ts +23 -0
  261. package/src/client/webhooks/hooks.test.ts +1 -2
  262. package/src/client/webhooks/processors.test.ts +18 -34
  263. package/src/client/webhooks/processors.ts +1 -23
  264. package/src/client/webhooks.test.ts +1 -2
  265. package/src/component/_generated/api.ts +2 -0
  266. package/src/component/connect/mutations.ts +5 -46
  267. package/src/component/connect/schema.ts +4 -3
  268. package/src/component/connect.test.ts +1 -5
  269. package/src/component/lib/paymentSeller.ts +15 -0
  270. package/src/component/lib/reversals.ts +30 -2
  271. package/src/component/subscription-scoping.test.ts +5 -1
  272. package/src/component/triggers.test.ts +7 -4
  273. package/src/react/components/BuyerBillingView.render.test.tsx +7 -2
  274. package/src/react/components/ConnectProvider.live.test.tsx +61 -0
  275. package/src/react/components/ConnectProvider.tsx +18 -4
  276. package/src/react/components/ConnectStatusBadge.tsx +1 -4
  277. package/src/react/components/DisputeDetail.render.test.tsx +5 -1
  278. package/src/react/components/DisputeDetail.tsx +14 -5
  279. package/src/react/components/DisputesList.render.test.tsx +21 -0
  280. package/src/react/components/DisputesList.tsx +2 -1
  281. package/src/react/components/EarningsSummary.render.test.tsx +2 -6
  282. package/src/react/components/EmbeddedDisputes.render.test.tsx +7 -5
  283. package/src/react/components/EmbeddedDisputes.tsx +4 -1
  284. package/src/react/components/EvidenceForm.render.test.tsx +3 -10
  285. package/src/react/components/SplitBreakdown.render.test.tsx +28 -5
  286. package/src/react/components/SplitBreakdown.tsx +12 -2
  287. package/src/react/hooks/useCheckoutSession.ts +1 -2
  288. package/src/react/hooks/useConfirmPayment.ts +1 -2
  289. package/src/react/hooks/useEarnings.test.ts +43 -8
  290. package/src/react/hooks/useStripeMode.test.ts +5 -8
  291. package/src/react/index.ts +7 -1
  292. package/src/react/workflows/Account.test.tsx +31 -0
  293. package/src/react/workflows/Account.tsx +183 -0
  294. package/src/react/workflows/Billing.test.tsx +45 -0
  295. package/src/react/workflows/Billing.tsx +213 -0
  296. package/src/react/workflows/BillingPlans.test.tsx +31 -0
  297. package/src/react/workflows/BillingPlans.tsx +130 -0
  298. package/src/react/workflows/Checkout.test.tsx +118 -0
  299. package/src/react/workflows/Checkout.tsx +135 -0
  300. package/src/react/workflows/CheckoutChooser.test.tsx +44 -0
  301. package/src/react/workflows/CheckoutChooser.tsx +77 -0
  302. package/src/react/workflows/CheckoutForm.test.tsx +66 -0
  303. package/src/react/workflows/CheckoutForms.test.tsx +123 -0
  304. package/src/react/workflows/CheckoutForms.tsx +247 -0
  305. package/src/react/workflows/ClipboardButton.test.tsx +34 -0
  306. package/src/react/workflows/ClipboardButton.tsx +67 -0
  307. package/src/react/workflows/Collection.tsx +76 -0
  308. package/src/react/workflows/Collections.test.tsx +86 -0
  309. package/src/react/workflows/Collections.tsx +213 -0
  310. package/src/react/workflows/Connect.test.tsx +50 -0
  311. package/src/react/workflows/Connect.tsx +107 -0
  312. package/src/react/workflows/Costs.test.tsx +41 -0
  313. package/src/react/workflows/Costs.tsx +133 -0
  314. package/src/react/workflows/Disputes.test.tsx +64 -0
  315. package/src/react/workflows/Disputes.tsx +173 -0
  316. package/src/react/workflows/Earnings.test.ts +19 -0
  317. package/src/react/workflows/Earnings.tsx +84 -0
  318. package/src/react/workflows/Financials.test.tsx +35 -0
  319. package/src/react/workflows/Financials.tsx +117 -0
  320. package/src/react/workflows/IntegrationSwitch.test.tsx +36 -0
  321. package/src/react/workflows/IntegrationSwitch.tsx +63 -0
  322. package/src/react/workflows/Onboarding.test.tsx +75 -0
  323. package/src/react/workflows/Onboarding.tsx +171 -0
  324. package/src/react/workflows/Overview.test.tsx +57 -0
  325. package/src/react/workflows/Overview.tsx +123 -0
  326. package/src/react/workflows/PaymentMethods.test.tsx +60 -0
  327. package/src/react/workflows/PaymentMethods.tsx +117 -0
  328. package/src/react/workflows/PaymentReceipt.test.tsx +24 -0
  329. package/src/react/workflows/PaymentReceipt.tsx +46 -0
  330. package/src/react/workflows/Payouts.test.tsx +112 -0
  331. package/src/react/workflows/Payouts.tsx +215 -0
  332. package/src/react/workflows/Products.test.tsx +90 -0
  333. package/src/react/workflows/Products.tsx +377 -0
  334. package/src/react/workflows/ReferralLinks.test.tsx +39 -0
  335. package/src/react/workflows/ReferralLinks.tsx +75 -0
  336. package/src/react/workflows/Refunds.test.tsx +75 -0
  337. package/src/react/workflows/Refunds.tsx +223 -0
  338. package/src/react/workflows/Setup.test.tsx +25 -0
  339. package/src/react/workflows/Setup.tsx +166 -0
  340. package/src/react/workflows/Storefront.test.tsx +82 -0
  341. package/src/react/workflows/Storefront.tsx +138 -0
  342. package/src/react/workflows/SubscriptionOverview.test.tsx +27 -0
  343. package/src/react/workflows/SubscriptionOverview.tsx +48 -0
  344. package/src/react/workflows/Subscriptions.test.tsx +61 -0
  345. package/src/react/workflows/Subscriptions.tsx +282 -0
  346. package/src/react/workflows/Tasks.test.tsx +23 -0
  347. package/src/react/workflows/Tasks.tsx +199 -0
  348. package/src/react/workflows/checkout-options.ts +42 -0
  349. package/src/react/workflows/current-subscription.test.ts +29 -0
  350. package/src/react/workflows/current-subscription.ts +25 -0
  351. package/src/react/workflows/filters.test.ts +12 -0
  352. package/src/react/workflows/filters.ts +22 -0
  353. package/src/react/workflows/index.ts +238 -0
  354. package/src/react/workflows/native-interactions.test.tsx +73 -0
  355. package/src/react/workflows/public-workflows.test.tsx +216 -0
  356. package/src/react/workflows/useWorkflowAction.test.tsx +54 -0
  357. package/src/react/workflows/useWorkflowAction.ts +75 -0
  358. package/src/react/workflows/useWorkflowResource.test.tsx +41 -0
  359. package/src/react/workflows/useWorkflowResource.ts +78 -0
package/CHANGELOG.md CHANGED
@@ -14,46 +14,57 @@
14
14
  - Remove internal tracker references from public documentation and add a
15
15
  regression check that prevents their reintroduction.
16
16
 
17
- ## [0.7.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.6.1...v0.7.0) (2026-10-13)
17
+ ## [0.8.1](https://github.com/FantasticDevHQ/better-stripe/compare/v0.8.0...v0.8.1) (2026-10-13)
18
+
19
+ ### Bug Fixes
18
20
 
21
+ - harden sandbox example and reusable React workflows ([#135](https://github.com/FantasticDevHQ/better-stripe/issues/135)) ([65985a5](https://github.com/FantasticDevHQ/better-stripe/commit/65985a5be392e3bcb04c4055fb36515ba02de0b2))
22
+
23
+ ## [0.8.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.7.0...v0.8.0) (2026-10-13)
19
24
 
20
25
  ### Features
21
26
 
22
- * expand marketplace example with seller billing and sandbox fixtures ([#129](https://github.com/FantasticDevHQ/better-stripe/issues/129)) ([7f21f53](https://github.com/FantasticDevHQ/better-stripe/commit/7f21f5365ce82cab9ecc984b94f444408223f8b8))
27
+ - compare checkout and embedded integration examples ([#133](https://github.com/FantasticDevHQ/better-stripe/issues/133)) ([0d916f6](https://github.com/FantasticDevHQ/better-stripe/commit/0d916f6aecf734877da379327a3148753fc0c4c3))
28
+ - ship reusable React workflows and migrate the example UI ([#134](https://github.com/FantasticDevHQ/better-stripe/issues/134)) ([a1336ce](https://github.com/FantasticDevHQ/better-stripe/commit/a1336ced2a6d3a09210e769a89cf70022c0f7531))
23
29
 
24
- ## [0.6.1](https://github.com/FantasticDevHQ/better-stripe/compare/v0.6.0...v0.6.1) (2026-10-13)
30
+ ### Maintenance
31
+
32
+ - add repo-gates and enforce check:all ([#131](https://github.com/FantasticDevHQ/better-stripe/issues/131)) ([be80b7f](https://github.com/FantasticDevHQ/better-stripe/commit/be80b7f8fe186bc22dbdc956357bd4a1120eec29))
25
33
 
34
+ ## [0.7.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.6.1...v0.7.0) (2026-10-13)
35
+
36
+ ### Features
37
+
38
+ - expand marketplace example with seller billing and sandbox fixtures ([#129](https://github.com/FantasticDevHQ/better-stripe/issues/129)) ([7f21f53](https://github.com/FantasticDevHQ/better-stripe/commit/7f21f5365ce82cab9ecc984b94f444408223f8b8))
39
+
40
+ ## [0.6.1](https://github.com/FantasticDevHQ/better-stripe/compare/v0.6.0...v0.6.1) (2026-10-13)
26
41
 
27
42
  ### Bug Fixes
28
43
 
29
- * complete large split reversals and keep public docs current ([#127](https://github.com/FantasticDevHQ/better-stripe/issues/127)) ([e7cc0a9](https://github.com/FantasticDevHQ/better-stripe/commit/e7cc0a9b0ea01f4993447f9d73edebe71b364081))
44
+ - complete large split reversals and keep public docs current ([#127](https://github.com/FantasticDevHQ/better-stripe/issues/127)) ([e7cc0a9](https://github.com/FantasticDevHQ/better-stripe/commit/e7cc0a9b0ea01f4993447f9d73edebe71b364081))
30
45
 
31
46
  ## [0.6.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.5.0...v0.6.0) (2026-10-12)
32
47
 
33
-
34
48
  ### ⚠ BREAKING CHANGES
35
49
 
36
- * the package name changes to @fantastic.dev/better-stripe; @getdojo/better-stripe receives no further releases.
50
+ - the package name changes to @fantastic.dev/better-stripe; @getdojo/better-stripe receives no further releases.
37
51
 
38
52
  ### Features
39
53
 
40
- * complete Stripe Endive compatibility and release 0.5.0 ([#126](https://github.com/FantasticDevHQ/better-stripe/issues/126)) ([135695f](https://github.com/FantasticDevHQ/better-stripe/commit/135695f51906ea156a36dbe8d0d43cf1d99e5fc1))
41
- * publish as [@fantastic](https://github.com/fantastic).dev/better-stripe via Release Please and trusted publishing ([#120](https://github.com/FantasticDevHQ/better-stripe/issues/120)) ([7451eeb](https://github.com/FantasticDevHQ/better-stripe/commit/7451eeb514b09a09656355c74c4bec083e1ddce7))
42
-
54
+ - complete Stripe Endive compatibility and release 0.5.0 ([#126](https://github.com/FantasticDevHQ/better-stripe/issues/126)) ([135695f](https://github.com/FantasticDevHQ/better-stripe/commit/135695f51906ea156a36dbe8d0d43cf1d99e5fc1))
55
+ - publish as [@fantastic](https://github.com/fantastic).dev/better-stripe via Release Please and trusted publishing ([#120](https://github.com/FantasticDevHQ/better-stripe/issues/120)) ([7451eeb](https://github.com/FantasticDevHQ/better-stripe/commit/7451eeb514b09a09656355c74c4bec083e1ddce7))
43
56
 
44
57
  ### Bug Fixes
45
58
 
46
- * repair example checkout billing and seller flows ([#125](https://github.com/FantasticDevHQ/better-stripe/issues/125)) ([5911fb8](https://github.com/FantasticDevHQ/better-stripe/commit/5911fb8d8bc585fab62fe48e58e1e964047b8fd9))
47
-
59
+ - repair example checkout billing and seller flows ([#125](https://github.com/FantasticDevHQ/better-stripe/issues/125)) ([5911fb8](https://github.com/FantasticDevHQ/better-stripe/commit/5911fb8d8bc585fab62fe48e58e1e964047b8fd9))
48
60
 
49
61
  ### Maintenance
50
62
 
51
- * **deps:** update dependencies to latest ([#122](https://github.com/FantasticDevHQ/better-stripe/issues/122)) ([a7e4161](https://github.com/FantasticDevHQ/better-stripe/commit/a7e416179d20afdd2356668cbd4482e2e3fa4eff))
52
-
63
+ - **deps:** update dependencies to latest ([#122](https://github.com/FantasticDevHQ/better-stripe/issues/122)) ([a7e4161](https://github.com/FantasticDevHQ/better-stripe/commit/a7e416179d20afdd2356668cbd4482e2e3fa4eff))
53
64
 
54
65
  ### Continuous Integration
55
66
 
56
- * **release:** open release PRs with the org release GitHub App ([#124](https://github.com/FantasticDevHQ/better-stripe/issues/124)) ([3c94f2e](https://github.com/FantasticDevHQ/better-stripe/commit/3c94f2ef317f939ac039c261f9c148e6b1f14a56))
67
+ - **release:** open release PRs with the org release GitHub App ([#124](https://github.com/FantasticDevHQ/better-stripe/issues/124)) ([3c94f2e](https://github.com/FantasticDevHQ/better-stripe/commit/3c94f2ef317f939ac039c261f9c148e6b1f14a56))
57
68
 
58
69
  ## 0.5.0
59
70
 
@@ -125,7 +136,7 @@ changed by this release.
125
136
 
126
137
  - [#76](https://github.com/kellykampen/better-stripe/pull/76) [`c9f1489`](https://github.com/kellykampen/better-stripe/commit/c9f148948f2f5ea77f343c5fc1a78faffbb5ac1e) Thanks [@kellykampen](https://github.com/kellykampen)! - Add headless `DisputesList` component with due-by countdown badges ([#41](https://github.com/kellykampen/better-stripe/issues/41)).
127
138
 
128
- Pure, hook-free presentational list of a seller's disputes, sorted by evidence deadline (soonest first, no-deadline rows last, overdue rows naturally at the top). Rows accept the exact shape `getDisputeWithCountdown`/`useDisputeWithCountdown` produce, so the component never recomputes deadlines itself.
139
+ Pure, hook-free presentational list of a seller's disputes, sorted by evidence deadline (soonest first, no-deadline rows last, overdue rows naturally at the top). Rows accept the exact shape `getDisputeWithCountdown`/`useDisputeWithCountdown` produce, so the component never recomputes deadlines itself.
129
140
 
130
141
  Headless overrides: `className`, i18n labels (`emptyLabel`, `loadingLabel`, `dueLabel`/`overdueLabel` with `{days}` templating), a per-row `renderRow` slot, and a whole-list `children` render prop. Default markup is semantic `ul[role=list] > li[data-dispute-id]` with a `span[role=status]` badge carrying `data-overdue`. Purely additive.
131
142
 
@@ -191,7 +202,7 @@ changed by this release.
191
202
 
192
203
  - [#76](https://github.com/kellykampen/better-stripe/pull/76) [`c9f1489`](https://github.com/kellykampen/better-stripe/commit/c9f148948f2f5ea77f343c5fc1a78faffbb5ac1e) Thanks [@kellykampen](https://github.com/kellykampen)! - Add product-level `statement_descriptor` so it covers a subscription's first charge ([#63](https://github.com/kellykampen/better-stripe/issues/63)).
193
204
 
194
- The invoice-time descriptor path sets the descriptor at `invoice.created`, which never reaches a subscription's first invoice — Stripe finalizes and (for `charge_automatically`/Checkout subscription-mode) pays invoice [#1](https://github.com/kellykampen/better-stripe/issues/1) synchronously at creation, before that handler runs. Per Stripe's descriptor precedence (Invoice → Product → charge-type default), a product-level `statement_descriptor` covers every cycle including the first.
205
+ The invoice-time descriptor path sets the descriptor at `invoice.created`, which never reaches a subscription's first invoice — Stripe finalizes and (for `charge_automatically`/Checkout subscription-mode) pays invoice [#1](https://github.com/kellykampen/better-stripe/issues/1) synchronously at creation, before that handler runs. Per Stripe's descriptor precedence (Invoice → Product → charge-type default), a product-level `statement_descriptor` covers every cycle including the first.
195
206
 
196
207
  `createProduct`/`updateProduct` now resolve the per-store descriptor (the store's stored suffix, else the platform default — mirroring the account-level descriptor resolution) and stamp it onto the Stripe Product's `statement_descriptor`, for products with an `accountId`. No public API change to existing call shapes.
197
208
 
@@ -280,7 +291,7 @@ changed by this release.
280
291
 
281
292
  - A bare metadata/status update (no `evidence`) is unchanged — no `submit` is forced.
282
293
  - An explicit `submit: true` / `submit: false` is always honored.
283
- - `EvidenceForm` already passes `submit` explicitly, so it is unaffected.
294
+ - `EvidenceForm` already passes `submit` explicitly, so it is unaffected.
284
295
 
285
296
  If you relied on the old behavior of submitting evidence by omitting `submit`, pass `submit: true` explicitly.
286
297
 
@@ -288,7 +299,7 @@ changed by this release.
288
299
 
289
300
  - [#76](https://github.com/kellykampen/better-stripe/pull/76) [`c9f1489`](https://github.com/kellykampen/better-stripe/commit/c9f148948f2f5ea77f343c5fc1a78faffbb5ac1e) Thanks [@kellykampen](https://github.com/kellykampen)! - Regenerate the component's `_generated` API so transfer/dispute queries are typed for consumers ([#71](https://github.com/kellykampen/better-stripe/issues/71)).
290
301
 
291
- `src/component/_generated/component.ts` was stale — it predated `listTransfersByCharge`/`listTransfersByAccount` and `getDisputeByStripeId`/`listDisputes`, so `components.betterStripe.connect.queries.*` for those methods was untyped for any consumer reaching into the raw component API. Regenerated via `npx convex codegen`; no source logic changed, generated bindings only.
302
+ `src/component/_generated/component.ts` was stale — it predated `listTransfersByCharge`/`listTransfersByAccount` and `getDisputeByStripeId`/`listDisputes`, so `components.betterStripe.connect.queries.*` for those methods was untyped for any consumer reaching into the raw component API. Regenerated via `npx convex codegen`; no source logic changed, generated bindings only.
292
303
 
293
304
  - [#76](https://github.com/kellykampen/better-stripe/pull/76) [`c9f1489`](https://github.com/kellykampen/better-stripe/commit/c9f148948f2f5ea77f343c5fc1a78faffbb5ac1e) Thanks [@kellykampen](https://github.com/kellykampen)! - Fix: `updateDispute` now sends an explicit `submit: false` on every call, including metadata-only updates ([#67](https://github.com/kellykampen/better-stripe/issues/67)).
294
305
 
package/README.md CHANGED
@@ -6,7 +6,7 @@ Built for Convex + Next.js applications. Follows the conventions established by
6
6
 
7
7
  ## Status
8
8
 
9
- **Version**: `0.7.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
9
+ **Version**: `0.8.1` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
10
10
 
11
11
  Used in production by its authors. Webhook pipeline is covered by unit tests and a live E2E harness (`npm run e2e:webhooks`) that fires real Stripe-signed events and asserts the ledger.
12
12
 
@@ -21,7 +21,8 @@ Releases are automated with [Release Please](https://github.com/googleapis/relea
21
21
  - `docs:`, `chore:`, `ci:`, `refactor:`, `test:`, `build:` and `perf:` appear in the changelog too. On their own they still open a patch release PR, which you can leave open to collect more changes: nothing publishes until that PR is merged.
22
22
 
23
23
  Write the title for consumers of the package: it becomes the changelog entry. A title that isn't a Conventional Commit is left out.
24
- 2. **On merge to `main`**, the `Release` workflow opens or updates a release PR that bumps `package.json`, `CHANGELOG.md`, the version line above and `.release-please-manifest.json`.
24
+
25
+ 2. **On merge to `main`**, the `Release` workflow opens or updates a release PR that bumps `package.json`, `CHANGELOG.md`, the version line above and `.release-please-manifest.json`. It formats the generated changelog with the repository's pinned Prettier and commits any formatting changes through the release GitHub App, so CI validates the formatted branch. An already formatted changelog creates no extra commit.
25
26
  3. **Merging the release PR** is the release decision. The same run tags the version, creates the GitHub release and publishes to npm through [trusted publishing](https://docs.npmjs.com/trusted-publishers) with provenance. There's no npm token.
26
27
 
27
28
  Release policy lives in `release-please-config.json`. Keep the workflow file named `release.yml`, because the trusted publisher on npmjs.com is bound to that filename. A manually pushed `vX.Y.Z` tag also publishes, but only if it matches `package.json` and `CHANGELOG.md` has a section for it (`scripts/release-notes.mjs`). If publishing fails after the GitHub release is created, use **Re-run failed jobs** on that run. Check npm first if the outcome is uncertain: a published version can't be overwritten.
@@ -43,6 +44,19 @@ recovery. The example also demonstrates optional balance-funded subscriptions
43
44
  using Stripe's Accounts v2 preview. See the setup guide for consent requirements,
44
45
  renewal tests, and payment-recovery limitations.
45
46
 
47
+ The example also compares headless APIs, package React components, Stripe Connect
48
+ embeds, and hosted billing where supported. Its checkout chooser demonstrates
49
+ Hosted Checkout, Embedded Checkout, custom Checkout Sessions with Payment Element,
50
+ Payment Intents with Payment Element, and the preview Embedded Checkout Form,
51
+ with pros and cons for each. `createCheckoutSession` accepts `uiMode` values
52
+ `"redirect"`, `"embedded"`, `"custom"`, and `"form"`; the latter two map to Stripe's
53
+ `elements` and preview `form` modes. See [the integration examples](example/README.md#compare-integration-styles).
54
+
55
+ Run `pnpm run check:all` before submitting changes. It runs the build, lint,
56
+ formatting, typechecks, codegen drift check, tests, and repository quality gates
57
+ used by CI. Policy lives in `repo-gates.config.json`; measured baselines live in
58
+ `gates/`. Fix failures without weakening the gates or raising existing budgets.
59
+
46
60
  Builds and typechecks use TypeScript 7 (`@typescript/native` aliases
47
61
  `typescript`). ESLint and Convex code generation still need the TypeScript 6
48
62
  API, so `typescript` aliases Microsoft's `@typescript/typescript6` compatibility
@@ -72,8 +86,8 @@ All three require a configured dev deployment (`CONVEX_DEPLOYMENT` env var, norm
72
86
  **CI gate.** Two layers verify the committed files are not stale:
73
87
 
74
88
  1. **Structural drift check** (`pnpm codegen:check`, always runs in CI): two independent scans, each checking both directions (every source export appears in the generated file, and every generated entry still has a matching source), neither needing a deployment:
75
- - Library component — scans `src/component/**/*.{queries,mutations,actions}.ts` and verifies every exported function appears in `src/component/_generated/component.ts`. The reverse direction also flags a stale entry left behind by a *deleted* query/mutation/action. The export-detection regex intentionally matches only direct `query(...)`/`mutation(...)`/`action(...)` exports — not wrapper or re-export forms like `customQuery(...)` (convex-helpers) or `export { fn as name }`, which this component has none of today; widen the regex (and the reverse scan) rather than assuming that stays true.
76
- - Example app — scans `example/convex/**/*.ts` and verifies every source module is imported and registered in `example/convex/_generated/api.ts`. Catches the common case of adding a new `example/convex/<module>.ts` (or nested file like `example/convex/lib/<module>.ts`) without regenerating. The reverse direction likewise flags a stale import left behind by a *deleted* module.
89
+ - Library component — scans `src/component/**/*.{queries,mutations,actions}.ts` and verifies every exported function appears in `src/component/_generated/component.ts`. The reverse direction also flags a stale entry left behind by a _deleted_ query/mutation/action. The export-detection regex intentionally matches only direct `query(...)`/`mutation(...)`/`action(...)` exports — not wrapper or re-export forms like `customQuery(...)` (convex-helpers) or `export { fn as name }`, which this component has none of today; widen the regex (and the reverse scan) rather than assuming that stays true.
90
+ - Example app — scans `example/convex/**/*.ts` and verifies every source module is imported and registered in `example/convex/_generated/api.ts`. Catches the common case of adding a new `example/convex/<module>.ts` (or nested file like `example/convex/lib/<module>.ts`) without regenerating. The reverse direction likewise flags a stale import left behind by a _deleted_ module.
77
91
  2. **Authoritative regen-and-diff** (runs in CI when `CONVEX_DEPLOYMENT` is configured): runs `pnpm codegen` against the configured dev deployment and fails if `git diff` shows changes. Catches every drift case, including validator-shape changes the structural check can't see. To enable on a fork, set the `CONVEX_DEPLOYMENT` repo secret to a dev deployment name and authorize the CI runner — see Convex's [GitHub Actions guide](https://docs.convex.dev/production/integration/deployments#github-actions).
78
92
 
79
93
  ### Relation to `@convex-dev/stripe`
@@ -216,27 +230,27 @@ Methods named `get<Entity>` take the component document ID (exception: `getInvoi
216
230
 
217
231
  ### Account
218
232
 
219
- | Method | Description |
220
- | --------------------------------------------------------------------------------- | -------------------------------------------------------- |
221
- | `createAccount(ctx, { userId, email?, name?, country?, orgId?, metadata? })` | Create a V2 account in Stripe and the component database |
222
- | `getAccount(ctx, { accountId })` | Get account by component document ID |
223
- | `getAccountByStripeId(ctx, { stripeAccountId })` | Get account by Stripe account ID |
224
- | `getOrCreateAccount(ctx, { userId, email?, name?, country?, orgId?, metadata? })` | Get existing or create new account |
225
- | `getAccountByUserId(ctx, { userId })` | Get account by app-layer user ID |
226
- | `getAccountByOrgId(ctx, { orgId })` | Get account by organization/team ID |
227
- | `getAccountOnboardingStatus(ctx, { accountId })` | Get Connect onboarding status (by component document ID) |
228
- | `updateAccount(ctx, { stripeAccountId, email?, name?, metadata? })` | Update account fields |
229
- | `createAccountLink(ctx, { stripeAccountId, refreshUrl, returnUrl, type })` | Create Connect onboarding or update link |
230
- | `createAccountSession(ctx, { stripeAccountId, components })` | Create embedded account management session |
231
- | `createLoginLink(ctx, { stripeAccountId })` | Create Express dashboard login link |
232
- | `addRecipientConfiguration(ctx, { stripeAccountId })` | Add recipient configuration to an existing account |
233
- | `getV2Account(ctx, { stripeAccountId, include? })` | Retrieve a V2 account directly from Stripe |
234
- | `updateV2Account(ctx, { stripeAccountId, updateParams })` | Update a V2 account in Stripe |
235
- | `listStripeAccounts(ctx, { limit? })` | List V2 accounts directly from Stripe |
236
- | `closeAccount(ctx, { stripeAccountId })` | Close a V2 account; returns `{ closed: boolean }` |
237
- | `restartAccountOnboarding(ctx, { stripeAccountId })` | Close the account so onboarding can restart fresh |
238
- | `setAccountStatementDescriptor(ctx, { stripeAccountId, statementDescriptor })` | Set (or `null` to clear) the account's per-store statement-descriptor suffix |
239
- | `createDisputeSession(ctx, { stripeAccountId })` | Create an embedded Account Session scoped to the seller's disputes |
233
+ | Method | Description |
234
+ | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
235
+ | `createAccount(ctx, { userId, email?, name?, country?, orgId?, metadata? })` | Create a V2 account in Stripe and the component database |
236
+ | `getAccount(ctx, { accountId })` | Get account by component document ID |
237
+ | `getAccountByStripeId(ctx, { stripeAccountId })` | Get account by Stripe account ID |
238
+ | `getOrCreateAccount(ctx, { userId, email?, name?, country?, orgId?, metadata? })` | Get existing or create new account |
239
+ | `getAccountByUserId(ctx, { userId })` | Get account by app-layer user ID |
240
+ | `getAccountByOrgId(ctx, { orgId })` | Get account by organization/team ID |
241
+ | `getAccountOnboardingStatus(ctx, { accountId })` | Get Connect onboarding status (by component document ID) |
242
+ | `updateAccount(ctx, { stripeAccountId, email?, name?, metadata? })` | Update account fields |
243
+ | `createAccountLink(ctx, { stripeAccountId, refreshUrl, returnUrl, type })` | Create Connect onboarding or update link |
244
+ | `createAccountSession(ctx, { stripeAccountId, components })` | Create embedded account management session |
245
+ | `createLoginLink(ctx, { stripeAccountId })` | Create Express dashboard login link |
246
+ | `addRecipientConfiguration(ctx, { stripeAccountId })` | Add recipient configuration to an existing account |
247
+ | `getV2Account(ctx, { stripeAccountId, include? })` | Retrieve a V2 account directly from Stripe |
248
+ | `updateV2Account(ctx, { stripeAccountId, updateParams })` | Update a V2 account in Stripe |
249
+ | `listStripeAccounts(ctx, { limit? })` | List V2 accounts directly from Stripe |
250
+ | `closeAccount(ctx, { stripeAccountId })` | Close a V2 account; returns `{ closed: boolean }` |
251
+ | `restartAccountOnboarding(ctx, { stripeAccountId })` | Close the account so onboarding can restart fresh |
252
+ | `setAccountStatementDescriptor(ctx, { stripeAccountId, statementDescriptor })` | Set (or `null` to clear) the account's per-store statement-descriptor suffix |
253
+ | `createDisputeSession(ctx, { stripeAccountId })` | Create an embedded Account Session scoped to the seller's disputes |
240
254
 
241
255
  ### Product and Price
242
256
 
@@ -257,22 +271,22 @@ Methods named `get<Entity>` take the component document ID (exception: `getInvoi
257
271
 
258
272
  ### Checkout and Subscription
259
273
 
260
- | Method | Description |
261
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
274
+ | Method | Description |
275
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
262
276
  | `createCheckoutSession(ctx, { userId, stripePriceId, mode, returnUrl, uiMode?, quantity?, trialDays?, accountId?, orgId?, customerEmail?, destinationAccountId?, split?, fee?, amount?, metadata?, sessionOverrides? })` | Create checkout session (embedded or redirect); `destinationAccountId`/`split` route funds, `fee` overrides the platform's configured default |
263
- | `getCheckoutSession(ctx, { sessionId })` | Get checkout session by component document ID |
264
- | `getCheckoutSessionByStripeId(ctx, { stripeSessionId })` | Get checkout session by Stripe session ID |
265
- | `createSubscription(ctx, { userId, orgId?, customerAccount, stripePriceId, destinationAccountId?, split?, fee?, trialDays?, metadata? })` | Create a subscription directly for a V2 buyer (off the checkout flow), with the same routing/fee options as checkout |
266
- | `getSubscription(ctx, { subscriptionId })` | Get subscription by component document ID |
267
- | `getSubscriptionByStripeId(ctx, { stripeSubscriptionId })` | Get subscription by Stripe subscription ID |
268
- | `listSubscriptions(ctx, { stripeAccountId?, status?, limit? })` | List subscriptions, optionally scoped to a Connect account (use `listSubscriptionsByUser` for per-user filtering) |
269
- | `listSubscriptionsByUser(ctx, { userId, status? })` | List all subscriptions for a user |
270
- | `listSubscriptionsByOrg(ctx, { orgId, status? })` | List all subscriptions for an organization |
271
- | `getActiveSubscription(ctx, { userId, orgId? })` | Get the active subscription for a user or org |
272
- | `getTrialStatus(ctx, { subscriptionId })` | Get trial state for a subscription |
273
- | `cancelSubscription(ctx, { stripeSubscriptionId, cancelAtPeriodEnd? })` | Cancel subscription immediately or at period end |
274
- | `reactivateSubscription(ctx, { stripeSubscriptionId })` | Reactivate a canceled subscription |
275
- | `updateSubscriptionQuantity(ctx, { stripeSubscriptionId, quantity })` | Update subscription seat quantity |
277
+ | `getCheckoutSession(ctx, { sessionId })` | Get checkout session by component document ID |
278
+ | `getCheckoutSessionByStripeId(ctx, { stripeSessionId })` | Get checkout session by Stripe session ID |
279
+ | `createSubscription(ctx, { userId, orgId?, customerAccount, stripePriceId, destinationAccountId?, split?, fee?, trialDays?, metadata? })` | Create a subscription directly for a V2 buyer (off the checkout flow), with the same routing/fee options as checkout |
280
+ | `getSubscription(ctx, { subscriptionId })` | Get subscription by component document ID |
281
+ | `getSubscriptionByStripeId(ctx, { stripeSubscriptionId })` | Get subscription by Stripe subscription ID |
282
+ | `listSubscriptions(ctx, { stripeAccountId?, status?, limit? })` | List subscriptions, optionally scoped to a Connect account (use `listSubscriptionsByUser` for per-user filtering) |
283
+ | `listSubscriptionsByUser(ctx, { userId, status? })` | List all subscriptions for a user |
284
+ | `listSubscriptionsByOrg(ctx, { orgId, status? })` | List all subscriptions for an organization |
285
+ | `getActiveSubscription(ctx, { userId, orgId? })` | Get the active subscription for a user or org |
286
+ | `getTrialStatus(ctx, { subscriptionId })` | Get trial state for a subscription |
287
+ | `cancelSubscription(ctx, { stripeSubscriptionId, cancelAtPeriodEnd? })` | Cancel subscription immediately or at period end |
288
+ | `reactivateSubscription(ctx, { stripeSubscriptionId })` | Reactivate a canceled subscription |
289
+ | `updateSubscriptionQuantity(ctx, { stripeSubscriptionId, quantity })` | Update subscription seat quantity |
276
290
 
277
291
  ### Invoice, Payment Method, and Payout
278
292
 
@@ -294,17 +308,17 @@ Methods named `get<Entity>` take the component document ID (exception: `getInvoi
294
308
 
295
309
  ### Refund and Dispute
296
310
 
297
- | Method | Description |
298
- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
311
+ | Method | Description |
312
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
299
313
  | `createRefund(ctx, { stripePaymentIntentId?, stripeChargeId?, amount?, reason?, metadata?, stripeAccountId?, refundApplicationFee?, reverseTransfer? })` | Issue a refund (provide a payment intent or charge); returns/reverses the platform fee and destination transfer by default; synced via `refund.created`/`.updated` |
300
- | `getRefundByStripeId(ctx, { stripeRefundId })` | Get a refund by Stripe refund ID |
301
- | `listRefunds(ctx, { stripeAccountId?, stripePaymentIntentId?, status?, limit? })` | List refunds with optional filters |
302
- | `getDisputeByStripeId(ctx, { stripeDisputeId })` | Get a dispute by Stripe dispute ID |
303
- | `getDisputeWithCountdown(ctx, { stripeDisputeId })` | Get a dispute plus its evidence-due countdown (`daysRemaining`, `isOverdue`) |
304
- | `listDisputes(ctx, { stripeAccountId?, stripePaymentIntentId?, status?, limit? })` | List disputes with optional filters |
305
- | `updateDispute(ctx, { stripeDisputeId, evidence?, metadata?, submit?, stripeAccountId? })` | Submit/stage dispute evidence (`submit: true` finalizes the response) |
306
- | `closeDispute(ctx, { stripeDisputeId, stripeAccountId? })` | Accept a dispute (concede the chargeback) — irreversible |
307
- | `reverseTransfers(ctx, { sourceChargeId, percent?, amount? })` | Reverse split/destination transfers for a charge (the primitive behind automatic dispute clawback; also callable manually) |
314
+ | `getRefundByStripeId(ctx, { stripeRefundId })` | Get a refund by Stripe refund ID |
315
+ | `listRefunds(ctx, { stripeAccountId?, stripePaymentIntentId?, status?, limit? })` | List refunds with optional filters |
316
+ | `getDisputeByStripeId(ctx, { stripeDisputeId })` | Get a dispute by Stripe dispute ID |
317
+ | `getDisputeWithCountdown(ctx, { stripeDisputeId })` | Get a dispute plus its evidence-due countdown (`daysRemaining`, `isOverdue`) |
318
+ | `listDisputes(ctx, { stripeAccountId?, stripePaymentIntentId?, status?, limit? })` | List disputes with optional filters |
319
+ | `updateDispute(ctx, { stripeDisputeId, evidence?, metadata?, submit?, stripeAccountId? })` | Submit/stage dispute evidence (`submit: true` finalizes the response) |
320
+ | `closeDispute(ctx, { stripeDisputeId, stripeAccountId? })` | Accept a dispute (concede the chargeback) — irreversible |
321
+ | `reverseTransfers(ctx, { sourceChargeId, percent?, amount? })` | Reverse split/destination transfers for a charge (the primitive behind automatic dispute clawback; also callable manually) |
308
322
 
309
323
  Refunds denormalize cumulative state onto the linked `payments` row (`refundedAmount`, `refundStatus: "partially_refunded" | "fully_refunded"`) so "is this payment whole?" is a single read.
310
324
 
@@ -629,7 +643,11 @@ await stripe.createCheckoutSession(ctx, {
629
643
  returnUrl,
630
644
  split: [
631
645
  { destinationAccountId: storeAccountId, role: "store", percent: 80 },
632
- { destinationAccountId: affiliateAccountId, role: "affiliate", percent: 10 },
646
+ {
647
+ destinationAccountId: affiliateAccountId,
648
+ role: "affiliate",
649
+ percent: 10,
650
+ },
633
651
  ],
634
652
  fee: { percent: 10 }, // per-call override; omit to use the configured default
635
653
  });
@@ -708,21 +726,21 @@ Read hooks are exported as factory functions that take the app's `useQuery` bind
708
726
 
709
727
  ### Read Hooks
710
728
 
711
- | Hook Factory | Hook Arguments | Returns |
712
- | ---------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
713
- | `createUseAccount` | `(userId?)` | `{ account, isLoading }` |
714
- | `createUseProducts` | `({ accountId?, active? }?)` | `{ products, isLoading }` |
715
- | `createUsePrices` | `(productId?)` | `{ prices, isLoading }` |
716
- | `createUseSubscription` | `(subscriptionId?)` | `{ subscription, isActive, isTrialing, isCanceling, daysUntilRenewal, daysUntilTrialEnd, isLoading }` |
717
- | `createUseSubscriptions` | `({ userId?, status? }?)` | `{ subscriptions, activeSubscription, isLoading }` |
718
- | `createUseCheckout` | `(sessionId?)` | `{ session, status, isComplete, isLoading }` |
719
- | `createUsePaymentMethods` | `(accountId?)` | `{ methods, defaultMethod, isLoading }` |
720
- | `createUseInvoices` | `({ userId?, subscriptionId?, status? }?)` | `{ invoices, isLoading }` |
721
- | `createUseAccountOnboarding` | `(accountId?)` | `{ account, status, isReady, missingRequirements, isLoading }` |
722
- | `createUseEarnings` | `(accountId?)` | `{ gross, reversed, net, payouts, paidOut, transfers, isLoading }` — recipient balance/earnings |
723
- | `createUseSplitBreakdown` | `({ sourceChargeId?, saleAmount? })` | `{ breakdown: { legs, store, affiliate, other, recipientsTotal, platform? } \| null, isLoading }` — per-sale split |
724
- | `createUseDisputes` | `({ accountId?, status? }?)` | `{ disputes, isLoading }` |
725
- | `createUseDisputeWithCountdown` | `(stripeDisputeId?)` | `{ dispute, countdown: { dueBy?, daysRemaining?, isOverdue } \| null, isLoading }` |
729
+ | Hook Factory | Hook Arguments | Returns |
730
+ | ------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
731
+ | `createUseAccount` | `(userId?)` | `{ account, isLoading }` |
732
+ | `createUseProducts` | `({ accountId?, active? }?)` | `{ products, isLoading }` |
733
+ | `createUsePrices` | `(productId?)` | `{ prices, isLoading }` |
734
+ | `createUseSubscription` | `(subscriptionId?)` | `{ subscription, isActive, isTrialing, isCanceling, daysUntilRenewal, daysUntilTrialEnd, isLoading }` |
735
+ | `createUseSubscriptions` | `({ userId?, status? }?)` | `{ subscriptions, activeSubscription, isLoading }` |
736
+ | `createUseCheckout` | `(sessionId?)` | `{ session, status, isComplete, isLoading }` |
737
+ | `createUsePaymentMethods` | `(accountId?)` | `{ methods, defaultMethod, isLoading }` |
738
+ | `createUseInvoices` | `({ userId?, subscriptionId?, status? }?)` | `{ invoices, isLoading }` |
739
+ | `createUseAccountOnboarding` | `(accountId?)` | `{ account, status, isReady, missingRequirements, isLoading }` |
740
+ | `createUseEarnings` | `(accountId?)` | `{ gross, reversed, net, payouts, paidOut, transfers, isLoading }` — recipient balance/earnings |
741
+ | `createUseSplitBreakdown` | `({ sourceChargeId?, saleAmount? })` | `{ breakdown: { legs, store, affiliate, other, recipientsTotal, platform? } \| null, isLoading }` — per-sale split |
742
+ | `createUseDisputes` | `({ accountId?, status? }?)` | `{ disputes, isLoading }` |
743
+ | `createUseDisputeWithCountdown` | `(stripeDisputeId?)` | `{ dispute, countdown: { dueBy?, daysRemaining?, isOverdue } \| null, isLoading }` |
726
744
 
727
745
  ### Checkout Session Hooks
728
746
 
@@ -794,14 +812,20 @@ These are re-exported so apps never need to import from `@stripe/react-stripe-js
794
812
 
795
813
  ## React Components
796
814
 
797
- Import from `@fantastic.dev/better-stripe/react`. All components are headless by default -- they provide behavior and minimal structure. Style them with Tailwind or any CSS approach.
815
+ Import from `@fantastic.dev/better-stripe/react`. The package includes the
816
+ example's reusable checkout, payouts, refunds, disputes, accounts, onboarding,
817
+ products, subscriptions, billing, referrals, and admin/setup workflows.
798
818
 
799
- All components accept:
819
+ Use native unstyled markup, render props, or companion hooks with your own
820
+ design system. Bind authenticated server callbacks and query data in your app.
821
+ Supported workflows can select Stripe Connect embedded presentation; checkout
822
+ supports five integrations. No example router, persona provider, or CSS is required.
800
823
 
801
- - `theme?: Stripe.Appearance` -- Stripe Appearance API object for styling
802
- - `className?: string` -- outer wrapper styling
803
- - String props for i18n with English defaults (e.g., `submitLabel?: string`)
804
- - Standard React props (`children`, event handlers)
824
+ See [the React workflow guide](docs/react-workflows.md) for usage, the full
825
+ component/hook matrix, styling, data contracts, and Stripe integration limits.
826
+ Existing low-level components remain available below. Props vary by component;
827
+ Stripe iframe styling uses `appearance`, while custom markup uses render props
828
+ or the low-level component's `className`/label props.
805
829
 
806
830
  ### Provider
807
831
 
@@ -837,8 +861,8 @@ All components accept:
837
861
 
838
862
  ### Buyer Billing
839
863
 
840
- | Component | Description |
841
- | ------------------ | --------------------------------------------------------------------- |
864
+ | Component | Description |
865
+ | ------------------ | ------------------------------------------------------------------------------------------------------- |
842
866
  | `BuyerBillingView` | Per-store buyer billing view: subscriptions grouped by store, reusable saved card, embedded card update |
843
867
 
844
868
  An embedded-only billing surface for buyers: their subscriptions are grouped by
@@ -856,7 +880,9 @@ import {
856
880
  import { groupSubscriptionsByStore } from "@fantastic.dev/better-stripe";
857
881
 
858
882
  function BuyerBilling({ userId, customerAccount }: Props) {
859
- const subscriptions = useQuery(api.stripe.listSubscriptionsByUser, { userId });
883
+ const subscriptions = useQuery(api.stripe.listSubscriptionsByUser, {
884
+ userId,
885
+ });
860
886
  const { defaultMethod } = usePaymentMethods(customerAccount);
861
887
  const cancel = useMutation(api.stripe.cancelSubscription);
862
888
  const reactivate = useMutation(api.stripe.reactivateSubscription);
@@ -864,7 +890,10 @@ function BuyerBilling({ userId, customerAccount }: Props) {
864
890
  return (
865
891
  <BuyerBillingView
866
892
  // groupSubscriptionsByStore reused, not recomputed
867
- subscriptions={subscriptions?.map((s) => ({ ...s, id: s.stripeSubscriptionId }))}
893
+ subscriptions={subscriptions?.map((s) => ({
894
+ ...s,
895
+ id: s.stripeSubscriptionId,
896
+ }))}
868
897
  paymentMethod={defaultMethod}
869
898
  isLoading={subscriptions === undefined}
870
899
  onCancel={(sub) => cancel({ stripeSubscriptionId: sub.id })}
@@ -896,21 +925,21 @@ function BuyerBilling({ userId, customerAccount }: Props) {
896
925
 
897
926
  ### Payouts and Earnings
898
927
 
899
- | Component | Description |
900
- | ------------------- | ---------------------------------------------------------------------------------------------------------------- |
901
- | `PayoutSchedule` | Recipient balance + next-payout display, fed by a `balance` snapshot and `listPayouts` rows. Payouts are automatic/rolling — no manual-withdrawal action is offered. |
902
- | `EarningsSummary` | Gross / reversals & adjustments / net + latest payout, fed by `useEarnings(accountId)`. Reversals cover both deferred fee collection and refund/dispute clawbacks — not a pure fees figure, hence the "Reversals & adjustments" label rather than "Fees". |
903
- | `SplitBreakdown` | Per-sale store / affiliate / other / platform split lines, fed by `useSplitBreakdown`. The platform line reads "unknown" (not $0) when the hook wasn't given the sale amount. |
928
+ | Component | Description |
929
+ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
930
+ | `PayoutSchedule` | Recipient balance + next-payout display, fed by a `balance` snapshot and `listPayouts` rows. Payouts are automatic/rolling — no manual-withdrawal action is offered. |
931
+ | `EarningsSummary` | Gross / reversals & adjustments / net + latest payout, fed by `useEarnings(accountId)`. Reversals cover both deferred fee collection and refund/dispute clawbacks — not a pure fees figure, hence the "Reversals & adjustments" label rather than "Fees". |
932
+ | `SplitBreakdown` | Per-sale store / affiliate / other / platform split lines, fed by `useSplitBreakdown`. The platform line reads "unknown" (not $0) when the hook wasn't given the sale amount. |
904
933
 
905
934
  ### Disputes (headless)
906
935
 
907
936
  The app-owned alternative to [Embedded Disputes](#embedded-disputes-stripe-connect) below — build a custom dispute UI on the read hooks and these components instead of Stripe's hosted ConnectJS components.
908
937
 
909
- | Component | Description |
910
- | ----------------- | ------------------------------------------------------------------------------------------------------------------ |
911
- | `DisputesList` | Sorted-by-deadline dispute list (soonest evidence due-by first, no-deadline last), fed by `useDisputes` |
912
- | `DisputeDetail` | Amount, reason, status, evidence-due countdown, and linked transfers for one dispute, fed by `useDisputeWithCountdown` |
913
- | `EvidenceForm` | Plain-language evidence form (product description, access activity, additional info, customer communication) that maps through `buildDisputeEvidence` before calling an app-wired `onUpdateDispute`; `stage()` saves a draft, `submit()` finalizes |
938
+ | Component | Description |
939
+ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
940
+ | `DisputesList` | Sorted-by-deadline dispute list (soonest evidence due-by first, no-deadline last), fed by `useDisputes` |
941
+ | `DisputeDetail` | Amount, reason, status, evidence-due countdown, and linked transfers for one dispute, fed by `useDisputeWithCountdown` |
942
+ | `EvidenceForm` | Plain-language evidence form (product description, access activity, additional info, customer communication) that maps through `buildDisputeEvidence` before calling an app-wired `onUpdateDispute`; `stage()` saves a draft, `submit()` finalizes |
914
943
 
915
944
  ### Embedded Disputes (Stripe Connect)
916
945
 
@@ -919,8 +948,8 @@ views and responds to their own disputes via Stripe's embedded `disputes_list`
919
948
  / `payment_disputes` components, driven by the Account Session that
920
949
  `createDisputeSession` creates.
921
950
 
922
- | Component | Description |
923
- | ------------------ | ---------------------------------------------------------------------------------------------- |
951
+ | Component | Description |
952
+ | ------------------ | ----------------------------------------------------------------------------------------------- |
924
953
  | `ConnectProvider` | Initializes ConnectJS with your publishable key + an account-session fetcher |
925
954
  | `EmbeddedDisputes` | Mounts the embedded `disputes_list` (or `payment_disputes` when scoped via `payment`) component |
926
955
 
@@ -934,7 +963,10 @@ export const createDisputeSession = action({
934
963
  });
935
964
 
936
965
  // Seller disputes page (client side)
937
- import { ConnectProvider, EmbeddedDisputes } from "@fantastic.dev/better-stripe/react";
966
+ import {
967
+ ConnectProvider,
968
+ EmbeddedDisputes,
969
+ } from "@fantastic.dev/better-stripe/react";
938
970
 
939
971
  function SellerDisputes({ stripeAccountId }: { stripeAccountId: string }) {
940
972
  const createSession = useAction(api.stripe.createDisputeSession);
@@ -1106,8 +1138,8 @@ Async hook (scheduled action) --> App calls external APIs
1106
1138
 
1107
1139
  ### Package Entry Points
1108
1140
 
1109
- | Entry Point | Contents |
1110
- | -------------------------------------- | -------------------------------------------------------- |
1141
+ | Entry Point | Contents |
1142
+ | -------------------------------------------- | -------------------------------------------------------- |
1111
1143
  | `@fantastic.dev/better-stripe` | `BetterStripe` class, `registerRoutes`, TypeScript types |
1112
1144
  | `@fantastic.dev/better-stripe/react` | React hooks, headless UI components, formatting helpers |
1113
1145
  | `@fantastic.dev/better-stripe/testing` | Test fixtures, mock webhooks, `assertTestEnvironment` |
@@ -7,7 +7,7 @@ export declare function createCheckoutSession(stripe: Stripe, component: Compone
7
7
  orgId?: string;
8
8
  stripePriceId: string;
9
9
  mode: "payment" | "subscription" | "setup";
10
- uiMode?: "embedded" | "redirect";
10
+ uiMode?: "embedded" | "redirect" | "custom" | "form";
11
11
  quantity?: number;
12
12
  returnUrl: string;
13
13
  trialDays?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/client/billing/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAgGrB,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IACJ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,OAAO,CAAC;IAC3C,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;I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E;IACJ,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,OAAO,CAAC;IAC3C,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,iBAQF;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;IACJ,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,qDAMF"}
@@ -198,8 +198,13 @@ export async function createCheckoutSession(stripe, component, ctx, opts) {
198
198
  }
199
199
  sessionParams.payment_intent_data = paymentIntentData;
200
200
  }
201
- if (uiMode === "embedded") {
202
- sessionParams.ui_mode = "embedded_page";
201
+ if (uiMode === "embedded" || uiMode === "custom" || uiMode === "form") {
202
+ sessionParams.ui_mode =
203
+ uiMode === "custom"
204
+ ? "elements"
205
+ : uiMode === "form"
206
+ ? "form"
207
+ : "embedded_page";
203
208
  sessionParams.return_url = opts.returnUrl;
204
209
  }
205
210
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/client/billing/checkout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,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AAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -95,7 +95,7 @@ export declare function buildDisputeEvidence(input: {
95
95
  accessActivity?: string;
96
96
  /** Off-platform context / anything else (Stripe: uncategorized_text). */
97
97
  additionalInfo?: string;
98
- /** Communications with the buyer (Stripe: customer_communication). */
98
+ /** Communication prose is appended to text evidence; file_ IDs remain file evidence. */
99
99
  customerCommunication?: string;
100
100
  }): import("stripe").Stripe.DisputeUpdateParams.Evidence;
101
101
  /**