onSuccess method

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

Implementation

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

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