@owlmeans/payment 0.1.18-rc.8 → 0.1.18

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 (364) hide show
  1. package/README.md +95 -57
  2. package/agent-meta/manifest.json +10 -3
  3. package/agent-meta/skills/entitlements/SKILL.md +159 -0
  4. package/agent-meta/skills/payment/SKILL.md +491 -28
  5. package/build/advertise.d.ts +2 -0
  6. package/build/advertise.d.ts.map +1 -0
  7. package/build/advertise.js +10 -0
  8. package/build/advertise.js.map +1 -0
  9. package/build/checkout/consts.d.ts +2 -0
  10. package/build/checkout/consts.d.ts.map +1 -0
  11. package/build/checkout/consts.js +2 -0
  12. package/build/checkout/consts.js.map +1 -0
  13. package/build/checkout/index.d.ts +6 -0
  14. package/build/checkout/index.d.ts.map +1 -0
  15. package/build/checkout/index.js +4 -0
  16. package/build/checkout/index.js.map +1 -0
  17. package/build/checkout/narrow/types.d.ts +25 -0
  18. package/build/checkout/narrow/types.d.ts.map +1 -0
  19. package/build/checkout/narrow/types.js +2 -0
  20. package/build/checkout/narrow/types.js.map +1 -0
  21. package/build/checkout/narrow.d.ts +8 -0
  22. package/build/checkout/narrow.d.ts.map +1 -0
  23. package/build/checkout/narrow.js +47 -0
  24. package/build/checkout/narrow.js.map +1 -0
  25. package/build/checkout/protocols.d.ts +8 -0
  26. package/build/checkout/protocols.d.ts.map +1 -0
  27. package/build/checkout/protocols.js +28 -0
  28. package/build/checkout/protocols.js.map +1 -0
  29. package/build/checkout/types.d.ts +29 -0
  30. package/build/checkout/types.d.ts.map +1 -0
  31. package/build/checkout/types.js +2 -0
  32. package/build/checkout/types.js.map +1 -0
  33. package/build/consts.d.ts +242 -25
  34. package/build/consts.d.ts.map +1 -1
  35. package/build/consts.js +377 -24
  36. package/build/consts.js.map +1 -1
  37. package/build/consts.local.d.ts +20 -0
  38. package/build/consts.local.d.ts.map +1 -0
  39. package/build/consts.local.js +23 -0
  40. package/build/consts.local.js.map +1 -0
  41. package/build/consumer/cancel.d.ts +11 -0
  42. package/build/consumer/cancel.d.ts.map +1 -0
  43. package/build/consumer/cancel.js +33 -0
  44. package/build/consumer/cancel.js.map +1 -0
  45. package/build/consumer/consts.d.ts +20 -0
  46. package/build/consumer/consts.d.ts.map +1 -0
  47. package/build/consumer/consts.js +39 -0
  48. package/build/consumer/consts.js.map +1 -0
  49. package/build/consumer/consts.local.d.ts +7 -0
  50. package/build/consumer/consts.local.d.ts.map +1 -0
  51. package/build/consumer/consts.local.js +13 -0
  52. package/build/consumer/consts.local.js.map +1 -0
  53. package/build/consumer/copy/types.d.ts +56 -0
  54. package/build/consumer/copy/types.d.ts.map +1 -0
  55. package/build/consumer/copy/types.js +2 -0
  56. package/build/consumer/copy/types.js.map +1 -0
  57. package/build/consumer/copy.d.ts +22 -0
  58. package/build/consumer/copy.d.ts.map +1 -0
  59. package/build/consumer/copy.js +87 -0
  60. package/build/consumer/copy.js.map +1 -0
  61. package/build/consumer/deadline/types.d.ts +30 -0
  62. package/build/consumer/deadline/types.d.ts.map +1 -0
  63. package/build/consumer/deadline/types.js +2 -0
  64. package/build/consumer/deadline/types.js.map +1 -0
  65. package/build/consumer/deadline.d.ts +12 -0
  66. package/build/consumer/deadline.d.ts.map +1 -0
  67. package/build/consumer/deadline.js +44 -0
  68. package/build/consumer/deadline.js.map +1 -0
  69. package/build/consumer/fifo/types.d.ts +17 -0
  70. package/build/consumer/fifo/types.d.ts.map +1 -0
  71. package/build/consumer/fifo/types.js +2 -0
  72. package/build/consumer/fifo/types.js.map +1 -0
  73. package/build/consumer/fifo.d.ts +4 -0
  74. package/build/consumer/fifo.d.ts.map +1 -0
  75. package/build/consumer/fifo.js +34 -0
  76. package/build/consumer/fifo.js.map +1 -0
  77. package/build/consumer/index.d.ts +18 -0
  78. package/build/consumer/index.d.ts.map +1 -0
  79. package/build/consumer/index.js +11 -0
  80. package/build/consumer/index.js.map +1 -0
  81. package/build/consumer/policy/types.d.ts +20 -0
  82. package/build/consumer/policy/types.d.ts.map +1 -0
  83. package/build/consumer/policy/types.js +2 -0
  84. package/build/consumer/policy/types.js.map +1 -0
  85. package/build/consumer/policy.d.ts +17 -0
  86. package/build/consumer/policy.d.ts.map +1 -0
  87. package/build/consumer/policy.js +91 -0
  88. package/build/consumer/policy.js.map +1 -0
  89. package/build/consumer/protocols.d.ts +20 -0
  90. package/build/consumer/protocols.d.ts.map +1 -0
  91. package/build/consumer/protocols.js +70 -0
  92. package/build/consumer/protocols.js.map +1 -0
  93. package/build/consumer/refund/types.d.ts +27 -0
  94. package/build/consumer/refund/types.d.ts.map +1 -0
  95. package/build/consumer/refund/types.js +2 -0
  96. package/build/consumer/refund/types.js.map +1 -0
  97. package/build/consumer/refund.d.ts +9 -0
  98. package/build/consumer/refund.d.ts.map +1 -0
  99. package/build/consumer/refund.js +112 -0
  100. package/build/consumer/refund.js.map +1 -0
  101. package/build/consumer/refusal.d.ts +10 -0
  102. package/build/consumer/refusal.d.ts.map +1 -0
  103. package/build/consumer/refusal.js +35 -0
  104. package/build/consumer/refusal.js.map +1 -0
  105. package/build/consumer/revive/types.d.ts +19 -0
  106. package/build/consumer/revive/types.d.ts.map +1 -0
  107. package/build/consumer/revive/types.js +2 -0
  108. package/build/consumer/revive/types.js.map +1 -0
  109. package/build/consumer/revive.d.ts +13 -0
  110. package/build/consumer/revive.d.ts.map +1 -0
  111. package/build/consumer/revive.js +43 -0
  112. package/build/consumer/revive.js.map +1 -0
  113. package/build/consumer/types.d.ts +196 -0
  114. package/build/consumer/types.d.ts.map +1 -0
  115. package/build/consumer/types.js +2 -0
  116. package/build/consumer/types.js.map +1 -0
  117. package/build/consumer/types.local.d.ts +11 -0
  118. package/build/consumer/types.local.d.ts.map +1 -0
  119. package/build/consumer/types.local.js +2 -0
  120. package/build/consumer/types.local.js.map +1 -0
  121. package/build/countries.d.ts +3 -0
  122. package/build/countries.d.ts.map +1 -0
  123. package/build/countries.js +4 -0
  124. package/build/countries.js.map +1 -0
  125. package/build/entitled.d.ts +14 -0
  126. package/build/entitled.d.ts.map +1 -0
  127. package/build/entitled.js +17 -0
  128. package/build/entitled.js.map +1 -0
  129. package/build/entitlement/types.d.ts +29 -0
  130. package/build/entitlement/types.d.ts.map +1 -0
  131. package/build/entitlement/types.js +2 -0
  132. package/build/entitlement/types.js.map +1 -0
  133. package/build/entitlement.d.ts +12 -0
  134. package/build/entitlement.d.ts.map +1 -0
  135. package/build/entitlement.js +64 -0
  136. package/build/entitlement.js.map +1 -0
  137. package/build/errors.d.ts +189 -0
  138. package/build/errors.d.ts.map +1 -1
  139. package/build/errors.js +361 -0
  140. package/build/errors.js.map +1 -1
  141. package/build/estimate/types.d.ts +34 -0
  142. package/build/estimate/types.d.ts.map +1 -0
  143. package/build/estimate/types.js +2 -0
  144. package/build/estimate/types.js.map +1 -0
  145. package/build/estimate.d.ts +11 -0
  146. package/build/estimate.d.ts.map +1 -0
  147. package/build/estimate.js +76 -0
  148. package/build/estimate.js.map +1 -0
  149. package/build/i18n/consumer-rights/be.json +131 -0
  150. package/build/i18n/consumer-rights/de.json +131 -0
  151. package/build/i18n/consumer-rights/en.json +131 -0
  152. package/build/i18n/consumer-rights/es.json +131 -0
  153. package/build/i18n/consumer-rights/fr.json +131 -0
  154. package/build/i18n/consumer-rights/pl.json +131 -0
  155. package/build/i18n/consumer-rights/ru.json +131 -0
  156. package/build/i18n/consumer-rights/uk.json +131 -0
  157. package/build/i18n/errors/be.json +30 -0
  158. package/build/i18n/errors/de.json +30 -0
  159. package/build/i18n/errors/en.json +30 -0
  160. package/build/i18n/errors/es.json +30 -0
  161. package/build/i18n/errors/fr.json +30 -0
  162. package/build/i18n/errors/pl.json +30 -0
  163. package/build/i18n/errors/ru.json +30 -0
  164. package/build/i18n/errors/uk.json +30 -0
  165. package/build/i18n/fr.json +39 -0
  166. package/build/i18n.js +53 -8
  167. package/build/i18n.js.map +1 -1
  168. package/build/index.d.ts +19 -1
  169. package/build/index.d.ts.map +1 -1
  170. package/build/index.js +12 -1
  171. package/build/index.js.map +1 -1
  172. package/build/limit/types.d.ts +44 -0
  173. package/build/limit/types.d.ts.map +1 -0
  174. package/build/limit/types.js +2 -0
  175. package/build/limit/types.js.map +1 -0
  176. package/build/limit.d.ts +23 -0
  177. package/build/limit.d.ts.map +1 -0
  178. package/build/limit.js +97 -0
  179. package/build/limit.js.map +1 -0
  180. package/build/model/checkout.d.ts +2 -3
  181. package/build/model/checkout.d.ts.map +1 -1
  182. package/build/model/checkout.js +12 -7
  183. package/build/model/checkout.js.map +1 -1
  184. package/build/model/consts.d.ts +15 -0
  185. package/build/model/consts.d.ts.map +1 -0
  186. package/build/model/consts.js +193 -0
  187. package/build/model/consts.js.map +1 -0
  188. package/build/model/consts.local.d.ts +35 -0
  189. package/build/model/consts.local.d.ts.map +1 -0
  190. package/build/model/consts.local.js +65 -0
  191. package/build/model/consts.local.js.map +1 -0
  192. package/build/model/consumer.d.ts +23 -0
  193. package/build/model/consumer.d.ts.map +1 -0
  194. package/build/model/consumer.js +272 -0
  195. package/build/model/consumer.js.map +1 -0
  196. package/build/model/estimate.d.ts +5 -0
  197. package/build/model/estimate.d.ts.map +1 -0
  198. package/build/model/estimate.js +69 -0
  199. package/build/model/estimate.js.map +1 -0
  200. package/build/model/index.d.ts +7 -2
  201. package/build/model/index.d.ts.map +1 -1
  202. package/build/model/index.js +7 -2
  203. package/build/model/index.js.map +1 -1
  204. package/build/model/limit.d.ts +7 -0
  205. package/build/model/limit.d.ts.map +1 -0
  206. package/build/model/limit.js +32 -0
  207. package/build/model/limit.js.map +1 -0
  208. package/build/model/plan.d.ts.map +1 -1
  209. package/build/model/plan.js +24 -11
  210. package/build/model/plan.js.map +1 -1
  211. package/build/model/portal.d.ts +4 -0
  212. package/build/model/portal.d.ts.map +1 -0
  213. package/build/model/portal.js +22 -0
  214. package/build/model/portal.js.map +1 -0
  215. package/build/model/pricing.d.ts +4 -0
  216. package/build/model/pricing.d.ts.map +1 -0
  217. package/build/model/pricing.js +31 -0
  218. package/build/model/pricing.js.map +1 -0
  219. package/build/model/view.d.ts +3 -0
  220. package/build/model/view.d.ts.map +1 -0
  221. package/build/model/view.js +15 -0
  222. package/build/model/view.js.map +1 -0
  223. package/build/pricing/types.d.ts +13 -0
  224. package/build/pricing/types.d.ts.map +1 -0
  225. package/build/pricing/types.js +2 -0
  226. package/build/pricing/types.js.map +1 -0
  227. package/build/pricing.d.ts +13 -0
  228. package/build/pricing.d.ts.map +1 -0
  229. package/build/pricing.js +74 -0
  230. package/build/pricing.js.map +1 -0
  231. package/build/promo/types.d.ts +14 -0
  232. package/build/promo/types.d.ts.map +1 -0
  233. package/build/promo/types.js +2 -0
  234. package/build/promo/types.js.map +1 -0
  235. package/build/promo.d.ts +7 -0
  236. package/build/promo.d.ts.map +1 -0
  237. package/build/promo.js +25 -0
  238. package/build/promo.js.map +1 -0
  239. package/build/regions/types.d.ts +32 -0
  240. package/build/regions/types.d.ts.map +1 -0
  241. package/build/regions/types.js +2 -0
  242. package/build/regions/types.js.map +1 -0
  243. package/build/regions.d.ts +15 -0
  244. package/build/regions.d.ts.map +1 -0
  245. package/build/regions.js +43 -0
  246. package/build/regions.js.map +1 -0
  247. package/build/service.d.ts.map +1 -1
  248. package/build/service.js +24 -9
  249. package/build/service.js.map +1 -1
  250. package/build/types.d.ts +619 -52
  251. package/build/types.d.ts.map +1 -1
  252. package/build/types.local.d.ts +4 -0
  253. package/build/types.local.d.ts.map +1 -0
  254. package/build/types.local.js +2 -0
  255. package/build/types.local.js.map +1 -0
  256. package/build/view/types.d.ts +33 -0
  257. package/build/view/types.d.ts.map +1 -0
  258. package/build/view/types.js +2 -0
  259. package/build/view/types.js.map +1 -0
  260. package/build/view.d.ts +13 -0
  261. package/build/view.d.ts.map +1 -0
  262. package/build/view.js +78 -0
  263. package/build/view.js.map +1 -0
  264. package/package.json +14 -12
  265. package/src/advertise.ts +13 -0
  266. package/src/checkout/consts.ts +1 -0
  267. package/src/checkout/index.ts +5 -0
  268. package/src/checkout/narrow/types.ts +27 -0
  269. package/src/checkout/narrow.ts +63 -0
  270. package/src/checkout/protocols.ts +39 -0
  271. package/src/checkout/types.ts +27 -0
  272. package/src/consts.local.ts +34 -0
  273. package/src/consts.ts +417 -24
  274. package/src/consumer/cancel.ts +40 -0
  275. package/src/consumer/consts.local.ts +16 -0
  276. package/src/consumer/consts.ts +46 -0
  277. package/src/consumer/copy/types.ts +54 -0
  278. package/src/consumer/copy.ts +121 -0
  279. package/src/consumer/deadline/types.ts +30 -0
  280. package/src/consumer/deadline.ts +61 -0
  281. package/src/consumer/fifo/types.ts +17 -0
  282. package/src/consumer/fifo.ts +42 -0
  283. package/src/consumer/index.ts +17 -0
  284. package/src/consumer/policy/types.ts +20 -0
  285. package/src/consumer/policy.ts +101 -0
  286. package/src/consumer/protocols.ts +116 -0
  287. package/src/consumer/refund/types.ts +27 -0
  288. package/src/consumer/refund.ts +136 -0
  289. package/src/consumer/refusal.ts +35 -0
  290. package/src/consumer/revive/types.ts +23 -0
  291. package/src/consumer/revive.ts +82 -0
  292. package/src/consumer/types.local.ts +10 -0
  293. package/src/consumer/types.ts +189 -0
  294. package/src/countries.ts +5 -0
  295. package/src/entitled.ts +20 -0
  296. package/src/entitlement/types.ts +29 -0
  297. package/src/entitlement.ts +86 -0
  298. package/src/errors.ts +445 -0
  299. package/src/estimate/types.ts +34 -0
  300. package/src/estimate.ts +90 -0
  301. package/src/i18n/consumer-rights/be.json +131 -0
  302. package/src/i18n/consumer-rights/de.json +131 -0
  303. package/src/i18n/consumer-rights/en.json +131 -0
  304. package/src/i18n/consumer-rights/es.json +131 -0
  305. package/src/i18n/consumer-rights/fr.json +131 -0
  306. package/src/i18n/consumer-rights/pl.json +131 -0
  307. package/src/i18n/consumer-rights/ru.json +131 -0
  308. package/src/i18n/consumer-rights/uk.json +131 -0
  309. package/src/i18n/errors/be.json +30 -0
  310. package/src/i18n/errors/de.json +30 -0
  311. package/src/i18n/errors/en.json +30 -0
  312. package/src/i18n/errors/es.json +30 -0
  313. package/src/i18n/errors/fr.json +30 -0
  314. package/src/i18n/errors/pl.json +30 -0
  315. package/src/i18n/errors/ru.json +30 -0
  316. package/src/i18n/errors/uk.json +30 -0
  317. package/src/i18n/fr.json +39 -0
  318. package/src/i18n.ts +58 -8
  319. package/src/index.ts +19 -2
  320. package/src/limit/types.ts +41 -0
  321. package/src/limit.ts +132 -0
  322. package/src/model/checkout.ts +12 -7
  323. package/src/model/consts.local.ts +83 -0
  324. package/src/model/consts.ts +206 -0
  325. package/src/model/consumer.ts +294 -0
  326. package/src/model/estimate.ts +73 -0
  327. package/src/model/index.ts +7 -2
  328. package/src/model/limit.ts +36 -0
  329. package/src/model/plan.ts +25 -12
  330. package/src/model/portal.ts +25 -0
  331. package/src/model/pricing.ts +34 -0
  332. package/src/model/view.ts +17 -0
  333. package/src/pricing/types.ts +13 -0
  334. package/src/pricing.ts +110 -0
  335. package/src/promo/types.ts +18 -0
  336. package/src/promo.ts +46 -0
  337. package/src/regions/types.ts +42 -0
  338. package/src/regions.ts +85 -0
  339. package/src/service.ts +32 -15
  340. package/src/types.local.ts +5 -0
  341. package/src/types.ts +669 -49
  342. package/src/view/types.ts +39 -0
  343. package/src/view.ts +119 -0
  344. package/tests/checkout-narrow.spec.ts +75 -0
  345. package/tests/consumer-copy.spec.ts +378 -0
  346. package/tests/consumer-deadline.spec.ts +85 -0
  347. package/tests/consumer-fifo.spec.ts +61 -0
  348. package/tests/consumer-protocols.spec.ts +103 -0
  349. package/tests/consumer-refund.spec.ts +134 -0
  350. package/tests/consumer-regions.spec.ts +140 -0
  351. package/tests/consumer-wire.spec.ts +170 -0
  352. package/tests/contract.spec.ts +183 -0
  353. package/tests/entitlement.spec.ts +103 -0
  354. package/tests/errors.spec.ts +168 -0
  355. package/tests/estimate.spec.ts +139 -0
  356. package/tests/limit.spec.ts +117 -0
  357. package/tests/pricing.spec.ts +30 -0
  358. package/tests/tsconfig.json +11 -0
  359. package/tests/view.spec.ts +130 -0
  360. package/tsconfig.json +6 -1
  361. package/build/.gitkeep +0 -0
  362. package/src/model/subscription.ts +0 -63
  363. package/src/model/utils.ts +0 -32
  364. package/src/modules.ts +0 -43
package/build/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { InitializedService } from '@owlmeans/context';
2
- import type { PaymentEntityType, PlanDuration, PlanStatus, ProductType, SubscriptionStatus } from './consts.js';
2
+ import type { CancellationKind, CancellationStatus, CheckoutPricingMode, ConsumerRegion, LimitKind, LimitWindow, PaymentEntityType, PlanDuration, PlanStatus, PortalFlow, ProductType, PurchaseKind, SubscriptionStatus, TaxBehavior, TaxEstimateStatus, TaxType, WithdrawalStatus } from './consts.js';
3
3
  import type { PermissionSet } from '@owlmeans/auth';
4
4
  export interface Product {
5
5
  type: ProductType;
@@ -26,13 +26,43 @@ export interface Localization {
26
26
  [key: string]: string;
27
27
  };
28
28
  }
29
+ /**
30
+ * A time-boxed grant on a capability set or a limit.
31
+ *
32
+ * In force while `now < until`; with `grandfather`, also for a subscription created before `until`.
33
+ */
34
+ export interface PromoDeclaration {
35
+ until: Date;
36
+ grandfather?: boolean;
37
+ }
38
+ /** A capability set a plan grants, optionally only while a promo is in force. */
39
+ export interface PlanCapability extends PermissionSet {
40
+ promo?: PromoDeclaration;
41
+ }
42
+ /** A counted allowance a plan grants under one key. */
43
+ export interface LimitDeclaration {
44
+ kind: LimitKind;
45
+ /** The ceiling. `0` means "not included". */
46
+ limit: number;
47
+ /** Required for `LimitKind.Window`; ignored otherwise. */
48
+ window?: LimitWindow;
49
+ /** A display unit, never interpreted. */
50
+ unit?: string;
51
+ promo?: PromoDeclaration;
52
+ }
29
53
  export interface ProductPlan {
30
54
  productSku: string;
31
55
  sku: string;
32
56
  status: PlanStatus;
33
- payagateAliases?: {
34
- [paygate: string]: string | null;
35
- };
57
+ /**
58
+ * Position among the plans of one product: a higher rank is an upgrade. Treated as `0` when
59
+ * absent.
60
+ */
61
+ rank?: number;
62
+ /** A plan every entity holds without paying: `price: 0`, no paygate. */
63
+ free?: boolean;
64
+ /** The paygates this plan is sold through. Empty for a free plan. */
65
+ gateways?: string[];
36
66
  duration: PlanDuration;
37
67
  trial?: number;
38
68
  gatedTrial?: boolean;
@@ -53,74 +83,244 @@ export interface ProductPlan {
53
83
  * This way we can plan event when users loose access in case they don't upgrade.
54
84
  */
55
85
  deprecatedAt?: Date;
56
- supsendedAt?: Date;
57
- capabilities?: PermissionSet[];
86
+ suspendedAt?: Date;
87
+ capabilities?: PlanCapability[];
58
88
  limits?: {
59
- [key: string]: LimitConfig;
89
+ [key: string]: LimitDeclaration;
60
90
  };
61
- }
62
- export interface PlanSubscription {
63
- sku: string;
64
- entityId: string;
65
- paymentMethod?: string;
66
- externalId?: string;
67
- createdAt: Date;
68
- lastPaymentAt?: Date;
69
- trialUntil?: Date;
70
- startsdAt: Date;
71
- expirationAt?: Date;
72
- endsAt?: Date;
73
- archiveAt?: Date;
74
- suspendedAt?: Date;
75
- canceledAt?: Date;
76
- blockedAt?: Date;
77
- suspendedUntil?: Date;
78
- status: SubscriptionStatus;
79
- /**
80
- * Custom capabilities for the particular subscription.
81
- */
82
- capabilities?: PermissionSet[];
91
+ pricingMode?: CheckoutPricingMode;
92
+ amountPolicy?: AmountCheckoutPolicy;
93
+ quantityPolicy?: QuantityCheckoutPolicy;
83
94
  /**
84
- * Custom limits for the particular subscription.
95
+ * How the price of a subscription splits for a withdrawal (CJEU C-641/19 PE Digital: pro rata
96
+ * temporis unless the contract states a separately priced component). Absent: the whole price is
97
+ * one `time` component.
85
98
  */
86
- limits?: {
87
- [key: string]: LimitConfig;
88
- };
89
- consumptions?: {
90
- [key: string]: CapabilityUsage;
99
+ withdrawal?: {
100
+ components: PlanWithdrawalComponent[];
91
101
  };
92
102
  }
103
+ /**
104
+ * One separately priced part of a plan. A `time` part is deducted pro rata by the days elapsed
105
+ * since the services were requested; a `units` part by the units used after consent. The shares
106
+ * of a plan sum to its price in minor units.
107
+ */
108
+ export interface PlanWithdrawalComponent {
109
+ key: string;
110
+ basis: WithdrawalBasis;
111
+ shareMinor: number;
112
+ }
113
+ export type WithdrawalBasis = 'time' | 'units';
114
+ export interface AmountCheckoutPolicy {
115
+ currency: string;
116
+ minimumMinor: number;
117
+ maximumMinor: number;
118
+ defaultMinor: number;
119
+ presetsMinor: number[];
120
+ fixedMinor: number;
121
+ rateBps: number;
122
+ }
123
+ export interface QuantityCheckoutPolicy {
124
+ minimum: number;
125
+ maximum: number;
126
+ default: number;
127
+ }
93
128
  export interface CreateCheckoutBody {
94
129
  productSku: string;
95
- sku?: string;
96
- entityId: string;
130
+ /** The plan to subscribe to, for a subscription checkout. */
131
+ planSku?: string;
132
+ /** Renameable organization value carried across a protocol boundary. */
133
+ entitySlug: string;
97
134
  service: string;
135
+ /** Net credit value for amount-priced checkouts, in integer currency minor units. */
136
+ amountMinor?: number;
98
137
  subscriptionId?: string;
99
138
  successUrl?: string;
100
139
  cancelUrl?: string;
140
+ /** The billing country the buyer declared (ISO 3166-1 alpha-2). A locked profile overrides it. */
141
+ country?: string;
142
+ /** The subscription start request recorded right before this checkout. */
143
+ startRequestId?: string;
101
144
  }
102
145
  export interface CreateCheckoutResponse {
103
146
  url: string;
104
147
  }
105
- export interface SubscriptionPropagateBody extends PlanSubscription {
106
- service: string;
107
- externalId: string;
108
- }
109
148
  /**
110
- * @deprecated Use SubscriptionPropagateBody instead
149
+ * What an entity may do and how much of each limit is left, at one instant.
150
+ *
151
+ * The one read both the server gate and the browser consume. Built by `entitlementViewOf`.
111
152
  */
112
- export type SubscriptionPropogateBody = SubscriptionPropagateBody;
113
- export interface LimitConfig {
114
- interval: PlanDuration;
153
+ export interface EntitlementView {
154
+ plan: EntitlementPlanView;
155
+ capabilities: CapabilityView[];
156
+ limits: LimitView[];
157
+ at: Date;
158
+ }
159
+ /** The effective plan and the subscription behind it. */
160
+ export interface EntitlementPlanView {
161
+ sku: string;
162
+ productSku: string;
163
+ title: string;
164
+ rank: number;
165
+ free: boolean;
166
+ status: SubscriptionStatus;
167
+ paygate: string;
168
+ subscriptionId?: string;
169
+ /** When the subscription was created — what a grandfathered promo is measured against. */
170
+ subscribedAt?: Date;
171
+ periodStart?: Date;
172
+ periodEnd?: Date;
173
+ cancelAtPeriodEnd?: boolean;
174
+ trialEnd?: Date;
175
+ pausedAt?: Date;
176
+ pastDue?: boolean;
177
+ /** The plan the entity falls back to when this one ends. */
178
+ fallbackSku?: string;
179
+ }
180
+ export interface CapabilityView {
181
+ /** `[scope:]permission`, exactly as the capability gate takes it. */
182
+ param: string;
183
+ scope: string;
184
+ permission: string;
185
+ value: boolean | number;
186
+ /** False when the set's promo is no longer in force. */
187
+ granted: boolean;
188
+ promo?: PromoView;
189
+ }
190
+ export interface LimitView {
191
+ key: string;
192
+ /** `limit:<key>`, exactly as the limit gate takes it. */
193
+ param: string;
194
+ kind: LimitKind;
195
+ window?: LimitWindow;
196
+ /** The ceiling in force now: `0` when a promo has lapsed. */
115
197
  limit: number;
116
- measurment?: string;
198
+ used: number;
199
+ /** `max(0, limit - used)`. */
200
+ remaining: number;
201
+ windowStart?: Date;
202
+ /** Exclusive: the first instant of the next window. */
203
+ resetsAt?: Date;
204
+ unit?: string;
205
+ promo?: PromoView;
206
+ }
207
+ export interface PromoView {
208
+ until: Date;
209
+ /** The subscription predates `until` and the promo grandfathers it. */
210
+ grandfathered: boolean;
211
+ active: boolean;
212
+ }
213
+ /**
214
+ * Declared once per configuration (a `PRICING_POLICY_RECORD_ID` singleton record). Absent entirely,
215
+ * `DEFAULT_PRICING_POLICY` applies: automatic tax and tax-id collection stay on for every checkout
216
+ * exactly as before this policy existed, no `behavior` is forced onto a synced price, no Adaptive
217
+ * Pricing, and the estimate endpoints stay off.
218
+ */
219
+ export interface PricingPolicy {
220
+ tax: {
221
+ /** Stripe Tax on every checkout session (`automatic_tax`, required billing address). */
222
+ automatic: boolean;
223
+ /**
224
+ * The behavior synced prices are given. Absent: a price's `tax_behavior` is left untouched
225
+ * (`unspecified`, following the Stripe account default) — never inferred, always declared.
226
+ */
227
+ behavior?: TaxBehavior;
228
+ /** VAT/GST id collection at checkout, for reverse charge. */
229
+ collectTaxId: boolean;
230
+ /** Serve `PaymentService`'s tax estimate endpoint. Requires `automatic`. */
231
+ estimate: boolean;
232
+ /** How long a tax estimate may be served from cache. Absent: the gateway's own default. */
233
+ estimateTtlSeconds?: number;
234
+ };
235
+ currency: {
236
+ /** Stripe Adaptive Pricing (`adaptive_pricing.enabled`) on every checkout session. */
237
+ adaptive?: boolean;
238
+ /**
239
+ * The conversion fee Adaptive Pricing adds to Stripe's base rate, as a fraction (`0.04` = 4%; Stripe
240
+ * documents 2–4% and decides it per currency) — a buyer pays `base-rate conversion × (1 + fee)`.
241
+ * The local-currency line of an estimate applies it, so a quoted total is the one Checkout shows.
242
+ * Absent: the FX Quotes API's own fee-inclusive rate (its `fx_fee_rate`, 2%), which is what a
243
+ * conversion through Stripe's FX costs, not what Adaptive Pricing charges. Requires `adaptive`.
244
+ */
245
+ adaptiveFeeRate?: number;
246
+ /** Serve the "≈ local total" line of an estimate. Requires `currency.adaptive`. */
247
+ estimate: boolean;
248
+ /** How long an FX quote may be served from cache. Absent: the gateway's own default. */
249
+ estimateTtlSeconds?: number;
250
+ };
251
+ }
252
+ export interface PriceEstimateBody {
253
+ /** Absent: the product's own reference plan (e.g. an amount-priced consumable). */
254
+ planSku?: string;
255
+ /** ISO 3166-1 alpha-2. Absent: taken from the entity's paygate customer, else `location-required`. */
256
+ country?: string;
117
257
  }
118
- export interface CapabilityUsage extends LimitConfig {
119
- startedAt: Date;
120
- refreshedAt?: Date;
121
- refreshAt?: Date;
122
- lastConsumedAt?: Date;
123
- consumption: number;
258
+ export interface TaxRateEstimate {
259
+ type: TaxType;
260
+ /** The rate as Stripe states it, e.g. `"23"` or `"8.5"` — display only. */
261
+ percentage: string;
262
+ /** The same rate as parts per million, exact: `23%` is `230000`. Never a float. */
263
+ ratePpm: number;
264
+ country?: string;
265
+ state?: string;
266
+ }
267
+ export interface TaxEstimate {
268
+ status: TaxEstimateStatus;
269
+ subtotalMinor: number;
270
+ taxMinor: number;
271
+ totalMinor: number;
272
+ /**
273
+ * Whether `rates` scales linearly to any other amount (a flat fee, a reduced-rate portion, or
274
+ * several inclusive rates do not). `false` means only the reference amount's own totals are
275
+ * trustworthy — a different amount shows "tax at checkout" instead of being rescaled.
276
+ */
277
+ scalable: boolean;
278
+ rates: TaxRateEstimate[];
279
+ }
280
+ export interface PriceEstimate {
281
+ /** The billing country the estimate was computed for, when one was resolved. */
282
+ country?: string;
283
+ /**
284
+ * Where that country came from — absent when neither the request nor the customer named one;
285
+ * `profile` when the entity's billing country is locked, which overrides the request.
286
+ */
287
+ source?: 'request' | 'customer' | 'profile';
288
+ /** The country is the locked billing country; a picker shows it and does not change it. */
289
+ locked?: boolean;
290
+ /** The consumer region of `country`. */
291
+ region?: ConsumerRegion;
292
+ /** The integration currency (lowercase ISO 4217) the amounts above and `tax` are stated in. */
293
+ currency: string;
294
+ behavior: TaxBehavior;
295
+ tax: TaxEstimate;
296
+ /** The approximate total in the country's own currency, when it differs and a rate was found. */
297
+ local?: {
298
+ currency: string;
299
+ /**
300
+ * Integration-currency (`currency` above) units per one unit of `local.currency`, fee-inclusive
301
+ * (Stripe FX Quotes, requested `to_currency: currency, from_currencies: [local.currency]`): the
302
+ * quote's `base_rate / (1 + currency.adaptiveFeeRate)` when the policy declares the Adaptive Pricing
303
+ * fee, else the quote's own `exchange_rate`. A local amount is `amountInCurrency / exchangeRate`.
304
+ */
305
+ exchangeRate: number;
306
+ /** The conversion fee `exchangeRate` includes: `currency.adaptiveFeeRate`, else the quote's `fx_fee_rate`. */
307
+ fxFeeRate?: number;
308
+ };
309
+ }
310
+ export interface PortalLinkBody {
311
+ flow: PortalFlow;
312
+ /** The target plan of a `PortalFlow.Change`. */
313
+ planSku?: string;
314
+ returnUrl?: string;
315
+ }
316
+ export interface PortalLinkResponse {
317
+ url: string;
318
+ }
319
+ /** One counter reading: how much of `key` is used in `window` (a `windowKeyOf` value). */
320
+ export interface LimitUsage {
321
+ key: string;
322
+ window: string;
323
+ used: number;
124
324
  }
125
325
  type PaymentEntity = Product | ProductPlan | PermissionSet;
126
326
  export interface PaymentService extends InitializedService {
@@ -131,6 +331,373 @@ export interface PaymentService extends InitializedService {
131
331
  allPlans: (productSku: string) => Promise<ProductPlan[]>;
132
332
  localize: (lng: string, entity: PaymentEntity) => Promise<Localization | null>;
133
333
  shallowAuthentication: (token: string | null) => Promise<string>;
334
+ /** The declared `PricingPolicy`, or `DEFAULT_PRICING_POLICY` when none was declared. */
335
+ pricingPolicy: () => Promise<PricingPolicy>;
336
+ /** The declared `ConsumerRightsPolicy`, or `null` when the application declared none. */
337
+ consumerRightsPolicy: () => Promise<ConsumerRightsPolicy | null>;
338
+ }
339
+ /** The legal documents and functions of one language. Every value is an absolute https URL. */
340
+ export interface ConsumerRightsLinks {
341
+ billingTerms: string;
342
+ withdrawalInformation?: string;
343
+ withdrawalForm?: string;
344
+ /** The public withdrawal function — the address the Billing Terms name. */
345
+ withdrawalFunction?: string;
346
+ /** The public cancellation page. */
347
+ cancellation?: string;
348
+ }
349
+ /** Which consumer-rights mechanisms an application runs. Each is a separate switch. */
350
+ export interface ConsumerRightsMechanisms {
351
+ /** Fix the billing country at the first purchase. */
352
+ countryLock: boolean;
353
+ /** The terms checkbox and text on every checkout (needs a terms URL at the paygate). */
354
+ checkoutTerms: boolean;
355
+ /** Ask for express consent before credits bought inside their window are spent. */
356
+ performanceConsent: boolean;
357
+ /** Ask for an express start request before a subscription checkout. */
358
+ subscriptionStart: boolean;
359
+ /** The withdrawal function. */
360
+ withdrawal: boolean;
361
+ /** Execute a withdrawal's refund at the paygate without an operator. */
362
+ automaticRefunds: boolean;
363
+ /** The cancellation function. */
364
+ cancellation: boolean;
365
+ /** The purchase confirmation e-mail with the withdrawal information. */
366
+ purchaseConfirmation: boolean;
367
+ }
368
+ /**
369
+ * Declared once per configuration (a `CONSUMER_RIGHTS_RECORD_ID` singleton record). Carries no
370
+ * secret — it is advertised to the browser, which renders the same links and switches the server
371
+ * enforces.
372
+ */
373
+ export interface ConsumerRightsPolicy {
374
+ /** The version of the application's Billing Terms and consent wording; a consent records it. */
375
+ textVersion: string;
376
+ /** ISO 3166-1 alpha-2 countries whose consumers have the rights. */
377
+ countries: string[];
378
+ /** An unknown billing country is protected (treated as in scope) or ignored. */
379
+ unknownCountry: 'protect' | 'ignore';
380
+ withdrawalDays: number;
381
+ deadline: {
382
+ weekendRollover: boolean;
383
+ marginDays: number;
384
+ };
385
+ mechanisms: ConsumerRightsMechanisms;
386
+ /** The charge currency per region (lowercase ISO 4217), e.g. `{ eu: 'eur', other: 'usd' }`. */
387
+ currencies?: Partial<Record<ConsumerRegion, string>>;
388
+ /** Country → language of the legal copy, over `COUNTRY_LANGUAGES`. */
389
+ languages?: Record<string, string>;
390
+ defaultLanguage: string;
391
+ /** Per language; `defaultLanguage` must be present. */
392
+ links: Record<string, ConsumerRightsLinks>;
393
+ /** Whether a renewal opens a new withdrawal window. Off by default. */
394
+ renewalOpensWindow?: boolean;
395
+ /** How long a subscription start request stays usable. */
396
+ startRequestTtlSeconds?: number;
397
+ /** Whether a buyer with a business tax id is exempt. Off by default: everyone is protected. */
398
+ exemptBusinesses?: boolean;
399
+ /**
400
+ * The copy variant of the performance consent (`^[a-z][a-z0-9-]*$`): its texts are read as
401
+ * `<key>_<consentContext>` first, the base key where no variant exists. Absent: the base texts.
402
+ */
403
+ consentContext?: string;
404
+ }
405
+ /** An entity's billing country, fixed at the first purchase. */
406
+ export interface BillingProfileView {
407
+ country: string | null;
408
+ region: ConsumerRegion | null;
409
+ /** The charge currency, fixed with the country. */
410
+ currency: string | null;
411
+ locked: boolean;
412
+ lockedAt?: Date;
413
+ /** The language of the legal copy for this country. */
414
+ language: string;
415
+ inScope: boolean;
416
+ }
417
+ /** One purchase — a contract — and its withdrawal window. */
418
+ export interface PurchaseView {
419
+ purchaseId: string;
420
+ /** The human contract reference a consumer quotes. */
421
+ contractRef: string;
422
+ kind: PurchaseKind;
423
+ purchasedAt: Date;
424
+ /** Exclusive end of the withdrawal window; absent outside the consumer-rights territories. */
425
+ deadline?: Date;
426
+ productSku: string;
427
+ planSku?: string;
428
+ amountTotalMinor: number;
429
+ currency: string;
430
+ consentedAt?: Date;
431
+ withdrawnAt?: Date;
432
+ /** Inside its window, not withdrawn, and something would be reimbursed. */
433
+ withdrawable: boolean;
434
+ }
435
+ export interface PurchaseList {
436
+ purchases: PurchaseView[];
437
+ }
438
+ /** Whether billed work needs the consumer's express consent now, and what it would cover. */
439
+ export interface PerformanceConsentView {
440
+ required: boolean;
441
+ region: ConsumerRegion | null;
442
+ country: string | null;
443
+ /** The language of the legal copy (the billing country's). */
444
+ language: string;
445
+ /** The trader named in the statement. */
446
+ trader: string;
447
+ /** The policy's `consentContext`: the copy variant the statement is rendered with. */
448
+ context?: string;
449
+ textVersion: string;
450
+ copyVersion: string;
451
+ links: ConsumerRightsLinks;
452
+ /** The open, unconsented purchases the consent would cover. */
453
+ purchases: PurchaseView[];
454
+ /** The latest deadline among them. */
455
+ deadline?: Date;
456
+ at: Date;
457
+ }
458
+ export interface PerformanceConsentBody {
459
+ purchaseIds: string[];
460
+ textVersion: string;
461
+ /** The language the statement was SHOWN in. */
462
+ language: string;
463
+ acknowledged: true;
464
+ uiLanguage?: string;
465
+ }
466
+ export interface PerformanceConsentResponse {
467
+ consentId: string;
468
+ consentedAt: Date;
469
+ purchaseIds: string[];
470
+ mailed: boolean;
471
+ }
472
+ export interface SubscriptionStartQuery {
473
+ planSku: string;
474
+ }
475
+ /** Whether a subscription checkout needs an express start request first. */
476
+ export interface SubscriptionStartView {
477
+ required: boolean;
478
+ planSku: string;
479
+ language: string;
480
+ trader: string;
481
+ /**
482
+ * The copy variant the statement is rendered with — `startContextOf(plan)`: `'units'` for a plan
483
+ * with a `units` withdrawal component, absent for one withdrawn pro rata by time only.
484
+ */
485
+ context?: string;
486
+ textVersion: string;
487
+ copyVersion: string;
488
+ links: ConsumerRightsLinks;
489
+ region: ConsumerRegion | null;
490
+ }
491
+ export interface SubscriptionStartBody {
492
+ planSku: string;
493
+ textVersion: string;
494
+ language: string;
495
+ acknowledged: true;
496
+ }
497
+ export interface SubscriptionStartResponse {
498
+ startRequestId: string;
499
+ requestedAt: Date;
500
+ expiresAt: Date;
501
+ }
502
+ /** What a withdrawal would reimburse now. */
503
+ export interface WithdrawalEstimate {
504
+ refundMinor: number;
505
+ currency: string;
506
+ timeDeductionMinor: number;
507
+ unitsDeductionMinor: number;
508
+ elapsedDays?: number;
509
+ periodDays?: number;
510
+ unitsUsed?: number;
511
+ unitsGranted?: number;
512
+ }
513
+ export interface WithdrawalCandidate {
514
+ purchaseId: string;
515
+ contractRef: string;
516
+ kind: PurchaseKind;
517
+ purchasedAt: Date;
518
+ deadline: Date;
519
+ amountTotalMinor: number;
520
+ currency: string;
521
+ /** `null` when it cannot be computed (no usage meter). */
522
+ estimate: WithdrawalEstimate | null;
523
+ /** The refund is executed without an operator. */
524
+ automatic: boolean;
525
+ }
526
+ export interface WithdrawalCandidateList {
527
+ candidates: WithdrawalCandidate[];
528
+ language: string;
529
+ links: ConsumerRightsLinks;
530
+ /** Prefill for the form. */
531
+ name?: string;
532
+ email?: string;
533
+ }
534
+ /**
535
+ * A withdrawal declaration. In-app it names `purchaseId`; on the public page `contractRef` (or an
536
+ * invoice number) plus the e-mail of the purchase. Only name, contract and e-mail are asked.
537
+ */
538
+ export interface WithdrawalBody {
539
+ purchaseId?: string;
540
+ contractRef?: string;
541
+ name: string;
542
+ email: string;
543
+ language?: string;
544
+ /** A field a person never fills — a filled one marks a bot on a public form. */
545
+ honeypot?: string;
546
+ }
547
+ /** The receipt of a declaration: what was declared and when it arrived. */
548
+ export interface DeclarationReceipt {
549
+ declarationId: string;
550
+ receivedAt: Date;
551
+ /** The declaration as received, field by field — echoed, never enriched with a match. */
552
+ content: Record<string, string>;
553
+ mailed: boolean;
554
+ }
555
+ export interface WithdrawalReceipt extends DeclarationReceipt {
556
+ status: WithdrawalStatus;
557
+ refundMinor?: number;
558
+ currency?: string;
559
+ subscriptionCanceled?: boolean;
560
+ }
561
+ export interface CancellationBody {
562
+ kind: CancellationKind;
563
+ /** Required for an extraordinary cancellation. */
564
+ reason?: string;
565
+ name: string;
566
+ contractRef?: string;
567
+ subscriptionId?: string;
568
+ effective: 'earliest' | 'date';
569
+ /** `YYYY-MM-DD`, with `effective: 'date'`. */
570
+ date?: string;
571
+ email: string;
572
+ language?: string;
573
+ /** A field a person never fills — a filled one marks a bot on a public form. */
574
+ honeypot?: string;
575
+ }
576
+ export interface CancellationReceipt extends DeclarationReceipt {
577
+ status: CancellationStatus;
578
+ effectiveAt?: Date;
579
+ }
580
+ /** What the public legal pages need without a login. */
581
+ export interface ConsumerRightsPublicView {
582
+ mechanisms: Pick<ConsumerRightsMechanisms, 'withdrawal' | 'cancellation'>;
583
+ languages: string[];
584
+ links: Record<string, ConsumerRightsLinks>;
585
+ textVersion: string;
586
+ }
587
+ /**
588
+ * One narrowing of an amount checkout's maximum — what a checkout plugin (a spending tier, a
589
+ * rolling cap) answers for one entity at one instant.
590
+ */
591
+ export interface AmountNarrowing {
592
+ /** The largest amount (net credit value, minor units) this narrowing allows now. */
593
+ maximumMinor: number;
594
+ /** Why — a stable key a UI phrases (`per-purchase`, `window`, `hold` …). */
595
+ reason: string;
596
+ /** When the narrowing lifts or widens. */
597
+ resetsAt?: Date;
598
+ /** What is left of a rolling allowance, when that is the cause. */
599
+ remainingMinor?: number;
600
+ }
601
+ /**
602
+ * The narrowed limit of an amount checkout, shared by the server's refusal and the dialog's
603
+ * control. `blocked` means no amount may be bought now.
604
+ */
605
+ export interface CheckoutLimitView {
606
+ productSku: string;
607
+ planSku?: string;
608
+ currency: string;
609
+ minimumMinor: number;
610
+ /** The narrowed maximum — below `minimumMinor` when `blocked`. */
611
+ maximumMinor: number;
612
+ narrowed: boolean;
613
+ blocked: boolean;
614
+ reason?: string;
615
+ resetsAt?: Date;
616
+ remainingMinor?: number;
617
+ }
618
+ /** An amount policy as narrowed for one entity, and the limit that narrowed it (`null`: none). */
619
+ export interface AmountPolicyView {
620
+ policy: AmountCheckoutPolicy;
621
+ limit: CheckoutLimitView | null;
622
+ }
623
+ export interface AmountPolicyQuery {
624
+ productSku: string;
625
+ planSku?: string;
626
+ }
627
+ /** One price of a plan in one currency, as the paygate charges it. */
628
+ export interface PlanPriceView {
629
+ planSku: string;
630
+ currency: string;
631
+ unitAmountMinor: number;
632
+ /** The price's default currency (the others are currency options). */
633
+ default: boolean;
634
+ taxBehavior?: TaxBehavior;
635
+ interval?: 'month' | 'year';
636
+ }
637
+ export interface PlanPriceList {
638
+ prices: PlanPriceView[];
639
+ }
640
+ export interface PlanPricesQuery {
641
+ productSku: string;
642
+ }
643
+ export interface EntitlementParam {
644
+ /** Capability scope. Absent means any scope. */
645
+ scope?: string;
646
+ /** The permission key inside `PermissionSet.permissions`. */
647
+ permission: string;
648
+ /** Numeric floor: `credits>=100` passes when the held value is a number at least that big. */
649
+ atLeast?: number;
650
+ }
651
+ export interface LimitExhaustedDetails {
652
+ key: string;
653
+ used: number;
654
+ limit: number;
655
+ /** When the window renews. Absent for a limit that never renews. */
656
+ resetsAt?: Date;
657
+ }
658
+ export interface PerformanceConsentRequiredDetails {
659
+ /** How many open purchases wait for consent. */
660
+ pending: number;
661
+ /** The latest of their deadlines. */
662
+ deadline?: Date;
663
+ }
664
+ export interface BillingCountryLockedDetails {
665
+ /** The locked country. */
666
+ country: string;
667
+ /** The country the request declared. */
668
+ requested?: string;
669
+ }
670
+ export interface CheckoutLimitExceededDetails {
671
+ /** The key of the narrowing that set the maximum. */
672
+ reason: string;
673
+ /** The narrowed maximum, net minor units — below the policy minimum when nothing may be bought. */
674
+ maximumMinor: number;
675
+ currency: string;
676
+ resetsAt?: Date;
677
+ }
678
+ export interface AmountEstimate {
679
+ subtotalMinor: number;
680
+ /** `null` when `estimate` cannot be rescaled to this amount (see `TaxEstimate.scalable`). */
681
+ taxMinor: number | null;
682
+ totalMinor: number | null;
683
+ /**
684
+ * The subtotal, tax and total in the country's own currency, in major units — present only
685
+ * alongside a non-`null` `totalMinor`. A UI showing `local` shows ONLY `local` for the tax and
686
+ * total (marked `≈`, since it is Stripe's own rate at read time, not the checkout rate); the
687
+ * integration-currency amounts stay the reference for bookkeeping, never a second figure to show
688
+ * alongside the converted one.
689
+ */
690
+ local?: {
691
+ currency: string;
692
+ subtotalAmount: number;
693
+ taxAmount: number;
694
+ totalAmount: number;
695
+ };
696
+ }
697
+ export interface LimitParam {
698
+ key: string;
699
+ /** How much room the requirement needs. `1` when the parameter states no floor. */
700
+ atLeast: number;
134
701
  }
135
702
  export {};
136
703
  //# sourceMappingURL=types.d.ts.map