fetchPaymentDetails method
Implementation
Future<void> fetchPaymentDetails(String paymentID) async {
Get.find<NotificationsController>().getNotifications();
var response = await Requests.getDio().get(
"payments/$paymentID",
);
print("payment Details$response");
if (response.statusCode == 200) {
paymentStatusData.value =
PaymentStatusModel.fromJson(response.data['data']);
print("payment Details rerererer${paymentStatusData.toJson()}");
if (paymentStatusData.value.purpose == "FLIGHT_BOOKING") {
bookingId = paymentStatusData.value.bookingId ?? "";
getBookingById(paymentStatusData.value.bookingId ?? "");
}
paymentStatusData.refresh();
} else {
CustomFlashWidget.showFlashMessage(
title: "Error",
message: response.data['message'],
type: FlashType.error);
}
}