TailoredApps.Shared.Payments.Provider.Stripe
2.1.2
See the version list below for details.
dotnet add package TailoredApps.Shared.Payments.Provider.Stripe --version 2.1.2
NuGet\Install-Package TailoredApps.Shared.Payments.Provider.Stripe -Version 2.1.2
<PackageReference Include="TailoredApps.Shared.Payments.Provider.Stripe" Version="2.1.2" />
<PackageVersion Include="TailoredApps.Shared.Payments.Provider.Stripe" Version="2.1.2" />
<PackageReference Include="TailoredApps.Shared.Payments.Provider.Stripe" />
paket add TailoredApps.Shared.Payments.Provider.Stripe --version 2.1.2
#r "nuget: TailoredApps.Shared.Payments.Provider.Stripe, 2.1.2"
#:package TailoredApps.Shared.Payments.Provider.Stripe@2.1.2
#addin nuget:?package=TailoredApps.Shared.Payments.Provider.Stripe&version=2.1.2
#tool nuget:?package=TailoredApps.Shared.Payments.Provider.Stripe&version=2.1.2
TailoredApps.Shared.Payments.Provider.Stripe
Stripe is a global payment operator. This package plugs Stripe Checkout into TailoredApps.Shared.Payments through the
Stripe.net SDK: it creates a Checkout Session and returns the address of Stripe's hosted payment page, reads the status of a
session, and verifies and handles Stripe webhooks.
Installation
dotnet add package TailoredApps.Shared.Payments.Provider.Stripe # brings TailoredApps.Shared.Payments with it
Registration
using TailoredApps.Shared.Payments;
using TailoredApps.Shared.Payments.Provider.Stripe;
builder.Services.AddPayments().RegisterStripeProvider();
The call registers the provider with its dependencies and adds it to IPaymentService. Several providers chain:
.AddPayments().RegisterStripeProvider().RegisterTpayProvider().
Configuration
Options are bound from the Payments:Providers:Stripe section (StripeServiceOptions).
{
"Payments": {
"Providers": {
"Stripe": {
"SecretKey": "<stripe-secret-key>",
"WebhookSecret": "<webhook-signing-secret>",
"SuccessUrl": "https://shop.example/payment/success?session={CHECKOUT_SESSION_ID}",
"CancelUrl": "https://shop.example/payment/cancelled"
}
}
}
}
| Key | Required | Meaning | Default |
|---|---|---|---|
SecretKey |
yes | Stripe secret key; passed with every SDK call | - |
WebhookSecret |
yes | Signing secret of the webhook endpoint | - |
SuccessUrl |
no | Return address after a payment; Stripe replaces {CHECKOUT_SESSION_ID} with the session id |
empty |
CancelUrl |
no | Return address after the payer cancels | empty |
A required key that is missing stops the host at startup with OptionsValidationException. The other keys are not validated.
The payment methods of a session can be set with a separate list at Stripe:AllowedPaymentMethods (top level, not under
Payments:Providers). Without it the provider uses card and blik for PLN, card and sepa_debit for EUR, card otherwise.
Usage
// payments is an injected IPaymentService
var response = await payments.RegisterPayment(new PaymentRequest("Stripe", 49.99m, "PLN")
{
Title = "Order 7", // sent as the product name of the session's line item
Email = "buyer@example.com",
AdditionalData = "order-7", // stored in the session metadata as additional_data
}, cancellationToken);
return Redirect(response.RedirectUrl);
response.PaymentUniqueId is the Checkout Session id; pass it to GetStatus("Stripe", sessionId).
Webhooks
Stripe posts a JSON event and signs the raw body in the Stripe-Signature header. The provider verifies it with Stripe.net
(EventUtility.ConstructEvent) and WebhookSecret; an event whose API version differs from the SDK's is still accepted.
using var reader = new StreamReader(Request.Body, Encoding.UTF8);
var result = await payments.HandleWebhookAsync("Stripe", new PaymentWebhookRequest
{
Body = await reader.ReadToEndAsync(cancellationToken), // raw body, not [FromBody]
Headers = Request.Headers.ToDictionary(h => h.Key, h => h.Value),
}, cancellationToken);
return result is PaymentWebhookRejected ? BadRequest() : Ok();
| Event | Result |
|---|---|
checkout.session.completed with payment_status paid, checkout.session.async_payment_succeeded |
PaymentWebhookProcessed, Finished, session id |
checkout.session.async_payment_failed, checkout.session.expired |
PaymentWebhookProcessed, Rejected, session id |
payment_intent.succeeded / payment_intent.payment_failed |
PaymentWebhookProcessed, Finished / Rejected, payment intent id |
checkout.session.completed not yet paid, any other event, an event without an id |
PaymentWebhookIgnored |
signature missing or wrong, or WebhookSecret not configured |
PaymentWebhookRejected (PaymentWebhookRejection.InvalidSignature) |
Good to know
- Failures of the Stripe API surface as
StripeExceptionfromRegisterPaymentandGetStatus, not asPaymentGatewayException.RegisterPaymentnever returnsRejected; treat the exception as an unknown state. payment_intent.*events carry the payment intent id inPayment.PaymentUniqueId, not the session idRegisterPaymentreturned. To match webhooks with stored session ids, act on thecheckout.session.*events.GetStatusmaps acompletesession that ispaidtoFinished, acompletesession that is not paid toProcessing,expiredtoRejected, anything else toCreated.- The amount is sent in the minor unit (amount x 100), except for Stripe's zero-decimal currencies such as JPY.
GetChannelsreturns a fixed list per currency (PLN:card,blik,p24; EUR:card,sepa_debit; other:card).PaymentRequest.PaymentChanneldoes not select a method; it is stored in the session metadata aspayment_channel.
Documentation
| 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.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Stripe.net (>= 47.4.0)
- TailoredApps.Shared.Payments (>= 2.1.2)
-
net11.0
- Microsoft.Extensions.Configuration.Binder (>= 11.0.0)
- Stripe.net (>= 47.4.0)
- TailoredApps.Shared.Payments (>= 2.1.2)
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 |
|---|---|---|
| 3.0.0-preview.3 | 41 | 12/2/2026 |
| 3.0.0-preview.2 | 56 | 11/12/2026 |
| 3.0.0-preview.1 | 66 | 11/12/2026 |
| 2.1.2 | 42 | 12/2/2026 |
| 2.1.1 | 57 | 12/2/2026 |
| 2.1.0 | 112 | 11/12/2026 |
| 2.0.1 | 101 | 11/12/2026 |
| 2.0.0 | 128 | 11/12/2026 |
| 1.6.0 | 103 | 11/12/2026 |
| 1.4.19 | 143 | 10/26/2026 |
| 1.4.18 | 102 | 10/23/2026 |
| 1.4.17 | 111 | 10/6/2026 |
| 1.4.16 | 110 | 9/28/2026 |
| 1.4.15 | 108 | 9/21/2026 |
| 1.4.14 | 122 | 8/20/2026 |
| 1.4.13 | 132 | 8/20/2026 |
| 1.4.12 | 119 | 8/20/2026 |
| 1.4.11 | 127 | 8/7/2026 |
| 1.4.10 | 143 | 7/8/2026 |
| 1.4.9 | 133 | 7/8/2026 |