onFailure method

void onFailure({
  1. required IncodesPaymentResponse response,
  2. String? paymentGatewayName,
  3. String? toastMsg,
  4. dynamic onPaymentFailure()?,
  5. bool? isShowToast,
})

Implementation

void onFailure({
  required IncodesPaymentResponse response,
  String? paymentGatewayName,
  String? toastMsg,
  Function()? onPaymentFailure,
  bool? isShowToast,
}) {
  bool isSuccessPayment = response.paymentStatus;
  if (isSuccessPayment) {
    onPaymentFailure?.call();

    isShowToast == true
        ? showToast(
            msg: toastMsg ?? (paymentGatewayName != null ? "$paymentGatewayName Payment Failed" : "Payment Failed"),
          )
        : null;
  }
}