WePayment.SDK
1.0.2
dotnet add package WePayment.SDK --version 1.0.2
NuGet\Install-Package WePayment.SDK -Version 1.0.2
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="WePayment.SDK" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WePayment.SDK" Version="1.0.2" />
<PackageReference Include="WePayment.SDK" />
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 WePayment.SDK --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WePayment.SDK, 1.0.2"
#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 WePayment.SDK@1.0.2
#: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=WePayment.SDK&version=1.0.2
#tool nuget:?package=WePayment.SDK&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WePayment.SDK
Official WePayment SDK for .NET.
Features
- Create payment orders via the WePayment API.
- HMAC SHA256 signature generation for requests.
- Webhook verification helpers.
- Dependency Injection integration for HttpClient and options.
Requirements
- .NET 6.0
Install
# NuGet
Install-Package WePayment.SDK
Configure
using WePayment.SDK.Extensions;
using WePayment.SDK.Options;
builder.Services.AddWePayment(options =>
{
options.BaseUrl = "https://api.wepayment.com";
options.ApiKey = "your-api-key";
options.SecretKey = "your-secret-key";
options.TimeoutSeconds = 30;
});
Create an order
using WePayment.SDK.Interfaces;
using WePayment.SDK.Models.Requests;
public class PaymentsService
{
private readonly IWePaymentClient _client;
public PaymentsService(IWePaymentClient client)
{
_client = client;
}
public Task CreateAsync()
{
var request = new CreateOrderV2Request
{
Amount = 100.00m,
Currency = "USD",
ReferenceId = "order-123",
ReturnUrl = "https://merchant.example.com/return",
CallbackUrl = "https://merchant.example.com/webhook",
Email = "customer@example.com",
FirstName = "Jane",
LastName = "Doe",
UserCountryCode = "US",
UseUserCountryAsResident = true,
Description = "Order #123",
Metadata = new Dictionary<string, string>
{
["cartId"] = "c-001"
}
};
return _client.CreateOrderAsync(request);
}
}
The SDK automatically sets Nonce and Timestamp, builds the canonical parameter string, and adds the required X-API-KEY and X-Signature headers.
Webhook verification
using WePayment.SDK.Webhooks;
public class WebhooksController
{
private readonly IWebhookVerifier _verifier;
public WebhooksController(IWebhookVerifier verifier)
{
_verifier = verifier;
}
public IActionResult Handle(IDictionary<string, string> headers, string rawBody)
{
var result = _verifier.Verify(headers, rawBody);
if (!result.IsValid)
{
return new BadRequestResult();
}
var payload = result.Payload;
return new OkResult();
}
}
The verifier checks:
X-API-KEYandX-Signatureheaders.- HMAC SHA256 signature over the canonical payload fields.
Responses
CreateOrderV2Response derives from BaseResponse<T> and includes:
SuccessErrorCodeMessageData(order details, includingPaymentUrl)
Notes
WePaymentOptions.TimeoutSecondsdefaults to 30 seconds.PaymentStatusvalues includeCreated,Processing,Success,Failed,Canceled,Refunded,Expired, andPartialReceived.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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.
-
net6.0
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
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.2 | 128 | 1/20/2026 |