Niobium.Platform.Finance
4.2.66
dotnet add package Niobium.Platform.Finance --version 4.2.66
NuGet\Install-Package Niobium.Platform.Finance -Version 4.2.66
<PackageReference Include="Niobium.Platform.Finance" Version="4.2.66" />
<PackageVersion Include="Niobium.Platform.Finance" Version="4.2.66" />
<PackageReference Include="Niobium.Platform.Finance" />
paket add Niobium.Platform.Finance --version 4.2.66
#r "nuget: Niobium.Platform.Finance, 4.2.66"
#:package Niobium.Platform.Finance@4.2.66
#addin nuget:?package=Niobium.Platform.Finance&version=4.2.66
#tool nuget:?package=Niobium.Platform.Finance&version=4.2.66
Niobium.Platform.Finance
Niobium.Platform.Finance provides a robust, extensible infrastructure for financial operations, payment processing, and accounting in .NET applications. It offers abstractions, middleware, and helpers for integrating payment services, managing account balances, and handling transactions in a secure and auditable way.
What is this project about?
- Implements the
AccountableDomain<T>base class for account and transaction management. - Provides interfaces and implementations for payment services (
IPaymentService,IPaymentProcessor), accounting auditors, and deposit recorders. - Supplies middleware for payment request and webhook handling in both ASP.NET Core and Azure Functions.
- Enables extensible integration with multiple payment providers (e.g., Stripe, WeChat, Alipay) via the
IPaymentProcessorinterface. - Used by consumer projects to standardize and accelerate the implementation of financial and payment features.
Getting Started
1. Install the NuGet Package
dotnet add package Niobium.Platform.Finance
2. Register Finance Services
In your application's DI setup, use the provided extension method:
using Niobium.Platform.Finance;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddFinance();
Or, for Azure Functions:
using Niobium.Platform.Finance;
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults(worker =>
{
worker.UsePlatformPayment<MyDepositHandler, MyAccountableDomain, MyAccountableEntity>();
})
.Build();
3. Configure Payment Options
Add your payment configuration (e.g., API keys) to your appsettings.json or configuration provider:
{
"PaymentServiceOptions": {
"PaymentWebHookEndpoint": "payments/webhook",
"PaymentRequestEndpoint": "payments/init",
"SecretAPIKey": "<your-api-key>",
"SecretHashKey": "<your-hash-key>"
}
}
4. Use Payment Service and Middleware
Example: Initiating a Payment Request
var paymentService = serviceProvider.GetRequiredService<IPaymentService>();
var chargeRequest = new ChargeRequest
{
TargetKind = ChargeTargetKind.User,
Target = "user-123",
Channel = PaymentChannels.Cards,
Operation = PaymentOperationKind.Charge,
Amount = 1000,
Currency = Currency.USD,
IP = "127.0.0.1"
};
var result = await paymentService.ChargeAsync(chargeRequest);
Example: Adding Middleware in ASP.NET Core
app.UsePlatformPayment<MyDepositHandler, MyAccountableDomain, MyAccountableEntity>();
This will automatically add the payment request and webhook middleware to your pipeline.
5. Implementing a Custom Payment Processor
To support a new payment provider, implement the IPaymentProcessor interface and register it with DI.
public class MyPaymentProcessor : IPaymentProcessor
{
public Task<OperationResult<ChargeResult>> RetrieveChargeAsync(string transaction, PaymentChannels paymentChannel) { ... }
public Task<OperationResult<ChargeResponse>> ChargeAsync(ChargeRequest request) { ... }
public Task<OperationResult<ChargeResult>> ReportAsync(string notificationJSON) { ... }
}
How Niobium.Platform.Finance is Consumed
Consumer projects (such as Niobium.Invoicing) use Niobium.Platform.Finance to:
- Register and use shared payment and accounting infrastructure.
- Standardize transaction and account management via
AccountableDomain<T>. - Integrate payment request and webhook endpoints with minimal code.
- Extend payment support by implementing custom
IPaymentProcessors.
Contributing
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch
- Make your changes with clear commit messages
- Submit a pull request
Please ensure your code follows the existing style and includes appropriate tests and documentation.
License
This project is licensed under the MIT License. See the LICENSE file for details.
| 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. |
-
net10.0
- Niobium.Finance (>= 4.2.66)
- Niobium.Platform (>= 4.2.66)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Niobium.Platform.Finance:
| Package | Downloads |
|---|---|
|
Niobium.Platform.Finance.Stripe
Stripe payment integration for Niobium platform finance. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.2.66 | 95 | 9/4/2026 |
| 4.0.60 | 103 | 8/30/2026 |
| 4.0.53 | 116 | 8/27/2026 |
| 4.0.50 | 102 | 8/14/2026 |
| 4.0.48 | 123 | 8/9/2026 |
| 4.0.43 | 208 | 7/18/2026 |
| 4.0.42 | 109 | 7/18/2026 |
| 4.0.41 | 120 | 7/18/2026 |
| 4.0.37 | 113 | 7/17/2026 |
| 4.0.35 | 113 | 7/17/2026 |
| 4.0.34 | 115 | 7/17/2026 |
| 4.0.33 | 119 | 7/16/2026 |
| 4.0.32 | 128 | 7/2/2026 |
| 3.4.30 | 226 | 12/22/2025 |
| 3.4.29 | 336 | 11/11/2025 |
| 3.4.28 | 217 | 11/2/2025 |
| 3.4.27 | 171 | 11/1/2025 |
| 3.4.26 | 168 | 11/1/2025 |
| 3.4.25 | 169 | 11/1/2025 |
| 3.4.24 | 203 | 10/31/2025 |