Browse Source

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

Mobile-pdf
Leeza Baidar 11 months ago
parent
commit
935320c6da
  1. 247
      Business/Mobile/MobileServices.cs
  2. 4
      Business/MobileV2/IMobileV2Business.cs
  3. 35
      Business/MobileV2/MobileV2Business.cs
  4. 19
      Business/SendMoney/SendMoneyBusiness.cs
  5. 1
      Common/APIJsonResponse.cs
  6. 1
      Common/Model/Enum/Notifications.cs
  7. 1
      Common/Model/LoginResponse.cs
  8. 30
      Common/Model/MobileV2/CustomerProfileV2.cs
  9. 5
      Common/Model/Notification/SMSRequestModel.cs
  10. 12
      Common/Model/RewardFee.cs
  11. 3
      Common/Model/StaticData.cs
  12. 1
      Common/RestApiClient.cs
  13. 71
      JsonRx/Api/SendMoneyController.cs
  14. 64
      JsonRx/ApiV3/MobileV3Controller.cs
  15. 4
      JsonRx/ApiV3/SendTransactionController.cs
  16. 45
      JsonRx/Helper/Util.cs
  17. 2
      JsonRx/Web.config
  18. 1
      Repository/Dao.cs
  19. 1
      Repository/MobileV2/IMobileV2Repo.cs
  20. 10
      Repository/MobileV2/MobileV2Repo.cs

247
Business/Mobile/MobileServices.cs

@ -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>();
@ -173,71 +174,88 @@ namespace Business.Mobile
ProviderId = "REQUESTOTP_EMAIL",
Template = Common.Model.Enum.NotifyTemplate.OTP_EMAIL,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel()
{
new RecipientViewModel()
{
NotificationContent = new NotificationDTO() {
Body = JsonConvert.SerializeObject(bodyMappings),
//Title will be set by mapping json
},
Address= requestOTPModel.userId,
DeviceType = requestOTPModel.DeviceType,
Body = JsonConvert.SerializeObject(bodyMappings),
//Title will be set by mapping json
},
Address= requestOTPModel.userId,
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;
}
catch (Exception emailException)
{
Log.Error("Error sending email", emailException);
}
try
{
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms";
SendSMSApiService _sendAPI = new SendSMSApiService();
string mobileNum = jsonRx.Extra2;
var mobNum = getSenderFormattedNumber(mobileNum);
}
SMSRequestModel _req = new SMSRequestModel
try
{
ProviderId = "onewaysms",
MobileNumber = mobNum, //jsonRx.Extra2,
SMSBody = Common.Model.Enum.NotifyTemplate.OTP_EMAIL,
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40),
RequestedBy = requestOTPModel.userId,
UserName = requestOTPModel.userId,
method = "send",
ControlNo = "", // GetControlNo()
};
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms";
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 = 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);
APIJsonResponse _resp = _sendAPI.SMSTPApi(_req);
Log.Debug("SendNotification.SMS | RESPONSE : " + JsonConvert.SerializeObject(_resp));
smsSent = true;
}
catch (Exception smsException)
{
Log.Error("Error sending SMS", smsException);
}
if (emailSent || smsSent)
{
jsonRx.ErrorCode = "0";
smsSent = true;
}
catch (Exception smsException)
{
Log.Error("Error sending SMS", smsException);
}
if (emailSent || smsSent)
{
jsonRx.ErrorCode = "0";
jsonRx.SetResponse("0", "OTP has been Sent.");
return jsonRx;
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.idExpiryDate))
//{
// 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;
// }
// 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,20 +2029,22 @@ namespace Business.Mobile
{
try
{
List<Notify.Mapping> bodyMappings = new List<Notify.Mapping>();
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 });
bodyMappings.Add(new Notify.Mapping() { SValue = "PASS_WORD", SText = randomPassword });
bodyMappings.Add(new Notify.Mapping() { SValue = "PASS_WORD", SText = randomPassword });
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = pwdReset.Username,
ProcessId = processId,
ProviderId = "ResetPassword",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
Template = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL,
Recipients = new List<RecipientViewModel>()
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = pwdReset.Username,
ProcessId = processId,
ProviderId = "ResetPassword",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
Template = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel()
{
@ -2042,25 +2055,23 @@ namespace Business.Mobile
Address= pwdReset.Username
}
}
};
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,
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40),
RequestedBy = pwdReset.Username,
UserName = pwdReset.Username,
method = "send",
ControlNo = "", // GetControlNo()
};
APIJsonResponse _resp = _sendAPI.SMSTPApi(_req);
res = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms";
SendSMSApiService _sendAPI = new SendSMSApiService();
SMSRequestModel _req = new SMSRequestModel
{
ProviderId = "onewaysms",
MobileNumber = pwdReset.mobileNo,
SMSBody = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL.ToString(),
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40),
RequestedBy = pwdReset.Username,
UserName = pwdReset.Username,
method = "send",
ControlNo = "", // GetControlNo()
};
APIJsonResponse _resp = _sendAPI.SMSTPApi(_req);
res = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
}
catch (Exception ex)
{
@ -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();

4
Business/MobileV2/IMobileV2Business.cs

@ -13,8 +13,12 @@ namespace Business.MobileV2
{
JsonRxResponse GetReceiverInformationV2(DateFilterParams search, string customerId, string countryId);
JsonRxResponse RefreshDashboardInformationV2(UserModel model);
CustomerDetailV2 GetCustomerProfile(string userId);
JsonRxResponse SaveCustomerProfile(CustomerDetailV2 profileV2);
JsonRxResponse CustomerProfile(CustomerProfileV2 profileV2);
JsonRxResponse GetKycSettings(KycRequest kycRequest);
JsonRxResponse SaveKycSettings(KycOption kycRequest);

35
Business/MobileV2/MobileV2Business.cs

@ -72,7 +72,7 @@ namespace Business.Mobile
filePath = "https://uat.imelondon.co.uk:1081/images/banners/Imebanner.jpg",
fileTitle = "file1",
Redirect = true,
RedirectURL= "https://imelondon.co.uk/"
RedirectURL = "https://imelondon.co.uk/"
});
dashBoardV2.bannerImages.Add(new BannerImages()
{
@ -110,8 +110,40 @@ namespace Business.Mobile
return jsonResult;
}
public CustomerDetailV2 GetCustomerProfile(string userId)
{
CustomerDetailV2 v2 = new CustomerDetailV2();
try
{
DataRow p = _requestServicesv2.GetProfileDetails(userId);
v2.FullName = p["FullName"].ToString();
v2.UserId = p["UserId"].ToString();
v2.Username = p["email"].ToString();
v2.PostalCode = p["zipCode"].ToString();
v2.Gender = p["gender"].ToString();
v2.DOB = p["dob"].ToString();
v2.MobileNumber = p["mobile"].ToString();
v2.Nationality = p["nativeCountry"].ToString();
v2.City = p["city"].ToString();
v2.Address1 = p["address"].ToString();
v2.Address2 = p["ADDITIONALADDRESS"].ToString();
}
catch (Exception ex)
{
throw;
}
return v2;
}
public JsonRxResponse SaveCustomerProfile(CustomerDetailV2 profileV2)
{
JsonRxResponse jsonRx = new JsonRxResponse() { ErrorCode ="0", Msg = "Success" };
return jsonRx;
}
public JsonRxResponse CustomerProfile(CustomerProfileV2 profileV2)
{
JsonRxResponse jsonRx = new JsonRxResponse();
@ -172,7 +204,6 @@ namespace Business.Mobile
try
{
var response = Utilities.GetKYCSettings(kycRequest);
if (response != null)

19
Business/SendMoney/SendMoneyBusiness.cs

@ -500,6 +500,7 @@ namespace Business.SendMoney
APIJsonResponse result = _tpApi.ThirdPartyApiGetDataOnly<TpSendMoney, APIJsonResponse>(tp, "TP/mobileSendTxn", out jsonResponse);
Log.Debug("DOTRANSACTION | TPAPI RESPONSE : " + JsonConvert.SerializeObject(result));
response = new JsonRxResponse()
{
ErrorCode = result.ResponseCode,
@ -507,12 +508,26 @@ namespace Business.SendMoney
Msg = result.Msg,
Data = result.Data,
Extra = result.Extra,
Extra2 = result.Extra1,
Extra2 = result.Extra2,
Extra3 = result.Extra3
};
if (response.ErrorCode.Equals("0"))
{
//var randomPassword = PasswordGenerator.GenerateRandomPassword(new PasswordGenerator.PasswordOptions()
//{ RequireDigit = true, RequiredLength = 10, RequiredUniqueChars = 2, RequireLowercase = true, RequireNonAlphanumeric = true, RequireUppercase = true });
Gateway gateway = new Gateway()
{
Code = result.Extra2,
IsRedirect = result.Extra3.Equals("Y") ? true : false,
//Token = randomPassword,
RedirectURL = $"https:////uat.imelondon.co.uk:1081/payment/STPaymentCustomerRedirect.aspx?id={result.Id}&ref={Guid.NewGuid()}&token=",
CheckSuccessURL = "https://uat.imelondon.co.uk:1081/payment/STPaymentSuccess.aspx",
CheckFailURL = "https://uat.imelondon.co.uk:1081/payment/STPaymentFail.aspx"
};
response.Data = gateway;
string email = model.User;
try
@ -542,7 +557,7 @@ namespace Business.SendMoney
}
}
};
NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
}
catch (Exception ex)

1
Common/APIJsonResponse.cs

@ -8,6 +8,7 @@
public object Data { get; set; }
public string Extra { get; set; }
public string Extra1 { get; set; }
public string Extra2 { get; set; }
public string Extra3 { get; set; }
public string FootNoteMessage { get; set; }

1
Common/Model/Enum/Notifications.cs

@ -14,6 +14,7 @@ namespace Common.Model.Enum
NONE,
[Description("Email to customer txn is created for bank transfer")]
BANK_TRANSFER_TXN_PENDING = 1,

1
Common/Model/LoginResponse.cs

@ -64,6 +64,7 @@ namespace Common.Model
public string SelfieDocPath { get; set; }
public bool KycVerified { get; set; }
public string KycStatus { get; set; }
public string KycStatusMsg { get; set; }
}

30
Common/Model/MobileV2/CustomerProfileV2.cs

@ -16,4 +16,34 @@ namespace Common.Model.MobileV2
public string fileName { get; set; }
}
public class CustomerDetailV2
{
public string UserId { get; set; }
public string Username { get; set; }
public string FullName { get; set; }
public string Gender { get; set; }
public string Nationality { get; set; }
public string DOB { get; set; }
public string MobileNumber { get; set; }
public string PostalCode { get; set; }
public string City { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
}
}

5
Common/Model/Notification/SMSRequestModel.cs

@ -1,5 +1,4 @@
using Common.Model.Enum;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -13,7 +12,7 @@ namespace Common.Model.Notification
public string UserName { get; set; }
public string RequestedBy { get; set; }
public string MobileNumber { get; set; }
public NotifyTemplate SMSBody { get; set; }
public string SMSBody { get; set; }
public string method { get; set; }
public string ProviderId { get; set; }
public string ControlNo { get; set; }

12
Common/Model/RewardFee.cs

@ -34,4 +34,16 @@ namespace Common.Model
public string Value { get; set; }
public string Icon { get; set; }
}
public class Gateway
{
public string Code { get; set; }
public bool IsRedirect { get; set; }
public string RedirectURL { get; set; }
// public string Token { get; set; }
public string CheckSuccessURL { get; set; }
public string CheckFailURL { get; set; }
}
}

3
Common/Model/StaticData.cs

@ -73,6 +73,7 @@ namespace Common.Model
{
public string id { get; set; }
public string text { get; set; }
public bool isBackRequired { get; set; }
}
@ -114,6 +115,7 @@ namespace Common.Model
public string idStartDate { get; set; }
public string idExpiryDate { get; set; }
public string idNumber { get; set; }
}
public class PrimaryInformation
@ -146,6 +148,7 @@ namespace Common.Model
{
public string Key { get; set; }
public string Value { get; set; }
//public string DisplayText { get; set; }
}
public class Gender

1
Common/RestApiClient.cs

@ -17,6 +17,7 @@ namespace Common
string thirdPartyUrl = ConfigurationManager.AppSettings["ThirdParty_Base_Url"].ToString();
var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(thirdPartyUrl);
httpClient.DefaultRequestHeaders.Add("apiAccessKey", ConfigurationManager.AppSettings["apiAccessKey"].ToString());
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
httpClient.Timeout = new TimeSpan(0, 0, timeOut);

71
JsonRx/Api/SendMoneyController.cs

@ -141,7 +141,6 @@ namespace JsonRx.Api
//model.senderId = Util.GetCustomerId(Request);
var res = _bussiness.Calculate(model);
res.FootNoteMessage = res.ErrorCode.Equals("0") ? Utilities.GetLanguageMapping(ConfigurationManager.AppSettings["footNote_calculateSendMoney"].ToString(), lang).Message : "";
if (res.ErrorCode.Equals("0"))
@ -157,7 +156,7 @@ namespace JsonRx.Api
}
return ModelValidationError(ModelState);
}
}
/// <summary>
/// Method is used for Send Transaction through Mobile
@ -231,6 +230,9 @@ namespace JsonRx.Api
if (_dbRes.ResponseCode == "0")
{
res = _bussiness.SendTransaction(model);
Log.Debug("DOTRANSACTION | RESPONSE : " + JsonConvert.SerializeObject(res));
if (res.ErrorCode == "0")
{
// var fcmid = Util.getJWTTokenClaim(Request.GetJWTToken(), "ClientFcmId");
@ -238,37 +240,42 @@ namespace JsonRx.Api
//Task.Run(() => FcmNotifier.Notify(fcmid, Languages.GetMessage("transaction_success", lang), Languages.GetTitle("transaction", lang)));
LogicalThreadContext.Properties[LoggerProperty.CONTROLNO] = res.Extra;
SendNotificationRequest temp = new SendNotificationRequest();
NotificationDTO rvm = new NotificationDTO();
if (res.Extra3 != null && res.Extra3.ToString() == "N")
{
temp.Template = Common.Model.Enum.NotifyTemplate.TF_NO_BALANCE;
rvm.ClickActivity = "OPEN_ACTIVITY_NOTIFICATION";
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = model.User,
ProcessId = model.ProcessId,
ProviderId = "dotransaction",
Template = temp.Template,
// Template = Common.Model.Enum.NotifyTemplate.TRANSACTION_SUCCESS,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel() { Address= Util.GetClientFCMId(Request) ,NotificationContent = new NotificationDTO() { ClickActivity = rvm.ClickActivity} }
},
Language = Util.getJWTTokenClaim(Request.GetJWTToken(), "language")
};
var devicetype = Util.GetDeviceType(Request);
if (devicetype != null && devicetype.Equals("IOS"))
{
Task.Run(() => NotifierV2.SendNotification(request, NOTIFICATION_TYPE.PUSH_NOTIFICATION));
}
}
//SendNotificationRequest temp = new SendNotificationRequest();
//NotificationDTO rvm = new NotificationDTO();
//if (res.Extra3 != null && res.Extra3.ToString() == "N")
//{
// temp.Template = Common.Model.Enum.NotifyTemplate.TF_NO_BALANCE;
// rvm.ClickActivity = "OPEN_ACTIVITY_NOTIFICATION";
// SendNotificationRequest request = new SendNotificationRequest()
// {
// IsBulkNotification = false,
// UserName = model.User,
// ProcessId = model.ProcessId,
// ProviderId = "dotransaction",
// Template = temp.Template,
// // Template = Common.Model.Enum.NotifyTemplate.TRANSACTION_SUCCESS,
// Recipients = new List<RecipientViewModel>()
// {
// new RecipientViewModel() { Address= Util.GetClientFCMId(Request) ,NotificationContent = new NotificationDTO() { ClickActivity = rvm.ClickActivity} }
// },
// Language = Util.getJWTTokenClaim(Request.GetJWTToken(), "language")
// };
// var devicetype = Util.GetDeviceType(Request);
// if (devicetype != null && devicetype.Equals("IOS"))
// {
// Task.Run(() => NotifierV2.SendNotification(request, NOTIFICATION_TYPE.PUSH_NOTIFICATION));
// }
//}
}
if (res.ErrorCode.Equals("0"))
{
enumString = RESPONSE_MSG.SEND_TRANSACTION_SUCCESS.ToString();
if (res.Extra3 != null && res.Extra3.ToString() == "N")
enumString = RESPONSE_MSG.SEND_TRANSACTION_SUCCESS.ToString();
else
enumString = "Please proceed to complete your payment.";
}
else if (res.ErrorCode.Equals("1"))
{
@ -354,7 +361,9 @@ namespace JsonRx.Api
var map = Utilities.GetLanguageMapping(enumString, lang);
return Ok(new JsonRxResponse { ErrorCode = res.ErrorCode.Equals("0") ? "0" : "1", Msg = res.ErrorCode.Equals("21")| res.ErrorCode.Equals("1") ? res.Msg : map.Message, Id = res.Id, Extra = res.Extra, FootNoteMessage = "" });
return Ok(new JsonRxResponse { ErrorCode = res.ErrorCode.Equals("0") ? "0" : "1",
Msg = res.ErrorCode.Equals("21") | res.ErrorCode.Equals("1") ? res.Msg : map.Message, Id = res.Id, Extra = res.Extra, Data= res.Data, FootNoteMessage = "" });
// return Ok(res);
}
else

64
JsonRx/ApiV3/MobileV3Controller.cs

@ -160,6 +160,70 @@ namespace JsonRx.ApiV3
custResponse = _requestServicesV2.SaveKycSettings(kycOption);
return Ok(custResponse);
}
/// <summary>
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
[HttpGet]
[TokenAuthentication]
[Route("mobile/{customer}/GetCustomerProfile")]
public IHttpActionResult GetCustomerProfile(string customer)
{
//= new CustomerProfileV2() { Username = HttpContext.Current.Request["userId"], UserId = customer };
LogicalThreadContext.Properties[LoggerProperty.PROCESSID] = Guid.NewGuid();
LogicalThreadContext.Properties[LoggerProperty.CREATEDBY] = customer;
LogicalThreadContext.Properties[LoggerProperty.METHODNAME] = "GetCustomerProfile";
Log.Debug("GetCustomerProfile | REQUEST : " + (customer));
JsonRxResponse custResponse = new JsonRxResponse() { ErrorCode = "0" };
if (string.IsNullOrEmpty(customer))
{
custResponse.ErrorCode = "1";
custResponse.Msg = "UserEmail is missing.";
return Ok(custResponse);
}
custResponse.Data = _requestServicesV2.GetCustomerProfile(customer);
return Ok(custResponse);
}
/// <summary>
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
[HttpPost]
[TokenAuthentication]
[Route("mobile/SaveCustomerProfile")]
public IHttpActionResult SaveCustomerProfile(CustomerDetailV2 request)
{
//= new CustomerProfileV2() { Username = HttpContext.Current.Request["userId"], UserId = customer };
LogicalThreadContext.Properties[LoggerProperty.PROCESSID] = Guid.NewGuid();
LogicalThreadContext.Properties[LoggerProperty.CREATEDBY] = request.Username;
LogicalThreadContext.Properties[LoggerProperty.METHODNAME] = "SaveCustomerProfile";
Log.Debug("UpdateCustomerDetail | REQUEST : " + JsonConvert.SerializeObject(request));
JsonRxResponse custResponse = new JsonRxResponse();
if (string.IsNullOrEmpty(request.UserId))
{
custResponse.ErrorCode = "1";
custResponse.Msg = "UserId is missing.";
return Ok(custResponse);
}
return Ok(custResponse);
}
}
}

4
JsonRx/ApiV3/SendTransactionController.cs

@ -99,7 +99,7 @@ namespace JsonRx.ApiV3
[HttpGet]
//[ApplicationLevelAuthentication]
[Route("mobile/{customer}/GetFieldsByProduct")]
public IHttpActionResult GetFieldsByProduct(string customer, [FromUri] MappingType type, [FromUri] string receiverId = "", [FromUri] string payoutPartner = "", [FromUri] bool IsAccountValidation=false )
public IHttpActionResult GetFieldsByProduct(string customer, [FromUri] MappingType type, [FromUri] string receiverId = "", [FromUri] string payoutPartner = "", [FromUri] bool IsAccountValidation = false)
{
var processid = Guid.NewGuid();
LogicalThreadContext.Properties[LoggerProperty.PROCESSID] = processid;
@ -122,8 +122,6 @@ namespace JsonRx.ApiV3
rewardFee.ShowValidationAlert = "N";
}
}
else
{

45
JsonRx/Helper/Util.cs

@ -246,6 +246,51 @@ namespace JsonRx.Helper
}
}
public static class StringHelper
{
private static CultureInfo ci = new CultureInfo("en-US");
//Convert all first latter
public static string ToTitleCase(this string str)
{
str = str.ToLower();
var strArray = str.Split(' ');
if (strArray.Length > 1)
{
strArray[0] = ci.TextInfo.ToTitleCase(strArray[0]);
return string.Join(" ", strArray);
}
return ci.TextInfo.ToTitleCase(str);
}
public static string ToTitleCase(this string str, TitleCase tcase)
{
str = str.ToLower();
switch (tcase)
{
case TitleCase.First:
var strArray = str.Split(' ');
if (strArray.Length > 1)
{
strArray[0] = ci.TextInfo.ToTitleCase(strArray[0]);
return string.Join(" ", strArray);
}
break;
case TitleCase.All:
return ci.TextInfo.ToTitleCase(str);
default:
break;
}
return ci.TextInfo.ToTitleCase(str);
}
}
public enum TitleCase
{
First,
All
}
public static class StringHelper
{
private static CultureInfo ci = new CultureInfo("en-US");

2
JsonRx/Web.config

@ -20,6 +20,8 @@
<appSettings>
<!--Third Party Details -->
<add key="ThirdParty_Base_Url" value="http://77.68.15.91:1083/api/v1/" />
<add key="apiAccessKey" value="KPb1ttRs3CJnORpVU8SmAKUs7a42vtvjzQ47gU0b4u0vxAEI0PgZref6puzkVhLTX2PRNMGCbnb2TglupsjV5AGhYvw8a8POTcUcFSrEdHmTkhkIGNvUvxSpKjUOXGFQWaGU1bxoqqUSaFOmNE5zGojVmwPoMy38CNLwnpQKjdsIuxCKGCApa2gWHJl9gebmIpUODv9jAZgmMEaXqyR4CLg4iSksfTyYNjdqxEE88P5THYt5GuNk8Ti6K2RxIKfPWY49hBOpiYnXcApgSDiKFYqQG9WuZ7cvDGJIWg5WgWKjGle8Y3OydhONXVkN5OMPXDA4VZkK4c5nM363Zkg4w4qdzWuwhsEoAwU4rej6sMRZue3L0BowBJja1OK0iPoTX70EexX8rviMLOZPUDwhxzkL3eODS69VEEbjHb8WSjhho5h3KnCE4tcqCWihwSZ8Yuyhw1rzIMNw2C8pN1GEJyXc6goIFkf7dmK9ynJSxu52D9GjOkKqoD7dFNFulOFVfgeCuhPDYG2A2c2RSvGHv24VDXvmGVaAMLiPtsTz5oD8f0na7fX1xGg0Qveh0KgQL5THnrMK6gm5Ky7O8nbecIxY" />
<add key="sSuperAgent" value="393877" />
<add key="sBranch" value="394395" />

1
Repository/Dao.cs

@ -330,7 +330,6 @@ namespace Repository
throw ex;
}
}
internal T ParseDbResult<T>(string sql)
{
throw new NotImplementedException();

1
Repository/MobileV2/IMobileV2Repo.cs

@ -14,6 +14,7 @@ namespace Repository.MobileV2
JsonRxResponse GetReceiverInformationV2(DateFilterParams search,string customerId, string countryid);
JsonRxResponse SaveProfile(string username, string url, string fileName, string fileType);
DataRow GetMembershipId(string userId);
DataRow GetProfileDetails(string customerId);
DataRow GetResidenceType(string customerId);
JsonRxResponse SaveKycSettings(KycOption kycOption);
}

10
Repository/MobileV2/MobileV2Repo.cs

@ -323,6 +323,16 @@ namespace Repository.MobileV2
return _dao.ExecuteDataRow(sql);
}
public DataRow GetProfileDetails(string customerId)
{
var sql = "EXEC mobile_proc_customerMaster @flag= 'get-profile-details'";
sql += ", @email = " + _dao.FilterString(customerId);
Log.DebugFormat("GetProfileDetails | SQL:{0}", sql);
return _dao.ExecuteDataRow(sql);
}
public JsonRxResponse SaveKycSettings(KycOption kycOption)
{
var sql = "EXEC JsonRx_Proc_UserRegistration @flag='save-kyc-option'";

Loading…
Cancel
Save