1
1
import type { EventSpecification } from "@trigger.dev/sdk" ;
2
2
import {
3
+ amountCapturablePaymentIntentExample ,
4
+ cancelledPaymentIntentExample ,
3
5
cancelledSubscriptionExample ,
6
+ capturedChargeExample ,
4
7
checkoutSessionExample ,
8
+ createdCustomerExample ,
9
+ createdPaymentIntentExample ,
5
10
customerSubscriptionExample ,
11
+ deletedCustomerExample ,
12
+ failedChargeExample ,
13
+ failedPaymentIntentExample ,
6
14
pausedSubscriptionExample ,
15
+ refundedChargeExample ,
16
+ succeededChargeExample ,
17
+ succeededPaymentIntentExample ,
18
+ updatedAccountExample ,
7
19
updatedSubscriptionExample ,
8
20
} from "./examples" ;
9
21
import {
@@ -13,6 +25,8 @@ import {
13
25
OnCustomerEvent ,
14
26
OnCustomerSubscription ,
15
27
OnExternalAccountEvent ,
28
+ OnPaymentIntentEvent ,
29
+ OnPayoutEvent ,
16
30
OnPersonEvent ,
17
31
OnPriceEvent ,
18
32
OnProductEvent ,
@@ -467,7 +481,7 @@ export const onAccountUpdated: EventSpecification<OnAccountEvent> = {
467
481
title : "On Account Updated" ,
468
482
source : "stripe.com" ,
469
483
icon : "stripe" ,
470
- examples : [ ] ,
484
+ examples : [ updatedAccountExample ] ,
471
485
parsePayload : ( payload ) => payload as OnAccountEvent ,
472
486
runProperties : ( payload ) => [
473
487
{ label : "Account ID" , text : payload . id } ,
@@ -480,7 +494,7 @@ export const onCustomer: EventSpecification<OnCustomerEvent> = {
480
494
title : "On Customer Event" ,
481
495
source : "stripe.com" ,
482
496
icon : "stripe" ,
483
- examples : [ ] ,
497
+ examples : [ createdCustomerExample ] ,
484
498
parsePayload : ( payload ) => payload as OnCustomerEvent ,
485
499
runProperties : ( payload ) => [ { label : "Customer ID" , text : payload . id } ] ,
486
500
} ;
@@ -490,7 +504,7 @@ export const onCustomerCreated: EventSpecification<OnCustomerEvent> = {
490
504
title : "On Customer Created" ,
491
505
source : "stripe.com" ,
492
506
icon : "stripe" ,
493
- examples : [ ] ,
507
+ examples : [ createdCustomerExample ] ,
494
508
parsePayload : ( payload ) => payload as OnCustomerEvent ,
495
509
runProperties : ( payload ) => [ { label : "Customer ID" , text : payload . id } ] ,
496
510
} ;
@@ -500,7 +514,7 @@ export const onCustomerDeleted: EventSpecification<OnCustomerEvent> = {
500
514
title : "On Customer Deleted" ,
501
515
source : "stripe.com" ,
502
516
icon : "stripe" ,
503
- examples : [ ] ,
517
+ examples : [ deletedCustomerExample ] ,
504
518
parsePayload : ( payload ) => payload as OnCustomerEvent ,
505
519
runProperties : ( payload ) => [ { label : "Customer ID" , text : payload . id } ] ,
506
520
} ;
@@ -510,7 +524,7 @@ export const onCustomerUpdated: EventSpecification<OnCustomerEvent> = {
510
524
title : "On Customer Updated" ,
511
525
source : "stripe.com" ,
512
526
icon : "stripe" ,
513
- examples : [ ] ,
527
+ examples : [ createdCustomerExample ] ,
514
528
parsePayload : ( payload ) => payload as OnCustomerEvent ,
515
529
runProperties : ( payload ) => [ { label : "Customer ID" , text : payload . id } ] ,
516
530
} ;
@@ -528,7 +542,12 @@ export const onCharge: EventSpecification<OnChargeEvent> = {
528
542
title : "On Charge Event" ,
529
543
source : "stripe.com" ,
530
544
icon : "stripe" ,
531
- examples : [ ] ,
545
+ examples : [
546
+ capturedChargeExample ,
547
+ succeededChargeExample ,
548
+ failedChargeExample ,
549
+ refundedChargeExample ,
550
+ ] ,
532
551
parsePayload : ( payload ) => payload as OnChargeEvent ,
533
552
runProperties : ( payload ) => [ { label : "Charge ID" , text : payload . id } ] ,
534
553
} ;
@@ -538,7 +557,7 @@ export const onChargeCaptured: EventSpecification<OnChargeEvent> = {
538
557
title : "On Charge Captured" ,
539
558
source : "stripe.com" ,
540
559
icon : "stripe" ,
541
- examples : [ ] ,
560
+ examples : [ capturedChargeExample ] ,
542
561
parsePayload : ( payload ) => payload as OnChargeEvent ,
543
562
runProperties : ( payload ) => [ { label : "Charge ID" , text : payload . id } ] ,
544
563
} ;
@@ -558,7 +577,7 @@ export const onChargeFailed: EventSpecification<OnChargeEvent> = {
558
577
title : "On Charge Failed" ,
559
578
source : "stripe.com" ,
560
579
icon : "stripe" ,
561
- examples : [ ] ,
580
+ examples : [ failedChargeExample ] ,
562
581
parsePayload : ( payload ) => payload as OnChargeEvent ,
563
582
runProperties : ( payload ) => [ { label : "Charge ID" , text : payload . id } ] ,
564
583
} ;
@@ -578,7 +597,7 @@ export const onChargeRefunded: EventSpecification<OnChargeEvent> = {
578
597
title : "On Charge Refunded" ,
579
598
source : "stripe.com" ,
580
599
icon : "stripe" ,
581
- examples : [ ] ,
600
+ examples : [ refundedChargeExample ] ,
582
601
parsePayload : ( payload ) => payload as OnChargeEvent ,
583
602
runProperties : ( payload ) => [ { label : "Charge ID" , text : payload . id } ] ,
584
603
} ;
@@ -588,7 +607,7 @@ export const onChargeSucceeded: EventSpecification<OnChargeEvent> = {
588
607
title : "On Charge Succeeded" ,
589
608
source : "stripe.com" ,
590
609
icon : "stripe" ,
591
- examples : [ ] ,
610
+ examples : [ succeededChargeExample ] ,
592
611
parsePayload : ( payload ) => payload as OnChargeEvent ,
593
612
runProperties : ( payload ) => [ { label : "Charge ID" , text : payload . id } ] ,
594
613
} ;
@@ -710,3 +729,206 @@ export const onPersonUpdated: EventSpecification<OnPersonEvent> = {
710
729
{ label : "Account" , text : payload . account } ,
711
730
] ,
712
731
} ;
732
+
733
+ export const onPaymentIntent : EventSpecification < OnPaymentIntentEvent > = {
734
+ name : [
735
+ "payment_intent.created" ,
736
+ "payment_intent.succeeded" ,
737
+ "payment_intent.canceled" ,
738
+ "payment_intent.processing" ,
739
+ "payment_intent.requires_action" ,
740
+ "payment_intent.amount_capturable_updated" ,
741
+ "payment_intent.payment_failed" ,
742
+ "payment_intent.partially_funded" ,
743
+ ] ,
744
+ title : "On Payment Intent Event" ,
745
+ source : "stripe.com" ,
746
+ icon : "stripe" ,
747
+ examples : [
748
+ createdPaymentIntentExample ,
749
+ succeededPaymentIntentExample ,
750
+ cancelledPaymentIntentExample ,
751
+ amountCapturablePaymentIntentExample ,
752
+ failedPaymentIntentExample ,
753
+ ] ,
754
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
755
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
756
+ } ;
757
+
758
+ export const onPaymentIntentCreated : EventSpecification < OnPaymentIntentEvent > = {
759
+ name : "payment_intent.created" ,
760
+ title : "On Payment Intent Created" ,
761
+ source : "stripe.com" ,
762
+ icon : "stripe" ,
763
+ examples : [ createdPaymentIntentExample ] ,
764
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
765
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
766
+ } ;
767
+
768
+ export const onPaymentIntentSucceeded : EventSpecification < OnPaymentIntentEvent > = {
769
+ name : "payment_intent.succeeded" ,
770
+ title : "On Payment Intent Succeeded" ,
771
+ source : "stripe.com" ,
772
+ icon : "stripe" ,
773
+ examples : [ succeededPaymentIntentExample ] ,
774
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
775
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
776
+ } ;
777
+
778
+ export const onPaymentIntentCanceled : EventSpecification < OnPaymentIntentEvent > = {
779
+ name : "payment_intent.canceled" ,
780
+ title : "On Payment Intent Canceled" ,
781
+ source : "stripe.com" ,
782
+ icon : "stripe" ,
783
+ examples : [ cancelledPaymentIntentExample ] ,
784
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
785
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
786
+ } ;
787
+
788
+ export const onPaymentIntentProcessing : EventSpecification < OnPaymentIntentEvent > = {
789
+ name : "payment_intent.processing" ,
790
+ title : "On Payment Intent Processing" ,
791
+ source : "stripe.com" ,
792
+ icon : "stripe" ,
793
+ examples : [ ] ,
794
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
795
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
796
+ } ;
797
+
798
+ export const onPaymentIntentRequiresAction : EventSpecification < OnPaymentIntentEvent > = {
799
+ name : "payment_intent.requires_action" ,
800
+ title : "On Payment Intent Requires Action" ,
801
+ source : "stripe.com" ,
802
+ icon : "stripe" ,
803
+ examples : [ ] ,
804
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
805
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
806
+ } ;
807
+
808
+ export const onPaymentIntentAmountCapturableUpdated : EventSpecification < OnPaymentIntentEvent > = {
809
+ name : "payment_intent.amount_capturable_updated" ,
810
+ title : "On Payment Intent Amount Capturable Updated" ,
811
+ source : "stripe.com" ,
812
+ icon : "stripe" ,
813
+ examples : [ amountCapturablePaymentIntentExample ] ,
814
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
815
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
816
+ } ;
817
+
818
+ export const onPaymentIntentPaymentFailed : EventSpecification < OnPaymentIntentEvent > = {
819
+ name : "payment_intent.payment_failed" ,
820
+ title : "On Payment Intent Payment Failed" ,
821
+ source : "stripe.com" ,
822
+ icon : "stripe" ,
823
+ examples : [ failedPaymentIntentExample ] ,
824
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
825
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
826
+ } ;
827
+
828
+ export const onPaymentIntentPartiallyFunded : EventSpecification < OnPaymentIntentEvent > = {
829
+ name : "payment_intent.partially_funded" ,
830
+ title : "On Payment Intent Partially Funded" ,
831
+ source : "stripe.com" ,
832
+ icon : "stripe" ,
833
+ examples : [ ] ,
834
+ parsePayload : ( payload ) => payload as OnPaymentIntentEvent ,
835
+ runProperties : ( payload ) => [ { label : "Payment Intent ID" , text : payload . id } ] ,
836
+ } ;
837
+
838
+ export const onPayout : EventSpecification < OnPayoutEvent > = {
839
+ name : [
840
+ "payout.canceled" ,
841
+ "payout.created" ,
842
+ "payout.failed" ,
843
+ "payout.paid" ,
844
+ "payout.reconciliation_completed" ,
845
+ "payout.updated" ,
846
+ ] ,
847
+ title : "On Payout Event" ,
848
+ source : "stripe.com" ,
849
+ icon : "stripe" ,
850
+ examples : [ ] ,
851
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
852
+ runProperties : ( payload ) => [
853
+ { label : "Payout ID" , text : payload . id } ,
854
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
855
+ ] ,
856
+ } ;
857
+
858
+ export const onPayoutCancelled : EventSpecification < OnPayoutEvent > = {
859
+ name : "payout.canceled" ,
860
+ title : "On Payout Cancelled Event" ,
861
+ source : "stripe.com" ,
862
+ icon : "stripe" ,
863
+ examples : [ ] ,
864
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
865
+ runProperties : ( payload ) => [
866
+ { label : "Payout ID" , text : payload . id } ,
867
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
868
+ ] ,
869
+ } ;
870
+
871
+ export const onPayoutCreated : EventSpecification < OnPayoutEvent > = {
872
+ name : "payout.created" ,
873
+ title : "On Payout Created Event" ,
874
+ source : "stripe.com" ,
875
+ icon : "stripe" ,
876
+ examples : [ ] ,
877
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
878
+ runProperties : ( payload ) => [
879
+ { label : "Payout ID" , text : payload . id } ,
880
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
881
+ ] ,
882
+ } ;
883
+
884
+ export const onPayoutFailed : EventSpecification < OnPayoutEvent > = {
885
+ name : "payout.failed" ,
886
+ title : "On Payout Failed Event" ,
887
+ source : "stripe.com" ,
888
+ icon : "stripe" ,
889
+ examples : [ ] ,
890
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
891
+ runProperties : ( payload ) => [
892
+ { label : "Payout ID" , text : payload . id } ,
893
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
894
+ ] ,
895
+ } ;
896
+
897
+ export const onPayoutPaid : EventSpecification < OnPayoutEvent > = {
898
+ name : "payout.paid" ,
899
+ title : "On Payout Paid Event" ,
900
+ source : "stripe.com" ,
901
+ icon : "stripe" ,
902
+ examples : [ ] ,
903
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
904
+ runProperties : ( payload ) => [
905
+ { label : "Payout ID" , text : payload . id } ,
906
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
907
+ ] ,
908
+ } ;
909
+
910
+ export const onPayoutReconciliationCompleted : EventSpecification < OnPayoutEvent > = {
911
+ name : "payout.reconciliation_completed" ,
912
+ title : "On Payout Reconciliation Completed Event" ,
913
+ source : "stripe.com" ,
914
+ icon : "stripe" ,
915
+ examples : [ ] ,
916
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
917
+ runProperties : ( payload ) => [
918
+ { label : "Payout ID" , text : payload . id } ,
919
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
920
+ ] ,
921
+ } ;
922
+
923
+ export const onPayoutUpdated : EventSpecification < OnPayoutEvent > = {
924
+ name : "payout.updated" ,
925
+ title : "On Payout Updated Event" ,
926
+ source : "stripe.com" ,
927
+ icon : "stripe" ,
928
+ examples : [ ] ,
929
+ parsePayload : ( payload ) => payload as OnPayoutEvent ,
930
+ runProperties : ( payload ) => [
931
+ { label : "Payout ID" , text : payload . id } ,
932
+ { label : "Amount" , text : `${ payload . amount } ${ payload . currency } ` } ,
933
+ ] ,
934
+ } ;
0 commit comments