A python library for integration of your backend with the payment services provided by Gerencianet.
Install with Pip:
$ pip install gerencianet
python 2.7, 3.3, 3.4, 3.5 and 3.9
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.
# 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)
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.
To run the tests, just run pytest:
$ py.test
The full documentation with all available endpoints is in https://dev.gerencianet.com.br/.
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.
The library is available as open source under the terms of the MIT License.