Giter Site home page Giter Site logo

gerencianet / gn-api-sdk-python Goto Github PK

View Code? Open in Web Editor NEW
38.0 12.0 17.0 96 KB

SDK em Python integrada a API Gerencianet. Esta SDK está preparada para integração à API Pix e API Boletos da Gerencianet, que lhe permite realizar o gerenciamento de cobranças Pix com QR Code e Pix Copia e Cola, boleto/Bolix, carnê, cartão de crédito e muito mais.

Home Page: https://dev.gerencianet.com.br/docs/instalacao-sdk-python

License: MIT License

Python 100.00%
python sdk marketplace subscription qrcode card split boleto billet assinatura

gn-api-sdk-python's Introduction

gn-api-sdk-python

A python library for integration of your backend with the payment services provided by Gerencianet.

Build Status Coverage Status Code Climate

Installation

Install with Pip:

$ pip install gerencianet

Tested with

python 2.7, 3.3, 3.4, 3.5 and 3.9

Atenção

A Gerencianet está disponibilizando um novo endpoint para requisitar o envio de Pix, este endpoint passará a ter um idEnvio como parâmetro na requisição, além disso o método passa a ser o PUT ao invés do POST para fins de idempotência. 

Basic usage

# encoding: utf-8

from gerencianet import Gerencianet

credentials = {
    'client_id': 'client_id',
    'client_secret': 'client_secret',
    'sandbox': True,
    'certificate': 'insira-o-caminho-completo-do-certificado'
}

gn = Gerencianet(credentials)

body = {
    'calendario': {
        'expiracao': 3600
    },
    'devedor': {
        'cpf': '12345678909',
        'nome': 'Francisco da Silva'
    },
    'valor': {
        'original': '123.45'
    },
    'chave': '71cdf9ba-c695-4e3c-b010-abb521a3f1be',
    'solicitacaoPagador': 'Cobrança dos serviços prestados.'
}

response =  gn.pix_create_immediate_charge(body=body)
print(response)

Examples

You can run the examples inside examples with $ python examples/example.py:

$ python examples/create_charge.py

Just remember to set the correct credentials inside examples/credentials.py before running.

Tests

To run the tests, just run pytest:

$ py.test

Additional documentation

The full documentation with all available endpoints is in https://dev.gerencianet.com.br/.

Changelog

CHANGELOG

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gerencianet/gn-api-sdk-python. This project is intended to be a safe, welcoming space for collaboration.

License

The library is available as open source under the terms of the MIT License.

gn-api-sdk-python's People

Contributors

ceciliadeveza avatar dannielhugo avatar dmalberto avatar filipemata avatar giovani-felipe avatar guilhermecotagn avatar matheus-rodriguesgn avatar pallomabritogn avatar sadycoimbraefi avatar thiagogresende avatar whintergoncalves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gn-api-sdk-python's Issues

Testando o QRCode

A API (sandbox) devolveu o seguinte QRCode:

{"qrcode":"00020101021226900014BR.GOV.BCB.PIX2568qrcodes-pix-h.gerencianet.com.br/v2/1945cd30c786425ab6121bba9f49d4405204000053039865802BR5914GERENCIANET SA6010OURO PRETO62070503***6304E615","imagemQrcode": "data:image/png;base64,...etc" }

Embora eu consiga renderizar esse base64, o link não funciona. Tem alguma forma de testar?

Qrcode Pix inválido

Ao gerar o Qrcode do pix em ambiente de homologação, quando tento ler o qrcode para testar é retornado um erro. Ao testar no Nubank o mesmo informa que ocorreu um erro de conexão, já no banco inter a mensagem de erro é:

Não foi possível processar o QrCode. Por favor, verifique com quem o gerou. Você consegue pagar de outra forma inserindo a chave Pix.

Erro ao executar em ambiente de produção

Estou tentando executar o projeto em ambiente de produção, já tendo configurado as chaves do ambiente de produção, baixa o certificado p12, convertido para o certificado .pem e toda vez que executo a função para gerar o Pix recebo como erro a mensagem:

Status:403 Could not authenticate. \nPlease make sure you are using correct credentials and if you are using then in the correct environment.

Bump requests/six versions

Please bump requests/six versions. These versions are 5 years old and break several lib installs that require some newest version.

I suggest to change requeriments.txt constraints to:

requests>=2.9.1,<3.0.0
six>=1.9.0,<2.0.0

Regards

Erro ao consultar detalhes do documento

Estou recebendo o erro abaixo ao usar o método Gerencianet.detail_charge em um ambiente de produção, as credenciais estão corretas, pois os documentos gerados pelo meu sistem eu consigo pesquisar, mas quando pego os ids dos documentos migrados/legados, recebo esse erro.

{'code': 3500010, 'error': 'property_does_not_exists', 'error_description': {'property': 'id', 'message': 'A propriedade [id] informada não existe.'}}

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.