Acquiring
YooKassaNet
.NET SDK for the YooKassa API v3
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
dotnet add package YooKassaNetQuick start
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 paymentCapturePaymentAsyncCapture a two-stage paymentCreateRefundAsyncRefund a paymentCreatePayoutAsyncPay out to a recipientCreateDealAsyncCreate a safe dealREADMEgithub.com/ai-iskuzhin/YooKassaNet
Loading README from the repository…