@owlmeans/server-payment 0.1.20-rc.1 → 0.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +52 -54
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/server-payment/SKILL.md +272 -330
  4. package/agent-meta/skills/server-payment/parts/reference.md +3 -3
  5. package/build/access/types.d.ts +7 -16
  6. package/build/access/types.d.ts.map +1 -1
  7. package/build/access.d.ts.map +1 -1
  8. package/build/access.js +6 -8
  9. package/build/access.js.map +1 -1
  10. package/build/actions/resync.d.ts +3 -3
  11. package/build/actions/resync.js +5 -5
  12. package/build/actions/resync.js.map +1 -1
  13. package/build/actions/webhook.d.ts +4 -1
  14. package/build/actions/webhook.d.ts.map +1 -1
  15. package/build/actions/webhook.js +8 -4
  16. package/build/actions/webhook.js.map +1 -1
  17. package/build/bootstrap/types.d.ts +13 -7
  18. package/build/bootstrap/types.d.ts.map +1 -1
  19. package/build/bootstrap.d.ts +4 -4
  20. package/build/bootstrap.d.ts.map +1 -1
  21. package/build/bootstrap.js +19 -10
  22. package/build/bootstrap.js.map +1 -1
  23. package/build/catalogue/types.d.ts +3 -3
  24. package/build/catalogue/types.d.ts.map +1 -1
  25. package/build/catalogue.d.ts.map +1 -1
  26. package/build/catalogue.js +4 -8
  27. package/build/catalogue.js.map +1 -1
  28. package/build/checkout/types.d.ts +21 -0
  29. package/build/checkout/types.d.ts.map +1 -0
  30. package/build/{plugins/stripe → checkout}/types.js.map +1 -1
  31. package/build/checkout.d.ts +6 -0
  32. package/build/checkout.d.ts.map +1 -0
  33. package/build/checkout.js +374 -0
  34. package/build/checkout.js.map +1 -0
  35. package/build/config.d.ts +10 -16
  36. package/build/config.d.ts.map +1 -1
  37. package/build/config.js +18 -59
  38. package/build/config.js.map +1 -1
  39. package/build/consts.d.ts +3 -49
  40. package/build/consts.d.ts.map +1 -1
  41. package/build/consts.js +3 -61
  42. package/build/consts.js.map +1 -1
  43. package/build/consumer/cancellation/types.d.ts +6 -4
  44. package/build/consumer/cancellation/types.d.ts.map +1 -1
  45. package/build/consumer/cancellation.d.ts.map +1 -1
  46. package/build/consumer/cancellation.js +11 -5
  47. package/build/consumer/cancellation.js.map +1 -1
  48. package/build/consumer/capture/types.d.ts +8 -12
  49. package/build/consumer/capture/types.d.ts.map +1 -1
  50. package/build/consumer/capture.d.ts.map +1 -1
  51. package/build/consumer/capture.js +48 -53
  52. package/build/consumer/capture.js.map +1 -1
  53. package/build/consumer/index.d.ts +4 -0
  54. package/build/consumer/index.d.ts.map +1 -1
  55. package/build/consumer/index.js +2 -0
  56. package/build/consumer/index.js.map +1 -1
  57. package/build/consumer/reconcile.d.ts.map +1 -1
  58. package/build/consumer/reconcile.js +82 -72
  59. package/build/consumer/reconcile.js.map +1 -1
  60. package/build/consumer/records/types.d.ts +4 -4
  61. package/build/consumer/records/types.d.ts.map +1 -1
  62. package/build/consumer/records.d.ts.map +1 -1
  63. package/build/consumer/records.js +16 -13
  64. package/build/consumer/records.js.map +1 -1
  65. package/build/consumer/service.d.ts +2 -2
  66. package/build/consumer/service.d.ts.map +1 -1
  67. package/build/consumer/service.js +28 -21
  68. package/build/consumer/service.js.map +1 -1
  69. package/build/consumer/types.d.ts +1 -4
  70. package/build/consumer/types.d.ts.map +1 -1
  71. package/build/consumer/types.local.d.ts +1 -9
  72. package/build/consumer/types.local.d.ts.map +1 -1
  73. package/build/consumer/withdrawal/types.d.ts +14 -12
  74. package/build/consumer/withdrawal/types.d.ts.map +1 -1
  75. package/build/consumer/withdrawal.d.ts.map +1 -1
  76. package/build/consumer/withdrawal.js +55 -71
  77. package/build/consumer/withdrawal.js.map +1 -1
  78. package/build/index.d.ts +12 -6
  79. package/build/index.d.ts.map +1 -1
  80. package/build/index.js +7 -4
  81. package/build/index.js.map +1 -1
  82. package/build/paygate/providers.d.ts +13 -0
  83. package/build/paygate/providers.d.ts.map +1 -0
  84. package/build/paygate/providers.js +38 -0
  85. package/build/paygate/providers.js.map +1 -0
  86. package/build/paygate/registry.d.ts +6 -0
  87. package/build/paygate/registry.d.ts.map +1 -0
  88. package/build/paygate/registry.js +37 -0
  89. package/build/paygate/registry.js.map +1 -0
  90. package/build/paygate/types.d.ts +577 -0
  91. package/build/paygate/types.d.ts.map +1 -0
  92. package/build/{plugins/session → paygate}/types.js.map +1 -1
  93. package/build/plan/types.d.ts +6 -1
  94. package/build/plan/types.d.ts.map +1 -1
  95. package/build/plan.d.ts.map +1 -1
  96. package/build/plan.js +16 -2
  97. package/build/plan.js.map +1 -1
  98. package/build/plugins/checkout-policy/types.d.ts +5 -3
  99. package/build/plugins/checkout-policy/types.d.ts.map +1 -1
  100. package/build/plugins/checkout-policy.d.ts.map +1 -1
  101. package/build/plugins/checkout-policy.js +5 -3
  102. package/build/plugins/checkout-policy.js.map +1 -1
  103. package/build/plugins/consts.local.d.ts +8 -10
  104. package/build/plugins/consts.local.d.ts.map +1 -1
  105. package/build/plugins/consts.local.js +2 -19
  106. package/build/plugins/consts.local.js.map +1 -1
  107. package/build/plugins/customer-lock/types.d.ts +2 -2
  108. package/build/plugins/customer-lock/types.d.ts.map +1 -1
  109. package/build/plugins/customer-lock.js +2 -2
  110. package/build/plugins/customer-lock.js.map +1 -1
  111. package/build/plugins/estimate/cache.js +1 -1
  112. package/build/plugins/estimate/cache.js.map +1 -1
  113. package/build/plugins/estimate/types.d.ts +10 -10
  114. package/build/plugins/estimate/types.d.ts.map +1 -1
  115. package/build/plugins/estimate.d.ts.map +1 -1
  116. package/build/plugins/estimate.js +48 -122
  117. package/build/plugins/estimate.js.map +1 -1
  118. package/build/plugins/events/types.d.ts +17 -10
  119. package/build/plugins/events/types.d.ts.map +1 -1
  120. package/build/plugins/events.d.ts +6 -5
  121. package/build/plugins/events.d.ts.map +1 -1
  122. package/build/plugins/events.js +162 -173
  123. package/build/plugins/events.js.map +1 -1
  124. package/build/plugins/fx/types.d.ts +10 -21
  125. package/build/plugins/fx/types.d.ts.map +1 -1
  126. package/build/plugins/fx.d.ts +1 -1
  127. package/build/plugins/fx.d.ts.map +1 -1
  128. package/build/plugins/fx.js +17 -54
  129. package/build/plugins/fx.js.map +1 -1
  130. package/build/plugins/portal/types.d.ts +8 -37
  131. package/build/plugins/portal/types.d.ts.map +1 -1
  132. package/build/plugins/portal.d.ts.map +1 -1
  133. package/build/plugins/portal.js +38 -208
  134. package/build/plugins/portal.js.map +1 -1
  135. package/build/plugins/refunds/types.d.ts +11 -11
  136. package/build/plugins/refunds/types.d.ts.map +1 -1
  137. package/build/plugins/refunds.d.ts.map +1 -1
  138. package/build/plugins/refunds.js +14 -39
  139. package/build/plugins/refunds.js.map +1 -1
  140. package/build/plugins/snapshot/types.d.ts +11 -0
  141. package/build/plugins/snapshot/types.d.ts.map +1 -0
  142. package/build/plugins/snapshot/types.js +2 -0
  143. package/build/plugins/snapshot/types.js.map +1 -0
  144. package/build/plugins/snapshot.d.ts +4 -0
  145. package/build/plugins/snapshot.d.ts.map +1 -0
  146. package/build/plugins/snapshot.js +19 -0
  147. package/build/plugins/snapshot.js.map +1 -0
  148. package/build/plugins/subscriptions/types.d.ts +17 -17
  149. package/build/plugins/subscriptions/types.d.ts.map +1 -1
  150. package/build/plugins/subscriptions.d.ts +4 -4
  151. package/build/plugins/subscriptions.d.ts.map +1 -1
  152. package/build/plugins/subscriptions.js +69 -77
  153. package/build/plugins/subscriptions.js.map +1 -1
  154. package/build/plugins/types.local.d.ts +9 -43
  155. package/build/plugins/types.local.d.ts.map +1 -1
  156. package/build/plugins/webhook-manager/types.d.ts +15 -43
  157. package/build/plugins/webhook-manager/types.d.ts.map +1 -1
  158. package/build/plugins/webhook-manager.d.ts +3 -3
  159. package/build/plugins/webhook-manager.d.ts.map +1 -1
  160. package/build/plugins/webhook-manager.js +21 -199
  161. package/build/plugins/webhook-manager.js.map +1 -1
  162. package/build/protocol.d.ts +1 -1
  163. package/build/protocol.d.ts.map +1 -1
  164. package/build/protocol.js +1 -1
  165. package/build/protocol.js.map +1 -1
  166. package/build/service.d.ts +11 -11
  167. package/build/service.d.ts.map +1 -1
  168. package/build/service.js +59 -23
  169. package/build/service.js.map +1 -1
  170. package/build/sync/types.d.ts +17 -13
  171. package/build/sync/types.d.ts.map +1 -1
  172. package/build/sync.d.ts.map +1 -1
  173. package/build/sync.js +22 -122
  174. package/build/sync.js.map +1 -1
  175. package/build/types.d.ts +46 -101
  176. package/build/types.d.ts.map +1 -1
  177. package/build/utils/types.d.ts +0 -8
  178. package/build/utils/types.d.ts.map +1 -1
  179. package/build/utils.d.ts +1 -4
  180. package/build/utils.d.ts.map +1 -1
  181. package/build/utils.js +1 -15
  182. package/build/utils.js.map +1 -1
  183. package/package.json +20 -22
  184. package/src/access/types.ts +7 -16
  185. package/src/access.ts +7 -15
  186. package/src/actions/resync.ts +5 -5
  187. package/src/actions/webhook.ts +8 -4
  188. package/src/bootstrap/types.ts +13 -7
  189. package/src/bootstrap.ts +23 -13
  190. package/src/catalogue/types.ts +3 -3
  191. package/src/catalogue.ts +4 -8
  192. package/src/checkout/types.ts +21 -0
  193. package/src/checkout.ts +414 -0
  194. package/src/config.ts +19 -66
  195. package/src/consts.ts +3 -69
  196. package/src/consumer/cancellation/types.ts +6 -4
  197. package/src/consumer/cancellation.ts +13 -7
  198. package/src/consumer/capture/types.ts +8 -12
  199. package/src/consumer/capture.ts +50 -59
  200. package/src/consumer/index.ts +4 -0
  201. package/src/consumer/reconcile.ts +69 -68
  202. package/src/consumer/records/types.ts +4 -4
  203. package/src/consumer/records.ts +19 -14
  204. package/src/consumer/service.ts +35 -22
  205. package/src/consumer/types.local.ts +1 -8
  206. package/src/consumer/types.ts +1 -4
  207. package/src/consumer/withdrawal/types.ts +14 -12
  208. package/src/consumer/withdrawal.ts +61 -77
  209. package/src/index.ts +12 -6
  210. package/src/paygate/providers.ts +48 -0
  211. package/src/paygate/registry.ts +53 -0
  212. package/src/paygate/types.ts +640 -0
  213. package/src/plan/types.ts +6 -1
  214. package/src/plan.ts +21 -3
  215. package/src/plugins/checkout-policy/types.ts +5 -3
  216. package/src/plugins/checkout-policy.ts +6 -5
  217. package/src/plugins/consts.local.ts +2 -26
  218. package/src/plugins/customer-lock/types.ts +2 -2
  219. package/src/plugins/customer-lock.ts +2 -2
  220. package/src/plugins/estimate/cache.ts +1 -1
  221. package/src/plugins/estimate/types.ts +10 -10
  222. package/src/plugins/estimate.ts +52 -128
  223. package/src/plugins/events/types.ts +17 -9
  224. package/src/plugins/events.ts +172 -190
  225. package/src/plugins/fx/types.ts +10 -23
  226. package/src/plugins/fx.ts +28 -64
  227. package/src/plugins/portal/types.ts +8 -38
  228. package/src/plugins/portal.ts +48 -229
  229. package/src/plugins/refunds/types.ts +11 -11
  230. package/src/plugins/refunds.ts +16 -40
  231. package/src/plugins/snapshot/types.ts +11 -0
  232. package/src/plugins/snapshot.ts +22 -0
  233. package/src/plugins/subscriptions/types.ts +17 -17
  234. package/src/plugins/subscriptions.ts +81 -81
  235. package/src/plugins/types.local.ts +9 -33
  236. package/src/plugins/webhook-manager/types.ts +15 -43
  237. package/src/plugins/webhook-manager.ts +24 -220
  238. package/src/protocol.ts +1 -1
  239. package/src/service.ts +66 -30
  240. package/src/sync/types.ts +17 -13
  241. package/src/sync.ts +25 -143
  242. package/src/types.ts +47 -97
  243. package/src/utils/types.ts +0 -9
  244. package/src/utils.ts +2 -20
  245. package/tests/capabilities.spec.ts +219 -0
  246. package/tests/entitlement.spec.ts +4 -4
  247. package/tests/gate-handlers.spec.ts +6 -6
  248. package/tests/gate.spec.ts +2 -2
  249. package/tests/grants.spec.ts +2 -2
  250. package/tests/internal-plan.spec.ts +2 -2
  251. package/tests/limit-gate.spec.ts +2 -2
  252. package/tests/paygates.spec.ts +132 -0
  253. package/tests/protocol.spec.ts +4 -5
  254. package/tests/usage.spec.ts +2 -2
  255. package/tests/webhook.spec.ts +137 -0
  256. package/build/plugins/session/types.d.ts +0 -34
  257. package/build/plugins/session/types.d.ts.map +0 -1
  258. package/build/plugins/session.d.ts +0 -4
  259. package/build/plugins/session.d.ts.map +0 -1
  260. package/build/plugins/session.js +0 -71
  261. package/build/plugins/session.js.map +0 -1
  262. package/build/plugins/status.d.ts +0 -8
  263. package/build/plugins/status.d.ts.map +0 -1
  264. package/build/plugins/status.js +0 -21
  265. package/build/plugins/status.js.map +0 -1
  266. package/build/plugins/stripe/types.d.ts +0 -20
  267. package/build/plugins/stripe/types.d.ts.map +0 -1
  268. package/build/plugins/stripe.d.ts +0 -6
  269. package/build/plugins/stripe.d.ts.map +0 -1
  270. package/build/plugins/stripe.js +0 -518
  271. package/build/plugins/stripe.js.map +0 -1
  272. package/src/plugins/session/types.ts +0 -30
  273. package/src/plugins/session.ts +0 -86
  274. package/src/plugins/status.ts +0 -22
  275. package/src/plugins/stripe/types.ts +0 -20
  276. package/src/plugins/stripe.ts +0 -571
  277. package/tests/checkout-consumer.spec.ts +0 -366
  278. package/tests/checkout-locks.spec.ts +0 -161
  279. package/tests/checkout-plugins.spec.ts +0 -164
  280. package/tests/checkout.spec.ts +0 -313
  281. package/tests/consumer-events.spec.ts +0 -215
  282. package/tests/consumer-fixtures.ts +0 -141
  283. package/tests/consumer-ops.spec.ts +0 -361
  284. package/tests/consumer-rights.integration.spec.ts +0 -147
  285. package/tests/consumer-rights.spec.ts +0 -606
  286. package/tests/context.ts +0 -110
  287. package/tests/estimate.spec.ts +0 -350
  288. package/tests/events.spec.ts +0 -367
  289. package/tests/fake-stripe.ts +0 -1004
  290. package/tests/gateway-options.spec.ts +0 -180
  291. package/tests/portal.spec.ts +0 -202
  292. package/tests/sync.spec.ts +0 -114
  293. package/tests/usage.integration.spec.ts +0 -165
  294. package/tests/webhook-manager.spec.ts +0 -149
  295. /package/build/{plugins/session → checkout}/types.js +0 -0
  296. /package/build/{plugins/stripe → paygate}/types.js +0 -0
@@ -50,10 +50,10 @@ Event actions: `mail` (step = mail kind), `computed` (the meter reading and the
50
50
  `cancel-scheduled`, `observers` (step = `consent`/`withdrawal`/`cancellation`), `lock`,
51
51
  `lock-mismatch`, `relock`, `unlock` (detail: `from`, `by`, `reason`, the deleted `profile`),
52
52
  `duplicate`, `checkout-terms-fallback` (`recordKind: 'checkout'`, `recordId` = the entity,
53
- `externalId` = the session created without the checkbox, `ok: false`, detail: the Stripe `message`,
53
+ `externalId` = the session created without the checkbox, `ok: false`, detail: the paygate's `message`,
54
54
  `code`, `param`, `mode`, `productSku`, `planSku`; `error` when the retry failed too).
55
55
 
56
- `PurchaseRecord.termsAccepted` is Stripe's `consent.terms_of_service` of the completed session and
56
+ `PurchaseRecord.termsAccepted` is the completed session's own terms acceptance (`CheckoutSnapshot.termsAccepted`) and
57
57
  nothing else; `confirmationMailAt` is the one claim of the purchase confirmation.
58
58
 
59
59
  Accessors (`paymentAccessOf(ctx)`, `src/access.ts`): `billingProfiles`, `purchases`, `consumerConsents`,
@@ -128,7 +128,7 @@ unrefunded and rounded in the consumer's favour.
128
128
  ## Cancellation, step by step
129
129
 
130
130
  1. Policy and `mechanisms.cancellation`; managed.
131
- 2. Resolve the subscription: in-app `subscriptionId`, a contract, else the entitling Stripe
131
+ 2. Resolve the subscription: in-app `subscriptionId`, a contract, else the entitling paygate
132
132
  subscription (none → `CancellationUnavailable('no-subscription')`, ended → `'ended'`); public the
133
133
  contract + e-mail, else the only organization whose paygate customer has the e-mail.
134
134
  3. Decide: extraordinary → `review` (paygate untouched); ordinary and live →
@@ -1,8 +1,8 @@
1
- import type Stripe from 'stripe';
2
1
  import type { PaymentService } from '@owlmeans/payment';
3
- import type { BillingProfileResource, CompletionObserver, ConsumerConsentResource, ConsumerDeclarationResource, ConsumerEventResource, ConsumerMailPluginConfig, ConsumerRightsService, EntitlementService, FingerprintResource, GatewayService, PaygateCustomerResource, PaymentFulfillmentResource, PaymentGrantResource, PaymentSubscriptionRecord, PaymentSubscriptionResource, PaymentUsageCounterResource, PaymentUsageResource, PaymentWebhookResource, PortalBrandingConfig, PurchaseResource, StripePluginConfig, StripePricingPluginConfig } from '../types.js';
2
+ import type { BillingProfileResource, CompletionObserver, ConsumerConsentResource, ConsumerDeclarationResource, ConsumerEventResource, ConsumerMailPluginConfig, ConsumerRightsService, EntitlementService, FingerprintResource, GatewayService, PaygateCustomerResource, PaymentFulfillmentResource, PaymentGrantResource, PaymentSubscriptionRecord, PaymentSubscriptionResource, PaymentUsageCounterResource, PaymentUsageResource, PaymentWebhookResource, PurchaseResource } from '../types.js';
3
+ import type { PaygateRegistry } from '../paygate/types.js';
4
4
  import type { EntitlementGrantHelper } from '../grants/types.js';
5
- /** What one context holds for payments: its services, its resources, its plugin configs and its Stripe client. */
5
+ /** What one context holds for payments: its services, its resources, its plugin configs and its paygates. */
6
6
  export interface PaymentAccess {
7
7
  payment: () => PaymentService;
8
8
  gateway: () => GatewayService;
@@ -32,21 +32,12 @@ export interface PaymentAccess {
32
32
  consumerRights: (alias?: string) => ConsumerRightsService;
33
33
  /** The consumer-rights service, or `null` in a process that registered none. */
34
34
  consumerRightsOf: (alias?: string) => ConsumerRightsService | null;
35
- stripeConfig: () => Promise<StripePluginConfig>;
36
- /** The portal branding declared with `portalBranding`, or `null`. */
37
- portalBrandingConfig: () => Promise<PortalBrandingConfig | null>;
38
35
  /** The consumer-rights mail options declared with `declareConsumerRights`, or `null`. */
39
36
  consumerMailConfig: () => Promise<ConsumerMailPluginConfig | null>;
40
- /** The Stripe-only pricing settings declared with `declarePaymentPricing`, or `null`. */
41
- stripePricingConfig: () => Promise<StripePricingPluginConfig | null>;
42
- /**
43
- * A Stripe client pinned to {@link STRIPE_PINNED_API_VERSION}: the API version this package's payload
44
- * readers, the stored webhook endpoints and the test doubles are written for. The installed SDK is typed
45
- * for a newer one, so a read of a field the newer version moved (a subscription's period, an invoice's
46
- * subscription) is cast at the seam until the readers are migrated — the pin is what keeps the shapes
47
- * the code parses and the shapes Stripe sends the same.
48
- */
49
- stripeClient: () => Promise<Stripe>;
37
+ /** A backend-only plugin config record by id (a provider's own settings), or `null`. */
38
+ pluginConfig: <T>(id: string) => Promise<T | null>;
39
+ /** The paygates of the registered payment providers (`paygatesOf`). */
40
+ paygates: () => PaygateRegistry;
50
41
  /** The entity's highest-ranked entitling subscription of one product. */
51
42
  activeSubscription: (entityId: string, productSku: string) => Promise<PaymentSubscriptionRecord | null>;
52
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/access/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EACV,sBAAsB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,2BAA2B,EAChG,qBAAqB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAC/G,cAAc,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,yBAAyB,EACpH,2BAA2B,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,sBAAsB,EACtG,oBAAoB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,yBAAyB,EACtF,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEhE,kHAAkH;AAClH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,cAAc,CAAA;IAC7B,OAAO,EAAE,MAAM,cAAc,CAAA;IAC7B,gEAAgE;IAChE,SAAS,EAAE,MAAM,cAAc,GAAG,IAAI,CAAA;IACtC,QAAQ,EAAE,MAAM,kBAAkB,CAAA;IAClC,YAAY,EAAE,MAAM,kBAAkB,CAAA;IACtC,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;IAC/C,aAAa,EAAE,MAAM,2BAA2B,CAAA;IAChD,YAAY,EAAE,MAAM,0BAA0B,CAAA;IAC9C,eAAe,EAAE,MAAM,sBAAsB,CAAA;IAC7C,WAAW,EAAE,MAAM,o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AAA;IAC7C,SAAS,EAAE,MAAM,gBAAgB,CAAA;IACjC,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;IAC/C,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;IACvD,cAAc,EAAE,MAAM,qBAAqB,CAAA;IAC3C,qEAAqE;IACrE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,qBAAqB,CAAA;IACzD,gFAAgF;IAChF,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,qBAAqB,GAAG,IAAI,CAAA;IAClE,yFAAyF;IACzF,kBAAkB,EAAE,MAAM,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAA;IAClE,wFAAwF;IACxF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAClD,uEAAuE;IACvE,QAAQ,EAAE,MAAM,eAAe,CAAA;IAC/B,yEAAyE;IACzE,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;CACxG"}
@@ -1 +1 @@
1
- {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAgBjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAItD,eAAO,MAAM,iBAAiB,QAAS,UAAU,KAAG,aAmEnD,CAAA;AAED,yDAAyD;AACzD,eAAO,MAAM,eAAe,8EAAwC,CAAA"}
1
+ {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAejE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAMtD,eAAO,MAAM,iBAAiB,QAAS,UAAU,KAAG,aA2DnD,CAAA;AAED,yDAAyD;AACzD,eAAO,MAAM,eAAe,8EAAwC,CAAA"}
package/build/access.js CHANGED
@@ -1,9 +1,9 @@
1
- import Stripe from 'stripe';
2
1
  import { PLUGINS } from '@owlmeans/config';
3
2
  import { memoHelper } from '@owlmeans/context';
4
3
  import { DEFAULT_ALIAS as PAYMENT_SERVICE, ENTITLING_STATUSES } from '@owlmeans/payment';
5
- import { CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG, CONSUMER_RIGHTS_SERVICE, ENTITLEMENT_SERVICE, GATEWAY_SERVICE, PAYMENT_OBSERVER, RES_BILLING_PROFILE, RES_CONSUMER_CONSENT, RES_CONSUMER_DECLARATION, RES_CONSUMER_EVENT, RES_PAYGATE_CUSTOMER, RES_PAYMENT_FINGERPRINT, RES_PAYMENT_FULFILLMENT, RES_PAYMENT_GRANT, RES_PAYMENT_PURCHASE, RES_PAYMENT_SUBSCRIPTION, RES_PAYMENT_USAGE, RES_PAYMENT_USAGE_COUNTER, RES_PAYMENT_WEBHOOK, STRIPE_PINNED_API_VERSION, STRIPE_PLUGIN_CONFIG, STRIPE_PORTAL_PLUGIN_CONFIG, STRIPE_PRICING_PLUGIN_CONFIG, } from './consts.js';
4
+ import { CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG, CONSUMER_RIGHTS_SERVICE, ENTITLEMENT_SERVICE, GATEWAY_SERVICE, PAYMENT_OBSERVER, RES_BILLING_PROFILE, RES_CONSUMER_CONSENT, RES_CONSUMER_DECLARATION, RES_CONSUMER_EVENT, RES_PAYGATE_CUSTOMER, RES_PAYMENT_FINGERPRINT, RES_PAYMENT_FULFILLMENT, RES_PAYMENT_GRANT, RES_PAYMENT_PURCHASE, RES_PAYMENT_SUBSCRIPTION, RES_PAYMENT_USAGE, RES_PAYMENT_USAGE_COUNTER, RES_PAYMENT_WEBHOOK, } from './consts.js';
6
5
  import { entitlementGrantsOf } from './grants.js';
6
+ import { paygatesOf } from './paygate/registry.js';
7
7
  export const makePaymentAccess = (ctx) => {
8
8
  const hasService = (alias) => ctx.hasService?.(alias) === true;
9
9
  const hasResource = (alias) => ctx.hasResource?.(alias) === true;
@@ -30,11 +30,9 @@ export const makePaymentAccess = (ctx) => {
30
30
  const consumerEvents = () => ctx.resource(RES_CONSUMER_EVENT);
31
31
  const consumerRights = (alias = CONSUMER_RIGHTS_SERVICE) => ctx.service(alias);
32
32
  const consumerRightsOf = (alias = CONSUMER_RIGHTS_SERVICE) => hasService(alias) ? ctx.service(alias) : null;
33
- const stripeConfig = async () => await plugins().get(STRIPE_PLUGIN_CONFIG);
34
- const portalBrandingConfig = async () => await plugins().load(STRIPE_PORTAL_PLUGIN_CONFIG);
35
33
  const consumerMailConfig = async () => await plugins().load(CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG);
36
- const stripePricingConfig = async () => await plugins().load(STRIPE_PRICING_PLUGIN_CONFIG);
37
- const stripeClient = async () => new Stripe((await stripeConfig()).api, { apiVersion: STRIPE_PINNED_API_VERSION });
34
+ const pluginConfig = async (id) => await plugins().load(id);
35
+ const paygates = () => paygatesOf(ctx);
38
36
  const activeSubscription = async (entityId, productSku) => await subscriptions().load({
39
37
  entityId, productSku, status: [...ENTITLING_STATUSES],
40
38
  }, { sort: [{ field: 'rank', order: 'desc' }, { field: 'createdAt', order: 'desc' }] });
@@ -42,8 +40,8 @@ export const makePaymentAccess = (ctx) => {
42
40
  payment, gateway, gatewayOf, observer, entitlements, paygateCustomers, subscriptions, fulfillments,
43
41
  paymentWebhooks, usageEvents, usageCounters, fingerprints, grantRecords, grantRecordsOf, grants, billingProfiles,
44
42
  purchases, consumerConsents,
45
- consumerDeclarations, consumerEvents, consumerRights, consumerRightsOf, stripeConfig, portalBrandingConfig,
46
- consumerMailConfig, stripePricingConfig, stripeClient, activeSubscription,
43
+ consumerDeclarations, consumerEvents, consumerRights, consumerRightsOf, consumerMailConfig, pluginConfig, paygates,
44
+ activeSubscription,
47
45
  };
48
46
  };
49
47
  /** The payment access of a context — one per context. */
@@ -1 +1 @@
1
- {"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,kBAAkB,EAAuB,MAAM,mBAAmB,CAAA;AAE7G,OAAO,EACL,kCAAkC,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,eAAe,EACjG,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,kBAAkB,EACzG,oBAAoB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,oBAAoB,EAC/G,wBAAwB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,mBAAmB,EAC3F,yBAAyB,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,4BAA4B,GAC3G,MAAM,aAAa,CAAA;AAWpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAe,EAAiB,EAAE;IAClE,MAAM,UAAU,GAAG,CAAC,KAAa,EAAW,EAAE,CAC3C,GAA8D,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;IAC9F,MAAM,WAAW,GAAG,CAAC,KAAa,EAAW,EAAE,CAC5C,GAA+D,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;IAChG,MAAM,OAAO,GAAG,GAAG,EAAE,CAAE,GAA6B,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAE/E,MAAM,OAAO,GAAG,GAAmB,EAAE,CAAC,GAAG,CAAC,OAAO,C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,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAA;IAEvF,OAAO;QACL,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY;QAClG,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe;QAChH,SAAS,EAAE,gBAAgB;QAC3B,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ;QAClH,kBAAkB;KACnB,CAAA;AACH,CAAC,CAAA;AAED,yDAAyD;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Forget every sync fingerprint and bring Stripe back to the declared catalogue, portal and webhook —
3
- * in any managed process, `bootstrap: false` included: the webhook URL and the rows follow the
4
- * gateway's `webhookService` and `owner`, so every process of the owner converges on one state.
2
+ * Forget every sync fingerprint and bring every paygate back to the declared catalogue, portal and
3
+ * webhook — in any managed process, `bootstrap: false` included: the webhook URL and the rows follow
4
+ * the gateway's `webhookService` and `owner`, so every process of the owner converges on one state.
5
5
  */
6
6
  export declare const resync: import("@owlmeans/server-entrypoint").BoundEntrypointHandler<import("@owlmeans/entrypoint").EntrypointProtocol<{}, import("../types.js").ResyncResult>>;
7
7
  //# sourceMappingURL=resync.d.ts.map
@@ -2,12 +2,12 @@ import { PaygateError } from '@owlmeans/payment';
2
2
  import { handlers } from '@owlmeans/server-api';
3
3
  import { paymentAccessOf } from '../access.js';
4
4
  import { paymentGate } from '../protocol.js';
5
- import { stripeBootstrapOf } from '../bootstrap.js';
5
+ import { paygateBootstrapOf } from '../bootstrap.js';
6
6
  const bind = handlers();
7
7
  /**
8
- * Forget every sync fingerprint and bring Stripe back to the declared catalogue, portal and webhook —
9
- * in any managed process, `bootstrap: false` included: the webhook URL and the rows follow the
10
- * gateway's `webhookService` and `owner`, so every process of the owner converges on one state.
8
+ * Forget every sync fingerprint and bring every paygate back to the declared catalogue, portal and
9
+ * webhook — in any managed process, `bootstrap: false` included: the webhook URL and the rows follow
10
+ * the gateway's `webhookService` and `owner`, so every process of the owner converges on one state.
11
11
  */
12
12
  export const resync = bind.request(paymentGate.resync, async (_request, context) => {
13
13
  const paymentAccess = paymentAccessOf(context);
@@ -15,7 +15,7 @@ export const resync = bind.request(paymentGate.resync, async (_request, context)
15
15
  if (!service.managed)
16
16
  throw new PaygateError('unmanaged');
17
17
  await paymentAccess.fingerprints().clear();
18
- await stripeBootstrapOf(context).bootstrapStripe(await service.stripe(context), { force: true });
18
+ await paygateBootstrapOf(context).bootstrap({ force: true });
19
19
  return { ok: true };
20
20
  });
21
21
  //# sourceMappingURL=resync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resync.js","sourceRoot":"","sources":["../../src/actions/resync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,MAAM,IAAI,GAAG,QAAQ,EAAW,CAAA;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACjF,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,EAAE,CAAA;IACvC,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,MAAM,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AA;AACrB,CAAC,CAAC,CAAA"}
@@ -1,4 +1,7 @@
1
- /** A Stripe delivery — only a managed gateway receives one; its secret is the `owner`'s stored one. */
1
+ /**
2
+ * A paygate delivery: the paygate named in the path must be registered (`UnknownPaygate`), and only a
3
+ * managed gateway receives one; the paygate verifies it against the `owner`'s secrets.
4
+ */
2
5
  export declare const webhook: import("@owlmeans/server-entrypoint").BoundEntrypointHandler<import("@owlmeans/entrypoint").EntrypointProtocol<{
3
6
  params: import("../types.js").PaygateParams;
4
7
  }, undefined>>;
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"AAUA,uGAAuG;AACvG,eAAO,MAAM,OAAO;;cAKlB,CAAA"}
1
+ {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,eAAO,MAAM,OAAO;;cAMlB,CAAA"}
@@ -1,17 +1,21 @@
1
1
  import { PaygateError, UnknownPaygate } from '@owlmeans/payment';
2
2
  import { handlers } from '@owlmeans/server-api';
3
- import { STRIPE_PAYGATE_ALIAS } from '../consts.js';
4
3
  import { paymentAccessOf } from '../access.js';
5
4
  import { paymentGate } from '../protocol.js';
5
+ import { paygatesOf } from '../paygate/registry.js';
6
6
  import { webhookOf } from '../plugins/webhook-manager.js';
7
7
  const bind = handlers();
8
- /** A Stripe delivery — only a managed gateway receives one; its secret is the `owner`'s stored one. */
8
+ /**
9
+ * A paygate delivery: the paygate named in the path must be registered (`UnknownPaygate`), and only a
10
+ * managed gateway receives one; the paygate verifies it against the `owner`'s secrets.
11
+ */
9
12
  export const webhook = bind.params(paymentGate.webhook, async ({ paygate }, context, request) => {
10
- if (paygate !== STRIPE_PAYGATE_ALIAS)
13
+ const target = paygatesOf(context).find(paygate);
14
+ if (target == null)
11
15
  throw new UnknownPaygate(paygate);
12
16
  const service = paymentAccessOf(context).gateway();
13
17
  if (!service.managed)
14
18
  throw new PaygateError('unmanaged');
15
- await webhookOf(context).handleStripeWebhook(await service.stripe(context), request);
19
+ await webhookOf(context).handleDelivery(target, request);
16
20
  });
17
21
  //# sourceMappingURL=webhook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAEzD,MAAM,IAAI,GAAG,QAAQ,EAAW,CAAA;AAEhC,uGAAuG;AACvG,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC9F,IAAI,OAAO,KAAK,oBAAoB;QAAE,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAA;IACvE,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;IAClD,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,MAAM,IAAI,YAAY,CAAC,WAAW,CAAC,CAAA;IACzD,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;AACtF,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAEzD,MAAM,IAAI,GAAG,QAAQ,EAAW,CAAA;AAEhC;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC9F,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,IAAI,MAAM,IAAI,IAAI;QAAE,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAA;IACrD,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;IAClD,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,MAAM,IAAI,YAAY,CAAC,WAAW,CAAC,CAAA;IACzD,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC1D,CAAC,CAAC,CAAA"}
@@ -1,16 +1,22 @@
1
- import type Stripe from 'stripe';
2
- import type { StripeBootstrapOptions } from '../types.js';
3
- /** What brings Stripe to a deployment's declaration. */
4
- export interface StripeBootstrapHelper {
1
+ import type { PaygateBootstrapOptions } from '../types.js';
2
+ import type { Paygate } from '../paygate/types.js';
3
+ /** What brings every registered paygate to a deployment's declaration. */
4
+ export interface PaygateBootstrapHelper {
5
5
  /**
6
- * Bring Stripe to what this deployment declares, each step on its own so one failing does not block
7
- * the others: products and prices, the customer-portal configuration, the webhook endpoint.
6
+ * Bring every registered paygate to what this deployment declares (`bootstrapPaygate`, in
7
+ * registration order).
8
8
  *
9
9
  * The webhook URL and the owner key come from the context's gateway (`webhookService`, `owner`), so
10
10
  * every process of one deployment — the one bootstrapping at boot, a `resync`, an application's
11
11
  * forced maintenance run — computes the same URL and rows; each step is fingerprinted, so running it
12
12
  * from any of them is idempotent.
13
13
  */
14
- bootstrapStripe: (stripe: Stripe, opts?: StripeBootstrapOptions) => Promise<void>;
14
+ bootstrap: (opts?: PaygateBootstrapOptions) => Promise<void>;
15
+ /**
16
+ * One paygate, each step on its own so one failing does not block the others: products and prices
17
+ * (`catalogue`), the customer-portal configuration (`portal`), the webhook endpoint (`webhook`) — a
18
+ * capability the paygate lacks is skipped.
19
+ */
20
+ bootstrapPaygate: (paygate: Paygate, opts?: PaygateBootstrapOptions) => Promise<void>;
15
21
  }
16
22
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bootstrap/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,wDAAwD;AACxD,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;OAQG;IACH,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAClF"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bootstrap/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;OAQG;IACH,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtF"}
@@ -1,6 +1,6 @@
1
1
  import type { Context as ApiContext } from '@owlmeans/server-api';
2
- import type { StripeBootstrapHelper } from './bootstrap/types.js';
3
- export declare const makeStripeBootstrapHelper: (ctx: ApiContext) => StripeBootstrapHelper;
4
- /** The Stripe bootstrap of a context — one per context. */
5
- export declare const stripeBootstrapOf: (target: ApiContext<import("@owlmeans/server-api").Config>) => StripeBootstrapHelper;
2
+ import type { PaygateBootstrapHelper } from './bootstrap/types.js';
3
+ export declare const makePaygateBootstrapHelper: (ctx: ApiContext) => PaygateBootstrapHelper;
4
+ /** The paygate bootstrap of a context — one per context. */
5
+ export declare const paygateBootstrapOf: (target: ApiContext<import("@owlmeans/server-api").Config>) => PaygateBootstrapHelper;
6
6
  //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAIjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAKjE,eAAO,MAAM,yBAAyB,QAAS,UAAU,KAAG,qBAiB3D,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,sFAAgD,CAAA"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAKjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAKlE,eAAO,MAAM,0BAA0B,QAAS,UAAU,KAAG,sBA2B5D,CAAA;AAED,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,uFAAiD,CAAA"}
@@ -1,26 +1,35 @@
1
1
  import { memoHelper } from '@owlmeans/context';
2
2
  import { log } from './log.js';
3
3
  import { productSyncOf } from './sync.js';
4
- import { portalOf } from './plugins/portal.js';
4
+ import { paygatesOf } from './paygate/registry.js';
5
5
  import { webhookOf } from './plugins/webhook-manager.js';
6
- export const makeStripeBootstrapHelper = (ctx) => {
7
- const bootstrapStripe = async (stripe, opts = {}) => {
6
+ export const makePaygateBootstrapHelper = (ctx) => {
7
+ const bootstrapPaygate = async (paygate, opts = {}) => {
8
8
  const steps = [
9
- ['products', async () => await productSyncOf(ctx).syncStripeProducts(stripe)],
10
- ['portal', async () => await portalOf(ctx).ensurePortalConfiguration(stripe, opts)],
11
- ['webhook', async () => await webhookOf(ctx).ensureWebhookEndpoint(stripe, opts)],
9
+ ...(paygate.catalogue != null
10
+ ? [['products', async () => await productSyncOf(ctx).syncProducts(paygate)]] : []),
11
+ ...(paygate.portal != null
12
+ ? [['portal', async () => await paygate.portal?.ensureConfiguration(webhookOf(ctx).deploymentOf(paygate.id), opts)]]
13
+ : []),
14
+ ...(paygate.webhook != null
15
+ ? [['webhook', async () => await webhookOf(ctx).ensureWebhookEndpoint(paygate, opts)]] : []),
12
16
  ];
13
17
  for (const [name, step] of steps) {
14
18
  try {
15
19
  await step();
16
20
  }
17
21
  catch (error) {
18
- log.error('Stripe bootstrap step failed', { step: name, error });
22
+ log.error('Paygate bootstrap step failed', { step: name, paygate: paygate.id, error });
19
23
  }
20
24
  }
21
25
  };
22
- return { bootstrapStripe };
26
+ const bootstrap = async (opts = {}) => {
27
+ for (const paygate of paygatesOf(ctx).all()) {
28
+ await bootstrapPaygate(paygate, opts);
29
+ }
30
+ };
31
+ return { bootstrap, bootstrapPaygate };
23
32
  };
24
- /** The Stripe bootstrap of a context — one per context. */
25
- export const stripeBootstrapOf = memoHelper.oncePer(makeStripeBootstrapHelper);
33
+ /** The paygate bootstrap of a context — one per context. */
34
+ export const paygateBootstrapOf = memoHelper.oncePer(makePaygateBootstrapHelper);
26
35
  //# sourceMappingURL=bootstrap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAe,EAAyB,EAAE;IAClF,MAAM,eAAe,GAAG,KAAK,EAAE,MAAc,EAAE,IAAI,GAA2B,EAAE,EAAiB,EAAE;QACjG,MAAM,KAAK,GAA4C;YACrD,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC7E,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACnF,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;SAClF,CAAA;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,IAAI,EAAE,CAAA;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,KAAK,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C,CAAC;gBACxJ,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI;gBACzB,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAqC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACnI,CAAA;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,IAAI,EAAE,CAAA;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;YACxF,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,GAA4B,EAAE,EAAiB,EAAE;QAC5E,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YAC5C,MAAM,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACvC,CAAC;IACH,CAAC,CAAA;IAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;AACxC,CAAC,CAAA;AAED,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAA"}
@@ -26,12 +26,12 @@ export interface CatalogueHelper {
26
26
  * Empty when the plan is not of one of `productSkus`.
27
27
  */
28
28
  entitlementsOf: (entityId: string, productSkus?: string[]) => Promise<PermissionSet[]>;
29
- /** Every product sold through Stripe with the plans it sells there. */
30
- stripePlansOf: () => Promise<Array<{
29
+ /** Every product with a plan sold through a paygate, with the plans it sells there (`planHelper.isSoldThrough`). */
30
+ plansSoldThrough: (paygate: string) => Promise<Array<{
31
31
  product: PaymentProduct;
32
32
  plans: PaymentPlan[];
33
33
  }>>;
34
- /** The plan an amount/quantity checkout of a consumable product sells: the named one, else the first. */
34
+ /** The plan an amount/quantity checkout of a consumable product sells: the named one, else the first plan for sale. */
35
35
  consumablePlanOf: (productSku: string, planSku?: string) => Promise<{
36
36
  product: PaymentProduct;
37
37
  plan: PaymentPlan;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/catalogue/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE7E,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC1D,mCAAmC;IACnC,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACnE,4CAA4C;IAC5C,YAAY,EAAE,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;IAC1C,qFAAqF;IACrF,UAAU,EAAE,MAAM,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC7C;;;;;;;;;OASG;IACH,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAC7E;;;OAGG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IACtF,uEAAuE;IACvE,aAAa,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gB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,cAAc,CAAC;QAAC,KAAK,EAAE,WAAW,EAAE,CAAA;KAAE,CAAC,CAAC,CAAA;IACxG,uHAAuH;IACvH,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CAAA;CACpH"}
@@ -1 +1 @@
1
- {"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../src/catalogue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAUjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAK3D,eAAO,MAAM,mBAAmB,QAAS,UAAU,KAAG,eAsHrD,CAAA;AAED,oDAAoD;AACpD,eAAO,MAAM,WAAW,gFAA0C,CAAA"}
1
+ {"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../src/catalogue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AASjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAK3D,eAAO,MAAM,mBAAmB,QAAS,UAAU,KAAG,eAmHrD,CAAA;AAED,oDAAoD;AACpD,eAAO,MAAM,WAAW,gFAA0C,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { ENTITLING_STATUSES, PlanRequired, ProductError, promoHelper } from '@owlmeans/payment';
2
2
  import { memoHelper } from '@owlmeans/context';
3
- import { STRIPE_PAYGATE_ALIAS } from './consts.js';
4
3
  import { paymentAccessOf } from './access.js';
5
4
  import { planHelper } from './plan.js';
6
5
  import { subscriptionHelper } from './subscription.js';
@@ -78,15 +77,12 @@ export const makeCatalogueHelper = (ctx) => {
78
77
  .filter(set => promoHelper.promoActive(set.promo, subscription?.createdAt, at))
79
78
  .map(({ promo: _promo, ...set }) => set);
80
79
  };
81
- const stripePlansOf = async () => {
80
+ const plansSoldThrough = async (paygate) => {
82
81
  const products = await access.payment().products();
83
82
  const result = [];
84
83
  for (const product of products) {
85
- if (!(product.gateways ?? []).includes(STRIPE_PAYGATE_ALIAS)) {
86
- continue;
87
- }
88
84
  const plans = (await access.payment().allPlans(product.sku))
89
- .filter(plan => planHelper.isSoldThrough(product, plan, STRIPE_PAYGATE_ALIAS));
85
+ .filter(plan => planHelper.isSoldThrough(product, plan, paygate));
90
86
  if (plans.length > 0) {
91
87
  result.push({ product, plans });
92
88
  }
@@ -96,7 +92,7 @@ export const makeCatalogueHelper = (ctx) => {
96
92
  const consumablePlanOf = async (productSku, planSku) => {
97
93
  const product = await access.payment().product(productSku);
98
94
  const plans = (await access.payment().allPlans(product.sku))
99
- .filter(plan => planHelper.isSoldThrough(product, plan, STRIPE_PAYGATE_ALIAS));
95
+ .filter(plan => planHelper.isForSale(product, plan));
100
96
  if (planSku != null && !plans.some(plan => plan.sku === planSku)) {
101
97
  throw new ProductError(`plan:${planSku}`);
102
98
  }
@@ -106,7 +102,7 @@ export const makeCatalogueHelper = (ctx) => {
106
102
  return { product, plan };
107
103
  };
108
104
  return {
109
- findPlan, findProduct, catalogPlans, freePlanOf, resolveEffectivePlan, entitlementsOf, stripePlansOf,
105
+ findPlan, findProduct, catalogPlans, freePlanOf, resolveEffectivePlan, entitlementsOf, plansSoldThrough,
110
106
  consumablePlanOf,
111
107
  };
112
108
  };
@@ -1 +1 @@
1
- {"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../src/catalogue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CA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M,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;QACtD,IAAI,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,OAAO,CAAC,EAAE,CAAC;YACjE,MAAM,IAAI,YAAY,CAAC,QAAQ,OAAO,EAAE,CAAC,CAAA;QAC3C,CAAC;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAA;QACjE,IAAI,IAAI,IAAI,IAAI;YAAE,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,CAAA;QAEhD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC,CAAA;IAED,OAAO;QACL,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB;QACvG,gBAAgB;KACjB,CAAA;AACH,CAAC,CAAA;AAED,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { CheckoutPlugin, CreateLinkParams } from '../types.js';
2
+ /** The checkout of a context, through any registered paygate. */
3
+ export interface CheckoutHelper {
4
+ /**
5
+ * A paygate checkout URL: an amount or quantity purchase of a consumable product, or a subscription
6
+ * to `planSku` (else the product's first recurring plan). The paygate is `params.paygate`, else the
7
+ * first registered one the plan is for sale through (`paygatesOf(ctx).forSale`); a plan no paygate
8
+ * sells is refused (`ProductError('plan:<sku>')`). A free plan is never checked out.
9
+ *
10
+ * With a consumer-rights policy: a locked billing country overrides the declared one (another is
11
+ * `BillingCountryLocked`); the charge currency is the profile's, else the region's; an amount
12
+ * checkout is narrowed by the checkout plugins (`CheckoutLimitExceeded`) and charged without FX
13
+ * when its policy currency is the charge currency; a subscription needs a fresh start request
14
+ * bound to its plan; the terms checkbox and the legal submit texts come from the copy.
15
+ *
16
+ * Under the paygate's customer e-mail lock the session's customer carries `params.email`
17
+ * (required, else `PaygateError('customer-email')`), so the paygate shows it read-only.
18
+ */
19
+ createCheckoutLink: (params: CreateLinkParams, plugins?: readonly CheckoutPlugin[]) => Promise<string>;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/checkout/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnE,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACvG"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugins/stripe/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/checkout/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Context as ApiContext } from '@owlmeans/server-api';
2
+ import type { CheckoutHelper } from './checkout/types.js';
3
+ export declare const makeCheckoutHelper: (ctx: ApiContext) => CheckoutHelper;
4
+ /** The checkout of a context — one per context. */
5
+ export declare const checkoutOf: (target: ApiContext<import("@owlmeans/server-api").Config>) => CheckoutHelper;
6
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAiBjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAkDzD,eAAO,MAAM,kBAAkB,QAAS,UAAU,KAAG,cAkVpD,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,UAAU,+EAAyC,CAAA"}