Dloizides.Payments.AspNetCore 1.0.2

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

Payments.AspNetCore

Reusable one-time payment processing for multi-tenant ASP.NET Core SaaS. Pairs Stripe Checkout + a Revolut-link adapter (for the existing manual flow) + a webhook handler. Per-tenant provider selection.

Sibling to Subscriptions.AspNetCore — this is for attendee-pays-tenant; that one is for tenant-pays-platform.

Concepts

  • PaymentProviderKind — None / RevolutLink / StripeCheckout.
  • IPaymentProvider — one implementation per kind; resolves the attendee's payment session.
  • IPaymentProviderResolver — looks up the right provider for a tenant's configured kind.
  • PaymentRequest — tenant id + line item + amount + URLs.
  • PaymentSessionResult — provider's URL the attendee is redirected to + the provider's session id.
  • StripePaymentWebhookHandler — HMAC-verified Stripe webhook, fires PaymentEventReceived for the consumer's payment-store layer.

Wiring

Program.cs:

builder.Services.AddPayments(builder.Configuration);

app.MapPaymentsWebhook(); // POST /api/webhooks/stripe-payments

// Consumer subscribes once at startup:
var handler = app.Services.GetRequiredService<StripePaymentWebhookHandler>();
handler.PaymentEventReceived += async (evt, ct) =>
{
    // Update your Payment row + downstream Attendee.Status etc.
};

appsettings.json:

{
  "Payments": {
    "Stripe": {
      "SecretKey": "sk_test_...",
      "WebhookSecret": "whsec_..."
    }
  }
}

Per-tenant provider choice

The package does NOT pick the provider — each tenant stores its choice in its own payment-config row, then the consumer resolves at session-creation time:

var kind = tenant.PaymentConfig.ProviderKind;
var provider = resolver.Resolve(kind)
    ?? throw new InvalidOperationException($"No provider for {kind}.");
var session = await provider.CreateSessionAsync(new PaymentRequest(
    TenantId: tenant.Id,
    PaymentReference: attendeeExternalId.ToString(),
    Description: $"{eventName} — {passLabel}",
    AmountEur: passPrice,
    CustomerEmail: attendeeEmail,
    SuccessUrl: $"https://{tenantSlug}.kefi.dloizides.com/ticket/{token}",
    CancelUrl: $"https://{tenantSlug}.kefi.dloizides.com/"));

The RevolutLink provider is a thin adapter — no API call, no webhook, no automatic confirmation. The tenant's Revolut URL is passed via the request's SuccessUrl; the provider returns it verbatim as the hosted URL. The organizer manually matches the Revolut transfer reference against the request's PaymentReference (typically the attendee's external id) to confirm payment.

Future providers

IPaymentProvider is open — drop in RevolutBusinessApi, PayPalCheckout, Klarna, etc. by implementing the interface + registering in DI. The resolver picks them up by kind.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 349 5/24/2026
1.0.1 122 5/23/2026