Wirepayment 1.0.0

dotnet add package Wirepayment --version 1.0.0
                    
NuGet\Install-Package Wirepayment -Version 1.0.0
                    
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="Wirepayment" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wirepayment" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Wirepayment" />
                    
Project file
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 Wirepayment --version 1.0.0
                    
#r "nuget: Wirepayment, 1.0.0"
                    
#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 Wirepayment@1.0.0
                    
#: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=Wirepayment&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Wirepayment&version=1.0.0
                    
Install as a Cake Tool

Wirepayment

Official .NET server-side SDK for the Wire payment API. Targets .NET 8, with zero third-party dependencies (built on System.Net.Http and System.Text.Json).

Install

dotnet add package Wirepayment

Quickstart

using Wire;

using var wire = new WireClient("sk_live_...");

// Amounts are in minor units (integer).
var pi = await wire.PaymentIntents.CreateAsync(new PaymentIntentCreateParams
{
    Amount = 50000,
    Currency = "MNT",
    AllowedOperators = new[] { "sandbox" }, // the operator ids enabled on your account
});

var confirmed = await wire.PaymentIntents.ConfirmAsync(pi.Id);
Console.WriteLine($"{confirmed.Id} {confirmed.Status}");

Auto-pagination

await foreach (var charge in wire.Charges.ListAsync(new ListParams { Limit = 50 }))
{
    Console.WriteLine(charge.Id);
}

Webhook verification

Always verify on the raw, unparsed request body.

using Wire;

// rawBody is the unparsed request body (string or byte[]).
// header is the value of the WirePayment-Signature request header.
var ev = Webhooks.Verify(rawBody, header, endpointSecret);
Console.WriteLine(ev.Type);

Webhooks.Verify throws SignatureVerificationException on any mismatch, malformed header, or timestamp outside tolerance (default 300s). It fails closed.

Errors

using Wire;

try
{
    await wire.PaymentIntents.CreateAsync(new PaymentIntentCreateParams { Amount = -1 });
}
catch (WireException e)
{
    Console.WriteLine($"{e.Code} {e.RequestId} {e.StatusCode}");
}

Network and timeout failures surface as WireConnectionException (a subclass of WireException). The API key is never logged nor included in any exception.

Configuration

using var wire = new WireClient("sk_live_...", new WireClientOptions
{
    BaseUrl = "https://api.wire.mn", // default
    Timeout = TimeSpan.FromSeconds(30),
    MaxRetries = 2,
    // HttpClient = myHttpClient,          // inject your own
    // HttpMessageHandler = myHandler,     // or a custom handler
});

Requests are retried with exponential backoff and jitter on 429, 5xx, and network errors, honoring Retry-After. POST requests carry an Idempotency-Key (generated if not supplied), reused across retries.

Documentation

Full API documentation: docs.wire.mn.

License

MIT

Product 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

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 122 6/7/2026