This commit is contained in:
mmrbnjd
2024-11-29 18:52:58 +03:30
parent fc2d774506
commit 384bcbc20f
6 changed files with 43 additions and 25 deletions

View File

@@ -16,10 +16,14 @@ namespace Back.Services
private string _UniqueMemory;
private string _PrivateKey;
private readonly servCompany _servCompany;
public ActionTaxPayer(servCompany servCompany)
private readonly IConfiguration _configuration;
public ActionTaxPayer(servCompany servCompany, IConfiguration configuration)
{
_servCompany = servCompany;
_configuration = configuration;
}
public string GenerateTaxid(string FactorNo, string InvoiceDate)
{
//return "testTaxid";
@@ -70,12 +74,14 @@ namespace Back.Services
if (!string.IsNullOrEmpty(resquth.UniqueMemory) && !string.IsNullOrEmpty(resquth.PrivateKey))
{
// "https://sandboxrc.tax.gov.ir/req/api/"
//string taxapi = _configuration.GetSection("TaxPayerApi").Value;
string taxapi = "https://sandboxrc.tax.gov.ir/req/api/";
_UniqueMemory = resquth.UniqueMemory;
_PrivateKey = resquth.PrivateKey;
TaxApiService.Instance.Init(_UniqueMemory,
new SignatoryConfig(_PrivateKey, null),
new NormalProperties(ClientType.SELF_TSP), "https://tp.tax.gov.ir/req/api/");
new NormalProperties(ClientType.SELF_TSP), taxapi);
await TaxApiService.Instance.TaxApis.GetServerInformationAsync();
}
#endregion