diff --git a/Business/Mobile/MobileServices.cs b/Business/Mobile/MobileServices.cs index 07dad6a..373c9de 100644 --- a/Business/Mobile/MobileServices.cs +++ b/Business/Mobile/MobileServices.cs @@ -1044,8 +1044,6 @@ namespace Business.Mobile } } - //if (string.IsNullOrEmpty(kyc.idNumber)) - if (string.IsNullOrEmpty(kyc.idExpiryDate)) { @@ -2087,43 +2085,46 @@ namespace Business.Mobile }; Log.Debug("SendNotification.EMAIL | REQUEST : " + JsonConvert.SerializeObject(request)); + var resEmail = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL); - res = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL); - - Log.Debug("SendNotification.EMAIL | RESPONSE : " + JsonConvert.SerializeObject(res)); + Log.Debug("SendNotification.EMAIL | RESPONSE : " + JsonConvert.SerializeObject(resEmail)); emailSent = true; - string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms"; - var mobileNo = getSenderFormattedNumber(res.Extra3); - SendSMSApiService _sendAPI = new SendSMSApiService(); - StringBuilder s = new StringBuilder(); - s.AppendLine($"Dear { pwdReset.Username}"); - s.AppendLine($"We received your password reset request and your new credentials are"); - s.AppendLine($"Login ID: { pwdReset.Username}"); - s.AppendLine($"Password: { pwdReset.RandomPassword}"); - s.AppendLine("Regards, IME London"); - - SMSRequestModel _req = new SMSRequestModel - { - ProviderId = "onewaysms", - MobileNumber = pwdReset.mobileNo, - SMSBody = s.ToString(), - ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40), - RequestedBy = pwdReset.Username, - UserName = pwdReset.Username, - method = "send", - ControlNo = "", // GetControlNo() - }; - Log.Debug("SendNotification.SMS | REQUEST : " + JsonConvert.SerializeObject(_req)); - - APIJsonResponse _resp = _sendAPI.SMSTPApi(_req); + var mobileNo = ""; - Log.Debug("SendNotification.SMS | RESPONSE : " + JsonConvert.SerializeObject(_resp)); - smsSent = true; + if (!string.IsNullOrEmpty(res.Extra3)) + { + mobileNo = getSenderFormattedNumber(res.Extra3); + + SendSMSApiService _sendAPI = new SendSMSApiService(); + StringBuilder s = new StringBuilder(); + s.AppendLine($"Dear { res.Extra2}"); + s.AppendLine($"We received your password reset request and your new credentials are"); + s.AppendLine($"Login ID: { pwdReset.Username}"); + s.AppendLine($"Password: { pwdReset.RandomPassword}"); + s.AppendLine("Regards, IME London"); + SMSRequestModel _req = new SMSRequestModel + { + ProviderId = "onewaysms", + MobileNumber = mobileNo, + SMSBody = s.ToString(), + ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40), + RequestedBy = pwdReset.Username, + UserName = pwdReset.Username, + method = "send", + ControlNo = "", // GetControlNo() + }; + Log.Debug("SendNotification.SMS | REQUEST : " + JsonConvert.SerializeObject(_req)); + APIJsonResponse _resp = _sendAPI.SMSTPApi(_req); + + Log.Debug("SendNotification.SMS | RESPONSE : " + JsonConvert.SerializeObject(_resp)); + smsSent = true; + } } catch (Exception ex) { + Log.Error("ResetPassword.SendNotification", ex); } if (emailSent || smsSent) @@ -2184,6 +2185,7 @@ namespace Business.Mobile Log.Debug("GetWalletStatement | Returning null while fetching the list of wallet statements."); return jsonRx; } + jsonRx.ErrorCode = "0"; jsonRx.Data = liWalletStmtResponse; @@ -2403,11 +2405,11 @@ namespace Business.Mobile var requiredList = props.Where(x => list.Any(z => x.Key.ToLower() == z.Field.ToLower())) .Where(y => string.IsNullOrEmpty(y.Value)).ToList(); // case when Field Value empty - var pLength = props.SingleOrDefault(p => p.Key.ToLower().Equals("mobile")).Value.Length; - var rLength = list.SingleOrDefault(p => p.Field.ToLower().Equals("mobile")).MinLength; + //var pLength = props.SingleOrDefault(p => p.Key.ToLower().Equals("mobile")).Value.Length; + //var rLength = list.SingleOrDefault(p => p.Field.ToLower().Equals("mobile")).MinLength; - if (pLength < rLength) - requiredList.Add(new KeyValuePair() { Key = "mobile" }); + //if (pLength < rLength) + // requiredList.Add(new KeyValuePair() { Key = "mobile" }); if (requiredList.Count > 0) { @@ -3017,7 +3019,7 @@ namespace Business.Mobile } } - + public List