Browse Source

fix for payment methods

Mobile-pdf
shakun 1 year ago
parent
commit
58199310cd
  1. 25
      Business/Mobile/MobileServices.cs
  2. 31
      Business/SendMoney/SendMoneyBusiness.cs
  3. 2
      Common/Model/ExRateCalculateRequest.cs
  4. 13
      Common/Model/TransactionResponse.cs
  5. 18
      JsonRx/Config/ResponseMsg.json
  6. 4
      Repository/Mobile/IMobileServicesRepo.cs
  7. 62
      Repository/Mobile/MobileServicesRepo.cs

25
Business/Mobile/MobileServices.cs

@ -160,7 +160,7 @@ namespace Business.Mobile
if (!string.IsNullOrEmpty(jsonRx.ErrorCode) && jsonRx.ErrorCode.Equals("0"))
{
List<Notify.Mapping> bodyMappings = new List<Notify.Mapping>();
bodyMappings.Add(new Notify.Mapping() { SValue = "CustomerName", SText = jsonRx.Extra3 });
bodyMappings.Add(new Notify.Mapping() { SValue = "CustomerName", SText = jsonRx.Extra });
bodyMappings.Add(new Notify.Mapping() { SValue = "OTP_CODE", SText = requestOTPModel.OTP });
bodyMappings.Add(new Notify.Mapping() { SValue = "TYPE", SText = requestOTPModel.requestFor.Equals("REGISTER") ? "customer" : "receiver" });
try
@ -170,7 +170,7 @@ namespace Business.Mobile
IsBulkNotification = false,
UserName = requestOTPModel.userId,
ControlNo = requestOTPModel.receiverId,
ProviderId = "RequestOTP",
ProviderId = "REQUESTOTP_EMAIL",
Template = Common.Model.Enum.NotifyTemplate.OTP_EMAIL,
Recipients = new List<RecipientViewModel>()
{
@ -184,7 +184,9 @@ namespace Business.Mobile
DeviceType = requestOTPModel.DeviceType,
} }
};
jsonRx = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
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)
@ -199,7 +201,7 @@ namespace Business.Mobile
SMSRequestModel _req = new SMSRequestModel
{
ProviderId = "onewaysms",
MobileNumber = requestOTPModel.mobileNo,
MobileNumber =jsonRx.Extra2,
SMSBody = Common.Model.Enum.NotifyTemplate.OTP_EMAIL.ToString(),
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40),
RequestedBy = requestOTPModel.userId,
@ -207,7 +209,9 @@ namespace Business.Mobile
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)
@ -353,7 +357,7 @@ namespace Business.Mobile
RequestedBy = "mobile",
SAgent = 0,
SBranch = Convert.ToInt32(GetStatic.ReadWebConfig("sBranch", "")),
//SchemeId = m.schemeId,
SchemeId = m.schemeId,
SCountry = Convert.ToInt32(m.sCountry == "" || m.sCountry == null ? "0" : m.sCountry),
SCurrency = m.sCurrency,
ServiceType = m.serviceType,
@ -2950,15 +2954,10 @@ namespace Business.Mobile
}
}
public class PaymentMethod
{
public string DetailTitle { get; set; }
public string DetailDesc { get; set; }
}
public List<Option> GetPaymentMethods()
{
List<PaymentMethod> paymentMethods = JsonConvert.DeserializeObject<List<PaymentMethod>>(_requestServices.GetPaymentMethod());
var paymentMethods = _requestServices.GetPaymentMethod();
List<Option> options;
string mappingPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["PaymentConfigFilePath"].ToString());
@ -2969,11 +2968,11 @@ namespace Business.Mobile
}
foreach (var paymentMethod in paymentMethods)
{
var matchingOption = options.FirstOrDefault(option => option.Code == paymentMethod.DetailTitle);
var matchingOption = options.FirstOrDefault(option => option.Code == paymentMethod.Key);
if (matchingOption != null)
{
matchingOption.Value = paymentMethod.DetailDesc;
matchingOption.Value = paymentMethod.Value;
}
}

31
Business/SendMoney/SendMoneyBusiness.cs

@ -174,7 +174,7 @@ namespace Business.SendMoney
ProviderId = "",
RequestedBy = "mobile",
SAgent = 0,
//SchemeId = m.schemeId,
SchemeId = m.schemeId,
SCountry = Convert.ToInt32(m.sCountry == "" ? "0" : m.sCountry),
SCurrency = m.sCurrency,
ServiceType = m.serviceType,
@ -517,20 +517,20 @@ namespace Business.SendMoney
try
{
UserDetails userDetails = _requestServices.GetUserDetails(email);
UserDetails userDetails = _requestServices.GetUserDetails(email);
List<Notify.Mapping> bodyMappings = new List<Notify.Mapping>();
List<Notify.Mapping> bodyMappings = new List<Notify.Mapping>();
bodyMappings.Add(new Notify.Mapping() { SValue = "CustomerName", SText = userDetails.FullName });
bodyMappings.Add(new Notify.Mapping() { SValue = "CustomerName", SText = userDetails.FullName });
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = userDetails.Email,
ProviderId = "BankTransferTxnPendingStatus",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
Template = Common.Model.Enum.NotifyTemplate.BANK_TRANSFER_TXN_PENDING,
Recipients = new List<RecipientViewModel>()
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = userDetails.Email,
ProviderId = "BankTransferTxnPendingStatus",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
Template = Common.Model.Enum.NotifyTemplate.BANK_TRANSFER_TXN_PENDING,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel()
{
@ -541,14 +541,17 @@ namespace Business.SendMoney
Address= userDetails.Email
}
}
};
};
NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
}
}
catch (Exception ex)
{
Log.Error("BankTransferTxnPendingStatus", ex);
}
}
return response;
}

2
Common/Model/ExRateCalculateRequest.cs

@ -91,5 +91,7 @@ namespace Common.Model
public string ProcessFor { get; set; }
public decimal DiscountedFee { get; set; }
public string schemeAppliedMsg { get; set; }
public string SchemeId { get; set; }
}
}

13
Common/Model/TransactionResponse.cs

@ -45,6 +45,19 @@
public string tranStatus { get; set; }
public string rewardPoints { get; set; }
public string SenderFullName { get; set; }
public PaymentDetails PaymentDetails { get; set; }
}
public class PaymentDetails
{
public string BankName { get; set; }
public string AccountName { get; set; }
public string SortCode { get; set; }
public string AccountNo { get; set; }
public string Reference { get; set; }
public string TotalToPay { get; set; }
public string Instruction { get; set; }
}
}

18
JsonRx/Config/ResponseMsg.json

@ -971,7 +971,7 @@
},
{
"Key": "SEND_TRANSACTION_SUCCESS",
"Message": "Transaction has been sent successfully!",
"Message": "You have successfully created the transaction. Please deposit the Amount to proceed with your transaction",
"Lang": "en"
},
{
@ -1869,11 +1869,11 @@
"Message": "ඔබ රෙමිටන්ස් කාඩ්පත හරහා කරන තැන්පතු සඳහා අමතර යෙන් 300 ක් තැන්පත් කරන්න.",
"Lang": "lk"
},
{
"Key": "INVITE_MESSAGE_TITLE",
{
"Key": "INVITE_MESSAGE_TITLE",
"Message": "Receive a FREE 5£ bonus credit as Reward amount",
"Lang": "en"
},
"Lang": "en"
},
{
"Key": "INVITE_MESSAGE_TITLE",
"Message": "JPY 500 सम्मको रेफरल पोइन्टहरू कमाउनुहोस्।",
@ -1899,11 +1899,11 @@
"Message": "යෙන් 500 දක්වා සම්බන්ධකිරීම් සඳහා පොයින්ට්ස් උපයාගන්න",
"Lang": "lk"
},
{
"Key": "INVITE_MESSAGE_BODY",
{
"Key": "INVITE_MESSAGE_BODY",
"Message": "You and your friend will each be given £5.00 in bonus credit. Get £1 after they successfully register, and £4 after their first transaction. There may be minimum send requirements. Terms and Conditions.",
"Lang": "en"
},
"Lang": "en"
},
{
"Key": "INVITE_MESSAGE_BODY",
"Message": "सफल दर्ता पछि तुरुन्तै 100 अंक र पहिलो लेनदेन पछि 400 अंक प्राप्त गर्नुहोस्।",

4
Repository/Mobile/IMobileServicesRepo.cs

@ -101,7 +101,7 @@ namespace Repository.Mobile
LoyaltyPoint GetLoyaltyPoint(string customerId);
JsonRxResponse ValidateReferralCode(string referralCode);
UserDetails GetUserDetails(string email);
//ataSet StaticQueryAddress();
string GetPaymentMethod();
//ataSet StaticQueryAddress();
List<KeyValues> GetPaymentMethod();
}
}

62
Repository/Mobile/MobileServicesRepo.cs

@ -99,14 +99,17 @@ namespace Repository.Mobile
var _dbRes = _dao.ParseDbResult(sql);
Log.Debug("RequestOTP | DB RESPONSE : " + JsonConvert.SerializeObject(_dbRes));
List<string> successCode = new List<string> { "0", "100", "103" };
return new JsonRxResponse { ErrorCode = successCode.Contains(_dbRes.ResponseCode) ? "0" : "1",
return new JsonRxResponse
{
ErrorCode = successCode.Contains(_dbRes.ResponseCode) ? "0" : "1",
Msg = _dbRes.Msg,
Extra = _dbRes.Id,
Extra2 = _dbRes.ResponseCode,
Extra3 = _dbRes.Extra };
Id = _dbRes.Id,
Extra = _dbRes.Extra,
Extra2 = _dbRes.Extra2
};
@ -200,28 +203,19 @@ namespace Repository.Mobile
};
}
public string GetPaymentMethod()
public List<KeyValues> GetPaymentMethod()
{
List<KeyValues> lst = new List<KeyValues>();
var sql = "EXEC mobile_proc_customerMaster @flag='get-payment-method'";
var dt = _dao.ExecuteDataTable(sql);
DataTable dataTable = new DataTable();
dataTable.Columns.Add("DetailTitle", typeof(string));
dataTable.Columns.Add("DetailDesc", typeof(string));
foreach (DataRow row in dt.Rows)
{
var detailTitle = row["detailTitle"].ToString();
var detailDesc = row["detailDesc"].ToString();
dataTable.Rows.Add(detailTitle, detailDesc);
lst.Add(new KeyValues() { Key = row["detailTitle"].ToString(), Value = row["detailDesc"].ToString() });
}
string jsonResult = JsonConvert.SerializeObject(dataTable, Formatting.Indented);
return jsonResult;
return lst;
}
public JsonRxResponse SubmitOTP(RequestOTPModel requestOTPModel)
{
var lang = Convert.ToString(CallContext.GetData(Constants.Language));
@ -461,8 +455,8 @@ namespace Repository.Mobile
jsonRx.Extra = dataTable.Extra;
//var res = _dao.ParseDbResult(sql);
return new JsonRxResponse { ErrorCode = dataTable.ResponseCode, Msg = dataTable.Msg };
//return jsonRx;
}
@ -1019,7 +1013,18 @@ namespace Repository.Mobile
discountValue = sRow["discountValue"].ToString(),
discountPercent = sRow["discountPercent"].ToString(),
tranStatus = sRow["tranStatus"].ToString(),
rewardPoints = sRow["rewardPoints"].ToString()
rewardPoints = sRow["rewardPoints"].ToString(),
SenderFullName = "a",
PaymentDetails = new PaymentDetails()
{
AccountName = "IME LONDON",
AccountNo = "00000151",
BankName = "Clear bank",
Instruction = "Payment Reference Should be your name . Should you require any assitance, IME team is happy to help. You can track from Home ",
TotalToPay = "XXX",
Reference = "asdad",
SortCode = "asdasdasd"
}
};
double discountval = 0, discountpercent = 0;
@ -1368,8 +1373,9 @@ namespace Repository.Mobile
var row = _dao.ExecuteDataRow(sql);
UserDetails userDetails = new UserDetails();
if (row!=null)
if (row != null)
{
userDetails.FullName = row["fullName"].ToString();
userDetails.CustomerId = row["customerid"].ToString();
userDetails.MembershipId = row["membershipid"].ToString();
@ -1379,11 +1385,12 @@ namespace Repository.Mobile
userDetails.LastName = row["Lastname1"].ToString();
userDetails.Email = row["email"].ToString();
userDetails.Address = row["address"].ToString();
userDetails.RegisteredDate = DateTime.Parse( row["createdDate"].ToString());
userDetails.RegisteredDate = DateTime.Parse(row["createdDate"].ToString());
}
return userDetails;
}
public JsonRxResponse CustomerInfoAgree(String username, string flag = "agree")
{
var lang = Convert.ToString(CallContext.GetData(Constants.Language));
@ -1591,9 +1598,9 @@ namespace Repository.Mobile
ResidenceType = Convert.ToString(dataTable.Rows[0]["ResidenceType"]),
UseNFC = Convert.ToString(dataTable.Rows[0]["UseNFC"]),
SelfieDocPath = Convert.ToString(dataTable.Rows[0]["SelfieDoc"]).Replace("////", "/"),
KycVerified=false,
KycStatus= "Processing",
KycStatusMsg= "ID Document Submission is in Processing",
KycVerified = Convert.ToBoolean(dataTable.Rows[0]["KycVerified"]),
KycStatus = Convert.ToString(dataTable.Rows[0]["KycStatus"]),
KycStatusMsg = Convert.ToString(dataTable.Rows[0]["KycStatusMsg"]),
// IsForcedPwdchange = Convert.ToString(dataTable.Rows[0]["IsForcedPwdChange"]),
appUpdate = app
};
@ -2883,6 +2890,7 @@ namespace Repository.Mobile
idStartDate = Convert.ToString(dt["passportIssueDate"]),
idExpiryDate = Convert.ToString(dt["passportExpiryDate"]),
idNumber = Convert.ToString(dt["passportNumber"])
};
if (type.ToLower().Equals("kycv3-existing"))

Loading…
Cancel
Save