@owlmeans/server-payment 0.1.18-rc.2 → 0.1.18-rc.21
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.
- package/README.md +109 -25
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/server-payment/SKILL.md +475 -52
- package/build/actions/index.d.ts +1 -0
- package/build/actions/index.d.ts.map +1 -1
- package/build/actions/index.js +1 -0
- package/build/actions/index.js.map +1 -1
- package/build/actions/resync-subscriptions.d.ts +3 -0
- package/build/actions/resync-subscriptions.d.ts.map +1 -0
- package/build/actions/resync-subscriptions.js +7 -0
- package/build/actions/resync-subscriptions.js.map +1 -0
- package/build/actions/resync.d.ts +1 -0
- package/build/actions/resync.d.ts.map +1 -1
- package/build/actions/resync.js +7 -3
- package/build/actions/resync.js.map +1 -1
- package/build/actions/webhook.d.ts.map +1 -1
- package/build/actions/webhook.js +6 -3
- package/build/actions/webhook.js.map +1 -1
- package/build/config.d.ts +60 -5
- package/build/config.d.ts.map +1 -1
- package/build/config.js +237 -5
- package/build/config.js.map +1 -1
- package/build/consts.d.ts +75 -3
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +94 -5
- package/build/consts.js.map +1 -1
- package/build/consumer/capture.d.ts +74 -0
- package/build/consumer/capture.d.ts.map +1 -0
- package/build/consumer/capture.js +291 -0
- package/build/consumer/capture.js.map +1 -0
- package/build/consumer/format.d.ts +27 -0
- package/build/consumer/format.d.ts.map +1 -0
- package/build/consumer/format.js +81 -0
- package/build/consumer/format.js.map +1 -0
- package/build/consumer/handlers.d.ts +28 -0
- package/build/consumer/handlers.d.ts.map +1 -0
- package/build/consumer/handlers.js +173 -0
- package/build/consumer/handlers.js.map +1 -0
- package/build/consumer/index.d.ts +7 -0
- package/build/consumer/index.d.ts.map +1 -0
- package/build/consumer/index.js +6 -0
- package/build/consumer/index.js.map +1 -0
- package/build/consumer/mail.d.ts +27 -0
- package/build/consumer/mail.d.ts.map +1 -0
- package/build/consumer/mail.js +314 -0
- package/build/consumer/mail.js.map +1 -0
- package/build/consumer/origin.d.ts +14 -0
- package/build/consumer/origin.d.ts.map +1 -0
- package/build/consumer/origin.js +47 -0
- package/build/consumer/origin.js.map +1 -0
- package/build/consumer/reconcile.d.ts +12 -0
- package/build/consumer/reconcile.d.ts.map +1 -0
- package/build/consumer/reconcile.js +317 -0
- package/build/consumer/reconcile.js.map +1 -0
- package/build/consumer/records.d.ts +78 -0
- package/build/consumer/records.d.ts.map +1 -0
- package/build/consumer/records.js +296 -0
- package/build/consumer/records.js.map +1 -0
- package/build/consumer/service.d.ts +51 -0
- package/build/consumer/service.d.ts.map +1 -0
- package/build/consumer/service.js +760 -0
- package/build/consumer/service.js.map +1 -0
- package/build/consumer/withdrawal.d.ts +57 -0
- package/build/consumer/withdrawal.d.ts.map +1 -0
- package/build/consumer/withdrawal.js +247 -0
- package/build/consumer/withdrawal.js.map +1 -0
- package/build/entitlement.d.ts +10 -0
- package/build/entitlement.d.ts.map +1 -0
- package/build/entitlement.js +69 -0
- package/build/entitlement.js.map +1 -0
- package/build/entrypoints.d.ts +1 -1
- package/build/entrypoints.d.ts.map +1 -1
- package/build/entrypoints.js +2 -1
- package/build/entrypoints.js.map +1 -1
- package/build/gate.d.ts +32 -4
- package/build/gate.d.ts.map +1 -1
- package/build/gate.js +59 -19
- package/build/gate.js.map +1 -1
- package/build/index.d.ts +18 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +15 -3
- package/build/index.js.map +1 -1
- package/build/limit.d.ts +13 -0
- package/build/limit.d.ts.map +1 -0
- package/build/limit.js +47 -0
- package/build/limit.js.map +1 -0
- package/build/model.d.ts +10 -1
- package/build/model.d.ts.map +1 -1
- package/build/model.js +215 -17
- package/build/model.js.map +1 -1
- package/build/observer.d.ts +9 -0
- package/build/observer.d.ts.map +1 -1
- package/build/observer.js +38 -12
- package/build/observer.js.map +1 -1
- package/build/plan.d.ts +22 -0
- package/build/plan.d.ts.map +1 -0
- package/build/plan.js +72 -0
- package/build/plan.js.map +1 -0
- package/build/plugins/checkout-plugins.d.ts +49 -0
- package/build/plugins/checkout-plugins.d.ts.map +1 -0
- package/build/plugins/checkout-plugins.js +124 -0
- package/build/plugins/checkout-plugins.js.map +1 -0
- package/build/plugins/estimate.d.ts +43 -0
- package/build/plugins/estimate.d.ts.map +1 -0
- package/build/plugins/estimate.js +268 -0
- package/build/plugins/estimate.js.map +1 -0
- package/build/plugins/events.d.ts +45 -10
- package/build/plugins/events.d.ts.map +1 -1
- package/build/plugins/events.js +605 -136
- package/build/plugins/events.js.map +1 -1
- package/build/plugins/fx.d.ts +31 -0
- package/build/plugins/fx.d.ts.map +1 -0
- package/build/plugins/fx.js +81 -0
- package/build/plugins/fx.js.map +1 -0
- package/build/plugins/portal.d.ts +37 -0
- package/build/plugins/portal.d.ts.map +1 -0
- package/build/plugins/portal.js +265 -0
- package/build/plugins/portal.js.map +1 -0
- package/build/plugins/refunds.d.ts +33 -0
- package/build/plugins/refunds.d.ts.map +1 -0
- package/build/plugins/refunds.js +80 -0
- package/build/plugins/refunds.js.map +1 -0
- package/build/plugins/stripe.d.ts +36 -4
- package/build/plugins/stripe.d.ts.map +1 -1
- package/build/plugins/stripe.js +492 -97
- package/build/plugins/stripe.js.map +1 -1
- package/build/plugins/webhook-manager.d.ts +46 -0
- package/build/plugins/webhook-manager.d.ts.map +1 -0
- package/build/plugins/webhook-manager.js +231 -0
- package/build/plugins/webhook-manager.js.map +1 -0
- package/build/reconcile.d.ts +15 -0
- package/build/reconcile.d.ts.map +1 -0
- package/build/reconcile.js +88 -0
- package/build/reconcile.js.map +1 -0
- package/build/resource.d.ts +12 -1
- package/build/resource.d.ts.map +1 -1
- package/build/resource.js +97 -6
- package/build/resource.js.map +1 -1
- package/build/service.d.ts +28 -3
- package/build/service.d.ts.map +1 -1
- package/build/service.js +146 -19
- package/build/service.js.map +1 -1
- package/build/subscription.d.ts +48 -0
- package/build/subscription.d.ts.map +1 -0
- package/build/subscription.js +176 -0
- package/build/subscription.js.map +1 -0
- package/build/sync.d.ts +28 -1
- package/build/sync.d.ts.map +1 -1
- package/build/sync.js +208 -31
- package/build/sync.js.map +1 -1
- package/build/types.d.ts +1115 -36
- package/build/types.d.ts.map +1 -1
- package/build/usage.d.ts +63 -0
- package/build/usage.d.ts.map +1 -0
- package/build/usage.js +363 -0
- package/build/usage.js.map +1 -0
- package/build/utils.d.ts +52 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +69 -7
- package/build/utils.js.map +1 -1
- package/package.json +17 -13
- package/src/actions/index.ts +1 -0
- package/src/actions/resync-subscriptions.ts +10 -0
- package/src/actions/resync.ts +6 -3
- package/src/actions/webhook.ts +5 -3
- package/src/config.ts +264 -8
- package/src/consts.ts +114 -6
- package/src/consumer/capture.ts +362 -0
- package/src/consumer/format.ts +90 -0
- package/src/consumer/handlers.ts +211 -0
- package/src/consumer/index.ts +6 -0
- package/src/consumer/mail.ts +368 -0
- package/src/consumer/origin.ts +63 -0
- package/src/consumer/reconcile.ts +329 -0
- package/src/consumer/records.ts +374 -0
- package/src/consumer/service.ts +868 -0
- package/src/consumer/withdrawal.ts +302 -0
- package/src/entitlement.ts +84 -0
- package/src/entrypoints.ts +2 -1
- package/src/gate.ts +88 -21
- package/src/index.ts +24 -3
- package/src/limit.ts +57 -0
- package/src/model.ts +237 -18
- package/src/observer.ts +44 -11
- package/src/plan.ts +89 -0
- package/src/plugins/checkout-plugins.ts +155 -0
- package/src/plugins/estimate.ts +339 -0
- package/src/plugins/events.ts +677 -121
- package/src/plugins/fx.ts +122 -0
- package/src/plugins/portal.ts +306 -0
- package/src/plugins/refunds.ts +108 -0
- package/src/plugins/stripe.ts +581 -96
- package/src/plugins/webhook-manager.ts +270 -0
- package/src/reconcile.ts +103 -0
- package/src/resource.ts +152 -7
- package/src/service.ts +174 -18
- package/src/subscription.ts +231 -0
- package/src/sync.ts +249 -29
- package/src/types.ts +1227 -32
- package/src/usage.ts +453 -0
- package/src/utils.ts +127 -10
- package/tests/checkout-consumer.spec.ts +348 -0
- package/tests/checkout-plugins.spec.ts +164 -0
- package/tests/checkout.spec.ts +184 -83
- package/tests/consumer-events.spec.ts +218 -0
- package/tests/consumer-fixtures.ts +132 -0
- package/tests/consumer-ops.spec.ts +351 -0
- package/tests/consumer-rights.integration.spec.ts +150 -0
- package/tests/consumer-rights.spec.ts +501 -0
- package/tests/context.ts +109 -0
- package/tests/entitlement.spec.ts +103 -0
- package/tests/estimate.spec.ts +240 -0
- package/tests/events.spec.ts +356 -0
- package/tests/fake-stripe.ts +972 -0
- package/tests/gate.spec.ts +62 -72
- package/tests/limit-gate.spec.ts +68 -0
- package/tests/portal.spec.ts +200 -0
- package/tests/protocol.spec.ts +23 -6
- package/tests/sync.spec.ts +114 -0
- package/tests/usage.integration.spec.ts +101 -0
- package/tests/usage.spec.ts +171 -0
- package/tests/webhook-manager.spec.ts +152 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resync.d.ts","sourceRoot":"","sources":["../../src/actions/resync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resync.d.ts","sourceRoot":"","sources":["../../src/actions/resync.ts"],"names":[],"mappings":"AASA,yGAAyG;AACzG,eAAO,MAAM,MAAM,0JAKjB,CAAA"}
|
package/build/actions/resync.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { PaygateError } from '@owlmeans/payment';
|
|
1
2
|
import { handlers } from '@owlmeans/server-api';
|
|
2
3
|
import { paymentGate } from '../consts.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
4
|
+
import { bootstrapStripe } from '../service.js';
|
|
5
|
+
import { fingerprints, gateway, stripeClient } from '../utils.js';
|
|
5
6
|
const bind = handlers();
|
|
7
|
+
/** Forget every sync fingerprint and bring Stripe back to the declared catalogue, portal and webhook. */
|
|
6
8
|
export const resync = bind.request(paymentGate.resync, async (_request, context) => {
|
|
9
|
+
if (!gateway(context).managed)
|
|
10
|
+
throw new PaygateError('unmanaged');
|
|
7
11
|
await fingerprints(context).clear();
|
|
8
|
-
await
|
|
12
|
+
await bootstrapStripe(context, await stripeClient(context), { force: true });
|
|
9
13
|
return { ok: true };
|
|
10
14
|
});
|
|
11
15
|
//# sourceMappingURL=resync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resync.js","sourceRoot":"","sources":["../../src/actions/resync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,
|
|
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;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAGjE,MAAM,IAAI,GAAG,QAAQ,EAAW,CAAA;AAEhC,yGAAyG;AACzG,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACjF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO;QAAE,MAAM,IAAI,YAAY,CAAC,WAAW,CAAC,CAAA;IAClE,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAA;IACnC,MAAM,eAAe,CAAC,OAAO,EAAE,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AACrB,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO;;cAIlB,CAAA"}
|
package/build/actions/webhook.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { UnknownPaygate } from '@owlmeans/payment';
|
|
1
|
+
import { PaygateError, UnknownPaygate } from '@owlmeans/payment';
|
|
2
2
|
import { handlers } from '@owlmeans/server-api';
|
|
3
3
|
import { paymentGate, STRIPE_PAYGATE_ALIAS } from '../consts.js';
|
|
4
|
-
import {
|
|
4
|
+
import { handleStripeWebhook } from '../plugins/stripe.js';
|
|
5
|
+
import { gateway, stripeClient } from '../utils.js';
|
|
5
6
|
const bind = handlers();
|
|
6
7
|
export const webhook = bind.params(paymentGate.webhook, async ({ paygate }, context, request) => {
|
|
7
8
|
if (paygate !== STRIPE_PAYGATE_ALIAS)
|
|
8
9
|
throw new UnknownPaygate(paygate);
|
|
9
|
-
|
|
10
|
+
if (!gateway(context).managed)
|
|
11
|
+
throw new PaygateError('unmanaged');
|
|
12
|
+
await handleStripeWebhook(context, await stripeClient(context), request);
|
|
10
13
|
});
|
|
11
14
|
//# sourceMappingURL=webhook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/actions/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,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;AAC/C,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAGnD,MAAM,IAAI,GAAG,QAAQ,EAAW,CAAA;AAEhC,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,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO;QAAE,MAAM,IAAI,YAAY,CAAC,WAAW,CAAC,CAAA;IAClE,MAAM,mBAAmB,CAAC,OAAO,EAAE,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;AAC1E,CAAC,CAAC,CAAA"}
|
package/build/config.d.ts
CHANGED
|
@@ -1,8 +1,63 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConsumerRightsPolicy } from '@owlmeans/payment';
|
|
2
|
+
import type { Config, ConsumerRightsDef, PaymentPlan, PaymentPlanDef, PaymentProductDef, PortalBrandingDef, PricingDef, StripeSecretsDef } from './types.js';
|
|
2
3
|
export declare const declarePaymentProduct: (cfg: Config, def: PaymentProductDef) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Declare a plan into the configuration catalogue.
|
|
6
|
+
*
|
|
7
|
+
* Validated before anything is pushed: `rank` a safe integer `>= 0`; a `free` plan costs nothing
|
|
8
|
+
* and is sold through no gateway; no capability set under the reserved `limit` scope; every limit
|
|
9
|
+
* well-formed (a `window` limit names its window, the others do not, the ceiling is a safe
|
|
10
|
+
* integer, a promo ends at a real `Date`). Amount and quantity policies are asserted as before.
|
|
11
|
+
*/
|
|
3
12
|
export declare const declarePaymentPlan: (cfg: Config, def: PaymentPlanDef) => void;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
/** Every plan declared into a configuration. */
|
|
14
|
+
export declare const declaredPlansOf: (cfg: Config) => PaymentPlan[];
|
|
15
|
+
/**
|
|
16
|
+
* Cross-plan rules a single declaration cannot see:
|
|
17
|
+
*
|
|
18
|
+
* - at most one free plan per rank;
|
|
19
|
+
* - no two paid plans of one product at the same rank (one-time `consumable` plans are never an
|
|
20
|
+
* entity's plan and are not ranked against each other).
|
|
21
|
+
*
|
|
22
|
+
* A limit key MAY change kind between plans (lifetime on one, a monthly window on another): counters
|
|
23
|
+
* are keyed by `(entity, key, window)` and the window is derived from the kind, so each kind keeps its
|
|
24
|
+
* own counter and a lifetime count still sticks to the entity across plan changes.
|
|
25
|
+
*
|
|
26
|
+
* @throws PlanRankConflict
|
|
27
|
+
*/
|
|
28
|
+
export declare const assertPlanDeclarations: (cfg: Config) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Where the Stripe secrets live. A value that looks like a path is read into the configuration at
|
|
31
|
+
* boot. The webhook secret is an optional override of the one the managed endpoint stores.
|
|
32
|
+
*/
|
|
33
|
+
export declare const stripeSecrets: (cfg: Config, paths: StripeSecretsDef) => void;
|
|
34
|
+
/** Branding and the default return URL of the managed customer portal configuration. */
|
|
35
|
+
export declare const portalBranding: (cfg: Config, def: PortalBrandingDef) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Declare the pricing policy: whether checkout collects tax and a VAT/GST id, what `tax_behavior`
|
|
38
|
+
* synced prices are given, Adaptive Pricing, and whether the estimate endpoints are served. A
|
|
39
|
+
* config never carries more than one — a second call replaces the first, so re-declaring (a test, a
|
|
40
|
+
* config module re-run) is safe rather than silently ignored (a config resource resolves an id to
|
|
41
|
+
* its FIRST match).
|
|
42
|
+
*
|
|
43
|
+
* `def.stripe` (the FX Quotes preview version, the unspecified-price migration switch) is
|
|
44
|
+
* Stripe-only and goes to a backend plugin, never the advertised `PricingPolicy` record.
|
|
45
|
+
*
|
|
46
|
+
* @throws PaymentError (`assertPricingPolicy`) when an estimate is declared without the tax or
|
|
47
|
+
* currency capability it requires.
|
|
48
|
+
*/
|
|
49
|
+
export declare const declarePaymentPricing: (cfg: Config, def: PricingDef) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Declare the consumer-rights policy (EU withdrawal, spend consent, start requests, cancellation,
|
|
52
|
+
* country lock) — a singleton config record like the pricing policy: `DEFAULT_CONSUMER_RIGHTS`
|
|
53
|
+
* filled in, asserted, and replacing any earlier declaration. It is ADVERTISED to the browser; the
|
|
54
|
+
* `mail` options (mailer alias, sender, archive copies) go to a backend-only plugin config.
|
|
55
|
+
*
|
|
56
|
+
* `trader` (who the consumer contracts with: `name` for the statements, `legalName`/`address`/`email`
|
|
57
|
+
* for the mails and the withdrawal information) is backend-only as well.
|
|
58
|
+
*
|
|
59
|
+
* @throws ConsumerRightsError (`policy:<field>`) — see `assertConsumerRightsPolicy`; `policy:trader`
|
|
60
|
+
* when a mechanism is on and no trader `name` and `legalName` are declared.
|
|
61
|
+
*/
|
|
62
|
+
export declare const declareConsumerRights: (cfg: Config, def: ConsumerRightsDef) => ConsumerRightsPolicy;
|
|
8
63
|
//# sourceMappingURL=config.d.ts.map
|
package/build/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAA6C,MAAM,mBAAmB,CAAA;AAKxG,OAAO,KAAK,EACV,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAkB,iBAAiB,EAAE,iBAAiB,EAC5G,UAAU,EAAE,gBAAgB,EAC7B,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,qBAAqB,QAAS,MAAM,OAAO,iBAAiB,KAAG,IAS3E,CAAA;AA8BD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,OAAO,cAAc,KAAG,IA+CrE,CAAA;AAgDD,gDAAgD;AAChD,eAAO,MAAM,eAAe,QAAS,MAAM,KAAG,WAAW,EACiD,CAAA;AAE1G;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,QAAS,MAAM,KAAG,IAmBpD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAS,MAAM,SAAS,gBAAgB,KAAG,IAIpE,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,cAAc,QAAS,MAAM,OAAO,iBAAiB,KAAG,IAOpE,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,QAAS,MAAM,OAAO,UAAU,KAAG,IAwBpE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,QAAS,MAAM,OAAO,iBAAiB,KAAG,oBAsC3E,CAAA"}
|
package/build/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toConfigRecord } from '@owlmeans/server-app';
|
|
2
|
-
import { plugin } from '@owlmeans/config';
|
|
3
|
-
import { assertAmountCheckoutPolicy, assertQuantityCheckoutPolicy, CheckoutPricingMode, PLAN_RECORD_PREFIX, PLAN_RECORD_TYPE, PlanStatus, PRODUCT_RECORD_PREFIX, PRODUCT_RECORD_TYPE, } from '@owlmeans/payment';
|
|
4
|
-
import { STRIPE_PAYGATE_ALIAS, STRIPE_PLUGIN_CONFIG } from './consts.js';
|
|
2
|
+
import { plugin, PLUGIN_RECORD } from '@owlmeans/config';
|
|
3
|
+
import { assertAmountCheckoutPolicy, assertPricingPolicy, assertQuantityCheckoutPolicy, CAPABILITY_LIMIT_SCOPE, CheckoutPricingMode, CONSUMER_RIGHTS_RECORD_ID, CONSUMER_RIGHTS_RECORD_TYPE, ConsumerRightsError, LimitKind, LimitMisdeclared, LimitWindow, makeConsumerRightsPolicy, PLAN_RECORD_PREFIX, PLAN_RECORD_TYPE, PaymentError, PlanDuration, PlanRankConflict, PlanStatus, PRICING_POLICY_RECORD_ID, PRICING_POLICY_RECORD_TYPE, PRODUCT_RECORD_PREFIX, PRODUCT_RECORD_TYPE, ProductError, } from '@owlmeans/payment';
|
|
4
|
+
import { CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG, STRIPE_PAYGATE_ALIAS, STRIPE_PLUGIN_CONFIG, STRIPE_PORTAL_PLUGIN_CONFIG, STRIPE_PRICING_PLUGIN_CONFIG, } from './consts.js';
|
|
5
5
|
export const declarePaymentProduct = (cfg, def) => {
|
|
6
6
|
cfg.records = cfg.records ?? [];
|
|
7
7
|
const product = {
|
|
@@ -12,8 +12,52 @@ export const declarePaymentProduct = (cfg, def) => {
|
|
|
12
12
|
};
|
|
13
13
|
cfg.records.push({ ...toConfigRecord(product), recordType: PRODUCT_RECORD_TYPE, id: `${PRODUCT_RECORD_PREFIX}:${def.sku}` });
|
|
14
14
|
};
|
|
15
|
+
const isSafeCount = (value) => typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
|
|
16
|
+
const LIMIT_KINDS = Object.values(LimitKind);
|
|
17
|
+
const LIMIT_WINDOWS = Object.values(LimitWindow);
|
|
18
|
+
const assertLimitDeclaration = (key, limit) => {
|
|
19
|
+
if (!LIMIT_KINDS.includes(limit.kind)) {
|
|
20
|
+
throw new LimitMisdeclared(`${key}:kind`);
|
|
21
|
+
}
|
|
22
|
+
if (limit.kind === LimitKind.Window) {
|
|
23
|
+
if (limit.window == null) {
|
|
24
|
+
throw new LimitMisdeclared(`${key}:window-missing`);
|
|
25
|
+
}
|
|
26
|
+
if (!LIMIT_WINDOWS.includes(limit.window)) {
|
|
27
|
+
throw new LimitMisdeclared(`${key}:window`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (limit.window != null) {
|
|
31
|
+
throw new LimitMisdeclared(`${key}:window-forbidden`);
|
|
32
|
+
}
|
|
33
|
+
if (!isSafeCount(limit.limit)) {
|
|
34
|
+
throw new LimitMisdeclared(`${key}:limit`);
|
|
35
|
+
}
|
|
36
|
+
if (limit.promo != null && !(limit.promo.until instanceof Date && !Number.isNaN(limit.promo.until.getTime()))) {
|
|
37
|
+
throw new LimitMisdeclared(`${key}:promo-until`);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Declare a plan into the configuration catalogue.
|
|
42
|
+
*
|
|
43
|
+
* Validated before anything is pushed: `rank` a safe integer `>= 0`; a `free` plan costs nothing
|
|
44
|
+
* and is sold through no gateway; no capability set under the reserved `limit` scope; every limit
|
|
45
|
+
* well-formed (a `window` limit names its window, the others do not, the ceiling is a safe
|
|
46
|
+
* integer, a promo ends at a real `Date`). Amount and quantity policies are asserted as before.
|
|
47
|
+
*/
|
|
15
48
|
export const declarePaymentPlan = (cfg, def) => {
|
|
16
|
-
|
|
49
|
+
if (def.rank != null && !isSafeCount(def.rank)) {
|
|
50
|
+
throw new PlanRankConflict(`rank:${def.sku}`);
|
|
51
|
+
}
|
|
52
|
+
if (def.free === true && (def.price !== 0 || (def.gateways ?? []).length > 0)) {
|
|
53
|
+
throw new PlanRankConflict(`free:${def.sku}`);
|
|
54
|
+
}
|
|
55
|
+
if ((def.capabilities ?? []).some(set => set.scope === CAPABILITY_LIMIT_SCOPE)) {
|
|
56
|
+
throw new LimitMisdeclared(`${def.sku}:reserved-scope`);
|
|
57
|
+
}
|
|
58
|
+
for (const [key, limit] of Object.entries(def.limits ?? {})) {
|
|
59
|
+
assertLimitDeclaration(key, limit);
|
|
60
|
+
}
|
|
17
61
|
const pricingMode = def.pricingMode;
|
|
18
62
|
if (pricingMode === CheckoutPricingMode.Amount) {
|
|
19
63
|
if (def.amountPolicy == null)
|
|
@@ -29,18 +73,206 @@ export const declarePaymentPlan = (cfg, def) => {
|
|
|
29
73
|
: undefined);
|
|
30
74
|
if (quantityPolicy != null)
|
|
31
75
|
assertQuantityCheckoutPolicy(quantityPolicy);
|
|
76
|
+
const currencyPrices = currencyPricesOf(def);
|
|
77
|
+
assertWithdrawalComponents(def);
|
|
78
|
+
cfg.records = cfg.records ?? [];
|
|
32
79
|
const plan = {
|
|
33
80
|
productSku: def.productSku, sku: def.sku, status: PlanStatus.Active,
|
|
81
|
+
...(def.rank != null ? { rank: def.rank } : {}),
|
|
82
|
+
...(def.free === true ? { free: true, gateways: [] } : def.gateways != null ? { gateways: def.gateways } : {}),
|
|
34
83
|
duration: def.duration, price: def.price, currency: def.currency ?? def.amountPolicy?.currency ?? 'usd',
|
|
35
84
|
order: def.order ?? 0, title: def.title ?? def.sku, capabilities: def.capabilities,
|
|
36
85
|
limits: def.limits, recurring: def.recurring, pricingMode, amountPolicy: def.amountPolicy,
|
|
37
86
|
quantityPolicy,
|
|
38
87
|
minQuantity: quantityPolicy?.minimum, maxQuantity: quantityPolicy?.maximum,
|
|
39
88
|
defaultQuantity: quantityPolicy?.default,
|
|
89
|
+
...(currencyPrices != null ? { currencyPrices } : {}),
|
|
90
|
+
...(def.withdrawal != null ? { withdrawal: { components: def.withdrawal.components.map(item => ({ ...item })) } } : {}),
|
|
40
91
|
};
|
|
41
92
|
cfg.records.push({ ...toConfigRecord(plan), recordType: PLAN_RECORD_TYPE, id: `${PLAN_RECORD_PREFIX}:${def.sku}` });
|
|
42
93
|
};
|
|
94
|
+
const CURRENCY = /^[a-z]{3}$/;
|
|
95
|
+
/** `currencyPrices` normalized to lowercase codes; each a positive amount of whole minor units. */
|
|
96
|
+
const currencyPricesOf = (def) => {
|
|
97
|
+
if (def.currencyPrices == null) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
if (def.pricingMode === CheckoutPricingMode.Amount || def.free === true) {
|
|
101
|
+
throw new ProductError(`currency-prices:${def.sku}:mode`);
|
|
102
|
+
}
|
|
103
|
+
const prices = {};
|
|
104
|
+
for (const [raw, amount] of Object.entries(def.currencyPrices)) {
|
|
105
|
+
const currency = raw.toLowerCase();
|
|
106
|
+
const minor = Math.round(amount * 100);
|
|
107
|
+
if (!CURRENCY.test(currency) || !Number.isFinite(amount) || amount <= 0 || !Number.isSafeInteger(minor)
|
|
108
|
+
|| Math.abs(minor - amount * 100) > 1e-6 || prices[currency] != null) {
|
|
109
|
+
throw new ProductError(`currency-prices:${def.sku}:${raw}`);
|
|
110
|
+
}
|
|
111
|
+
prices[currency] = amount;
|
|
112
|
+
}
|
|
113
|
+
return prices;
|
|
114
|
+
};
|
|
115
|
+
/** The components' shares must add up to the plan's price in minor units. */
|
|
116
|
+
const assertWithdrawalComponents = (def) => {
|
|
117
|
+
const components = def.withdrawal?.components;
|
|
118
|
+
if (components == null) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const keys = new Set();
|
|
122
|
+
let sum = 0;
|
|
123
|
+
for (const component of components) {
|
|
124
|
+
if (typeof component.key !== 'string' || component.key === '' || keys.has(component.key)
|
|
125
|
+
|| (component.basis !== 'time' && component.basis !== 'units')
|
|
126
|
+
|| !Number.isSafeInteger(component.shareMinor) || component.shareMinor < 0) {
|
|
127
|
+
throw new ProductError(`withdrawal:${def.sku}:component`);
|
|
128
|
+
}
|
|
129
|
+
keys.add(component.key);
|
|
130
|
+
sum += component.shareMinor;
|
|
131
|
+
}
|
|
132
|
+
if (components.length === 0 || sum !== Math.round(def.price * 100)) {
|
|
133
|
+
throw new ProductError(`withdrawal:${def.sku}:shares`);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
/** Every plan declared into a configuration. */
|
|
137
|
+
export const declaredPlansOf = (cfg) => (cfg.records ?? []).filter(record => record.recordType === PLAN_RECORD_TYPE);
|
|
138
|
+
/**
|
|
139
|
+
* Cross-plan rules a single declaration cannot see:
|
|
140
|
+
*
|
|
141
|
+
* - at most one free plan per rank;
|
|
142
|
+
* - no two paid plans of one product at the same rank (one-time `consumable` plans are never an
|
|
143
|
+
* entity's plan and are not ranked against each other).
|
|
144
|
+
*
|
|
145
|
+
* A limit key MAY change kind between plans (lifetime on one, a monthly window on another): counters
|
|
146
|
+
* are keyed by `(entity, key, window)` and the window is derived from the kind, so each kind keeps its
|
|
147
|
+
* own counter and a lifetime count still sticks to the entity across plan changes.
|
|
148
|
+
*
|
|
149
|
+
* @throws PlanRankConflict
|
|
150
|
+
*/
|
|
151
|
+
export const assertPlanDeclarations = (cfg) => {
|
|
152
|
+
const plans = declaredPlansOf(cfg);
|
|
153
|
+
const freeRanks = new Set();
|
|
154
|
+
const paidRanks = new Set();
|
|
155
|
+
for (const plan of plans) {
|
|
156
|
+
const rank = plan.rank ?? 0;
|
|
157
|
+
if (plan.free === true) {
|
|
158
|
+
if (freeRanks.has(rank)) {
|
|
159
|
+
throw new PlanRankConflict(`free:${rank}`);
|
|
160
|
+
}
|
|
161
|
+
freeRanks.add(rank);
|
|
162
|
+
}
|
|
163
|
+
else if (plan.duration !== PlanDuration.Consumable) {
|
|
164
|
+
const key = `${plan.productSku}:${rank}`;
|
|
165
|
+
if (paidRanks.has(key)) {
|
|
166
|
+
throw new PlanRankConflict(key);
|
|
167
|
+
}
|
|
168
|
+
paidRanks.add(key);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Where the Stripe secrets live. A value that looks like a path is read into the configuration at
|
|
174
|
+
* boot. The webhook secret is an optional override of the one the managed endpoint stores.
|
|
175
|
+
*/
|
|
43
176
|
export const stripeSecrets = (cfg, paths) => {
|
|
44
|
-
plugin(cfg, {
|
|
177
|
+
plugin(cfg, {
|
|
178
|
+
api: paths.api, ...(paths.webhook != null && paths.webhook !== '' ? { webhook: paths.webhook } : {}),
|
|
179
|
+
}, STRIPE_PLUGIN_CONFIG);
|
|
180
|
+
};
|
|
181
|
+
/** Branding and the default return URL of the managed customer portal configuration. */
|
|
182
|
+
export const portalBranding = (cfg, def) => {
|
|
183
|
+
plugin(cfg, {
|
|
184
|
+
returnUrl: def.returnUrl,
|
|
185
|
+
...(def.headline != null ? { headline: def.headline } : {}),
|
|
186
|
+
...(def.privacyPolicyUrl != null ? { privacyPolicyUrl: def.privacyPolicyUrl } : {}),
|
|
187
|
+
...(def.termsOfServiceUrl != null ? { termsOfServiceUrl: def.termsOfServiceUrl } : {}),
|
|
188
|
+
}, STRIPE_PORTAL_PLUGIN_CONFIG);
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Declare the pricing policy: whether checkout collects tax and a VAT/GST id, what `tax_behavior`
|
|
192
|
+
* synced prices are given, Adaptive Pricing, and whether the estimate endpoints are served. A
|
|
193
|
+
* config never carries more than one — a second call replaces the first, so re-declaring (a test, a
|
|
194
|
+
* config module re-run) is safe rather than silently ignored (a config resource resolves an id to
|
|
195
|
+
* its FIRST match).
|
|
196
|
+
*
|
|
197
|
+
* `def.stripe` (the FX Quotes preview version, the unspecified-price migration switch) is
|
|
198
|
+
* Stripe-only and goes to a backend plugin, never the advertised `PricingPolicy` record.
|
|
199
|
+
*
|
|
200
|
+
* @throws PaymentError (`assertPricingPolicy`) when an estimate is declared without the tax or
|
|
201
|
+
* currency capability it requires.
|
|
202
|
+
*/
|
|
203
|
+
export const declarePaymentPricing = (cfg, def) => {
|
|
204
|
+
const { stripe, ...policy } = def;
|
|
205
|
+
assertPricingPolicy(policy);
|
|
206
|
+
cfg.records = (cfg.records ?? []).filter(record => record.id !== PRICING_POLICY_RECORD_ID);
|
|
207
|
+
cfg.records.push({
|
|
208
|
+
...toConfigRecord(policy), recordType: PRICING_POLICY_RECORD_TYPE, id: PRICING_POLICY_RECORD_ID,
|
|
209
|
+
});
|
|
210
|
+
if (stripe != null) {
|
|
211
|
+
const settlementCurrency = stripe.settlementCurrency?.toLowerCase();
|
|
212
|
+
if (settlementCurrency != null && !/^[a-z]{3}$/.test(settlementCurrency)) {
|
|
213
|
+
throw new PaymentError('pricing-policy:settlement-currency');
|
|
214
|
+
}
|
|
215
|
+
const subscriptionPaymentMethodTypes = stripe.subscriptionPaymentMethodTypes?.map(type => type.toLowerCase());
|
|
216
|
+
if (subscriptionPaymentMethodTypes != null && (subscriptionPaymentMethodTypes.length === 0
|
|
217
|
+
|| subscriptionPaymentMethodTypes.some(type => !/^[a-z][a-z0-9_]*$/.test(type))
|
|
218
|
+
|| new Set(subscriptionPaymentMethodTypes).size !== subscriptionPaymentMethodTypes.length)) {
|
|
219
|
+
throw new PaymentError('pricing-policy:subscription-payment-methods');
|
|
220
|
+
}
|
|
221
|
+
plugin(cfg, {
|
|
222
|
+
...stripe,
|
|
223
|
+
...(settlementCurrency != null ? { settlementCurrency } : {}),
|
|
224
|
+
...(subscriptionPaymentMethodTypes != null ? { subscriptionPaymentMethodTypes } : {}),
|
|
225
|
+
}, STRIPE_PRICING_PLUGIN_CONFIG);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Declare the consumer-rights policy (EU withdrawal, spend consent, start requests, cancellation,
|
|
230
|
+
* country lock) — a singleton config record like the pricing policy: `DEFAULT_CONSUMER_RIGHTS`
|
|
231
|
+
* filled in, asserted, and replacing any earlier declaration. It is ADVERTISED to the browser; the
|
|
232
|
+
* `mail` options (mailer alias, sender, archive copies) go to a backend-only plugin config.
|
|
233
|
+
*
|
|
234
|
+
* `trader` (who the consumer contracts with: `name` for the statements, `legalName`/`address`/`email`
|
|
235
|
+
* for the mails and the withdrawal information) is backend-only as well.
|
|
236
|
+
*
|
|
237
|
+
* @throws ConsumerRightsError (`policy:<field>`) — see `assertConsumerRightsPolicy`; `policy:trader`
|
|
238
|
+
* when a mechanism is on and no trader `name` and `legalName` are declared.
|
|
239
|
+
*/
|
|
240
|
+
export const declareConsumerRights = (cfg, def) => {
|
|
241
|
+
const { mail, trader, ...declaration } = def;
|
|
242
|
+
const policy = makeConsumerRightsPolicy(declaration);
|
|
243
|
+
const anyMechanism = Object.values(policy.mechanisms).some(on => on === true);
|
|
244
|
+
if (anyMechanism && (trader?.name == null || trader.name.trim() === '' || trader.legalName == null
|
|
245
|
+
|| trader.legalName.trim() === '')) {
|
|
246
|
+
throw new ConsumerRightsError('policy:trader');
|
|
247
|
+
}
|
|
248
|
+
if (mail?.bcc?.some(address => !/^[^\s@]+@[^\s@]+$/.test(address)) === true) {
|
|
249
|
+
throw new ConsumerRightsError('policy:mail-bcc');
|
|
250
|
+
}
|
|
251
|
+
cfg.records = (cfg.records ?? []).filter(record => record.id !== CONSUMER_RIGHTS_RECORD_ID);
|
|
252
|
+
cfg.records.push({
|
|
253
|
+
...toConfigRecord(policy), recordType: CONSUMER_RIGHTS_RECORD_TYPE, id: CONSUMER_RIGHTS_RECORD_ID,
|
|
254
|
+
});
|
|
255
|
+
const plugins = cfg[PLUGIN_RECORD];
|
|
256
|
+
if (plugins != null) {
|
|
257
|
+
cfg[PLUGIN_RECORD] = plugins
|
|
258
|
+
.filter(record => record.id !== CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG);
|
|
259
|
+
}
|
|
260
|
+
if (mail != null || trader != null) {
|
|
261
|
+
plugin(cfg, {
|
|
262
|
+
...(trader != null ? {
|
|
263
|
+
trader: {
|
|
264
|
+
name: trader.name.trim(), legalName: trader.legalName.trim(),
|
|
265
|
+
...(trader.address != null && trader.address.trim() !== '' ? { address: trader.address.trim() } : {}),
|
|
266
|
+
...(trader.email != null && trader.email.trim() !== '' ? { email: trader.email.trim() } : {}),
|
|
267
|
+
...(trader.website != null && trader.website.trim() !== '' ? { website: trader.website.trim() } : {}),
|
|
268
|
+
},
|
|
269
|
+
} : {}),
|
|
270
|
+
...(mail?.alias != null ? { alias: mail.alias } : {}),
|
|
271
|
+
...(mail?.from != null ? { from: mail.from } : {}),
|
|
272
|
+
...(mail?.replyTo != null ? { replyTo: mail.replyTo } : {}),
|
|
273
|
+
...(mail?.bcc != null && mail.bcc.length > 0 ? { bcc: [...mail.bcc] } : {}),
|
|
274
|
+
}, CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG);
|
|
275
|
+
}
|
|
276
|
+
return policy;
|
|
45
277
|
};
|
|
46
278
|
//# sourceMappingURL=config.js.map
|
package/build/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,0BAA0B,EAAE,4BAA4B,EAAE,mBAAmB,EAC7E,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE,mBAAmB,GAC7F,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAE,GAAsB,EAAQ,EAAE;IACjF,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAE,CAAA;IAC/B,MAAM,OAAO,GAAmB;QAC9B,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW;QAC3E,UAAU,EAAE,GAAG,CAAC,UAAU,IAAI,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ;QAC1D,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,YAAY;QAChF,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS;KAC/C,CAAA;IACD,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,mBAAm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AI,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3D,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5E,EAAE,kCAAkC,CAAC,CAAA;IACxC,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
package/build/consts.d.ts
CHANGED
|
@@ -1,26 +1,98 @@
|
|
|
1
|
+
import { INTERNAL_PAYGATE, LIMIT_GATE } from '@owlmeans/payment';
|
|
2
|
+
export { INTERNAL_PAYGATE, LIMIT_GATE };
|
|
1
3
|
export declare const STRIPE_PAYGATE_ALIAS = "stripe";
|
|
2
4
|
export declare const STRIPE_PLUGIN_CONFIG = "_external:stripe";
|
|
5
|
+
export declare const STRIPE_PORTAL_PLUGIN_CONFIG = "_external:stripe-portal";
|
|
6
|
+
/** Stripe-only pricing settings (FX Quotes API version, the unspecified-price migration switch) — never advertised to the browser, unlike the `PricingPolicy` record itself. */
|
|
7
|
+
export declare const STRIPE_PRICING_PLUGIN_CONFIG = "_external:stripe-pricing";
|
|
3
8
|
export declare const STRIPE_SIGNATURE = "Stripe-Signature";
|
|
9
|
+
/**
|
|
10
|
+
* The FX Quotes API is a Stripe PREVIEW endpoint as of this writing: it answers only a
|
|
11
|
+
* `Stripe-Version` header naming a preview version, never the SDK's pinned stable one. Verify this
|
|
12
|
+
* string against https://docs.stripe.com/api/fx_quotes/create before relying on it, and override it
|
|
13
|
+
* with `declarePaymentPricing({ stripe: { fxApiVersion } })` once Stripe moves the API or renames
|
|
14
|
+
* the preview.
|
|
15
|
+
*/
|
|
16
|
+
export declare const STRIPE_FX_QUOTES_API_VERSION = "2025-07-30.preview";
|
|
4
17
|
export declare const GATEWAY_SERVICE = "payment-gateway";
|
|
5
18
|
export declare const PAYMENT_OBSERVER = "payment-observer";
|
|
19
|
+
export declare const ENTITLEMENT_SERVICE = "payment-entitlement";
|
|
6
20
|
export declare const RES_PAYGATE_CUSTOMER = "payment-paygate-customer";
|
|
7
21
|
export declare const RES_PAYMENT_SUBSCRIPTION = "payment-subscription";
|
|
22
|
+
export declare const RES_PAYMENT_FULFILLMENT = "payment-fulfillment";
|
|
23
|
+
export declare const RES_PAYMENT_WEBHOOK = "payment-webhook";
|
|
24
|
+
export declare const RES_PAYMENT_USAGE = "payment-usage";
|
|
25
|
+
export declare const RES_PAYMENT_USAGE_COUNTER = "payment-usage-counter";
|
|
8
26
|
export declare const RES_PAYMENT_FINGERPRINT = "payment-fingerprint";
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
27
|
+
/** One per organization: the billing country fixed at the first purchase. */
|
|
28
|
+
export declare const RES_BILLING_PROFILE = "payment-billing-profile";
|
|
29
|
+
/** One per paid checkout (a top-up, a subscription's first invoice): the contract and its window. */
|
|
30
|
+
export declare const RES_PAYMENT_PURCHASE = "payment-purchase";
|
|
31
|
+
/** Append-only: express consents to early performance and subscription start requests. */
|
|
32
|
+
export declare const RES_CONSUMER_CONSENT = "payment-consumer-consent";
|
|
33
|
+
/** Append-only: withdrawal and cancellation declarations. */
|
|
34
|
+
export declare const RES_CONSUMER_DECLARATION = "payment-consumer-declaration";
|
|
35
|
+
/** Append-only: every execution and audit step of the consumer-rights flows. */
|
|
36
|
+
export declare const RES_CONSUMER_EVENT = "payment-consumer-event";
|
|
37
|
+
export declare const CONSUMER_RIGHTS_SERVICE = "payment-consumer-rights";
|
|
38
|
+
/** The consumer-rights mail options (trader, sender, archive copies) — never advertised. */
|
|
39
|
+
export declare const CONSUMER_RIGHTS_MAIL_PLUGIN_CONFIG = "_external:payment-consumer-mail";
|
|
40
|
+
/** Stripe's own bounds of a Checkout Session's `expires_at`, from now. */
|
|
41
|
+
export declare const STRIPE_SESSION_TTL_MIN_SECONDS: number;
|
|
42
|
+
export declare const STRIPE_SESSION_TTL_MAX_SECONDS: number;
|
|
43
|
+
/** How far back `reconcile` looks for completed sessions that have no purchase row. */
|
|
44
|
+
export declare const PURCHASE_BACKFILL_DAYS = 16;
|
|
45
|
+
/** Top-level domains that never receive mail (RFC 2606 / 6761) — e2e addresses are recorded as skipped. */
|
|
46
|
+
export declare const RESERVED_MAIL_TLDS: readonly string[];
|
|
47
|
+
/** The purchase id prefix of a Stripe purchase: `stripe:<session id>` or `stripe:<subscription id>`. */
|
|
48
|
+
export declare const PURCHASE_ID_PREFIX = "stripe";
|
|
49
|
+
/**
|
|
50
|
+
* The contract reference alphabet: digits and capitals without the look-alikes 0/O, 1/I/L, so a
|
|
51
|
+
* reference read aloud or typed from paper is never ambiguous.
|
|
52
|
+
*/
|
|
53
|
+
export declare const CONTRACT_REF_ALPHABET = "23456789ABCDEFGHJKMNPQRSTUVWXYZ";
|
|
54
|
+
/** Fingerprint sku prefix of a portal configuration: `portal:<service>`. */
|
|
55
|
+
export declare const FINGERPRINT_PORTAL = "portal";
|
|
56
|
+
/**
|
|
57
|
+
* The metadata every Stripe object this package creates carries (`{ owlmeans: 'payment', service }`).
|
|
58
|
+
* It labels the object for an operator; several deployments of one service share it, so it never
|
|
59
|
+
* decides on its own that an object belongs to this deployment.
|
|
60
|
+
*/
|
|
61
|
+
export declare const STRIPE_OWNER_KEY = "owlmeans";
|
|
62
|
+
export declare const STRIPE_OWNER_VALUE = "payment";
|
|
63
|
+
/**
|
|
64
|
+
* The metadata key naming the ONE deployment a portal configuration belongs to, valued with that
|
|
65
|
+
* deployment's webhook URL (`webhookUrlOf`). Only an exact match lets a deployment adopt a
|
|
66
|
+
* configuration it holds no fingerprint row for.
|
|
67
|
+
*/
|
|
68
|
+
export declare const STRIPE_DEPLOYMENT_KEY = "deployment";
|
|
69
|
+
/**
|
|
70
|
+
* Every Stripe event the managed webhook endpoint subscribes to.
|
|
71
|
+
*
|
|
72
|
+
* `invoice.upcoming` is enabled although nothing handles it (it carries no invoice id and nothing
|
|
73
|
+
* is due), so an application can observe it without a Stripe dashboard change.
|
|
74
|
+
*/
|
|
75
|
+
export declare const WEBHOOK_EVENTS: readonly string[];
|
|
11
76
|
export interface PaygateParams {
|
|
12
77
|
paygate: string;
|
|
13
78
|
}
|
|
14
79
|
export interface ResyncResult {
|
|
15
80
|
ok: boolean;
|
|
16
81
|
}
|
|
82
|
+
export interface ResyncSubscriptionsResult {
|
|
83
|
+
scanned: number;
|
|
84
|
+
updated: number;
|
|
85
|
+
}
|
|
17
86
|
/** Embedded gateway protocol tree; the alias strings are private adapter details. */
|
|
18
87
|
export declare const paymentGate: {
|
|
19
88
|
readonly base: import("@owlmeans/entrypoint").EntrypointProtocol<{}, undefined>;
|
|
89
|
+
/** Public: Stripe signs the raw body, so no application guard may sit in front of it. */
|
|
20
90
|
readonly webhook: import("@owlmeans/entrypoint").EntrypointProtocol<{
|
|
21
91
|
params: PaygateParams;
|
|
22
92
|
}, undefined>;
|
|
93
|
+
/** Re-sync products, prices, the portal configuration and the webhook endpoint. */
|
|
23
94
|
readonly resync: import("@owlmeans/entrypoint").EntrypointProtocol<{}, ResyncResult>;
|
|
95
|
+
/** Re-read every live paygate subscription and apply it as a webhook would. */
|
|
96
|
+
readonly resyncSubscriptions: import("@owlmeans/entrypoint").EntrypointProtocol<{}, ResyncSubscriptionsResult>;
|
|
24
97
|
};
|
|
25
|
-
export declare const paymentGateProtocols: import("@owlmeans/entrypoint").EntrypointProtocolDeclaration[];
|
|
26
98
|
//# sourceMappingURL=consts.d.ts.map
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGhE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAA;AAEvC,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAC5C,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AACtD,eAAO,MAAM,2BAA2B,4BAA4B,CAAA;AACpE,gLAAgL;AAChL,eAAO,MAAM,4BAA4B,6BAA6B,CAAA;AACtE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,uBAAuB,CAAA;AAChE,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AAExD,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAC9D,eAAO,MAAM,wBAAwB,yBAAyB,CAAA;AAC9D,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAC5D,eAAO,MAAM,mBAAmB,oBAAoB,CAAA;AACpD,eAAO,MAAM,iBAAiB,kBAAkB,CAAA;AAChD,eAAO,MAAM,yBAAyB,0BAA0B,CAAA;AAChE,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAE5D,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,4BAA4B,CAAA;AAC5D,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AACtD,0FAA0F;AAC1F,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAC9D,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,iCAAiC,CAAA;AACtE,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,2BAA2B,CAAA;AAE1D,eAAO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