Giter VIP home page Giter VIP logo

pix-api's Introduction

Unofficial.BtgPactual.Merchant.Sdk

A BTG Pactual library for merchants customers.

This aims to be an unofficial library version written in C# of the official BTG Pactual API.

https://developer.btgpactual.com/dochub

Nuget Nuget

Library Tests

Notes

Version 2.1.0:

  • Add method unlink location from collection
  • Add methods for get qrcode image (base64 and svg)
  • Add method for abstract location create on create collection
  • Performance improvements
  • Retries on dependents methods

Version 2.0.0:

  • Add payment management
  • Add reversal management
  • Add errors on response envelope
  • Add request timeout in seconds initializer
  • Improve performance
  • Some fixes

Version 1.0.0:

  • Immediate Collection management
  • Location management

Installation

Use the package manager to install.

Install-Package Unofficial.BtgPactual.Merchant.Sdk -Version 2.1.0

Usage

var services = new ServiceCollection();
services.AddSingleton(HttpClient)
        .AddSingleton(p => new Models.Requests.Authorization() 
        { 
            client_id = "<your client_id>", 
            client_secret = "<your client_secret>",
            is_production = false,
            request_timeout_in_seconds = 120
        })
        .AddTransient<IImmediateCollection, Services.Repositories.ImmediateCollection>()
        .AddTransient<IPayment, Services.Repositories.Payment>()
        .AddTransient<ILocation, Services.Repositories.Location>();

var serviceProvider = services.BuildServiceProvider();
public class Payment
{
        private readonly IPayment _payment;

        public Payment(IPayment payment)
        {
                _payment = payment;
        }

        public async Task<Models.Responses.Bacen.ListPayment> ListPayment()
        {
                Models.Responses.Bacen.Envelope<Models.Responses.Bacen.ListPayment> payments = await _payment.ListAsync(new Models.Requests.Bacen.ListPayment()
                {
                        inicio = "2022-04-24T00:00:00Z",
                        fim = "2022-06-25T20:00:00Z"
                });

                return payments?.Body;
        }
}

Issues

For major changes, please open an issue to discuss your point or send e-mail to [email protected]

License

MIT

pix-api's People

Contributors

btg-unofficial-merchant-sdk avatar

Watchers

 avatar

pix-api's Issues

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.