callIMPSFundingLimitCheck method

dynamic callIMPSFundingLimitCheck(
  1. BuildContext context,
  2. String? mobileNumber,
  3. String accNo,
  4. String bnkName,
  5. String ifscCode,
  6. String amt,
  7. String custMobNo,
  8. String beneficiaryName,
  9. String type,
  10. String mBenfMobNo,
  11. String mMMIDCODE,
  12. String senderName,
  13. String senderMmid,
  14. String pan,
  15. String accountNo,
)

Implementation

callIMPSFundingLimitCheck(
  BuildContext context,
  String? mobileNumber,
  String accNo,
  String bnkName,
  String ifscCode,
  String amt,
  String custMobNo,
  String beneficiaryName,
  String type,
  String mBenfMobNo,
  String mMMIDCODE,
  String senderName,
  String senderMmid,
  String pan,
  String accountNo,
) async {
  print('Jan_Aadhaar_eWallet_AccountHolder_TransactionLimit>>${bnkName}');
  Map<String, dynamic> requestBody = {
    "ApplicationType": kglobal.shared.applcationType,
   // "EntityID": kglobal.shared.EntityID,
    'SSO_ID': mobileNumber,
    'GeoLocation': kglobal.shared.geolocation, //26.8659074,75.8158073
    'MachineID': kglobal.shared.deviceID,
    'MobileNumber': mobileNumber ?? "",
    'Platform': kglobal.shared.kPlatform,
    'ReqType': AppUrl.IMPS_Funding_Limit_Check,
   // "SessionID": kglobal.shared.UserID,
  };
  print("request>>${requestBody}"); //FundTransfer screen
  String bodyJson = jsonEncode(requestBody);

  auth.fundLimitCheckModel(context, bodyJson).then((value) {
    try {
      setBalance(value);
      if (fundLimitCheckModel.value.responseCode?.length == 4) {
        if ((fundLimitCheckModel
                    .value
                    .userLimits?[0]
                    .customerDayTransferLimitCount ??
                0.00) <
            (fundLimitCheckModel
                    .value
                    .userLimits?[0]
                    .mAXDayTransferLimitCount ??
                0.00)) {
          if (double.parse(amt) <
              (fundLimitCheckModel
                      .value
                      .userLimits?[0]
                      .availableMonthTransfer ??
                  0.00)) {
            if (double.parse(amt) <
                (fundLimitCheckModel
                        .value
                        .userLimits?[0]
                        .availableDayTransfer ??
                    0.00)) {
              ProccedToImpsCharges(
                context,
                mobileNumber ?? "",
                accNo,
                bnkName,
                ifscCode,
                amt,
                custMobNo,
                beneficiaryName,
                type,
                mBenfMobNo,
                mMMIDCODE,
                senderName,
                senderMmid,
                pan,
                accountNo,
              );
              print('Success');
            } else {
              // Max Transfer per Day limit exceed
              kglobal.shared.showSnack(
                context,
                true,
                "Transfer limit per day is exceeded.",
              );
            }
          } else {
            kglobal.shared.showSnack(
              context,
              true,
              "Max Transfer Amount per month exceed.",
            );
          }
        } else {
          // Max number of transfer per day exceed
          kglobal.shared.showSnack(
            context,
            true,
            "Max Transfer Amount per month exceed.",
          );
        }
      } else {
        kglobal.shared.showSnack(
          context,
          true,
          fundLimitCheckModel.value.message ?? "",
        );
      }
    } on Exception catch (ex) {
      print(ex);
    }
  });
}