@ -32,7 +32,7 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
sql + = ", @PayoutCurrencyCode = " + _connHelper . FilterString ( model . PayoutCurrencyCode ) ;
sql + = ", @CollectionAmount = " + _connHelper . FilterString ( model . CollectionAmount ) ;
sql + = ", @PayoutAmount = " + _connHelper . FilterString ( model . PayoutAmount ) ;
sql + = ", @PaymentTypeCode = " + _connHelper . FilterString ( model . Paymen tTypeCode ) ;
sql + = ", @PaymentTypeCode = " + _connHelper . FilterString ( model . Payou tTypeCode ) ;
sql + = ", @AgentId = " + _connHelper . FilterString ( loginDetails . AgentId ) ;
_logger . LogDebug ( "REMITREPOSITORY | CALCULATEEXRATE | SQL | " + sql ) ;
@ -73,6 +73,53 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
return _response ;
}
public async Task < CommonResponse > VerifyRemittance ( 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 ) ;
_logger . LogDebug ( "REMITREPOSITORY | VERIFYREMITTANCE | SQL | " + sql ) ;
var dt = _connHelper . ExecuteDataTable ( sql ) ;
if ( dt = = null | | dt . Rows . Count < = 0 )
{
_response . ResponseCode = ResponseHelper . FAILED ;
_response . ResponseMessage = ResponseMessageHelper . DBNULLERROR ;
_logger . LogError ( "REMITREPOSITORY | VERIFYREMITTANCE | DBNULLERROR | " + JsonConvert . SerializeObject ( _response ) ) ;
}
else
{
_response = _connHelper . ParseDbResult ( dt ) ;
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 = exRateResponse ;
}
}
}
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 ( ) ;
@ -80,13 +127,6 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
{
var sql = "EXEC PROC_REMIT_INBOUND_EXRATE @Flag = 'EXRATE'" ;
sql + = ", @UserName= " + _connHelper . FilterString ( loginDetails . UserName ) ;
sql + = ", @SendingCountryCode = " + _connHelper . FilterString ( model . SendingCountryCode ) ;
sql + = ", @SendingCurrencyCode = " + _connHelper . FilterString ( model . SendingCurrencyCode ) ;
sql + = ", @PayoutCountryCode = " + _connHelper . FilterString ( model . PayoutCountryCode ) ;
sql + = ", @PayoutCurrencyCode = " + _connHelper . FilterString ( model . PayoutCurrencyCode ) ;
sql + = ", @CollectionAmount = " + _connHelper . FilterString ( model . CollectionAmount ) ;
sql + = ", @PayoutAmount = " + _connHelper . FilterString ( model . PayoutAmount ) ;
sql + = ", @PaymentTypeCode = " + _connHelper . FilterString ( model . PaymentTypeCode ) ;
sql + = ", @AgentId = " + _connHelper . FilterString ( loginDetails . AgentId ) ;
_logger . LogDebug ( "REMITREPOSITORY | SENDREMITTANCE | SQL | " + sql ) ;