Lava.NET
1.0.1
dotnet add package Lava.NET --version 1.0.1
NuGet\Install-Package Lava.NET -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lava.NET" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lava.NET" Version="1.0.1" />
<PackageReference Include="Lava.NET" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lava.NET --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lava.NET, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lava.NET@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lava.NET&version=1.0.1
#tool nuget:?package=Lava.NET&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Lava.NET
Библиотека для работы с API сайта lava.ru. Пока что ведется работа над бизнес-частью API
Советуется перед использованием прочитать API сайта lava.ru
Примеры
Установка бибилотеки
dotnet add package Lava.NET
И использлование в проекте
using Lava.NET;
public class Program
{
public static async Task Main(string[] args)
{
var publicLavaApi = new PublicLavaAPI("[ Ваш токен ]");
// ... Ваша логика
}
}
Пример использования с ASP.NET приложением:
// Startup.cs
public void ConfigureServices(IServiceCollection services)
{
var publicLavaApi = new PublicLavaAPI("[ Ваш токен ]");
services.AddControllers();
services
.AddSwaggerGen();
services
// ...Настройка приложения
.AddSingleton(publicLavaAPI);
}
Пример работы с вебхуком(.NET 8):
// PaymentController.cs
[ApiController]
[Route("/payment/")]
public class PaymentController(PublicLavaAPI lavaAPI) : ControllerBase
{
[HttpPost("lava")]
public async Task<IActionResult> ValidatePaymentLava([FromBody] WebhookResponse webhookResponse)
{
// Ваша логика
return Ok(); // Обязательно отвечать 200, иначе вебхуки будут приходить снова и снова, до 15 раз.
}
}
Создание ссылки на оплату:
var publicLavaApi = new PublicLavaAPI("[Ваш токен]");
var createdPayment = await publicLavaApi.CreatePaymentAsync(
new (){
comment = "Оплата покупки в Telegram боте", // Необ.
hook_url = $"https://example.com/api/payment/lava", // Необ.
merchant_id = "AskMeAboutBOT", // Необ.
merchant_name = "AskMeAboutBOT", // Необ.
custom_fields = $"Любые кастомные данные, передаваемые в webhook", // Необ.
success_url = $"https://example.com/", // Необ.
sum = 39.00f,
wallet_to = "R123123123"
}
);
Console.Out.WriteLine(createdPayment.url);
// >>> 'https://p2p.lava.ru/form?id=1ee31634-e3e0-34ce-1423-b5b4cb524c6a'
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.