@@ -23,7 +23,11 @@ abstract class BaseTransactionManager {
2323 final Transaction transaction = Transaction ();
2424 final String publicKey;
2525
26- BaseTransactionManager ({required this .charge, required this .context, required this .publicKey});
26+ BaseTransactionManager ({
27+ required this .charge,
28+ required this .context,
29+ required this .publicKey,
30+ });
2731
2832 initiate () async {
2933 if (processing) throw ProcessingException ();
@@ -120,15 +124,17 @@ abstract class BaseTransactionManager {
120124 }
121125
122126 Future <CheckoutResponse > getAuthFrmUI (String ? url) async {
123- String result =
124- await (Utils .methodChannel.invokeMethod ('getAuthorization' , {"authUrl" : url})
125- as FutureOr <String >);
126- TransactionApiResponse apiResponse;
127- try {
128- Map <String , dynamic > responseMap = json.decode (result);
129- apiResponse = TransactionApiResponse .fromMap (responseMap);
130- } catch (e) {
131- apiResponse = TransactionApiResponse .unknownServerResponse ();
127+ TransactionApiResponse apiResponse =
128+ TransactionApiResponse .unknownServerResponse ();
129+
130+ String ? result = await Utils .methodChannel
131+ .invokeMethod <String >('getAuthorization' , {"authUrl" : url});
132+
133+ if (result != null ) {
134+ try {
135+ Map <String , dynamic > responseMap = json.decode (result);
136+ apiResponse = TransactionApiResponse .fromMap (responseMap);
137+ } catch (e) {}
132138 }
133139 return _initApiResponse (apiResponse);
134140 }
0 commit comments