|
|
@ -32,6 +32,7 @@ using Repository; |
|
|
|
using System.Configuration; |
|
|
|
using Business.TrustDoc; |
|
|
|
using Business.Addressy; |
|
|
|
using System.Text; |
|
|
|
|
|
|
|
namespace Business.Mobile |
|
|
|
{ |
|
|
@ -144,10 +145,9 @@ namespace Business.Mobile |
|
|
|
{ |
|
|
|
var lang = Convert.ToString(CallContext.GetData(Constants.Language)); |
|
|
|
JsonRxResponse jsonRx = new JsonRxResponse(); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
requestOTPModel.OTP = Utilities.GenerateOTP(); |
|
|
|
requestOTPModel.OTP = Utilities.GenerateOTP(); //implement the logic to send OTP SMS in customers mobile.
|
|
|
|
jsonRx = _requestServices.RequestOTP(requestOTPModel); |
|
|
|
Log.Debug("GenerateOTP | RESPONSE : " + JsonConvert.SerializeObject(jsonRx)); |
|
|
|
|
|
|
@ -157,6 +157,7 @@ namespace Business.Mobile |
|
|
|
bool smsSent = false; |
|
|
|
if (requestOTPModel.userId.IsValidEmail()) |
|
|
|
{ |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(jsonRx.ErrorCode) && jsonRx.ErrorCode.Equals("0")) |
|
|
|
{ |
|
|
|
List<Notify.Mapping> bodyMappings = new List<Notify.Mapping>(); |
|
|
@ -184,8 +185,12 @@ namespace Business.Mobile |
|
|
|
DeviceType = requestOTPModel.DeviceType, |
|
|
|
} } |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Log.Debug("SendNotification.EMAIL | REQUEST : " + JsonConvert.SerializeObject(request)); |
|
|
|
|
|
|
|
var jsonRx1 = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL); |
|
|
|
|
|
|
|
Log.Debug("SendNotification.EMAIL | RESPONSE : " + JsonConvert.SerializeObject(jsonRx1)); |
|
|
|
emailSent = true; |
|
|
|
} |
|
|
@ -197,24 +202,34 @@ namespace Business.Mobile |
|
|
|
try |
|
|
|
{ |
|
|
|
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms"; |
|
|
|
SendSMSApiService _sendAPI = new SendSMSApiService(); |
|
|
|
|
|
|
|
string mobileNum = jsonRx.Extra2; |
|
|
|
var mobNum = getSenderFormattedNumber(mobileNum); |
|
|
|
SendSMSApiService _sendAPI = new SendSMSApiService(); |
|
|
|
|
|
|
|
StringBuilder s = new StringBuilder(); |
|
|
|
s.AppendLine($"Dear { jsonRx.Extra}"); |
|
|
|
s.AppendLine($"Your OTP code for Customer Registration is {requestOTPModel.OTP }."); |
|
|
|
s.AppendLine("Regards, IME London"); |
|
|
|
|
|
|
|
SMSRequestModel _req = new SMSRequestModel |
|
|
|
{ |
|
|
|
ProviderId = "onewaysms", |
|
|
|
MobileNumber = mobNum, //jsonRx.Extra2,
|
|
|
|
SMSBody = Common.Model.Enum.NotifyTemplate.OTP_EMAIL, |
|
|
|
MobileNumber = mobileNum, |
|
|
|
SMSBody = s.ToString(), |
|
|
|
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40), |
|
|
|
RequestedBy = requestOTPModel.userId, |
|
|
|
UserName = requestOTPModel.userId, |
|
|
|
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 smsException) |
|
|
@ -228,16 +243,19 @@ namespace Business.Mobile |
|
|
|
return jsonRx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
jsonRx.ErrorCode = "1"; |
|
|
|
var map = Utilities.GetLanguageMapping(RESPONSE_MSG.OLD_USER_REGISTER_FAIL_11.ToString(), lang); |
|
|
|
return new JsonRxResponse { ErrorCode = jsonRx.ErrorCode, Msg = map.Message }; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
jsonRx.ErrorCode = jsonRx.ErrorCode == "103" ? "0" : jsonRx.ErrorCode; // 103 = previous OTP was not expired, so the same was used
|
|
|
|
jsonRx.ErrorCode = jsonRx.ErrorCode == "103" ? "0" : jsonRx.ErrorCode;//103 = previous OTP was not expired so same was used
|
|
|
|
return jsonRx; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
@ -246,13 +264,10 @@ namespace Business.Mobile |
|
|
|
jsonRx.SetResponse("1", "Error occurred while calling RequestOTP."); |
|
|
|
return jsonRx; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private string getSenderFormattedNumber(string number) |
|
|
|
{ |
|
|
|
string finalNo = number; |
|
|
|
|
|
|
|
if (!number.Contains("+44")) |
|
|
|
{ |
|
|
|
string mobileFirst = number.Substring(0, 1); |
|
|
@ -272,12 +287,10 @@ namespace Business.Mobile |
|
|
|
{ |
|
|
|
finalNo = $"+44{number}"; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (number.Contains("+44")) |
|
|
|
{ |
|
|
|
string MobN = number.Substring(4, 1); |
|
|
|
|
|
|
|
if (MobN == "0" && number.Length > 14) |
|
|
|
{ |
|
|
|
finalNo = number.Remove(4, 1); |
|
|
@ -668,8 +681,6 @@ namespace Business.Mobile |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(custKyc.RegistrationType) && custKyc.RegistrationType.Equals("EKYC")) |
|
|
|
{ |
|
|
|
isKyc = true; |
|
|
@ -684,6 +695,8 @@ namespace Business.Mobile |
|
|
|
// isBackRequired = id["isBackRequired"].ToString();
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
Log.Debug($"RegisterKYC | httpRequest : {httpRequest.Params}"); |
|
|
|
Log.Debug($"RegisterKYC | REQUEST : { JsonConvert.SerializeObject(custKyc)} | Files: { httpRequest.Files.Count}"); |
|
|
|
|
|
|
|
|
|
|
@ -1002,33 +1015,53 @@ namespace Business.Mobile |
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//if (string.IsNullOrEmpty(kyc.otherOccupation) && string.IsNullOrEmpty(kyc.occupation))
|
|
|
|
if (string.IsNullOrEmpty(kyc.otherOccupation) && string.IsNullOrEmpty(kyc.occupation)) |
|
|
|
{ |
|
|
|
enumString = RESPONSE_MSG.VALIDATE_FORM_2.ToString(); |
|
|
|
var map = Utilities.GetLanguageMapping(enumString, lang); |
|
|
|
jsonRx.SetResponse("1", map.Message); |
|
|
|
|
|
|
|
return jsonRx; |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(kyc.occupation)) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(kyc.otherOccupation)) |
|
|
|
{ |
|
|
|
enumString = RESPONSE_MSG.VALIDATE_FORM_9.ToString(); |
|
|
|
var map = Utilities.GetLanguageMapping(enumString, lang); |
|
|
|
jsonRx.SetResponse("1", map.Message); |
|
|
|
|
|
|
|
return jsonRx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//if (string.IsNullOrEmpty(kyc.idNumber))
|
|
|
|
//{
|
|
|
|
// enumString = RESPONSE_MSG.VALIDATE_FORM_2.ToString();
|
|
|
|
// var map = Utilities.GetLanguageMapping(enumString, lang);
|
|
|
|
// jsonRx.SetResponse("1", map.Message);
|
|
|
|
|
|
|
|
// jsonRx.SetResponse("1", "Id number is required");
|
|
|
|
// return jsonRx;
|
|
|
|
//}
|
|
|
|
//else if (string.IsNullOrEmpty(kyc.occupation))
|
|
|
|
//{
|
|
|
|
// if (string.IsNullOrEmpty(kyc.otherOccupation))
|
|
|
|
|
|
|
|
|
|
|
|
//if (string.IsNullOrEmpty(kyc.idExpiryDate))
|
|
|
|
//{
|
|
|
|
// enumString = RESPONSE_MSG.VALIDATE_FORM_9.ToString();
|
|
|
|
// var map = Utilities.GetLanguageMapping(enumString, lang);
|
|
|
|
// jsonRx.SetResponse("1", map.Message);
|
|
|
|
|
|
|
|
// jsonRx.SetResponse("1", "IdExpiryDate is required");
|
|
|
|
// return jsonRx;
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
//if (string.IsNullOrEmpty(kyc.idStartDate))
|
|
|
|
//{
|
|
|
|
|
|
|
|
//if (string.IsNullOrEmpty(kyc.monthlyIncome))
|
|
|
|
// jsonRx.SetResponse("1", "Idissue Date is required");
|
|
|
|
// return jsonRx;
|
|
|
|
//}
|
|
|
|
//if (string.IsNullOrEmpty(kyc.idIssuingCountry))
|
|
|
|
//{
|
|
|
|
// enumString = RESPONSE_MSG.VALIDATE_FORM_3.ToString();
|
|
|
|
// var map = Utilities.GetLanguageMapping(enumString, lang);
|
|
|
|
// jsonRx.SetResponse("1", map.Message);
|
|
|
|
|
|
|
|
// jsonRx.SetResponse("1", "idIssuingCountry is required");
|
|
|
|
// return jsonRx;
|
|
|
|
//}
|
|
|
|
|
|
|
|
//if (string.IsNullOrEmpty(kyc.additionalAddress))
|
|
|
|
//{
|
|
|
|
// enumString = RESPONSE_MSG.VALIDATE_FORM_4.ToString();
|
|
|
@ -1907,29 +1940,9 @@ namespace Business.Mobile |
|
|
|
|
|
|
|
res = _requestServices.CustomerInfoAgree(username, "agree"); |
|
|
|
|
|
|
|
//if (res.ErrorCode.Equals("0"))
|
|
|
|
//{
|
|
|
|
|
|
|
|
// _trustDocBusiness.CompareData(new TrustDocRequest() { birth = res.Extra2, name = res.Msg }, res.Extra3, username, res.Id);
|
|
|
|
|
|
|
|
// SendNotificationRequest request = new SendNotificationRequest()
|
|
|
|
// {
|
|
|
|
// IsBulkNotification = false,
|
|
|
|
// UserName = username,
|
|
|
|
// ProcessId = Guid.NewGuid().ToString(),
|
|
|
|
// ProviderId = "CustomerInfoAgree",
|
|
|
|
// NotificationTypeId = NOTIFICATION_TYPE.PUSH_NOTIFICATION.ToString(),
|
|
|
|
// //Template = Common.Model.Enum.NotifyTemplate.NEW_REGISTER_WELCOME,
|
|
|
|
// Recipients = new List<RecipientViewModel>()
|
|
|
|
// {
|
|
|
|
// new RecipientViewModel() { Address= res.Extra , NotificationContent = new NotificationDTO() }
|
|
|
|
// },
|
|
|
|
// Language = Convert.ToString(CallContext.GetData(Constants.Language))
|
|
|
|
// };
|
|
|
|
// Task.Run(() => NotifierV2.SendNotification(request, NOTIFICATION_TYPE.PUSH_NOTIFICATION));
|
|
|
|
//}
|
|
|
|
if (res.ErrorCode.Equals("0")) |
|
|
|
{ |
|
|
|
|
|
|
|
// _trustDocBusiness.CompareData(new TrustDocRequest() { birth = res.Extra2, name = res.Msg }, res.Extra3, username, res.Id);
|
|
|
|
res.Msg = "Thank you for completing your profile. You can now start sending transactions"; |
|
|
|
|
|
|
@ -1961,10 +1974,8 @@ namespace Business.Mobile |
|
|
|
// },
|
|
|
|
// Language = Convert.ToString(CallContext.GetData(Constants.Language))
|
|
|
|
//};
|
|
|
|
|
|
|
|
//Task.Run(() => NotifierV2.SendNotification(emailNotificationRequest, NOTIFICATION_TYPE.EMAIL));
|
|
|
|
} |
|
|
|
|
|
|
|
Log.Debug("CustomerInfoAgree.Agree | DB RESPONSE : " + JsonConvert.SerializeObject(res)); |
|
|
|
} |
|
|
|
//else if (agreeYn.Equals("N"))
|
|
|
@ -2018,6 +2029,8 @@ namespace Business.Mobile |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
List<Notify.Mapping> bodyMappings = new List<Notify.Mapping>(); |
|
|
|
bodyMappings.Add(new Notify.Mapping() { SValue = "CustomerName", SText = res.Extra2 }); |
|
|
|
bodyMappings.Add(new Notify.Mapping() { SValue = "EMAIL_ID", SText = pwdReset.Username }); |
|
|
@ -2046,13 +2059,11 @@ namespace Business.Mobile |
|
|
|
|
|
|
|
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms"; |
|
|
|
SendSMSApiService _sendAPI = new SendSMSApiService(); |
|
|
|
|
|
|
|
//GetSMSTextForTxn
|
|
|
|
SMSRequestModel _req = new SMSRequestModel |
|
|
|
{ |
|
|
|
ProviderId = "onewaysms", |
|
|
|
MobileNumber = pwdReset.mobileNo, |
|
|
|
SMSBody = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL, |
|
|
|
SMSBody = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL.ToString(), |
|
|
|
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40), |
|
|
|
RequestedBy = pwdReset.Username, |
|
|
|
UserName = pwdReset.Username, |
|
|
@ -2932,7 +2943,6 @@ namespace Business.Mobile |
|
|
|
|
|
|
|
return jsonRx; |
|
|
|
} |
|
|
|
|
|
|
|
else if (type == Common.Model.Config.MappingType.REWARD_POINT) |
|
|
|
{ |
|
|
|
var response1 = _requestServices.GetRewardFee(customerId); |
|
|
@ -2999,7 +3009,6 @@ namespace Business.Mobile |
|
|
|
public List<Option> GetPaymentMethods() |
|
|
|
{ |
|
|
|
var paymentMethods = _requestServices.GetPaymentMethod(); |
|
|
|
|
|
|
|
List<Option> options; |
|
|
|
string mappingPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["PaymentConfigFilePath"].ToString()); |
|
|
|
using (StreamReader reader = File.OpenText(mappingPath)) |
|
|
@ -3010,17 +3019,13 @@ namespace Business.Mobile |
|
|
|
foreach (var paymentMethod in paymentMethods) |
|
|
|
{ |
|
|
|
var matchingOption = options.FirstOrDefault(option => option.Code == paymentMethod.Key); |
|
|
|
|
|
|
|
if (matchingOption != null) |
|
|
|
{ |
|
|
|
matchingOption.Value = paymentMethod.Value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return options; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JsonRxResponse ValidateReferralCode(string referralCode) |
|
|
|
{ |
|
|
|
JsonRxResponse jsonRx = new JsonRxResponse(); |
|
|
|