onFailure method
void
onFailure({
- required IncodesPaymentResponse response,
- String? paymentGatewayName,
- String? toastMsg,
- dynamic onPaymentFailure()?,
- 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;
}
}