public void parses_error_string() { var response = "?valid=false&trans_id=72034c29-72bb-4b29-b4ef-849fa15440202012-10-05_03:59:55&code=N&message=No {1} transaction found&resp_code=30"; var data = new PayPointReturnData(response); Assert.That(data.HasError, Is.True); Assert.That(data.Code, Is.EqualTo("N")); }
} //IsCollectionSuccessful private bool IsNotEnoughMoney(PayPointReturnData payPointReturnData) { bool isNotEnoughMoney = payPointReturnData.Code == "N" && payPointReturnData.Error == "INSUFF FUNDS"; Error = string.Format("Checking if return status is INSUFF FUNDS. Code:{0} Message:{1} AuthCode:{2} RespCode:{3} Error:{4} Result:{5}", payPointReturnData.Code, payPointReturnData.Message, payPointReturnData.AuthCode, payPointReturnData.RespCode, payPointReturnData.Error, isNotEnoughMoney); Log.Debug(Error); NL_AddLog(LogType.Info, "IsNotEnoughMoney", this.strategyArgs, Error, null, null); return(isNotEnoughMoney); } //IsNotEnoughMoney
} //MakeAutoPayment private static bool IsCollectionSuccessful(PayPointReturnData payPointReturnData) { return(payPointReturnData.Code == "A"); } //IsCollectionSuccessful
} //ShouldCharge private bool MakeAutoPayment(int customerId, int loanId, int loanScheduleId, decimal amountDue, out PayPointReturnData result) { try { result = this.payPointApi.MakeAutomaticPayment(customerId, loanId, loanScheduleId, amountDue); NL_AddLog(LogType.Debug, "MakeAutoPayment success", new object[] { customerId, loanId, loanScheduleId, amountDue }, result, null, null); return(true); // ReSharper disable once CatchAllClause } catch (Exception ex) { Error = string.Format("Failed making auto payment for loan schedule id:{0} exception:{1}", loanScheduleId, ex); Log.Error(Error); NL_AddLog(LogType.Error, "MakeAutoPayment failed", new object[] { customerId, loanId, loanScheduleId, amountDue }, Error, ex.Message, ex.StackTrace); result = null; return(false); } //try } //MakeAutoPayment