6/22/1
This commit is contained in:
@@ -79,7 +79,6 @@ class PaymobPayment {
|
||||
'api_key': _apiKey,
|
||||
},
|
||||
);
|
||||
print(response.data['token']);
|
||||
|
||||
return response.data['token'];
|
||||
} catch (e) {
|
||||
@@ -105,7 +104,6 @@ class PaymobPayment {
|
||||
"items": items,
|
||||
},
|
||||
);
|
||||
print(response.data['id']);
|
||||
|
||||
return response.data['id'];
|
||||
} catch (e) {
|
||||
@@ -138,7 +136,6 @@ class PaymobPayment {
|
||||
if (message != null) {
|
||||
throw Exception(message);
|
||||
}
|
||||
print(response.data['token']);
|
||||
return response.data['token'];
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ class PaymobPaymentWallet {
|
||||
'api_key': _apiKey,
|
||||
},
|
||||
);
|
||||
print(response.data['token']);
|
||||
return response.data['token'];
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
@@ -104,7 +103,6 @@ class PaymobPaymentWallet {
|
||||
"items": items,
|
||||
},
|
||||
);
|
||||
print(response.data['id']);
|
||||
return response.data['id'];
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
@@ -136,7 +134,6 @@ class PaymobPaymentWallet {
|
||||
// if (message != null) {
|
||||
// throw Exception(message);
|
||||
// }
|
||||
print(response.data['token']);
|
||||
return response.data['token'];
|
||||
}
|
||||
|
||||
@@ -161,16 +158,13 @@ class PaymobPaymentWallet {
|
||||
if (response.statusCode == 200) {
|
||||
final paymentData = response.data; // Assuming JSON response
|
||||
|
||||
print("redirection_url: ${paymentData['iframe_redirection_url']}");
|
||||
return paymentData['iframe_redirection_url'];
|
||||
// Navigate to success screen or display success message
|
||||
} else {
|
||||
// Payment failed: Handle errors (e.g., display error message)
|
||||
print("Payment failed: ${response.statusCode} - ${response.data}");
|
||||
}
|
||||
} on DioError catch (e) {
|
||||
// Handle network or Dio-related errors
|
||||
print("Error making payment request: $e");
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user