@volter/twin-stripe 2.0.38 → 3.0.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 (402) hide show
  1. package/README.md +112 -207
  2. package/dist/generated/pack-facts.json +94 -0
  3. package/dist/journeys/coverage.json +596 -0
  4. package/dist/journeys/customer-life.json +6108 -0
  5. package/dist/journeys/customer-life.outline.md +371 -0
  6. package/dist/journeys/decisions.json +677 -0
  7. package/dist/journeys/demand.json +706 -0
  8. package/dist/journeys/score.json +853 -0
  9. package/dist/journeys/unreachable.json +102 -0
  10. package/dist/journeys/vendor-examples.json +8010 -0
  11. package/dist/spec/SOURCE.md +18 -0
  12. package/dist/spec/doc-examples.json +445 -0
  13. package/dist/spec/fixtures3.json.gz +0 -0
  14. package/dist/spec/openapi.json.gz +0 -0
  15. package/dist/spec/patches.json +34 -0
  16. package/dist/spec/sources.json +306 -0
  17. package/dist/src/cli.d.ts +0 -1
  18. package/dist/src/cli.js +11 -31
  19. package/dist/src/engine/after-payment.d.ts +8 -0
  20. package/dist/src/engine/after-payment.js +27 -0
  21. package/dist/src/engine/apps-secrets.d.ts +1 -0
  22. package/dist/src/engine/apps-secrets.js +3 -0
  23. package/dist/src/engine/balance.d.ts +5 -0
  24. package/dist/src/engine/balance.js +15 -0
  25. package/dist/src/engine/checkout.d.ts +24 -0
  26. package/dist/src/engine/checkout.js +30 -0
  27. package/dist/src/engine/common.d.ts +19 -0
  28. package/dist/src/engine/common.js +34 -0
  29. package/dist/src/engine/connect.d.ts +45 -0
  30. package/dist/src/engine/connect.js +108 -0
  31. package/dist/src/engine/customers.d.ts +4 -0
  32. package/dist/src/engine/customers.js +8 -0
  33. package/dist/src/engine/display.d.ts +11 -0
  34. package/dist/src/engine/display.js +13 -0
  35. package/dist/src/engine/files.d.ts +11 -0
  36. package/dist/src/engine/files.js +23 -0
  37. package/dist/src/engine/invoices.d.ts +21 -0
  38. package/dist/src/engine/invoices.js +84 -0
  39. package/dist/src/engine/issuing.d.ts +33 -0
  40. package/dist/src/engine/issuing.js +54 -0
  41. package/dist/src/engine/ledger.d.ts +8 -0
  42. package/dist/src/engine/ledger.js +8 -0
  43. package/dist/src/engine/oauth.d.ts +4 -0
  44. package/dist/src/engine/oauth.js +24 -0
  45. package/dist/src/engine/onboarding.d.ts +13 -0
  46. package/dist/src/engine/onboarding.js +42 -0
  47. package/dist/src/{stripe-params.d.ts → engine/params.d.ts} +20 -3
  48. package/dist/src/{stripe-params.js → engine/params.js} +7 -60
  49. package/dist/src/engine/payment-intents.d.ts +10 -0
  50. package/dist/src/engine/payment-intents.js +27 -0
  51. package/dist/src/engine/payment-methods.d.ts +16 -0
  52. package/dist/src/engine/payment-methods.js +22 -0
  53. package/dist/src/engine/radar.d.ts +2 -0
  54. package/dist/src/engine/radar.js +5 -0
  55. package/dist/src/engine/refunds.d.ts +1 -0
  56. package/dist/src/engine/refunds.js +3 -0
  57. package/dist/src/engine/renewals.d.ts +36 -0
  58. package/dist/src/engine/renewals.js +65 -0
  59. package/dist/src/{stripe-twin.d.ts → engine/stripe.d.ts} +12 -45
  60. package/dist/src/{stripe-twin.js → engine/stripe.js} +53 -387
  61. package/dist/src/engine/subscriptions.d.ts +11 -0
  62. package/dist/src/engine/subscriptions.js +30 -0
  63. package/dist/src/engine/transfers.d.ts +2 -0
  64. package/dist/src/engine/transfers.js +1 -0
  65. package/dist/src/{stripe-version.d.ts → engine/version.d.ts} +0 -2
  66. package/dist/src/{stripe-version.js → engine/version.js} +21 -9
  67. package/dist/src/engine/webhook-endpoints.d.ts +1 -0
  68. package/dist/src/engine/webhook-endpoints.js +12 -0
  69. package/dist/src/engine/webhooks.d.ts +31 -0
  70. package/dist/src/engine/webhooks.js +68 -0
  71. package/dist/src/fetch.d.ts +2 -0
  72. package/dist/src/fetch.js +26 -0
  73. package/dist/src/generated/surface.gen.json +1 -1
  74. package/dist/src/generated/ui.gen.json +1 -1
  75. package/dist/src/index.d.ts +5 -14
  76. package/dist/src/index.js +10 -75
  77. package/dist/src/manifest.js +478 -876
  78. package/dist/src/screens/billing-portal.d.ts +3 -0
  79. package/dist/src/screens/{portal.js → billing-portal.js} +32 -58
  80. package/dist/src/screens/checkout-js.d.ts +2 -0
  81. package/dist/src/screens/checkout-js.js +84 -0
  82. package/dist/src/screens/checkout.d.ts +2 -31
  83. package/dist/src/screens/checkout.js +32 -121
  84. package/dist/src/screens/connect-onboarding.d.ts +3 -0
  85. package/dist/src/screens/{onboarding.js → connect-onboarding.js} +38 -104
  86. package/dist/src/screens/dashboard.d.ts +3 -0
  87. package/dist/src/screens/dashboard.js +116 -0
  88. package/dist/src/screens/shared.d.ts +27 -0
  89. package/dist/src/screens/shared.js +87 -0
  90. package/dist/src/screens/stripe-js.d.ts +3 -0
  91. package/dist/src/screens/stripe-js.js +95 -0
  92. package/dist/src/semantics/account.d.ts +2 -0
  93. package/dist/src/semantics/account.js +8 -0
  94. package/dist/src/semantics/account_links.d.ts +2 -0
  95. package/dist/src/semantics/account_links.js +22 -0
  96. package/dist/src/semantics/accounts.d.ts +4 -0
  97. package/dist/src/semantics/accounts.js +40 -0
  98. package/dist/src/semantics/apps.d.ts +4 -0
  99. package/dist/src/semantics/{apps-secrets.js → apps.js} +14 -26
  100. package/dist/src/semantics/around.d.ts +2 -0
  101. package/dist/src/semantics/around.js +13 -0
  102. package/dist/src/semantics/balance.d.ts +2 -11
  103. package/dist/src/semantics/balance.js +3 -194
  104. package/dist/src/semantics/balance_transactions.d.ts +2 -0
  105. package/dist/src/semantics/balance_transactions.js +15 -0
  106. package/dist/src/semantics/billing_portal.d.ts +4 -0
  107. package/dist/src/semantics/billing_portal.js +36 -0
  108. package/dist/src/semantics/charges.d.ts +3 -28
  109. package/dist/src/semantics/charges.js +5 -202
  110. package/dist/src/semantics/checkout.d.ts +3 -20
  111. package/dist/src/semantics/checkout.js +21 -271
  112. package/dist/src/semantics/clock.d.ts +2 -0
  113. package/dist/src/semantics/clock.js +15 -0
  114. package/dist/src/semantics/coupons.d.ts +2 -6
  115. package/dist/src/semantics/coupons.js +2 -60
  116. package/dist/src/semantics/customers.d.ts +5 -6
  117. package/dist/src/semantics/customers.js +47 -413
  118. package/dist/src/semantics/doors.d.ts +23 -0
  119. package/dist/src/semantics/doors.js +73 -0
  120. package/dist/src/semantics/entitlements.d.ts +0 -2
  121. package/dist/src/semantics/entitlements.js +4 -95
  122. package/dist/src/semantics/events.d.ts +11 -0
  123. package/dist/src/semantics/events.js +31 -0
  124. package/dist/src/semantics/index.d.ts +2 -0
  125. package/dist/src/semantics/index.js +85 -0
  126. package/dist/src/semantics/invoice_payments.d.ts +2 -0
  127. package/dist/src/semantics/invoice_payments.js +12 -0
  128. package/dist/src/semantics/invoices.d.ts +11 -18
  129. package/dist/src/semantics/invoices.js +121 -440
  130. package/dist/src/semantics/issuing.d.ts +6 -13
  131. package/dist/src/semantics/issuing.js +58 -556
  132. package/dist/src/semantics/payment_intents.d.ts +3 -0
  133. package/dist/src/semantics/payment_intents.js +71 -0
  134. package/dist/src/semantics/payment_methods.d.ts +3 -0
  135. package/dist/src/semantics/payment_methods.js +15 -0
  136. package/dist/src/semantics/payouts.d.ts +3 -0
  137. package/dist/src/semantics/payouts.js +28 -0
  138. package/dist/src/semantics/prices.d.ts +4 -0
  139. package/dist/src/semantics/prices.js +37 -0
  140. package/dist/src/semantics/products.d.ts +4 -2
  141. package/dist/src/semantics/products.js +12 -138
  142. package/dist/src/semantics/promotion_codes.d.ts +3 -0
  143. package/dist/src/semantics/promotion_codes.js +35 -0
  144. package/dist/src/semantics/radar.d.ts +2 -2
  145. package/dist/src/semantics/radar.js +5 -74
  146. package/dist/src/semantics/refunds.d.ts +2 -9
  147. package/dist/src/semantics/refunds.js +3 -193
  148. package/dist/src/semantics/shared.d.ts +558 -55
  149. package/dist/src/semantics/shared.js +2070 -114
  150. package/dist/src/semantics/states.d.ts +462 -0
  151. package/dist/src/semantics/states.js +634 -0
  152. package/dist/src/semantics/subscriptions.d.ts +6 -11
  153. package/dist/src/semantics/subscriptions.js +37 -530
  154. package/dist/src/semantics/test_helpers.d.ts +3 -0
  155. package/dist/src/semantics/test_helpers.js +125 -0
  156. package/dist/src/semantics/transfers.d.ts +2 -2
  157. package/dist/src/semantics/transfers.js +6 -101
  158. package/dist/src/semantics/webhook_endpoints.d.ts +2 -0
  159. package/dist/src/semantics/webhook_endpoints.js +26 -0
  160. package/dist/src/server.d.ts +7 -0
  161. package/dist/src/server.js +7 -0
  162. package/generated/pack-facts.json +94 -0
  163. package/journeys/coverage.json +596 -0
  164. package/journeys/customer-life.json +6108 -0
  165. package/journeys/customer-life.outline.md +371 -0
  166. package/journeys/decisions.json +677 -0
  167. package/journeys/demand.json +706 -0
  168. package/journeys/score.json +853 -0
  169. package/journeys/unreachable.json +102 -0
  170. package/journeys/vendor-examples.json +8010 -0
  171. package/package.json +11 -20
  172. package/spec/SOURCE.md +18 -0
  173. package/spec/doc-examples.json +445 -0
  174. package/spec/fixtures3.json.gz +0 -0
  175. package/spec/openapi.json.gz +0 -0
  176. package/spec/patches.json +34 -0
  177. package/spec/sources.json +306 -0
  178. package/src/cli.ts +11 -28
  179. package/src/engine/after-payment.ts +29 -0
  180. package/src/engine/apps-secrets.ts +4 -0
  181. package/src/engine/balance.ts +32 -0
  182. package/src/engine/checkout.ts +39 -0
  183. package/src/engine/common.ts +49 -0
  184. package/src/engine/connect.ts +106 -0
  185. package/src/engine/customers.ts +10 -0
  186. package/src/engine/display.ts +18 -0
  187. package/src/engine/files.ts +28 -0
  188. package/src/engine/invoices.ts +102 -0
  189. package/src/engine/issuing.ts +66 -0
  190. package/src/engine/ledger.ts +48 -0
  191. package/src/engine/oauth.ts +18 -0
  192. package/src/engine/onboarding.ts +53 -0
  193. package/src/{stripe-params.ts → engine/params.ts} +7 -56
  194. package/src/engine/payment-intents.ts +32 -0
  195. package/src/engine/payment-methods.ts +24 -0
  196. package/src/engine/radar.ts +6 -0
  197. package/src/engine/refunds.ts +3 -0
  198. package/src/engine/renewals.ts +72 -0
  199. package/src/{stripe-twin.ts → engine/stripe.ts} +57 -400
  200. package/src/engine/subscriptions.ts +37 -0
  201. package/src/engine/transfers.ts +22 -0
  202. package/src/{stripe-version.ts → engine/version.ts} +19 -10
  203. package/src/engine/webhook-endpoints.ts +14 -0
  204. package/src/engine/webhooks.ts +70 -0
  205. package/src/fetch.ts +27 -0
  206. package/src/generated/surface.gen.json +1 -1
  207. package/src/generated/ui.gen.json +1 -1
  208. package/src/index.ts +10 -116
  209. package/src/manifest.ts +480 -904
  210. package/src/screens/{portal.tsx → billing-portal.tsx} +35 -42
  211. package/src/screens/checkout-js.ts +80 -0
  212. package/src/screens/checkout.tsx +32 -96
  213. package/src/screens/{onboarding.tsx → connect-onboarding.tsx} +39 -85
  214. package/src/screens/dashboard.tsx +178 -0
  215. package/src/screens/shared.tsx +84 -0
  216. package/src/screens/stripe-js.ts +102 -0
  217. package/src/semantics/account.ts +10 -0
  218. package/src/semantics/account_links.ts +20 -0
  219. package/src/semantics/accounts.ts +44 -0
  220. package/src/semantics/{apps-secrets.ts → apps.ts} +17 -33
  221. package/src/semantics/around.ts +17 -0
  222. package/src/semantics/balance.ts +6 -208
  223. package/src/semantics/balance_transactions.ts +18 -0
  224. package/src/semantics/billing_portal.ts +45 -0
  225. package/src/semantics/charges.ts +8 -212
  226. package/src/semantics/checkout.ts +25 -276
  227. package/src/semantics/clock.ts +19 -0
  228. package/src/semantics/coupons.ts +5 -68
  229. package/src/semantics/customers.ts +48 -414
  230. package/src/semantics/doors.ts +79 -0
  231. package/src/semantics/entitlements.ts +3 -94
  232. package/src/semantics/events.ts +37 -0
  233. package/src/semantics/index.ts +89 -0
  234. package/src/semantics/invoice_payments.ts +16 -0
  235. package/src/semantics/invoices.ts +112 -441
  236. package/src/semantics/issuing.ts +57 -573
  237. package/src/semantics/payment_intents.ts +76 -0
  238. package/src/semantics/payment_methods.ts +20 -0
  239. package/src/semantics/payouts.ts +29 -0
  240. package/src/semantics/prices.ts +41 -0
  241. package/src/semantics/products.ts +12 -146
  242. package/src/semantics/promotion_codes.ts +38 -0
  243. package/src/semantics/radar.ts +8 -79
  244. package/src/semantics/refunds.ts +4 -216
  245. package/src/semantics/shared.ts +2089 -135
  246. package/src/semantics/states.ts +662 -0
  247. package/src/semantics/subscriptions.ts +39 -542
  248. package/src/semantics/test_helpers.ts +119 -0
  249. package/src/semantics/transfers.ts +10 -132
  250. package/src/semantics/webhook_endpoints.ts +27 -0
  251. package/src/server.ts +7 -0
  252. package/client/dashboard-api.ts +0 -286
  253. package/client/stripe-mirror.css +0 -277
  254. package/client/stripe-mirror.tsx +0 -1559
  255. package/dist/client/dashboard-api.d.ts +0 -107
  256. package/dist/client/dashboard-api.js +0 -238
  257. package/dist/client/dashboard-api.ts +0 -286
  258. package/dist/client/stripe-mirror.bundle.js +0 -236
  259. package/dist/client/stripe-mirror.css +0 -277
  260. package/dist/client/stripe-mirror.d.ts +0 -134
  261. package/dist/client/stripe-mirror.js +0 -859
  262. package/dist/client/stripe-mirror.tsx +0 -1559
  263. package/dist/src/screens/connect-oauth.d.ts +0 -27
  264. package/dist/src/screens/connect-oauth.js +0 -414
  265. package/dist/src/screens/connect-settings.d.ts +0 -22
  266. package/dist/src/screens/connect-settings.js +0 -103
  267. package/dist/src/screens/consent-skin.d.ts +0 -4
  268. package/dist/src/screens/consent-skin.js +0 -18
  269. package/dist/src/screens/financial-connections.d.ts +0 -5
  270. package/dist/src/screens/financial-connections.js +0 -90
  271. package/dist/src/screens/identity.d.ts +0 -5
  272. package/dist/src/screens/identity.js +0 -86
  273. package/dist/src/screens/onboarding.d.ts +0 -13
  274. package/dist/src/screens/portal.d.ts +0 -5
  275. package/dist/src/screens/public-details.d.ts +0 -5
  276. package/dist/src/screens/public-details.js +0 -90
  277. package/dist/src/semantics/after-payment.d.ts +0 -22
  278. package/dist/src/semantics/after-payment.js +0 -99
  279. package/dist/src/semantics/apps-secrets.d.ts +0 -2
  280. package/dist/src/semantics/billing.d.ts +0 -2
  281. package/dist/src/semantics/billing.js +0 -220
  282. package/dist/src/semantics/connect.d.ts +0 -5
  283. package/dist/src/semantics/connect.js +0 -493
  284. package/dist/src/semantics/credit-notes.d.ts +0 -2
  285. package/dist/src/semantics/credit-notes.js +0 -172
  286. package/dist/src/semantics/disputes.d.ts +0 -2
  287. package/dist/src/semantics/disputes.js +0 -51
  288. package/dist/src/semantics/ephemeral-keys.d.ts +0 -2
  289. package/dist/src/semantics/ephemeral-keys.js +0 -34
  290. package/dist/src/semantics/files.d.ts +0 -2
  291. package/dist/src/semantics/files.js +0 -125
  292. package/dist/src/semantics/ledger.d.ts +0 -59
  293. package/dist/src/semantics/ledger.js +0 -200
  294. package/dist/src/semantics/payment-intents.d.ts +0 -18
  295. package/dist/src/semantics/payment-intents.js +0 -452
  296. package/dist/src/semantics/payment-links.d.ts +0 -2
  297. package/dist/src/semantics/payment-links.js +0 -133
  298. package/dist/src/semantics/payment-methods.d.ts +0 -20
  299. package/dist/src/semantics/payment-methods.js +0 -140
  300. package/dist/src/semantics/plans.d.ts +0 -5
  301. package/dist/src/semantics/plans.js +0 -121
  302. package/dist/src/semantics/platform.d.ts +0 -9
  303. package/dist/src/semantics/platform.js +0 -206
  304. package/dist/src/semantics/renewals.d.ts +0 -47
  305. package/dist/src/semantics/renewals.js +0 -281
  306. package/dist/src/semantics/setup-intents.d.ts +0 -2
  307. package/dist/src/semantics/setup-intents.js +0 -84
  308. package/dist/src/semantics/subscription-schedules.d.ts +0 -2
  309. package/dist/src/semantics/subscription-schedules.js +0 -119
  310. package/dist/src/semantics/tax.d.ts +0 -2
  311. package/dist/src/semantics/tax.js +0 -197
  312. package/dist/src/semantics/terminal.d.ts +0 -5
  313. package/dist/src/semantics/terminal.js +0 -182
  314. package/dist/src/semantics/test-clocks.d.ts +0 -6
  315. package/dist/src/semantics/test-clocks.js +0 -73
  316. package/dist/src/semantics/tokens.d.ts +0 -4
  317. package/dist/src/semantics/tokens.js +0 -44
  318. package/dist/src/semantics/treasury.d.ts +0 -2
  319. package/dist/src/semantics/treasury.js +0 -377
  320. package/dist/src/semantics/webhook-endpoints.d.ts +0 -3
  321. package/dist/src/semantics/webhook-endpoints.js +0 -85
  322. package/dist/src/stripe-budget.d.ts +0 -55
  323. package/dist/src/stripe-budget.js +0 -155
  324. package/dist/src/stripe-capabilities.d.ts +0 -3
  325. package/dist/src/stripe-capabilities.js +0 -5836
  326. package/dist/src/stripe-conformance.d.ts +0 -43
  327. package/dist/src/stripe-conformance.js +0 -105
  328. package/dist/src/stripe-connector.d.ts +0 -161
  329. package/dist/src/stripe-connector.js +0 -414
  330. package/dist/src/stripe-emit.d.ts +0 -2
  331. package/dist/src/stripe-emit.js +0 -145
  332. package/dist/src/stripe-events.d.ts +0 -93
  333. package/dist/src/stripe-events.js +0 -392
  334. package/dist/src/stripe-js.d.ts +0 -4
  335. package/dist/src/stripe-js.js +0 -70
  336. package/dist/src/stripe-mirror-ui.d.ts +0 -15
  337. package/dist/src/stripe-mirror-ui.js +0 -87
  338. package/dist/src/stripe-perform-harness.d.ts +0 -9
  339. package/dist/src/stripe-perform-harness.js +0 -26
  340. package/dist/src/stripe-server.d.ts +0 -33
  341. package/dist/src/stripe-server.js +0 -429
  342. package/dist/src/stripe-shared.d.ts +0 -109
  343. package/dist/src/stripe-shared.js +0 -276
  344. package/dist/src/stripe-ui-conformance.d.ts +0 -5
  345. package/dist/src/stripe-ui-conformance.js +0 -79
  346. package/dist/src/stripe-ui-structure.d.ts +0 -3
  347. package/dist/src/stripe-ui-structure.js +0 -168
  348. package/dist/test-fixtures/stripe-known-deviations.json +0 -110
  349. package/dist/test-fixtures/stripe-openapi-operations.SOURCE.md +0 -14
  350. package/dist/test-fixtures/stripe-openapi-operations.json +0 -4717
  351. package/dist/test-fixtures/stripe-schemas.SOURCE.md +0 -35
  352. package/dist/test-fixtures/stripe-schemas.json +0 -3813
  353. package/src/screens/connect-oauth.tsx +0 -400
  354. package/src/screens/connect-settings.tsx +0 -121
  355. package/src/screens/consent-skin.ts +0 -20
  356. package/src/screens/financial-connections.tsx +0 -101
  357. package/src/screens/identity.tsx +0 -96
  358. package/src/screens/public-details.tsx +0 -105
  359. package/src/semantics/after-payment.ts +0 -118
  360. package/src/semantics/billing.ts +0 -216
  361. package/src/semantics/connect.ts +0 -487
  362. package/src/semantics/credit-notes.ts +0 -168
  363. package/src/semantics/disputes.ts +0 -62
  364. package/src/semantics/ephemeral-keys.ts +0 -34
  365. package/src/semantics/files.ts +0 -143
  366. package/src/semantics/ledger.ts +0 -253
  367. package/src/semantics/payment-intents.ts +0 -463
  368. package/src/semantics/payment-links.ts +0 -148
  369. package/src/semantics/payment-methods.ts +0 -145
  370. package/src/semantics/plans.ts +0 -131
  371. package/src/semantics/platform.ts +0 -220
  372. package/src/semantics/renewals.ts +0 -279
  373. package/src/semantics/setup-intents.ts +0 -87
  374. package/src/semantics/subscription-schedules.ts +0 -129
  375. package/src/semantics/tax.ts +0 -220
  376. package/src/semantics/terminal.ts +0 -195
  377. package/src/semantics/test-clocks.ts +0 -77
  378. package/src/semantics/tokens.ts +0 -52
  379. package/src/semantics/treasury.ts +0 -383
  380. package/src/semantics/webhook-endpoints.ts +0 -87
  381. package/src/stripe-budget.ts +0 -181
  382. package/src/stripe-capabilities.ts +0 -5651
  383. package/src/stripe-conformance.ts +0 -124
  384. package/src/stripe-connector.ts +0 -462
  385. package/src/stripe-emit.ts +0 -157
  386. package/src/stripe-events.ts +0 -434
  387. package/src/stripe-js.ts +0 -70
  388. package/src/stripe-mirror-ui.ts +0 -90
  389. package/src/stripe-perform-harness.ts +0 -29
  390. package/src/stripe-server.ts +0 -393
  391. package/src/stripe-shared.ts +0 -297
  392. package/src/stripe-ui-conformance.ts +0 -88
  393. package/src/stripe-ui-structure.ts +0 -182
  394. package/test-fixtures/stripe-known-deviations.json +0 -110
  395. package/test-fixtures/stripe-openapi-operations.json +0 -4717
  396. package/test-fixtures/stripe-schemas.json +0 -3813
  397. /package/dist/src/{screens → engine}/industries.d.ts +0 -0
  398. /package/dist/src/{screens → engine}/industries.js +0 -0
  399. /package/dist/src/{semantics → engine}/test-cards.d.ts +0 -0
  400. /package/dist/src/{semantics → engine}/test-cards.js +0 -0
  401. /package/src/{screens → engine}/industries.ts +0 -0
  402. /package/src/{semantics → engine}/test-cards.ts +0 -0
package/README.md CHANGED
@@ -1,213 +1,118 @@
1
1
  # @volter/twin-stripe
2
2
 
3
- The **Stripe twin** — a local, spec-correct replica of the Stripe REST API on the
4
- shared [`@volter/world-core`](../../world-core) kernel. The real `stripe` SDK works against it
5
- unmodified; it's the QA stack's authoritative local Stripe (it replaced the old
6
- hand-made in-process mock).
7
-
8
- ## Surface
9
-
10
- - **REST API** (`stripe-twin.ts` → `handleStripeTwinRequest`; HTTP wrapper
11
- `stripe-server.ts` → `createStripeTwinServer`): charges, customers,
12
- payment_intents, setup_intents, payment_methods, products, prices, invoices,
13
- invoiceitems, subscriptions, refunds, coupons, promotion_codes, identity
14
- verification sessions, ephemeral_keys, checkout sessions, billing/customer-portal
15
- sessions + configurations, and the legacy **Plans** API (`semantics/plans.ts`: a plan is the recurring
16
- price it is; plan writes send `plan.created`/`plan.updated`/`plan.deleted`; a deleted plan's price stays
17
- readable, inactive, for its existing subscribers).
18
- - **Hosted pages** (`src/screens/`): Stripe's own pages an application sends a person to, served at their
19
- vendor urls — Checkout's payment page (`checkout.stripe.com/c/pay/{id}`: the customer pays, the session
20
- completes and `checkout.session.completed` fires), the Customer Portal (`billing.stripe.com/p/session/{id}`),
21
- Connect hosted onboarding (`connect.stripe.com/setup/…`), Identity (`verify.stripe.com/start/{id}`) and the
22
- Financial Connections bank-linking flow Stripe.js opens.
23
- - **Stripe.js** (`stripe-js.ts`): `js.stripe.com` serves the client library at `/v3`, `/v3/`, `/v3/stripe.js` and
24
- `/<release train>/stripe.js` — the paths the `@stripe/stripe-js` loader loads or accepts — with
25
- `redirectToCheckout({ sessionId })` sending the page to the hosted Checkout page; any other member throws,
26
- naming itself (`stripe.js.loader`).
27
- - **Writes** are local transactions (action log); reads are the projection (R3/R5/R18).
28
- - **Card declines** (`stripe-twin.ts`): Stripe's documented test cards get vendor-faithful
29
- outcomes on charge create / PaymentIntent confirm — `4242…4242` (and `pm_card_visa`/`tok_visa`)
30
- succeed; `4000…0002`, `4000…9995`, `4000…0069`, `4000…0127`, `4000…0119` (and the matching
31
- `pm_card_*`/`tok_*` tokens) return the real `card_error` envelope (HTTP 402) and leave a
32
- confirmed PaymentIntent at `requires_payment_method`. Unknown cards succeed. See
33
- `_card.declines-test-set-only` in `stripe-known-deviations.json`.
34
- - **Manual capture** (`semantics/payment-intents.ts`, `semantics/charges.ts`): confirming a `capture_method=manual`
35
- intent authorizes an uncaptured charge (`captured: false`, nothing on the balance); capture takes that charge
36
- (`charge.captured`; a partial capture releases the rest with no Refund, Stripe's basil change), and an incremental
37
- authorization grows its amount. An uncaptured charge is never refunded out of the balance: cancelling a
38
- `requires_capture` intent releases the authorization (no Refund; `amount_captured` 0, `refunded` false) and its
39
- charge's capture is then refused with `payment_intent_unexpected_state`, a refund of a PaymentIntent's uncaptured
40
- charge is refused (cancel the intent, as Stripe's refunds guide says), and a `capture=false` charge's refund releases
41
- it, after which its capture is refused with `charge_already_refunded`. An uncaptured charge is refused as a transfer's
42
- `source_transaction` (the twin's rule; the docs are silent).
43
- - **Idempotency keys**: the `Idempotency-Key` header is honored on POST — a replay with the
44
- same key returns the stored response without re-applying the write (`_idempotency.stored-per-root`).
45
- - **Events** (`stripe-events.ts`): fires Stripe `event` objects on write
46
- (`payment_intent.succeeded`, `customer.subscription.created`, `invoice.paid`, …). A charge fires the event
47
- Stripe sends for it — `charge.succeeded` (made, or authorized under manual capture), `charge.failed` (a declined
48
- attempt), `charge.captured` (an authorization captured) — never an invented `charge.created`.
49
- - **Connect webhooks**: an event of a connected account (a write made with its `Stripe-Account` header, its own
50
- `account.updated`, or a row kept on its books such as the automatic payout time makes for it) carries the
51
- top-level `account` and reaches only endpoints created with `connect=true`; the platform's reach only the others
52
- (`stripe.connect.webhook_scope`, `stripe.connect.event_scope`). `GET /v1/events` and `/v1/events/{id}` answer the
53
- acting account's events: with the header that account's, without it the platform's. An event's id is minted once
54
- per World (`evt_twin_<n>`) and is the delivered webhook's id and the stored event's alike (`stripe.events.ids`).
55
- `world-stripe emit` re-fires a connected account's object with its `account`; it does not yet route it to Connect
56
- endpoints only (the kernel's emit seam has no endpoint scope).
57
- - **Connect OAuth (Standard accounts)** (`src/screens/connect-oauth.tsx`, `src/screens/connect-settings.tsx`;
58
- docs.stripe.com/connect/oauth-reference). The platform's **client_id is `ca_twin_self`** in every World (a test
59
- client_id; the platform account is `acct_twin_self`), shown on the Dashboard's Connect OAuth settings page,
60
- `dashboard.stripe.com/settings/connect/onboarding-options/oauth` (also `/settings/connect` and the `/test/…` link),
61
- in `<code data-testid="connect-client-id">`. OAuth starts **off**: a runner POSTs that page as a browser does,
62
- `oauth_enabled=on&redirect_uris=<one per line>` (303 to `?saved=1`), and the saved URIs are listed in
63
- `data-testid="connect-redirect-uri"` items. `GET connect.stripe.com/oauth/authorize` checks client_id (unknown:
64
- `invalid_client`), OAuth on, `redirect_uri` (must exactly match a registered one; absent: the first; http and
65
- localhost allowed, as Stripe's test client_id allows), `response_type=code` and `scope` (`read_write` | `read_only`,
66
- default `read_only`), each refusal a 400 JSON `{error, error_description, state}` as the reference says (no
67
- redirect). The page offers the test-mode **Skip this form**, which creates a new Standard account (controller type
68
- `account`, prefilled from valid `stripe_user[...]` values, charges and payouts enabled) and redirects with
69
- `scope`, `code` and `state`, and **Deny access**, which redirects with
70
- `error=access_denied&error_description=The%20user%20denied%20your%20request&state=…`. `POST
71
- connect.stripe.com/oauth/token` (the secret key as Bearer, Basic or `client_secret`) exchanges a code once, within 5
72
- minutes, into `{access_token, livemode, refresh_token, scope, stripe_publishable_key, stripe_user_id, token_type}`;
73
- a reused code is `invalid_grant` and revokes the connection; `refresh_token` grants an equal or lesser scope.
74
- `POST connect.stripe.com/oauth/deauthorize` answers `{stripe_user_id}`, after which the Stripe-Account header (and
75
- `/v1/accounts/{id}`) for that account is refused 403 `account_invalid`. `account.application.authorized` /
76
- `.deauthorized` reach Connect endpoints with the account; once revoked, `GET /v1/accounts` no longer lists it and its own events (payouts, balance) stop reaching the platform. The token answer's
77
- deprecated `access_token` and `stripe_publishable_key` act as the connected account (as the Stripe-Account header
78
- does, as Bearer or Basic; `GET /v1/account` then answers it), a token replaced by a refresh or revoked is a 401 invalid API key, and it is never the platform's key at `/oauth/token` or `/oauth/deauthorize`. The
79
- application's own setting of its client_id (Cal.com's `client_id` app key, `STRIPE_CLIENT_ID`) is the runner's to
80
- set to `ca_twin_self`; the World does not provision it. Where the docs stop, the twin decides (the file header lists
81
- each): connecting an existing Stripe account, the full account application form, and holding a `read_only`
82
- connection to reads are not modelled (todos in `stripe-capabilities.ts`).
83
- - **Signing secrets in a World**: Stripe mints an endpoint's `secret`; in a World the app's env is the World's, so an
84
- endpoint is given the World's value, which the app already verifies with: `STRIPE_WEBHOOK_SECRET` (or
85
- `STRIPE_WEBHOOK_SIGNING_SECRET`, `STRIPE_ENDPOINT_SECRET`, `STRIPE_WEBHOOK_SECRET_KEY`,
86
- `NEXT_PRIVATE_STRIPE_WEBHOOK_SECRET`), and for a `connect=true` endpoint `STRIPE_CONNECT_WEBHOOK_SECRET` (or
87
- `STRIPE_WEBHOOK_SECRET_CONNECT`, `STRIPE_CONNECT_WEBHOOK_SIGNING_SECRET`) first. With none set the twin mints
88
- `whsec_twin_<id>`. Where Stripe stops and the twin decides: Stripe lets no one choose a secret.
89
- - **Conformance** (`stripe-conformance.ts`): field name + type checked vs Stripe's
90
- real OpenAPI (standing gate).
91
- - **UI mirror** (`stripe-mirror-ui.ts`): a Stripe-dashboard-style React app over the
92
- twin's own REST API.
93
-
94
- ## CLI
3
+ A local Stripe: the REST API the unmodified `stripe` SDK calls (`https://api.stripe.com/v1`), the hosted pages an
4
+ application sends a person through, and Stripe.js, over one state.
5
+
6
+ A Protocol 3 pack (twin-world's docs/contributing/architecture.md, "Protocol 3: the derived pack"). Its surface is
7
+ generated from Stripe's published OpenAPI document (`spec/`). The derived core serves plain reads, writes and deletes.
8
+ Handlers are in `src/semantics/<family>.ts`, the state machines in `src/semantics/states.ts`, and Stripe's own
9
+ computation (money and declines, billing, the ledger, the API versions) in `src/engine/`.
95
10
 
96
11
  ```bash
97
- world-stripe serve [--read-only] [--port N] [--root DIR]
98
- world-stripe mirror [--port N] [--root DIR]
99
- world-stripe conformance [--fields FILE] [--root DIR]
12
+ world-stripe serve [--port N] [--root DIR] [--read-only]
100
13
  ```
101
14
 
102
- `serve` defaults to `simulator` (the stack uses the twin as a writable Stripe).
103
- Point the real `stripe` SDK at it with `{ host, port, protocol: 'http' }`.
104
-
105
- ## Interaction surfaces
106
-
107
- 1. **SDK/API** — *zero edits (preferred):* `STRIPE_TWIN_URL=http://127.0.0.1:PORT node --require @volter/world-core/inject your-app` redirects the real `stripe` SDK from `api.stripe.com` to the twin (`cookbook/zero-edit-inject`). For browser routing, follow [run a full stack](../../../docs/guides/run-a-full-stack.md). *Or* override directly: `new Stripe(key, { host: '127.0.0.1', port: PORT, protocol: 'http' })`.
108
- 2. **API + CLI** — run the twin in a World and inspect it with `volter world log` and `diff`. Use the [deployment guide](../../../docs/guides/deploy-from-a-shared-world.md) for changeset review and deployment.
109
- 3. **Read-only** — `world-stripe serve --read-only`: unlimited local reads, no rate limits; writes refuse like Stripe (4xx).
110
- 4. **UI mirror** — `world-stripe mirror` renders a Stripe-dashboard-style view of the twin's state.
111
- 5. **Time's events** — `POST /_twin/drain` sends what World time produced since the last drain: `balance.available`
112
- to each account whose settled funds added to its balance (never for negative transactions alone), `payout.paid` for
113
- each payout that arrived, a connected account's with its `account` to its Connect endpoints
114
- (`stripe.events.time_drain`). A read sees time's moves without it; a runner's drainer calls it so the events
115
- arrive, as the qstash and vercel twins' drain doors do.
116
- Test mode keeps live timing except where Stripe documents otherwise: a card charge's funds are pending two days,
117
- except the cards that bypass the pending balance (4000000000000077, 4000003720000278, `pm_card_bypassPending*`,
118
- `tok_bypassPending*`, and a PaymentMethod saved from one) and US bank account debits ("Test transactions settle
119
- instantly"), whose funds, and a `source_transaction` transfer's from them, are available at once; every credit
120
- available at once is sent as `balance.available` at the next drain; a test payout is paid at its `arrival_date`
121
- (`stripe.balance.test_mode_bypass_pending`; sources in `src/semantics/ledger.ts`).
122
-
123
- (See Getting Started → "Twin interaction surfaces".)
124
-
125
- Stable on the twin rubric: fidelity, read/write/fork, sync, observability, event emission, and conformance are tracked with explicit coverage gaps.
126
-
127
- ## Coverage
128
-
129
- Goal: **honest, explicitly tracked coverage of Stripe's core feature surface.** Every capability
130
- is either done or a tracked todo; anything not done is a gap to close.
131
-
132
- **Done** — core resources: **customers**, **charges**, **payment_intents** (+ confirm),
133
- **setup_intents** (+ confirm), **payment_methods** (+ detach), **subscriptions** (create/
134
- update/cancel), **prices**, **products**, **invoices** (+ finalize/pay/void), **invoiceitems**,
135
- **refunds**, **disputes** (+ update/close), **payouts** (+ cancel), **balance_transactions**,
136
- **balance** (synthesized from the ledger), **events** (Events API list/retrieve),
137
- **Checkout Sessions** (create/retrieve/list/`line_items`/expire + modeled completion that
138
- creates+links a payment_intent/subscription/setup_intent; `amount_total` computed from
139
- line_items), **Customer Portal** (`billing_portal` sessions + configurations create/retrieve/
140
- list/update), **Connect** (connected **accounts** create/retrieve/list/update/delete +
141
- `login_links`, and **transfers** platform→connected-account create/retrieve/list filtered by
142
- destination; a new account starts un-onboarded with charges/payouts disabled + a `requirements`
143
- hash; a transfer's `source_transaction` waives the balance check only while its charge is unsettled,
144
- takes the charge's `transfer_group` or writes `group_<payment intent>` onto both, and counts reversals
145
- back as room; connected-account balances, payouts (manual and automatic) and payout reversal, top-ups,
146
- account sessions, persons, external accounts, application fees, hosted onboarding and Connect OAuth for Standard accounts), plus **ephemeral_keys**, **identity verification_sessions**, **file_links**
147
- (synthesized) and **coupons**/**promotion_codes** (retrieve/list, seed-only). Cursor pagination
148
- (`limit`/`starting_after`/`ending_before` + `has_more`); per-resource list filters; `expand[]`
149
- on the modeled paths; vendor-faithful **test-card declines** (`4242…` succeeds; documented
150
- decline PANs + `pm_card_*`/`tok_*` tokens return the real `card_error` 402); **idempotency keys**
151
- (`Idempotency-Key` replay, no re-write); **events/webhooks** (`stripe-events.ts`); spec
152
- **conformance** gate; **UI mirror** (rung-5 ✅, `client/stripe-mirror.tsx` + structure check);
153
- **connector** pull (customers + subscriptions) + push (create/update/cancel/confirm/detach/
154
- finalize/pay/void/close to the real REST surface).
155
-
156
- This cycle added: **ACH/SEPA micro-deposit verification** (`payment_intents`/`setup_intents`
157
- `/verify_microdeposits` — confirm with `pm_us_bank_account` → `requires_action` with a
158
- `verify_with_microdeposits` next_action, then the 32/45 amounts or `SM11AA` descriptor →
159
- `succeeded`), **Customer.list_payment_methods** (`/v1/customers/:id/payment_methods`),
160
- **subscription items** CRUD (create/retrieve/list/update/delete, kept in sync with the parent
161
- sub's `items` list), **subscriptions/invoices search**, **invoice line items**
162
- (`/lines` + `add_lines`/`update_lines`/`remove_lines` with recomputed totals), **invoice
163
- edge-action gating** (finalize/pay/mark_uncollectible/void state machine), **Tax transactions**
164
- (`create_from_calculation` + `create_reversal` with negated lines), **quote** cancel-from-draft/
165
- open lifecycle gates, **customer + subscription discount delete**, **promotion-code update**
166
- (active toggle), **charge fraud-marking** (`fraud_details[user_report]`), and the **Radar**
167
- family — **Reviews** (`/approve`), **Value Lists** (+ items), **Rules** — plus a **Radar
168
- dashboard screen** in the UI mirror.
169
-
170
- **Issuing** (modeled) — cardholders/cards/authorizations/transactions/disputes + test helpers
171
- (present authorization, capture, force capture, fund_balance), including the **real-time
172
- authorization leg**: an endpoint enrolled for `issuing_authorization.request` receives the
173
- signed request event **synchronously** at present time and its JSON response
174
- (`{approved, amount?}`) decides the authorization within Stripe's 2-second window (timeout →
175
- declined `webhook_timeout`, invalid response → `webhook_error`); **spending_controls**
176
- (category/country allow+block lists, per_authorization/all_time/calendar-window spending
177
- limits) are enforced ahead of the webhook with the vendor's `spending_controls` decline
178
- reason; and **captures debit the issuing balance** (`balance_transaction` type
179
- `issuing_transaction`, `balance_type: 'issuing'`, served in `GET /v1/balance`'s `issuing`
180
- section). Remaining issuing gaps (authorization holds, expire/increment/reverse test
181
- helpers) are tracked todos in `stripe-capabilities.ts`. **Terminal**
182
- (locations/readers/connection tokens + process_payment_intent) is likewise modeled — the old
183
- "Planned" listing for both families was stale.
184
-
185
- Also modelled: **Treasury** financial accounts and money movement, **Climate** orders,
186
- **Financial Connections** sessions/accounts/transactions, **Entitlements**, **Billing** meters,
187
- credit grants and usage alerts, **Reporting** report runs, and the legacy **Sources** API.
188
-
189
- **Planned** (known-missing, will do) — **Sigma scheduled query runs** (`GET /v1/sigma/scheduled_query_runs`
190
- list + retrieve, with the run object's status/result-file lifecycle), Treasury financial addresses and
191
- reversals, Financial Connections refresh, the Issuing gaps above, connector pulls of payment methods and
192
- setup intents, and additional list endpoints/filters as needed. (See `stripe-capabilities.ts` for the full
193
- honest todo list — every entry is a tracked gap.)
194
-
195
- ## Rate budget — the fail-closed backstop on live calls
196
-
197
- `liveStripeExecute` is the **one place** this pack issues a live request, so every call it makes is charged
198
- against a persistent, fail-closed spend ledger **before** the request goes out. Past the ceiling, or
199
- while a `Retry-After`/429 cooldown is armed, it **throws instead of calling**. The ledger is keyed by
200
- vendor and a hash of the credential (limits are per credential, so it is deliberately *not*
201
- cwd-scoped) and persists across processes, so a fresh process does not get a fresh allowance; a
202
- corrupt ledger counts as a **full** window rather than zero spend. There is no option to disable it,
203
- and no value you can pass for `budget` that yields an unguarded client — an injected budget is
204
- validated by *method identity*, so a subclass or a `Proxy` that replaces `checkBudget` is refused.
205
-
206
- The declared numbers: **120 weighted units / 60s** = 2 requests/second — 2% of Stripe's documented 100/s live mode and 8% of the 25/s a sandbox key or any single endpoint gets. `POST`/`DELETE` cost 2 (not a published ratio — a judgement call about blast radius: a write creates a charge, refund or receipt e-mail and cannot be taken back) and `POST /v1/payouts` costs 5 (documented at 15 creates/second). Stripe's own window is a **second** while this one is a minute, so an intra-second burst reaches Stripe's limiter first; the 429 cooldown is the backstop for that shape.
207
-
208
- The mechanism is **shared and vendor-agnostic** — it lives in the kernel (`@volter/world-core` →
209
- `packages/world-core/src/rateBudget.ts`); what lives here in [`src/stripe-budget.ts`](src/stripe-budget.ts) is this vendor's
210
- **declaration** (window, ceiling, per-endpoint weights, and a `reason` citing the limits above) plus
211
- the vendor-bound `StripeBudget`. The rule is ratified as
212
- [../../../docs/contributing/architecture.md](../../../docs/contributing/architecture.md) **D8**, and the kernel module's header documents what the
213
- guard does *not* guarantee — read that before trusting it.
15
+ ## What it models
16
+
17
+ What the demand reaches (`journeys/demand.json`: Open Autonomy, Twin, Volter Harness, and the stripe-node applications
18
+ Cal.com, Dub, Postiz, Rallly and Twenty, with their frontends' Stripe.js), the life (`journeys/customer-life.json`) and a
19
+ vendor-backed World's refresh; each served operation is decided in `journeys/decisions.json`:
20
+
21
+ - **Customers**: created, updated, searched, listed by email, deleted; their balance transactions and payment methods,
22
+ and their active entitlements (read). Balance-transaction writes answer the gap.
23
+ - **Catalog**: products and prices created and listed, prices retrieved, coupons and promotion codes managed. Product search and administrative product/price updates answer the gap.
24
+ - **Checkout Sessions** and the customer portal (sessions and configurations): pay, add a card, pay an open invoice,
25
+ cancel at the period's end or at once.
26
+ - **Subscriptions**: created (charged at once, trialing, `default_incomplete` or `error_if_incomplete`), updated (items,
27
+ discounts, a trial ended early or added), searched, canceled; their items, schedules (made, updated, released),
28
+ renewals on the World clock, and a renewal declined and paid later.
29
+ - **Invoices**: invoice items, drafts, finalize, pay (a draft is finalized on the way), void, delete, lines,
30
+ previews and their payments. Invoice lines are read in the invoice; the standalone lines endpoint answers the gap.
31
+ - **Intents**: payment and setup intents, confirmed on the server or by Stripe.js with the publishable key and the
32
+ client secret, through the testing page's cards (declines, 3-D Secure) and test bank accounts (ACH debits that settle,
33
+ micro-deposit verification asked), a hold confirmed under manual capture and canceled, a bank transfer that waits for
34
+ funds; payment methods attached and detached; refunds (held for want of balance, with a destination charge's
35
+ transfer reversed and its application fee refunded); the charges, disputes and Radar reviews the testing page's cards
36
+ bring.
37
+ - **Apps secret store**; existing Radar value lists and their items (reads and item insertion).
38
+ - **Connect**: Express and Custom accounts, account links (Stripe's hosted onboarding) and login links, transfers (from
39
+ a charge's funds too), payouts, the balance and its transactions, application fees and their refunds, and Connect
40
+ OAuth (cal.com's).
41
+ - **Issuing** (Open Autonomy's card rail): cardholders and cards (a card is `inactive` unless its create names a status;
42
+ its number and CVC drawn from the World and shown only when expanded), activated, frozen and canceled; authorizations
43
+ asked of the real-time endpoint, approved or declined within the window or decided by Stripe when it ends, and
44
+ received from the vendor and closed by its transactions. Their published fixtures are recorded notReplayed because authorization creation and capture test helpers remain outside demand.
45
+ - **Webhook endpoints** made through the API, each with its own signing secret; events listed.
46
+
47
+ **Keys.** The platform's secret and publishable keys, and its webhook secret, are issued by the credential door and
48
+ held by their SHA-256. A request with no key, or with one Stripe never issued, is refused 401. A connected account's
49
+ OAuth key acts as that account.
50
+
51
+ **The gap.** Operations outside application demand and the declared refresh reads answer Stripe's unknown-URL 404
52
+ (the manifest's literal `unmodeled` list). This includes administrative catalog updates and deletion, direct
53
+ PaymentMethod creation and attachment, send-invoice, balance-credit writes, test clocks and Issuing test helpers,
54
+ top-ups, Plans, meter and entitlement-feature setup, Radar-list creation, and separate products such as Terminal,
55
+ Treasury, Tax, Climate, Identity and Financial Connections. Reading an already declared resource for vendor-backed
56
+ refresh remains served; declaring an unused product does not establish application demand.
57
+
58
+ **Vendor-backed.** Every stored resource declares its `refresh` (the list that reads it back, under its parent where it
59
+ has one); Stripe's webhooks are ingested by their `Stripe-Signature` (`type`, `data.object`); calls are charged against
60
+ Stripe's documented limit (25 requests a second in a sandbox).
61
+
62
+ ## Events
63
+
64
+ Every write Stripe reports sends its event (`payment_intent.succeeded`, `customer.subscription.created`,
65
+ `invoice.paid`, …; a charge sends `charge.succeeded` or `charge.failed`, never an invented `charge.created`), declared as data the kernel renders, stores, signs (`Stripe-Signature: t=…,v1=…`, which the
66
+ SDK's `constructEvent` verifies) and delivers to the account's enabled webhook endpoints whose `enabled_events` take it
67
+ (`*`, `<family>.*` or the type). Each event is rendered in the writing request's API version.
68
+
69
+ - **Connect**: an event of a connected account (a write made with its `Stripe-Account` header, its own
70
+ `account.updated`, or a row kept on its books, such as the payout time makes for it) carries the top-level `account`
71
+ and reaches only endpoints created with `connect=true`; the platform's reach only the others.
72
+ - **Signing secrets in a World**: the credential door issues the application its keys and two signing secrets, its
73
+ account's (`STRIPE_WEBHOOK_SECRET` and the other names an application reads it by) and its Connect endpoint's
74
+ (`STRIPE_CONNECT_WEBHOOK_SECRET`), the same on every boot; an endpoint made on the Webhooks page (a door) is signed
75
+ with the one of its kind. The twin reads no env.
76
+
77
+ ## Screens
78
+
79
+ Stripe's own pages, at their vendor urls (`src/screens/`):
80
+
81
+ - **Checkout** (`checkout.stripe.com/c/pay/{session}`): the customer pays; the session completes and
82
+ `checkout.session.completed` fires.
83
+ - **Customer portal** (`billing.stripe.com/p/session/{session}`): cancel or renew a plan, update the card, pay an
84
+ open invoice.
85
+ - **Connect onboarding** (`connect.stripe.com/setup/…`): an Account Link's hosted onboarding.
86
+ - **Connect OAuth** (`connect.stripe.com/oauth/authorize`, `/oauth/token`, `/oauth/deauthorize`; Standard accounts,
87
+ docs.stripe.com/connect/oauth-reference). The platform's client_id is `ca_twin_self` in every World (a test
88
+ client_id; the platform account is `acct_twin_self`), shown on the Dashboard's Connect OAuth settings page in
89
+ `<code data-testid="connect-client-id">`. OAuth starts off: a runner POSTs that page as a browser does,
90
+ `oauth_enabled=on&redirect_uris=<one per line>`. The authorize page offers the test-mode **Skip this form** (a new
91
+ Standard account, connected) and **Deny access**; the token endpoint exchanges a code once, within 5 minutes (a
92
+ reused code revokes the connection), and refreshes to an equal or lesser scope; after a deauthorization the
93
+ account's `Stripe-Account` header is refused 403 `account_invalid`. The deprecated `access_token` and
94
+ `stripe_publishable_key` act as the connected account. Not modelled: connecting an existing Stripe account, the full
95
+ account application, holding a `read_only` connection to reads.
96
+ - **Stripe.js** (`js.stripe.com/v3/`, `/v3/stripe.js`, `/<release train>/stripe.js`): `redirectToCheckout({ sessionId })`
97
+ goes to the hosted Checkout page; any other member
98
+ throws, naming itself.
99
+ - **Dashboard** (`dashboard.stripe.com/settings/public`, `/settings/connect/onboarding-options/oauth`): Public details
100
+ (the business name Checkout and the portal show) and the Connect OAuth settings.
101
+
102
+ ## Doors
103
+
104
+ The World's hands where Stripe's API has no act (`src/semantics/doors.ts`), refused on a read-only twin:
105
+
106
+ - `POST /_twin/app-credentials`: the platform's keys and webhook secret, as the runtime issues them to a World's
107
+ applications.
108
+ - `POST /_twin/webhook-endpoints {url, events, connect?}`: an endpoint added on the Dashboard's Webhooks page.
109
+ - `POST /_twin/account {settings?, business_profile?, …}`: the platform's own account settings, as the Dashboard
110
+ changes them.
111
+ - `POST /_twin/drain`: time's events, sent when a runner drives them (`payout.paid`, `balance.available`).
112
+
113
+ ## Published examples
114
+
115
+ `journeys/vendor-examples.json` replays Stripe's published examples for the operations the pack serves: the fixtures
116
+ beside its spec (`spec/fixtures3.json.gz`), and the requests and rules its documentation pages publish
117
+ (`spec/doc-examples.json`: the testing page's cards and test bank accounts, the payment lifecycle's states, and each
118
+ reference page's stated rule). Examples whose preconditions require an unserved setup operation are recorded notReplayed naming that operation and its pinned-spec citation. Served preconditions replay through vendor APIs, including customer balance changes and their immutable ledger entries. Coverage remains missing where no application call or published replay reaches it.
@@ -0,0 +1,94 @@
1
+ {
2
+ "//": "GENERATED by scripts/pack-facts.ts — current pack descriptors and explicit world-runtime server backings; no prior-artifact entries are retained.",
3
+ "packs": {
4
+ "stripe": {
5
+ "adoption": {
6
+ "pypi": [
7
+ "stripe"
8
+ ],
9
+ "sdks": [
10
+ "stripe"
11
+ ],
12
+ "envStems": [
13
+ "STRIPE",
14
+ "NEXTPRIVATESTRIPE"
15
+ ]
16
+ },
17
+ "hosts": [
18
+ {
19
+ "host": "api.stripe.com"
20
+ },
21
+ {
22
+ "host": "checkout.stripe.com",
23
+ "pathPattern": "^/c/pay/"
24
+ },
25
+ {
26
+ "host": "billing.stripe.com",
27
+ "pathPattern": "^/p/session/"
28
+ },
29
+ {
30
+ "host": "connect.stripe.com",
31
+ "pathPattern": "^/setup/"
32
+ },
33
+ {
34
+ "host": "dashboard.stripe.com",
35
+ "pathPattern": "^/radar/lists(?:/[^/]+)?/?$|^/test/issuing/balance/?$|^/settings/public/?$"
36
+ },
37
+ {
38
+ "host": "verify.stripe.com",
39
+ "pathPattern": "^/start/"
40
+ },
41
+ {
42
+ "host": "js.stripe.com",
43
+ "pathPattern": "^/v3/?$|^/(v3|[a-z]+)/stripe\\.js$"
44
+ }
45
+ ],
46
+ "archetype": "crud",
47
+ "protocol": {
48
+ "declared": "3",
49
+ "major": 3,
50
+ "standing": "current"
51
+ },
52
+ "transport": "rest",
53
+ "resources": [
54
+ "charge",
55
+ "customer",
56
+ "payment_intent",
57
+ "setup_intent",
58
+ "payment_method",
59
+ "subscription",
60
+ "price",
61
+ "product",
62
+ "invoice",
63
+ "invoiceitem",
64
+ "refund",
65
+ "event"
66
+ ],
67
+ "credentialDoor": {
68
+ "path": "/_twin/app-credentials",
69
+ "body": {},
70
+ "fill": {
71
+ "STRIPE_SECRET_KEY": "secret_key",
72
+ "STRIPE_API_KEY": "secret_key",
73
+ "STRIPE_PRIVATE_KEY": "secret_key",
74
+ "BILLING_STRIPE_API_KEY": "secret_key",
75
+ "STRIPE_PUBLISHABLE_KEY": "publishable_key",
76
+ "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY": "publishable_key",
77
+ "NEXT_PUBLIC_STRIPE_PUBLIC_KEY": "publishable_key",
78
+ "NEXT_PUBLIC_STRIPE_KEY": "publishable_key",
79
+ "STRIPE_WEBHOOK_SECRET": "webhook_secret",
80
+ "STRIPE_WEBHOOK_SIGNING_SECRET": "webhook_secret",
81
+ "STRIPE_ENDPOINT_SECRET": "webhook_secret",
82
+ "STRIPE_WEBHOOK_SECRET_KEY": "webhook_secret",
83
+ "NEXT_PRIVATE_STRIPE_WEBHOOK_SECRET": "webhook_secret",
84
+ "BILLING_STRIPE_WEBHOOK_SECRET": "webhook_secret",
85
+ "STRIPE_CONNECT_WEBHOOK_SECRET": "connect_webhook_secret",
86
+ "STRIPE_WEBHOOK_SECRET_CONNECT": "connect_webhook_secret",
87
+ "STRIPE_CONNECT_WEBHOOK_SIGNING_SECRET": "connect_webhook_secret"
88
+ }
89
+ },
90
+ "serveExport": "createStripeTwinServer"
91
+ }
92
+ },
93
+ "undeclared": []
94
+ }