@payclave/sdk-server 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +192 -7
- package/dist/index.cjs +845 -15
- package/dist/index.d.cts +684 -8
- package/dist/index.d.ts +684 -8
- package/dist/index.js +845 -16
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,10 @@ import { Buffer } from 'node:buffer';
|
|
|
3
3
|
type PayclaveMode = "test" | "live" | (string & {});
|
|
4
4
|
type PayclaveInvoiceStatus = "pending" | "processing" | "paid" | "underpaid" | "overpaid" | "expired" | "failed" | "cancelled" | (string & {});
|
|
5
5
|
type PayclavePaymentStatus = "detected" | "validating" | "confirmed" | "failed" | "duplicate" | "underpaid" | "overpaid" | (string & {});
|
|
6
|
-
|
|
6
|
+
type PayclaveInvoiceCollectionState = "draft" | "open" | "past_due" | "partially_paid" | "paid" | "void" | "uncollectible" | (string & {});
|
|
7
|
+
type PayclaveMigrationState = "current" | "review_required" | (string & {});
|
|
8
|
+
type PayclaveSourceType = "api" | "dashboard" | "payment_link" | "sdk" | "legacy" | (string & {});
|
|
9
|
+
declare const PAYCLAVE_WEBHOOK_EVENT_TYPES: readonly ["invoice.issued", "invoice.paid", "invoice.partially_paid", "invoice.past_due", "invoice.overpaid", "invoice.voided", "invoice.uncollectible", "invoice.refund_recorded", "invoice.payment_received_after_void", "invoice.payment_received_after_uncollectible", "invoice.expired", "payment_link.completed", "payment_link.expired", "payment.failed", "payment.underpaid", "payment.overpaid"];
|
|
7
10
|
type PayclaveWebhookEventType = (typeof PAYCLAVE_WEBHOOK_EVENT_TYPES)[number];
|
|
8
11
|
type PayclaveWebhookDeliveryStatus = "pending" | "delivering" | "delivered" | "retry_scheduled" | "failed" | (string & {});
|
|
9
12
|
type PayclaveMetadata = Record<string, unknown>;
|
|
@@ -17,6 +20,20 @@ type PayclaveServerClientOptions = {
|
|
|
17
20
|
type PayclaveRequestOptions = {
|
|
18
21
|
signal?: AbortSignal;
|
|
19
22
|
};
|
|
23
|
+
type PayclaveInvoicePDF = {
|
|
24
|
+
bytes: Uint8Array;
|
|
25
|
+
contentType: "application/pdf";
|
|
26
|
+
filename: string;
|
|
27
|
+
requestId: string | null;
|
|
28
|
+
};
|
|
29
|
+
type PayclaveReconciliationDownload = {
|
|
30
|
+
stream: ReadableStream<Uint8Array>;
|
|
31
|
+
contentType: "application/zip";
|
|
32
|
+
filename: string;
|
|
33
|
+
byteSize: number | null;
|
|
34
|
+
sha256: string | null;
|
|
35
|
+
requestId: string | null;
|
|
36
|
+
};
|
|
20
37
|
type CreateCheckoutSessionInput = PayclaveRequestOptions & {
|
|
21
38
|
amount: string;
|
|
22
39
|
customerEmail?: string;
|
|
@@ -34,6 +51,168 @@ type CreateInvoiceInput = PayclaveRequestOptions & {
|
|
|
34
51
|
expiresInMinutes?: number;
|
|
35
52
|
idempotencyKey?: string;
|
|
36
53
|
};
|
|
54
|
+
type PayclaveInvoiceCustomer = {
|
|
55
|
+
name?: string;
|
|
56
|
+
email?: string;
|
|
57
|
+
company?: string;
|
|
58
|
+
billingAddress?: string | null;
|
|
59
|
+
};
|
|
60
|
+
type PayclaveInvoiceLineInput = {
|
|
61
|
+
id?: string;
|
|
62
|
+
description: string;
|
|
63
|
+
sku?: string | null;
|
|
64
|
+
quantity: string;
|
|
65
|
+
unitAmount: string;
|
|
66
|
+
};
|
|
67
|
+
type PayclaveInvoiceDiscountInput = {
|
|
68
|
+
type: "fixed";
|
|
69
|
+
amount: string;
|
|
70
|
+
percentage?: never;
|
|
71
|
+
} | {
|
|
72
|
+
type: "percentage";
|
|
73
|
+
percentage: string;
|
|
74
|
+
amount?: never;
|
|
75
|
+
};
|
|
76
|
+
type PayclaveInvoiceTaxInput = {
|
|
77
|
+
id?: string;
|
|
78
|
+
label: string;
|
|
79
|
+
jurisdiction?: string | null;
|
|
80
|
+
registrationReference?: string | null;
|
|
81
|
+
amount: string;
|
|
82
|
+
};
|
|
83
|
+
type PayclaveInvoiceReminderSchedule = {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
daysBeforeDue?: number[];
|
|
86
|
+
onDue?: boolean;
|
|
87
|
+
daysAfterDue?: number[];
|
|
88
|
+
};
|
|
89
|
+
type PayclaveInvoiceDraftFields = {
|
|
90
|
+
customer: PayclaveInvoiceCustomer;
|
|
91
|
+
lines: PayclaveInvoiceLineInput[];
|
|
92
|
+
discount?: PayclaveInvoiceDiscountInput | null;
|
|
93
|
+
taxes?: PayclaveInvoiceTaxInput[];
|
|
94
|
+
dueAt?: string | null;
|
|
95
|
+
paymentTerms?: string;
|
|
96
|
+
memo?: string;
|
|
97
|
+
footer?: string;
|
|
98
|
+
purchaseOrderNumber?: string;
|
|
99
|
+
externalReference?: string | null;
|
|
100
|
+
currencyCode?: string;
|
|
101
|
+
metadata?: PayclaveMetadata;
|
|
102
|
+
successUrl?: string | null;
|
|
103
|
+
cancelUrl?: string | null;
|
|
104
|
+
checkoutExpiresInMinutes?: number;
|
|
105
|
+
reminderSchedule?: PayclaveInvoiceReminderSchedule;
|
|
106
|
+
};
|
|
107
|
+
type CreateInvoiceDraftInput = PayclaveRequestOptions & PayclaveInvoiceDraftFields & {
|
|
108
|
+
idempotencyKey?: string;
|
|
109
|
+
};
|
|
110
|
+
type UpdateInvoiceDraftInput = PayclaveRequestOptions & PayclaveInvoiceDraftFields & {
|
|
111
|
+
version: number;
|
|
112
|
+
idempotencyKey?: string;
|
|
113
|
+
};
|
|
114
|
+
type IssueInvoiceInput = PayclaveRequestOptions & {
|
|
115
|
+
version: number;
|
|
116
|
+
send?: boolean;
|
|
117
|
+
idempotencyKey?: string;
|
|
118
|
+
};
|
|
119
|
+
type PayclaveInvoiceDelivery = {
|
|
120
|
+
id: string;
|
|
121
|
+
type: "issue" | "send" | "reminder" | (string & {});
|
|
122
|
+
recipient: string;
|
|
123
|
+
templateVersion: string;
|
|
124
|
+
status: string;
|
|
125
|
+
providerMessageId: string | null;
|
|
126
|
+
lastError: string | null;
|
|
127
|
+
scheduledFor: string;
|
|
128
|
+
sentAt: string | null;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
reminderKey: string | null;
|
|
131
|
+
};
|
|
132
|
+
type PayclaveInvoiceActivityEvent = {
|
|
133
|
+
id: string;
|
|
134
|
+
action: string;
|
|
135
|
+
actorType: string;
|
|
136
|
+
actorId: string;
|
|
137
|
+
changes: Record<string, unknown>;
|
|
138
|
+
createdAt: string;
|
|
139
|
+
};
|
|
140
|
+
type InvoiceActionInput = PayclaveRequestOptions & {
|
|
141
|
+
reason?: string;
|
|
142
|
+
idempotencyKey?: string;
|
|
143
|
+
};
|
|
144
|
+
type CreateInvoiceCheckoutSessionInput = PayclaveRequestOptions & {
|
|
145
|
+
idempotencyKey?: string;
|
|
146
|
+
};
|
|
147
|
+
type RecordInvoiceRefundReferenceInput = PayclaveRequestOptions & {
|
|
148
|
+
paymentId: string;
|
|
149
|
+
amount: string;
|
|
150
|
+
reason: string;
|
|
151
|
+
externalTransactionHash: string;
|
|
152
|
+
chainId: number;
|
|
153
|
+
tokenContract: string;
|
|
154
|
+
idempotencyKey?: string;
|
|
155
|
+
};
|
|
156
|
+
type ListInvoicesInput = PayclaveRequestOptions & {
|
|
157
|
+
limit?: number;
|
|
158
|
+
startingAfter?: string;
|
|
159
|
+
collectionState?: PayclaveInvoiceCollectionState;
|
|
160
|
+
};
|
|
161
|
+
type PayclavePaymentLinkStatus = "draft" | "active" | "paused" | "completed" | "expired" | "archived" | (string & {});
|
|
162
|
+
type PayclavePaymentLinkAmountType = "fixed" | "customer_entered";
|
|
163
|
+
type PayclavePaymentLinkUsageType = "single_use" | "reusable";
|
|
164
|
+
type PayclavePaymentLinkCollect = {
|
|
165
|
+
email: boolean;
|
|
166
|
+
name: boolean;
|
|
167
|
+
reference: boolean;
|
|
168
|
+
};
|
|
169
|
+
type PayclavePaymentLinkFields = {
|
|
170
|
+
mode?: "test" | "live";
|
|
171
|
+
title: string;
|
|
172
|
+
description?: string;
|
|
173
|
+
amountType: PayclavePaymentLinkAmountType;
|
|
174
|
+
amount?: string;
|
|
175
|
+
minimumAmount?: string;
|
|
176
|
+
maximumAmount?: string;
|
|
177
|
+
currencyCode?: "USDC" | "USDT";
|
|
178
|
+
usageType?: PayclavePaymentLinkUsageType;
|
|
179
|
+
activeAt?: string | null;
|
|
180
|
+
expiresAt?: string | null;
|
|
181
|
+
collect?: Partial<PayclavePaymentLinkCollect>;
|
|
182
|
+
referencePrefix?: string;
|
|
183
|
+
successUrl?: string | null;
|
|
184
|
+
cancelUrl?: string | null;
|
|
185
|
+
successMessage?: string;
|
|
186
|
+
metadata?: PayclaveMetadata;
|
|
187
|
+
};
|
|
188
|
+
type CreatePaymentLinkInput = PayclaveRequestOptions & PayclavePaymentLinkFields & {
|
|
189
|
+
idempotencyKey?: string;
|
|
190
|
+
};
|
|
191
|
+
type UpdatePaymentLinkInput = PayclaveRequestOptions & PayclavePaymentLinkFields & {
|
|
192
|
+
version: number;
|
|
193
|
+
idempotencyKey?: string;
|
|
194
|
+
};
|
|
195
|
+
type PaymentLinkActionInput = PayclaveRequestOptions & {
|
|
196
|
+
idempotencyKey?: string;
|
|
197
|
+
};
|
|
198
|
+
type ReleasePaymentLinkReservationInput = PayclaveRequestOptions & {
|
|
199
|
+
acknowledgeLatePaymentRisk: true;
|
|
200
|
+
idempotencyKey?: string;
|
|
201
|
+
};
|
|
202
|
+
type ListPaymentLinksInput = PayclaveRequestOptions & {
|
|
203
|
+
limit?: number;
|
|
204
|
+
startingAfter?: string;
|
|
205
|
+
status?: PayclavePaymentLinkStatus;
|
|
206
|
+
amountType?: PayclavePaymentLinkAmountType;
|
|
207
|
+
usageType?: PayclavePaymentLinkUsageType;
|
|
208
|
+
currencyCode?: "USDC" | "USDT";
|
|
209
|
+
search?: string;
|
|
210
|
+
createdFrom?: string;
|
|
211
|
+
createdTo?: string;
|
|
212
|
+
};
|
|
213
|
+
type ListPaymentLinkPaymentsInput = PayclaveRequestOptions & {
|
|
214
|
+
limit?: number;
|
|
215
|
+
};
|
|
37
216
|
type CreateWebhookEndpointInput = PayclaveRequestOptions & {
|
|
38
217
|
url: string;
|
|
39
218
|
eventTypes?: PayclaveWebhookEventType[];
|
|
@@ -44,16 +223,186 @@ type CreateTestWebhookInput = PayclaveRequestOptions & {
|
|
|
44
223
|
};
|
|
45
224
|
type ListWebhookDeliveriesInput = PayclaveRequestOptions & {
|
|
46
225
|
limit?: number;
|
|
226
|
+
endpointId?: string;
|
|
227
|
+
eventType?: PayclaveWebhookEventType;
|
|
228
|
+
status?: PayclaveWebhookDeliveryStatus;
|
|
229
|
+
createdFrom?: string;
|
|
230
|
+
createdTo?: string;
|
|
231
|
+
replayStatus?: "original" | "replay";
|
|
232
|
+
responseFamily?: "2xx" | "3xx" | "4xx" | "5xx" | "network";
|
|
233
|
+
};
|
|
234
|
+
type ReplayWebhookDeliveryInput = PayclaveRequestOptions & {
|
|
235
|
+
idempotencyKey: string;
|
|
236
|
+
};
|
|
237
|
+
type UpdateWebhookEndpointInput = PayclaveRequestOptions & {
|
|
238
|
+
url?: string;
|
|
239
|
+
enabled?: boolean;
|
|
240
|
+
eventTypes?: PayclaveWebhookEventType[];
|
|
241
|
+
alertsEnabled?: boolean;
|
|
242
|
+
alertThreshold?: number;
|
|
243
|
+
recoveryAlertsEnabled?: boolean;
|
|
244
|
+
idempotencyKey: string;
|
|
245
|
+
};
|
|
246
|
+
type WebhookEndpointActionInput = PayclaveRequestOptions & {
|
|
247
|
+
idempotencyKey: string;
|
|
248
|
+
};
|
|
249
|
+
type ListWebhookIncidentsInput = PayclaveRequestOptions & {
|
|
250
|
+
status?: "open" | "resolved";
|
|
251
|
+
};
|
|
252
|
+
declare const PAYCLAVE_RECONCILIATION_SCHEMA_VERSION: "2026-08-29.v1";
|
|
253
|
+
type PayclaveReconciliationDateBasis = "invoice_created" | "invoice_issued" | "invoice_paid" | "payment_confirmed" | "transaction_observed";
|
|
254
|
+
type GetReconciliationSummaryInput = PayclaveRequestOptions & {
|
|
255
|
+
dateBasis: PayclaveReconciliationDateBasis;
|
|
256
|
+
from: string;
|
|
257
|
+
to: string;
|
|
258
|
+
timezone?: string;
|
|
259
|
+
invoiceStatuses?: PayclaveInvoiceStatus[];
|
|
260
|
+
paymentStatuses?: PayclavePaymentStatus[];
|
|
261
|
+
settlementTokens?: Array<"USDC" | "USDT" | (string & {})>;
|
|
262
|
+
exceptionOnly?: boolean;
|
|
263
|
+
};
|
|
264
|
+
type PayclaveReconciliationTokenSummary = {
|
|
265
|
+
tokenSymbol: string;
|
|
266
|
+
tokenContract: string;
|
|
267
|
+
chainId: number;
|
|
268
|
+
invoiceCount: number;
|
|
269
|
+
paymentCount: number;
|
|
270
|
+
exceptionCount: number;
|
|
271
|
+
invoiceTotal: string;
|
|
272
|
+
customerGrossPaid: string;
|
|
273
|
+
platformFeeExpected: string;
|
|
274
|
+
platformFeeCollected: string;
|
|
275
|
+
expectedMerchantSettlement: string;
|
|
276
|
+
merchantSettled: string;
|
|
277
|
+
outstanding: string;
|
|
278
|
+
overpayment: string;
|
|
279
|
+
nominalStablecoinUsd: string;
|
|
280
|
+
invoiceStatusCounts: Record<string, number>;
|
|
281
|
+
paymentStatusCounts: Record<string, number>;
|
|
282
|
+
};
|
|
283
|
+
type PayclaveReconciliationSummary = {
|
|
284
|
+
schemaVersion: string;
|
|
285
|
+
dateBasis: PayclaveReconciliationDateBasis;
|
|
286
|
+
from: string;
|
|
287
|
+
to: string;
|
|
288
|
+
cutoffAt: string;
|
|
289
|
+
timezone: string;
|
|
290
|
+
rowCounts: Record<string, number>;
|
|
291
|
+
summaryByToken: PayclaveReconciliationTokenSummary[];
|
|
292
|
+
exceptions: Array<{
|
|
293
|
+
invoiceId: string;
|
|
294
|
+
invoiceNumber: string;
|
|
295
|
+
state: string;
|
|
296
|
+
reasonCodes: string[];
|
|
297
|
+
tokenSymbol: string;
|
|
298
|
+
customerGrossPaid: string;
|
|
299
|
+
outstanding: string;
|
|
300
|
+
}>;
|
|
301
|
+
warnings: string[];
|
|
302
|
+
};
|
|
303
|
+
type PayclaveReconciliationSchema = {
|
|
304
|
+
schemaVersion: string;
|
|
305
|
+
formats: string[];
|
|
306
|
+
dateBases: PayclaveReconciliationDateBasis[];
|
|
307
|
+
maximumRangeDays: number;
|
|
308
|
+
rangeEnd: "exclusive" | (string & {});
|
|
309
|
+
retention: string;
|
|
310
|
+
files: Array<{
|
|
311
|
+
name: string;
|
|
312
|
+
description: string;
|
|
313
|
+
columns: Array<{
|
|
314
|
+
name: string;
|
|
315
|
+
type: string;
|
|
316
|
+
description: string;
|
|
317
|
+
pii: boolean;
|
|
318
|
+
}>;
|
|
319
|
+
}>;
|
|
320
|
+
stateRules: Array<{
|
|
321
|
+
state: string;
|
|
322
|
+
description: string;
|
|
323
|
+
}>;
|
|
324
|
+
};
|
|
325
|
+
type PayclaveReconciliationExportStatus = "queued" | "running" | "ready" | "failed" | "cancelled" | "expired" | (string & {});
|
|
326
|
+
type PayclaveReconciliationFilters = {
|
|
327
|
+
from: string;
|
|
328
|
+
to: string;
|
|
329
|
+
invoiceStatuses?: PayclaveInvoiceStatus[];
|
|
330
|
+
paymentStatuses?: PayclavePaymentStatus[];
|
|
331
|
+
settlementTokens?: string[];
|
|
332
|
+
exceptionOnly: boolean;
|
|
333
|
+
};
|
|
334
|
+
type PayclaveReconciliationFile = {
|
|
335
|
+
name: string;
|
|
336
|
+
mediaType: string;
|
|
337
|
+
rows: number;
|
|
338
|
+
bytes: number;
|
|
339
|
+
sha256: string;
|
|
340
|
+
};
|
|
341
|
+
type PayclaveReconciliationExport = {
|
|
342
|
+
id: string;
|
|
343
|
+
merchantId: string;
|
|
344
|
+
mode: PayclaveMode;
|
|
345
|
+
status: PayclaveReconciliationExportStatus;
|
|
346
|
+
format: "csv" | "json" | (string & {});
|
|
347
|
+
schemaVersion: string;
|
|
348
|
+
filters: PayclaveReconciliationFilters;
|
|
349
|
+
dateBasis: PayclaveReconciliationDateBasis;
|
|
350
|
+
cutoffAt?: string | null;
|
|
351
|
+
timezone: string;
|
|
352
|
+
requestedBy: string;
|
|
353
|
+
requestedAt: string;
|
|
354
|
+
startedAt?: string | null;
|
|
355
|
+
completedAt?: string | null;
|
|
356
|
+
cancelledAt?: string | null;
|
|
357
|
+
expiresAt?: string | null;
|
|
358
|
+
rowCounts?: Record<string, number>;
|
|
359
|
+
byteSize?: number;
|
|
360
|
+
fileManifest?: PayclaveReconciliationFile[];
|
|
361
|
+
sha256?: string;
|
|
362
|
+
summaryByToken?: PayclaveReconciliationTokenSummary[];
|
|
363
|
+
warnings?: string[];
|
|
364
|
+
errorCategory?: string;
|
|
365
|
+
attempts: number;
|
|
366
|
+
includePII: boolean;
|
|
367
|
+
piiFields?: string[];
|
|
368
|
+
createdAt: string;
|
|
369
|
+
updatedAt: string;
|
|
370
|
+
statusUrl?: string;
|
|
371
|
+
};
|
|
372
|
+
type CreateReconciliationExportInput = GetReconciliationSummaryInput & {
|
|
373
|
+
mode?: "test" | "live";
|
|
374
|
+
format: "csv" | "json";
|
|
375
|
+
includePII?: boolean;
|
|
376
|
+
idempotencyKey?: string;
|
|
377
|
+
schemaVersion?: string;
|
|
378
|
+
};
|
|
379
|
+
type ListReconciliationExportsInput = PayclaveRequestOptions & {
|
|
380
|
+
limit?: number;
|
|
381
|
+
startingAfter?: string;
|
|
382
|
+
};
|
|
383
|
+
type PayclaveReconciliationExportList = {
|
|
384
|
+
items: PayclaveReconciliationExport[];
|
|
385
|
+
hasMore: boolean;
|
|
386
|
+
nextCursor?: string;
|
|
387
|
+
};
|
|
388
|
+
type ReconciliationExportActionInput = PayclaveRequestOptions & {
|
|
389
|
+
idempotencyKey?: string;
|
|
47
390
|
};
|
|
48
391
|
type PayclaveCreatedCheckoutSession = {
|
|
49
392
|
id: string;
|
|
50
393
|
checkoutId: string;
|
|
51
394
|
object: "checkout_session";
|
|
52
395
|
mode: PayclaveMode;
|
|
396
|
+
sourceType?: PayclaveSourceType;
|
|
53
397
|
status: "pending";
|
|
398
|
+
collectionState: PayclaveInvoiceCollectionState;
|
|
54
399
|
invoiceId: string;
|
|
55
400
|
invoiceNumber: string;
|
|
56
401
|
amountDue: string;
|
|
402
|
+
amountReceived: string;
|
|
403
|
+
total: string;
|
|
404
|
+
customerAmountPaid: string;
|
|
405
|
+
customerAmountRemaining: string;
|
|
57
406
|
currencyCode: string;
|
|
58
407
|
chainId: number;
|
|
59
408
|
tokenSymbol: string;
|
|
@@ -71,9 +420,21 @@ type PayclaveCheckoutSession = {
|
|
|
71
420
|
checkoutId: string;
|
|
72
421
|
object: "checkout_session";
|
|
73
422
|
mode: PayclaveMode;
|
|
423
|
+
sourceType?: PayclaveSourceType;
|
|
74
424
|
status: PayclaveInvoiceStatus;
|
|
425
|
+
collectionState: PayclaveInvoiceCollectionState;
|
|
75
426
|
invoiceId: string | null;
|
|
76
427
|
invoiceNumber: string | null;
|
|
428
|
+
amountDue: string;
|
|
429
|
+
amountReceived: string;
|
|
430
|
+
total: string;
|
|
431
|
+
customerAmountPaid: string;
|
|
432
|
+
customerAmountRemaining: string;
|
|
433
|
+
currencyCode: string;
|
|
434
|
+
chainId: number;
|
|
435
|
+
tokenSymbol: string;
|
|
436
|
+
tokenContract: string;
|
|
437
|
+
settlementWalletAddress: string;
|
|
77
438
|
externalReference: string | null;
|
|
78
439
|
customerEmail: string | null;
|
|
79
440
|
metadata: PayclaveMetadata;
|
|
@@ -81,25 +442,222 @@ type PayclaveCheckoutSession = {
|
|
|
81
442
|
expiresAt: string;
|
|
82
443
|
completedAt: string | null;
|
|
83
444
|
createdAt: string;
|
|
445
|
+
/**
|
|
446
|
+
* Present on secret-key reads only: the merchant-absorbed platform fee and the
|
|
447
|
+
* net settlement (`amountDue` minus `platformFee`) the merchant receives.
|
|
448
|
+
*/
|
|
449
|
+
platformFee?: string;
|
|
450
|
+
netAmount?: string;
|
|
451
|
+
expectedMerchantSettlement?: string;
|
|
452
|
+
merchantAmountSettled?: string;
|
|
453
|
+
overpaymentAmount?: string;
|
|
454
|
+
/** Present once a payment has been detected for the session. */
|
|
455
|
+
paymentId?: string;
|
|
456
|
+
paymentStatus?: PayclavePaymentStatus;
|
|
457
|
+
txHash?: string;
|
|
458
|
+
sourceTxHash?: string;
|
|
459
|
+
settlementTxHash?: string;
|
|
460
|
+
} & PayclavePaymentSource;
|
|
461
|
+
/**
|
|
462
|
+
* The network and token the customer paid with, which can differ from the
|
|
463
|
+
* settlement token (`currencyCode`/`chainId`) when the payment was routed
|
|
464
|
+
* across chains. Each field is present only when the provider reported it.
|
|
465
|
+
*/
|
|
466
|
+
type PayclavePaymentSource = {
|
|
467
|
+
/** Lowercase network slug, e.g. "base", "polygon", "tron", "solana". */
|
|
468
|
+
sourceNetwork?: string;
|
|
469
|
+
/** EVM chain id of the source network; absent for non-EVM networks. */
|
|
470
|
+
sourceChainId?: number;
|
|
471
|
+
/** Symbol of the token the customer paid with, e.g. "USDC". */
|
|
472
|
+
sourceTokenSymbol?: string;
|
|
473
|
+
sourceTokenAddress?: string;
|
|
474
|
+
sourceTokenLogoUrl?: string;
|
|
84
475
|
};
|
|
85
476
|
type PayclaveInvoice = {
|
|
86
477
|
id: string;
|
|
87
|
-
invoiceNumber: string;
|
|
478
|
+
invoiceNumber: string | null;
|
|
88
479
|
object: "invoice";
|
|
89
480
|
mode: PayclaveMode;
|
|
90
481
|
status: PayclaveInvoiceStatus;
|
|
482
|
+
collectionState: PayclaveInvoiceCollectionState;
|
|
483
|
+
subtotal: string;
|
|
484
|
+
discountTotal: string;
|
|
485
|
+
taxTotal: string;
|
|
486
|
+
total: string;
|
|
487
|
+
customerAmountPaid: string;
|
|
488
|
+
customerAmountRemaining: string;
|
|
489
|
+
expectedMerchantSettlement: string;
|
|
490
|
+
merchantAmountSettled: string;
|
|
491
|
+
overpaymentAmount: string;
|
|
492
|
+
migrationState: PayclaveMigrationState;
|
|
91
493
|
amountDue: string;
|
|
92
494
|
amountReceived: string;
|
|
495
|
+
platformFee: string;
|
|
496
|
+
netAmount: string;
|
|
93
497
|
currencyCode: string;
|
|
94
498
|
chainId: number;
|
|
95
499
|
tokenContract: string;
|
|
96
500
|
settlementWalletAddress: string;
|
|
97
501
|
externalReference: string | null;
|
|
98
502
|
metadata: PayclaveMetadata;
|
|
99
|
-
expiresAt: string;
|
|
503
|
+
expiresAt: string | null;
|
|
100
504
|
paidAt: string | null;
|
|
101
505
|
cancelledAt: string | null;
|
|
506
|
+
voidedAt?: string | null;
|
|
507
|
+
uncollectibleAt?: string | null;
|
|
102
508
|
createdAt: string;
|
|
509
|
+
internalId?: string;
|
|
510
|
+
sourceType?: PayclaveSourceType;
|
|
511
|
+
version?: number;
|
|
512
|
+
calculationVersion?: string;
|
|
513
|
+
sellerSnapshot?: {
|
|
514
|
+
displayName: string;
|
|
515
|
+
businessEmail?: string | null;
|
|
516
|
+
address?: string | null;
|
|
517
|
+
taxIdentifier?: string | null;
|
|
518
|
+
} | null;
|
|
519
|
+
customer?: PayclaveInvoiceCustomer;
|
|
520
|
+
lines?: Array<PayclaveInvoiceLineInput & {
|
|
521
|
+
lineTotal: string;
|
|
522
|
+
}>;
|
|
523
|
+
discount?: PayclaveInvoiceDiscountInput | null;
|
|
524
|
+
taxes?: PayclaveInvoiceTaxInput[];
|
|
525
|
+
paymentTerms?: string;
|
|
526
|
+
memo?: string;
|
|
527
|
+
footer?: string;
|
|
528
|
+
purchaseOrderNumber?: string;
|
|
529
|
+
dueAt?: string | null;
|
|
530
|
+
issuedAt?: string | null;
|
|
531
|
+
publicToken?: string | null;
|
|
532
|
+
hostedInvoiceEnabled?: boolean;
|
|
533
|
+
hostedInvoiceUrl?: string | null;
|
|
534
|
+
checkoutSessions?: PayclaveInvoiceCheckoutSession[];
|
|
535
|
+
payments?: PayclaveInvoicePayment[];
|
|
536
|
+
adjustments?: PayclavePaymentAdjustment[];
|
|
537
|
+
deliveries?: PayclaveInvoiceDelivery[];
|
|
538
|
+
activity?: PayclaveInvoiceActivityEvent[];
|
|
539
|
+
reminderSchedule?: PayclaveInvoiceReminderSchedule;
|
|
540
|
+
remindersPausedAt?: string | null;
|
|
541
|
+
lastReminderAt?: string | null;
|
|
542
|
+
nextReminderAt?: string | null;
|
|
543
|
+
lastSentAt?: string | null;
|
|
544
|
+
updatedAt?: string;
|
|
545
|
+
lastActivityAt?: string | null;
|
|
546
|
+
};
|
|
547
|
+
type PayclaveInvoiceCheckoutSession = {
|
|
548
|
+
id: string;
|
|
549
|
+
checkoutId: string;
|
|
550
|
+
status: string;
|
|
551
|
+
sourceType?: PayclaveSourceType;
|
|
552
|
+
amountDue: string;
|
|
553
|
+
checkoutUrl: string;
|
|
554
|
+
expiresAt: string;
|
|
555
|
+
completedAt: string | null;
|
|
556
|
+
createdAt: string;
|
|
557
|
+
};
|
|
558
|
+
type PayclaveInvoicePayment = {
|
|
559
|
+
id: string;
|
|
560
|
+
invoiceId: string;
|
|
561
|
+
checkoutSessionId?: string;
|
|
562
|
+
transactionId: string | null;
|
|
563
|
+
sourceTransactionId: string | null;
|
|
564
|
+
settlementTransactionId: string | null;
|
|
565
|
+
mode: PayclaveMode;
|
|
566
|
+
status: PayclavePaymentStatus;
|
|
567
|
+
amountExpected: string;
|
|
568
|
+
amountReceived: string;
|
|
569
|
+
customerAmountTendered?: string;
|
|
570
|
+
customerAmountCredited?: string;
|
|
571
|
+
expectedMerchantSettlement?: string;
|
|
572
|
+
merchantAmountSettled?: string;
|
|
573
|
+
platformFeeExpected?: string;
|
|
574
|
+
platformFeeCollected?: string;
|
|
575
|
+
platformFee: string;
|
|
576
|
+
netAmount: string;
|
|
577
|
+
chainId: number;
|
|
578
|
+
settlementWalletAddress: string;
|
|
579
|
+
failureReason: string | null;
|
|
580
|
+
confirmedAt: string | null;
|
|
581
|
+
createdAt: string;
|
|
582
|
+
};
|
|
583
|
+
type PayclavePaymentAdjustment = {
|
|
584
|
+
id: string;
|
|
585
|
+
merchantId: string;
|
|
586
|
+
mode: PayclaveMode;
|
|
587
|
+
invoiceId: string;
|
|
588
|
+
paymentId?: string;
|
|
589
|
+
type: "refund_reference" | "write_off" | "correction" | (string & {});
|
|
590
|
+
amount: string;
|
|
591
|
+
reason: string;
|
|
592
|
+
externalTransactionHash?: string;
|
|
593
|
+
chainId?: number;
|
|
594
|
+
tokenContract?: string;
|
|
595
|
+
createdByType: string;
|
|
596
|
+
createdById: string;
|
|
597
|
+
createdAt: string;
|
|
598
|
+
};
|
|
599
|
+
type PayclaveInvoiceCheckoutSessionCreated = {
|
|
600
|
+
invoiceId: string;
|
|
601
|
+
invoiceNumber: string;
|
|
602
|
+
checkoutSessionId: string;
|
|
603
|
+
checkoutUrl: string;
|
|
604
|
+
amountDue: string;
|
|
605
|
+
currencyCode: string;
|
|
606
|
+
expiresAt: string;
|
|
607
|
+
};
|
|
608
|
+
type PayclaveRefundReferenceResult = {
|
|
609
|
+
adjustment: PayclavePaymentAdjustment;
|
|
610
|
+
invoice: PayclaveInvoice;
|
|
611
|
+
};
|
|
612
|
+
type PayclaveInvoiceList = {
|
|
613
|
+
items: PayclaveInvoice[];
|
|
614
|
+
hasMore: boolean;
|
|
615
|
+
nextCursor: string | null;
|
|
616
|
+
};
|
|
617
|
+
type PayclavePaymentLink = {
|
|
618
|
+
id: string;
|
|
619
|
+
object: "payment_link";
|
|
620
|
+
publicId: string;
|
|
621
|
+
url: string;
|
|
622
|
+
merchantId: string;
|
|
623
|
+
mode: PayclaveMode;
|
|
624
|
+
status: PayclavePaymentLinkStatus;
|
|
625
|
+
version: number;
|
|
626
|
+
title: string;
|
|
627
|
+
description: string;
|
|
628
|
+
amountType: PayclavePaymentLinkAmountType;
|
|
629
|
+
amount: string | null;
|
|
630
|
+
minimumAmount: string | null;
|
|
631
|
+
maximumAmount: string | null;
|
|
632
|
+
currencyCode: string;
|
|
633
|
+
chainId: number;
|
|
634
|
+
tokenContract: string;
|
|
635
|
+
usageType: PayclavePaymentLinkUsageType;
|
|
636
|
+
completedPayments: number;
|
|
637
|
+
startedCheckouts: number;
|
|
638
|
+
activeAt: string | null;
|
|
639
|
+
expiresAt: string | null;
|
|
640
|
+
pausedAt: string | null;
|
|
641
|
+
archivedAt: string | null;
|
|
642
|
+
collect: PayclavePaymentLinkCollect;
|
|
643
|
+
referencePrefix: string;
|
|
644
|
+
successUrl: string | null;
|
|
645
|
+
cancelUrl: string | null;
|
|
646
|
+
successMessage: string;
|
|
647
|
+
metadata: PayclaveMetadata;
|
|
648
|
+
reservationInvoiceId: string | null;
|
|
649
|
+
reservedAt: string | null;
|
|
650
|
+
createdAt: string;
|
|
651
|
+
updatedAt: string;
|
|
652
|
+
lastCheckoutCreatedAt: string | null;
|
|
653
|
+
};
|
|
654
|
+
type PayclavePaymentLinkList = {
|
|
655
|
+
items: PayclavePaymentLink[];
|
|
656
|
+
hasMore: boolean;
|
|
657
|
+
nextCursor: string | null;
|
|
658
|
+
};
|
|
659
|
+
type PayclavePaymentLinkPayments = {
|
|
660
|
+
items: PayclaveInvoice[];
|
|
103
661
|
};
|
|
104
662
|
type PayclavePayment = {
|
|
105
663
|
id: string;
|
|
@@ -111,12 +669,24 @@ type PayclavePayment = {
|
|
|
111
669
|
status: PayclavePaymentStatus;
|
|
112
670
|
amountExpected: string;
|
|
113
671
|
amountReceived: string;
|
|
672
|
+
customerAmountTendered: string;
|
|
673
|
+
customerAmountCredited: string;
|
|
674
|
+
expectedMerchantSettlement: string;
|
|
675
|
+
merchantAmountSettled: string;
|
|
676
|
+
platformFeeExpected: string;
|
|
677
|
+
platformFeeCollected: string;
|
|
678
|
+
payerWalletAddress: string;
|
|
679
|
+
payerWalletEvidence: string;
|
|
680
|
+
creditEvidenceType: string;
|
|
681
|
+
migrationState: PayclaveMigrationState;
|
|
682
|
+
platformFee: string;
|
|
683
|
+
netAmount: string;
|
|
114
684
|
chainId: number;
|
|
115
685
|
settlementWalletAddress: string;
|
|
116
686
|
failureReason: string | null;
|
|
117
687
|
confirmedAt: string | null;
|
|
118
688
|
createdAt: string;
|
|
119
|
-
};
|
|
689
|
+
} & PayclavePaymentSource;
|
|
120
690
|
type PayclaveWebhookEndpoint = {
|
|
121
691
|
id: string;
|
|
122
692
|
object: "webhook_endpoint";
|
|
@@ -124,19 +694,74 @@ type PayclaveWebhookEndpoint = {
|
|
|
124
694
|
url: string;
|
|
125
695
|
enabled: boolean;
|
|
126
696
|
eventTypes: PayclaveWebhookEventType[];
|
|
127
|
-
signingSecret
|
|
697
|
+
signingSecret?: string;
|
|
698
|
+
copyRequired?: boolean;
|
|
699
|
+
currentSecretVersion: number;
|
|
700
|
+
secretVersions: PayclaveWebhookSecretVersion[];
|
|
701
|
+
secretOverlap: {
|
|
702
|
+
status: "none" | "active" | (string & {});
|
|
703
|
+
expiresAt: string | null;
|
|
704
|
+
previousVersion: number | null;
|
|
705
|
+
};
|
|
128
706
|
createdAt: string;
|
|
707
|
+
updatedAt: string;
|
|
708
|
+
};
|
|
709
|
+
type PayclaveWebhookSecretVersion = {
|
|
710
|
+
version: number;
|
|
711
|
+
createdAt: string;
|
|
712
|
+
activatesAt: string;
|
|
713
|
+
expiresAt: string | null;
|
|
714
|
+
revokedAt: string | null;
|
|
715
|
+
testedAt: string | null;
|
|
716
|
+
};
|
|
717
|
+
type PayclaveWebhookIncident = {
|
|
718
|
+
id: string;
|
|
719
|
+
object: "webhook_incident";
|
|
720
|
+
endpointId: string;
|
|
721
|
+
mode: PayclaveMode;
|
|
722
|
+
status: "open" | "resolved" | (string & {});
|
|
723
|
+
reasonFamily: string;
|
|
724
|
+
failureCount: number;
|
|
725
|
+
affectedDeliveryCount: number;
|
|
726
|
+
affectedDeliveryIds: string[];
|
|
727
|
+
firstFailedAt: string;
|
|
728
|
+
lastFailedAt: string;
|
|
729
|
+
openedAt: string;
|
|
730
|
+
resolvedAt: string | null;
|
|
731
|
+
lastDeliveryId: string;
|
|
732
|
+
lastAttemptId: string;
|
|
733
|
+
createdAt: string;
|
|
734
|
+
updatedAt: string;
|
|
129
735
|
};
|
|
130
736
|
type PayclaveWebhookDeliveryAttemptSummary = {
|
|
131
737
|
responseStatusCode: number | null;
|
|
132
738
|
errorMessage: string | null;
|
|
739
|
+
errorCategory?: string | null;
|
|
740
|
+
attemptedAt: string;
|
|
741
|
+
};
|
|
742
|
+
type PayclaveWebhookDeliveryAttempt = {
|
|
743
|
+
id: string;
|
|
744
|
+
attemptNumber: number;
|
|
745
|
+
responseStatusCode: number | null;
|
|
746
|
+
responseBody: string | null;
|
|
747
|
+
responseBodyTruncated: boolean;
|
|
748
|
+
errorMessage: string | null;
|
|
749
|
+
errorCategory?: string | null;
|
|
750
|
+
responseHeaders?: Record<string, string> | null;
|
|
751
|
+
requestHeaders?: Record<string, string> | null;
|
|
752
|
+
destinationHost?: string;
|
|
753
|
+
sanitizedAt?: string;
|
|
133
754
|
attemptedAt: string;
|
|
755
|
+
startedAt: string;
|
|
756
|
+
completedAt: string;
|
|
757
|
+
durationMs: number;
|
|
134
758
|
};
|
|
135
759
|
type PayclaveWebhookDelivery = {
|
|
136
760
|
id: string;
|
|
137
761
|
object: "webhook_delivery";
|
|
138
762
|
endpointId: string;
|
|
139
763
|
invoiceId: string | null;
|
|
764
|
+
eventId: string;
|
|
140
765
|
eventType: PayclaveWebhookEventType | (string & {});
|
|
141
766
|
status: PayclaveWebhookDeliveryStatus;
|
|
142
767
|
idempotencyKey: string;
|
|
@@ -145,6 +770,12 @@ type PayclaveWebhookDelivery = {
|
|
|
145
770
|
deliveredAt: string | null;
|
|
146
771
|
attemptCount: number;
|
|
147
772
|
latestAttempt: PayclaveWebhookDeliveryAttemptSummary | null;
|
|
773
|
+
latestErrorCategory?: string | null;
|
|
774
|
+
replayOfDeliveryId: string | null;
|
|
775
|
+
replayRootDeliveryId: string | null;
|
|
776
|
+
replayedBy: string | null;
|
|
777
|
+
replayedAt: string | null;
|
|
778
|
+
attempts?: PayclaveWebhookDeliveryAttempt[];
|
|
148
779
|
createdAt: string;
|
|
149
780
|
};
|
|
150
781
|
type PayclaveWebhookData = Record<string, unknown>;
|
|
@@ -156,7 +787,7 @@ type PayclaveWebhookEvent<TData = PayclaveWebhookData> = {
|
|
|
156
787
|
createdAt: string;
|
|
157
788
|
data: TData;
|
|
158
789
|
};
|
|
159
|
-
declare const PAYCLAVE_API_ERROR_CODES: readonly ["API_KEY_FORBIDDEN", "API_KEY_REQUIRED", "AUTH_FORBIDDEN", "AUTH_REQUIRED", "DEFAULT_WALLET_REQUIRED", "INTERNAL_JOB_UNAUTHORIZED", "INTERNAL_SERVER_ERROR", "INVALID_AMOUNT", "INVALID_API_KEY", "INVALID_EXPIRY", "INVALID_IDEMPOTENCY_KEY", "INVALID_DEPOSIT_NETWORK", "INVALID_WALLET_PAYMENT_ATTEMPT", "INVALID_TX_HASH", "INVALID_WALLET_ADDRESS", "NOT_FOUND", "RATE_LIMIT_EXCEEDED", "REQUEST_ERROR", "SCAN_OR_COPY_UNAVAILABLE", "WALLET_PAYMENTS_UNAVAILABLE", "UNSUPPORTED_DEFAULT_WALLET", "VALIDATION_ERROR", "WEBHOOK_DELIVERY_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_EVENT_UNSUPPORTED", "WEBHOOK_SIGNATURE_INVALID", "CHECKOUT_SESSION_NOT_PAYABLE", "INVOICE_NOT_FOUND", "INVOICE_STATE_MISMATCH", "INVOICE_TRANSITION_GUARD_FAILED", "IDEMPOTENCY_KEY_CONFLICT"];
|
|
790
|
+
declare const PAYCLAVE_API_ERROR_CODES: readonly ["ACCOUNT_SUSPENDED", "ACTIVE_MERCHANT_REQUIRED", "API_KEY_FORBIDDEN", "API_KEY_REQUIRED", "AUTH_FORBIDDEN", "GOOGLE_ACCOUNT_CONFLICT", "GOOGLE_AUTH_CANCELLED", "GOOGLE_AUTH_CODE_MISSING", "GOOGLE_EMAIL_UNVERIFIED", "GOOGLE_AUTH_EXCHANGE_FAILED", "GOOGLE_AUTH_FAILED", "GOOGLE_PROFILE_UNAVAILABLE", "GOOGLE_AUTH_STATE_INVALID", "AUTH_PASSWORD_ALREADY_SET", "AUTH_PROXY_UNAUTHORIZED", "AUTH_PROVIDER_UNAVAILABLE", "AUTH_REQUIRED", "USE_SOCIAL_LOGIN", "AUTH_VERIFIED_EMAIL_REQUIRED", "DEFAULT_WALLET_REQUIRED", "INTERNAL_JOB_UNAUTHORIZED", "INTERNAL_SERVER_ERROR", "INVALID_AMOUNT", "INVALID_API_KEY", "INVALID_CREDENTIALS", "INVALID_EXPIRY", "INVALID_IDEMPOTENCY_KEY", "INVALID_DEPOSIT_NETWORK", "INVALID_WALLET_PAYMENT_ATTEMPT", "INVALID_TX_HASH", "INVALID_WALLET_ADDRESS", "MODE_MISMATCH", "MEMBERSHIP_REVOKED", "MEMBER_ALREADY_EXISTS", "MEMBER_LIMIT_REACHED", "LAST_OWNER_REQUIRED", "INVITATION_ALREADY_PENDING", "INVITATION_ALREADY_USED", "INVITATION_EMAIL_MISMATCH", "INVITATION_EXPIRED", "INVITATION_NOT_FOUND", "OWNERSHIP_TRANSFER_REQUIRED", "NOT_FOUND", "PUBLIC_KEY_FIELD_NOT_ALLOWED", "PERMISSION_DENIED", "RATE_LIMIT_EXCEEDED", "REAUTH_REQUIRED", "STEP_UP_REQUIRED", "REQUEST_ERROR", "REQUEST_TOO_LARGE", "SCAN_OR_COPY_UNAVAILABLE", "WALLET_PAYMENTS_UNAVAILABLE", "UNSUPPORTED_DEFAULT_WALLET", "VALIDATION_ERROR", "WEBHOOK_DELIVERY_NOT_FOUND", "WEBHOOK_ENDPOINT_DISABLED", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_EVENT_UNSUPPORTED", "WEBHOOK_INCIDENT_NOT_FOUND", "WEBHOOK_SIGNATURE_INVALID", "SECRET_OVERLAP_ACTIVE", "SECRET_OVERLAP_EXPIRED", "CHECKOUT_SESSION_NOT_PAYABLE", "EVENT_TYPE_UNSUPPORTED", "EVENT_PAYLOAD_TOO_LARGE", "JOURNEY_TOKEN_INVALID", "EVENT_DUPLICATE", "TIMESTAMP_OUT_OF_RANGE", "INVOICE_NOT_FOUND", "INVOICE_STATE_MISMATCH", "INVOICE_TRANSITION_GUARD_FAILED", "INVOICE_NOT_EDITABLE", "INVOICE_ALREADY_ISSUED", "INVOICE_NOT_PAYABLE", "INVOICE_PDF_UNAVAILABLE", "INVOICE_VERSION_CONFLICT", "CURRENCY_MISMATCH", "INVALID_TOTAL", "CUSTOMER_EMAIL_REQUIRED", "IDEMPOTENCY_KEY_CONFLICT", "PAYMENT_LINK_NOT_FOUND", "PAYMENT_LINK_VERSION_CONFLICT", "LINK_INACTIVE", "LINK_EXPIRED", "LINK_ALREADY_USED", "LINK_RESERVED", "AMOUNT_OUT_OF_RANGE", "FIELD_REQUIRED", "FEATURE_UNAVAILABLE", "MODE_UNAVAILABLE", "CONFIG_CHANGED", "RATE_LIMITED", "EXPORT_RANGE_TOO_LARGE", "EXPORT_NOT_READY", "EXPORT_EXPIRED", "EXPORT_CANCELLED", "EXPORT_SCHEMA_UNSUPPORTED", "EXPORT_TOO_LARGE_FOR_SYNC"];
|
|
160
791
|
type PayclaveApiErrorCode = (typeof PAYCLAVE_API_ERROR_CODES)[number];
|
|
161
792
|
declare const PAYCLAVE_SERVER_SDK_ERROR_CODES: readonly ["INVALID_SECRET_KEY", "INVALID_API_BASE_URL", "INVALID_TIMEOUT", "INVALID_ID", "INVALID_AMOUNT", "INVALID_EXPIRY", "INVALID_METADATA", "INVALID_IDEMPOTENCY_KEY", "INVALID_LIMIT", "INVALID_WEBHOOK_URL", "INVALID_REQUEST_BODY", "INVALID_RESPONSE", "NETWORK_ERROR", "TIMEOUT", "ABORTED"];
|
|
162
793
|
type PayclaveServerSdkErrorCode = (typeof PAYCLAVE_SERVER_SDK_ERROR_CODES)[number];
|
|
@@ -193,7 +824,7 @@ declare class PayclaveError extends Error {
|
|
|
193
824
|
};
|
|
194
825
|
}
|
|
195
826
|
declare const PAYCLAVE_SERVER_SDK_NAME = "payclave-sdk-server";
|
|
196
|
-
declare const PAYCLAVE_SERVER_SDK_VERSION = "0.
|
|
827
|
+
declare const PAYCLAVE_SERVER_SDK_VERSION = "0.2.0";
|
|
197
828
|
declare function assertPayclaveWebhookSignature({ payload, signature, secret, toleranceSeconds, now, }: VerifyWebhookSignatureInput): void;
|
|
198
829
|
declare function verifyPayclaveWebhookSignature(input: VerifyWebhookSignatureInput): boolean;
|
|
199
830
|
declare function constructPayclaveWebhookEvent<TData extends PayclaveWebhookData = PayclaveWebhookData>(input: VerifyWebhookSignatureInput): PayclaveWebhookEvent<TData>;
|
|
@@ -201,12 +832,57 @@ declare function createPayclaveServerClient({ secretKey, apiBaseUrl, fetcher, ti
|
|
|
201
832
|
createCheckoutSession: (input: CreateCheckoutSessionInput) => Promise<PayclaveCreatedCheckoutSession>;
|
|
202
833
|
getCheckoutSession: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveCheckoutSession>;
|
|
203
834
|
createInvoice: (input: CreateInvoiceInput) => Promise<PayclaveInvoice>;
|
|
835
|
+
createInvoiceDraft: (input: CreateInvoiceDraftInput) => Promise<PayclaveInvoice>;
|
|
836
|
+
listInvoices: (input?: ListInvoicesInput) => Promise<PayclaveInvoiceList>;
|
|
204
837
|
getInvoice: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveInvoice>;
|
|
838
|
+
downloadInvoicePDF: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveInvoicePDF>;
|
|
839
|
+
updateInvoiceDraft: (id: string, input: UpdateInvoiceDraftInput) => Promise<PayclaveInvoice>;
|
|
840
|
+
issueInvoice: (id: string, input: IssueInvoiceInput) => Promise<PayclaveInvoice>;
|
|
841
|
+
sendInvoice: (id: string, input?: CreateInvoiceCheckoutSessionInput) => Promise<PayclaveInvoice>;
|
|
842
|
+
remindInvoice: (id: string, input?: CreateInvoiceCheckoutSessionInput) => Promise<PayclaveInvoice>;
|
|
843
|
+
createInvoiceCheckoutSession: (id: string, input?: CreateInvoiceCheckoutSessionInput) => Promise<PayclaveInvoiceCheckoutSessionCreated>;
|
|
844
|
+
voidInvoice: (id: string, input?: InvoiceActionInput) => Promise<PayclaveInvoice>;
|
|
845
|
+
voidInvoiceRemaining: (id: string, input?: InvoiceActionInput) => Promise<PayclaveInvoice>;
|
|
846
|
+
markInvoiceUncollectible: (id: string, input?: InvoiceActionInput) => Promise<PayclaveInvoice>;
|
|
847
|
+
duplicateInvoice: (id: string, input?: CreateInvoiceCheckoutSessionInput) => Promise<PayclaveInvoice>;
|
|
848
|
+
recordInvoiceRefundReference: (id: string, input: RecordInvoiceRefundReferenceInput) => Promise<PayclaveRefundReferenceResult>;
|
|
849
|
+
createPaymentLink: (input: CreatePaymentLinkInput) => Promise<PayclavePaymentLink>;
|
|
850
|
+
listPaymentLinks: (input?: ListPaymentLinksInput) => Promise<PayclavePaymentLinkList>;
|
|
851
|
+
getPaymentLink: (id: string, options?: PayclaveRequestOptions) => Promise<PayclavePaymentLink>;
|
|
852
|
+
updatePaymentLink: (id: string, input: UpdatePaymentLinkInput) => Promise<PayclavePaymentLink>;
|
|
853
|
+
pausePaymentLink: (id: string, input?: PaymentLinkActionInput) => Promise<PayclavePaymentLink>;
|
|
854
|
+
resumePaymentLink: (id: string, input?: PaymentLinkActionInput) => Promise<PayclavePaymentLink>;
|
|
855
|
+
archivePaymentLink: (id: string, input?: PaymentLinkActionInput) => Promise<PayclavePaymentLink>;
|
|
856
|
+
duplicatePaymentLink: (id: string, input?: PaymentLinkActionInput) => Promise<PayclavePaymentLink>;
|
|
857
|
+
releasePaymentLinkReservation: (id: string, input: ReleasePaymentLinkReservationInput) => Promise<PayclavePaymentLink>;
|
|
858
|
+
listPaymentLinkPayments: (id: string, input?: ListPaymentLinkPaymentsInput) => Promise<PayclavePaymentLinkPayments>;
|
|
205
859
|
getPayment: (id: string, options?: PayclaveRequestOptions) => Promise<PayclavePayment>;
|
|
206
860
|
createWebhookEndpoint: (input: CreateWebhookEndpointInput) => Promise<PayclaveWebhookEndpoint>;
|
|
861
|
+
listWebhookEndpoints: (options?: PayclaveRequestOptions) => Promise<PayclaveWebhookEndpoint[]>;
|
|
862
|
+
getWebhookEndpoint: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveWebhookEndpoint>;
|
|
863
|
+
updateWebhookEndpoint: (id: string, input: UpdateWebhookEndpointInput) => Promise<PayclaveWebhookEndpoint>;
|
|
864
|
+
archiveWebhookEndpoint: (id: string, input: WebhookEndpointActionInput) => Promise<{
|
|
865
|
+
id: string;
|
|
866
|
+
object: "webhook_endpoint";
|
|
867
|
+
archived: true;
|
|
868
|
+
}>;
|
|
869
|
+
rotateWebhookSecret: (id: string, input: WebhookEndpointActionInput) => Promise<PayclaveWebhookEndpoint>;
|
|
870
|
+
endWebhookSecretOverlap: (id: string, input: WebhookEndpointActionInput) => Promise<PayclaveWebhookEndpoint>;
|
|
207
871
|
createTestWebhook: (input: CreateTestWebhookInput) => Promise<PayclaveWebhookDelivery>;
|
|
208
872
|
listWebhookDeliveries: (input?: ListWebhookDeliveriesInput) => Promise<PayclaveWebhookDelivery[]>;
|
|
873
|
+
getWebhookDelivery: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveWebhookDelivery>;
|
|
874
|
+
listWebhookDeliveryAttempts: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveWebhookDeliveryAttempt[]>;
|
|
875
|
+
replayWebhookDelivery: (id: string, input: ReplayWebhookDeliveryInput) => Promise<PayclaveWebhookDelivery>;
|
|
876
|
+
listWebhookIncidents: (input?: ListWebhookIncidentsInput) => Promise<PayclaveWebhookIncident[]>;
|
|
877
|
+
getWebhookIncident: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveWebhookIncident>;
|
|
878
|
+
getReconciliationSchema: (version?: string, options?: PayclaveRequestOptions) => Promise<PayclaveReconciliationSchema>;
|
|
879
|
+
getReconciliationSummary: (input: GetReconciliationSummaryInput) => Promise<PayclaveReconciliationSummary>;
|
|
880
|
+
createReconciliationExport: (input: CreateReconciliationExportInput) => Promise<PayclaveReconciliationExport>;
|
|
881
|
+
listReconciliationExports: (input?: ListReconciliationExportsInput) => Promise<PayclaveReconciliationExportList>;
|
|
882
|
+
getReconciliationExport: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveReconciliationExport>;
|
|
883
|
+
cancelReconciliationExport: (id: string, input?: ReconciliationExportActionInput) => Promise<PayclaveReconciliationExport>;
|
|
884
|
+
downloadReconciliationExport: (id: string, options?: PayclaveRequestOptions) => Promise<PayclaveReconciliationDownload>;
|
|
209
885
|
};
|
|
210
886
|
type PayclaveServerClient = ReturnType<typeof createPayclaveServerClient>;
|
|
211
887
|
|
|
212
|
-
export { type CreateCheckoutSessionInput, type CreateInvoiceInput, type CreateTestWebhookInput, type CreateWebhookEndpointInput, type ListWebhookDeliveriesInput, PAYCLAVE_API_ERROR_CODES, PAYCLAVE_SERVER_SDK_ERROR_CODES, PAYCLAVE_SERVER_SDK_NAME, PAYCLAVE_SERVER_SDK_VERSION, PAYCLAVE_WEBHOOK_EVENT_TYPES, PAYCLAVE_WEBHOOK_VERIFICATION_ERROR_CODES, type PayclaveApiErrorCode, type PayclaveCheckoutSession, type PayclaveCreatedCheckoutSession, PayclaveError, type PayclaveErrorCode, type PayclaveFetcher, type PayclaveInvoice, type PayclaveInvoiceStatus, type PayclaveMetadata, type PayclaveMode, type PayclavePayment, type PayclavePaymentStatus, type PayclaveRequestOptions, type PayclaveServerClient, type PayclaveServerClientOptions, type PayclaveServerSdkErrorCode, type PayclaveWebhookData, type PayclaveWebhookDelivery, type PayclaveWebhookDeliveryAttemptSummary, type PayclaveWebhookDeliveryStatus, type PayclaveWebhookEndpoint, type PayclaveWebhookEvent, type PayclaveWebhookEventType, type PayclaveWebhookVerificationErrorCode, type VerifyWebhookSignatureInput, assertPayclaveWebhookSignature, constructPayclaveWebhookEvent, createPayclaveServerClient, verifyPayclaveWebhookSignature };
|
|
888
|
+
export { type CreateCheckoutSessionInput, type CreateInvoiceCheckoutSessionInput, type CreateInvoiceDraftInput, type CreateInvoiceInput, type CreatePaymentLinkInput, type CreateReconciliationExportInput, type CreateTestWebhookInput, type CreateWebhookEndpointInput, type GetReconciliationSummaryInput, type InvoiceActionInput, type IssueInvoiceInput, type ListInvoicesInput, type ListPaymentLinkPaymentsInput, type ListPaymentLinksInput, type ListReconciliationExportsInput, type ListWebhookDeliveriesInput, type ListWebhookIncidentsInput, PAYCLAVE_API_ERROR_CODES, PAYCLAVE_RECONCILIATION_SCHEMA_VERSION, PAYCLAVE_SERVER_SDK_ERROR_CODES, PAYCLAVE_SERVER_SDK_NAME, PAYCLAVE_SERVER_SDK_VERSION, PAYCLAVE_WEBHOOK_EVENT_TYPES, PAYCLAVE_WEBHOOK_VERIFICATION_ERROR_CODES, type PayclaveApiErrorCode, type PayclaveCheckoutSession, type PayclaveCreatedCheckoutSession, PayclaveError, type PayclaveErrorCode, type PayclaveFetcher, type PayclaveInvoice, type PayclaveInvoiceActivityEvent, type PayclaveInvoiceCheckoutSession, type PayclaveInvoiceCheckoutSessionCreated, type PayclaveInvoiceCollectionState, type PayclaveInvoiceCustomer, type PayclaveInvoiceDelivery, type PayclaveInvoiceDiscountInput, type PayclaveInvoiceDraftFields, type PayclaveInvoiceLineInput, type PayclaveInvoiceList, type PayclaveInvoicePDF, type PayclaveInvoicePayment, type PayclaveInvoiceReminderSchedule, type PayclaveInvoiceStatus, type PayclaveInvoiceTaxInput, type PayclaveMetadata, type PayclaveMigrationState, type PayclaveMode, type PayclavePayment, type PayclavePaymentAdjustment, type PayclavePaymentLink, type PayclavePaymentLinkAmountType, type PayclavePaymentLinkCollect, type PayclavePaymentLinkFields, type PayclavePaymentLinkList, type PayclavePaymentLinkPayments, type PayclavePaymentLinkStatus, type PayclavePaymentLinkUsageType, type PayclavePaymentSource, type PayclavePaymentStatus, type PayclaveReconciliationDateBasis, type PayclaveReconciliationDownload, type PayclaveReconciliationExport, type PayclaveReconciliationExportList, type PayclaveReconciliationExportStatus, type PayclaveReconciliationFile, type PayclaveReconciliationFilters, type PayclaveReconciliationSchema, type PayclaveReconciliationSummary, type PayclaveReconciliationTokenSummary, type PayclaveRefundReferenceResult, type PayclaveRequestOptions, type PayclaveServerClient, type PayclaveServerClientOptions, type PayclaveServerSdkErrorCode, type PayclaveSourceType, type PayclaveWebhookData, type PayclaveWebhookDelivery, type PayclaveWebhookDeliveryAttempt, type PayclaveWebhookDeliveryAttemptSummary, type PayclaveWebhookDeliveryStatus, type PayclaveWebhookEndpoint, type PayclaveWebhookEvent, type PayclaveWebhookEventType, type PayclaveWebhookIncident, type PayclaveWebhookSecretVersion, type PayclaveWebhookVerificationErrorCode, type PaymentLinkActionInput, type ReconciliationExportActionInput, type RecordInvoiceRefundReferenceInput, type ReleasePaymentLinkReservationInput, type ReplayWebhookDeliveryInput, type UpdateInvoiceDraftInput, type UpdatePaymentLinkInput, type UpdateWebhookEndpointInput, type VerifyWebhookSignatureInput, type WebhookEndpointActionInput, assertPayclaveWebhookSignature, constructPayclaveWebhookEvent, createPayclaveServerClient, verifyPayclaveWebhookSignature };
|