@ -32,6 +32,7 @@ using Repository;
using System.Configuration ;
using System.Configuration ;
using Business.TrustDoc ;
using Business.TrustDoc ;
using Business.Addressy ;
using Business.Addressy ;
using System.Text ;
namespace Business.Mobile
namespace Business.Mobile
{
{
@ -144,10 +145,9 @@ namespace Business.Mobile
{
{
var lang = Convert . ToString ( CallContext . GetData ( Constants . Language ) ) ;
var lang = Convert . ToString ( CallContext . GetData ( Constants . Language ) ) ;
JsonRxResponse jsonRx = new JsonRxResponse ( ) ;
JsonRxResponse jsonRx = new JsonRxResponse ( ) ;
try
try
{
{
requestOTPModel . OTP = Utilities . GenerateOTP ( ) ;
requestOTPModel . OTP = Utilities . GenerateOTP ( ) ; //implement the logic to send OTP SMS in customers mobile.
jsonRx = _requestServices . RequestOTP ( requestOTPModel ) ;
jsonRx = _requestServices . RequestOTP ( requestOTPModel ) ;
Log . Debug ( "GenerateOTP | RESPONSE : " + JsonConvert . SerializeObject ( jsonRx ) ) ;
Log . Debug ( "GenerateOTP | RESPONSE : " + JsonConvert . SerializeObject ( jsonRx ) ) ;
@ -155,8 +155,9 @@ namespace Business.Mobile
{
{
bool emailSent = false ;
bool emailSent = false ;
bool smsSent = false ;
bool smsSent = false ;
if ( requestOTPModel . userId . IsValidEmail ( ) )
if ( requestOTPModel . userId . IsValidEmail ( ) & ( jsonRx . Extra3 . Equals ( "0" ) | jsonRx . Extra3 . Equals ( "100" ) ) )
{
{
if ( ! string . IsNullOrEmpty ( jsonRx . ErrorCode ) & & jsonRx . ErrorCode . Equals ( "0" ) )
if ( ! string . IsNullOrEmpty ( jsonRx . ErrorCode ) & & jsonRx . ErrorCode . Equals ( "0" ) )
{
{
List < Notify . Mapping > bodyMappings = new List < Notify . Mapping > ( ) ;
List < Notify . Mapping > bodyMappings = new List < Notify . Mapping > ( ) ;
@ -184,8 +185,12 @@ namespace Business.Mobile
DeviceType = requestOTPModel . DeviceType ,
DeviceType = requestOTPModel . DeviceType ,
} }
} }
} ;
} ;
Log . Debug ( "SendNotification.EMAIL | REQUEST : " + JsonConvert . SerializeObject ( request ) ) ;
Log . Debug ( "SendNotification.EMAIL | REQUEST : " + JsonConvert . SerializeObject ( request ) ) ;
var jsonRx1 = NotifierV2 . SendNotification ( request , NOTIFICATION_TYPE . EMAIL ) ;
var jsonRx1 = NotifierV2 . SendNotification ( request , NOTIFICATION_TYPE . EMAIL ) ;
Log . Debug ( "SendNotification.EMAIL | RESPONSE : " + JsonConvert . SerializeObject ( jsonRx1 ) ) ;
Log . Debug ( "SendNotification.EMAIL | RESPONSE : " + JsonConvert . SerializeObject ( jsonRx1 ) ) ;
emailSent = true ;
emailSent = true ;
}
}
@ -196,25 +201,34 @@ namespace Business.Mobile
try
try
{
{
string ProcessId = Guid . NewGuid ( ) . ToString ( ) . Replace ( "-" , "" ) + ":sendSms" ;
SendSMSApiService _sendAPI = new SendSMSApiService ( ) ;
string mobileNum = jsonRx . Extra2 ;
string mobileNum = jsonRx . Extra2 ;
var mobNum = getSenderFormattedNumber ( mobileNum ) ;
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
SMSRequestModel _req = new SMSRequestModel
{
{
ProviderId = "onewaysms" ,
MobileNumber = mobNum , //jsonRx.Extra2,
SMSBody = Common . Model . Enum . NotifyTemplate . OTP_EMAIL ,
ProcessId = ProcessId . Substring ( ProcessId . Length - 4 0 , 4 0 ) ,
ProviderId = "ProcessId " ,
MobileNumber = mobile Num ,
SMSBody = s . ToString ( ) ,
ProcessId = requestOTPModel . ProcessId ,
RequestedBy = requestOTPModel . userId ,
RequestedBy = requestOTPModel . userId ,
UserName = requestOTPModel . userId ,
UserName = requestOTPModel . userId ,
method = "send" ,
method = "send" ,
ControlNo = "" , // GetControlNo()
ControlNo = "" , // GetControlNo()
} ;
} ;
Log . Debug ( "SendNotification.SMS | REQUEST : " + JsonConvert . SerializeObject ( _req ) ) ;
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 ) ) ;
Log . Debug ( "SendNotification.SMS | RESPONSE : " + JsonConvert . SerializeObject ( _resp ) ) ;
smsSent = true ;
smsSent = true ;
}
}
catch ( Exception smsException )
catch ( Exception smsException )
@ -228,16 +242,25 @@ namespace Business.Mobile
return jsonRx ;
return jsonRx ;
}
}
}
}
}
}
else
else
{
{
if ( jsonRx . Extra3 ! = null & jsonRx . Extra3 . Equals ( "103" ) )
{
return new JsonRxResponse { ErrorCode = "0" , Msg = "OTP Already Sent" } ;
}
jsonRx . ErrorCode = "1" ;
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 } ;
// var map = Utilities.GetLanguageMapping(RESPONSE_MSG.OLD_USER_REGISTER_FAIL_11.ToString(), lang);
return new JsonRxResponse { ErrorCode = jsonRx . ErrorCode , Msg = jsonRx . Msg } ;
}
}
}
}
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 ;
return jsonRx ;
}
}
catch ( Exception ex )
catch ( Exception ex )
@ -246,13 +269,10 @@ namespace Business.Mobile
jsonRx . SetResponse ( "1" , "Error occurred while calling RequestOTP." ) ;
jsonRx . SetResponse ( "1" , "Error occurred while calling RequestOTP." ) ;
return jsonRx ;
return jsonRx ;
}
}
}
}
private string getSenderFormattedNumber ( string number )
public string getSenderFormattedNumber ( string number )
{
{
string finalNo = number ;
string finalNo = number ;
if ( ! number . Contains ( "+44" ) )
if ( ! number . Contains ( "+44" ) )
{
{
string mobileFirst = number . Substring ( 0 , 1 ) ;
string mobileFirst = number . Substring ( 0 , 1 ) ;
@ -272,19 +292,20 @@ namespace Business.Mobile
{
{
finalNo = $"+44{number}" ;
finalNo = $"+44{number}" ;
}
}
}
}
else if ( number . Contains ( "+44" ) )
else if ( number . Contains ( "+44" ) )
{
{
string MobN = number . Substring ( 4 , 1 ) ;
string MobN = number . Substring ( 4 , 1 ) ;
if ( MobN = = "0" & & number . Length > 1 4 )
if ( MobN = = "0" & & number . Length > 1 4 )
{
{
finalNo = number . Remove ( 4 , 1 ) ;
finalNo = number . Remove ( 4 , 1 ) ;
}
}
}
}
if ( ! finalNo . Substring ( 0 , 1 ) . Contains ( "+" ) )
if ( ! finalNo . Substring ( 0 , 1 ) . Contains ( "+" ) )
{
finalNo = $"+{finalNo}" ;
finalNo = $"+{finalNo}" ;
}
return finalNo ;
return finalNo ;
}
}
@ -668,8 +689,6 @@ namespace Business.Mobile
}
}
if ( ! string . IsNullOrEmpty ( custKyc . RegistrationType ) & & custKyc . RegistrationType . Equals ( "EKYC" ) )
if ( ! string . IsNullOrEmpty ( custKyc . RegistrationType ) & & custKyc . RegistrationType . Equals ( "EKYC" ) )
{
{
isKyc = true ;
isKyc = true ;
@ -684,6 +703,8 @@ namespace Business.Mobile
// isBackRequired = id["isBackRequired"].ToString();
// isBackRequired = id["isBackRequired"].ToString();
// }
// }
//}
//}
//Log.Debug($"RegisterKYC | httpRequest : {httpRequest.Params}");
Log . Debug ( $"RegisterKYC | REQUEST : { JsonConvert.SerializeObject(custKyc)} | Files: { httpRequest.Files.Count}" ) ;
Log . Debug ( $"RegisterKYC | REQUEST : { JsonConvert.SerializeObject(custKyc)} | Files: { httpRequest.Files.Count}" ) ;
@ -1001,34 +1022,59 @@ namespace Business.Mobile
// kyc.mobile = jsonRxMobile.Extra;
// kyc.mobile = jsonRxMobile.Extra;
//}
//}
if ( kyc . type . Equals ( "0" ) )
{
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 ) ;
//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;
//}
//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 ;
}
}
// return jsonRx;
// }
//}
if ( string . IsNullOrEmpty ( kyc . idExpiryDate ) )
{
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 ) )
{
jsonRx . SetResponse ( "1" , "idIssuingCountry is required" ) ;
return jsonRx ;
}
}
//if (string.IsNullOrEmpty(kyc.idNumber))
//{
//{
// enumString = RESPONSE_MSG.VALIDATE_FORM_3.ToString();
// var map = Utilities.GetLanguageMapping(enumString, lang);
// jsonRx.SetResponse("1", map.Message);
// jsonRx.SetResponse("1", "Id number is required");
// return jsonRx;
// return jsonRx;
//}
//}
//if (string.IsNullOrEmpty(kyc.additionalAddress))
//if (string.IsNullOrEmpty(kyc.additionalAddress))
//{
//{
// enumString = RESPONSE_MSG.VALIDATE_FORM_4.ToString();
// enumString = RESPONSE_MSG.VALIDATE_FORM_4.ToString();
@ -1666,28 +1712,28 @@ namespace Business.Mobile
_resp . SetResponse ( "1" , "Password can not be empty!" ) ;
_resp . SetResponse ( "1" , "Password can not be empty!" ) ;
return _resp ;
return _resp ;
}
}
if ( confirmpwd . Length < 8 )
if ( confirmpwd . Length < 6 )
{
{
_resp . SetResponse ( "1" , "Password must be of atleast 8 digits!" ) ;
_resp . SetResponse ( "1" , "Password must be of atleast 6 digits!" ) ;
return _resp ;
return _resp ;
}
}
if ( ! Regex . Match ( confirmpwd , @"\d+" ) . Success )
{
_resp . SetResponse ( "1" , "Password must contain 1 number!" ) ;
return _resp ;
}
//if (!Regex.Match(confirmpwd, @"\d+").Success)
//{
// _resp.SetResponse("1", "Password must contain 1 number!");
// return _resp;
//}
if ( ! Regex . Match ( confirmpwd , @"[A-Z]" ) . Success )
{
_resp . SetResponse ( "1" , "Password must contain atleaset one capital letter!" ) ;
return _resp ;
}
if ( ! Regex . Match ( confirmpwd , @"[!@#$%&*_+\-]" ) . Success )
{
_resp . SetResponse ( "1" , "Password must contain atleaset one special character!" ) ;
return _resp ;
}
//if (!Regex.Match(confirmpwd, @"[A-Z]").Success)
//{
// _resp.SetResponse("1", "Password must contain atleaset one capital letter!");
// return _resp;
//}
//if (!Regex.Match(confirmpwd, @"[!@#$%&*_+\-]").Success)
//{
// _resp.SetResponse("1", "Password must contain atleaset one special character!");
// return _resp;
//}
return _resp ;
return _resp ;
}
}
@ -1739,6 +1785,8 @@ namespace Business.Mobile
return verifyPwdResp ;
return verifyPwdResp ;
}
}
newUserRegister . MobileNumber = newUserRegister . MobileNumber . getUKFormattedNumber ( ) ;
res = _requestServices . NewUserRegister ( newUserRegister ) ;
res = _requestServices . NewUserRegister ( newUserRegister ) ;
Log . Debug ( "NewUserRegister | completed with db response. " + "ErrorCode: " + res . ErrorCode + " Msg: " + res . Msg ) ;
Log . Debug ( "NewUserRegister | completed with db response. " + "ErrorCode: " + res . ErrorCode + " Msg: " + res . Msg ) ;
@ -1907,29 +1955,9 @@ namespace Business.Mobile
res = _requestServices . CustomerInfoAgree ( username , "agree" ) ;
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" ) )
if ( res . ErrorCode . Equals ( "0" ) )
{
{
// _trustDocBusiness.CompareData(new TrustDocRequest() { birth = res.Extra2, name = res.Msg }, res.Extra3, username, res.Id);
// _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" ;
res . Msg = "Thank you for completing your profile. You can now start sending transactions" ;
@ -1961,10 +1989,8 @@ namespace Business.Mobile
// },
// },
// Language = Convert.ToString(CallContext.GetData(Constants.Language))
// Language = Convert.ToString(CallContext.GetData(Constants.Language))
//};
//};
//Task.Run(() => NotifierV2.SendNotification(emailNotificationRequest, NOTIFICATION_TYPE.EMAIL));
//Task.Run(() => NotifierV2.SendNotification(emailNotificationRequest, NOTIFICATION_TYPE.EMAIL));
}
}
Log . Debug ( "CustomerInfoAgree.Agree | DB RESPONSE : " + JsonConvert . SerializeObject ( res ) ) ;
Log . Debug ( "CustomerInfoAgree.Agree | DB RESPONSE : " + JsonConvert . SerializeObject ( res ) ) ;
}
}
//else if (agreeYn.Equals("N"))
//else if (agreeYn.Equals("N"))
@ -2001,6 +2027,15 @@ namespace Business.Mobile
return res ;
return res ;
}
}
DateTime dateTime ;
if ( DateTime . TryParseExact ( pwdReset . Dob , "dd/MM/yyyy" , System . Globalization . CultureInfo . InvariantCulture , System . Globalization . DateTimeStyles . None , out dateTime ) )
{
pwdReset . Dob = dateTime . ToString ( "yyyy-MM-dd" ) ;
}
if ( ! pwdReset . Username . IsValidEmail ( ) )
if ( ! pwdReset . Username . IsValidEmail ( ) )
{
{
var map = Utilities . GetLanguageMapping ( RESPONSE_MSG . INVALID_EMAIL_FOR_RESETPASSWORD . ToString ( ) , lang ) ;
var map = Utilities . GetLanguageMapping ( RESPONSE_MSG . INVALID_EMAIL_FOR_RESETPASSWORD . ToString ( ) , lang ) ;
@ -2008,7 +2043,9 @@ namespace Business.Mobile
return res ;
return res ;
} ;
} ;
var randomPassword = PasswordGenerator . GenerateRandomPassword ( ) ;
// var randomPassword = PasswordGenerator.GenerateRandomPassword();
var randomPassword = Utilities . GenerateRandomPin ( ) ;
pwdReset . RandomPassword = randomPassword ;
pwdReset . RandomPassword = randomPassword ;
res = _requestServices . ResetPassword ( pwdReset ) ;
res = _requestServices . ResetPassword ( pwdReset ) ;
@ -2018,6 +2055,7 @@ namespace Business.Mobile
{
{
try
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 = "CustomerName" , SText = res . Extra2 } ) ;
bodyMappings . Add ( new Notify . Mapping ( ) { SValue = "EMAIL_ID" , SText = pwdReset . Username } ) ;
bodyMappings . Add ( new Notify . Mapping ( ) { SValue = "EMAIL_ID" , SText = pwdReset . Username } ) ;
@ -2044,15 +2082,16 @@ namespace Business.Mobile
}
}
} ;
} ;
res = NotifierV2 . SendNotification ( request , NOTIFICATION_TYPE . ) ;
string ProcessId = Guid . NewGuid ( ) . ToString ( ) . Replace ( "-" , "" ) + ":sendSms" ;
string ProcessId = Guid . NewGuid ( ) . ToString ( ) . Replace ( "-" , "" ) + ":sendSms" ;
SendSMSApiService _sendAPI = new SendSMSApiService ( ) ;
SendSMSApiService _sendAPI = new SendSMSApiService ( ) ;
//GetSMSTextForTxn
SMSRequestModel _req = new SMSRequestModel
SMSRequestModel _req = new SMSRequestModel
{
{
ProviderId = "onewaysms" ,
ProviderId = "onewaysms" ,
MobileNumber = pwdReset . mobileNo ,
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 - 4 0 , 4 0 ) ,
ProcessId = ProcessId . Substring ( ProcessId . Length - 4 0 , 4 0 ) ,
RequestedBy = pwdReset . Username ,
RequestedBy = pwdReset . Username ,
UserName = pwdReset . Username ,
UserName = pwdReset . Username ,
@ -2060,7 +2099,7 @@ namespace Business.Mobile
ControlNo = "" , // GetControlNo()
ControlNo = "" , // GetControlNo()
} ;
} ;
APIJsonResponse _resp = _sendAPI . SMSTPApi ( _req ) ;
APIJsonResponse _resp = _sendAPI . SMSTPApi ( _req ) ;
res = NotifierV2 . SendNotification ( request , NOTIFICATION_TYPE . EMAIL ) ;
}
}
catch ( Exception ex )
catch ( Exception ex )
{
{
@ -2114,56 +2153,16 @@ namespace Business.Mobile
if ( liWalletStmtResponse = = null )
if ( liWalletStmtResponse = = null )
{
{
jsonRx . ErrorCode = "0 " ;
jsonRx . ErrorCode = "1 " ;
jsonRx . Msg = "No wallet statement found." ;
jsonRx . Msg = "No wallet statement found." ;
jsonRx . Data = new System . Collections . ArrayList ( ) ;
jsonRx . Data = new System . Collections . ArrayList ( ) ;
Log . Debug ( "GetWalletStatement | Returning null while fetching the list of wallet statements." ) ;
Log . Debug ( "GetWalletStatement | Returning null while fetching the list of wallet statements." ) ;
return jsonRx ;
return jsonRx ;
}
}
double OpenBalnce = 0.0 ;
foreach ( var item in liWalletStmtResponse )
{
if ( item . Particular . ToString ( ) . ToUpper ( ) = = "BALANCE BROUGHT FORWARD" )
{
OpenBalnce = GetStatic . ParseDouble ( item . ClosingAmount . ToString ( ) ) ;
}
else
{
item . ClosingAmount = ( OpenBalnce + GetStatic . ParseDouble ( item . WalletIn ) - GetStatic . ParseDouble ( item . WalletOut ) ) . ToString ( ) ;
OpenBalnce = GetStatic . ParseDouble ( item . ClosingAmount ) ;
}
//item.ClosingAmount = GetStatic.ShowCommaAmt(item.ClosingAmount);
item . WalletIn = GetStatic . ShowCommaAmt ( item . WalletIn ) ;
item . WalletOut = GetStatic . ShowCommaAmt ( item . WalletOut ) ;
}
if ( liWalletStmtResponse [ 0 ] . Particular . ToString ( ) . ToUpper ( ) = = "BALANCE BROUGHT FORWARD" )
{
liWalletStmtResponse . RemoveAt ( 0 ) ;
}
liWalletStmtResponse . Add ( new WalletStatementResponse ( )
{
Particular = "BALANCE BROUGHT FORWARD" ,
ClosingAmount = OpenBalnce . ToString ( )
} ) ;
jsonRx . SetResponse ( "0" , liWalletStmtResponse . Count . ToString ( ) + " wallet txn" ) ;
jsonRx . ErrorCode = "0" ;
jsonRx . Data = liWalletStmtResponse ;
List < WalletStatementResponse > list = new List < WalletStatementResponse > ( ) ;
for ( int i = liWalletStmtResponse . Count - 1 ; i > = 0 ; i - - )
{
list . Add ( new WalletStatementResponse ( )
{
Particular = liWalletStmtResponse [ i ] . Particular ,
TransactionDate = liWalletStmtResponse [ i ] . TransactionDate ,
WalletIn = liWalletStmtResponse [ i ] . WalletIn ,
WalletOut = liWalletStmtResponse [ i ] . WalletOut ,
ClosingAmount = GetStatic . ShowCommaAmt ( liWalletStmtResponse [ i ] . ClosingAmount )
} ) ;
}
jsonRx . Data = list ;
Log . Debug ( "GetWalletStatement | DB RESPONSE : " + JsonConvert . SerializeObject ( jsonRx ) ) ;
return jsonRx ;
return jsonRx ;
}
}
@ -2932,7 +2931,6 @@ namespace Business.Mobile
return jsonRx ;
return jsonRx ;
}
}
else if ( type = = Common . Model . Config . MappingType . REWARD_POINT )
else if ( type = = Common . Model . Config . MappingType . REWARD_POINT )
{
{
var response1 = _requestServices . GetRewardFee ( customerId ) ;
var response1 = _requestServices . GetRewardFee ( customerId ) ;
@ -2999,7 +2997,6 @@ namespace Business.Mobile
public List < Option > GetPaymentMethods ( )
public List < Option > GetPaymentMethods ( )
{
{
var paymentMethods = _requestServices . GetPaymentMethod ( ) ;
var paymentMethods = _requestServices . GetPaymentMethod ( ) ;
List < Option > options ;
List < Option > options ;
string mappingPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , ConfigurationManager . AppSettings [ "PaymentConfigFilePath" ] . ToString ( ) ) ;
string mappingPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , ConfigurationManager . AppSettings [ "PaymentConfigFilePath" ] . ToString ( ) ) ;
using ( StreamReader reader = File . OpenText ( mappingPath ) )
using ( StreamReader reader = File . OpenText ( mappingPath ) )
@ -3010,17 +3007,13 @@ namespace Business.Mobile
foreach ( var paymentMethod in paymentMethods )
foreach ( var paymentMethod in paymentMethods )
{
{
var matchingOption = options . FirstOrDefault ( option = > option . Code = = paymentMethod . Key ) ;
var matchingOption = options . FirstOrDefault ( option = > option . Code = = paymentMethod . Key ) ;
if ( matchingOption ! = null )
if ( matchingOption ! = null )
{
{
matchingOption . Value = paymentMethod . Value ;
matchingOption . Value = paymentMethod . Value ;
}
}
}
}
return options ;
return options ;
}
}
public JsonRxResponse ValidateReferralCode ( string referralCode )
public JsonRxResponse ValidateReferralCode ( string referralCode )
{
{
JsonRxResponse jsonRx = new JsonRxResponse ( ) ;
JsonRxResponse jsonRx = new JsonRxResponse ( ) ;