isPaymentFailed method

Future<bool> isPaymentFailed(
  1. String bookingId
)

Implementation

Future<bool> isPaymentFailed(String bookingId) async {
  try {
    var response = await Requests.getDio(showLoadingDialog: false)
        .get('booking/$bookingId');
    if (response.statusCode == 200) {
      return !(response.data['status'] == 'booking-confirmed' ||
          response.data['status'] == 'paid');
    } else {
      debugPrint("Error: isPaymentFailed $response");
      return true;
    }
  } catch (e) {
    debugPrint("Error: isPaymentFailed ${e.toString()}");
    return true;
  }
}