Giter VIP home page Giter VIP logo

ebanx.net's Introduction

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 = "[email protected]",
                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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.