Synetec.Payment.Gateway 3.0.1

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

Synetec.Payment.Gateway

A .NET 8 library for integrating Stripe payment processing into your applications, with support for both hosted and embedded checkout experiences. Optimized for Blazor and ASP.NET Core projects.


✨ Features

  • Stripe Hosted Checkout (redirect-based)
  • Stripe Embedded Checkout (Stripe Elements)
  • Product and price retrieval from Stripe Portal
  • Secure, validated Stripe webhook endpoint

📦 Installation

Add the NuGet package to your project:

dotnet add package Synetec.Payment.Gateway

🚀 Usage

1. Register Endpoints

In your Program.cs (Blazor or ASP.NET Core):

// Register the Payment Gateway context and services
var builder = WebApplication.CreateBuilder(args);
ConfigurationManager configuration = builder.Configuration;
builder.Services.AddPaymentGateway(configuration);

// Register Synetec.Payment.Gateway endpoints depending on your needs
var app = builder.Build();
app.AddStripeProductEndpoints();
app.AddStripeHostedCheckoutEndpoints();
app.AddStripeEmbeddedCheckoutEndpoints();
app.AddStripeWebhook();

app.Run();

2. Configuration

Add your Stripe settings to appsettings.json:

{
  "PaymentGateway": {
    "ConnectionString": "REDACTED",
    "RedirectBaseUrl": "REDACTED",
    "SuccessPath": "REDACTED",
    "CancelPath": "REDACTED",
    "Stripe": {
      "SecretKey": "REDACTED",
      "PublishableKey": "REDACTED",
      "WebhookSecret": "REDACTED"
    }
  }
}

3. Endpoints

Get Products
  • GET /api/v{version}/stripe/product
  • Returns a list of Stripe products and prices.
Create Hosted Checkout Session
  • POST /api/v{version}/stripe/checkout
  • Request body: CheckoutRequest
  • Returns a Stripe Checkout session URL.
Create Embedded Payment Intent
  • POST /api/v{version}/stripe/initialize-payment
  • Request body: PaymentIntentRequest
  • Returns a Stripe PaymentIntent client secret.
Stripe Webhook
  • POST /api/v{version}/stripe/webhook
  • Receives Stripe webhook events for payment updates and notifications.

4. Example: Creating a Checkout Session

POST /api/v1/stripe/checkout
Content-Type: application/json

{
  "idempotencyKey": "b1a7c8e2-1234-4c9a-8e2b-1234567890ab",
  "items": [
    { "priceId": "price_1N...", "quantity": 1 }
  ],
  "paymentMethodTypes": ["card"],
  "consumerReference": "user@example.com",
  "additionalMetadata": { "orderId": "12345" }
}

5. Webhook Security

Set your Stripe webhook secret in configuration. The webhook endpoint validates incoming requests using the Stripe-Signature header.


🧩 Getting Started Example

// Example: Minimal API integration
var builder = WebApplication.CreateBuilder(args);
builder.Services.Configure<StripeOptions>(builder.Configuration.GetSection("Stripe"));

var app = builder.Build();
app.AddStripeHostedCheckoutEndpoints();
app.Run();

🛠️ Requirements

  • .NET 8.0 or later
  • Stripe account and API keys

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Run tests with dotnet test
  4. Submit a pull request

📜 License

© 2025 Synetec Limited. All rights reserved.

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.

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.1 818 11/17/2025
3.0.0 315 11/10/2025
2.0.0 228 11/6/2025
1.1.0 226 11/6/2025
1.0.0 302 10/31/2025