Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
o.nadymov committed Aug 7, 2023
1 parent 0b308ff commit b82dc24
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,50 @@
C# SDK для интеграции с хостом Мульти-Банка (Узбекистан) для передачи информации об оплатах покупок.

The project for integration with MultiBank host.

## Быстрый старт

Клиент написан на C#, .NET 7.0 с использованием Dependency Injection от [Microsoft](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-usage).

### Определение зависимостей

```csharp
// Set up the dependency injection container
var services = new ServiceCollection();

// Register your dependencies here.
services.AddHttpClient();
services.AddSingleton<IMultiBankProvider, MultiBankProvider>();

// Build the service provider
_serviceProvider = services.BuildServiceProvider();
```


### Вызов методов API
#### Продажа
```csharp
var settings = new MultiBankOption { ServiceUrl = "http://localhost:8080/" };

var multiBankProvider = _serviceProvider.GetService<IMultiBankProvider>()!;
var saleSlip = new SaleSlip
{
Items = new List<SlipItem>{
new SlipItem{
ProductName="Свитер" ,
ProductLabel="4780019900571",
ProductBarcode="4780019900571",
Count = 1,
ProductPrice=1000,
TotalProductPrice=1000,
ClassifierClassCode="01902001009030001" }
},
ReceiptCashierName = "Иванов Иван",
ReceiptGnkReceivedCash = 1000,
ReceiptGnkTime = DateTime.UtcNow,
Location = new Location { Latitude = 45.29671408606234, Longitude = 79.21787478269367 }
};

// Act
var result = await multiBankProvider.SellAsync(settings, saleSlip);
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<PublishReadyToRun>true</PublishReadyToRun>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<PublishReadyToRunComposite>false</PublishReadyToRunComposite>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit b82dc24

Please sign in to comment.