Browse Source

Merge branch 'feature/Redmine-17825-Email_Template' of http://202.166.220.79:3000/IME-LONDON/MOBILE_API into feature/Redmine-17825-Email_Template

feature/Redmine-17825-Email_Template
shakun 10 months ago
parent
commit
91369f89bf
  1. 81
      Business/Mobile/MobileServices.cs
  2. 6
      Common/Model/RewardFee.cs
  3. 13
      Repository/Mobile/MobileServicesRepo.cs

81
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<Option> GetPaymentMethods()
{
var paymentMethods = _requestServices.GetPaymentMethod();
@ -3028,15 +3030,20 @@ namespace Business.Mobile
var jsonS = reader.ReadToEnd();
options = JsonConvert.DeserializeObject<List<Option>>(jsonS);
}
List<Option> matchingOptions = new List<Option>();
foreach (var paymentMethod in paymentMethods)
{
var matchingOption = options.FirstOrDefault(option => option.Code == paymentMethod.Key);
if (matchingOption != null)
{
matchingOption.Value = paymentMethod.Value;
matchingOptions.Add(matchingOption);
}
}
return options;
return matchingOptions;
}
public JsonRxResponse ValidateReferralCode(string referralCode)
{

6
Common/Model/RewardFee.cs

@ -41,9 +41,5 @@ namespace Common.Model
public string RedirectURL { get; set; }
public string CheckSuccessURL { get; set; }
public string CheckFailURL { get; set; }
}
public string CheckSuccessURL { get; set; }
public string CheckFailURL { get; set; }
}
}
}

13
Repository/Mobile/MobileServicesRepo.cs

@ -1710,7 +1710,7 @@ namespace Repository.Mobile
}
else if (status.Equals("PAID"))
{
return "#008000";
return "#2ED636";
}
else if (status.Equals("CANCELLED"))
{
@ -1718,26 +1718,25 @@ namespace Repository.Mobile
}
else
return "#514e82";
}
private string GetTextCode(string status)
{
if (status.Equals("AWAITING PAYMENT") || status.Equals("PENDING"))
{
return "#964B00";
return "#FFFFFF";
}
else if (status.Equals("PROCESSING"))
{
return "##262262";
return "#FFFFFF";
}
else if (status.Equals("PAID"))
{
return "#262262";
return "#000000";
}
else if (status.Equals("CANCELLED"))
{
return "#262262";
return "#000000";
}
else
return "#FFFFFF";
@ -3005,7 +3004,7 @@ namespace Repository.Mobile
additionalIdName = item["fileName"].ToString();
else if (item["fileDescription"].ToString() == "additionalIdBackCustUpload")
additionalIdBackName = item["fileName"].ToString();
else if (item["fileDescription"].ToString() == "facePictureCustUpload")
else if (item["fileDescription"].ToString() == "SelfieCustUpload") //facePictureCustUpload
facePictureName = item["fileName"].ToString();
registerDate = item["REGISTERED_DATE"].ToString();

Loading…
Cancel
Save