pycer-sdk 0.0.0-stage → 1.0.3

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.
@@ -0,0 +1,688 @@
1
+ /**
2
+ * OwnPay Node.js SDK - Type Definitions
3
+ *
4
+ * Comprehensive type definitions for the OwnPay Payment Gateway API.
5
+ * All types are derived from the actual PHP API controllers.
6
+ */
7
+ /**
8
+ * Configuration options for the OwnPay client.
9
+ */
10
+ interface OwnPayConfig {
11
+ /** API key starting with 'op_' prefix */
12
+ apiKey?: string;
13
+ /** Endpoint environment. Defaults to PYCER_ENV, then the key prefix or production. */
14
+ environment?: 'sandbox' | 'production';
15
+ /** Pycer APISIX base URL. Overrides environment settings. */
16
+ baseUrl?: string;
17
+ /** Public OwnPay-branded browser checkout URL when the API uses a gateway. */
18
+ checkoutBaseUrl?: string;
19
+ /** Request timeout in milliseconds (default: 30000) */
20
+ timeout?: number;
21
+ /** Maximum number of retry attempts (default: 2) */
22
+ maxRetries?: number;
23
+ /** Custom headers to include in all requests */
24
+ headers?: Record<string, string>;
25
+ /** API version (default: 'v1') */
26
+ apiVersion?: string;
27
+ }
28
+ /**
29
+ * Request options that can be passed per-request.
30
+ */
31
+ interface RequestOptions {
32
+ /** Idempotency key for safe request retries */
33
+ idempotencyKey?: string;
34
+ /** Custom headers for this specific request */
35
+ headers?: Record<string, string>;
36
+ /** Request timeout override in milliseconds */
37
+ timeout?: number;
38
+ /** AbortSignal for request cancellation */
39
+ signal?: AbortSignal;
40
+ }
41
+ /**
42
+ * Standard success response from the OwnPay API.
43
+ */
44
+ interface ApiResponse<T = unknown> {
45
+ /** Always true for successful responses */
46
+ success: true;
47
+ /** Response data payload */
48
+ data: T;
49
+ /** Optional pagination or metadata */
50
+ meta?: PaginationMeta;
51
+ }
52
+ /**
53
+ * Standard error response from the OwnPay API.
54
+ */
55
+ interface ApiErrorResponse {
56
+ /** Always false for error responses */
57
+ success: false;
58
+ /** Human-readable error message */
59
+ error: string;
60
+ /** Structured error details */
61
+ errors: ApiErrorDetail[];
62
+ /** Unique request identifier for debugging */
63
+ request_id: string;
64
+ }
65
+ /**
66
+ * Individual error detail in an error response.
67
+ */
68
+ interface ApiErrorDetail {
69
+ /** Machine-readable error code */
70
+ code: string;
71
+ /** Human-readable error message */
72
+ message: string;
73
+ /** Optional field name that caused the error */
74
+ field?: string | null;
75
+ }
76
+ /**
77
+ * Pagination metadata for list endpoints.
78
+ */
79
+ interface PaginationMeta {
80
+ /** Current page number */
81
+ page: number;
82
+ /** Items per page */
83
+ per_page: number;
84
+ /** Total number of items */
85
+ total: number;
86
+ /** Total number of pages */
87
+ total_pages: number;
88
+ }
89
+ /**
90
+ * Parameters for creating a payment intent.
91
+ */
92
+ interface CreatePaymentParams {
93
+ /** Payment amount (positive number) */
94
+ amount: string | number;
95
+ /** 3-letter ISO currency code (e.g., 'BDT', 'USD') */
96
+ currency: string;
97
+ /** Webhook notification URL */
98
+ callback_url?: string;
99
+ /** Success redirect URL */
100
+ redirect_url?: string;
101
+ /** Cancel redirect URL */
102
+ cancel_url?: string;
103
+ /** Customer email address */
104
+ customer_email?: string;
105
+ /** Customer full name (max 150 characters) */
106
+ customer_name?: string;
107
+ /** Customer phone number (max 30 characters) */
108
+ customer_phone?: string;
109
+ /** Merchant reference identifier */
110
+ reference?: string;
111
+ /** Preferred payment gateway slug */
112
+ gateway?: string;
113
+ /** Custom key-value metadata */
114
+ metadata?: Record<string, unknown>;
115
+ }
116
+ /**
117
+ * Payment intent returned after creation.
118
+ */
119
+ interface PaymentIntent {
120
+ /** Unique payment identifier (UUID) */
121
+ payment_id: string;
122
+ /** Payment intent token for checkout */
123
+ token: string;
124
+ /** URL to redirect customer for payment */
125
+ checkout_url: string;
126
+ /** Current payment status */
127
+ status: PaymentStatus;
128
+ }
129
+ /**
130
+ * Detailed payment information.
131
+ */
132
+ interface Payment {
133
+ /** Transaction ID (null if no transaction yet) */
134
+ id: number | null;
135
+ /** OwnPay transaction reference (e.g., 'OP-XXXX') */
136
+ trx_id: string | null;
137
+ /** Gateway transaction ID */
138
+ gateway_trx_id: string | null;
139
+ /** Payment amount */
140
+ amount: string | null;
141
+ /** Currency code */
142
+ currency: string | null;
143
+ /** Processing fee */
144
+ fee: string;
145
+ /** Current status */
146
+ status: string | null;
147
+ /** Payment gateway used */
148
+ gateway: string | null;
149
+ /** Payment method */
150
+ method: string | null;
151
+ /** Merchant reference */
152
+ reference: string | null;
153
+ /** Creation timestamp */
154
+ created_at: string | null;
155
+ /** Completion timestamp */
156
+ completed_at: string | null;
157
+ /** Customer information (if available) */
158
+ customer?: CustomerSummary;
159
+ }
160
+ /**
161
+ * Customer summary attached to a payment.
162
+ */
163
+ interface CustomerSummary {
164
+ /** Customer name */
165
+ name: string | null;
166
+ /** Customer email */
167
+ email: string | null;
168
+ }
169
+ /**
170
+ * Possible payment statuses.
171
+ */
172
+ type PaymentStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled' | 'refunded';
173
+ /**
174
+ * Parameters for listing transactions.
175
+ */
176
+ interface ListTransactionsParams {
177
+ /** Page number (default: 1) */
178
+ page?: number;
179
+ /** Items per page (default: 25, max: 100) */
180
+ per_page?: number;
181
+ /** Filter by status */
182
+ status?: string;
183
+ /** Filter by gateway slug */
184
+ gateway?: string;
185
+ /** Filter from date (ISO format) */
186
+ from?: string;
187
+ /** Filter to date (ISO format) */
188
+ to?: string;
189
+ }
190
+ /**
191
+ * Transaction record.
192
+ */
193
+ interface Transaction {
194
+ /** Internal transaction ID */
195
+ id: number;
196
+ /** OwnPay transaction reference */
197
+ trx_id: string;
198
+ /** Gateway transaction ID */
199
+ gateway_trx_id: string | null;
200
+ /** Transaction amount */
201
+ amount: string;
202
+ /** Currency code */
203
+ currency: string;
204
+ /** Processing fee */
205
+ fee: string;
206
+ /** Net amount after fees */
207
+ net_amount: string | null;
208
+ /** Transaction status */
209
+ status: string;
210
+ /** Gateway slug */
211
+ gateway: string | null;
212
+ /** Payment method */
213
+ method: string | null;
214
+ /** Merchant reference */
215
+ reference: string | null;
216
+ /** Creation timestamp */
217
+ created_at: string;
218
+ /** Last update timestamp */
219
+ updated_at: string | null;
220
+ }
221
+ /**
222
+ * Parameters for creating a refund.
223
+ */
224
+ interface CreateRefundParams {
225
+ /** Transaction ID or OwnPay reference */
226
+ transaction_id?: string | number;
227
+ /** OwnPay transaction reference */
228
+ trx_id?: string | number;
229
+ /** Refund amount (partial refund if less than original) */
230
+ amount?: string | number;
231
+ /** Reason for refund */
232
+ reason?: string;
233
+ }
234
+ /**
235
+ * Parameters for listing refunds.
236
+ */
237
+ interface ListRefundsParams {
238
+ /** Page number (default: 1) */
239
+ page?: number;
240
+ /** Items per page (default: 25, max: 100) */
241
+ per_page?: number;
242
+ /** Filter by status */
243
+ status?: string;
244
+ /** Filter by transaction reference */
245
+ trx_id?: string;
246
+ /** Filter by transaction ID */
247
+ transaction_id?: string | number;
248
+ /** Filter from date (ISO format) */
249
+ from?: string;
250
+ /** Filter to date (ISO format) */
251
+ to?: string;
252
+ }
253
+ /**
254
+ * Refund record.
255
+ */
256
+ interface Refund {
257
+ /** Internal refund ID */
258
+ id: number | null;
259
+ /** Refund UUID */
260
+ uuid: string | null;
261
+ /** Associated transaction ID */
262
+ transaction_id: number | null;
263
+ /** OwnPay transaction reference */
264
+ trx_id: string | null;
265
+ /** Gateway transaction ID */
266
+ gateway_trx_id: string | null;
267
+ /** Refund amount */
268
+ amount: string | null;
269
+ /** Refund reason */
270
+ reason: string | null;
271
+ /** Refund status */
272
+ status: string | null;
273
+ /** Processing timestamp */
274
+ processed_at: string | null;
275
+ /** Creation timestamp */
276
+ created_at: string | null;
277
+ }
278
+ /**
279
+ * Parameters for creating a customer.
280
+ */
281
+ interface CreateCustomerParams {
282
+ /** Customer full name (required) */
283
+ name: string;
284
+ /** Customer email address */
285
+ email?: string;
286
+ /** Customer phone number */
287
+ phone?: string;
288
+ }
289
+ /**
290
+ * Parameters for listing customers.
291
+ */
292
+ interface ListCustomersParams {
293
+ /** Page number (default: 1) */
294
+ page?: number;
295
+ /** Items per page (default: 25, max: 100) */
296
+ per_page?: number;
297
+ }
298
+ /**
299
+ * Customer record.
300
+ */
301
+ interface Customer {
302
+ /** Internal customer ID */
303
+ id: number;
304
+ /** Customer UUID */
305
+ uuid: string;
306
+ /** Customer name */
307
+ name: string | null;
308
+ /** Customer email */
309
+ email: string | null;
310
+ /** Customer phone */
311
+ phone: string | null;
312
+ /** Masked email for display */
313
+ email_masked?: string | null;
314
+ /** Masked phone for display */
315
+ phone_masked?: string | null;
316
+ /** Creation timestamp */
317
+ created_at: string;
318
+ }
319
+ /**
320
+ * Parameters for generating an API key.
321
+ */
322
+ interface GenerateApiKeyParams {
323
+ /** Key name/label (default: 'Default') */
324
+ name?: string;
325
+ /** Key permission scopes (default: ['read', 'write']) */
326
+ scopes?: ApiKeyScope[];
327
+ }
328
+ /**
329
+ * API key permission scope.
330
+ */
331
+ type ApiKeyScope = 'read' | 'write' | 'admin';
332
+ /**
333
+ * API key metadata (without the actual key).
334
+ */
335
+ interface ApiKey {
336
+ /** Internal key ID */
337
+ id: number;
338
+ /** Key name/label */
339
+ name: string;
340
+ /** Key prefix for identification */
341
+ prefix: string | null;
342
+ /** Key status */
343
+ status: 'active' | 'revoked';
344
+ /** Last usage timestamp */
345
+ last_used: string | null;
346
+ /** Expiration timestamp */
347
+ expires_at: string | null;
348
+ /** Creation timestamp */
349
+ created_at: string;
350
+ }
351
+ /**
352
+ * API key generation response (includes the actual key).
353
+ */
354
+ interface GeneratedApiKey {
355
+ /** The actual API key (shown only once) */
356
+ key: string;
357
+ /** Key prefix for identification */
358
+ prefix: string | null;
359
+ /** Security warning */
360
+ warning: string;
361
+ }
362
+ /**
363
+ * Webhook test result.
364
+ */
365
+ interface WebhookTestResult {
366
+ /** HTTP status code from the webhook endpoint */
367
+ status_code: number | null;
368
+ /** Response time in milliseconds */
369
+ response_time_ms: number | null;
370
+ }
371
+ /**
372
+ * Webhook delivery record.
373
+ */
374
+ interface WebhookDelivery {
375
+ /** Delivery ID */
376
+ id: number;
377
+ /** Event name */
378
+ event: string;
379
+ /** Webhook URL */
380
+ url: string;
381
+ /** Delivery direction */
382
+ direction: 'outbound' | 'inbound';
383
+ /** HTTP status code */
384
+ status_code: number | null;
385
+ /** Response time in milliseconds */
386
+ response_time_ms: number | null;
387
+ /** Attempt number */
388
+ attempt: number;
389
+ /** Delivery status */
390
+ status: string;
391
+ /** Creation timestamp */
392
+ created_at: string;
393
+ }
394
+ /**
395
+ * Webhook event payload structure.
396
+ */
397
+ interface WebhookPayload {
398
+ /** Event type (e.g., 'payment.completed') */
399
+ event: string;
400
+ /** OwnPay transaction reference */
401
+ transaction_id: string;
402
+ /** Gateway transaction ID */
403
+ gateway_trx_id: string;
404
+ /** Transaction amount */
405
+ amount: string;
406
+ /** Currency code */
407
+ currency: string;
408
+ /** Processing fee */
409
+ fee: string;
410
+ /** Gateway slug */
411
+ gateway: string;
412
+ /** Gateway type */
413
+ gateway_type: string;
414
+ /** Transaction status */
415
+ status: string;
416
+ /** Customer information */
417
+ customer: {
418
+ /** Customer name */
419
+ name: string;
420
+ /** Customer email */
421
+ email: string;
422
+ /** Customer phone */
423
+ phone: string;
424
+ };
425
+ /** Custom metadata */
426
+ metadata: Record<string, unknown>;
427
+ /** Event timestamp (ISO format) */
428
+ timestamp: string;
429
+ }
430
+ /**
431
+ * Parameters for webhook signature verification.
432
+ */
433
+ interface WebhookVerificationParams {
434
+ /** Raw request body (string or Buffer) */
435
+ payload: string | Buffer;
436
+ /** Signature from X-OwnPay-Signature header */
437
+ signature: string;
438
+ /** Webhook secret key */
439
+ secret: string;
440
+ /** Optional: timestamp from X-OwnPay-Timestamp header for replay protection */
441
+ timestamp?: string | number;
442
+ /** Optional: maximum age in seconds for replay protection (default: 300) */
443
+ tolerance?: number;
444
+ }
445
+ /**
446
+ * System health check response.
447
+ */
448
+ interface HealthStatus {
449
+ /** Overall system status */
450
+ status: 'healthy' | 'degraded';
451
+ /** Application version */
452
+ version: string;
453
+ /** Database connection status */
454
+ db: 'connected' | 'error';
455
+ /** Mobile companion app status */
456
+ mobile: {
457
+ /** Whether any device is connected */
458
+ connected: boolean;
459
+ /** Number of active devices */
460
+ active_devices: number;
461
+ };
462
+ /** Number of active payment gateways */
463
+ gateways: number;
464
+ /** Total customer count */
465
+ customers: number;
466
+ /** Server timestamp (ISO format) */
467
+ time: string;
468
+ }
469
+ /**
470
+ * HTTP methods supported by the API.
471
+ */
472
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
473
+ /**
474
+ * Internal request configuration.
475
+ */
476
+ interface RequestConfig {
477
+ /** HTTP method */
478
+ method: HttpMethod;
479
+ /** Request path (relative to base URL) */
480
+ path: string;
481
+ /** Query parameters */
482
+ query?: Record<string, string | number | boolean | undefined>;
483
+ /** Request body (for POST/PUT/PATCH) */
484
+ body?: unknown;
485
+ /** Request options */
486
+ options?: RequestOptions;
487
+ }
488
+ /**
489
+ * Paginated list response.
490
+ */
491
+ interface PaginatedList<T> {
492
+ /** Array of items */
493
+ items: T[];
494
+ /** Pagination metadata */
495
+ meta: PaginationMeta;
496
+ }
497
+
498
+ /**
499
+ * OwnPay Node.js SDK - Error Classes
500
+ *
501
+ * Comprehensive error hierarchy for the OwnPay API.
502
+ * Each error class provides specific context for different failure scenarios.
503
+ */
504
+
505
+ /**
506
+ * Base error class for all OwnPay SDK errors.
507
+ * Provides common properties and methods for error handling.
508
+ */
509
+ declare class OwnPayError extends Error {
510
+ /** The error type identifier */
511
+ readonly type: string;
512
+ /** HTTP status code (if applicable) */
513
+ readonly status: number | undefined;
514
+ /** Unique request identifier for debugging */
515
+ readonly requestId: string | undefined;
516
+ /** Raw error response from the API */
517
+ readonly rawResponse: unknown;
518
+ constructor(message: string, type: string, status?: number, requestId?: string, rawResponse?: unknown);
519
+ /**
520
+ * Returns a JSON representation of the error for logging.
521
+ */
522
+ toJSON(): Record<string, unknown>;
523
+ }
524
+ /**
525
+ * Thrown when API authentication fails (401).
526
+ * Indicates an invalid, missing, or revoked API key.
527
+ */
528
+ declare class AuthenticationError extends OwnPayError {
529
+ constructor(message: string, requestId?: string, rawResponse?: unknown);
530
+ }
531
+ /**
532
+ * Thrown when the API key lacks required permissions (403).
533
+ * Indicates insufficient scope (e.g., read-only key attempting a write operation).
534
+ */
535
+ declare class PermissionError extends OwnPayError {
536
+ constructor(message: string, requestId?: string, rawResponse?: unknown);
537
+ }
538
+ /**
539
+ * Thrown when a requested resource is not found (404).
540
+ */
541
+ declare class NotFoundError extends OwnPayError {
542
+ /** The resource type that was not found */
543
+ readonly resource: string | undefined;
544
+ /** The identifier that was searched for */
545
+ readonly resourceId: string | undefined;
546
+ constructor(message: string, resource?: string, resourceId?: string, requestId?: string, rawResponse?: unknown);
547
+ }
548
+ /**
549
+ * Thrown when request validation fails (422).
550
+ * Contains structured error details for each invalid field.
551
+ */
552
+ declare class ValidationError extends OwnPayError {
553
+ /** Array of individual validation errors */
554
+ readonly errors: ApiErrorDetail[];
555
+ constructor(message: string, errors: ApiErrorDetail[], requestId?: string, rawResponse?: unknown);
556
+ /**
557
+ * Returns errors grouped by field name.
558
+ */
559
+ getFieldErrors(): Record<string, string[]>;
560
+ /**
561
+ * Returns the first error message for a specific field.
562
+ */
563
+ getFirstFieldError(field: string): string | undefined;
564
+ }
565
+ /**
566
+ * Thrown when the API rate limit is exceeded (429).
567
+ * Includes retry-after information when available.
568
+ */
569
+ declare class RateLimitError extends OwnPayError {
570
+ /** Seconds to wait before retrying */
571
+ readonly retryAfter: number | undefined;
572
+ constructor(message: string, retryAfter?: number, requestId?: string, rawResponse?: unknown);
573
+ }
574
+ /**
575
+ * Thrown when an idempotency key conflict occurs (409).
576
+ * Indicates a request with the same key is still processing.
577
+ */
578
+ declare class IdempotencyError extends OwnPayError {
579
+ constructor(message: string, requestId?: string, rawResponse?: unknown);
580
+ }
581
+ /**
582
+ * Thrown when the API returns a server error (500, 502, 503, 504).
583
+ */
584
+ declare class ApiError extends OwnPayError {
585
+ /** The error code from the API */
586
+ readonly errorCode: string | undefined;
587
+ constructor(message: string, errorCode?: string, status?: number, requestId?: string, rawResponse?: unknown);
588
+ }
589
+ /**
590
+ * Thrown when a network error occurs (connection failure, timeout, etc.).
591
+ */
592
+ declare class NetworkError extends OwnPayError {
593
+ /** The underlying cause */
594
+ readonly cause: Error | undefined;
595
+ constructor(message: string, cause?: Error);
596
+ }
597
+ /**
598
+ * Thrown when a request is aborted (via AbortSignal or timeout).
599
+ */
600
+ declare class AbortError extends OwnPayError {
601
+ constructor(message?: string);
602
+ }
603
+ /**
604
+ * Thrown when webhook signature verification fails.
605
+ */
606
+ declare class WebhookVerificationError extends OwnPayError {
607
+ constructor(message: string);
608
+ }
609
+
610
+ /**
611
+ * OwnPay Node.js SDK - Webhook Signature Verification
612
+ *
613
+ * Standalone utility for verifying OwnPay webhook signatures.
614
+ * Uses HMAC-SHA256 for cryptographic verification.
615
+ *
616
+ * @module ownpay/webhooks
617
+ */
618
+
619
+ /**
620
+ * Verifies an OwnPay webhook signature.
621
+ *
622
+ * This function verifies that the webhook payload was sent by OwnPay
623
+ * and has not been tampered with. It supports optional timestamp
624
+ * validation for legacy delivery diagnostics. The timestamp is outside the signature.
625
+ *
626
+ * @param params - Verification parameters
627
+ * @returns true if the signature is valid
628
+ * @throws {WebhookVerificationError} If the signature is invalid
629
+ *
630
+ * @example
631
+ * ```typescript
632
+ * import { verifyWebhookSignature } from 'pycer-sdk/webhooks';
633
+ *
634
+ * // In your webhook handler
635
+ * app.post('/webhook', (req, res) => {
636
+ * try {
637
+ * verifyWebhookSignature({
638
+ * payload: req.body,
639
+ * signature: req.headers['x-signature'],
640
+ * secret: process.env.OWNPAY_WEBHOOK_SECRET,
641
+ * timestamp: req.headers['x-timestamp'],
642
+ * });
643
+ *
644
+ * // Signature is valid, process the webhook
645
+ * const event = JSON.parse(req.body);
646
+ * handleWebhookEvent(event);
647
+ *
648
+ * res.status(200).json({ received: true });
649
+ * } catch (error) {
650
+ * res.status(400).json({ error: 'Invalid signature' });
651
+ * }
652
+ * });
653
+ * ```
654
+ */
655
+ declare function verifyWebhookSignature(params: WebhookVerificationParams): boolean;
656
+ /**
657
+ * Generates an HMAC-SHA256 signature for a payload.
658
+ *
659
+ * @param payload - The payload string to sign
660
+ * @param secret - The webhook secret key
661
+ * @returns Hex-encoded signature
662
+ *
663
+ * @example
664
+ * ```typescript
665
+ * import { generateSignature } from 'pycer-sdk/webhooks';
666
+ *
667
+ * const signature = generateSignature('{"event":"payment.completed"}', 'whsec_...');
668
+ * ```
669
+ */
670
+ declare function generateSignature(payload: string, secret: string): string;
671
+ /**
672
+ * Parses a webhook payload from a raw request body.
673
+ *
674
+ * @param body - Raw request body (string or Buffer)
675
+ * @returns Parsed webhook payload
676
+ * @throws {WebhookVerificationError} If the payload is invalid JSON
677
+ *
678
+ * @example
679
+ * ```typescript
680
+ * import { parseWebhookPayload } from 'pycer-sdk/webhooks';
681
+ *
682
+ * const payload = parseWebhookPayload(req.body);
683
+ * console.log(payload.event); // 'payment.completed'
684
+ * ```
685
+ */
686
+ declare function parseWebhookPayload<T = Record<string, unknown>>(body: string | Buffer): T;
687
+
688
+ export { type ApiKey as A, WebhookVerificationError as B, type CreateRefundParams as C, type WebhookVerificationParams as D, generateSignature as E, parseWebhookPayload as F, type GenerateApiKeyParams as G, type HealthStatus as H, IdempotencyError as I, verifyWebhookSignature as J, type ListTransactionsParams as L, NetworkError as N, type OwnPayConfig as O, type PaginatedList as P, type RequestConfig as R, type Transaction as T, ValidationError as V, type WebhookTestResult as W, type RequestOptions as a, type Refund as b, type ListRefundsParams as c, type CreateCustomerParams as d, type Customer as e, type ListCustomersParams as f, type GeneratedApiKey as g, type WebhookDelivery as h, type ApiResponse as i, AbortError as j, ApiError as k, type ApiErrorDetail as l, type ApiErrorResponse as m, type ApiKeyScope as n, AuthenticationError as o, type CreatePaymentParams as p, type CustomerSummary as q, NotFoundError as r, OwnPayError as s, type PaginationMeta as t, type Payment as u, type PaymentIntent as v, type PaymentStatus as w, PermissionError as x, RateLimitError as y, type WebhookPayload as z };