@@ -82,6 +82,52 @@ export const ConnectPaymentDetails = ({
82
82
return wrapper ;
83
83
} ;
84
84
85
+ export const ConnectPaymentDisputes = ( {
86
+ payment,
87
+ onDisputesLoaded,
88
+ onLoadError,
89
+ onLoaderStart,
90
+ } : {
91
+ /**
92
+ * @param payment the ID of `payment`, `charge`, or `paymentIntent` to be displayed.
93
+ */
94
+ payment : string ;
95
+ onDisputesLoaded ?: ( { total} : { total : number } ) => void ;
96
+ } & CommonComponentProps ) : JSX . Element | null => {
97
+ const { wrapper, component} =
98
+ useCreateComponent ( 'payment-disputes' ) ;
99
+
100
+ useUpdateWithSetter ( component , payment , ( comp , val ) =>
101
+ comp . setPayment ( val )
102
+ ) ;
103
+ useUpdateWithSetter ( component , onDisputesLoaded , ( comp , val ) =>
104
+ comp . setOnDisputesLoaded ( val )
105
+ ) ;
106
+ useUpdateWithSetter ( component , onLoaderStart , ( comp , val ) => {
107
+ comp . setOnLoaderStart ( val ) ;
108
+ } ) ;
109
+ useUpdateWithSetter ( component , onLoadError , ( comp , val ) => {
110
+ comp . setOnLoadError ( val ) ;
111
+ } ) ;
112
+ return wrapper ;
113
+ } ;
114
+
115
+ export const ConnectDisputesList = ( {
116
+ onLoadError,
117
+ onLoaderStart,
118
+ } : CommonComponentProps ) : JSX . Element | null => {
119
+ const { wrapper, component} =
120
+ useCreateComponent ( 'disputes-list' ) ;
121
+
122
+ useUpdateWithSetter ( component , onLoaderStart , ( comp , val ) => {
123
+ comp . setOnLoaderStart ( val ) ;
124
+ } ) ;
125
+ useUpdateWithSetter ( component , onLoadError , ( comp , val ) => {
126
+ comp . setOnLoadError ( val ) ;
127
+ } ) ;
128
+ return wrapper ;
129
+ } ;
130
+
85
131
export type CollectionOptions = {
86
132
fields : 'currently_due' | 'eventually_due' ;
87
133
futureRequirements ?: 'omit' | 'include' ;
0 commit comments