@@ -157,6 +157,7 @@ function useFlutterwave(flutterWaveConfig) {
157157 switch ( _b . label ) {
158158 case 0 :
159159 if ( ! ( response . status === "successful" ) ) return [ 3 /*break*/ , 2 ] ;
160+ callback ( response ) ;
160161 return [ 4 /*yield*/ , fetch ( "https://cors-anywhere.herokuapp.com/https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent" , {
161162 method : "post" ,
162163 headers : {
@@ -172,24 +173,24 @@ function useFlutterwave(flutterWaveConfig) {
172173 } ) ] ;
173174 case 1 :
174175 _b . sent ( ) ;
175- callback ( response ) ;
176176 return [ 3 /*break*/ , 4 ] ;
177- case 2 : return [ 4 /*yield*/ , fetch ( "https://cors-anywhere.herokuapp.com/https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent" , {
178- method : "post" ,
179- headers : {
180- "Content-Type" : "application/json" ,
181- } ,
182- body : JSON . stringify ( {
183- publicKey : ( _a = flutterWaveConfig . public_key ) !== null && _a !== void 0 ? _a : "" ,
184- language : "Flutterwave-React-v3" ,
185- version : "1.0.7" ,
186- title : "" + ( ( flutterWaveConfig === null || flutterWaveConfig === void 0 ? void 0 : flutterWaveConfig . payment_options . split ( "," ) . length ) > 1 ? "Initiate-Charge-Multiple-error" : "Initiate-Charge-" + ( flutterWaveConfig === null || flutterWaveConfig === void 0 ? void 0 : flutterWaveConfig . payment_options ) + "-error" ) ,
187- message : "15s"
188- } )
189- } ) ] ;
177+ case 2 :
178+ callback ( response ) ;
179+ return [ 4 /*yield*/ , fetch ( "https://cors-anywhere.herokuapp.com/https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent" , {
180+ method : "post" ,
181+ headers : {
182+ "Content-Type" : "application/json" ,
183+ } ,
184+ body : JSON . stringify ( {
185+ publicKey : ( _a = flutterWaveConfig . public_key ) !== null && _a !== void 0 ? _a : "" ,
186+ language : "Flutterwave-React-v3" ,
187+ version : "1.0.7" ,
188+ title : "" + ( ( flutterWaveConfig === null || flutterWaveConfig === void 0 ? void 0 : flutterWaveConfig . payment_options . split ( "," ) . length ) > 1 ? "Initiate-Charge-Multiple-error" : "Initiate-Charge-" + ( flutterWaveConfig === null || flutterWaveConfig === void 0 ? void 0 : flutterWaveConfig . payment_options ) + "-error" ) ,
189+ message : "15s"
190+ } )
191+ } ) ] ;
190192 case 3 :
191193 _b . sent ( ) ;
192- callback ( response ) ;
193194 _b . label = 4 ;
194195 case 4 : return [ 2 /*return*/ ] ;
195196 }
0 commit comments