@adminiumjs/add-on-contracts 0.3.30 → 0.3.32

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 (45) hide show
  1. package/dist/add-on-block.d.ts +4 -0
  2. package/dist/add-on-block.d.ts.map +1 -1
  3. package/dist/contracts.d.ts +6 -0
  4. package/dist/contracts.d.ts.map +1 -1
  5. package/dist/contracts.js +16 -0
  6. package/dist/contracts.js.map +1 -1
  7. package/dist/document-render.d.ts +9 -2
  8. package/dist/document-render.d.ts.map +1 -1
  9. package/dist/document-render.js +4 -2
  10. package/dist/document-render.js.map +1 -1
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/payment-demo.d.ts +99 -0
  16. package/dist/payment-demo.d.ts.map +1 -0
  17. package/dist/payment-demo.js +604 -0
  18. package/dist/payment-demo.js.map +1 -0
  19. package/dist/payment-money.d.ts +29 -0
  20. package/dist/payment-money.d.ts.map +1 -0
  21. package/dist/payment-money.js +99 -0
  22. package/dist/payment-money.js.map +1 -0
  23. package/dist/payment-provider.d.ts +605 -0
  24. package/dist/payment-provider.d.ts.map +1 -0
  25. package/dist/payment-provider.js +249 -0
  26. package/dist/payment-provider.js.map +1 -0
  27. package/dist/runtime/app-types.d.ts +17 -0
  28. package/dist/runtime/app-types.d.ts.map +1 -1
  29. package/dist/runtime/app.d.ts +2 -0
  30. package/dist/runtime/app.d.ts.map +1 -1
  31. package/dist/runtime/app.js +2 -0
  32. package/dist/runtime/app.js.map +1 -1
  33. package/dist/runtime/index.d.ts +2 -2
  34. package/dist/runtime/index.d.ts.map +1 -1
  35. package/dist/runtime/index.js +2 -1
  36. package/dist/runtime/index.js.map +1 -1
  37. package/dist/testing/index.d.ts +1 -0
  38. package/dist/testing/index.d.ts.map +1 -1
  39. package/dist/testing/index.js +1 -0
  40. package/dist/testing/index.js.map +1 -1
  41. package/dist/testing/payment-provider.d.ts +43 -0
  42. package/dist/testing/payment-provider.d.ts.map +1 -0
  43. package/dist/testing/payment-provider.js +308 -0
  44. package/dist/testing/payment-provider.js.map +1 -0
  45. package/package.json +1 -1
@@ -0,0 +1,605 @@
1
+ /**
2
+ * `payment-provider@1` — one payment service, online payments only.
3
+ *
4
+ * ─── WHAT IT IS FOR ────────────────────────────────────────────────────────
5
+ *
6
+ * A shop's customer pays on the provider's own hosted page; Adminium never
7
+ * sees a card. The provider half answers a small set of questions about money
8
+ * that moves at the provider: start a checkout, say how one ended, end one,
9
+ * refund, prove a webhook came from the provider, list the events whose webhook
10
+ * went missing, and say which ways to pay the account has switched on.
11
+ * In-person terminals will be a contract of their own when they are built.
12
+ *
13
+ * ─── THE SHAPE ─────────────────────────────────────────────────────────────
14
+ *
15
+ * The server half exports a FACTORY, `createPaymentProvider({ http, credentials,
16
+ * mode })`. The engine calls it for every operation with an egress-bound HTTP
17
+ * client (the add-on's `network.allow` only, redirects refused) and the
18
+ * credential decrypted at that moment, so no key is held longer than one call
19
+ * and a replaced key is used at once.
20
+ *
21
+ * Every answer is DATA. A refusal is `{ ok: false, code, providerMessage,
22
+ * retryable }`, never a thrown class: a class does not cross the add-on seam
23
+ * (each bundle carries its own copy, so `instanceof` is false engine-side).
24
+ * The engine parses every answer with the schemas below before it believes it.
25
+ *
26
+ * ─── RULES EVERY PROVIDER FOLLOWS (the conformance suite checks them) ──────
27
+ *
28
+ * - Amounts cross as decimal strings. `toMinor` converts with the provider's
29
+ * OWN exponent table; an amount the provider cannot represent exactly is
30
+ * refused (`AMOUNT_UNREPRESENTABLE`), never rounded.
31
+ * - Every call that moves money carries an idempotency key Adminium mints and
32
+ * stores. The key is the second line of defence: Adminium's own state
33
+ * decides whether money may move.
34
+ * - A webhook proves only that the provider sent it. `verifyWebhook` returns
35
+ * the event's identity, never a status to trust: the engine re-reads the
36
+ * status with `status()`.
37
+ * - No secret appears in an answer, a `providerMessage` or a log line.
38
+ * - The provider half never reads or writes a database. In-process this is a
39
+ * review rule, not something the runtime can enforce.
40
+ */
41
+ import { z } from 'zod';
42
+ export declare const PAYMENT_PROVIDER_CONTRACT = "payment-provider";
43
+ export declare const PAYMENT_PROVIDER_VERSION = 1;
44
+ /** The name of the factory a server half must export. */
45
+ export declare const PAYMENT_PROVIDER_FACTORY = "createPaymentProvider";
46
+ /**
47
+ * The name of an OPTIONAL second export of the server half: the event types
48
+ * the admin ticks when making the webhook at the provider, in the provider's
49
+ * own spelling (`checkout.session.completed`, `PAYMENT.CAPTURE.COMPLETED`).
50
+ * Studio lists them beside the webhook address with a copy button each, so
51
+ * the admin ticks exactly what the provider half listens for. A server half
52
+ * without it gets a webhook card with no list.
53
+ */
54
+ export declare const PAYMENT_WEBHOOK_EVENTS_EXPORT = "webhookEvents";
55
+ /**
56
+ * The name of an OPTIONAL export of the server half for a provider whose key is
57
+ * made by an app the shop uploads to its own account (Stripe's private app):
58
+ * `(input: { shopName: string; installId: string }) => { appId: string;
59
+ * appName: string; files: Record<string, string> }`. Studio's "Download the
60
+ * app template" calls it with a per-install id and zips the files it answers.
61
+ */
62
+ export declare const PAYMENT_KEY_APP_EXPORT = "keyAppTemplate";
63
+ /** A key belongs to one mode; so does every checkout, event and refund made with it. */
64
+ export declare const PAYMENT_MODES: readonly ["test", "live"];
65
+ export type PaymentMode = (typeof PAYMENT_MODES)[number];
66
+ /**
67
+ * How a checkout stands at the provider.
68
+ *
69
+ * `processing`: the money is on its way but not there (SEPA, a voucher, a
70
+ * pending capture). `requires_action`: the customer still has a step to take.
71
+ */
72
+ export declare const CHECKOUT_STATUSES: readonly ["pending", "processing", "succeeded", "failed", "cancelled", "expired", "requires_action"];
73
+ export type CheckoutStatus = (typeof CHECKOUT_STATUSES)[number];
74
+ /** How a refund stands. `requires_action`: the customer must give bank details. */
75
+ export declare const REFUND_STATUSES: readonly ["pending", "succeeded", "failed", "cancelled", "requires_action"];
76
+ export type RefundStatus = (typeof REFUND_STATUSES)[number];
77
+ /** What a verified event is about, so the engine knows which record to look up. */
78
+ export declare const PAYMENT_EVENT_KINDS: readonly ["checkout", "refund", "dispute", "other"];
79
+ export type PaymentEventKind = (typeof PAYMENT_EVENT_KINDS)[number];
80
+ /** Why a refund is made, in the words the provider's own list uses. */
81
+ export declare const REFUND_REASONS: readonly ["requested_by_customer", "duplicate", "fraudulent", "other"];
82
+ export type RefundReason = (typeof REFUND_REASONS)[number];
83
+ /**
84
+ * Every refusal code. Closed: an engine branch on a code the contract never
85
+ * named would be a guess.
86
+ */
87
+ export declare const PROVIDER_ERROR_CODES: readonly ["CREDENTIALS_REFUSED", "PERMISSION_MISSING", "MODE_MISMATCH", "NOT_FOUND", "AMOUNT_UNREPRESENTABLE", "CURRENCY_UNSUPPORTED", "SIGNATURE_INVALID", "REFUND_REFUSED", "ALREADY_COMPLETED", "INVALID_REQUEST", "RATE_LIMITED", "UNAVAILABLE"];
88
+ export type ProviderErrorCode = (typeof PROVIDER_ERROR_CODES)[number];
89
+ /** A refusal, returned as data. */
90
+ export interface ProviderError {
91
+ readonly ok: false;
92
+ readonly code: ProviderErrorCode;
93
+ /** The provider's own words, shown quoted to staff. Never a secret. */
94
+ readonly providerMessage: string;
95
+ readonly retryable: boolean;
96
+ }
97
+ export declare const providerErrorSchema: z.ZodObject<{
98
+ ok: z.ZodLiteral<false>;
99
+ code: z.ZodEnum<{
100
+ CREDENTIALS_REFUSED: "CREDENTIALS_REFUSED";
101
+ PERMISSION_MISSING: "PERMISSION_MISSING";
102
+ MODE_MISMATCH: "MODE_MISMATCH";
103
+ NOT_FOUND: "NOT_FOUND";
104
+ AMOUNT_UNREPRESENTABLE: "AMOUNT_UNREPRESENTABLE";
105
+ CURRENCY_UNSUPPORTED: "CURRENCY_UNSUPPORTED";
106
+ SIGNATURE_INVALID: "SIGNATURE_INVALID";
107
+ REFUND_REFUSED: "REFUND_REFUSED";
108
+ ALREADY_COMPLETED: "ALREADY_COMPLETED";
109
+ INVALID_REQUEST: "INVALID_REQUEST";
110
+ RATE_LIMITED: "RATE_LIMITED";
111
+ UNAVAILABLE: "UNAVAILABLE";
112
+ }>;
113
+ providerMessage: z.ZodString;
114
+ retryable: z.ZodBoolean;
115
+ }, z.core.$strict>;
116
+ /** True for a refusal. Checks the shape, never a class. */
117
+ export declare function isProviderError(value: unknown): value is ProviderError;
118
+ /** Builds a refusal. */
119
+ export declare function providerError(code: ProviderErrorCode, providerMessage: string, retryable?: boolean): ProviderError;
120
+ /** A non-negative decimal amount as text: "120.00", "12000", "45.250". */
121
+ export declare const decimalAmountSchema: z.ZodString;
122
+ /** An ISO 4217 code in capitals. */
123
+ export declare const currencyCodeSchema: z.ZodString;
124
+ /** An amount in the provider's smallest unit, as integer text (no float ever holds money). */
125
+ export declare const minorAmountSchema: z.ZodString;
126
+ export interface MinorAmount {
127
+ readonly minor: string;
128
+ readonly currency: string;
129
+ }
130
+ export declare const minorAmountAnswerSchema: z.ZodObject<{
131
+ minor: z.ZodString;
132
+ currency: z.ZodString;
133
+ }, z.core.$strict>;
134
+ /** The fields of an HTTP response a transport reads. A real `Response` has them all. */
135
+ export interface PaymentHttpResponse {
136
+ readonly status: number;
137
+ readonly headers: {
138
+ get(name: string): string | null;
139
+ };
140
+ text(): Promise<string>;
141
+ }
142
+ /**
143
+ * The egress-bound client. Only hosts in the add-on's `network.allow` are
144
+ * reachable, and a redirect is refused rather than followed.
145
+ */
146
+ export type PaymentHttpClient = (url: string, init?: {
147
+ method?: string;
148
+ headers?: Record<string, string>;
149
+ body?: string;
150
+ }) => Promise<PaymentHttpResponse>;
151
+ /**
152
+ * One mode's credential fields, decrypted for one call. The field names are
153
+ * the provider's own (a Stripe key; a PayPal client id, secret and webhook id),
154
+ * plus `webhookSecret` where the provider signs webhooks with a shared secret.
155
+ */
156
+ export type PaymentCredentials = Readonly<Record<string, string>>;
157
+ export interface PaymentProviderContext {
158
+ readonly http: PaymentHttpClient;
159
+ readonly credentials: PaymentCredentials;
160
+ readonly mode: PaymentMode;
161
+ }
162
+ /** What `checkCredentials` learns: whose account, which mode, what is missing. */
163
+ export interface CredentialCheck {
164
+ readonly ok: true;
165
+ /** The provider's account id (`acct_…`, a PayPal merchant id). Shown everywhere. */
166
+ readonly accountId: string;
167
+ readonly livemode: boolean;
168
+ /** Each missing permission, named in the provider's own dashboard words. Empty when the key is complete. */
169
+ readonly missing: readonly string[];
170
+ }
171
+ export declare const credentialCheckSchema: z.ZodObject<{
172
+ ok: z.ZodLiteral<true>;
173
+ accountId: z.ZodString;
174
+ livemode: z.ZodBoolean;
175
+ missing: z.ZodArray<z.ZodString>;
176
+ }, z.core.$strict>;
177
+ /** The thing being paid, as the provider needs to show it. Never carries a secret. */
178
+ export interface CheckoutPayable {
179
+ /** The invoice or record number the customer recognises ("INV-0042"). */
180
+ readonly reference: string;
181
+ /** One line describing it, shown on the provider's page. */
182
+ readonly description: string;
183
+ readonly amount: string;
184
+ readonly currency: string;
185
+ /** Prefills the provider's email field; never required. */
186
+ readonly customerEmail: string | null;
187
+ /** One of Adminium's locales (`en-US`, `ar-EG`, …); the provider maps it to its own. */
188
+ readonly locale: string | null;
189
+ }
190
+ export interface CheckoutInput {
191
+ readonly payable: CheckoutPayable;
192
+ /** The ways to pay the shop's rules allow for this customer, by the ids `methodsFor` returned. */
193
+ readonly methods: readonly string[];
194
+ /** Where the provider sends the customer back. Adminium's own URLs, never the customer's. */
195
+ readonly successUrl: string;
196
+ readonly cancelUrl: string;
197
+ /** Adminium's attempt id: the provider's client reference and metadata. */
198
+ readonly attemptId: string;
199
+ readonly idempotencyKey: string;
200
+ }
201
+ export interface CheckoutCreated {
202
+ readonly ok: true;
203
+ /** The provider's id for the checkout (a session id, an order id). */
204
+ readonly ref: string;
205
+ /** The hosted page. The engine checks its host before sending anyone there. */
206
+ readonly url: string;
207
+ /** When the provider will end it (epoch ms), if it says. */
208
+ readonly expiresAt: number | null;
209
+ }
210
+ export declare const checkoutCreatedSchema: z.ZodObject<{
211
+ ok: z.ZodLiteral<true>;
212
+ ref: z.ZodString;
213
+ url: z.ZodString;
214
+ expiresAt: z.ZodNullable<z.ZodNumber>;
215
+ }, z.core.$strict>;
216
+ /** How the customer paid, as staff will read it. */
217
+ export interface PaidWith {
218
+ /** The provider's method id (`card`, `sepa_debit`, `paypal`). */
219
+ readonly method: string;
220
+ /** "Visa ••4242" or the method's name. Never a full number. */
221
+ readonly label: string;
222
+ /** True for a method whose money arrives later (SEPA, vouchers). */
223
+ readonly delayed: boolean;
224
+ }
225
+ export declare const paidWithSchema: z.ZodObject<{
226
+ method: z.ZodString;
227
+ label: z.ZodString;
228
+ delayed: z.ZodBoolean;
229
+ }, z.core.$strict>;
230
+ /** How a checkout stands, re-read from the provider (never from a webhook body). */
231
+ export interface CheckoutState {
232
+ readonly ok: true;
233
+ readonly ref: string;
234
+ readonly status: CheckoutStatus;
235
+ /** The client reference the checkout was made with: Adminium's attempt id. */
236
+ readonly attemptId: string | null;
237
+ /** What the provider TOOK. Null until money moved. May differ from what was asked. */
238
+ readonly amount: string | null;
239
+ readonly currency: string | null;
240
+ readonly livemode: boolean;
241
+ /** The provider's id for the money itself (a PaymentIntent, a capture), once there is one. */
242
+ readonly paymentRef: string | null;
243
+ readonly paidWith: PaidWith | null;
244
+ /** When the provider says it succeeded (epoch ms). */
245
+ readonly settledAt: number | null;
246
+ /** The provider's words for a failure, if any. */
247
+ readonly failureMessage: string | null;
248
+ }
249
+ export declare const checkoutStateSchema: z.ZodObject<{
250
+ ok: z.ZodLiteral<true>;
251
+ ref: z.ZodString;
252
+ status: z.ZodEnum<{
253
+ expired: "expired";
254
+ pending: "pending";
255
+ processing: "processing";
256
+ succeeded: "succeeded";
257
+ failed: "failed";
258
+ cancelled: "cancelled";
259
+ requires_action: "requires_action";
260
+ }>;
261
+ attemptId: z.ZodNullable<z.ZodString>;
262
+ amount: z.ZodNullable<z.ZodString>;
263
+ currency: z.ZodNullable<z.ZodString>;
264
+ livemode: z.ZodBoolean;
265
+ paymentRef: z.ZodNullable<z.ZodString>;
266
+ paidWith: z.ZodNullable<z.ZodObject<{
267
+ method: z.ZodString;
268
+ label: z.ZodString;
269
+ delayed: z.ZodBoolean;
270
+ }, z.core.$strict>>;
271
+ settledAt: z.ZodNullable<z.ZodNumber>;
272
+ failureMessage: z.ZodNullable<z.ZodString>;
273
+ }, z.core.$strict>;
274
+ export interface ExpireResult {
275
+ readonly ok: true;
276
+ readonly ref: string;
277
+ /** The checkout's state after the call: `expired`, or what it already was. */
278
+ readonly status: CheckoutStatus;
279
+ }
280
+ export declare const expireResultSchema: z.ZodObject<{
281
+ ok: z.ZodLiteral<true>;
282
+ ref: z.ZodString;
283
+ status: z.ZodEnum<{
284
+ expired: "expired";
285
+ pending: "pending";
286
+ processing: "processing";
287
+ succeeded: "succeeded";
288
+ failed: "failed";
289
+ cancelled: "cancelled";
290
+ requires_action: "requires_action";
291
+ }>;
292
+ }, z.core.$strict>;
293
+ export interface RefundInput {
294
+ /** The provider's id for the money (`CheckoutState.paymentRef`). */
295
+ readonly paymentRef: string;
296
+ readonly amount: string;
297
+ readonly currency: string;
298
+ readonly reason: RefundReason;
299
+ /** Minted at the confirm step, bound to (payment, amount), reused on every retry. */
300
+ readonly idempotencyKey: string;
301
+ }
302
+ export interface RefundState {
303
+ readonly ok: true;
304
+ /** The provider's id for the refund. */
305
+ readonly ref: string;
306
+ readonly paymentRef: string;
307
+ readonly status: RefundStatus;
308
+ readonly amount: string;
309
+ readonly currency: string;
310
+ readonly failureMessage: string | null;
311
+ }
312
+ export declare const refundStateSchema: z.ZodObject<{
313
+ ok: z.ZodLiteral<true>;
314
+ ref: z.ZodString;
315
+ paymentRef: z.ZodString;
316
+ status: z.ZodEnum<{
317
+ pending: "pending";
318
+ succeeded: "succeeded";
319
+ failed: "failed";
320
+ cancelled: "cancelled";
321
+ requires_action: "requires_action";
322
+ }>;
323
+ amount: z.ZodString;
324
+ currency: z.ZodString;
325
+ failureMessage: z.ZodNullable<z.ZodString>;
326
+ }, z.core.$strict>;
327
+ /** A webhook's identity, after its signature verified. Never a status to trust. */
328
+ export interface PaymentEvent {
329
+ readonly ok: true;
330
+ /** The provider's event id: unique per provider and mode. */
331
+ readonly eventId: string;
332
+ /** The provider's own type (`checkout.session.completed`). */
333
+ readonly type: string;
334
+ readonly kind: PaymentEventKind;
335
+ /** The checkout the event is about (a session or order id), when it says. */
336
+ readonly checkoutRef: string | null;
337
+ /** The money it is about (a PaymentIntent or capture), when it says. */
338
+ readonly paymentRef: string | null;
339
+ /** The refund it is about, when it says. */
340
+ readonly refundRef: string | null;
341
+ readonly livemode: boolean;
342
+ /** When the provider made the event (epoch ms). */
343
+ readonly occurredAt: number;
344
+ }
345
+ export declare const paymentEventSchema: z.ZodObject<{
346
+ ok: z.ZodLiteral<true>;
347
+ eventId: z.ZodString;
348
+ type: z.ZodString;
349
+ kind: z.ZodEnum<{
350
+ refund: "refund";
351
+ checkout: "checkout";
352
+ dispute: "dispute";
353
+ other: "other";
354
+ }>;
355
+ checkoutRef: z.ZodNullable<z.ZodString>;
356
+ paymentRef: z.ZodNullable<z.ZodString>;
357
+ refundRef: z.ZodNullable<z.ZodString>;
358
+ livemode: z.ZodBoolean;
359
+ occurredAt: z.ZodNumber;
360
+ }, z.core.$strict>;
361
+ export interface MissedEvents {
362
+ readonly ok: true;
363
+ readonly events: readonly PaymentEvent[];
364
+ /** Pass back next time. Null when the provider keeps no cursor. */
365
+ readonly cursor: string | null;
366
+ /** More events wait past this page. */
367
+ readonly more: boolean;
368
+ }
369
+ export declare const missedEventsSchema: z.ZodObject<{
370
+ ok: z.ZodLiteral<true>;
371
+ events: z.ZodArray<z.ZodObject<{
372
+ ok: z.ZodLiteral<true>;
373
+ eventId: z.ZodString;
374
+ type: z.ZodString;
375
+ kind: z.ZodEnum<{
376
+ refund: "refund";
377
+ checkout: "checkout";
378
+ dispute: "dispute";
379
+ other: "other";
380
+ }>;
381
+ checkoutRef: z.ZodNullable<z.ZodString>;
382
+ paymentRef: z.ZodNullable<z.ZodString>;
383
+ refundRef: z.ZodNullable<z.ZodString>;
384
+ livemode: z.ZodBoolean;
385
+ occurredAt: z.ZodNumber;
386
+ }, z.core.$strict>>;
387
+ cursor: z.ZodNullable<z.ZodString>;
388
+ more: z.ZodBoolean;
389
+ }, z.core.$strict>;
390
+ /** A way to pay the account has switched on. */
391
+ export interface PaymentMethodInfo {
392
+ /** The provider's id, passed back in `CheckoutInput.methods`. */
393
+ readonly id: string;
394
+ /** Its name, as staff see it ("Cards", "Link (Stripe)", "SEPA Direct Debit"). */
395
+ readonly label: string;
396
+ readonly delayed: boolean;
397
+ }
398
+ export interface MethodList {
399
+ readonly ok: true;
400
+ readonly methods: readonly PaymentMethodInfo[];
401
+ }
402
+ export declare const methodListSchema: z.ZodObject<{
403
+ ok: z.ZodLiteral<true>;
404
+ methods: z.ZodArray<z.ZodObject<{
405
+ id: z.ZodString;
406
+ label: z.ZodString;
407
+ delayed: z.ZodBoolean;
408
+ }, z.core.$strict>>;
409
+ }, z.core.$strict>;
410
+ export interface MethodQuery {
411
+ /** ISO 3166-1 alpha-2, the customer's country, or null when unknown. */
412
+ readonly country: string | null;
413
+ readonly currency: string;
414
+ readonly amount: string;
415
+ }
416
+ /** A webhook as received: the exact bytes (as UTF-8 text) and the headers, names in lower case. */
417
+ export interface WebhookDelivery {
418
+ readonly rawBody: string;
419
+ readonly headers: Readonly<Record<string, string | undefined>>;
420
+ }
421
+ /**
422
+ * One payment service. Every method may return a `ProviderError` instead of
423
+ * its answer; none throws for an ordinary refusal.
424
+ */
425
+ export interface PaymentProvider {
426
+ /** The add-on's key. */
427
+ readonly key: string;
428
+ readonly mode: PaymentMode;
429
+ checkCredentials(): Promise<CredentialCheck | ProviderError>;
430
+ createCheckout(input: CheckoutInput): Promise<CheckoutCreated | ProviderError>;
431
+ /** An unknown ref is `NOT_FOUND`, never a throw. */
432
+ status(ref: string): Promise<CheckoutState | ProviderError>;
433
+ /** Finishes a two-step payment (a PayPal capture). A one-step provider returns `status(ref)`. */
434
+ complete(ref: string, idempotencyKey: string): Promise<CheckoutState | ProviderError>;
435
+ /** Ends an open checkout. One that already completed is `ALREADY_COMPLETED`. */
436
+ expire(ref: string): Promise<ExpireResult | ProviderError>;
437
+ refund(input: RefundInput): Promise<RefundState | ProviderError>;
438
+ refundStatus(ref: string): Promise<RefundState | ProviderError>;
439
+ verifyWebhook(delivery: WebhookDelivery): Promise<PaymentEvent | ProviderError>;
440
+ listMissedEvents(cursor: string | null): Promise<MissedEvents | ProviderError>;
441
+ methodsFor(query: MethodQuery): Promise<MethodList | ProviderError>;
442
+ /** The provider's own exponent table. Refuses an amount it cannot hold exactly. */
443
+ toMinor(amount: string, currency: string): MinorAmount | ProviderError;
444
+ fromMinor(minor: string, currency: string): string | ProviderError;
445
+ }
446
+ /** The server half's export. Called once per operation. */
447
+ export type CreatePaymentProvider = (context: PaymentProviderContext) => PaymentProvider;
448
+ /**
449
+ * The schema each answer must pass, by call. The engine parses every answer
450
+ * with these; a provider whose answer fails is treated as unavailable.
451
+ */
452
+ export declare const PAYMENT_ANSWER_SCHEMAS: {
453
+ readonly checkCredentials: z.ZodObject<{
454
+ ok: z.ZodLiteral<true>;
455
+ accountId: z.ZodString;
456
+ livemode: z.ZodBoolean;
457
+ missing: z.ZodArray<z.ZodString>;
458
+ }, z.core.$strict>;
459
+ readonly createCheckout: z.ZodObject<{
460
+ ok: z.ZodLiteral<true>;
461
+ ref: z.ZodString;
462
+ url: z.ZodString;
463
+ expiresAt: z.ZodNullable<z.ZodNumber>;
464
+ }, z.core.$strict>;
465
+ readonly status: z.ZodObject<{
466
+ ok: z.ZodLiteral<true>;
467
+ ref: z.ZodString;
468
+ status: z.ZodEnum<{
469
+ expired: "expired";
470
+ pending: "pending";
471
+ processing: "processing";
472
+ succeeded: "succeeded";
473
+ failed: "failed";
474
+ cancelled: "cancelled";
475
+ requires_action: "requires_action";
476
+ }>;
477
+ attemptId: z.ZodNullable<z.ZodString>;
478
+ amount: z.ZodNullable<z.ZodString>;
479
+ currency: z.ZodNullable<z.ZodString>;
480
+ livemode: z.ZodBoolean;
481
+ paymentRef: z.ZodNullable<z.ZodString>;
482
+ paidWith: z.ZodNullable<z.ZodObject<{
483
+ method: z.ZodString;
484
+ label: z.ZodString;
485
+ delayed: z.ZodBoolean;
486
+ }, z.core.$strict>>;
487
+ settledAt: z.ZodNullable<z.ZodNumber>;
488
+ failureMessage: z.ZodNullable<z.ZodString>;
489
+ }, z.core.$strict>;
490
+ readonly complete: z.ZodObject<{
491
+ ok: z.ZodLiteral<true>;
492
+ ref: z.ZodString;
493
+ status: z.ZodEnum<{
494
+ expired: "expired";
495
+ pending: "pending";
496
+ processing: "processing";
497
+ succeeded: "succeeded";
498
+ failed: "failed";
499
+ cancelled: "cancelled";
500
+ requires_action: "requires_action";
501
+ }>;
502
+ attemptId: z.ZodNullable<z.ZodString>;
503
+ amount: z.ZodNullable<z.ZodString>;
504
+ currency: z.ZodNullable<z.ZodString>;
505
+ livemode: z.ZodBoolean;
506
+ paymentRef: z.ZodNullable<z.ZodString>;
507
+ paidWith: z.ZodNullable<z.ZodObject<{
508
+ method: z.ZodString;
509
+ label: z.ZodString;
510
+ delayed: z.ZodBoolean;
511
+ }, z.core.$strict>>;
512
+ settledAt: z.ZodNullable<z.ZodNumber>;
513
+ failureMessage: z.ZodNullable<z.ZodString>;
514
+ }, z.core.$strict>;
515
+ readonly expire: z.ZodObject<{
516
+ ok: z.ZodLiteral<true>;
517
+ ref: z.ZodString;
518
+ status: z.ZodEnum<{
519
+ expired: "expired";
520
+ pending: "pending";
521
+ processing: "processing";
522
+ succeeded: "succeeded";
523
+ failed: "failed";
524
+ cancelled: "cancelled";
525
+ requires_action: "requires_action";
526
+ }>;
527
+ }, z.core.$strict>;
528
+ readonly refund: z.ZodObject<{
529
+ ok: z.ZodLiteral<true>;
530
+ ref: z.ZodString;
531
+ paymentRef: z.ZodString;
532
+ status: z.ZodEnum<{
533
+ pending: "pending";
534
+ succeeded: "succeeded";
535
+ failed: "failed";
536
+ cancelled: "cancelled";
537
+ requires_action: "requires_action";
538
+ }>;
539
+ amount: z.ZodString;
540
+ currency: z.ZodString;
541
+ failureMessage: z.ZodNullable<z.ZodString>;
542
+ }, z.core.$strict>;
543
+ readonly refundStatus: z.ZodObject<{
544
+ ok: z.ZodLiteral<true>;
545
+ ref: z.ZodString;
546
+ paymentRef: z.ZodString;
547
+ status: z.ZodEnum<{
548
+ pending: "pending";
549
+ succeeded: "succeeded";
550
+ failed: "failed";
551
+ cancelled: "cancelled";
552
+ requires_action: "requires_action";
553
+ }>;
554
+ amount: z.ZodString;
555
+ currency: z.ZodString;
556
+ failureMessage: z.ZodNullable<z.ZodString>;
557
+ }, z.core.$strict>;
558
+ readonly verifyWebhook: z.ZodObject<{
559
+ ok: z.ZodLiteral<true>;
560
+ eventId: z.ZodString;
561
+ type: z.ZodString;
562
+ kind: z.ZodEnum<{
563
+ refund: "refund";
564
+ checkout: "checkout";
565
+ dispute: "dispute";
566
+ other: "other";
567
+ }>;
568
+ checkoutRef: z.ZodNullable<z.ZodString>;
569
+ paymentRef: z.ZodNullable<z.ZodString>;
570
+ refundRef: z.ZodNullable<z.ZodString>;
571
+ livemode: z.ZodBoolean;
572
+ occurredAt: z.ZodNumber;
573
+ }, z.core.$strict>;
574
+ readonly listMissedEvents: z.ZodObject<{
575
+ ok: z.ZodLiteral<true>;
576
+ events: z.ZodArray<z.ZodObject<{
577
+ ok: z.ZodLiteral<true>;
578
+ eventId: z.ZodString;
579
+ type: z.ZodString;
580
+ kind: z.ZodEnum<{
581
+ refund: "refund";
582
+ checkout: "checkout";
583
+ dispute: "dispute";
584
+ other: "other";
585
+ }>;
586
+ checkoutRef: z.ZodNullable<z.ZodString>;
587
+ paymentRef: z.ZodNullable<z.ZodString>;
588
+ refundRef: z.ZodNullable<z.ZodString>;
589
+ livemode: z.ZodBoolean;
590
+ occurredAt: z.ZodNumber;
591
+ }, z.core.$strict>>;
592
+ cursor: z.ZodNullable<z.ZodString>;
593
+ more: z.ZodBoolean;
594
+ }, z.core.$strict>;
595
+ readonly methodsFor: z.ZodObject<{
596
+ ok: z.ZodLiteral<true>;
597
+ methods: z.ZodArray<z.ZodObject<{
598
+ id: z.ZodString;
599
+ label: z.ZodString;
600
+ delayed: z.ZodBoolean;
601
+ }, z.core.$strict>>;
602
+ }, z.core.$strict>;
603
+ };
604
+ export type PaymentCall = keyof typeof PAYMENT_ANSWER_SCHEMAS;
605
+ //# sourceMappingURL=payment-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-provider.d.ts","sourceRoot":"","sources":["../src/payment-provider.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAC5D,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD,wFAAwF;AACxF,eAAO,MAAM,aAAa,2BAA4B,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,sGAQpB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,mFAAmF;AACnF,eAAO,MAAM,eAAe,6EAA8E,CAAC;AAC3G,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,qDAAsD,CAAC;AACvF,MAAM,MAAM,gBAAgB,GAA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