Skip to content

Latest commit

 

History

History
95 lines (83 loc) · 4.24 KB

README.md

File metadata and controls

95 lines (83 loc) · 4.24 KB

Ebanx.net

It's a .net library for Ebanx Payments implementation.

Start

Install in your project

Nuget Nuget

PM > Install-Package Ebanx.net

Support

Operation Working Api
Token Operation EbanxTokenOperationApi.Create()
Direct Operation EbanxDirectOperationApi.Create()
Cancel Operation EbanxCancelOperationApi.Create()
Capture Operation EbanxCaptureOperationApi.Create()
Query Operation EbanxQueryOperationApi.Create()
RefundOrCancel Operation EbanxRefundOrCancelOperationApi.Create()
Refund Operation EbanxRefundOperationApi.Create()
Request Operation EbanxRequestOperationApi.Create()
SetCvv Operation EbanxSetCvvOperationApi.Create()

Configure

new Config(new EbanxKeys
{
        PaymentKeys = new PaymentKey
        {
            StagIntegrationKey = "your key",
            StagPublicIntegrationKey = "your key",
            ProdIntegrationKey = "your key (not required to tests)",
            ProdPublicIntegrationKey = "your key (not required to run tests)"
        }
});

How to use

Create a Direct Operation sample (all samples here)

var token = new TokenResponse();

using (var tokenApi = new EbanxTokenOperationApi())
{
        var request = new TokenRequest
        {
            Country = "BR",
            CreditCard = CreaditCardRequestExtention.GetACard(),
            PaymentTypeCode = "mastercard",
        };

        token = await tokenApi.Create(request);
}

var response = new DirectResponse();

using (var directApi = new EbanxDirectOperationApi())
{
        var request = new DirectRequest
        {
            Operation = "request",
            Mode = "full",
            Payment = new PaymentRequest
            {
                Name = "Customer Name",
                Email = "customer@mail.com",
                AmountTotal = 500,
                Zipcode = "000000",
                Address = "Rua X",
                StreetNumber = "5",
                City = "City",
                State = "SP",
                Country = "BR",
                PhoneNumber = "999999999",
                CreditCard = new CreditCardRequest
                {
                    Token = token.Token
                },
                CurrencyCode = "BRL",
                MerchantPaymentCode = Guid.NewGuid().ToString(),
                Document = "29479146002",
                Instalments = 12
            }
        };

        response = await directApi.Create(request);
}

Additional

  • For to run tests in this project, create your respective environment variables with name "EbanxStagIntegrationKey" and "EbanxStagPublicIntegrationKey". It's set here TestBase Class

forthebadge