@venturekit/billing 0.0.48 → 0.0.51

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 (115) hide show
  1. package/README.md +30 -28
  2. package/dist/client.d.ts +15 -8
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +21 -10
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +1 -1
  7. package/dist/errors.js +1 -1
  8. package/dist/events.d.ts +51 -7
  9. package/dist/events.d.ts.map +1 -1
  10. package/dist/events.js +3 -3
  11. package/dist/events.js.map +1 -1
  12. package/dist/index.d.ts +13 -11
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +10 -8
  15. package/dist/index.js.map +1 -1
  16. package/dist/provider.d.ts +51 -7
  17. package/dist/provider.d.ts.map +1 -1
  18. package/dist/provider.js +10 -1
  19. package/dist/provider.js.map +1 -1
  20. package/dist/providers/index.d.ts +2 -1
  21. package/dist/providers/index.d.ts.map +1 -1
  22. package/dist/providers/index.js +2 -1
  23. package/dist/providers/index.js.map +1 -1
  24. package/dist/providers/{zazu → manza}/adapter.d.ts +15 -15
  25. package/dist/providers/manza/adapter.d.ts.map +1 -0
  26. package/dist/providers/{zazu → manza}/adapter.js +24 -24
  27. package/dist/providers/manza/adapter.js.map +1 -0
  28. package/dist/providers/manza/client.d.ts +76 -0
  29. package/dist/providers/manza/client.d.ts.map +1 -0
  30. package/dist/providers/{zazu → manza}/client.js +9 -9
  31. package/dist/providers/manza/client.js.map +1 -0
  32. package/dist/providers/{zazu → manza}/config.d.ts +21 -21
  33. package/dist/providers/manza/config.d.ts.map +1 -0
  34. package/dist/providers/manza/config.js +99 -0
  35. package/dist/providers/manza/config.js.map +1 -0
  36. package/dist/providers/{zazu → manza}/correlation.d.ts +7 -7
  37. package/dist/providers/manza/correlation.d.ts.map +1 -0
  38. package/dist/providers/{zazu → manza}/correlation.js +22 -22
  39. package/dist/providers/manza/correlation.js.map +1 -0
  40. package/dist/providers/manza/index.d.ts +19 -0
  41. package/dist/providers/manza/index.d.ts.map +1 -0
  42. package/dist/providers/manza/index.js +24 -0
  43. package/dist/providers/manza/index.js.map +1 -0
  44. package/dist/providers/manza/maps.d.ts +36 -0
  45. package/dist/providers/manza/maps.d.ts.map +1 -0
  46. package/dist/providers/{zazu → manza}/maps.js +4 -4
  47. package/dist/providers/manza/maps.js.map +1 -0
  48. package/dist/providers/{zazu → manza}/secrets.d.ts +15 -15
  49. package/dist/providers/manza/secrets.d.ts.map +1 -0
  50. package/dist/providers/{zazu → manza}/secrets.js +13 -13
  51. package/dist/providers/manza/secrets.js.map +1 -0
  52. package/dist/providers/{zazu → manza}/types.d.ts +65 -65
  53. package/dist/providers/manza/types.d.ts.map +1 -0
  54. package/dist/providers/{zazu → manza}/types.js +3 -3
  55. package/dist/providers/manza/types.js.map +1 -0
  56. package/dist/providers/{zazu → manza}/webhooks.d.ts +19 -19
  57. package/dist/providers/manza/webhooks.d.ts.map +1 -0
  58. package/dist/providers/{zazu → manza}/webhooks.js +57 -46
  59. package/dist/providers/manza/webhooks.js.map +1 -0
  60. package/dist/providers/mock.js +3 -3
  61. package/dist/providers/stripe/adapter.d.ts +28 -0
  62. package/dist/providers/stripe/adapter.d.ts.map +1 -0
  63. package/dist/providers/stripe/adapter.js +192 -0
  64. package/dist/providers/stripe/adapter.js.map +1 -0
  65. package/dist/providers/stripe/client.d.ts +26 -0
  66. package/dist/providers/stripe/client.d.ts.map +1 -0
  67. package/dist/providers/stripe/client.js +84 -0
  68. package/dist/providers/stripe/client.js.map +1 -0
  69. package/dist/providers/stripe/config.d.ts +28 -0
  70. package/dist/providers/stripe/config.d.ts.map +1 -0
  71. package/dist/providers/stripe/config.js +33 -0
  72. package/dist/providers/stripe/config.js.map +1 -0
  73. package/dist/providers/stripe/index.d.ts +13 -0
  74. package/dist/providers/stripe/index.d.ts.map +1 -0
  75. package/dist/providers/stripe/index.js +16 -0
  76. package/dist/providers/stripe/index.js.map +1 -0
  77. package/dist/providers/stripe/maps.d.ts +165 -0
  78. package/dist/providers/stripe/maps.d.ts.map +1 -0
  79. package/dist/providers/stripe/maps.js +179 -0
  80. package/dist/providers/stripe/maps.js.map +1 -0
  81. package/dist/providers/stripe/webhooks.d.ts +34 -0
  82. package/dist/providers/stripe/webhooks.d.ts.map +1 -0
  83. package/dist/providers/stripe/webhooks.js +123 -0
  84. package/dist/providers/stripe/webhooks.js.map +1 -0
  85. package/dist/providers/zazu.d.ts +9 -0
  86. package/dist/providers/zazu.d.ts.map +1 -0
  87. package/dist/providers/zazu.js +8 -0
  88. package/dist/providers/zazu.js.map +1 -0
  89. package/dist/types.d.ts +139 -15
  90. package/dist/types.d.ts.map +1 -1
  91. package/dist/types.js +2 -2
  92. package/package.json +15 -7
  93. package/dist/providers/zazu/adapter.d.ts.map +0 -1
  94. package/dist/providers/zazu/adapter.js.map +0 -1
  95. package/dist/providers/zazu/client.d.ts +0 -76
  96. package/dist/providers/zazu/client.d.ts.map +0 -1
  97. package/dist/providers/zazu/client.js.map +0 -1
  98. package/dist/providers/zazu/config.d.ts.map +0 -1
  99. package/dist/providers/zazu/config.js +0 -90
  100. package/dist/providers/zazu/config.js.map +0 -1
  101. package/dist/providers/zazu/correlation.d.ts.map +0 -1
  102. package/dist/providers/zazu/correlation.js.map +0 -1
  103. package/dist/providers/zazu/index.d.ts +0 -19
  104. package/dist/providers/zazu/index.d.ts.map +0 -1
  105. package/dist/providers/zazu/index.js +0 -22
  106. package/dist/providers/zazu/index.js.map +0 -1
  107. package/dist/providers/zazu/maps.d.ts +0 -36
  108. package/dist/providers/zazu/maps.d.ts.map +0 -1
  109. package/dist/providers/zazu/maps.js.map +0 -1
  110. package/dist/providers/zazu/secrets.d.ts.map +0 -1
  111. package/dist/providers/zazu/secrets.js.map +0 -1
  112. package/dist/providers/zazu/types.d.ts.map +0 -1
  113. package/dist/providers/zazu/types.js.map +0 -1
  114. package/dist/providers/zazu/webhooks.d.ts.map +0 -1
  115. package/dist/providers/zazu/webhooks.js.map +0 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Warning:** This package is in active development and not production-ready. APIs may change without notice.
4
4
 
5
- Multi-provider payment processing for [VentureKit](https://venturekit.dev) — a provider-agnostic abstraction over payment providers (Zazu today; Stripe and PayPal are the intended next adapters) covering hosted checkout, payment links, invoicing, transfers, and normalized webhook events.
5
+ Multi-provider payment processing for [VentureKit](https://venturekit.dev) — a provider-agnostic abstraction over payment providers (Manza today; Stripe and PayPal are the intended next adapters) covering hosted checkout, payment links, invoicing, transfers, and normalized webhook events.
6
6
 
7
7
  > **Not to be confused with** [`@venturekit-pro/billing`](../pro/billing), which handles plans, subscriptions, usage metering, and invoice *generation*. That package deliberately excludes payment processing — this one provides it. They compose.
8
8
 
@@ -15,12 +15,12 @@ npm install @venturekit/billing@dev
15
15
  ## Quick start
16
16
 
17
17
  ```typescript
18
- import { createBillingClient, createZazuAdapter } from '@venturekit/billing';
18
+ import { createBillingClient, createManzaAdapter } from '@venturekit/billing';
19
19
 
20
- // createZazuAdapter() resolves config from ZAZU_* env vars.
20
+ // createManzaAdapter() resolves config from MANZA_* env vars.
21
21
  const billing = createBillingClient({
22
- providers: { zazu: createZazuAdapter() },
23
- defaultProvider: 'zazu',
22
+ providers: { manza: createManzaAdapter() },
23
+ defaultProvider: 'manza',
24
24
  });
25
25
 
26
26
  const session = await billing.createCheckoutSession({
@@ -34,7 +34,7 @@ const session = await billing.createCheckoutSession({
34
34
  // → redirect the customer to session.url
35
35
  ```
36
36
 
37
- The funding account comes from `ZAZU_ACCOUNT_ID`, not from every call site — it is a deployment property. Pass `accountId` explicitly only to override it (multi-account tenants).
37
+ The funding account comes from `MANZA_ACCOUNT_ID`, not from every call site — it is a deployment property. Pass `accountId` explicitly only to override it (multi-account tenants).
38
38
 
39
39
  ## Correlation
40
40
 
@@ -57,7 +57,7 @@ const order = await orders.findByReference(event.correlation?.reference);
57
57
  if (event.amount?.amount !== order.total) throw new Error('amount mismatch');
58
58
  ```
59
59
 
60
- Every event also carries `objectId` (the provider's id, for follow-up calls), `eventId` (**deduplicate on this** — Zazu retries up to 8 times over ~28 hours), and `raw` (the untouched payload).
60
+ Every event also carries `objectId` (the provider's id, for follow-up calls), `eventId` (**deduplicate on this** — Manza retries up to 8 times over ~28 hours), and `raw` (the untouched payload).
61
61
 
62
62
  ### Per-flow support
63
63
 
@@ -68,7 +68,7 @@ billing.adapter.correlationSupport('paymentLink');
68
68
  // → { reference: true, metadata: false, channel: 'urlQuery' }
69
69
  ```
70
70
 
71
- | Flow | Zazu channel | `reference` | `metadata` |
71
+ | Flow | Manza channel | `reference` | `metadata` |
72
72
  | --- | --- | --- | --- |
73
73
  | checkout session | `metadata` map in the create body | ✅ | ✅ (≤50 keys, values ≤500 chars) |
74
74
  | payment link | `client_reference_id` URL query parameter | ✅ | ❌ |
@@ -76,7 +76,7 @@ billing.adapter.correlationSupport('paymentLink');
76
76
 
77
77
  Two consequences worth knowing:
78
78
 
79
- - **Payment links** — the reference is appended to the returned `url`, so **share that exact URL**; a hand-built link loses it. Passing `metadata` throws `UnsupportedCorrelationError` rather than letting Zazu silently discard it (it accepts only four whitelisted query parameters and ignores the rest without erroring).
79
+ - **Payment links** — the reference is appended to the returned `url`, so **share that exact URL**; a hand-built link loses it. Passing `metadata` throws `UnsupportedCorrelationError` rather than letting Manza silently discard it (it accepts only four whitelisted query parameters and ignores the rest without erroring).
80
80
  - **Transfers** — the reference travels as `payment_reference`, which is **visible on bank statements**, so use a human-meaningful value. It cannot be combined with an explicit `paymentReference`; setting both throws rather than silently picking one.
81
81
 
82
82
  ## Configuration
@@ -85,21 +85,23 @@ Every value resolves from the environment, with explicit overrides accepted so s
85
85
 
86
86
  | Variable | Required | Default | Purpose |
87
87
  | --- | --- | --- | --- |
88
- | `BILLING_PROVIDER` | no | `zazu` | Provider selected by `createBillingClientFromEnv()` |
89
- | `ZAZU_SECRET_ARN` | no | — | Secrets Manager entry holding `{apiKey, accountId, webhookSecret}`. Injected automatically by a `billing` intent; makes the three variables below optional |
90
- | `ZAZU_API_KEY` | unless `ZAZU_SECRET_ARN` | — | Bearer token for the Zazu API |
91
- | `ZAZU_ACCOUNT_ID` | effectively yes | — | Default funding/destination account. Zazu requires one to create anything; a per-call `accountId` overrides it |
92
- | `ZAZU_BASE_URL` | no | `https://zazu.ma` | API host. Defaults to Morocco production; set `https://zazu.africa` for South Africa, or `https://staging.zazu.ma` for staging. Not the `pay.zazu.ma` checkout domain |
93
- | `ZAZU_WEBHOOK_SECRET` | for webhooks | — | Endpoint signing secret |
94
- | `ZAZU_WEBHOOK_TOLERANCE_SECONDS` | no | `300` | Replay window; `0` disables the freshness check |
88
+ | `BILLING_PROVIDER` | no | `manza` | Provider selected by `createBillingClientFromEnv()` |
89
+ | `MANZA_SECRET_ARN` | no | — | Secrets Manager entry holding `{apiKey, accountId, webhookSecret}`. Injected automatically by a `billing` intent; makes the three variables below optional |
90
+ | `MANZA_API_KEY` | unless `MANZA_SECRET_ARN` | — | Bearer token for the Manza API |
91
+ | `MANZA_ACCOUNT_ID` | effectively yes | — | Default funding/destination account. Manza requires one to create anything; a per-call `accountId` overrides it |
92
+ | `MANZA_BASE_URL` | no | `https://ma.manza.finance` | API host. Defaults to Morocco production; set `https://zazu.africa` for South Africa, or `https://ma.manza.dev` for staging. Not the `pay.zazu.ma` checkout domain |
93
+ | `MANZA_WEBHOOK_SECRET` | for webhooks | — | Endpoint signing secret |
94
+ | `MANZA_WEBHOOK_TOLERANCE_SECONDS` | no | `300` | Replay window; `0` disables the freshness check |
95
+
96
+ > **Zazu is now Manza.** The provider id `'zazu'`, the `ZAZU_*` variables, the `X-Zazu-*` webhook headers and the `Zazu*` exports (`@venturekit/billing/providers/zazu`) keep working as deprecated aliases. Its API moved from `zazu.ma/api` to `ma.manza.finance/api` (production) and from `staging.zazu.ma/api` to `ma.manza.dev/api` (staging): test on staging first, then production.
95
97
 
96
98
  ### Declaring billing in `vk.config.ts`
97
99
 
98
- Declare the intent and VentureKit wires the credentials for you — it provisions the Secrets Manager entry, grants the Lambda role `secretsmanager:GetSecretValue` on that one secret, and injects `ZAZU_SECRET_ARN`:
100
+ Declare the intent and VentureKit wires the credentials for you — it provisions the Secrets Manager entry, grants the Lambda role `secretsmanager:GetSecretValue` on that one secret, and injects `MANZA_SECRET_ARN`:
99
101
 
100
102
  ```ts
101
103
  infrastructure: {
102
- billing: [{ id: 'main', provider: 'zazu' }],
104
+ billing: [{ id: 'main', provider: 'manza' }],
103
105
  }
104
106
  ```
105
107
 
@@ -107,11 +109,11 @@ No credential ever passes through `vk.config.ts`, a build artifact, or source co
107
109
 
108
110
  **Resolution order per credential**, highest first:
109
111
 
110
- - **Explicit argument** — `createZazuAdapter({ apiKey })`
111
- - **Environment variable** — `ZAZU_API_KEY`
112
- - **Secrets Manager** — the matching field in `ZAZU_SECRET_ARN`
112
+ - **Explicit argument** — `createManzaAdapter({ apiKey })`
113
+ - **Environment variable** — `MANZA_API_KEY`
114
+ - **Secrets Manager** — the matching field in `MANZA_SECRET_ARN`
113
115
 
114
- Precedence is per credential, not all-or-nothing: exporting only `ZAZU_API_KEY` locally while the rest still resolve from the deployed secret works fine.
116
+ Precedence is per credential, not all-or-nothing: exporting only `MANZA_API_KEY` locally while the rest still resolve from the deployed secret works fine.
115
117
 
116
118
  The secret is read **lazily, once per container**, on the first credential access — not at construction. Adapter creation stays synchronous and cold starts pay nothing when a request never touches billing. A failed read is not cached, so a transient Secrets Manager error doesn't poison the container.
117
119
 
@@ -138,7 +140,7 @@ Values take effect on the next container start; no redeploy is needed. Rotation
138
140
 
139
141
  Core operations — checkout sessions, payment links, inbound webhooks — are always available. Everything else is an **optional capability** an adapter opts into, so a future Stripe or PayPal adapter never stubs methods it has no equivalent for.
140
142
 
141
- | Capability | Operations | Zazu | Mock |
143
+ | Capability | Operations | Manza | Mock |
142
144
  | --- | --- | --- | --- |
143
145
  | core | checkout sessions, payment links, webhooks | ✅ | ✅ |
144
146
  | `invoicing` | invoices + customers | ✅ | ✅ |
@@ -178,7 +180,7 @@ try {
178
180
  Four things the caller **must** get right:
179
181
 
180
182
  - **Pass the raw body.** Signatures are computed over the bytes the provider sent. Re-serializing the parsed JSON breaks verification.
181
- - **Keep the two error classes apart.** `WebhookSignatureError` is an auth failure; `WebhookPayloadError` is an authentic request this adapter can't consume. Answering `401` to an unmapped-but-authentic event makes the provider redeliver it forever — Zazu retries for ~28 hours before giving up.
183
+ - **Keep the two error classes apart.** `WebhookSignatureError` is an auth failure; `WebhookPayloadError` is an authentic request this adapter can't consume. Answering `401` to an unmapped-but-authentic event makes the provider redeliver it forever — Manza retries for ~28 hours before giving up.
182
184
  - **Deduplicate on `event.eventId`.** Providers deliver at-least-once. Signature verification rejects anything outside a 300-second window, which stops indefinite replay — but not a redelivery inside it.
183
185
  - **Reconcile through `correlation`, not the payload.** An event carries only what its payload is documented to include — never a reconstructed REST object. Use `event.correlation` to find your own record, and check `event.amount` before fulfilling.
184
186
 
@@ -198,13 +200,13 @@ if (isCheckoutSessionCompleted(event)) {
198
200
  }
199
201
  ```
200
202
 
201
- Note `transfer.executed` exposes `providerStatus` verbatim (Zazu sends `"accepted"`) rather than coercing it into the transfers API's `requested|processing|completed|failed` vocabulary, which would misreport it. It carries **no `accountId`** — the payload has none, so resolve the source account from your own record via `correlation`.
203
+ Note `transfer.executed` exposes `providerStatus` verbatim (Manza sends `"accepted"`) rather than coercing it into the transfers API's `requested|processing|completed|failed` vocabulary, which would misreport it. It carries **no `accountId`** — the payload has none, so resolve the source account from your own record via `correlation`.
202
204
 
203
205
  ## Retries and idempotency
204
206
 
205
- The Zazu HTTP client retries **reads only**. Zazu exposes no idempotency-key header, so a `POST` whose response was merely lost cannot be safely repeated — a retry creates a second resource. `maxRetries` therefore applies to `GET` requests; mutations fail fast with a `ProviderError` carrying a `transient` flag, letting callers that own an application-level idempotency key retry deliberately.
207
+ The Manza HTTP client retries **reads only**. Manza exposes no idempotency-key header, so a `POST` whose response was merely lost cannot be safely repeated — a retry creates a second resource. `maxRetries` therefore applies to `GET` requests; mutations fail fast with a `ProviderError` carrying a `transient` flag, letting callers that own an application-level idempotency key retry deliberately.
206
208
 
207
- Worth knowing what the duplicate actually is: `POST /api/payments` creates a transfer **draft** in `requested` status for a human to approve in the Zazu app — an API key alone cannot move money. So a retried transfer duplicates entries in the approval queue (which an approver may authorize more than once), rather than settling twice. `POST /api/invoices` is the sharper edge: duplicates are sent to the customer.
209
+ Worth knowing what the duplicate actually is: `POST /api/payments` creates a transfer **draft** in `requested` status for a human to approve in the Manza app — an API key alone cannot move money. So a retried transfer duplicates entries in the approval queue (which an approver may authorize more than once), rather than settling twice. `POST /api/invoices` is the sharper edge: duplicates are sent to the customer.
208
210
 
209
211
  ```typescript
210
212
  try {
@@ -246,7 +248,7 @@ The guard asks *"is this provably local?"* rather than *"is this production?"* o
246
248
 
247
249
  No core file needs editing:
248
250
 
249
- 1. Add `src/providers/<name>/` with `config.ts`, `client.ts`, `maps.ts`, `adapter.ts`, `correlation.ts`, and `webhooks.ts` — mirroring `providers/zazu/`.
251
+ 1. Add `src/providers/<name>/` with `config.ts`, `client.ts`, `maps.ts`, `adapter.ts`, `correlation.ts`, and `webhooks.ts` — mirroring `providers/manza/`.
250
252
  2. Implement `PaymentProvider`, plus any optional capability interfaces the provider genuinely supports.
251
253
  3. Implement `correlationSupport(flow)` **honestly**. If a flow cannot round-trip `metadata`, report `false` and throw `UnsupportedCorrelationError` when it is supplied — never accept data the provider will discard.
252
254
  4. Round-trip `correlation.reference` on every flow, and populate `correlation`, `objectId`, `amount`, and `raw` on every event.
package/dist/client.d.ts CHANGED
@@ -7,12 +7,12 @@
7
7
  * one application:
8
8
  *
9
9
  * ```ts
10
- * import { createBillingClient, createZazuAdapter } from '@venturekit/billing';
10
+ * import { createBillingClient, createManzaAdapter } from '@venturekit/billing';
11
11
  *
12
- * // createZazuAdapter() resolves config from ZAZU_* env vars.
12
+ * // createManzaAdapter() resolves config from MANZA_* env vars.
13
13
  * const billing = createBillingClient({
14
- * providers: { zazu: createZazuAdapter() },
15
- * defaultProvider: 'zazu',
14
+ * providers: { manza: createManzaAdapter() },
15
+ * defaultProvider: 'manza',
16
16
  * });
17
17
  *
18
18
  * const session = await billing.createCheckoutSession({ ... });
@@ -38,7 +38,7 @@
38
38
  */
39
39
  import type { PaymentEvent } from './events.js';
40
40
  import { BillingError } from './errors.js';
41
- import { type AccountCapable, type InvoicingCapable, type PaymentProvider, type ProviderName, type TransferCapable, type WebhookEndpointCapable, type WebhookRequest } from './provider.js';
41
+ import { type AccountCapable, type CardPaymentCapable, type CustomerCapable, type SubscriptionCapable, type InvoicingCapable, type PaymentProvider, type ProviderName, type TransferCapable, type WebhookEndpointCapable, type WebhookRequest } from './provider.js';
42
42
  import type { CheckoutSession, CreateCheckoutSessionInput, CreatePaymentLinkInput, CursorPage, ListPaymentLinksParams, PaymentLink } from './types.js';
43
43
  /** Thrown when a capability is required but the provider doesn't implement it. */
44
44
  export declare class CapabilityNotSupportedError extends BillingError {
@@ -62,6 +62,13 @@ export interface BillingClient {
62
62
  readonly transfers: TransferCapable | null;
63
63
  readonly accounts: AccountCapable | null;
64
64
  readonly webhookEndpoints: WebhookEndpointCapable | null;
65
+ readonly customers: CustomerCapable | null;
66
+ readonly cards: CardPaymentCapable | null;
67
+ readonly subscriptions: SubscriptionCapable | null;
68
+ /** Assert saved-card support (SetupIntents / PaymentIntents); throws {@link CapabilityNotSupportedError}. */
69
+ requireCards(): CardPaymentCapable;
70
+ /** Assert provider-run subscriptions; throws {@link CapabilityNotSupportedError}. */
71
+ requireSubscriptions(): SubscriptionCapable;
65
72
  /** Assert invoicing support; throws {@link CapabilityNotSupportedError}. */
66
73
  requireInvoicing(): InvoicingCapable;
67
74
  /** Assert transfer support; throws {@link CapabilityNotSupportedError}. */
@@ -93,16 +100,16 @@ export declare function createBillingClient(options: CreateBillingClientOptions)
93
100
  */
94
101
  export declare function createBillingClientFor(adapter: PaymentProvider): BillingClient;
95
102
  export interface CreateBillingClientFromEnvOptions {
96
- /** Provider to use. Defaults to `BILLING_PROVIDER` env var, then `'zazu'`. */
103
+ /** Provider to use. Defaults to `BILLING_PROVIDER` env var, then `'manza'`. */
97
104
  provider?: ProviderName;
98
105
  /** Optional per-provider config overrides, keyed by provider name. */
99
106
  config?: Partial<Record<ProviderName, unknown>>;
100
107
  }
101
108
  /**
102
109
  * Create a billing client resolved entirely from environment variables.
103
- * Reads `BILLING_PROVIDER` (default `'zazu'`), lazy-imports the matching
110
+ * Reads `BILLING_PROVIDER` (default `'manza'`), lazy-imports the matching
104
111
  * built-in provider, and lets it resolve its own config from its env
105
- * vars (`ZAZU_*`, …). Falls back to the registry for providers the host
112
+ * vars (`MANZA_*`, …). Falls back to the registry for providers the host
106
113
  * application registered itself.
107
114
  */
108
115
  export declare function createBillingClientFromEnv(options?: CreateBillingClientFromEnvOptions): Promise<BillingClient>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAwB,MAAM,aAAa,CAAC;AACjE,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,UAAU,EACV,sBAAsB,EACtB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,kFAAkF;AAClF,qBAAa,2BAA4B,SAAQ,YAAY;IAC3D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;gBACpB,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IAC7G,YAAY,IAAI,kBAAkB,CAAC;IACnC,qFAAqF;IACrF,oBAAoB,IAAI,mBAAmB,CAAC;IAC5C,4EAA4E;IAC5E,gBAAgB,IAAI,gBAAgB,CAAC;IACrC,2EAA2E;IAC3E,gBAAgB,IAAI,eAAe,CAAC;IACpC,0EAA0E;IAC1E,eAAe,IAAI,cAAc,CAAC;IAClC,mFAAmF;IACnF,uBAAuB,IAAI,sBAAsB,CAAC;CACnD;AA6CD,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAC1D,8CAA8C;IAC9C,eAAe,EAAE,YAAY,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,aAAa,CAMtF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAE9E;AA4BD,MAAM,WAAW,iCAAiC;IAChD,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;CACjD;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,aAAa,CAAC,CAcxB"}
package/dist/client.js CHANGED
@@ -7,12 +7,12 @@
7
7
  * one application:
8
8
  *
9
9
  * ```ts
10
- * import { createBillingClient, createZazuAdapter } from '@venturekit/billing';
10
+ * import { createBillingClient, createManzaAdapter } from '@venturekit/billing';
11
11
  *
12
- * // createZazuAdapter() resolves config from ZAZU_* env vars.
12
+ * // createManzaAdapter() resolves config from MANZA_* env vars.
13
13
  * const billing = createBillingClient({
14
- * providers: { zazu: createZazuAdapter() },
15
- * defaultProvider: 'zazu',
14
+ * providers: { manza: createManzaAdapter() },
15
+ * defaultProvider: 'manza',
16
16
  * });
17
17
  *
18
18
  * const session = await billing.createCheckoutSession({ ... });
@@ -37,7 +37,7 @@
37
37
  * ```
38
38
  */
39
39
  import { BillingError, UnknownProviderError } from './errors.js';
40
- import { createProvider, isProviderRegistered, supportsAccounts, supportsInvoicing, supportsTransfers, supportsWebhookEndpoints, } from './provider.js';
40
+ import { createProvider, isProviderRegistered, supportsAccounts, supportsInvoicing, supportsTransfers, supportsWebhookEndpoints, supportsCardPayments, supportsCustomers, supportsSubscriptions, } from './provider.js';
41
41
  /** Thrown when a capability is required but the provider doesn't implement it. */
42
42
  export class CapabilityNotSupportedError extends BillingError {
43
43
  capability;
@@ -54,6 +54,9 @@ function wrap(adapter) {
54
54
  const transfers = supportsTransfers(adapter) ? adapter : null;
55
55
  const accounts = supportsAccounts(adapter) ? adapter : null;
56
56
  const webhookEndpoints = supportsWebhookEndpoints(adapter) ? adapter : null;
57
+ const customers = supportsCustomers(adapter) ? adapter : null;
58
+ const cards = supportsCardPayments(adapter) ? adapter : null;
59
+ const subscriptions = supportsSubscriptions(adapter) ? adapter : null;
57
60
  function require(cap, name) {
58
61
  if (!cap)
59
62
  throw new CapabilityNotSupportedError(name, adapter.name);
@@ -73,6 +76,11 @@ function wrap(adapter) {
73
76
  transfers,
74
77
  accounts,
75
78
  webhookEndpoints,
79
+ customers,
80
+ cards,
81
+ subscriptions,
82
+ requireCards: () => require(cards, 'cards'),
83
+ requireSubscriptions: () => require(subscriptions, 'subscriptions'),
76
84
  requireInvoicing: () => require(invoicing, 'invoicing'),
77
85
  requireTransfers: () => require(transfers, 'transfers'),
78
86
  requireAccounts: () => require(accounts, 'accounts'),
@@ -115,18 +123,21 @@ export function createBillingClientFor(adapter) {
115
123
  * registry fallback below.
116
124
  */
117
125
  const envProviders = {
118
- zazu: async (cfg) => (await import('./providers/zazu/index.js')).createZazuAdapter(cfg),
126
+ manza: async (cfg) => (await import('./providers/manza/index.js')).createManzaAdapter(cfg),
127
+ stripe: async (cfg) => (await import('./providers/stripe/index.js')).createStripeAdapter(cfg),
119
128
  };
120
129
  /**
121
130
  * Create a billing client resolved entirely from environment variables.
122
- * Reads `BILLING_PROVIDER` (default `'zazu'`), lazy-imports the matching
131
+ * Reads `BILLING_PROVIDER` (default `'manza'`), lazy-imports the matching
123
132
  * built-in provider, and lets it resolve its own config from its env
124
- * vars (`ZAZU_*`, …). Falls back to the registry for providers the host
133
+ * vars (`MANZA_*`, …). Falls back to the registry for providers the host
125
134
  * application registered itself.
126
135
  */
127
136
  export async function createBillingClientFromEnv(options) {
128
- const name = options?.provider ?? process.env.BILLING_PROVIDER ?? 'zazu';
129
- const config = options?.config?.[name];
137
+ const requested = options?.provider ?? process.env.BILLING_PROVIDER ?? 'manza';
138
+ // `zazu` is Manza's former name — a deprecated alias.
139
+ const name = requested === 'zazu' ? 'manza' : requested;
140
+ const config = options?.config?.[name] ?? options?.config?.[requested];
130
141
  const build = envProviders[name];
131
142
  if (build) {
132
143
  return wrap(await build(config));
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,GAQzB,MAAM,eAAe,CAAC;AAUvB,kFAAkF;AAClF,MAAM,OAAO,2BAA4B,SAAQ,YAAY;IAClD,UAAU,CAAS;IACnB,QAAQ,CAAe;IAChC,YAAY,UAAkB,EAAE,QAAsB;QACpD,KAAK,CAAC,aAAa,QAAQ,2BAA2B,UAAU,eAAe,CAAC,CAAC;QACjF,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;Q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;AACvC,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -66,7 +66,7 @@ export declare class UnknownProviderError extends BillingError {
66
66
  * A {@link CorrelationRef} carried data the target flow cannot
67
67
  * round-trip, or a reference collided with a provider-visible field.
68
68
  *
69
- * This exists because the failure is otherwise **silent**: Zazu accepts
69
+ * This exists because the failure is otherwise **silent**: Manza accepts
70
70
  * only four whitelisted query parameters on a payment link and ignores
71
71
  * everything else without error, so a dropped metadata map would only
72
72
  * surface as missing data at webhook time — long after the request that
package/dist/errors.js CHANGED
@@ -80,7 +80,7 @@ export class UnknownProviderError extends BillingError {
80
80
  * A {@link CorrelationRef} carried data the target flow cannot
81
81
  * round-trip, or a reference collided with a provider-visible field.
82
82
  *
83
- * This exists because the failure is otherwise **silent**: Zazu accepts
83
+ * This exists because the failure is otherwise **silent**: Manza accepts
84
84
  * only four whitelisted query parameters on a payment link and ignores
85
85
  * everything else without error, so a dropped metadata map would only
86
86
  * surface as missing data at webhook time — long after the request that
package/dist/events.d.ts CHANGED
@@ -7,9 +7,9 @@
7
7
  * (`publishEvent` from `@venturekit/runtime/patterns`) and subscribers
8
8
  * react to `event.type` without knowing which provider fired it.
9
9
  *
10
- * Idempotency: `eventId` (the provider's stable event id, e.g. Zazu's
11
- * `X-Zazu-Event-Id`) must be deduplicated by the consumer — providers
12
- * may deliver the same event more than once. Zazu retries up to 8 times
10
+ * Idempotency: `eventId` (the provider's stable event id, e.g. Manza's
11
+ * `X-Manza-Event-Id`) must be deduplicated by the consumer — providers
12
+ * may deliver the same event more than once. Manza retries up to 8 times
13
13
  * over ~28 hours, so this is not optional.
14
14
  *
15
15
  * ## Correlation, not reconstruction
@@ -31,13 +31,15 @@
31
31
  * / `Transfer` domain objects into events, which meant every event type
32
32
  * had to fabricate the fields its payload lacked.
33
33
  */
34
- import type { CheckoutTransaction, CorrelationRef, Money } from './types.js';
34
+ import type { CheckoutTransaction, CorrelationRef, Money, ProviderSubscription } from './types.js';
35
35
  import type { ProviderName } from './provider.js';
36
36
  /**
37
37
  * Canonical event type names. These are the `detail-type` values an
38
38
  * application publishes to its event bus.
39
39
  */
40
- export type PaymentEventType = 'checkout_session.completed' | 'payment_link.paid' | 'transfer.executed' | 'test.ping';
40
+ export type PaymentEventType = 'checkout_session.completed' | 'payment_link.paid' | 'transfer.executed' | 'test.ping' | 'payment_intent.succeeded' | 'payment_intent.failed' | 'setup_intent.succeeded' | 'invoice.paid' | 'invoice.payment_failed' | 'subscription.updated' | 'subscription.deleted'
41
+ /** A provider event this package doesn't normalize; acknowledge it and move on. */
42
+ | 'provider.other';
41
43
  /**
42
44
  * Fields the `checkout_session.completed` payload is documented to
43
45
  * carry. Everything optional here is genuinely optional in the payload.
@@ -54,7 +56,7 @@ export interface CheckoutSessionCompletedData {
54
56
  /**
55
57
  * Fields the `payment_link.paid` payload is documented to carry. Note
56
58
  * the customer identifiers are "always present, set to null when not
57
- * supplied" per Zazu's docs, hence optional rather than absent.
59
+ * supplied" per Manza's docs, hence optional rather than absent.
58
60
  */
59
61
  export interface PaymentLinkPaidData {
60
62
  paymentLinkId: string;
@@ -81,7 +83,7 @@ export interface PaymentLinkPaidData {
81
83
  */
82
84
  export interface TransferExecutedData {
83
85
  transferId: string;
84
- /** Raw provider status (e.g. Zazu's `"accepted"`), not remapped. */
86
+ /** Raw provider status (e.g. Manza's `"accepted"`), not remapped. */
85
87
  providerStatus: string;
86
88
  /** `"debit"` / `"credit"` where the provider reports it. */
87
89
  operation?: string;
@@ -92,6 +94,38 @@ export interface TransferExecutedData {
92
94
  export interface TestPingData {
93
95
  [key: string]: unknown;
94
96
  }
97
+ export interface PaymentIntentEventData {
98
+ paymentIntentId: string;
99
+ status: string;
100
+ customerId?: string;
101
+ failureMessage?: string;
102
+ }
103
+ export interface SetupIntentEventData {
104
+ setupIntentId: string;
105
+ customerId?: string;
106
+ paymentMethodId?: string;
107
+ }
108
+ export interface InvoiceEventData {
109
+ invoiceId: string;
110
+ number?: string;
111
+ status: string;
112
+ customerId?: string;
113
+ subscriptionId?: string;
114
+ amountPaid?: Money;
115
+ amountDue?: Money;
116
+ pdfUrl?: string;
117
+ hostedUrl?: string;
118
+ /** Payment attempts so far, and when the provider tries again (failed payments). */
119
+ attemptCount?: number;
120
+ nextAttemptAt?: string;
121
+ description?: string;
122
+ }
123
+ export interface SubscriptionEventData {
124
+ subscription: ProviderSubscription;
125
+ }
126
+ export interface ProviderOtherData {
127
+ providerType: string;
128
+ }
95
129
  export type PaymentEventData = (CheckoutSessionCompletedData & {
96
130
  type: 'checkout_session.completed';
97
131
  }) | (PaymentLinkPaidData & {
@@ -100,6 +134,16 @@ export type PaymentEventData = (CheckoutSessionCompletedData & {
100
134
  type: 'transfer.executed';
101
135
  }) | (TestPingData & {
102
136
  type: 'test.ping';
137
+ }) | (PaymentIntentEventData & {
138
+ type: 'payment_intent.succeeded' | 'payment_intent.failed';
139
+ }) | (SetupIntentEventData & {
140
+ type: 'setup_intent.succeeded';
141
+ }) | (InvoiceEventData & {
142
+ type: 'invoice.paid' | 'invoice.payment_failed';
143
+ }) | (SubscriptionEventData & {
144
+ type: 'subscription.updated' | 'subscription.deleted';
145
+ }) | (ProviderOtherData & {
146
+ type: 'provider.other';
103
147
  });
104
148
  /**
105
149
  * A normalized webhook event ready to publish to the application's
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAMlD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,4BAA4B,GAC5B,mBAAmB,GACnB,mBAAmB,GACnB,WAAW,CAAC;AAMhB;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAC;IA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GACd,CAAC,IAAI,YAAY,GAAG;IAAE,IAAI,EAAE,4BAA4B,GAAG;QAAE,IAAI,EAAE,4BAA4B,CAAA;KAAE,CAAA;CAAE,CAErG;AAED,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,YAAY,GACd,CAAC,IAAI,YAAY,GAAG;IAAE,IAAI,EAAE,mBAAmB,GAAG;QAAE,IAAI,EAAE,mBAAmB,CAAA;KAAE,CAAA;CAAE,CAEnF;AAED,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,YAAY,GACd,CAAC,IAAI,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,GAAG;QAAE,IAAI,EAAE,mBAAmB,CAAA;KAAE,CAAA;CAAE,CAEpF"}
package/dist/events.js CHANGED
@@ -7,9 +7,9 @@
7
7
  * (`publishEvent` from `@venturekit/runtime/patterns`) and subscribers
8
8
  * react to `event.type` without knowing which provider fired it.
9
9
  *
10
- * Idempotency: `eventId` (the provider's stable event id, e.g. Zazu's
11
- * `X-Zazu-Event-Id`) must be deduplicated by the consumer — providers
12
- * may deliver the same event more than once. Zazu retries up to 8 times
10
+ * Idempotency: `eventId` (the provider's stable event id, e.g. Manza's
11
+ * `X-Manza-Event-Id`) must be deduplicated by the consumer — providers
12
+ * may deliver the same event more than once. Manza retries up to 8 times
13
13
  * over ~28 hours, so this is not optional.
14
14
  *
15
15
  * ## Correlation, not reconstruction
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AA2IH;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,CAAe;IAEf,OAAO,CAAC,CAAC,IAAI,KAAK,4BAA4B,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,CAAe;IAEf,OAAO,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,CAAe;IAEf,OAAO,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AA+LH;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,CAAe;IAEf,OAAO,CAAC,CAAC,IAAI,KAAK,4BAA4B,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,CAAe;IAEf,OAAO,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,CAAe;IAEf,OAAO,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;AACxC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,24 +2,24 @@
2
2
  * @venturekit/billing
3
3
  *
4
4
  * Multi-provider billing for VentureKit. Provides a provider-agnostic
5
- * abstraction (`PaymentProvider`) over payment providers (Zazu, Stripe,
5
+ * abstraction (`PaymentProvider`) over payment providers (Manza, Stripe,
6
6
  * PayPal) with checkout sessions, payment links, invoices, transfers,
7
7
  * and normalized webhook events.
8
8
  *
9
9
  * ## Quick start
10
10
  *
11
11
  * ```ts
12
- * import { createBillingClient, createZazuAdapter } from '@venturekit/billing';
12
+ * import { createBillingClient, createManzaAdapter } from '@venturekit/billing';
13
13
  *
14
- * // createZazuAdapter() resolves config from ZAZU_* env vars.
14
+ * // createManzaAdapter() resolves config from MANZA_* env vars.
15
15
  * const billing = createBillingClient({
16
- * providers: { zazu: createZazuAdapter() },
17
- * defaultProvider: 'zazu',
16
+ * providers: { manza: createManzaAdapter() },
17
+ * defaultProvider: 'manza',
18
18
  * });
19
19
  *
20
20
  * // Checkout session (customer-driven, per-order)
21
21
  * const session = await billing.createCheckoutSession({
22
- * accountId: process.env.ZAZU_ACCOUNT_ID!,
22
+ * accountId: process.env.MANZA_ACCOUNT_ID!,
23
23
  * amount: { amount: '1500.000', currency: 'MAD' },
24
24
  * successUrl: 'https://app.example.com/success?session={CHECKOUT_SESSION_ID}',
25
25
  * metadata: { order_id: 'ORD-123' },
@@ -36,13 +36,15 @@
36
36
  * new provider by implementing `PaymentProvider` and registering it —
37
37
  * no edits to core files. See the README for the full checklist.
38
38
  */
39
- export type { Money, Customer, CustomerType, BillingAddress, Order, CheckoutSession, CheckoutSessionStatus, CheckoutTransaction, CreateCheckoutSessionInput, PaymentLink, PaymentLinkType, PaymentLinkStatus, PaymentLinkAccount, CreatePaymentLinkInput, Invoice, InvoiceStatus, InvoiceLineItem, InvoiceDiscount, CreateInvoiceInput, ListInvoicesParams, CreateCustomerInput, UpdateCustomerInput, ListCustomersParams, Transfer, TransferStatus, CreateTransferInput, ListTransfersParams, ListPaymentLinksParams, Account, AccountStatus, ListAccountsParams, AccountTransaction, AccountTransactionOperation, ListAccountTransactionsParams, WebhookEndpoint, WebhookEndpointStatus, WebhookEndpointWithSecret, CreateWebhookEndpointInput, UpdateWebhookEndpointInput, ListWebhookEndpointsParams, TestWebhookEndpointResult, CursorPage, CorrelationRef, CorrelationFlow, CorrelationSupport, } from './types.js';
39
+ export type { Money, Customer, CustomerType, BillingAddress, Order, CheckoutSession, CheckoutSessionStatus, CheckoutTransaction, CreateCheckoutSessionInput, PaymentLink, PaymentLinkType, PaymentLinkStatus, PaymentLinkAccount, CreatePaymentLinkInput, Invoice, InvoiceStatus, InvoiceLineItem, InvoiceDiscount, CreateInvoiceInput, ListInvoicesParams, CreateCustomerInput, UpdateCustomerInput, ListCustomersParams, Transfer, TransferStatus, CreateTransferInput, ListTransfersParams, ListPaymentLinksParams, Account, AccountStatus, ListAccountsParams, AccountTransaction, AccountTransactionOperation, ListAccountTransactionsParams, WebhookEndpoint, WebhookEndpointStatus, WebhookEndpointWithSecret, CreateWebhookEndpointInput, UpdateWebhookEndpointInput, ListWebhookEndpointsParams, TestWebhookEndpointResult, CursorPage, CorrelationRef, CorrelationFlow, CorrelationSupport, PaymentMethodSummary, IntentStatus, SetupIntent, CreateSetupIntentInput, PaymentIntent, CreatePaymentIntentInput, ProviderSubscription, ProviderSubscriptionStatus, SubscriptionPrice, CreateSubscriptionInput, UpdateSubscriptionInput, CreateSubscriptionCheckoutInput, SubscriptionInvoice, } from './types.js';
40
40
  export { BillingError, ProviderError, WebhookSignatureError, WebhookPayloadError, UnknownProviderError, UnsupportedCorrelationError, InvalidCorrelationError, MockProviderNotAllowedError, MissingConfigError, } from './errors.js';
41
41
  export { isCheckoutSessionCompleted, isPaymentLinkPaid, isTransferExecuted, } from './events.js';
42
- export type { PaymentEvent, PaymentEventType, PaymentEventData, CheckoutSessionCompletedData, PaymentLinkPaidData, TransferExecutedData, TestPingData, } from './events.js';
43
- export { registerProvider, createProvider, isProviderRegistered, registeredProviders, supportsInvoicing, supportsTransfers, supportsAccounts, supportsWebhookEndpoints, } from './provider.js';
44
- export type { PaymentProvider, FullPaymentProvider, InvoicingCapable, TransferCapable, AccountCapable, WebhookEndpointCapable, ProviderFactory, ProviderName, WebhookRequest, } from './provider.js';
42
+ export type { PaymentEvent, PaymentEventType, PaymentEventData, CheckoutSessionCompletedData, PaymentLinkPaidData, TransferExecutedData, TestPingData, PaymentIntentEventData, SetupIntentEventData, InvoiceEventData, SubscriptionEventData, ProviderOtherData, } from './events.js';
43
+ export { registerProvider, createProvider, isProviderRegistered, registeredProviders, supportsInvoicing, supportsTransfers, supportsAccounts, supportsWebhookEndpoints, supportsCustomers, supportsCardPayments, supportsSubscriptions, } from './provider.js';
44
+ export type { PaymentProvider, FullPaymentProvider, InvoicingCapable, TransferCapable, AccountCapable, WebhookEndpointCapable, CustomerCapable, CardPaymentCapable, SubscriptionCapable, ProviderFactory, ProviderName, WebhookRequest, } from './provider.js';
45
45
  export { createBillingClient, createBillingClientFor, createBillingClientFromEnv, CapabilityNotSupportedError, } from './client.js';
46
46
  export type { BillingClient, CreateBillingClientOptions, CreateBillingClientFromEnvOptions, } from './client.js';
47
- export { createZazuAdapter, type ZazuAdapter, createZazuHttpClient, type ZazuHttpClient, resolveZazuConfig, type ZazuConfig, createZazuSecretsResolver, resolveSecretValue, resolveOptionalSecretValue, type ZazuSecretResolver, type ZazuSecretValue, type ZazuSecretField, type ZazuSecretsResolverOptions, verifyZazuSignature, parseZazuWebhook, handleZazuWebhook, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type HandleZazuWebhookOptions, } from './providers/index.js';
47
+ export { createManzaAdapter, type ManzaAdapter, createManzaHttpClient, type ManzaHttpClient, resolveManzaConfig, type ManzaConfig, createManzaSecretsResolver, resolveSecretValue, resolveOptionalSecretValue, type ManzaSecretResolver, type ManzaSecretValue, type ManzaSecretField, type ManzaSecretsResolverOptions, verifyManzaSignature, parseManzaWebhook, handleManzaWebhook, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type HandleManzaWebhookOptions, createStripeAdapter, type StripeAdapter, resolveStripeConfig, type StripeConfig, verifyStripeSignature, parseStripeEvent, handleStripeWebhook, STRIPE_SIGNATURE_HEADER, type HandleStripeWebhookOptions, } from './providers/index.js';
48
+ /** @deprecated Zazu is now Manza — use the `Manza*` names. */
49
+ export { createZazuAdapter, type ZazuAdapter, resolveZazuConfig, type ZazuConfig, verifyZazuSignature, parseZazuWebhook, handleZazuWebhook, } from './providers/zazu.js';
48
50
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,YAAY,EACV,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,eAAe,EACf,eAAe,EACf,k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AAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,oBAAoB,EACpB,KAAK,cAAc,EACnB,iBAAiB,EACjB,KAAK,UAAU,EACf,yBAAyB,EACzB,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,EACjC,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,YAAY,EACV,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,6BAA6B,EAC7B,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,+BAA+B,EAC/B,mBAAmB,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gB,EACrB,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iCAAiC,EACjC,KAAK,yBAAyB,EAC9B,mBAAmB,EACnB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,YAAY,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,0BAA0B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,8DAA8D;AAC9D,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,UAAU,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -2,24 +2,24 @@
2
2
  * @venturekit/billing
3
3
  *
4
4
  * Multi-provider billing for VentureKit. Provides a provider-agnostic
5
- * abstraction (`PaymentProvider`) over payment providers (Zazu, Stripe,
5
+ * abstraction (`PaymentProvider`) over payment providers (Manza, Stripe,
6
6
  * PayPal) with checkout sessions, payment links, invoices, transfers,
7
7
  * and normalized webhook events.
8
8
  *
9
9
  * ## Quick start
10
10
  *
11
11
  * ```ts
12
- * import { createBillingClient, createZazuAdapter } from '@venturekit/billing';
12
+ * import { createBillingClient, createManzaAdapter } from '@venturekit/billing';
13
13
  *
14
- * // createZazuAdapter() resolves config from ZAZU_* env vars.
14
+ * // createManzaAdapter() resolves config from MANZA_* env vars.
15
15
  * const billing = createBillingClient({
16
- * providers: { zazu: createZazuAdapter() },
17
- * defaultProvider: 'zazu',
16
+ * providers: { manza: createManzaAdapter() },
17
+ * defaultProvider: 'manza',
18
18
  * });
19
19
  *
20
20
  * // Checkout session (customer-driven, per-order)
21
21
  * const session = await billing.createCheckoutSession({
22
- * accountId: process.env.ZAZU_ACCOUNT_ID!,
22
+ * accountId: process.env.MANZA_ACCOUNT_ID!,
23
23
  * amount: { amount: '1500.000', currency: 'MAD' },
24
24
  * successUrl: 'https://app.example.com/success?session={CHECKOUT_SESSION_ID}',
25
25
  * metadata: { order_id: 'ORD-123' },
@@ -41,12 +41,14 @@ export { BillingError, ProviderError, WebhookSignatureError, WebhookPayloadError
41
41
  // Events ------------------------------------------------------------
42
42
  export { isCheckoutSessionCompleted, isPaymentLinkPaid, isTransferExecuted, } from './events.js';
43
43
  // Provider interface, capabilities & registry ----------------------
44
- export { registerProvider, createProvider, isProviderRegistered, registeredProviders, supportsInvoicing, supportsTransfers, supportsAccounts, supportsWebhookEndpoints, } from './provider.js';
44
+ export { registerProvider, createProvider, isProviderRegistered, registeredProviders, supportsInvoicing, supportsTransfers, supportsAccounts, supportsWebhookEndpoints, supportsCustomers, supportsCardPayments, supportsSubscriptions, } from './provider.js';
45
45
  // Client facade -----------------------------------------------------
46
46
  export { createBillingClient, createBillingClientFor, createBillingClientFromEnv, CapabilityNotSupportedError, } from './client.js';
47
47
  // Providers ---------------------------------------------------------
48
48
  // The mock is NOT re-exported here on purpose: it skips webhook
49
49
  // signature verification, so it must stay out of production bundles.
50
50
  // Import it by subpath — `@venturekit/billing/providers/mock`.
51
- export { createZazuAdapter, createZazuHttpClient, resolveZazuConfig, createZazuSecretsResolver, resolveSecretValue, resolveOptionalSecretValue, verifyZazuSignature, parseZazuWebhook, handleZazuWebhook, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, } from './providers/index.js';
51
+ export { createManzaAdapter, createManzaHttpClient, resolveManzaConfig, createManzaSecretsResolver, resolveSecretValue, resolveOptionalSecretValue, verifyManzaSignature, parseManzaWebhook, handleManzaWebhook, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, createStripeAdapter, resolveStripeConfig, verifyStripeSignature, parseStripeEvent, handleStripeWebhook, STRIPE_SIGNATURE_HEADER, } from './providers/index.js';
52
+ /** @deprecated Zazu is now Manza — use the `Manza*` names. */
53
+ export { createZazuAdapter, resolveZazuConfig, verifyZazuSignature, parseZazuWebhook, handleZazuWebhook, } from './providers/zazu.js';
52
54
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAmDH,sEAAsE;AACtE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,sEAAsE;AACtE,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAWrB,qEAAqE;AACrE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAavB,sEAAsE;AACtE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAOrB,sEAAsE;AACtE,gEAAgE;AAChE,qEAAqE;AACrE,+DAA+D;AAC/D,OAAO,EACL,iBAAiB,EAEjB,oBAAoB,EAEpB,iBAAiB,EAEjB,yBAAyB,EACzB,kBAAkB,EAClB,0BAA0B,EAK1B,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,GAElC,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAgEH,sEAAsE;AACtE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,sEAAsE;AACtE,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAgBrB,qEAAqE;AACrE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAgBvB,sEAAsE;AACtE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAOrB,sEAAsE;AACtE,gEAAgE;AAChE,qEAAqE;AACrE,+DAA+D;AAC/D,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EAErB,kBAAkB,EAElB,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,EAK1B,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iCAAiC,EAEjC,mBAAmB,EAEnB,mBAAmB,EAEnB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,GAExB,MAAM,sBAAsB,CAAC;AAC9B,8DAA8D;AAC9D,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EAEjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}