Acquiring

YooKassaNet

.NET SDK for the YooKassa API v3

YooKassaNet version on NuGetYooKassaNet downloads on NuGetMITC#
netstandard2.0net8.0net10.0

Features

  • One- and two-stage payments, capture and cancel
  • Refunds and payouts (including SBP)
  • Safe deals and shop settings
  • Inbound webhook notification verification
  • Idempotency and a single YooKassaClient facade

Installation

bash
dotnet add package YooKassaNet

Quick start

csharp
using YooKassaNet;
using YooKassaNet.Payments;

using var http = new HttpClient();
var payments = new YooKassaPaymentsClient(http, new YooKassaClientOptions
{
    ShopId = "1281498",
    SecretKey = "test_...",
});

var payment = await payments.CreatePaymentAsync(new CreatePaymentRequest
{
    Amount = Money.Rubles(100m),
    Capture = true,
    Confirmation = Confirmation.Redirect("https://example.com/return"),
    Description = "Order #37",
});

Console.WriteLine(payment.Confirmation?.ConfirmationUrl);

Key methods

CreatePaymentAsyncCreate a payment
CapturePaymentAsyncCapture a two-stage payment
CreateRefundAsyncRefund a payment
CreatePayoutAsyncPay out to a recipient
CreateDealAsyncCreate a safe deal
READMEgithub.com/ai-iskuzhin/YooKassaNet
Loading README from the repository…