@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/errors.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { ResilientError } from '@owlmeans/error';
2
+ import { AuthForbidden } from '@owlmeans/auth';
3
+ import { BILLING_COUNTRY_LOCKED_MARKER, CANCELLATION_UNAVAILABLE_MARKER, CAPABILITY_REQUIRED_MARKER, CHECKOUT_LIMIT_MARKER, LIMIT_EXHAUSTED_FIELDS, LIMIT_EXHAUSTED_MARKER, PERFORMANCE_CONSENT_MARKER, SUBSCRIPTION_START_MARKER, WITHDRAWAL_UNAVAILABLE_MARKER } from './consts.local.js';
2
4
  export class PaymentError extends ResilientError {
3
5
  static typeName = 'PaymentError';
4
6
  constructor(message = 'error') {
@@ -26,6 +28,20 @@ export class PaygateMappingError extends PaygateError {
26
28
  this.type = PaygateMappingError.typeName;
27
29
  }
28
30
  }
31
+ /**
32
+ * A webhook delivery whose signature is missing or verifies against no known secret. The sender is
33
+ * refused as a client error (400): a forged or unsigned POST at a public hook is not a server fault,
34
+ * and answering 500 would page operators for it and invite the sender to retry it.
35
+ */
36
+ export class PaygateSignatureError extends PaygateError {
37
+ static typeName = `${PaygateError.typeName}Signature`;
38
+ /** Read by the HTTP boundary (`server-api` `declaredErrorStatus`). */
39
+ static httpStatus = 400;
40
+ constructor() {
41
+ super('signature');
42
+ this.type = PaygateSignatureError.typeName;
43
+ }
44
+ }
29
45
  export class ProductError extends PaymentError {
30
46
  static typeName = `${PaymentError.typeName}Product`;
31
47
  constructor(message = 'error') {
@@ -68,14 +84,359 @@ export class UnknownSubscription extends SubscriptionError {
68
84
  this.type = UnknownSubscription.typeName;
69
85
  }
70
86
  }
87
+ export class LimitUnknown extends ProductError {
88
+ static typeName = `${ProductError.typeName}LimitUnknown`;
89
+ constructor(message = 'error') {
90
+ super(`limit-unknown:${message}`);
91
+ this.type = LimitUnknown.typeName;
92
+ }
93
+ }
94
+ export class LimitMisdeclared extends ProductError {
95
+ static typeName = `${ProductError.typeName}LimitMisdeclared`;
96
+ constructor(message = 'error') {
97
+ super(`limit-misdeclared:${message}`);
98
+ this.type = LimitMisdeclared.typeName;
99
+ }
100
+ }
101
+ export class PlanRequired extends ProductError {
102
+ static typeName = `${ProductError.typeName}PlanRequired`;
103
+ constructor(message = 'error') {
104
+ super(`plan-required:${message}`);
105
+ this.type = PlanRequired.typeName;
106
+ }
107
+ }
108
+ export class PlanRankConflict extends ProductError {
109
+ static typeName = `${ProductError.typeName}PlanRankConflict`;
110
+ constructor(message = 'error') {
111
+ super(`plan-rank-conflict:${message}`);
112
+ this.type = PlanRankConflict.typeName;
113
+ }
114
+ }
115
+ export class WebhookSetupError extends PaygateError {
116
+ static typeName = `${PaygateError.typeName}WebhookSetup`;
117
+ constructor(message = 'error') {
118
+ super(`webhook-setup:${message}`);
119
+ this.type = WebhookSetupError.typeName;
120
+ }
121
+ }
122
+ /**
123
+ * The entity has nothing the requested portal flow can act on — no paygate customer, no entitling
124
+ * subscription, no plan or item to change to. The entity's own state, not a fault: an HTTP boundary
125
+ * that honours `httpStatus` (`@owlmeans/server-api`) answers 409 Conflict.
126
+ */
127
+ export class PortalUnavailable extends PaygateError {
128
+ static typeName = `${PaygateError.typeName}PortalUnavailable`;
129
+ static httpStatus = 409;
130
+ constructor(message = 'error') {
131
+ super(`portal-unavailable:${message}`);
132
+ this.type = PortalUnavailable.typeName;
133
+ }
134
+ }
135
+ /**
136
+ * The entity's plan does not allow the request.
137
+ *
138
+ * Extends `AuthForbidden` so an HTTP boundary answers 403, never 500. Only `type` and `message`
139
+ * survive a marshal round trip, so each subclass packs its fields into the message and rebuilds
140
+ * them in `finalizeUnmarshal()`.
141
+ */
142
+ export class EntitlementRefusal extends AuthForbidden {
143
+ static typeName = 'EntitlementRefusal';
144
+ constructor(message = 'error') {
145
+ super(`entitlement:${message}`);
146
+ this.type = EntitlementRefusal.typeName;
147
+ }
148
+ }
149
+ /** None of the capability parameters (OR'd) is granted. Message marker `capability-required:<a|b>`. */
150
+ export class CapabilityRequired extends EntitlementRefusal {
151
+ static typeName = `${EntitlementRefusal.typeName}CapabilityRequired`;
152
+ /** The refused parameters, as the gate took them. */
153
+ params = [];
154
+ constructor(params = []) {
155
+ const list = (Array.isArray(params) ? params : [params]).filter(param => param !== '');
156
+ super(`${CAPABILITY_REQUIRED_MARKER}${list.join('|')}`);
157
+ this.type = CapabilityRequired.typeName;
158
+ this.applyFields();
159
+ }
160
+ applyFields() {
161
+ const at = this.message.indexOf(CAPABILITY_REQUIRED_MARKER);
162
+ const packed = at < 0 ? '' : this.message.slice(at + CAPABILITY_REQUIRED_MARKER.length);
163
+ this.params = packed.split('|').filter(param => param !== '');
164
+ }
165
+ finalizeUnmarshal() {
166
+ this.applyFields();
167
+ }
168
+ }
169
+ /**
170
+ * A limit has no room left. Message marker `limit-exhausted:<key>:<used>/<limit>[:<resetsAt ISO>]`.
171
+ */
172
+ export class LimitExhausted extends EntitlementRefusal {
173
+ static typeName = `${EntitlementRefusal.typeName}LimitExhausted`;
174
+ limitKey = '';
175
+ used = 0;
176
+ limit = 0;
177
+ resetsAt;
178
+ /** The packed marker body of a refusal. */
179
+ static encode(details) {
180
+ const resetsAt = details.resetsAt != null && !Number.isNaN(details.resetsAt.getTime())
181
+ ? `:${details.resetsAt.toISOString()}` : '';
182
+ return `${details.key}:${details.used}/${details.limit}${resetsAt}`;
183
+ }
184
+ constructor(details = 'error') {
185
+ super(`${LIMIT_EXHAUSTED_MARKER}${typeof details === 'string' ? details : LimitExhausted.encode(details)}`);
186
+ this.type = LimitExhausted.typeName;
187
+ this.applyFields();
188
+ }
189
+ applyFields() {
190
+ const at = this.message.indexOf(LIMIT_EXHAUSTED_MARKER);
191
+ const match = at < 0 ? null
192
+ : LIMIT_EXHAUSTED_FIELDS.exec(this.message.slice(at + LIMIT_EXHAUSTED_MARKER.length));
193
+ if (match == null) {
194
+ return;
195
+ }
196
+ const [, key, used, limit, resetsAt] = match;
197
+ this.limitKey = key;
198
+ this.used = Number(used) || 0;
199
+ this.limit = Number(limit) || 0;
200
+ const date = resetsAt != null ? new Date(resetsAt) : null;
201
+ this.resetsAt = date != null && !Number.isNaN(date.getTime()) ? date : undefined;
202
+ }
203
+ finalizeUnmarshal() {
204
+ this.applyFields();
205
+ }
206
+ }
207
+ /**
208
+ * A consumer-rights fault — a misdeclared policy (`policy:<field>`), a missing usage meter or
209
+ * mailer, a copy template without a value (`copy:<path>`). Declares no status: 500.
210
+ */
211
+ export class ConsumerRightsError extends PaymentError {
212
+ static typeName = `${PaymentError.typeName}ConsumerRights`;
213
+ constructor(message = 'error') {
214
+ super(`consumer-rights:${message}`);
215
+ this.type = ConsumerRightsError.typeName;
216
+ }
217
+ }
218
+ /**
219
+ * The consumer's own position refuses the request — never a fault. Deliberately NOT an
220
+ * `AuthForbidden`: an HTTP boundary tests that family first, and a 403 would hide the declared
221
+ * 428/409 a client acts on.
222
+ */
223
+ export class ConsumerRightsRefusal extends ConsumerRightsError {
224
+ static typeName = `${ConsumerRightsError.typeName}Refusal`;
225
+ constructor(message = 'error') {
226
+ super(message);
227
+ this.type = ConsumerRightsRefusal.typeName;
228
+ }
229
+ }
230
+ /** The packed body after the LAST marker occurrence — a registry rebuild doubles the prefix. */
231
+ const packedAfter = (message, marker) => {
232
+ const at = message.lastIndexOf(marker);
233
+ return at < 0 ? null : message.slice(at + marker.length);
234
+ };
235
+ const dateOf = (value) => {
236
+ const date = value != null && value !== '' ? new Date(value) : null;
237
+ return date != null && !Number.isNaN(date.getTime()) ? date : undefined;
238
+ };
239
+ const isoOf = (date) => date != null && !Number.isNaN(date.getTime()) ? `:${date.toISOString()}` : '';
240
+ const decode = (value) => {
241
+ try {
242
+ return decodeURIComponent(value);
243
+ }
244
+ catch {
245
+ return value;
246
+ }
247
+ };
248
+ /**
249
+ * Billed work would spend credits of a purchase still inside its withdrawal window, and the
250
+ * consumer has not expressly requested performance. HTTP 428. Marker
251
+ * `performance-consent-required:<pending>[:<deadline ISO>]`.
252
+ */
253
+ export class PerformanceConsentRequired extends ConsumerRightsRefusal {
254
+ static typeName = `${ConsumerRightsRefusal.typeName}PerformanceConsentRequired`;
255
+ static httpStatus = 428;
256
+ pending = 0;
257
+ deadline;
258
+ static encode(details) {
259
+ return `${Math.max(0, Math.floor(details.pending))}${isoOf(details.deadline)}`;
260
+ }
261
+ constructor(details = 'error') {
262
+ super(`${PERFORMANCE_CONSENT_MARKER}${typeof details === 'string' ? details : PerformanceConsentRequired.encode(details)}`);
263
+ this.type = PerformanceConsentRequired.typeName;
264
+ this.applyFields();
265
+ }
266
+ applyFields() {
267
+ const match = /^(\d+)(?::(.+))?$/.exec(packedAfter(this.message, PERFORMANCE_CONSENT_MARKER) ?? '');
268
+ if (match == null) {
269
+ return;
270
+ }
271
+ this.pending = Number(match[1]);
272
+ this.deadline = dateOf(match[2]);
273
+ }
274
+ finalizeUnmarshal() {
275
+ this.applyFields();
276
+ }
277
+ }
278
+ /**
279
+ * A subscription checkout needs a fresh express start request bound to this plan. HTTP 428.
280
+ * Marker `subscription-start-required:<encodeURIComponent(planSku)>`.
281
+ */
282
+ export class SubscriptionStartRequired extends ConsumerRightsRefusal {
283
+ static typeName = `${ConsumerRightsRefusal.typeName}SubscriptionStartRequired`;
284
+ static httpStatus = 428;
285
+ planSku = '';
286
+ static encode(planSku) {
287
+ return encodeURIComponent(planSku);
288
+ }
289
+ /** `planSku` as is, or a packed marker body / marshaled message (the registry's path). */
290
+ constructor(planSku = 'error') {
291
+ super(`${SUBSCRIPTION_START_MARKER}${typeof planSku === 'string' ? SubscriptionStartRequired.encodeLoose(planSku) : SubscriptionStartRequired.encode(planSku.planSku)}`);
292
+ this.type = SubscriptionStartRequired.typeName;
293
+ this.applyFields();
294
+ }
295
+ /** A string that already is a marker (the registry path) passes through unencoded. */
296
+ static encodeLoose(value) {
297
+ return value.includes(SUBSCRIPTION_START_MARKER) ? value : SubscriptionStartRequired.encode(value);
298
+ }
299
+ applyFields() {
300
+ const packed = packedAfter(this.message, SUBSCRIPTION_START_MARKER);
301
+ if (packed != null) {
302
+ this.planSku = decode(packed);
303
+ }
304
+ }
305
+ finalizeUnmarshal() {
306
+ this.applyFields();
307
+ }
308
+ }
309
+ /**
310
+ * The entity's billing country is fixed and the request declared another. HTTP 409. Marker
311
+ * `billing-country-locked:<country>[:<requested>]`.
312
+ */
313
+ export class BillingCountryLocked extends ConsumerRightsRefusal {
314
+ static typeName = `${ConsumerRightsRefusal.typeName}BillingCountryLocked`;
315
+ static httpStatus = 409;
316
+ country = '';
317
+ requested;
318
+ static encode(details) {
319
+ return details.requested != null && details.requested !== ''
320
+ ? `${details.country}:${details.requested}` : details.country;
321
+ }
322
+ constructor(details = 'error') {
323
+ super(`${BILLING_COUNTRY_LOCKED_MARKER}${typeof details === 'string' ? details : BillingCountryLocked.encode(details)}`);
324
+ this.type = BillingCountryLocked.typeName;
325
+ this.applyFields();
326
+ }
327
+ applyFields() {
328
+ const match = /^([A-Za-z]{2})(?::([A-Za-z]{2}))?$/.exec(packedAfter(this.message, BILLING_COUNTRY_LOCKED_MARKER) ?? '');
329
+ if (match == null) {
330
+ return;
331
+ }
332
+ this.country = match[1];
333
+ this.requested = match[2];
334
+ }
335
+ finalizeUnmarshal() {
336
+ this.applyFields();
337
+ }
338
+ }
339
+ /**
340
+ * The named purchase cannot be withdrawn from (`WithdrawalUnavailableReason`). HTTP 409. Marker
341
+ * `withdrawal-unavailable:<reason>`. Never raised on the public page, which discloses nothing.
342
+ */
343
+ export class WithdrawalUnavailable extends ConsumerRightsRefusal {
344
+ static typeName = `${ConsumerRightsRefusal.typeName}WithdrawalUnavailable`;
345
+ static httpStatus = 409;
346
+ reason = '';
347
+ constructor(reason = 'error') {
348
+ super(`${WITHDRAWAL_UNAVAILABLE_MARKER}${reason}`);
349
+ this.type = WithdrawalUnavailable.typeName;
350
+ this.applyFields();
351
+ }
352
+ applyFields() {
353
+ this.reason = /^[\w-]*/.exec(packedAfter(this.message, WITHDRAWAL_UNAVAILABLE_MARKER) ?? '')?.[0] ?? '';
354
+ }
355
+ finalizeUnmarshal() {
356
+ this.applyFields();
357
+ }
358
+ }
359
+ /**
360
+ * Nothing to cancel in-app (`CancellationUnavailableReason`). HTTP 409. Marker
361
+ * `cancellation-unavailable:<reason>`.
362
+ */
363
+ export class CancellationUnavailable extends ConsumerRightsRefusal {
364
+ static typeName = `${ConsumerRightsRefusal.typeName}CancellationUnavailable`;
365
+ static httpStatus = 409;
366
+ reason = '';
367
+ constructor(reason = 'error') {
368
+ super(`${CANCELLATION_UNAVAILABLE_MARKER}${reason}`);
369
+ this.type = CancellationUnavailable.typeName;
370
+ this.applyFields();
371
+ }
372
+ applyFields() {
373
+ this.reason = /^[\w-]*/.exec(packedAfter(this.message, CANCELLATION_UNAVAILABLE_MARKER) ?? '')?.[0] ?? '';
374
+ }
375
+ finalizeUnmarshal() {
376
+ this.applyFields();
377
+ }
378
+ }
379
+ /**
380
+ * The amount is above what this entity may buy now (a narrowing of the plan's policy). HTTP 409.
381
+ * Marker `checkout-limit-exceeded:<encodeURIComponent(reason)>:<maximumMinor>:<currency>[:<ISO>]`.
382
+ * A payment refusal, not a consumer-rights one.
383
+ */
384
+ export class CheckoutLimitExceeded extends PaymentError {
385
+ static typeName = `${PaymentError.typeName}CheckoutLimitExceeded`;
386
+ static httpStatus = 409;
387
+ reason = '';
388
+ maximumMinor = 0;
389
+ currency = '';
390
+ resetsAt;
391
+ static encode(details) {
392
+ return `${encodeURIComponent(details.reason)}:${Math.max(0, Math.floor(details.maximumMinor))}`
393
+ + `:${details.currency.toLowerCase()}${isoOf(details.resetsAt)}`;
394
+ }
395
+ constructor(details = 'error') {
396
+ super(`${CHECKOUT_LIMIT_MARKER}${typeof details === 'string' ? details : CheckoutLimitExceeded.encode(details)}`);
397
+ this.type = CheckoutLimitExceeded.typeName;
398
+ this.applyFields();
399
+ }
400
+ applyFields() {
401
+ const match = /^([^:]*):(\d+):([a-z]{3})(?::(.+))?$/.exec(packedAfter(this.message, CHECKOUT_LIMIT_MARKER) ?? '');
402
+ if (match == null) {
403
+ return;
404
+ }
405
+ this.reason = decode(match[1]);
406
+ this.maximumMinor = Number(match[2]);
407
+ this.currency = match[3];
408
+ this.resetsAt = dateOf(match[4]);
409
+ }
410
+ finalizeUnmarshal() {
411
+ this.applyFields();
412
+ }
413
+ }
71
414
  ResilientError.registerErrorClass(PaymentError);
72
415
  ResilientError.registerErrorClass(PaygateError);
73
416
  ResilientError.registerErrorClass(UnknownPaygate);
74
417
  ResilientError.registerErrorClass(PaygateMappingError);
418
+ ResilientError.registerErrorClass(PaygateSignatureError);
75
419
  ResilientError.registerErrorClass(ProductError);
76
420
  ResilientError.registerErrorClass(UnknownProduct);
77
421
  ResilientError.registerErrorClass(UnknownPlan);
78
422
  ResilientError.registerErrorClass(PaymentIdentificationError);
79
423
  ResilientError.registerErrorClass(SubscriptionError);
80
424
  ResilientError.registerErrorClass(UnknownSubscription);
425
+ ResilientError.registerErrorClass(LimitUnknown);
426
+ ResilientError.registerErrorClass(LimitMisdeclared);
427
+ ResilientError.registerErrorClass(PlanRequired);
428
+ ResilientError.registerErrorClass(PlanRankConflict);
429
+ ResilientError.registerErrorClass(WebhookSetupError);
430
+ ResilientError.registerErrorClass(PortalUnavailable);
431
+ ResilientError.registerErrorClass(EntitlementRefusal);
432
+ ResilientError.registerErrorClass(CapabilityRequired);
433
+ ResilientError.registerErrorClass(LimitExhausted);
434
+ ResilientError.registerErrorClass(ConsumerRightsError);
435
+ ResilientError.registerErrorClass(ConsumerRightsRefusal);
436
+ ResilientError.registerErrorClass(PerformanceConsentRequired);
437
+ ResilientError.registerErrorClass(SubscriptionStartRequired);
438
+ ResilientError.registerErrorClass(BillingCountryLocked);
439
+ ResilientError.registerErrorClass(WithdrawalUnavailable);
440
+ ResilientError.registerErrorClass(CancellationUnavailable);
441
+ ResilientError.registerErrorClass(CheckoutLimitExceeded);
81
442
  //# sourceMappingURL=errors.js.map
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cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;AACtD,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;AACnD,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;AACnD,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;AACrD,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;AACrD,cAAc,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;AACjD,cAAc,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;AACtD,cAAc,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;AACxD,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;AAC7D,cAAc,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAA;AAC5D,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;AACvD,cAAc,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;AACxD,cAAc,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;AAC1D,cAAc,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,34 @@
1
+ import type { AmountEstimate, PriceEstimate, PricingPolicy } from '../types.js';
2
+ /** The pricing policy's invariants and the tax / local-currency estimate of an amount. */
3
+ export interface PriceEstimateHelper {
4
+ /**
5
+ * @throws PaymentError when a tax estimate is served without automatic tax, a currency estimate is
6
+ * served without Adaptive Pricing, or a TTL is not a positive integer.
7
+ */
8
+ assertPricingPolicy: (policy: PricingPolicy) => PricingPolicy;
9
+ /**
10
+ * Stripe's `percentage_decimal` (e.g. `"23"`, `"8.875"`) as parts per million — `1_000_000` is
11
+ * `100%` — parsed digit by digit so it is exact where a float parse (`Number(x) * 10_000`) is not.
12
+ * Fractional digits past the fourth are truncated, not rounded: a quarter of a hundredth of a
13
+ * percent is already far finer than any real tax rate.
14
+ *
15
+ * @throws PaymentError when the string is not a plain (unsigned, non-exponential) decimal.
16
+ */
17
+ ratePpmOf: (percentageDecimal: string) => number;
18
+ /**
19
+ * Re-derive tax and the local-currency total for `amountMinor` from a `PriceEstimate` already
20
+ * fetched for the SAME product/plan/country, so a UI can re-price a custom amount (the credit
21
+ * dialog) without a second Stripe Tax call ($0.05 each).
22
+ *
23
+ * Exact for `amountMinor === estimate.tax.subtotalMinor` (Stripe's own numbers, echoed back).
24
+ * Otherwise exact only for `TaxBehavior.Exclusive` with `estimate.tax.scalable` — a linear
25
+ * percentage rate scales; a flat fee, a reduced-rate portion, or several inclusive rates do not, and
26
+ * neither does rescaling an inclusive amount (its tax portion is carved OUT of the total by a
27
+ * different formula this helper does not attempt). Both cases return `null` amounts, meaning
28
+ * "computed at checkout".
29
+ *
30
+ * @throws PaymentError when `amountMinor` is not a non-negative safe integer.
31
+ */
32
+ estimateOf: (amountMinor: number, estimate: PriceEstimate) => AmountEstimate;
33
+ }
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/estimate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/E,0FAA0F;AAC1F,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,mBAAmB,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,aAAa,CAAA;IAC7D;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,MAAM,CAAA;IAChD;;;;;;;;;;;;;OAaG;IACH,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,cAAc,CAAA;CAC7E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/estimate/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { PriceEstimate, PricingPolicy, AmountEstimate } from './types.js';
2
+ import type { PriceEstimateHelper } from './estimate/types.js';
3
+ export declare const createPriceEstimateHelper: () => PriceEstimateHelper;
4
+ export declare const priceEstimateHelper: PriceEstimateHelper;
5
+ /** @deprecated compat:factory-refactor — use `priceEstimateHelper.assertPricingPolicy(…)` */
6
+ export declare const assertPricingPolicy: (policy: PricingPolicy) => PricingPolicy;
7
+ /** @deprecated compat:factory-refactor — use `priceEstimateHelper.ratePpmOf(…)` */
8
+ export declare const ratePpmOf: (percentageDecimal: string) => number;
9
+ /** @deprecated compat:factory-refactor — use `priceEstimateHelper.estimateOf(…)` */
10
+ export declare const estimateOf: (amountMinor: number, estimate: PriceEstimate) => AmountEstimate;
11
+ //# sourceMappingURL=estimate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimate.d.ts","sourceRoot":"","sources":["../src/estimate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAK9D,eAAO,MAAM,yBAAyB,QAAO,mBAoE5C,CAAA;AAED,eAAO,MAAM,mBAAmB,qBAA8B,CAAA;AAE9D,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,WAAY,aAAa,KAAG,aACX,CAAA;AAEjD,mFAAmF;AACnF,eAAO,MAAM,SAAS,sBAAuB,MAAM,KAAG,MAA0D,CAAA;AAEhH,oFAAoF;AACpF,eAAO,MAAM,UAAU,gBAAiB,MAAM,YAAY,aAAa,KAAG,cACnB,CAAA"}
@@ -0,0 +1,76 @@
1
+ import { PaymentError } from './errors.js';
2
+ import { TaxBehavior } from './consts.js';
3
+ /** Stripe's own convention for a tax amount: half a unit rounds up. */
4
+ const roundHalfUp = (value) => Math.floor(value + 0.5);
5
+ export const createPriceEstimateHelper = () => {
6
+ const assertPricingPolicy = (policy) => {
7
+ if (policy.tax.estimate && !policy.tax.automatic) {
8
+ throw new PaymentError('pricing-policy:tax-estimate-requires-automatic');
9
+ }
10
+ if (policy.currency.estimate && policy.currency.adaptive !== true) {
11
+ throw new PaymentError('pricing-policy:currency-estimate-requires-adaptive');
12
+ }
13
+ const feeRate = policy.currency.adaptiveFeeRate;
14
+ if (feeRate != null) {
15
+ if (policy.currency.adaptive !== true) {
16
+ throw new PaymentError('pricing-policy:adaptive-fee-requires-adaptive');
17
+ }
18
+ if (!Number.isFinite(feeRate) || feeRate < 0 || feeRate >= 1) {
19
+ throw new PaymentError('pricing-policy:adaptive-fee-rate');
20
+ }
21
+ }
22
+ for (const ttl of [policy.tax.estimateTtlSeconds, policy.currency.estimateTtlSeconds]) {
23
+ if (ttl != null && (!Number.isSafeInteger(ttl) || ttl < 1)) {
24
+ throw new PaymentError('pricing-policy:ttl');
25
+ }
26
+ }
27
+ return policy;
28
+ };
29
+ const ratePpmOf = (percentageDecimal) => {
30
+ const match = /^(\d+)(?:\.(\d+))?$/.exec(percentageDecimal.trim());
31
+ if (match == null) {
32
+ throw new PaymentError('tax-rate:percentage');
33
+ }
34
+ const [, whole, fraction = ''] = match;
35
+ const fractionPpm = Number(`${fraction}0000`.slice(0, 4));
36
+ const ppm = Number(whole) * 10_000 + fractionPpm;
37
+ if (!Number.isSafeInteger(ppm)) {
38
+ throw new PaymentError('tax-rate:percentage');
39
+ }
40
+ return ppm;
41
+ };
42
+ const estimateOf = (amountMinor, estimate) => {
43
+ if (!Number.isSafeInteger(amountMinor) || amountMinor < 0) {
44
+ throw new PaymentError('price-estimate:amount');
45
+ }
46
+ const { tax, behavior, local } = estimate;
47
+ const sameAmount = amountMinor === tax.subtotalMinor;
48
+ const rescalable = sameAmount || (behavior === TaxBehavior.Exclusive && tax.scalable);
49
+ if (!rescalable) {
50
+ return { subtotalMinor: amountMinor, taxMinor: null, totalMinor: null };
51
+ }
52
+ // `sameAmount` trusts Stripe's own numbers outright; otherwise only Exclusive ever reaches here
53
+ // (`rescalable` above excludes an Inclusive amount that differs from the reference).
54
+ const taxMinor = sameAmount ? tax.taxMinor : tax.rates.reduce((sum, rate) => sum + roundHalfUp(amountMinor * rate.ratePpm / 1_000_000), 0);
55
+ const totalMinor = sameAmount ? tax.totalMinor : amountMinor + taxMinor;
56
+ const result = { subtotalMinor: amountMinor, taxMinor, totalMinor };
57
+ if (local != null) {
58
+ result.local = {
59
+ currency: local.currency,
60
+ subtotalAmount: amountMinor / 100 / local.exchangeRate,
61
+ taxAmount: taxMinor / 100 / local.exchangeRate,
62
+ totalAmount: totalMinor / 100 / local.exchangeRate,
63
+ };
64
+ }
65
+ return result;
66
+ };
67
+ return { assertPricingPolicy, ratePpmOf, estimateOf };
68
+ };
69
+ export const priceEstimateHelper = createPriceEstimateHelper();
70
+ /** @deprecated compat:factory-refactor — use `priceEstimateHelper.assertPricingPolicy(…)` */
71
+ export const assertPricingPolicy = (policy) => priceEstimateHelper.assertPricingPolicy(policy);
72
+ /** @deprecated compat:factory-refactor — use `priceEstimateHelper.ratePpmOf(…)` */
73
+ export const ratePpmOf = (percentageDecimal) => priceEstimateHelper.ratePpmOf(percentageDecimal);
74
+ /** @deprecated compat:factory-refactor — use `priceEstimateHelper.estimateOf(…)` */
75
+ export const estimateOf = (amountMinor, estimate) => priceEstimateHelper.estimateOf(amountMinor, estimate);
76
+ //# sourceMappingURL=estimate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimate.js","sourceRoot":"","sources":["../src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