init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
74
Kreta.Job.Tasks/OtpBankszamlaIgenylesJob.cs
Normal file
74
Kreta.Job.Tasks/OtpBankszamlaIgenylesJob.cs
Normal file
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using Kreta.Core.Configuratiaton;
|
||||
using Kreta.Core.Logic;
|
||||
using Kreta.DataAccessManual.ParameterClasses;
|
||||
using Kreta.Job.Tasks.Core;
|
||||
|
||||
namespace Kreta.Job.Tasks
|
||||
{
|
||||
|
||||
public class OtpBankszamlaIgenylesJob : BankszamlaIgenylesJob, IOtpBankszamlaIgenylesJob
|
||||
{
|
||||
private readonly string OTP_IN = "\\OTP_IN\\";
|
||||
private readonly string OTP_ERROR = "\\OTP_ERROR\\";
|
||||
private readonly string OTP_OK = "\\OTP_OK\\";
|
||||
private readonly string OTP_ARCHIVE = "\\OTP_ARCHIVE\\";
|
||||
|
||||
public void OtpBankszamlaIgenyles()
|
||||
{
|
||||
RunBankszamlaIgenylesJob<OtpBankszamlaIgenylesConfiguration>();
|
||||
}
|
||||
|
||||
protected override string GetArchivePart()
|
||||
{
|
||||
return OTP_ARCHIVE;
|
||||
}
|
||||
|
||||
protected override string GetErrorPart()
|
||||
{
|
||||
return OTP_ERROR;
|
||||
}
|
||||
|
||||
protected override string GetInPart()
|
||||
{
|
||||
return OTP_IN;
|
||||
}
|
||||
|
||||
protected override string GetOkPart()
|
||||
{
|
||||
return OTP_OK;
|
||||
}
|
||||
|
||||
protected override bool HasRowWithError(List<BankszamlaIgenylesPco> bankszamlaIgenylesPcos)
|
||||
{
|
||||
// NOTE: OTP esetén csak akkor kell küldeni email-t, ha van hibás sor a feldolgozott állományban.
|
||||
return bankszamlaIgenylesPcos.Any(x => x.IsError);
|
||||
}
|
||||
|
||||
protected override string DecryptEgyediAzonosito(string receivedEgyediAzonosito)
|
||||
{
|
||||
// NOTE: az OTP a titkosított tokent küldi vissza az egyedi azonosítóban, ezért azt decrypt-álni kell
|
||||
var configuration = (OtpBankszamlaIgenylesConfiguration)ConfigurationManager.GetSection(nameof(OtpBankszamlaIgenylesConfiguration));
|
||||
if (string.IsNullOrWhiteSpace(receivedEgyediAzonosito))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
try
|
||||
{
|
||||
return UrlLogic.JweDecrypt(configuration.PrivateKeyFileName, configuration.PrivateKeyFilePassword, receivedEgyediAzonosito);
|
||||
}
|
||||
catch (CryptographicException ex)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
catch (ArgumentOutOfRangeException aorex)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue