SDK Oficial Produção v1.3.0
EDPay .NET / C# SDK
Biblioteca oficial para .NET 8+ e ASP.NET Core com suporte nativo a IHttpClientFactory, Dependency Injection e tipagem moderna em C#.
edutecka/edpay-dot-net-sdk
Produção v1.3.0
Repositório oficial no GitHub com código aberto sob licença MIT.
Instalação via NuGet CLI
Adicione o pacote NuGet ao seu projeto .NET:
Terminal
dotnet add package EDPay.SDKConfiguração no ASP.NET Core
Registe o cliente no contentor de injeção de dependência:
Program.cs
using EDPay;
using Microsoft.Extensions.DependencyInjection;
// Injeção de dependência no Program.cs do ASP.NET Core
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<EDPayClient>(sp => new EDPayClient(
publicKey: builder.Configuration["EDPay:PublicKey"]!,
privateKey: builder.Configuration["EDPay:PrivateKey"]!
));Criar Pagamento
Exemplo de criação assíncrona de pagamento multicanal:
PaymentController.cs
// Criar pagamento multi-gateway
var payment = await edPayClient.Payments.CreateAsync(new CreatePaymentRequest
{
Amount = 1500, // 1.500,00 MZN
Currency = "MZN",
Reference = "FAT-2026-005",
Description = "Subscrição Cloud Hosting",
Customer = new CustomerInfo
{
Name = "Alberto Chissano",
Email = "[email protected]",
Phone = "+25884xxxxxxx"
}
}, idempotencyKey: "req_dotnet_98416");
Console.WriteLine($"ID: {payment.Data.Id}");
Console.WriteLine($"Status: {payment.Data.Status}");