|
@ -74,12 +74,12 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository |
|
|
return _response; |
|
|
return _response; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<CommonResponse> VerifyRemittance(SendRemittanceModel model, UserLoginModel loginDetails) |
|
|
|
|
|
|
|
|
public async Task<CommonResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails) |
|
|
{ |
|
|
{ |
|
|
var _response = new CommonResponse(); |
|
|
var _response = new CommonResponse(); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var sql = "EXEC PROC_REMIT_INBOUND_TRANSACTION_VALIDATE @Flag = 'VALIDATE'"; |
|
|
|
|
|
|
|
|
var sql = "EXEC PROC_REMIT_INBOUND_TRANSACTION_SEND @Flag = 'SEND'"; |
|
|
sql += ", @UserName= " + _connHelper.FilterString(loginDetails.UserName); |
|
|
sql += ", @UserName= " + _connHelper.FilterString(loginDetails.UserName); |
|
|
sql += ", @AgentId = " + _connHelper.FilterString(loginDetails.AgentId); |
|
|
sql += ", @AgentId = " + _connHelper.FilterString(loginDetails.AgentId); |
|
|
sql += ", @IpAddress = " + _connHelper.FilterString(loginDetails.IpAddress); |
|
|
sql += ", @IpAddress = " + _connHelper.FilterString(loginDetails.IpAddress); |
|
@ -127,62 +127,27 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository |
|
|
sql += ", @ReceiverAddress = " + _connHelper.FilterString(model.RemitReceiverDetails.ReceiverAddress); |
|
|
sql += ", @ReceiverAddress = " + _connHelper.FilterString(model.RemitReceiverDetails.ReceiverAddress); |
|
|
sql += ", @ReceiverEmail = " + _connHelper.FilterString(model.RemitReceiverDetails.ReceiverEmail); |
|
|
sql += ", @ReceiverEmail = " + _connHelper.FilterString(model.RemitReceiverDetails.ReceiverEmail); |
|
|
sql += ", @ReceiverAccountNo = " + _connHelper.FilterString(model.RemitReceiverDetails.ReceiverAccountNo); |
|
|
sql += ", @ReceiverAccountNo = " + _connHelper.FilterString(model.RemitReceiverDetails.ReceiverAccountNo); |
|
|
|
|
|
|
|
|
_logger.LogDebug("REMITREPOSITORY | VERIFYREMITTANCE | SQL | " + sql); |
|
|
|
|
|
var _dbResponse = _connHelper.ParseDbResult(sql); |
|
|
|
|
|
|
|
|
|
|
|
_response.ResponseCode = _dbResponse.ResponseCode; |
|
|
|
|
|
_response.ResponseMessage = _dbResponse.ResponseMessage; |
|
|
|
|
|
if (_dbResponse.ResponseCode == ResponseHelper.SUCCESS) |
|
|
|
|
|
{ |
|
|
|
|
|
_response.Data = new { IMETransactionId = _dbResponse.Id, PartnerTransactionId = _dbResponse.Extra }; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
_response.ResponseCode = ResponseHelper.EXCEPTION; |
|
|
|
|
|
_response.ResponseMessage = "Exception occured: " + ex.Message; |
|
|
|
|
|
|
|
|
|
|
|
_logger.LogError("REMITREPOSITORY | VERIFYREMITTANCE | EXCEPTION | " + JsonConvert.SerializeObject(_response)); |
|
|
|
|
|
} |
|
|
|
|
|
return _response; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<CommonResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails) |
|
|
|
|
|
{ |
|
|
|
|
|
var _response = new CommonResponse(); |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var sql = "EXEC PROC_REMIT_INBOUND_EXRATE @Flag = 'EXRATE'"; |
|
|
|
|
|
sql += ", @UserName= " + _connHelper.FilterString(loginDetails.UserName); |
|
|
|
|
|
sql += ", @AgentId = " + _connHelper.FilterString(loginDetails.AgentId); |
|
|
|
|
|
|
|
|
sql += ", @CheckOfacFlag = " + _connHelper.FilterString(Utilities.ReadAppSettings("CheckOfacFlag")); |
|
|
|
|
|
|
|
|
_logger.LogDebug("REMITREPOSITORY | SENDREMITTANCE | SQL | " + sql); |
|
|
_logger.LogDebug("REMITREPOSITORY | SENDREMITTANCE | SQL | " + sql); |
|
|
var dt = _connHelper.ExecuteDataTable(sql); |
|
|
|
|
|
if (dt == null || dt.Rows.Count <= 0) |
|
|
|
|
|
{ |
|
|
|
|
|
_response.ResponseCode = ResponseHelper.FAILED; |
|
|
|
|
|
_response.ResponseMessage = ResponseMessageHelper.DBNULLERROR; |
|
|
|
|
|
|
|
|
var _transactionResponse = _connHelper.ExecuteDataRow(sql); |
|
|
|
|
|
|
|
|
_logger.LogError("REMITREPOSITORY | SENDREMITTANCE | DBNULLERROR | " + JsonConvert.SerializeObject(_response)); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_response = _connHelper.ParseDbResult(dt); |
|
|
|
|
|
|
|
|
_response.ResponseCode = Convert.ToInt16(_transactionResponse["ErrorCode"]); |
|
|
|
|
|
_response.ResponseMessage = Convert.ToString(_transactionResponse["ErrorMessage"]); |
|
|
if (_response.ResponseCode == ResponseHelper.SUCCESS) |
|
|
if (_response.ResponseCode == ResponseHelper.SUCCESS) |
|
|
{ |
|
|
{ |
|
|
var exRateResponse = new |
|
|
|
|
|
{ |
|
|
|
|
|
ServiceCharge = Utilities.ShowDecimal(Convert.ToString(dt.Rows[0]["ServiceCharge"])), |
|
|
|
|
|
ExRate = Utilities.ShowDecimalRate(Convert.ToString(dt.Rows[0]["ExRate"])), |
|
|
|
|
|
PayoutCurrencyCode = Convert.ToString(dt.Rows[0]["PayoutCurrencyCode"]), |
|
|
|
|
|
CurrDecimal = Convert.ToString(dt.Rows[0]["CurrDecimal"]), |
|
|
|
|
|
CollectionAmount = Utilities.ShowDecimal(Convert.ToString(dt.Rows[0]["CollectionAmount"])), |
|
|
|
|
|
TransferAmount = Utilities.ShowDecimal(Convert.ToString(dt.Rows[0]["TransferAmount"])), |
|
|
|
|
|
PayoutAmount = Utilities.ShowDecimal(Convert.ToString(dt.Rows[0]["PayoutAmount"])) |
|
|
|
|
|
|
|
|
_response.Data = new |
|
|
|
|
|
{ |
|
|
|
|
|
IMEControlNo = Convert.ToString(_transactionResponse["IMEControlNo"]), |
|
|
|
|
|
PartnerTransactionId = Convert.ToString(_transactionResponse["PartnerTransactionId"]), |
|
|
|
|
|
TranStatus = Convert.ToString(_transactionResponse["TranStatus"]), |
|
|
|
|
|
//SendingCommission = Utilities.ShowDecimal(Convert.ToString(_transactionResponse["SendingCommission"])),
|
|
|
|
|
|
//SendingCommissionCurrency = Convert.ToString(_transactionResponse["SendingCommissionCurrency"]),
|
|
|
|
|
|
CollectionAmount = Utilities.ShowDecimal(Convert.ToString(_transactionResponse["CollectionAmount"])), |
|
|
|
|
|
TransferAmount = Utilities.ShowDecimal(Convert.ToString(_transactionResponse["TransferAmount"])), |
|
|
|
|
|
PayoutAmount = Utilities.ShowDecimal(Convert.ToString(_transactionResponse["PayoutAmount"])), |
|
|
|
|
|
ExRate = Utilities.ShowDecimalRate(Convert.ToString(_transactionResponse["ExRate"])) |
|
|
}; |
|
|
}; |
|
|
_response.Data = exRateResponse; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|