NuvTools.Payment
10.0.0
See the version list below for details.
dotnet add package NuvTools.Payment --version 10.0.0
NuGet\Install-Package NuvTools.Payment -Version 10.0.0
<PackageReference Include="NuvTools.Payment" Version="10.0.0" />
<PackageVersion Include="NuvTools.Payment" Version="10.0.0" />
<PackageReference Include="NuvTools.Payment" />
paket add NuvTools.Payment --version 10.0.0
#r "nuget: NuvTools.Payment, 10.0.0"
#:package NuvTools.Payment@10.0.0
#addin nuget:?package=NuvTools.Payment&version=10.0.0
#tool nuget:?package=NuvTools.Payment&version=10.0.0
NuvTools Payment Libraries
Payment abstraction library and API clients for Brazilian financial services. Part of the NuvTools Framework.
Projects
| Project | Target | Description |
|---|---|---|
| NuvTools.Payment | net8.0, net9.0, net10.0 | Core payment abstractions: the card, payee, charge and webhook contracts a card provider implements, their DTOs, and the shared HttpClient infrastructure. |
| NuvTools.Payment.BancoDoBrasil.ApiClient | net10.0 | API client for Banco do Brasil bank slip payment services. |
| NuvTools.Payment.Sicoob.ApiClient | net10.0 | API client for Sicoob bank slip services. |
| NuvTools.Payment.Omie.ApiClient | net10.0 | API client for Omie ERP: service orders, accounts receivable, and bank slip (boleto) generation. |
| NuvTools.Payment.Stripe.ApiClient | net10.0 | Stripe's implementation of the NuvTools.Payment contracts: customers and saved payment methods, Connect Express onboarding, separate charges and transfers, and webhook signature verification. |
NuvTools.Payment — the card-provider contracts
A marketplace that charges customers and pays several payees out of the same money needs four capabilities, and they are declared here so that the application layer never references a provider:
| Contract | What it is for |
|---|---|
IPaymentCustomerClient |
Who is charged, and the payment method they saved — including a provider-hosted page, so no card and no provider script reach the caller's own origin |
IPayeeAccountClient |
An account the platform can pay, and the hosted onboarding that makes it payable |
IPaymentChargeClient |
Charging a customer, and transferring to a payee — two calls, never one destination charge |
IPaymentWebhookVerifier |
The signature check, and the payload read into the fields a caller acts on |
Amounts are always in the currency's minor units; PaymentMoney converts, rounding once.
PaymentStatusType and PaymentEventType are the provider-neutral vocabularies a client maps its
own onto — four payment outcomes and four kinds of event, because those are the ones that change what
the caller does next.
The provider-shaped reading belongs in the provider's package. IPaymentWebhookVerifier answers
a PaymentEventDTO whose CustomerId, PaymentMethodId and FailureReason are already extracted:
which field of which payload holds the customer is the provider's business, and a caller that dug it
out itself would be coupled to a shape it does not control.
These contracts are for card and marketplace providers. The bank-slip clients below stay direct, for the reason given under Common Patterns.
NuvTools.Payment.Stripe.ApiClient
Stripe's implementation of those contracts, over the official Stripe.net SDK.
Features
- Customers and saved payment methods (
SetupIntent, off-session, and a hosted Checkout page) - Connect Express onboarding: account, hosted account link, and account status
- Separate charges and transfers - one charge can pay several connected accounts, which a destination charge cannot express
- Caller-supplied idempotency keys on every money-moving call
- Webhook signature verification, with a separate secret for the Connect endpoint
Configuration
{
"Stripe": {
"SecretKey": "sk_test_...",
"WebhookSecret": "whsec_...",
"ConnectWebhookSecret": "",
"RequestTimeoutSeconds": 30,
"MaxNetworkRetries": 2
}
}
Every value but the timeouts is a secret, including both webhook secrets: they are what make an incoming webhook trustworthy.
Registration
services.AddStripeApiClient(configuration);
Injects Stripe behind IPaymentCustomerClient, IPayeeAccountClient, IPaymentChargeClient and
IPaymentWebhookVerifier — so this call, in the composition root, is the only place the application
names Stripe. Each method returns IResult<T>, so a declined card is a result to read rather than an
exception to catch.
NuvTools.Payment.BancoDoBrasil.ApiClient
Typed HTTP client for the Banco do Brasil Payments API with OAuth2 authentication.
Features
- OAuth2 token generation (
client_credentials) - Batch bank slip payment creation
- Payment query by ID
Configuration
{
"BancoDoBrasil": {
"AuthUrl": "https://...",
"BaseUrl": "https://...",
"ClientId": "",
"ClientSecret": "",
"ApiKey": ""
}
}
Registration
services.AddBancoDoBrasilApiClient(configuration);
NuvTools.Payment.Sicoob.ApiClient
Typed HTTP client for the Sicoob Banking API (bank slips).
Features
- Bank slip query by number or period
- Bank slip creation
- Second copy generation
- Cancellation, due date extension, and amount change
Configuration
{
"Sicoob": {
"BaseUrl": "https://...",
"ClientId": "",
"Token": ""
}
}
Registration
services.AddSicoobApiClient(configuration);
NuvTools.Payment.Omie.ApiClient
Typed HTTP client for the Omie ERP API (service orders, accounts receivable, and bank slip issuance).
Features
- Client lookup
- Service registration query
- Service order (OS) creation
- Accounts receivable entry creation
- Bank slip (boleto) generation and retrieval
Configuration
{
"Omie": {
"AppKey": "",
"AppSecret": "",
"BaseUrlClient": "https://...",
"BaseUrlService": "https://...",
"BaseUrlOrderService": "https://...",
"BaseUrlOrderBilling": "https://..."
}
}
Registration
services.AddOmieApiClient(configuration);
Common Patterns
All API clients share the same infrastructure, provided by NuvTools.Payment:
- Result pattern: every method returns
IResult<T>fromNuvTools.Common.ResultWrapper(Succeeded,Data,Message,Messages,ResultType). - Standard resilience: registered via
services.AddPaymentResilientHttpClient<TInterface, TImpl>(name)— applies retry, circuit breaker, and timeout policy across all providers. - Configuration binding from
IConfigurationsections using the Options pattern.
The bank-slip and ERP clients expose their own contracts (ISicoobBankSlipApiClient, IBbBankSlipPaymentApiClient, IOmieApiClient) and return provider-specific DTOs, deliberately: Brazilian banking integrations are intrinsically provider-shaped, and a neutral layer over them would have to invent a domain none of them share. The card and marketplace side is different — the four capabilities are the same everywhere — so it is declared in NuvTools.Payment and implemented by the provider's package.
Note (Omie):
OmieApiClientis registered as a singleton and uses an internal staticHttpClient. It intentionally bypassesHttpClientFactoryand the standard resilience pipeline — Omie's gateway misbehaves with HTTP/2 and Polly retry. Do not change this without re-validating against the Omie sandbox.
Build
dotnet build NuvTools.Payment.slnx
| Product | Versions 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 is compatible. 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 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
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Http.Resilience (>= 10.10.0)
- NuvTools.Common (>= 10.0.10)
-
net8.0
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Http.Resilience (>= 10.10.0)
- NuvTools.Common (>= 10.0.10)
-
net9.0
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Http.Resilience (>= 10.10.0)
- NuvTools.Common (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NuvTools.Payment:
| Package | Downloads |
|---|---|
|
NuvTools.Payment.Stripe.ApiClient
Typed client for Stripe, covering customers and saved payment methods, Connect onboarding (hosted, embedded, or the application's own form through Stripe.js tokens), separate charges and transfers, and webhook signature verification. Wraps the official Stripe.net SDK and returns NuvTools.Common ResultWrapper results. |
GitHub repositories
This package is not used by any popular GitHub repositories.