@voyantjs/checkout 0.19.0 → 0.21.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/dist/routes.d.ts +637 -43
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +9 -5
- package/dist/service.d.ts +8 -3
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +9 -4
- package/dist/validation.d.ts +19 -9
- package/dist/validation.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/routes.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
82
82
|
fxRateSetId: string | null;
|
|
83
83
|
invoiceNumber: string;
|
|
84
84
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
85
|
+
convertedFromInvoiceId: string | null;
|
|
85
86
|
seriesId: string | null;
|
|
86
87
|
sequence: number | null;
|
|
87
88
|
templateId: string | null;
|
|
@@ -177,6 +178,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
177
178
|
fxRateSetId: string | null;
|
|
178
179
|
invoiceNumber: string;
|
|
179
180
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
181
|
+
convertedFromInvoiceId: string | null;
|
|
180
182
|
seriesId: string | null;
|
|
181
183
|
sequence: number | null;
|
|
182
184
|
templateId: string | null;
|
|
@@ -215,6 +217,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
215
217
|
fxRateSetId: string | null;
|
|
216
218
|
invoiceNumber: string;
|
|
217
219
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
220
|
+
convertedFromInvoiceId: string | null;
|
|
218
221
|
seriesId: string | null;
|
|
219
222
|
sequence: number | null;
|
|
220
223
|
templateId: string | null;
|
|
@@ -242,7 +245,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
242
245
|
createdAt: string;
|
|
243
246
|
updatedAt: string;
|
|
244
247
|
expiresAt: string | null;
|
|
245
|
-
status: "pending" | "
|
|
248
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
246
249
|
currency: string;
|
|
247
250
|
notes: string | null;
|
|
248
251
|
idempotencyKey: string | null;
|
|
@@ -253,7 +256,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
253
256
|
completedAt: string | null;
|
|
254
257
|
paymentId: string | null;
|
|
255
258
|
amountCents: number;
|
|
256
|
-
targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
|
|
259
|
+
targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
|
|
257
260
|
targetId: string | null;
|
|
258
261
|
orderId: string | null;
|
|
259
262
|
invoiceId: string | null;
|
|
@@ -290,8 +293,10 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
290
293
|
createdAt: string;
|
|
291
294
|
updatedAt: string;
|
|
292
295
|
organizationId: string | null;
|
|
293
|
-
status: "pending" | "
|
|
296
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
294
297
|
provider: string;
|
|
298
|
+
scheduledFor: string | null;
|
|
299
|
+
errorMessage: string | null;
|
|
295
300
|
bookingId: string | null;
|
|
296
301
|
personId: string | null;
|
|
297
302
|
channel: "email" | "sms";
|
|
@@ -300,7 +305,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
300
305
|
templateId: string | null;
|
|
301
306
|
invoiceId: string | null;
|
|
302
307
|
failedAt: string | null;
|
|
303
|
-
errorMessage: string | null;
|
|
304
308
|
subject: string | null;
|
|
305
309
|
sentAt: string | null;
|
|
306
310
|
fromAddress: string | null;
|
|
@@ -313,7 +317,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
313
317
|
payloadData: {
|
|
314
318
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
315
319
|
} | null;
|
|
316
|
-
scheduledFor: string | null;
|
|
317
320
|
} | null;
|
|
318
321
|
paymentSessionNotification: {
|
|
319
322
|
metadata: {
|
|
@@ -323,8 +326,10 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
323
326
|
createdAt: string;
|
|
324
327
|
updatedAt: string;
|
|
325
328
|
organizationId: string | null;
|
|
326
|
-
status: "pending" | "
|
|
329
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
327
330
|
provider: string;
|
|
331
|
+
scheduledFor: string | null;
|
|
332
|
+
errorMessage: string | null;
|
|
328
333
|
bookingId: string | null;
|
|
329
334
|
personId: string | null;
|
|
330
335
|
channel: "email" | "sms";
|
|
@@ -333,7 +338,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
333
338
|
templateId: string | null;
|
|
334
339
|
invoiceId: string | null;
|
|
335
340
|
failedAt: string | null;
|
|
336
|
-
errorMessage: string | null;
|
|
337
341
|
subject: string | null;
|
|
338
342
|
sentAt: string | null;
|
|
339
343
|
fromAddress: string | null;
|
|
@@ -346,7 +350,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
346
350
|
payloadData: {
|
|
347
351
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
348
352
|
} | null;
|
|
349
|
-
scheduledFor: string | null;
|
|
350
353
|
} | null;
|
|
351
354
|
bankTransferInstructions: {
|
|
352
355
|
provider: string | null;
|
|
@@ -441,6 +444,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
441
444
|
fxRateSetId: string | null;
|
|
442
445
|
invoiceNumber: string;
|
|
443
446
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
447
|
+
convertedFromInvoiceId: string | null;
|
|
444
448
|
seriesId: string | null;
|
|
445
449
|
sequence: number | null;
|
|
446
450
|
templateId: string | null;
|
|
@@ -479,6 +483,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
479
483
|
fxRateSetId: string | null;
|
|
480
484
|
invoiceNumber: string;
|
|
481
485
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
486
|
+
convertedFromInvoiceId: string | null;
|
|
482
487
|
seriesId: string | null;
|
|
483
488
|
sequence: number | null;
|
|
484
489
|
templateId: string | null;
|
|
@@ -506,7 +511,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
506
511
|
createdAt: string;
|
|
507
512
|
updatedAt: string;
|
|
508
513
|
expiresAt: string | null;
|
|
509
|
-
status: "pending" | "
|
|
514
|
+
status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
|
|
510
515
|
currency: string;
|
|
511
516
|
notes: string | null;
|
|
512
517
|
idempotencyKey: string | null;
|
|
@@ -517,7 +522,7 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
517
522
|
completedAt: string | null;
|
|
518
523
|
paymentId: string | null;
|
|
519
524
|
amountCents: number;
|
|
520
|
-
targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
|
|
525
|
+
targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
|
|
521
526
|
targetId: string | null;
|
|
522
527
|
orderId: string | null;
|
|
523
528
|
invoiceId: string | null;
|
|
@@ -554,8 +559,10 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
554
559
|
createdAt: string;
|
|
555
560
|
updatedAt: string;
|
|
556
561
|
organizationId: string | null;
|
|
557
|
-
status: "pending" | "
|
|
562
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
558
563
|
provider: string;
|
|
564
|
+
scheduledFor: string | null;
|
|
565
|
+
errorMessage: string | null;
|
|
559
566
|
bookingId: string | null;
|
|
560
567
|
personId: string | null;
|
|
561
568
|
channel: "email" | "sms";
|
|
@@ -564,7 +571,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
564
571
|
templateId: string | null;
|
|
565
572
|
invoiceId: string | null;
|
|
566
573
|
failedAt: string | null;
|
|
567
|
-
errorMessage: string | null;
|
|
568
574
|
subject: string | null;
|
|
569
575
|
sentAt: string | null;
|
|
570
576
|
fromAddress: string | null;
|
|
@@ -577,7 +583,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
577
583
|
payloadData: {
|
|
578
584
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
579
585
|
} | null;
|
|
580
|
-
scheduledFor: string | null;
|
|
581
586
|
} | null;
|
|
582
587
|
paymentSessionNotification: {
|
|
583
588
|
metadata: {
|
|
@@ -587,8 +592,10 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
587
592
|
createdAt: string;
|
|
588
593
|
updatedAt: string;
|
|
589
594
|
organizationId: string | null;
|
|
590
|
-
status: "pending" | "
|
|
595
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
591
596
|
provider: string;
|
|
597
|
+
scheduledFor: string | null;
|
|
598
|
+
errorMessage: string | null;
|
|
592
599
|
bookingId: string | null;
|
|
593
600
|
personId: string | null;
|
|
594
601
|
channel: "email" | "sms";
|
|
@@ -597,7 +604,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
597
604
|
templateId: string | null;
|
|
598
605
|
invoiceId: string | null;
|
|
599
606
|
failedAt: string | null;
|
|
600
|
-
errorMessage: string | null;
|
|
601
607
|
subject: string | null;
|
|
602
608
|
sentAt: string | null;
|
|
603
609
|
fromAddress: string | null;
|
|
@@ -610,7 +616,6 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
610
616
|
payloadData: {
|
|
611
617
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
612
618
|
} | null;
|
|
613
|
-
scheduledFor: string | null;
|
|
614
619
|
} | null;
|
|
615
620
|
bankTransferInstructions: {
|
|
616
621
|
provider: string | null;
|
|
@@ -650,9 +655,20 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
|
|
|
650
655
|
};
|
|
651
656
|
};
|
|
652
657
|
}, "/", "/collections/bootstrap">;
|
|
653
|
-
export declare function createCheckoutAdminRoutes(): import("hono/hono-base").HonoBase<Env, {
|
|
654
|
-
"/bookings/:bookingId/
|
|
655
|
-
$
|
|
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
|
+
} | {
|
|
656
672
|
input: {
|
|
657
673
|
param: {
|
|
658
674
|
bookingId: string;
|
|
@@ -660,35 +676,613 @@ export declare function createCheckoutAdminRoutes(): import("hono/hono-base").Ho
|
|
|
660
676
|
};
|
|
661
677
|
output: {
|
|
662
678
|
data: {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
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
|
+
};
|
|
686
737
|
};
|
|
687
738
|
outputFormat: "json";
|
|
688
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;
|
|
689
751
|
};
|
|
690
752
|
};
|
|
691
|
-
}
|
|
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">;
|
|
692
1286
|
export declare const checkoutModule: Module;
|
|
693
1287
|
export declare function createCheckoutHonoModule(options?: CheckoutRoutesOptions): HonoModule;
|
|
694
1288
|
export declare function buildCheckoutRouteRuntime(bindings: Record<string, unknown>, options?: CheckoutRoutesOptions): CheckoutRouteRuntime;
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,oB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previewCheckoutCollection, } from "./service.js";
|
|
5
5
|
import { bootstrapCheckoutCollectionSchema, checkoutReminderRunListQuerySchema, initiateCheckoutCollectionSchema, previewCheckoutCollectionSchema, } from "./validation.js";
|
|
6
6
|
export const CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY = "providers.checkout.runtime";
|
|
7
|
-
|
|
7
|
+
function attachCollectionRoutes(app, options) {
|
|
8
8
|
function getRuntime(bindings, resolveFromContainer) {
|
|
9
9
|
return (resolveFromContainer?.(CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY) ??
|
|
10
10
|
buildCheckoutRouteRuntime(bindings, options));
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return app
|
|
13
13
|
.post("/bookings/:bookingId/collection-plan", async (c) => {
|
|
14
14
|
try {
|
|
15
15
|
const plan = await previewCheckoutCollection(c.get("db"), c.req.param("bookingId"), await parseOptionalJsonBody(c, previewCheckoutCollectionSchema), options.policy);
|
|
@@ -60,11 +60,15 @@ export function createCheckoutRoutes(options = {}) {
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
export function
|
|
64
|
-
return new Hono()
|
|
63
|
+
export function createCheckoutRoutes(options = {}) {
|
|
64
|
+
return attachCollectionRoutes(new Hono(), options);
|
|
65
|
+
}
|
|
66
|
+
export function createCheckoutAdminRoutes(options = {}) {
|
|
67
|
+
const app = new Hono().get("/bookings/:bookingId/reminder-runs", async (c) => {
|
|
65
68
|
const query = parseQuery(c, checkoutReminderRunListQuerySchema);
|
|
66
69
|
return c.json(await listBookingReminderRuns(c.get("db"), c.req.param("bookingId"), query));
|
|
67
70
|
});
|
|
71
|
+
return attachCollectionRoutes(app, options);
|
|
68
72
|
}
|
|
69
73
|
export const checkoutModule = {
|
|
70
74
|
name: "checkout",
|
|
@@ -79,7 +83,7 @@ export function createCheckoutHonoModule(options = {}) {
|
|
|
79
83
|
return {
|
|
80
84
|
module,
|
|
81
85
|
publicRoutes: createCheckoutRoutes(options),
|
|
82
|
-
adminRoutes: createCheckoutAdminRoutes(),
|
|
86
|
+
adminRoutes: createCheckoutAdminRoutes(options),
|
|
83
87
|
};
|
|
84
88
|
}
|
|
85
89
|
export function buildCheckoutRouteRuntime(bindings, options = {}) {
|
package/dist/service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bookingPaymentSchedules, invoices, type PaymentSession } from "@voyantjs/finance";
|
|
2
|
-
import type { NotificationDelivery, NotificationService } from "@voyantjs/notifications";
|
|
2
|
+
import type { NotificationDelivery, NotificationReminderRun, NotificationService } from "@voyantjs/notifications";
|
|
3
3
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
4
4
|
import type { BootstrapCheckoutCollectionInput, CheckoutBankTransferInstructionsRecord, CheckoutProviderStartInput, CheckoutReminderRunListQuery, InitiateCheckoutCollectionInput, PreviewCheckoutCollectionInput } from "./validation.js";
|
|
5
5
|
export interface CheckoutPolicyOptions {
|
|
@@ -34,7 +34,12 @@ export interface CheckoutBankTransferDetails {
|
|
|
34
34
|
beneficiary: string;
|
|
35
35
|
iban: string;
|
|
36
36
|
bankName?: string | null;
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Deploy-wide instructions appended to every bank-transfer block (e.g.
|
|
39
|
+
* "Please reference your invoice number in the wire memo"). Per-call
|
|
40
|
+
* notes from `initiateCheckoutCollection({ notes })` take precedence —
|
|
41
|
+
* use this slot for boilerplate, not booking-specific content.
|
|
42
|
+
*/
|
|
38
43
|
notes?: string | null;
|
|
39
44
|
}
|
|
40
45
|
export interface CheckoutProviderStartResult {
|
|
@@ -82,7 +87,7 @@ export interface CheckoutReminderRunSummary {
|
|
|
82
87
|
reminderRuleId: string;
|
|
83
88
|
reminderRuleSlug: string | null;
|
|
84
89
|
reminderRuleName: string | null;
|
|
85
|
-
targetType: "
|
|
90
|
+
targetType: NotificationReminderRun["targetType"];
|
|
86
91
|
targetId: string;
|
|
87
92
|
bookingId: string | null;
|
|
88
93
|
paymentSessionId: string | null;
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EAIvB,QAAQ,EACR,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EAIvB,QAAQ,EACR,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,yBAAyB,CAAA;AAQhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,KAAK,EACV,gCAAgC,EAChC,sCAAsC,EACtC,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,iBAAiB,CAAA;AAExB,MAAM,WAAW,qBAAqB;IACpC,2BAA2B,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IACpD,mCAAmC,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5D,+BAA+B,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IACxD,kBAAkB,CAAC,EAAE;QACnB,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc,CAAA;QACnD,YAAY,EAAE,MAAM,CAAA;QACpB,yBAAyB,EAAE,MAAM,CAAA;QACjC,oBAAoB,EAAE,OAAO,CAAA;QAC7B,eAAe,EAAE,OAAO,CAAA;QACxB,aAAa,EACT,SAAS,GACT,aAAa,GACb,SAAS,GACT,cAAc,GACd,eAAe,GACf,SAAS,GACT,eAAe,CAAA;QACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KACtB,CAAA;CACF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AAM,EACjB,KAAK,EAAE,8BAA8B,EACrC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CA4ExC;AAkED,wBAAsB,0BAA0B,CAC9C,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,+BAA+B,EACtC,OAAO,GAAE,qBAA0B,EACnC,UAAU,CAAC,EAAE,mBAAmB,EAChC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CA8I7C;AAED,wBAAsB,2BAA2B,CAC/C,EAAE,EAAE,kBAAkB,EACtB,KAAK,EAAE,gCAAgC,EACvC,OAAO,GAAE,qBAA0B,EACnC,UAAU,CAAC,EAAE,mBAAmB,EAChC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAoChD;AAED,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,uBAAuB,CAAC,CAwElC"}
|
package/dist/service.js
CHANGED
|
@@ -101,7 +101,7 @@ function resolveCheckoutSubject(input) {
|
|
|
101
101
|
function toInvoiceDueDateTime(value) {
|
|
102
102
|
return value ? `${value}T00:00:00.000Z` : null;
|
|
103
103
|
}
|
|
104
|
-
function buildBankTransferInstructions(invoice, details) {
|
|
104
|
+
function buildBankTransferInstructions(invoice, details, callNotes) {
|
|
105
105
|
if (!details) {
|
|
106
106
|
return null;
|
|
107
107
|
}
|
|
@@ -111,12 +111,17 @@ function buildBankTransferInstructions(invoice, details) {
|
|
|
111
111
|
invoiceNumber: invoice.invoiceNumber,
|
|
112
112
|
documentType: invoice.invoiceType === "proforma" ? "proforma" : "invoice",
|
|
113
113
|
amountCents: invoice.balanceDueCents,
|
|
114
|
-
|
|
114
|
+
// Currency always tracks the invoice — the deploy-wide bank-transfer
|
|
115
|
+
// block can't predict what the customer is buying. EUR booking +
|
|
116
|
+
// RON-default env would have shown the wrong currency to the customer.
|
|
117
|
+
currency: invoice.currency,
|
|
115
118
|
dueDate: toInvoiceDueDateTime(invoice.dueDate),
|
|
116
119
|
beneficiary: details.beneficiary,
|
|
117
120
|
iban: details.iban,
|
|
118
121
|
bankName: details.bankName ?? null,
|
|
119
|
-
|
|
122
|
+
// Per-call notes win over deploy-wide boilerplate — the caller knows
|
|
123
|
+
// booking context (invoice number, due date, etc.) the env can't.
|
|
124
|
+
notes: callNotes ?? details.notes ?? null,
|
|
120
125
|
};
|
|
121
126
|
}
|
|
122
127
|
async function loadBookingContext(db, bookingId) {
|
|
@@ -322,7 +327,7 @@ export async function initiateCheckoutCollection(db, bookingId, input, options =
|
|
|
322
327
|
let providerStart = null;
|
|
323
328
|
if (input.method === "bank_transfer") {
|
|
324
329
|
invoice = await createCollectionInvoice(db, context, plan, input.notes ?? null);
|
|
325
|
-
bankTransferInstructions = buildBankTransferInstructions(invoice, runtime.bankTransferDetails ?? null);
|
|
330
|
+
bankTransferInstructions = buildBankTransferInstructions(invoice, runtime.bankTransferDetails ?? null, input.notes ?? null);
|
|
326
331
|
if (dispatcher && input.invoiceNotification) {
|
|
327
332
|
invoiceNotification = await notificationsService.sendInvoiceNotification(db, dispatcher, invoice.id, input.invoiceNotification);
|
|
328
333
|
}
|
package/dist/validation.d.ts
CHANGED
|
@@ -429,8 +429,8 @@ export declare const checkoutNotificationDeliverySchema: z.ZodObject<{
|
|
|
429
429
|
provider: z.ZodString;
|
|
430
430
|
status: z.ZodEnum<{
|
|
431
431
|
pending: "pending";
|
|
432
|
-
cancelled: "cancelled";
|
|
433
432
|
failed: "failed";
|
|
433
|
+
cancelled: "cancelled";
|
|
434
434
|
sent: "sent";
|
|
435
435
|
}>;
|
|
436
436
|
toAddress: z.ZodString;
|
|
@@ -608,6 +608,7 @@ export declare const initiatedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
608
608
|
invoice: "invoice";
|
|
609
609
|
booking_payment_schedule: "booking_payment_schedule";
|
|
610
610
|
booking_guarantee: "booking_guarantee";
|
|
611
|
+
flight_order: "flight_order";
|
|
611
612
|
}>;
|
|
612
613
|
targetId: z.ZodNullable<z.ZodString>;
|
|
613
614
|
bookingId: z.ZodNullable<z.ZodString>;
|
|
@@ -616,9 +617,9 @@ export declare const initiatedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
616
617
|
bookingGuaranteeId: z.ZodNullable<z.ZodString>;
|
|
617
618
|
status: z.ZodEnum<{
|
|
618
619
|
pending: "pending";
|
|
620
|
+
failed: "failed";
|
|
619
621
|
expired: "expired";
|
|
620
622
|
cancelled: "cancelled";
|
|
621
|
-
failed: "failed";
|
|
622
623
|
paid: "paid";
|
|
623
624
|
requires_redirect: "requires_redirect";
|
|
624
625
|
processing: "processing";
|
|
@@ -651,6 +652,7 @@ export declare const initiatedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
651
652
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
652
653
|
failureCode: z.ZodNullable<z.ZodString>;
|
|
653
654
|
failureMessage: z.ZodNullable<z.ZodString>;
|
|
655
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
654
656
|
}, z.core.$strip>>;
|
|
655
657
|
invoiceNotification: z.ZodNullable<z.ZodObject<{
|
|
656
658
|
id: z.ZodString;
|
|
@@ -662,8 +664,8 @@ export declare const initiatedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
662
664
|
provider: z.ZodString;
|
|
663
665
|
status: z.ZodEnum<{
|
|
664
666
|
pending: "pending";
|
|
665
|
-
cancelled: "cancelled";
|
|
666
667
|
failed: "failed";
|
|
668
|
+
cancelled: "cancelled";
|
|
667
669
|
sent: "sent";
|
|
668
670
|
}>;
|
|
669
671
|
toAddress: z.ZodString;
|
|
@@ -682,8 +684,8 @@ export declare const initiatedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
682
684
|
provider: z.ZodString;
|
|
683
685
|
status: z.ZodEnum<{
|
|
684
686
|
pending: "pending";
|
|
685
|
-
cancelled: "cancelled";
|
|
686
687
|
failed: "failed";
|
|
688
|
+
cancelled: "cancelled";
|
|
687
689
|
sent: "sent";
|
|
688
690
|
}>;
|
|
689
691
|
toAddress: z.ZodString;
|
|
@@ -804,6 +806,7 @@ export declare const bootstrappedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
804
806
|
invoice: "invoice";
|
|
805
807
|
booking_payment_schedule: "booking_payment_schedule";
|
|
806
808
|
booking_guarantee: "booking_guarantee";
|
|
809
|
+
flight_order: "flight_order";
|
|
807
810
|
}>;
|
|
808
811
|
targetId: z.ZodNullable<z.ZodString>;
|
|
809
812
|
bookingId: z.ZodNullable<z.ZodString>;
|
|
@@ -812,9 +815,9 @@ export declare const bootstrappedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
812
815
|
bookingGuaranteeId: z.ZodNullable<z.ZodString>;
|
|
813
816
|
status: z.ZodEnum<{
|
|
814
817
|
pending: "pending";
|
|
818
|
+
failed: "failed";
|
|
815
819
|
expired: "expired";
|
|
816
820
|
cancelled: "cancelled";
|
|
817
|
-
failed: "failed";
|
|
818
821
|
paid: "paid";
|
|
819
822
|
requires_redirect: "requires_redirect";
|
|
820
823
|
processing: "processing";
|
|
@@ -847,6 +850,7 @@ export declare const bootstrappedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
847
850
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
848
851
|
failureCode: z.ZodNullable<z.ZodString>;
|
|
849
852
|
failureMessage: z.ZodNullable<z.ZodString>;
|
|
853
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
850
854
|
}, z.core.$strip>>;
|
|
851
855
|
invoiceNotification: z.ZodNullable<z.ZodObject<{
|
|
852
856
|
id: z.ZodString;
|
|
@@ -858,8 +862,8 @@ export declare const bootstrappedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
858
862
|
provider: z.ZodString;
|
|
859
863
|
status: z.ZodEnum<{
|
|
860
864
|
pending: "pending";
|
|
861
|
-
cancelled: "cancelled";
|
|
862
865
|
failed: "failed";
|
|
866
|
+
cancelled: "cancelled";
|
|
863
867
|
sent: "sent";
|
|
864
868
|
}>;
|
|
865
869
|
toAddress: z.ZodString;
|
|
@@ -878,8 +882,8 @@ export declare const bootstrappedCheckoutCollectionSchema: z.ZodObject<{
|
|
|
878
882
|
provider: z.ZodString;
|
|
879
883
|
status: z.ZodEnum<{
|
|
880
884
|
pending: "pending";
|
|
881
|
-
cancelled: "cancelled";
|
|
882
885
|
failed: "failed";
|
|
886
|
+
cancelled: "cancelled";
|
|
883
887
|
sent: "sent";
|
|
884
888
|
}>;
|
|
885
889
|
toAddress: z.ZodString;
|
|
@@ -942,8 +946,11 @@ export declare const checkoutReminderRunSchema: z.ZodObject<{
|
|
|
942
946
|
reminderRuleSlug: z.ZodNullable<z.ZodString>;
|
|
943
947
|
reminderRuleName: z.ZodNullable<z.ZodString>;
|
|
944
948
|
targetType: z.ZodEnum<{
|
|
949
|
+
booking_confirmed: "booking_confirmed";
|
|
945
950
|
invoice: "invoice";
|
|
946
951
|
booking_payment_schedule: "booking_payment_schedule";
|
|
952
|
+
payment_complete: "payment_complete";
|
|
953
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
947
954
|
}>;
|
|
948
955
|
targetId: z.ZodString;
|
|
949
956
|
bookingId: z.ZodNullable<z.ZodString>;
|
|
@@ -958,8 +965,8 @@ export declare const checkoutReminderRunSchema: z.ZodObject<{
|
|
|
958
965
|
}>;
|
|
959
966
|
deliveryStatus: z.ZodNullable<z.ZodEnum<{
|
|
960
967
|
pending: "pending";
|
|
961
|
-
cancelled: "cancelled";
|
|
962
968
|
failed: "failed";
|
|
969
|
+
cancelled: "cancelled";
|
|
963
970
|
sent: "sent";
|
|
964
971
|
}>>;
|
|
965
972
|
channel: z.ZodNullable<z.ZodEnum<{
|
|
@@ -981,8 +988,11 @@ export declare const checkoutReminderRunListResponseSchema: z.ZodObject<{
|
|
|
981
988
|
reminderRuleSlug: z.ZodNullable<z.ZodString>;
|
|
982
989
|
reminderRuleName: z.ZodNullable<z.ZodString>;
|
|
983
990
|
targetType: z.ZodEnum<{
|
|
991
|
+
booking_confirmed: "booking_confirmed";
|
|
984
992
|
invoice: "invoice";
|
|
985
993
|
booking_payment_schedule: "booking_payment_schedule";
|
|
994
|
+
payment_complete: "payment_complete";
|
|
995
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
986
996
|
}>;
|
|
987
997
|
targetId: z.ZodString;
|
|
988
998
|
bookingId: z.ZodNullable<z.ZodString>;
|
|
@@ -997,8 +1007,8 @@ export declare const checkoutReminderRunListResponseSchema: z.ZodObject<{
|
|
|
997
1007
|
}>;
|
|
998
1008
|
deliveryStatus: z.ZodNullable<z.ZodEnum<{
|
|
999
1009
|
pending: "pending";
|
|
1000
|
-
cancelled: "cancelled";
|
|
1001
1010
|
failed: "failed";
|
|
1011
|
+
cancelled: "cancelled";
|
|
1002
1012
|
sent: "sent";
|
|
1003
1013
|
}>>;
|
|
1004
1014
|
channel: z.ZodNullable<z.ZodEnum<{
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,8BAA8B;;;EAAoC,CAAA;AAC/E,eAAO,MAAM,6BAA6B;;;;EAA4C,CAAA;AACtF,eAAO,MAAM,8BAA8B;;;;EAA2C,CAAA;AACtF,eAAO,MAAM,kCAAkC;;;EAAkC,CAAA;AACjF,eAAO,MAAM,iCAAiC;;;EAAkC,CAAA;AAChF,eAAO,MAAM,gCAAgC;;;iBAG3C,CAAA;AAQF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS1C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;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AC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AACjG,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/checkout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"drizzle-orm": "^0.45.2",
|
|
30
30
|
"hono": "^4.12.10",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@voyantjs/bookings": "0.
|
|
33
|
-
"@voyantjs/core": "0.
|
|
34
|
-
"@voyantjs/finance": "0.
|
|
35
|
-
"@voyantjs/hono": "0.
|
|
36
|
-
"@voyantjs/notifications": "0.
|
|
32
|
+
"@voyantjs/bookings": "0.21.0",
|
|
33
|
+
"@voyantjs/core": "0.21.0",
|
|
34
|
+
"@voyantjs/finance": "0.21.0",
|
|
35
|
+
"@voyantjs/hono": "0.21.0",
|
|
36
|
+
"@voyantjs/notifications": "0.21.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"typescript": "^6.0.2",
|