Rename
This commit is contained in:
@ -14,9 +14,9 @@ namespace Hcs.Client.Api
|
|||||||
/// <param name="payload">Пейлоад сведений о платежных документах</param>
|
/// <param name="payload">Пейлоад сведений о платежных документах</param>
|
||||||
/// <param name="token">Токен отмены</param>
|
/// <param name="token">Токен отмены</param>
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
public async Task<bool> ImportPaymentDocumentAsync(ImportPaymentDocumentPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportPaymentDocumentDataAsync(ImportPaymentDocumentDataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportPaymentDocumentRequest(client);
|
var request = new ImportPaymentDocumentDataRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ namespace Hcs.Client.Api
|
|||||||
/// <returns>Лицевые счета</returns>
|
/// <returns>Лицевые счета</returns>
|
||||||
public async Task<IEnumerable<exportMeteringDeviceHistoryResultType>> ExportMeteringDeviceHistoryAsync(ExportMeteringDeviceHistoryPayload payload, CancellationToken token = default)
|
public async Task<IEnumerable<exportMeteringDeviceHistoryResultType>> ExportMeteringDeviceHistoryAsync(ExportMeteringDeviceHistoryPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportMeteringDeviceHistory(client);
|
var request = new ExportMeteringDeviceHistoryRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ using System.Collections.Generic;
|
|||||||
namespace Hcs.Client.Api.Payload.Bills
|
namespace Hcs.Client.Api.Payload.Bills
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/Bills/importPaymentDocumentRequest.html
|
// http://open-gkh.ru/Bills/importPaymentDocumentRequest.html
|
||||||
public class ImportPaymentDocumentPayload
|
public class ImportPaymentDocumentDataPayload
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/Bills/importPaymentDocumentRequest/PaymentInformation.html
|
// http://open-gkh.ru/Bills/importPaymentDocumentRequest/PaymentInformation.html
|
||||||
public class PaymentInformation
|
public class PaymentInformation
|
||||||
@ -11,11 +11,11 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Hcs.Client.Api.Request.Bills
|
namespace Hcs.Client.Api.Request.Bills
|
||||||
{
|
{
|
||||||
internal class ImportPaymentDocumentRequest(ClientBase client) : BillsRequestBase(client)
|
internal class ImportPaymentDocumentDataRequest(ClientBase client) : BillsRequestBase(client)
|
||||||
{
|
{
|
||||||
protected override bool CanBeRestarted => false;
|
protected override bool CanBeRestarted => false;
|
||||||
|
|
||||||
internal async Task<bool> ExecuteAsync(ImportPaymentDocumentPayload payload, CancellationToken token)
|
internal async Task<bool> ExecuteAsync(ImportPaymentDocumentDataPayload payload, CancellationToken token)
|
||||||
{
|
{
|
||||||
// TODO: Добавить проверку пейлоада
|
// TODO: Добавить проверку пейлоада
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace Hcs.Client.Api.Request.Bills
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private importPaymentDocumentRequest GetRequestFromPayload(ImportPaymentDocumentPayload payload)
|
private importPaymentDocumentRequest GetRequestFromPayload(ImportPaymentDocumentDataPayload payload)
|
||||||
{
|
{
|
||||||
var items = new List<object>();
|
var items = new List<object>();
|
||||||
if (payload.confirmAmountsCorrect)
|
if (payload.confirmAmountsCorrect)
|
||||||
@ -52,7 +52,7 @@ namespace Hcs.Client.Api.Request.Bills
|
|||||||
items.Add(payload.month);
|
items.Add(payload.month);
|
||||||
items.Add(payload.year);
|
items.Add(payload.year);
|
||||||
|
|
||||||
var paymentInformations = new Dictionary<ImportPaymentDocumentPayload.PaymentInformation, importPaymentDocumentRequestPaymentInformation>();
|
var paymentInformations = new Dictionary<ImportPaymentDocumentDataPayload.PaymentInformation, importPaymentDocumentRequestPaymentInformation>();
|
||||||
foreach (var entry in payload.paymentInformation)
|
foreach (var entry in payload.paymentInformation)
|
||||||
{
|
{
|
||||||
var paymentInformation = new importPaymentDocumentRequestPaymentInformation()
|
var paymentInformation = new importPaymentDocumentRequestPaymentInformation()
|
||||||
@ -71,7 +71,7 @@ namespace Hcs.Client.Api.Request.Bills
|
|||||||
var chargeInfo = new List<object>();
|
var chargeInfo = new List<object>();
|
||||||
foreach (var subEntry in entry.chargeInfo)
|
foreach (var subEntry in entry.chargeInfo)
|
||||||
{
|
{
|
||||||
if (subEntry is ImportPaymentDocumentPayload.MunicipalService municipalService)
|
if (subEntry is ImportPaymentDocumentDataPayload.MunicipalService municipalService)
|
||||||
{
|
{
|
||||||
var item = new PDServiceChargeTypeMunicipalService()
|
var item = new PDServiceChargeTypeMunicipalService()
|
||||||
{
|
{
|
||||||
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Hcs.Client.Api.Request.DeviceMetering
|
namespace Hcs.Client.Api.Request.DeviceMetering
|
||||||
{
|
{
|
||||||
internal class ExportMeteringDeviceHistory(ClientBase client) : DeviceMeteringRequestBase(client)
|
internal class ExportMeteringDeviceHistoryRequest(ClientBase client) : DeviceMeteringRequestBase(client)
|
||||||
{
|
{
|
||||||
protected override bool EnableMinimalResponseWaitDelay => false;
|
protected override bool EnableMinimalResponseWaitDelay => false;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@
|
|||||||
<Compile Include="Client\Api\NsiApi.cs" />
|
<Compile Include="Client\Api\NsiApi.cs" />
|
||||||
<Compile Include="Client\Api\NsiCommonApi.cs" />
|
<Compile Include="Client\Api\NsiCommonApi.cs" />
|
||||||
<Compile Include="Client\Api\OrgRegistryCommonApi.cs" />
|
<Compile Include="Client\Api\OrgRegistryCommonApi.cs" />
|
||||||
<Compile Include="Client\Api\Payload\Bills\ImportPaymentDocumentPayload.cs" />
|
<Compile Include="Client\Api\Payload\Bills\ImportPaymentDocumentDataPayload.cs" />
|
||||||
<Compile Include="Client\Api\Payload\DeviceMetering\ExportMeteringDeviceHistoryPayload.cs" />
|
<Compile Include="Client\Api\Payload\DeviceMetering\ExportMeteringDeviceHistoryPayload.cs" />
|
||||||
<Compile Include="Client\Api\Payload\HouseManagement\ImportAccountDataPayload.cs" />
|
<Compile Include="Client\Api\Payload\HouseManagement\ImportAccountDataPayload.cs" />
|
||||||
<Compile Include="Client\Api\Payload\HouseManagement\ImportContractDataPayload.cs" />
|
<Compile Include="Client\Api\Payload\HouseManagement\ImportContractDataPayload.cs" />
|
||||||
@ -98,9 +98,9 @@
|
|||||||
<Compile Include="Client\Api\Request\Adapter\IGetStateResultMany.cs" />
|
<Compile Include="Client\Api\Request\Adapter\IGetStateResultMany.cs" />
|
||||||
<Compile Include="Client\Api\Request\Adapter\IGetStateResultOne.cs" />
|
<Compile Include="Client\Api\Request\Adapter\IGetStateResultOne.cs" />
|
||||||
<Compile Include="Client\Api\Request\Bills\BillsRequestBase.cs" />
|
<Compile Include="Client\Api\Request\Bills\BillsRequestBase.cs" />
|
||||||
<Compile Include="Client\Api\Request\Bills\ImportPaymentDocumentRequest.cs" />
|
<Compile Include="Client\Api\Request\Bills\ImportPaymentDocumentDataRequest.cs" />
|
||||||
<Compile Include="Client\Api\Request\DeviceMetering\DeviceMeteringRequestBase.cs" />
|
<Compile Include="Client\Api\Request\DeviceMetering\DeviceMeteringRequestBase.cs" />
|
||||||
<Compile Include="Client\Api\Request\DeviceMetering\ExportMeteringDeviceHistory.cs" />
|
<Compile Include="Client\Api\Request\DeviceMetering\ExportMeteringDeviceHistoryRequest.cs" />
|
||||||
<Compile Include="Client\Api\Request\DeviceMetering\ImportMeteringDeviceValuesRequest.cs" />
|
<Compile Include="Client\Api\Request\DeviceMetering\ImportMeteringDeviceValuesRequest.cs" />
|
||||||
<Compile Include="Client\Api\Request\Exception\NoResultsRemoteException.cs" />
|
<Compile Include="Client\Api\Request\Exception\NoResultsRemoteException.cs" />
|
||||||
<Compile Include="Client\Api\Request\GostSigningEndpointBehavior.cs" />
|
<Compile Include="Client\Api\Request\GostSigningEndpointBehavior.cs" />
|
||||||
|
|||||||
@ -45,7 +45,7 @@ namespace Hcs.TestApp
|
|||||||
var paymentsScenario = new PaymentsScenario(client);
|
var paymentsScenario = new PaymentsScenario(client);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//billsScenario.ImportPaymentDocument();
|
//billsScenario.ImportPaymentDocumentData();
|
||||||
|
|
||||||
//deviceMeteringScenario.ExportMeteringDeviceHistory();
|
//deviceMeteringScenario.ExportMeteringDeviceHistory();
|
||||||
//deviceMeteringScenario.ImportMeteringDeviceValues();
|
//deviceMeteringScenario.ImportMeteringDeviceValues();
|
||||||
|
|||||||
@ -11,27 +11,27 @@ namespace Hcs.TestApp.Scenario
|
|||||||
{
|
{
|
||||||
private readonly UniClient client = client;
|
private readonly UniClient client = client;
|
||||||
|
|
||||||
internal void ImportPaymentDocument()
|
internal void ImportPaymentDocumentData()
|
||||||
{
|
{
|
||||||
var paymentInformation = new ImportPaymentDocumentPayload.PaymentInformation()
|
var paymentInformation = new ImportPaymentDocumentDataPayload.PaymentInformation()
|
||||||
{
|
{
|
||||||
bankBIK = "049805609",
|
bankBIK = "049805609",
|
||||||
operatingAccountNumber = "40602810276000100228"
|
operatingAccountNumber = "40602810276000100228"
|
||||||
};
|
};
|
||||||
var payload = new ImportPaymentDocumentPayload()
|
var payload = new ImportPaymentDocumentDataPayload()
|
||||||
{
|
{
|
||||||
confirmAmountsCorrect = true,
|
confirmAmountsCorrect = true,
|
||||||
month = 8,
|
month = 8,
|
||||||
year = 2025,
|
year = 2025,
|
||||||
paymentInformation = [paymentInformation],
|
paymentInformation = [paymentInformation],
|
||||||
paymentDocument = [new ImportPaymentDocumentPayload.PaymentDocument()
|
paymentDocument = [new ImportPaymentDocumentDataPayload.PaymentDocument()
|
||||||
{
|
{
|
||||||
paymentInformation = paymentInformation,
|
paymentInformation = paymentInformation,
|
||||||
accountGuid = "019917a8-6eb6-74cc-99b7-58350127ac50",
|
accountGuid = "019917a8-6eb6-74cc-99b7-58350127ac50",
|
||||||
paymentDocumentNumber = "23900701600162023",
|
paymentDocumentNumber = "23900701600162023",
|
||||||
chargeInfo =
|
chargeInfo =
|
||||||
[
|
[
|
||||||
new ImportPaymentDocumentPayload.MunicipalService()
|
new ImportPaymentDocumentDataPayload.MunicipalService()
|
||||||
{
|
{
|
||||||
moneyRecalculation = 0M,
|
moneyRecalculation = 0M,
|
||||||
moneyDiscount = 0M,
|
moneyDiscount = 0M,
|
||||||
@ -63,7 +63,7 @@ namespace Hcs.TestApp.Scenario
|
|||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = client.Bills.ImportPaymentDocumentAsync(payload).Result;
|
var result = client.Bills.ImportPaymentDocumentDataAsync(payload).Result;
|
||||||
Console.WriteLine("Scenario execution " + (result ? "succeeded" : "failed"));
|
Console.WriteLine("Scenario execution " + (result ? "succeeded" : "failed"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user