@voyantjs/checkout 0.24.1 → 0.24.2

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,1290 @@
1
+ import type { Module, ModuleContainer } from "@voyantjs/core";
2
+ import type { HonoModule } from "@voyantjs/hono/module";
3
+ import type { NotificationProvider } from "@voyantjs/notifications";
4
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
5
+ import { type CheckoutBankTransferDetails, type CheckoutPaymentStarter, type CheckoutPolicyOptions } from "./service.js";
6
+ type Env = {
7
+ Bindings: Record<string, unknown>;
8
+ Variables: {
9
+ container: ModuleContainer;
10
+ db: PostgresJsDatabase;
11
+ userId?: string;
12
+ };
13
+ };
14
+ export type CheckoutRoutesOptions = {
15
+ policy?: CheckoutPolicyOptions;
16
+ providers?: ReadonlyArray<NotificationProvider>;
17
+ resolveProviders?: (bindings: Record<string, unknown>) => ReadonlyArray<NotificationProvider>;
18
+ paymentStarters?: Record<string, CheckoutPaymentStarter>;
19
+ resolvePaymentStarters?: (bindings: Record<string, unknown>) => Record<string, CheckoutPaymentStarter>;
20
+ bankTransferDetails?: CheckoutBankTransferDetails | null;
21
+ resolveBankTransferDetails?: (bindings: Record<string, unknown>) => CheckoutBankTransferDetails | null;
22
+ };
23
+ export type CheckoutRouteRuntime = {
24
+ bindings: Record<string, unknown>;
25
+ providers: ReadonlyArray<NotificationProvider>;
26
+ paymentStarters: Record<string, CheckoutPaymentStarter>;
27
+ bankTransferDetails: CheckoutBankTransferDetails | null;
28
+ };
29
+ export declare const CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY = "providers.checkout.runtime";
30
+ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): import("hono/hono-base").HonoBase<Env, {
31
+ "/bookings/:bookingId/collection-plan": {
32
+ $post: {
33
+ input: {
34
+ param: {
35
+ bookingId: string;
36
+ };
37
+ };
38
+ output: {
39
+ error: string;
40
+ };
41
+ outputFormat: "json";
42
+ status: 404;
43
+ } | {
44
+ input: {
45
+ param: {
46
+ bookingId: string;
47
+ };
48
+ };
49
+ output: {
50
+ data: {
51
+ bookingId: string;
52
+ method: "card" | "bank_transfer";
53
+ stage: "initial" | "reminder" | "manual";
54
+ paymentSessionTarget: "schedule" | "invoice" | null;
55
+ documentType: "proforma" | "invoice" | null;
56
+ willCreateDefaultPaymentPlan: boolean;
57
+ selectedSchedule: {
58
+ id: string;
59
+ createdAt: string;
60
+ updatedAt: string;
61
+ status: "pending" | "expired" | "cancelled" | "paid" | "due" | "waived";
62
+ currency: string;
63
+ notes: string | null;
64
+ bookingId: string;
65
+ bookingItemId: string | null;
66
+ amountCents: number;
67
+ dueDate: string;
68
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
69
+ } | null;
70
+ selectedInvoice: {
71
+ id: string;
72
+ createdAt: string;
73
+ updatedAt: string;
74
+ organizationId: string | null;
75
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
76
+ issueDate: string;
77
+ currency: string;
78
+ notes: string | null;
79
+ bookingId: string;
80
+ personId: string | null;
81
+ baseCurrency: string | null;
82
+ fxRateSetId: string | null;
83
+ invoiceNumber: string;
84
+ invoiceType: "invoice" | "proforma" | "credit_note";
85
+ convertedFromInvoiceId: string | null;
86
+ seriesId: string | null;
87
+ sequence: number | null;
88
+ templateId: string | null;
89
+ taxRegimeId: string | null;
90
+ language: string | null;
91
+ subtotalCents: number;
92
+ baseSubtotalCents: number | null;
93
+ taxCents: number;
94
+ baseTaxCents: number | null;
95
+ totalCents: number;
96
+ baseTotalCents: number | null;
97
+ paidCents: number;
98
+ basePaidCents: number | null;
99
+ balanceDueCents: number;
100
+ baseBalanceDueCents: number | null;
101
+ commissionPercent: number | null;
102
+ commissionAmountCents: number | null;
103
+ dueDate: string;
104
+ } | null;
105
+ amountCents: number;
106
+ currency: string;
107
+ recommendedAction: "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session" | "none";
108
+ };
109
+ };
110
+ outputFormat: "json";
111
+ status: import("hono/utils/http-status").ContentfulStatusCode;
112
+ } | {
113
+ input: {
114
+ param: {
115
+ bookingId: string;
116
+ };
117
+ };
118
+ output: {
119
+ error: string;
120
+ };
121
+ outputFormat: "json";
122
+ status: 400;
123
+ };
124
+ };
125
+ } & {
126
+ "/bookings/:bookingId/initiate-collection": {
127
+ $post: {
128
+ input: {
129
+ param: {
130
+ bookingId: string;
131
+ };
132
+ };
133
+ output: {
134
+ error: string;
135
+ };
136
+ outputFormat: "json";
137
+ status: 404;
138
+ } | {
139
+ input: {
140
+ param: {
141
+ bookingId: string;
142
+ };
143
+ };
144
+ output: {
145
+ data: {
146
+ plan: {
147
+ bookingId: string;
148
+ method: "card" | "bank_transfer";
149
+ stage: "initial" | "reminder" | "manual";
150
+ paymentSessionTarget: "schedule" | "invoice" | null;
151
+ documentType: "proforma" | "invoice" | null;
152
+ willCreateDefaultPaymentPlan: boolean;
153
+ selectedSchedule: {
154
+ id: string;
155
+ createdAt: string;
156
+ updatedAt: string;
157
+ status: "pending" | "expired" | "cancelled" | "paid" | "due" | "waived";
158
+ currency: string;
159
+ notes: string | null;
160
+ bookingId: string;
161
+ bookingItemId: string | null;
162
+ amountCents: number;
163
+ dueDate: string;
164
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
165
+ } | null;
166
+ selectedInvoice: {
167
+ id: string;
168
+ createdAt: string;
169
+ updatedAt: string;
170
+ organizationId: string | null;
171
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
172
+ issueDate: string;
173
+ currency: string;
174
+ notes: string | null;
175
+ bookingId: string;
176
+ personId: string | null;
177
+ baseCurrency: string | null;
178
+ fxRateSetId: string | null;
179
+ invoiceNumber: string;
180
+ invoiceType: "invoice" | "proforma" | "credit_note";
181
+ convertedFromInvoiceId: string | null;
182
+ seriesId: string | null;
183
+ sequence: number | null;
184
+ templateId: string | null;
185
+ taxRegimeId: string | null;
186
+ language: string | null;
187
+ subtotalCents: number;
188
+ baseSubtotalCents: number | null;
189
+ taxCents: number;
190
+ baseTaxCents: number | null;
191
+ totalCents: number;
192
+ baseTotalCents: number | null;
193
+ paidCents: number;
194
+ basePaidCents: number | null;
195
+ balanceDueCents: number;
196
+ baseBalanceDueCents: number | null;
197
+ commissionPercent: number | null;
198
+ commissionAmountCents: number | null;
199
+ dueDate: string;
200
+ } | null;
201
+ amountCents: number;
202
+ currency: string;
203
+ recommendedAction: "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session" | "none";
204
+ };
205
+ invoice: {
206
+ id: string;
207
+ createdAt: string;
208
+ updatedAt: string;
209
+ organizationId: string | null;
210
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
211
+ issueDate: string;
212
+ currency: string;
213
+ notes: string | null;
214
+ bookingId: string;
215
+ personId: string | null;
216
+ baseCurrency: string | null;
217
+ fxRateSetId: string | null;
218
+ invoiceNumber: string;
219
+ invoiceType: "invoice" | "proforma" | "credit_note";
220
+ convertedFromInvoiceId: string | null;
221
+ seriesId: string | null;
222
+ sequence: number | null;
223
+ templateId: string | null;
224
+ taxRegimeId: string | null;
225
+ language: string | null;
226
+ subtotalCents: number;
227
+ baseSubtotalCents: number | null;
228
+ taxCents: number;
229
+ baseTaxCents: number | null;
230
+ totalCents: number;
231
+ baseTotalCents: number | null;
232
+ paidCents: number;
233
+ basePaidCents: number | null;
234
+ balanceDueCents: number;
235
+ baseBalanceDueCents: number | null;
236
+ commissionPercent: number | null;
237
+ commissionAmountCents: number | null;
238
+ dueDate: string;
239
+ } | null;
240
+ paymentSession: {
241
+ metadata: {
242
+ [x: string]: import("hono/utils/types").JSONValue;
243
+ } | null;
244
+ id: string;
245
+ createdAt: string;
246
+ updatedAt: string;
247
+ expiresAt: string | null;
248
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
249
+ currency: string;
250
+ notes: string | null;
251
+ idempotencyKey: string | null;
252
+ provider: string | null;
253
+ bookingId: string | null;
254
+ expiredAt: string | null;
255
+ cancelledAt: string | null;
256
+ completedAt: string | null;
257
+ paymentId: string | null;
258
+ amountCents: number;
259
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
260
+ targetId: string | null;
261
+ orderId: string | null;
262
+ invoiceId: string | null;
263
+ bookingPaymentScheduleId: string | null;
264
+ paymentInstrumentId: string | null;
265
+ bookingGuaranteeId: string | null;
266
+ paymentAuthorizationId: string | null;
267
+ paymentCaptureId: string | null;
268
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
269
+ providerSessionId: string | null;
270
+ providerPaymentId: string | null;
271
+ externalReference: string | null;
272
+ clientReference: string | null;
273
+ payerPersonId: string | null;
274
+ payerOrganizationId: string | null;
275
+ payerEmail: string | null;
276
+ payerName: string | null;
277
+ redirectUrl: string | null;
278
+ returnUrl: string | null;
279
+ cancelUrl: string | null;
280
+ callbackUrl: string | null;
281
+ failedAt: string | null;
282
+ failureCode: string | null;
283
+ failureMessage: string | null;
284
+ providerPayload: {
285
+ [x: string]: import("hono/utils/types").JSONValue;
286
+ } | null;
287
+ } | null;
288
+ invoiceNotification: {
289
+ metadata: {
290
+ [x: string]: import("hono/utils/types").JSONValue;
291
+ } | null;
292
+ id: string;
293
+ createdAt: string;
294
+ updatedAt: string;
295
+ organizationId: string | null;
296
+ status: "pending" | "failed" | "cancelled" | "sent";
297
+ provider: string;
298
+ scheduledFor: string | null;
299
+ errorMessage: string | null;
300
+ bookingId: string | null;
301
+ personId: string | null;
302
+ channel: "email" | "sms";
303
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
304
+ targetId: string | null;
305
+ templateId: string | null;
306
+ invoiceId: string | null;
307
+ failedAt: string | null;
308
+ subject: string | null;
309
+ sentAt: string | null;
310
+ fromAddress: string | null;
311
+ templateSlug: string | null;
312
+ paymentSessionId: string | null;
313
+ providerMessageId: string | null;
314
+ toAddress: string;
315
+ htmlBody: string | null;
316
+ textBody: string | null;
317
+ payloadData: {
318
+ [x: string]: import("hono/utils/types").JSONValue;
319
+ } | null;
320
+ } | null;
321
+ paymentSessionNotification: {
322
+ metadata: {
323
+ [x: string]: import("hono/utils/types").JSONValue;
324
+ } | null;
325
+ id: string;
326
+ createdAt: string;
327
+ updatedAt: string;
328
+ organizationId: string | null;
329
+ status: "pending" | "failed" | "cancelled" | "sent";
330
+ provider: string;
331
+ scheduledFor: string | null;
332
+ errorMessage: string | null;
333
+ bookingId: string | null;
334
+ personId: string | null;
335
+ channel: "email" | "sms";
336
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
337
+ targetId: string | null;
338
+ templateId: string | null;
339
+ invoiceId: string | null;
340
+ failedAt: string | null;
341
+ subject: string | null;
342
+ sentAt: string | null;
343
+ fromAddress: string | null;
344
+ templateSlug: string | null;
345
+ paymentSessionId: string | null;
346
+ providerMessageId: string | null;
347
+ toAddress: string;
348
+ htmlBody: string | null;
349
+ textBody: string | null;
350
+ payloadData: {
351
+ [x: string]: import("hono/utils/types").JSONValue;
352
+ } | null;
353
+ } | null;
354
+ bankTransferInstructions: {
355
+ provider: string | null;
356
+ invoiceId: string;
357
+ invoiceNumber: string;
358
+ documentType: "invoice" | "proforma";
359
+ amountCents: number;
360
+ currency: string;
361
+ dueDate: string | null;
362
+ beneficiary: string;
363
+ iban: string;
364
+ bankName: string | null;
365
+ notes: string | null;
366
+ } | null;
367
+ providerStart: {
368
+ provider: string;
369
+ paymentSessionId: string;
370
+ redirectUrl: string | null;
371
+ externalReference: string | null;
372
+ providerSessionId: string | null;
373
+ providerPaymentId: string | null;
374
+ response: {
375
+ [x: string]: import("hono/utils/types").JSONValue;
376
+ } | null;
377
+ } | null;
378
+ };
379
+ };
380
+ outputFormat: "json";
381
+ status: 201;
382
+ } | {
383
+ input: {
384
+ param: {
385
+ bookingId: string;
386
+ };
387
+ };
388
+ output: {
389
+ error: string;
390
+ };
391
+ outputFormat: "json";
392
+ status: 409;
393
+ };
394
+ };
395
+ } & {
396
+ "/collections/bootstrap": {
397
+ $post: {
398
+ input: {};
399
+ output: {
400
+ error: string;
401
+ };
402
+ outputFormat: "json";
403
+ status: 404;
404
+ } | {
405
+ input: {};
406
+ output: {
407
+ data: {
408
+ bookingId: string;
409
+ sessionId: string;
410
+ sourceType: "booking" | "session";
411
+ intent: "deposit" | "balance" | "custom";
412
+ plan: {
413
+ bookingId: string;
414
+ method: "card" | "bank_transfer";
415
+ stage: "initial" | "reminder" | "manual";
416
+ paymentSessionTarget: "schedule" | "invoice" | null;
417
+ documentType: "proforma" | "invoice" | null;
418
+ willCreateDefaultPaymentPlan: boolean;
419
+ selectedSchedule: {
420
+ id: string;
421
+ createdAt: string;
422
+ updatedAt: string;
423
+ status: "pending" | "expired" | "cancelled" | "paid" | "due" | "waived";
424
+ currency: string;
425
+ notes: string | null;
426
+ bookingId: string;
427
+ bookingItemId: string | null;
428
+ amountCents: number;
429
+ dueDate: string;
430
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
431
+ } | null;
432
+ selectedInvoice: {
433
+ id: string;
434
+ createdAt: string;
435
+ updatedAt: string;
436
+ organizationId: string | null;
437
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
438
+ issueDate: string;
439
+ currency: string;
440
+ notes: string | null;
441
+ bookingId: string;
442
+ personId: string | null;
443
+ baseCurrency: string | null;
444
+ fxRateSetId: string | null;
445
+ invoiceNumber: string;
446
+ invoiceType: "invoice" | "proforma" | "credit_note";
447
+ convertedFromInvoiceId: string | null;
448
+ seriesId: string | null;
449
+ sequence: number | null;
450
+ templateId: string | null;
451
+ taxRegimeId: string | null;
452
+ language: string | null;
453
+ subtotalCents: number;
454
+ baseSubtotalCents: number | null;
455
+ taxCents: number;
456
+ baseTaxCents: number | null;
457
+ totalCents: number;
458
+ baseTotalCents: number | null;
459
+ paidCents: number;
460
+ basePaidCents: number | null;
461
+ balanceDueCents: number;
462
+ baseBalanceDueCents: number | null;
463
+ commissionPercent: number | null;
464
+ commissionAmountCents: number | null;
465
+ dueDate: string;
466
+ } | null;
467
+ amountCents: number;
468
+ currency: string;
469
+ recommendedAction: "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session" | "none";
470
+ };
471
+ invoice: {
472
+ id: string;
473
+ createdAt: string;
474
+ updatedAt: string;
475
+ organizationId: string | null;
476
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
477
+ issueDate: string;
478
+ currency: string;
479
+ notes: string | null;
480
+ bookingId: string;
481
+ personId: string | null;
482
+ baseCurrency: string | null;
483
+ fxRateSetId: string | null;
484
+ invoiceNumber: string;
485
+ invoiceType: "invoice" | "proforma" | "credit_note";
486
+ convertedFromInvoiceId: string | null;
487
+ seriesId: string | null;
488
+ sequence: number | null;
489
+ templateId: string | null;
490
+ taxRegimeId: string | null;
491
+ language: string | null;
492
+ subtotalCents: number;
493
+ baseSubtotalCents: number | null;
494
+ taxCents: number;
495
+ baseTaxCents: number | null;
496
+ totalCents: number;
497
+ baseTotalCents: number | null;
498
+ paidCents: number;
499
+ basePaidCents: number | null;
500
+ balanceDueCents: number;
501
+ baseBalanceDueCents: number | null;
502
+ commissionPercent: number | null;
503
+ commissionAmountCents: number | null;
504
+ dueDate: string;
505
+ } | null;
506
+ paymentSession: {
507
+ metadata: {
508
+ [x: string]: import("hono/utils/types").JSONValue;
509
+ } | null;
510
+ id: string;
511
+ createdAt: string;
512
+ updatedAt: string;
513
+ expiresAt: string | null;
514
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
515
+ currency: string;
516
+ notes: string | null;
517
+ idempotencyKey: string | null;
518
+ provider: string | null;
519
+ bookingId: string | null;
520
+ expiredAt: string | null;
521
+ cancelledAt: string | null;
522
+ completedAt: string | null;
523
+ paymentId: string | null;
524
+ amountCents: number;
525
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
526
+ targetId: string | null;
527
+ orderId: string | null;
528
+ invoiceId: string | null;
529
+ bookingPaymentScheduleId: string | null;
530
+ paymentInstrumentId: string | null;
531
+ bookingGuaranteeId: string | null;
532
+ paymentAuthorizationId: string | null;
533
+ paymentCaptureId: string | null;
534
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
535
+ providerSessionId: string | null;
536
+ providerPaymentId: string | null;
537
+ externalReference: string | null;
538
+ clientReference: string | null;
539
+ payerPersonId: string | null;
540
+ payerOrganizationId: string | null;
541
+ payerEmail: string | null;
542
+ payerName: string | null;
543
+ redirectUrl: string | null;
544
+ returnUrl: string | null;
545
+ cancelUrl: string | null;
546
+ callbackUrl: string | null;
547
+ failedAt: string | null;
548
+ failureCode: string | null;
549
+ failureMessage: string | null;
550
+ providerPayload: {
551
+ [x: string]: import("hono/utils/types").JSONValue;
552
+ } | null;
553
+ } | null;
554
+ invoiceNotification: {
555
+ metadata: {
556
+ [x: string]: import("hono/utils/types").JSONValue;
557
+ } | null;
558
+ id: string;
559
+ createdAt: string;
560
+ updatedAt: string;
561
+ organizationId: string | null;
562
+ status: "pending" | "failed" | "cancelled" | "sent";
563
+ provider: string;
564
+ scheduledFor: string | null;
565
+ errorMessage: string | null;
566
+ bookingId: string | null;
567
+ personId: string | null;
568
+ channel: "email" | "sms";
569
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
570
+ targetId: string | null;
571
+ templateId: string | null;
572
+ invoiceId: string | null;
573
+ failedAt: string | null;
574
+ subject: string | null;
575
+ sentAt: string | null;
576
+ fromAddress: string | null;
577
+ templateSlug: string | null;
578
+ paymentSessionId: string | null;
579
+ providerMessageId: string | null;
580
+ toAddress: string;
581
+ htmlBody: string | null;
582
+ textBody: string | null;
583
+ payloadData: {
584
+ [x: string]: import("hono/utils/types").JSONValue;
585
+ } | null;
586
+ } | null;
587
+ paymentSessionNotification: {
588
+ metadata: {
589
+ [x: string]: import("hono/utils/types").JSONValue;
590
+ } | null;
591
+ id: string;
592
+ createdAt: string;
593
+ updatedAt: string;
594
+ organizationId: string | null;
595
+ status: "pending" | "failed" | "cancelled" | "sent";
596
+ provider: string;
597
+ scheduledFor: string | null;
598
+ errorMessage: string | null;
599
+ bookingId: string | null;
600
+ personId: string | null;
601
+ channel: "email" | "sms";
602
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
603
+ targetId: string | null;
604
+ templateId: string | null;
605
+ invoiceId: string | null;
606
+ failedAt: string | null;
607
+ subject: string | null;
608
+ sentAt: string | null;
609
+ fromAddress: string | null;
610
+ templateSlug: string | null;
611
+ paymentSessionId: string | null;
612
+ providerMessageId: string | null;
613
+ toAddress: string;
614
+ htmlBody: string | null;
615
+ textBody: string | null;
616
+ payloadData: {
617
+ [x: string]: import("hono/utils/types").JSONValue;
618
+ } | null;
619
+ } | null;
620
+ bankTransferInstructions: {
621
+ provider: string | null;
622
+ invoiceId: string;
623
+ invoiceNumber: string;
624
+ documentType: "invoice" | "proforma";
625
+ amountCents: number;
626
+ currency: string;
627
+ dueDate: string | null;
628
+ beneficiary: string;
629
+ iban: string;
630
+ bankName: string | null;
631
+ notes: string | null;
632
+ } | null;
633
+ providerStart: {
634
+ provider: string;
635
+ paymentSessionId: string;
636
+ redirectUrl: string | null;
637
+ externalReference: string | null;
638
+ providerSessionId: string | null;
639
+ providerPaymentId: string | null;
640
+ response: {
641
+ [x: string]: import("hono/utils/types").JSONValue;
642
+ } | null;
643
+ } | null;
644
+ };
645
+ };
646
+ outputFormat: "json";
647
+ status: 201;
648
+ } | {
649
+ input: {};
650
+ output: {
651
+ error: string;
652
+ };
653
+ outputFormat: "json";
654
+ status: 409;
655
+ };
656
+ };
657
+ }, "/", "/collections/bootstrap">;
658
+ export declare function createCheckoutAdminRoutes(options?: CheckoutRoutesOptions): import("hono/hono-base").HonoBase<Env, {
659
+ "/bookings/:bookingId/collection-plan": {
660
+ $post: {
661
+ input: {
662
+ param: {
663
+ bookingId: string;
664
+ };
665
+ };
666
+ output: {
667
+ error: string;
668
+ };
669
+ outputFormat: "json";
670
+ status: 404;
671
+ } | {
672
+ input: {
673
+ param: {
674
+ bookingId: string;
675
+ };
676
+ };
677
+ output: {
678
+ data: {
679
+ bookingId: string;
680
+ method: "card" | "bank_transfer";
681
+ stage: "initial" | "reminder" | "manual";
682
+ paymentSessionTarget: "schedule" | "invoice" | null;
683
+ documentType: "proforma" | "invoice" | null;
684
+ willCreateDefaultPaymentPlan: boolean;
685
+ selectedSchedule: {
686
+ id: string;
687
+ createdAt: string;
688
+ updatedAt: string;
689
+ status: "pending" | "expired" | "cancelled" | "paid" | "due" | "waived";
690
+ currency: string;
691
+ notes: string | null;
692
+ bookingId: string;
693
+ bookingItemId: string | null;
694
+ amountCents: number;
695
+ dueDate: string;
696
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
697
+ } | null;
698
+ selectedInvoice: {
699
+ id: string;
700
+ createdAt: string;
701
+ updatedAt: string;
702
+ organizationId: string | null;
703
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
704
+ issueDate: string;
705
+ currency: string;
706
+ notes: string | null;
707
+ bookingId: string;
708
+ personId: string | null;
709
+ baseCurrency: string | null;
710
+ fxRateSetId: string | null;
711
+ invoiceNumber: string;
712
+ invoiceType: "invoice" | "proforma" | "credit_note";
713
+ convertedFromInvoiceId: string | null;
714
+ seriesId: string | null;
715
+ sequence: number | null;
716
+ templateId: string | null;
717
+ taxRegimeId: string | null;
718
+ language: string | null;
719
+ subtotalCents: number;
720
+ baseSubtotalCents: number | null;
721
+ taxCents: number;
722
+ baseTaxCents: number | null;
723
+ totalCents: number;
724
+ baseTotalCents: number | null;
725
+ paidCents: number;
726
+ basePaidCents: number | null;
727
+ balanceDueCents: number;
728
+ baseBalanceDueCents: number | null;
729
+ commissionPercent: number | null;
730
+ commissionAmountCents: number | null;
731
+ dueDate: string;
732
+ } | null;
733
+ amountCents: number;
734
+ currency: string;
735
+ recommendedAction: "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session" | "none";
736
+ };
737
+ };
738
+ outputFormat: "json";
739
+ status: import("hono/utils/http-status").ContentfulStatusCode;
740
+ } | {
741
+ input: {
742
+ param: {
743
+ bookingId: string;
744
+ };
745
+ };
746
+ output: {
747
+ error: string;
748
+ };
749
+ outputFormat: "json";
750
+ status: 400;
751
+ };
752
+ };
753
+ } & {
754
+ "/bookings/:bookingId/initiate-collection": {
755
+ $post: {
756
+ input: {
757
+ param: {
758
+ bookingId: string;
759
+ };
760
+ };
761
+ output: {
762
+ error: string;
763
+ };
764
+ outputFormat: "json";
765
+ status: 404;
766
+ } | {
767
+ input: {
768
+ param: {
769
+ bookingId: string;
770
+ };
771
+ };
772
+ output: {
773
+ data: {
774
+ plan: {
775
+ bookingId: string;
776
+ method: "card" | "bank_transfer";
777
+ stage: "initial" | "reminder" | "manual";
778
+ paymentSessionTarget: "schedule" | "invoice" | null;
779
+ documentType: "proforma" | "invoice" | null;
780
+ willCreateDefaultPaymentPlan: boolean;
781
+ selectedSchedule: {
782
+ id: string;
783
+ createdAt: string;
784
+ updatedAt: string;
785
+ status: "pending" | "expired" | "cancelled" | "paid" | "due" | "waived";
786
+ currency: string;
787
+ notes: string | null;
788
+ bookingId: string;
789
+ bookingItemId: string | null;
790
+ amountCents: number;
791
+ dueDate: string;
792
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
793
+ } | null;
794
+ selectedInvoice: {
795
+ id: string;
796
+ createdAt: string;
797
+ updatedAt: string;
798
+ organizationId: string | null;
799
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
800
+ issueDate: string;
801
+ currency: string;
802
+ notes: string | null;
803
+ bookingId: string;
804
+ personId: string | null;
805
+ baseCurrency: string | null;
806
+ fxRateSetId: string | null;
807
+ invoiceNumber: string;
808
+ invoiceType: "invoice" | "proforma" | "credit_note";
809
+ convertedFromInvoiceId: string | null;
810
+ seriesId: string | null;
811
+ sequence: number | null;
812
+ templateId: string | null;
813
+ taxRegimeId: string | null;
814
+ language: string | null;
815
+ subtotalCents: number;
816
+ baseSubtotalCents: number | null;
817
+ taxCents: number;
818
+ baseTaxCents: number | null;
819
+ totalCents: number;
820
+ baseTotalCents: number | null;
821
+ paidCents: number;
822
+ basePaidCents: number | null;
823
+ balanceDueCents: number;
824
+ baseBalanceDueCents: number | null;
825
+ commissionPercent: number | null;
826
+ commissionAmountCents: number | null;
827
+ dueDate: string;
828
+ } | null;
829
+ amountCents: number;
830
+ currency: string;
831
+ recommendedAction: "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session" | "none";
832
+ };
833
+ invoice: {
834
+ id: string;
835
+ createdAt: string;
836
+ updatedAt: string;
837
+ organizationId: string | null;
838
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
839
+ issueDate: string;
840
+ currency: string;
841
+ notes: string | null;
842
+ bookingId: string;
843
+ personId: string | null;
844
+ baseCurrency: string | null;
845
+ fxRateSetId: string | null;
846
+ invoiceNumber: string;
847
+ invoiceType: "invoice" | "proforma" | "credit_note";
848
+ convertedFromInvoiceId: string | null;
849
+ seriesId: string | null;
850
+ sequence: number | null;
851
+ templateId: string | null;
852
+ taxRegimeId: string | null;
853
+ language: string | null;
854
+ subtotalCents: number;
855
+ baseSubtotalCents: number | null;
856
+ taxCents: number;
857
+ baseTaxCents: number | null;
858
+ totalCents: number;
859
+ baseTotalCents: number | null;
860
+ paidCents: number;
861
+ basePaidCents: number | null;
862
+ balanceDueCents: number;
863
+ baseBalanceDueCents: number | null;
864
+ commissionPercent: number | null;
865
+ commissionAmountCents: number | null;
866
+ dueDate: string;
867
+ } | null;
868
+ paymentSession: {
869
+ metadata: {
870
+ [x: string]: import("hono/utils/types").JSONValue;
871
+ } | null;
872
+ id: string;
873
+ createdAt: string;
874
+ updatedAt: string;
875
+ expiresAt: string | null;
876
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
877
+ currency: string;
878
+ notes: string | null;
879
+ idempotencyKey: string | null;
880
+ provider: string | null;
881
+ bookingId: string | null;
882
+ expiredAt: string | null;
883
+ cancelledAt: string | null;
884
+ completedAt: string | null;
885
+ paymentId: string | null;
886
+ amountCents: number;
887
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
888
+ targetId: string | null;
889
+ orderId: string | null;
890
+ invoiceId: string | null;
891
+ bookingPaymentScheduleId: string | null;
892
+ paymentInstrumentId: string | null;
893
+ bookingGuaranteeId: string | null;
894
+ paymentAuthorizationId: string | null;
895
+ paymentCaptureId: string | null;
896
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
897
+ providerSessionId: string | null;
898
+ providerPaymentId: string | null;
899
+ externalReference: string | null;
900
+ clientReference: string | null;
901
+ payerPersonId: string | null;
902
+ payerOrganizationId: string | null;
903
+ payerEmail: string | null;
904
+ payerName: string | null;
905
+ redirectUrl: string | null;
906
+ returnUrl: string | null;
907
+ cancelUrl: string | null;
908
+ callbackUrl: string | null;
909
+ failedAt: string | null;
910
+ failureCode: string | null;
911
+ failureMessage: string | null;
912
+ providerPayload: {
913
+ [x: string]: import("hono/utils/types").JSONValue;
914
+ } | null;
915
+ } | null;
916
+ invoiceNotification: {
917
+ metadata: {
918
+ [x: string]: import("hono/utils/types").JSONValue;
919
+ } | null;
920
+ id: string;
921
+ createdAt: string;
922
+ updatedAt: string;
923
+ organizationId: string | null;
924
+ status: "pending" | "failed" | "cancelled" | "sent";
925
+ provider: string;
926
+ scheduledFor: string | null;
927
+ errorMessage: string | null;
928
+ bookingId: string | null;
929
+ personId: string | null;
930
+ channel: "email" | "sms";
931
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
932
+ targetId: string | null;
933
+ templateId: string | null;
934
+ invoiceId: string | null;
935
+ failedAt: string | null;
936
+ subject: string | null;
937
+ sentAt: string | null;
938
+ fromAddress: string | null;
939
+ templateSlug: string | null;
940
+ paymentSessionId: string | null;
941
+ providerMessageId: string | null;
942
+ toAddress: string;
943
+ htmlBody: string | null;
944
+ textBody: string | null;
945
+ payloadData: {
946
+ [x: string]: import("hono/utils/types").JSONValue;
947
+ } | null;
948
+ } | null;
949
+ paymentSessionNotification: {
950
+ metadata: {
951
+ [x: string]: import("hono/utils/types").JSONValue;
952
+ } | null;
953
+ id: string;
954
+ createdAt: string;
955
+ updatedAt: string;
956
+ organizationId: string | null;
957
+ status: "pending" | "failed" | "cancelled" | "sent";
958
+ provider: string;
959
+ scheduledFor: string | null;
960
+ errorMessage: string | null;
961
+ bookingId: string | null;
962
+ personId: string | null;
963
+ channel: "email" | "sms";
964
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
965
+ targetId: string | null;
966
+ templateId: string | null;
967
+ invoiceId: string | null;
968
+ failedAt: string | null;
969
+ subject: string | null;
970
+ sentAt: string | null;
971
+ fromAddress: string | null;
972
+ templateSlug: string | null;
973
+ paymentSessionId: string | null;
974
+ providerMessageId: string | null;
975
+ toAddress: string;
976
+ htmlBody: string | null;
977
+ textBody: string | null;
978
+ payloadData: {
979
+ [x: string]: import("hono/utils/types").JSONValue;
980
+ } | null;
981
+ } | null;
982
+ bankTransferInstructions: {
983
+ provider: string | null;
984
+ invoiceId: string;
985
+ invoiceNumber: string;
986
+ documentType: "invoice" | "proforma";
987
+ amountCents: number;
988
+ currency: string;
989
+ dueDate: string | null;
990
+ beneficiary: string;
991
+ iban: string;
992
+ bankName: string | null;
993
+ notes: string | null;
994
+ } | null;
995
+ providerStart: {
996
+ provider: string;
997
+ paymentSessionId: string;
998
+ redirectUrl: string | null;
999
+ externalReference: string | null;
1000
+ providerSessionId: string | null;
1001
+ providerPaymentId: string | null;
1002
+ response: {
1003
+ [x: string]: import("hono/utils/types").JSONValue;
1004
+ } | null;
1005
+ } | null;
1006
+ };
1007
+ };
1008
+ outputFormat: "json";
1009
+ status: 201;
1010
+ } | {
1011
+ input: {
1012
+ param: {
1013
+ bookingId: string;
1014
+ };
1015
+ };
1016
+ output: {
1017
+ error: string;
1018
+ };
1019
+ outputFormat: "json";
1020
+ status: 409;
1021
+ };
1022
+ };
1023
+ } & {
1024
+ "/collections/bootstrap": {
1025
+ $post: {
1026
+ input: {};
1027
+ output: {
1028
+ error: string;
1029
+ };
1030
+ outputFormat: "json";
1031
+ status: 404;
1032
+ } | {
1033
+ input: {};
1034
+ output: {
1035
+ data: {
1036
+ bookingId: string;
1037
+ sessionId: string;
1038
+ sourceType: "booking" | "session";
1039
+ intent: "deposit" | "balance" | "custom";
1040
+ plan: {
1041
+ bookingId: string;
1042
+ method: "card" | "bank_transfer";
1043
+ stage: "initial" | "reminder" | "manual";
1044
+ paymentSessionTarget: "schedule" | "invoice" | null;
1045
+ documentType: "proforma" | "invoice" | null;
1046
+ willCreateDefaultPaymentPlan: boolean;
1047
+ selectedSchedule: {
1048
+ id: string;
1049
+ createdAt: string;
1050
+ updatedAt: string;
1051
+ status: "pending" | "expired" | "cancelled" | "paid" | "due" | "waived";
1052
+ currency: string;
1053
+ notes: string | null;
1054
+ bookingId: string;
1055
+ bookingItemId: string | null;
1056
+ amountCents: number;
1057
+ dueDate: string;
1058
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1059
+ } | null;
1060
+ selectedInvoice: {
1061
+ id: string;
1062
+ createdAt: string;
1063
+ updatedAt: string;
1064
+ organizationId: string | null;
1065
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
1066
+ issueDate: string;
1067
+ currency: string;
1068
+ notes: string | null;
1069
+ bookingId: string;
1070
+ personId: string | null;
1071
+ baseCurrency: string | null;
1072
+ fxRateSetId: string | null;
1073
+ invoiceNumber: string;
1074
+ invoiceType: "invoice" | "proforma" | "credit_note";
1075
+ convertedFromInvoiceId: string | null;
1076
+ seriesId: string | null;
1077
+ sequence: number | null;
1078
+ templateId: string | null;
1079
+ taxRegimeId: string | null;
1080
+ language: string | null;
1081
+ subtotalCents: number;
1082
+ baseSubtotalCents: number | null;
1083
+ taxCents: number;
1084
+ baseTaxCents: number | null;
1085
+ totalCents: number;
1086
+ baseTotalCents: number | null;
1087
+ paidCents: number;
1088
+ basePaidCents: number | null;
1089
+ balanceDueCents: number;
1090
+ baseBalanceDueCents: number | null;
1091
+ commissionPercent: number | null;
1092
+ commissionAmountCents: number | null;
1093
+ dueDate: string;
1094
+ } | null;
1095
+ amountCents: number;
1096
+ currency: string;
1097
+ recommendedAction: "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session" | "none";
1098
+ };
1099
+ invoice: {
1100
+ id: string;
1101
+ createdAt: string;
1102
+ updatedAt: string;
1103
+ organizationId: string | null;
1104
+ status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
1105
+ issueDate: string;
1106
+ currency: string;
1107
+ notes: string | null;
1108
+ bookingId: string;
1109
+ personId: string | null;
1110
+ baseCurrency: string | null;
1111
+ fxRateSetId: string | null;
1112
+ invoiceNumber: string;
1113
+ invoiceType: "invoice" | "proforma" | "credit_note";
1114
+ convertedFromInvoiceId: string | null;
1115
+ seriesId: string | null;
1116
+ sequence: number | null;
1117
+ templateId: string | null;
1118
+ taxRegimeId: string | null;
1119
+ language: string | null;
1120
+ subtotalCents: number;
1121
+ baseSubtotalCents: number | null;
1122
+ taxCents: number;
1123
+ baseTaxCents: number | null;
1124
+ totalCents: number;
1125
+ baseTotalCents: number | null;
1126
+ paidCents: number;
1127
+ basePaidCents: number | null;
1128
+ balanceDueCents: number;
1129
+ baseBalanceDueCents: number | null;
1130
+ commissionPercent: number | null;
1131
+ commissionAmountCents: number | null;
1132
+ dueDate: string;
1133
+ } | null;
1134
+ paymentSession: {
1135
+ metadata: {
1136
+ [x: string]: import("hono/utils/types").JSONValue;
1137
+ } | null;
1138
+ id: string;
1139
+ createdAt: string;
1140
+ updatedAt: string;
1141
+ expiresAt: string | null;
1142
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
1143
+ currency: string;
1144
+ notes: string | null;
1145
+ idempotencyKey: string | null;
1146
+ provider: string | null;
1147
+ bookingId: string | null;
1148
+ expiredAt: string | null;
1149
+ cancelledAt: string | null;
1150
+ completedAt: string | null;
1151
+ paymentId: string | null;
1152
+ amountCents: number;
1153
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1154
+ targetId: string | null;
1155
+ orderId: string | null;
1156
+ invoiceId: string | null;
1157
+ bookingPaymentScheduleId: string | null;
1158
+ paymentInstrumentId: string | null;
1159
+ bookingGuaranteeId: string | null;
1160
+ paymentAuthorizationId: string | null;
1161
+ paymentCaptureId: string | null;
1162
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1163
+ providerSessionId: string | null;
1164
+ providerPaymentId: string | null;
1165
+ externalReference: string | null;
1166
+ clientReference: string | null;
1167
+ payerPersonId: string | null;
1168
+ payerOrganizationId: string | null;
1169
+ payerEmail: string | null;
1170
+ payerName: string | null;
1171
+ redirectUrl: string | null;
1172
+ returnUrl: string | null;
1173
+ cancelUrl: string | null;
1174
+ callbackUrl: string | null;
1175
+ failedAt: string | null;
1176
+ failureCode: string | null;
1177
+ failureMessage: string | null;
1178
+ providerPayload: {
1179
+ [x: string]: import("hono/utils/types").JSONValue;
1180
+ } | null;
1181
+ } | null;
1182
+ invoiceNotification: {
1183
+ metadata: {
1184
+ [x: string]: import("hono/utils/types").JSONValue;
1185
+ } | null;
1186
+ id: string;
1187
+ createdAt: string;
1188
+ updatedAt: string;
1189
+ organizationId: string | null;
1190
+ status: "pending" | "failed" | "cancelled" | "sent";
1191
+ provider: string;
1192
+ scheduledFor: string | null;
1193
+ errorMessage: string | null;
1194
+ bookingId: string | null;
1195
+ personId: string | null;
1196
+ channel: "email" | "sms";
1197
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
1198
+ targetId: string | null;
1199
+ templateId: string | null;
1200
+ invoiceId: string | null;
1201
+ failedAt: string | null;
1202
+ subject: string | null;
1203
+ sentAt: string | null;
1204
+ fromAddress: string | null;
1205
+ templateSlug: string | null;
1206
+ paymentSessionId: string | null;
1207
+ providerMessageId: string | null;
1208
+ toAddress: string;
1209
+ htmlBody: string | null;
1210
+ textBody: string | null;
1211
+ payloadData: {
1212
+ [x: string]: import("hono/utils/types").JSONValue;
1213
+ } | null;
1214
+ } | null;
1215
+ paymentSessionNotification: {
1216
+ metadata: {
1217
+ [x: string]: import("hono/utils/types").JSONValue;
1218
+ } | null;
1219
+ id: string;
1220
+ createdAt: string;
1221
+ updatedAt: string;
1222
+ organizationId: string | null;
1223
+ status: "pending" | "failed" | "cancelled" | "sent";
1224
+ provider: string;
1225
+ scheduledFor: string | null;
1226
+ errorMessage: string | null;
1227
+ bookingId: string | null;
1228
+ personId: string | null;
1229
+ channel: "email" | "sms";
1230
+ targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
1231
+ targetId: string | null;
1232
+ templateId: string | null;
1233
+ invoiceId: string | null;
1234
+ failedAt: string | null;
1235
+ subject: string | null;
1236
+ sentAt: string | null;
1237
+ fromAddress: string | null;
1238
+ templateSlug: string | null;
1239
+ paymentSessionId: string | null;
1240
+ providerMessageId: string | null;
1241
+ toAddress: string;
1242
+ htmlBody: string | null;
1243
+ textBody: string | null;
1244
+ payloadData: {
1245
+ [x: string]: import("hono/utils/types").JSONValue;
1246
+ } | null;
1247
+ } | null;
1248
+ bankTransferInstructions: {
1249
+ provider: string | null;
1250
+ invoiceId: string;
1251
+ invoiceNumber: string;
1252
+ documentType: "invoice" | "proforma";
1253
+ amountCents: number;
1254
+ currency: string;
1255
+ dueDate: string | null;
1256
+ beneficiary: string;
1257
+ iban: string;
1258
+ bankName: string | null;
1259
+ notes: string | null;
1260
+ } | null;
1261
+ providerStart: {
1262
+ provider: string;
1263
+ paymentSessionId: string;
1264
+ redirectUrl: string | null;
1265
+ externalReference: string | null;
1266
+ providerSessionId: string | null;
1267
+ providerPaymentId: string | null;
1268
+ response: {
1269
+ [x: string]: import("hono/utils/types").JSONValue;
1270
+ } | null;
1271
+ } | null;
1272
+ };
1273
+ };
1274
+ outputFormat: "json";
1275
+ status: 201;
1276
+ } | {
1277
+ input: {};
1278
+ output: {
1279
+ error: string;
1280
+ };
1281
+ outputFormat: "json";
1282
+ status: 409;
1283
+ };
1284
+ };
1285
+ }, "/", "/collections/bootstrap">;
1286
+ export declare const checkoutModule: Module;
1287
+ export declare function createCheckoutHonoModule(options?: CheckoutRoutesOptions): HonoModule;
1288
+ export declare function buildCheckoutRouteRuntime(bindings: Record<string, unknown>, options?: CheckoutRoutesOptions): CheckoutRouteRuntime;
1289
+ export {};
1290
+ //# sourceMappingURL=routes.d.ts.map