TailoredApps.Shared.Payments
2.1.1
See the version list below for details.
dotnet add package TailoredApps.Shared.Payments --version 2.1.1
NuGet\Install-Package TailoredApps.Shared.Payments -Version 2.1.1
<PackageReference Include="TailoredApps.Shared.Payments" Version="2.1.1" />
<PackageVersion Include="TailoredApps.Shared.Payments" Version="2.1.1" />
<PackageReference Include="TailoredApps.Shared.Payments" />
paket add TailoredApps.Shared.Payments --version 2.1.1
#r "nuget: TailoredApps.Shared.Payments, 2.1.1"
#:package TailoredApps.Shared.Payments@2.1.1
#addin nuget:?package=TailoredApps.Shared.Payments&version=2.1.1
#tool nuget:?package=TailoredApps.Shared.Payments&version=2.1.1
TailoredApps.Shared.Payments
One interface, IPaymentService, in front of several payment gateways. A provider package per gateway
(TailoredApps.Shared.Payments.Provider.*: Adyen, CashBill, HotPay, PayNow, PayU, Przelewy24, Revolut, Stripe, Tpay)
plugs into it; the application starts payments, reads their status and handles webhooks the same way for all of them.
Usage
// Program.cs
builder.Services
.AddPayments()
.RegisterTpayProvider();
// PaymentProvider, Amount and Currency are required members.
var response = await payments.RegisterPayment(new PaymentRequest("Tpay", 49.99m, "PLN")
{
Title = "Order 7",
Email = "buyer@example.com",
AdditionalData = "order-7", // your own reference; it identifies the payment in Tpay and Adyen webhooks
}, cancellationToken);
return Redirect(response.RedirectUrl);
Three things an application has to handle
1. A failing gateway is an exception, not a rejected payment.
RegisterPayment and GetStatus return PaymentStatusEnum.Rejected only when the gateway said so. When the gateway is failing,
refuses a status query or cannot be reached, they throw PaymentGatewayException (derives from HttpRequestException): the state
of the payment is not known and an order must not be cancelled on that basis.
try
{
var payment = await payments.GetStatus("Tpay", paymentId, cancellationToken);
// act on payment.PaymentStatus
}
catch (HttpRequestException exception) // covers PaymentGatewayException
{
// unknown state: leave the order as it is and check again later
}
Stripe reports such failures with StripeException.
2. PaymentRequest requires PaymentProvider, Amount and Currency.
An object initializer that leaves one out does not compile (CS9035), and System.Text.Json refuses a document without them.
3. Webhooks need the raw request body.
Gateways sign the exact bytes they send. Read the body from the request stream (not through [FromForm] or [FromBody]), pass it with
every header to HandleWebhookAsync, and act on the result: PaymentWebhookProcessed, PaymentWebhookIgnored or
PaymentWebhookRejected. Tpay and Adyen expect a specific answer body (TpayProvider.Acknowledgement, AdyenProvider.Acknowledgement)
and identify the payment by the reference you sent in PaymentRequest.AdditionalData.
Upgrading from 1.x
The three points above are the changes that affect application code. The full guide, with before/after examples: https://shared.tailoredapps.pl/en/Migration/v2/
Documentation
- Library: https://shared.tailoredapps.pl/en/Libraries/Payments/
- Providers, configuration keys and webhook details: the Providers pages under the same address
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. net11.0 is compatible. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Primitives (>= 10.0.15)
-
net11.0
- No dependencies.
NuGet packages (9)
Showing the top 5 NuGet packages that depend on TailoredApps.Shared.Payments:
| Package | Downloads |
|---|---|
|
TailoredApps.Shared.Payments.Provider.CashBill
Package Description |
|
|
TailoredApps.Shared.Payments.Provider.Przelewy24
Package Description |
|
|
TailoredApps.Shared.Payments.Provider.Adyen
Package Description |
|
|
TailoredApps.Shared.Payments.Provider.Stripe
Package Description |
|
|
TailoredApps.Shared.Payments.Provider.Revolut
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-preview.3 | 53 | 12/2/2026 |
| 3.0.0-preview.2 | 100 | 11/12/2026 |
| 3.0.0-preview.1 | 111 | 11/12/2026 |
| 2.1.2 | 67 | 12/2/2026 |
| 2.1.1 | 95 | 12/2/2026 |
| 2.1.0 | 214 | 11/12/2026 |
| 2.0.1 | 195 | 11/12/2026 |
| 2.0.0 | 219 | 11/12/2026 |
| 1.6.0 | 447 | 11/12/2026 |
| 1.4.19 | 452 | 10/26/2026 |
| 1.4.18 | 494 | 10/23/2026 |
| 1.4.17 | 573 | 10/6/2026 |
| 1.4.16 | 243 | 9/28/2026 |
| 1.4.15 | 253 | 9/21/2026 |
| 1.4.14 | 323 | 8/20/2026 |
| 1.4.13 | 304 | 8/20/2026 |
| 1.4.12 | 311 | 8/20/2026 |
| 1.4.11 | 278 | 8/7/2026 |
| 1.4.10 | 323 | 7/8/2026 |
| 1.4.9 | 319 | 7/8/2026 |