eQuantic.Payment
1.1.0
See the version list below for details.
dotnet add package eQuantic.Payment --version 1.1.0
NuGet\Install-Package eQuantic.Payment -Version 1.1.0
<PackageReference Include="eQuantic.Payment" Version="1.1.0" />
<PackageVersion Include="eQuantic.Payment" Version="1.1.0" />
<PackageReference Include="eQuantic.Payment" />
paket add eQuantic.Payment --version 1.1.0
#r "nuget: eQuantic.Payment, 1.1.0"
#:package eQuantic.Payment@1.1.0
#addin nuget:?package=eQuantic.Payment&version=1.1.0
#tool nuget:?package=eQuantic.Payment&version=1.1.0
eQuantic.Payment
One contract for every payment gateway: the same request, the same response, and the provider and API version that answered, always. The gateways live in their own packages and plug into this one.
Install
dotnet add package eQuantic.Payment
dotnet add package eQuantic.Payment.Stripe # or any other provider package
Register
using eQuantic.Payment.DependencyInjection;
using eQuantic.Payment.Stripe;
services.AddPayments(payments => payments
.AddStripe(o => o.ApiKey = configuration["Stripe:ApiKey"]!, asDefault: true));
Charge
using eQuantic.Payment.Abstractions;
using eQuantic.Payment.Models;
using eQuantic.Payment.Models.Requests;
var provider = factory.GetDefault(); // IPaymentProviderFactory, from DI
var response = await provider.Charges.CreateAsync(new CreateChargeRequest
{
Amount = Money.Brl(49.90m),
Method = PaymentMethodType.Pix,
});
if (response.Success)
{
Console.WriteLine($"{response.Data!.Id} via {response.Provider.Key}");
}
What is in it
- Contracts:
IPaymentProviderwith itsCharges,Refunds,CustomersandNotificationsoperations, andIPaymentProviderFactory, which resolves a provider by name, by name and version, or the default.Notifications.Verifychecks that a webhook came from the gateway before parsing it; a provider that does not verify its notifications yet answers with a failure. - The unified model:
CreateChargeRequest,CustomerRequest,RefundRequest;Charge,Customer,Refund, with the Pix, boleto and card details each method returns;Moneyin centavos. PaymentResponse<T>: the result or aPaymentError, the provider and version that answered, and the gateway's raw body for auditing.- The registration:
AddPayments(...)and thePaymentBuilderthe provider packages extend.
Providers
| Package | Gateway |
|---|---|
eQuantic.Payment.Stripe |
Stripe |
eQuantic.Payment.Pagarme |
Pagar.me |
eQuantic.Payment.MercadoPago |
Mercado Pago |
eQuantic.Payment.PagSeguro |
PagSeguro / PagBank |
eQuantic.Payment.Cielo |
Cielo |
eQuantic.Payment.Adyen |
Adyen |
eQuantic.Payment.Asaas |
Asaas |
eQuantic.Payment.Efi |
Efí (Gerencianet) |
Source, design notes and the other packages: https://github.com/eQuantic/core-payment.
| 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
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on eQuantic.Payment:
| Package | Downloads |
|---|---|
|
eQuantic.Payment.Stripe
Stripe API client for eQuantic.Payment. Versioned client (REST v1, pinned Stripe-Version) plus the unified IPaymentProvider adapter. |
|
|
eQuantic.Payment.Pagarme
Pagar.me API client for eQuantic.Payment. Versioned clients (Core API v4 and v5) plus the unified IPaymentProvider adapter. |
|
|
eQuantic.Payment.PagSeguro
PagSeguro / PagBank API client for eQuantic.Payment. Modern Orders/Charges API (versioned) plus the unified IPaymentProvider adapter. |
|
|
eQuantic.Payment.Asaas
Asaas API client for eQuantic.Payment. Versioned client (API v3) plus the unified IPaymentProvider adapter with real customer support (PIX, boleto, credit card). |
|
|
eQuantic.Payment.Cielo
Cielo E-commerce API client for eQuantic.Payment. Versioned client (API 3.0) plus the unified IPaymentProvider adapter. |
GitHub repositories
This package is not used by any popular GitHub repositories.