Browse Source

Get status method added

master
Arjun Dhami 7 months ago
parent
commit
94a9d28d94
  1. 78
      DB/SP's/PROC_REMIT_INBOUND_TRANSACTION_STATUS.sql
  2. BIN
      RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.metadata.v7.bin
  3. BIN
      RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.projects.v7.bin
  4. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/DesignTimeBuild/.dtbcache.v2
  5. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/01239fbf-6687-4b63-998d-f792aca6bc63.vsidx
  6. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/05ee04aa-601f-4f81-8fe9-df2aedec18f9.vsidx
  7. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/230daa69-897c-46e5-bfcb-7972493b7084.vsidx
  8. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/2a5f9589-8363-4f9e-8df0-3c9da121349e.vsidx
  9. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/782cf0ce-0ca8-4927-ae8d-fe5480d0b397.vsidx
  10. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/aef7c663-0533-42aa-a108-857eac186a6e.vsidx
  11. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/b13aa5e3-d976-4365-9ff8-bdfb185030ee.vsidx
  12. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/d4b1c652-87b9-4797-81f6-dc33fd53a7ef.vsidx
  13. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/fdab9600-0f48-4f69-ba75-db8c02367234.vsidx
  14. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/v17/.futdcache.v2
  15. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/v17/.suo
  16. 12
      RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/ApplicationBusiness.cs
  17. 2
      RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/IApplicationBusiness.cs
  18. 5
      RemitInboundAPI/RemitInboundAPI.Business/Business/RemitBusiness/IRemitBusiness.cs
  19. 46
      RemitInboundAPI/RemitInboundAPI.Business/Business/RemitBusiness/RemitBusiness.cs
  20. 22
      RemitInboundAPI/RemitInboundAPI.Business/Helper/ValidationHelper/ExRateValidationHelper.cs
  21. 24
      RemitInboundAPI/RemitInboundAPI.Business/Helper/ValidationHelper/RemittanceStatusValidationHelper.cs
  22. 78
      RemitInboundAPI/RemitInboundAPI.Business/Helper/ValidationHelper/SendTransactionValidationHelper.cs
  23. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.dll
  24. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.pdb
  25. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  26. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  27. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.dll
  28. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb
  29. 2
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfo.cs
  30. 2
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfoInputs.cache
  31. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.csproj.AssemblyReference.cache
  32. 2
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.csproj.CoreCompileInputs.cache
  33. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.dll
  34. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.pdb
  35. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/ref/RemitInboundAPI.Business.dll
  36. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/refint/RemitInboundAPI.Business.dll
  37. 29
      RemitInboundAPI/RemitInboundAPI.Common/Model/CommonResponse.cs
  38. 6
      RemitInboundAPI/RemitInboundAPI.Common/Model/RemitModel/ExRateModel.cs
  39. BIN
      RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  40. BIN
      RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  41. 2
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfo.cs
  42. 2
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfoInputs.cache
  43. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.dll
  44. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.pdb
  45. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/ref/RemitInboundAPI.Common.dll
  46. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/refint/RemitInboundAPI.Common.dll
  47. 2
      RemitInboundAPI/RemitInboundAPI.Repository/DBHelper/ConnectionHelper.cs
  48. 8
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/ApplicationRepository.cs
  49. 4
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/IApplicationRepository.cs
  50. 5
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/RemitRepository/IRemitRepository.cs
  51. 52
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/RemitRepository/RemitRepository.cs
  52. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  53. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  54. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.dll
  55. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb
  56. 2
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfo.cs
  57. 2
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfoInputs.cache
  58. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.csproj.AssemblyReference.cache
  59. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.dll
  60. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.pdb
  61. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/ref/RemitInboundAPI.Repository.dll
  62. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/refint/RemitInboundAPI.Repository.dll
  63. 4
      RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationHelper.cs
  64. 4
      RemitInboundAPI/RemitInboundAPI/Controllers/ApplicationController.cs
  65. 26
      RemitInboundAPI/RemitInboundAPI/Controllers/RemitController.cs
  66. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.dll
  67. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.pdb
  68. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  69. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  70. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.dll
  71. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb
  72. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.dll
  73. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.exe
  74. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.pdb
  75. 2
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfo.cs
  76. 2
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfoInputs.cache
  77. 17
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.MvcApplicationPartsAssemblyInfo.cs
  78. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.csproj.AssemblyReference.cache
  79. 1
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.csproj.FileListAbsolute.txt
  80. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.dll
  81. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.pdb
  82. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/apphost.exe
  83. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/ref/RemitInboundAPI.dll
  84. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/refint/RemitInboundAPI.dll

78
DB/SP's/PROC_REMIT_INBOUND_TRANSACTION_STATUS.sql

@ -0,0 +1,78 @@
ALTER PROC PROC_REMIT_INBOUND_TRANSACTION_STATUS
(
@Flag VARCHAR(20)
, @UserName VARCHAR(80) = NULL
, @AgentId INT = NULL
, @PartnerTransactionId VARCHAR(40) = NULL
, @IMEControlNo VARCHAR(40) = NULL
)
AS;
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN TRY
BEGIN
DECLARE @ErrorMsg VARCHAR(MAX), @TransactionId BIGINT = NULL, @Status VARCHAR(40), @PayStatus VARCHAR(40), @FinalStatus VARCHAR(40), @StatusMessage VARCHAR(200)
IF @Flag = 'STATUS'
BEGIN
SELECT @TransactionId = id
, @Status = tranStatus
, @PayStatus = payStatus
, @IMEControlNo = dbo.decryptDb(controlNo)
FROM remitTran (NOLOCK)
WHERE controlNo = dbo.FNAEncryptString(@IMEControlNo)
OR controlNo2 = dbo.FNAEncryptString(@PartnerTransactionId)
IF @TransactionId IS NULL
BEGIN
SELECT @TransactionId = id
, @Status = tranStatus
, @PayStatus = payStatus
, @IMEControlNo = dbo.decryptDb(controlNo)
FROM remitTranTemp (NOLOCK)
WHERE controlNo = dbo.FNAEncryptString(@IMEControlNo)
OR controlNo2 = dbo.FNAEncryptString(@PartnerTransactionId)
IF @TransactionId IS NULL
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Invalid transaction details!', @Id = NULL;
RETURN;
END
IF @Status = 'Hold' AND @PayStatus = 'UNPAID'
SELECT @FinalStatus = 'Hold', @StatusMessage = 'Transaction is waiting for approval!'
ELSE
SELECT @FinalStatus = @Status, @StatusMessage = 'Transaction is in '+@Status+' and is waiting for approval!'
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success', @Id = @IMEControlNo, @Extra = @FinalStatus, @Extra2 = @StatusMessage;
RETURN;
END
IF @Status = 'CANCEL' OR @PayStatus = 'CANCEL'
SELECT @FinalStatus = 'Cancel', @StatusMessage = 'Transaction is cancelled!'
IF @PayStatus = 'Paid' AND @Status <> 'Cancel'
SELECT @FinalStatus = 'Paid', @StatusMessage = 'Transaction is paid!'
IF @Status = 'CancelRequest'
SELECT @FinalStatus = 'CancelRequest', @StatusMessage = 'Transaction is paid!'
IF @Status = 'Payment' AND @PayStatus = 'UNPAID'
SELECT @FinalStatus = 'Unpaid', @StatusMessage = 'Transaction is in unpaid status!'
IF @Status = 'Payment' AND @PayStatus = 'Post'
SELECT @FinalStatus = 'Post', @StatusMessage = 'Transaction is in post status and waiting from thirdparty for final status!'
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success', @Id = @IMEControlNo, @Extra = @FinalStatus, @Extra2 = @StatusMessage;
RETURN;
END
END
END TRY
BEGIN CATCH
IF @@TRANCOUNT>0
ROLLBACK TRANSACTION
SET @ErrorMsg = 'Exception executing SP: ' + ERROR_MESSAGE()
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = @ErrorMsg, @Id = NULL;
END CATCH

BIN
RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.metadata.v7.bin

BIN
RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.projects.v7.bin

BIN
RemitInboundAPI/.vs/RemitInboundAPI/DesignTimeBuild/.dtbcache.v2

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/01239fbf-6687-4b63-998d-f792aca6bc63.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/05ee04aa-601f-4f81-8fe9-df2aedec18f9.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/230daa69-897c-46e5-bfcb-7972493b7084.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/2a5f9589-8363-4f9e-8df0-3c9da121349e.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/782cf0ce-0ca8-4927-ae8d-fe5480d0b397.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/aef7c663-0533-42aa-a108-857eac186a6e.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/b13aa5e3-d976-4365-9ff8-bdfb185030ee.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/d4b1c652-87b9-4797-81f6-dc33fd53a7ef.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/31e5f1be-106f-4c89-ab2f-91d20fda133a.vsidx → RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/fdab9600-0f48-4f69-ba75-db8c02367234.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/v17/.futdcache.v2

BIN
RemitInboundAPI/.vs/RemitInboundAPI/v17/.suo

12
RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/ApplicationBusiness.cs

@ -52,9 +52,9 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
return _response;
}
public async Task<CommonResponse> Authenticate(AuthenticateModel model)
public async Task<ApiResponse> Authenticate(AuthenticateModel model)
{
CommonResponse _response;
ApiResponse _response;
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, model.UserName, "Authenticate", model.IpAddress, "", JsonConvert.SerializeObject(model));
var _logResponse = await _applicationRepo.LogInboundData(_logRequestModel);
@ -62,17 +62,17 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
{
if (string.IsNullOrEmpty(model.UserName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Username can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "Username can not be empty.");
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else if (string.IsNullOrEmpty(model.Password))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Password can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "Password can not be empty.");
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else if (string.IsNullOrEmpty(model.AgentId))
{
_response = new CommonResponse(ResponseHelper.FAILED, "AgentId can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "AgentId can not be empty.");
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else
@ -82,7 +82,7 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
}
else
{
_response = new CommonResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_response = new ApiResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_logger.LogError("REMITBUSINESS | SENDREMITTANCE | LOGGING ERROR | " + JsonConvert.SerializeObject(_response));
}

2
RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/IApplicationBusiness.cs

@ -5,7 +5,7 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
{
public interface IApplicationBusiness
{
Task<CommonResponse> Authenticate(AuthenticateModel model);
Task<ApiResponse> Authenticate(AuthenticateModel model);
Task<CommonResponse> AuthenticateUser(AuthenticateModel model);
Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model);
Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId);

5
RemitInboundAPI/RemitInboundAPI.Business/Business/RemitBusiness/IRemitBusiness.cs

@ -6,7 +6,8 @@ namespace RemitInboundAPI.Business.Business.RemitBusiness
{
public interface IRemitBusiness
{
Task<CommonResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails);
Task<CommonResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails);
Task<ApiResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails);
Task<ApiResponse> GetRemittanceStatus(RemittanceStatusModel model, UserLoginModel loginDetails);
Task<ApiResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails);
}
}

46
RemitInboundAPI/RemitInboundAPI.Business/Business/RemitBusiness/RemitBusiness.cs

@ -23,9 +23,9 @@ namespace RemitInboundAPI.Business.Business.RemitBusiness
_applicationRepo = applicationRepo;
}
public async Task<CommonResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails)
public async Task<ApiResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails)
{
CommonResponse _response;
ApiResponse _response;
ExRateValidationHelper validationHelper = new ExRateValidationHelper();
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, loginDetails.UserName, "CalculateExRate", model.IpAddress, model.PartnerSessionId, JsonConvert.SerializeObject(model));
var _logResponse = await _applicationRepo.LogInboundData(_logRequestModel);
@ -46,18 +46,18 @@ namespace RemitInboundAPI.Business.Business.RemitBusiness
}
else
{
_response = new CommonResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_logger.LogError("REMITBUSINESS | SENDREMITTANCE | LOGGING ERROR | " + JsonConvert.SerializeObject(_response));
_response = new ApiResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_logger.LogError("REMITBUSINESS | CALCULATEEXRATE | LOGGING ERROR | " + JsonConvert.SerializeObject(_response));
}
return _response;
}
public async Task<CommonResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails)
public async Task<ApiResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails)
{
CommonResponse _response;
ApiResponse _response;
SendTransactionValidationHelper validationHelper = new SendTransactionValidationHelper();
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, loginDetails.UserName, "VerifyRemittance", model.IpAddress, model.PartnerSessionId, JsonConvert.SerializeObject(model));
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, loginDetails.UserName, "SendRemittance", model.IpAddress, model.PartnerSessionId, JsonConvert.SerializeObject(model));
var _logResponse = await _applicationRepo.LogInboundData(_logRequestModel);
if (_logResponse.ResponseCode == ResponseHelper.SUCCESS)
@ -76,11 +76,41 @@ namespace RemitInboundAPI.Business.Business.RemitBusiness
}
else
{
_response = new CommonResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_response = new ApiResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_logger.LogError("REMITBUSINESS | SENDREMITTANCE | LOGGING ERROR | " + JsonConvert.SerializeObject(_response));
}
return _response;
}
public async Task<ApiResponse> GetRemittanceStatus(RemittanceStatusModel model, UserLoginModel loginDetails)
{
ApiResponse _response;
RemittanceStatusValidationHelper validationHelper = new RemittanceStatusValidationHelper();
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, loginDetails.UserName, "GetRemittanceStatus", model.IpAddress, model.PartnerSessionId, JsonConvert.SerializeObject(model));
var _logResponse = await _applicationRepo.LogInboundData(_logRequestModel);
if (_logResponse.ResponseCode == ResponseHelper.SUCCESS)
{
_response = await validationHelper.GetRemittanceStatusValidationRequest(model);
if (_response.ResponseCode == ResponseHelper.SUCCESS)
{
_response = await _remitRepo.GetRemittanceStatus(model, loginDetails);
}
else
{
_logger.LogError("REMITBUSINESS | GETREMITTANCESTATUS | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
_applicationRepo.LogUpdateInboundData(_response, _logResponse.Id);
}
else
{
_response = new ApiResponse(ResponseHelper.FAILED, _logResponse.ResponseMessage);
_logger.LogError("REMITBUSINESS | GETREMITTANCESTATUS | LOGGING ERROR | " + JsonConvert.SerializeObject(_response));
}
return _response;
}
}
}

22
RemitInboundAPI/RemitInboundAPI.Business/Helper/ValidationHelper/ExRateValidationHelper.cs

@ -6,44 +6,44 @@ namespace RemitInboundAPI.Business.Helper.ValidationHelper
{
public class ExRateValidationHelper
{
public async Task<CommonResponse> ValidateExrateRequest(ExRateModel model)
public async Task<ApiResponse> ValidateExrateRequest(ExRateModel model)
{
CommonResponse _response;
ApiResponse _response;
if (string.IsNullOrEmpty(model.SendingCountryCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCountryCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCountryCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.SendingCurrencyCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.PayoutCountryCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutCountryCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutCountryCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.PayoutCurrencyCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutCurrencyCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutCurrencyCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.CollectionAmount))
{
_response = new CommonResponse(ResponseHelper.FAILED, "CollectionAmount can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "CollectionAmount can not be empty.");
}
else if (string.IsNullOrEmpty(model.PayoutAmount))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutAmount can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutAmount can not be empty.");
}
else if (string.IsNullOrEmpty(model.PayoutTypeCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PaymentTypeCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PaymentTypeCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.CalcBy))
{
_response = new CommonResponse(ResponseHelper.FAILED, "CalcBy can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "CalcBy can not be empty.");
}
else
{
_response = new CommonResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
_response = new ApiResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
}
return _response;
}

24
RemitInboundAPI/RemitInboundAPI.Business/Helper/ValidationHelper/RemittanceStatusValidationHelper.cs

@ -0,0 +1,24 @@
using RemitInboundAPI.Common.Model.RemitModel;
using RemitInboundAPI.Common.Model;
using RemitInboundAPI.Common.Helper;
namespace RemitInboundAPI.Business.Helper.ValidationHelper
{
public class RemittanceStatusValidationHelper
{
public async Task<ApiResponse> GetRemittanceStatusValidationRequest(RemittanceStatusModel model)
{
ApiResponse _response;
if (string.IsNullOrEmpty(model.IMEControlNo) && string.IsNullOrEmpty(model.PartnerTransactionId))
{
_response = new ApiResponse(ResponseHelper.FAILED, "IMEControlNo and PartnerTransactionId both can not be empty.");
}
else
{
_response = new ApiResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
}
return _response;
}
}
}

78
RemitInboundAPI/RemitInboundAPI.Business/Helper/ValidationHelper/SendTransactionValidationHelper.cs

@ -6,140 +6,140 @@ namespace RemitInboundAPI.Business.Helper.ValidationHelper
{
public class SendTransactionValidationHelper
{
public async Task<CommonResponse> SendTransactionValidationRequest(SendRemittanceModel model)
public async Task<ApiResponse> SendTransactionValidationRequest(SendRemittanceModel model)
{
CommonResponse _response;
ApiResponse _response;
if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCountryCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCountryCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCountryCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCurrencyCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutCountryCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutCountryCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutCountryCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutTypeCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutTypeCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutTypeCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutCurrencyCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutCurrencyCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutCurrencyCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.CollectionAmount))
{
_response = new CommonResponse(ResponseHelper.FAILED, "CollectionAmount can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "CollectionAmount can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCurrencyCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.TransferAmount))
{
_response = new CommonResponse(ResponseHelper.FAILED, "TransferAmount can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "TransferAmount can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutAmount))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutAmount can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutAmount can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.ServiceCharge))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ServiceCharge can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ServiceCharge can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.ExchangeRate))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ExchangeRate can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ExchangeRate can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCurrencyCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.RemittancePurpose))
{
_response = new CommonResponse(ResponseHelper.FAILED, "RemittancePurpose can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "RemittancePurpose can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.SourceOfFund))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SourceOfFund can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SourceOfFund can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.Relationship))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Relationship can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "Relationship can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.Occupation))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Occupation can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "Occupation can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.CalcBy))
{
_response = new CommonResponse(ResponseHelper.FAILED, "CalcBy can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "CalcBy can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderFirstName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderFirstName can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderFirstName can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderDOB))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderDOB can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderDOB can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderLastName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderLastName can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderLastName can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdType))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdType can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdType can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdNo))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdNo can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdNo can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdIssuedDate))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdIssuedDate can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdIssuedDate can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdValidDate))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdValidDate can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdValidDate can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderMobile))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderMobile can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderMobile can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderAddress))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderAddress can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderAddress can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderGender))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SenderGender can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "SenderGender can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverFirstName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverFirstName can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverFirstName can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverLastName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverLastName can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverLastName can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverMobile))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverMobile can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverMobile can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverCity))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverCity can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverCity can not be empty.");
}
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverAddress))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverAddress can not be empty.");
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverAddress can not be empty.");
}
else
{
_response = new CommonResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
_response = new ApiResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
}
//conditional
@ -149,19 +149,19 @@ namespace RemitInboundAPI.Business.Helper.ValidationHelper
{
if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutBankCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutBankCode can not be empty for payment type Bank Deposit.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutBankCode can not be empty for payment type Bank Deposit.");
}
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutBankBranchCode))
{
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutBankBranchCode can not be empty for payment type Bank Deposit.");
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutBankBranchCode can not be empty for payment type Bank Deposit.");
}
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverAccountNo))
{
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverAccountNo can not be empty for payment type Bank Deposit.");
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverAccountNo can not be empty for payment type Bank Deposit.");
}
else
{
_response = new CommonResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
_response = new ApiResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS);
}
}
}

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb

2
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI.Business")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4a75e2c350b46031bebbb93f179ac50944540e95")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4f21fe7c001e9f33c469aaf22f43a6a56b1d6ccf")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI.Business")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI.Business")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfoInputs.cache

@ -1 +1 @@
831577a45a58eaa1b1745ff404e91ac443fa015732883dbcf834659fc30e31e8
9f2cc3727705a5227110b4ffd6a7ab758ea89f31b55e352a5454863e2c8c2adf

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.csproj.AssemblyReference.cache

2
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.csproj.CoreCompileInputs.cache

@ -1 +1 @@
3acde09e1e93ad3ad06d19e21dc24a519aa0bab3e870f1fe9707b3d2e85b62a5
abf4bc92b582caa7d7db101e8389b494d36e8347dcb09beb61084bdd98b1cfd3

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/ref/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/refint/RemitInboundAPI.Business.dll

29
RemitInboundAPI/RemitInboundAPI.Common/Model/CommonResponse.cs

@ -6,6 +6,7 @@
public string? ResponseMessage { get; set; }
public string? Id { get; set; }
public string? Extra { get; set; }
public string? Extra2 { get; set; }
public object Data { get; set; }
public CommonResponse()
@ -14,12 +15,38 @@
ResponseMessage = "Failed";
}
public CommonResponse(int responseCode, string? responseMessage, string? id = null, string? extra = null)
public CommonResponse(int responseCode, string? responseMessage, string? id = null, string? extra = null, string? extra2 = null)
{
ResponseCode = responseCode;
ResponseMessage = responseMessage;
Id = id;
Extra = extra;
Extra2 = extra2;
}
}
public class ApiResponse
{
public int ResponseCode { get; set; }
public string? ResponseMessage { get; set; }
public object Data { get; set; }
public ApiResponse()
{
ResponseCode = 101;
ResponseMessage = "Failed";
}
public ApiResponse(CommonResponse _response)
{
ResponseCode = _response.ResponseCode;
ResponseMessage = _response.ResponseMessage;
}
public ApiResponse(int responseCode, string? responseMessage)
{
ResponseCode = responseCode;
ResponseMessage = responseMessage;
}
}
}

6
RemitInboundAPI/RemitInboundAPI.Common/Model/RemitModel/ExRateModel.cs

@ -14,6 +14,12 @@ namespace RemitInboundAPI.Common.Model.RemitModel
public string? CalcBy { get; set; }
}
public class RemittanceStatusModel : CommonRequestModel
{
public string? IMEControlNo { get; set; }
public string? PartnerTransactionId { get; set; }
}
public class SendRemittanceModel : CommonRequestModel
{
public RemitSenderDetailsModel? RemitSenderDetails { get; set; }

BIN
RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

2
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI.Common")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4a75e2c350b46031bebbb93f179ac50944540e95")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4f21fe7c001e9f33c469aaf22f43a6a56b1d6ccf")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI.Common")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI.Common")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfoInputs.cache

@ -1 +1 @@
87e8c18b610b688255ecf959d4b419cefd213e67c4145b5da51f481f68973ab4
5993d5b343fa1db9f19e79679d0f2ef3fdf14e7b5ee7281a1f0c6b3e5ca90aa2

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/ref/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/refint/RemitInboundAPI.Common.dll

2
RemitInboundAPI/RemitInboundAPI.Repository/DBHelper/ConnectionHelper.cs

@ -189,6 +189,8 @@ namespace RemitInboundAPI.Repository.DBHelper
response.Id = Convert.ToString(dt.Rows[0][2]);
if (dt.Columns.Count > 3)
response.Extra = Convert.ToString(dt.Rows[0][3]);
if (dt.Columns.Count > 4)
response.Extra2 = Convert.ToString(dt.Rows[0][4]);
return response;
}

8
RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/ApplicationRepository.cs

@ -40,9 +40,9 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
return _response;
}
public async Task<CommonResponse> Authenticate(AuthenticateModel model)
public async Task<ApiResponse> Authenticate(AuthenticateModel model)
{
var _response = new CommonResponse();
var _response = new ApiResponse();
try
{
var sql = "EXEC PROC_REMIT_INBOUND_LOGIN @Flag = 'LOGIN'";
@ -54,7 +54,7 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
sql += ", @ExpiresIn = " + _connHelper.FilterString(Utilities.ReadAppSettings("JWT:ExpiryTimeInMinutes"));
_logger.LogDebug("APPLICATIONREPOSITORY | AUTHENTICATE | SQL | " + sql);
_response = _connHelper.ParseDbResult(sql);
_response = new ApiResponse(_connHelper.ParseDbResult(sql));
}
catch (Exception ex)
{
@ -93,7 +93,7 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
return _response;
}
public async Task<CommonResponse> LogUpdateInboundData(CommonResponse response, string rowId)
public async Task<CommonResponse> LogUpdateInboundData(ApiResponse response, string rowId)
{
var _response = new CommonResponse();
try

4
RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/IApplicationRepository.cs

@ -5,10 +5,10 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
{
public interface IApplicationRepository
{
Task<CommonResponse> Authenticate(AuthenticateModel model);
Task<ApiResponse> Authenticate(AuthenticateModel model);
Task<CommonResponse> AuthenticateUser(AuthenticateModel model);
Task<CommonResponse> LogInboundData(InboundLogModel model);
Task<CommonResponse> LogUpdateInboundData(CommonResponse response, string rowId);
Task<CommonResponse> LogUpdateInboundData(ApiResponse response, string rowId);
Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId);
Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model);
}

5
RemitInboundAPI/RemitInboundAPI.Repository/Repository/RemitRepository/IRemitRepository.cs

@ -6,7 +6,8 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
{
public interface IRemitRepository
{
Task<CommonResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails);
Task<CommonResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails);
Task<ApiResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails);
Task<ApiResponse> GetRemittanceStatus(RemittanceStatusModel model, UserLoginModel loginDetails);
Task<ApiResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails);
}
}

52
RemitInboundAPI/RemitInboundAPI.Repository/Repository/RemitRepository/RemitRepository.cs

@ -19,9 +19,9 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
_connHelper = connHelper;
}
public async Task<CommonResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails)
public async Task<ApiResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails)
{
var _response = new CommonResponse();
var _response = new ApiResponse();
try
{
var sql = "EXEC PROC_REMIT_INBOUND_EXRATE @Flag = 'EXRATE'";
@ -47,7 +47,10 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
}
else
{
_response = _connHelper.ParseDbResult(dt);
var _dbResponse = _connHelper.ParseDbResult(dt);
_response.ResponseCode = _dbResponse.ResponseCode;
_response.ResponseMessage = _dbResponse.ResponseMessage;
if (_response.ResponseCode == ResponseHelper.SUCCESS)
{
var exRateResponse = new
@ -74,9 +77,9 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
return _response;
}
public async Task<CommonResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails)
public async Task<ApiResponse> SendRemittance(SendRemittanceModel model, UserLoginModel loginDetails)
{
var _response = new CommonResponse();
var _response = new ApiResponse();
try
{
var sql = "EXEC PROC_REMIT_INBOUND_TRANSACTION_SEND @Flag = 'SEND'";
@ -140,7 +143,7 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
{
IMEControlNo = Convert.ToString(_transactionResponse["IMEControlNo"]),
PartnerTransactionId = Convert.ToString(_transactionResponse["PartnerTransactionId"]),
TranStatus = Convert.ToString(_transactionResponse["TranStatus"]),
Status = Convert.ToString(_transactionResponse["TranStatus"]),
//SendingCommission = Utilities.ShowDecimal(Convert.ToString(_transactionResponse["SendingCommission"])),
//SendingCommissionCurrency = Convert.ToString(_transactionResponse["SendingCommissionCurrency"]),
CollectionAmount = Utilities.ShowDecimal(Convert.ToString(_transactionResponse["CollectionAmount"])),
@ -159,5 +162,42 @@ namespace RemitInboundAPI.Repository.Repository.RemitRepository
}
return _response;
}
public async Task<ApiResponse> GetRemittanceStatus(RemittanceStatusModel model, UserLoginModel loginDetails)
{
var _response = new ApiResponse();
try
{
var sql = "EXEC PROC_REMIT_INBOUND_TRANSACTION_STATUS @Flag = 'STATUS'";
sql += ", @UserName= " + _connHelper.FilterString(loginDetails.UserName);
sql += ", @AgentId = " + _connHelper.FilterString(loginDetails.AgentId);
sql += ", @PartnerTransactionId = " + _connHelper.FilterString(model.PartnerTransactionId);
sql += ", @IMEControlNo = " + _connHelper.FilterString(model.IMEControlNo);
_logger.LogDebug("REMITREPOSITORY | GETREMITTANCESTATUS | SQL | " + sql);
var _transactionResponse = _connHelper.ParseDbResult(sql);
_response.ResponseCode = _transactionResponse.ResponseCode;
_response.ResponseMessage = _transactionResponse.ResponseMessage;
if (_response.ResponseCode == ResponseHelper.SUCCESS)
{
_response.Data = new
{
IMEControlNo = _transactionResponse.Id,
Status = _transactionResponse.Extra,
Message = _transactionResponse.Extra2
};
}
}
catch (Exception ex)
{
_response.ResponseCode = ResponseHelper.EXCEPTION;
_response.ResponseMessage = "Exception occured: " + ex.Message;
_logger.LogError("REMITREPOSITORY | GETREMITTANCESTATUS | EXCEPTION | " + JsonConvert.SerializeObject(_response));
}
return _response;
}
}
}

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb

2
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI.Repository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4a75e2c350b46031bebbb93f179ac50944540e95")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4f21fe7c001e9f33c469aaf22f43a6a56b1d6ccf")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI.Repository")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI.Repository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfoInputs.cache

@ -1 +1 @@
a974456348f41c809c7f39807366095000b9313dc7ea111822f2814ce06bccaa
f011ff240e6124f7ea7cfb7c358d8856a8326f101875d1c6084e0b3ebe287957

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.csproj.AssemblyReference.cache

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/ref/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/refint/RemitInboundAPI.Repository.dll

4
RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationHelper.cs

@ -12,7 +12,7 @@ namespace RemitInboundAPI.Authorization
{
public static class AuthorizationHelper
{
public static async Task<CommonResponse> GenerateJWTToken(CommonResponse loginResponse, AuthenticateModel model)
public static async Task<ApiResponse> GenerateJWTToken(ApiResponse loginResponse, AuthenticateModel model)
{
var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Utilities.ReadAppSettings("JWT:Secret")));
var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);
@ -42,8 +42,6 @@ namespace RemitInboundAPI.Authorization
model.SessionIdentifier
};
loginResponse.Data = tokenResponse;
loginResponse.Id = null;
loginResponse.Extra = null;
return await Task.FromResult(loginResponse);
}

4
RemitInboundAPI/RemitInboundAPI/Controllers/ApplicationController.cs

@ -37,9 +37,9 @@ namespace RemitInboundAPI.Controllers
{
AuthenticateModel model = await AuthorizationHelper.GetAuthDetails(Request);
if (model == null)
return Ok(new CommonResponse { ResponseCode = 101, ResponseMessage = "Invalid headers found!" });
return Ok(new ApiResponse { ResponseCode = 101, ResponseMessage = "Invalid headers found!" });
var _response = new CommonResponse();
var _response = new ApiResponse();
model.ProcessIdentifier = Convert.ToString(Guid.NewGuid());
model.SessionIdentifier = Convert.ToString(Guid.NewGuid());
model.IpAddress = Utilities.GetIpAddress(HttpContext);

26
RemitInboundAPI/RemitInboundAPI/Controllers/RemitController.cs

@ -28,7 +28,7 @@ namespace RemitInboundAPI.Controllers
[Authorize(AuthenticationSchemes = "ApplicationAuthorization")]
public async Task<IActionResult> CalculateExRate(ExRateModel model)
{
var _response = new CommonResponse();
var _response = new ApiResponse();
var loginDetails = await AuthorizationHelper.GetLoginDetails(User);
model.SessionIdentifier = loginDetails.SessionIdentifier; //unique for one session
model.ProcessIdentifier = Convert.ToString(Guid.NewGuid()); //unique for each process
@ -50,7 +50,7 @@ namespace RemitInboundAPI.Controllers
[Authorize(AuthenticationSchemes = "ApplicationAuthorization")]
public async Task<IActionResult> SendRemittance(SendRemittanceModel model)
{
var _response = new CommonResponse();
var _response = new ApiResponse();
var loginDetails = await AuthorizationHelper.GetLoginDetails(User);
model.SessionIdentifier = loginDetails.SessionIdentifier; //unique for one session
model.ProcessIdentifier = Convert.ToString(Guid.NewGuid()); //unique for each process
@ -66,5 +66,27 @@ namespace RemitInboundAPI.Controllers
}
return Ok(_response);
}
[HttpPost]
[Route("getRemittanceStatus")]
[Authorize(AuthenticationSchemes = "ApplicationAuthorization")]
public async Task<IActionResult> GetRemittanceStatus(RemittanceStatusModel model)
{
var _response = new ApiResponse();
var loginDetails = await AuthorizationHelper.GetLoginDetails(User);
model.SessionIdentifier = loginDetails.SessionIdentifier; //unique for one session
model.ProcessIdentifier = Convert.ToString(Guid.NewGuid()); //unique for each process
model.IpAddress = Utilities.GetIpAddress(HttpContext);
using (LogContext.PushProperty("PartnerSessionId", model.PartnerSessionId))
using (LogContext.PushProperty("ProcessIdentifier", model.ProcessIdentifier))
using (LogContext.PushProperty("SessionIdentifier", model.SessionIdentifier))
{
_logger.LogInformation($"REMITCONTROLLER | GETREMITTANCESTATUS | REQUEST | {JsonConvert.SerializeObject(model)}");
_response = await _remitBusiness.GetRemittanceStatus(model, loginDetails);
_logger.LogInformation($"REMITCONTROLLER | GETREMITTANCESTATUS | RESPONSE | {JsonConvert.SerializeObject(_response)}");
}
return Ok(_response);
}
}
}

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.pdb

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.exe

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.pdb

2
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4f21fe7c001e9f33c469aaf22f43a6a56b1d6ccf")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfoInputs.cache

@ -1 +1 @@
81553e38b8c0af341dcf95f42445e229d2d79ca4a76a47006a537b944a7750f5
b68aa275097ab5f6767f340c26aca3597c4f95fb3db7624b34785337003d5776

17
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.MvcApplicationPartsAssemblyInfo.cs

@ -1,17 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")]
// Generated by the MSBuild WriteCodeFragment class.

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.csproj.AssemblyReference.cache

1
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.csproj.FileListAbsolute.txt

@ -67,7 +67,6 @@ D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInbou
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\RemitInboundAPI.AssemblyInfoInputs.cache
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\RemitInboundAPI.AssemblyInfo.cs
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\RemitInboundAPI.csproj.CoreCompileInputs.cache
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\RemitInboundAPI.MvcApplicationPartsAssemblyInfo.cs
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\RemitInboundAPI.MvcApplicationPartsAssemblyInfo.cache
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\staticwebassets.build.json
D:\C# Projects\UAT\JME_JAPAN\JME_Remit_UAT\JME Japan\INBOUND_SEND_API\RemitInboundAPI\RemitInboundAPI\obj\Debug\net8.0\staticwebassets.development.json

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.dll

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.pdb

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/apphost.exe

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/ref/RemitInboundAPI.dll

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/refint/RemitInboundAPI.dll

Loading…
Cancel
Save