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 and 3.5
# encoding: utf-8
from gerencianet import Gerencianet
credentials = {
'client_id': 'client_id',
'client_secret': 'client_secret',
'sandbox': True
}
gn = Gerencianet(credentials)
body = {
'items': [{
'name': "Product 1",
'value': 1000,
'amount': 2
}],
'shippings': [{
'name': "Default Shipping Cost",
'value': 100
}]
}
print gn.create_charge(body=body)
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.