Skip to content

Commit

Permalink
Merge pull request #10 from pallomabritoGN/master
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
matheus-rodriguesGN authored Jul 13, 2022
2 parents 09664fd + 7095d20 commit c0e6adc
Show file tree
Hide file tree
Showing 105 changed files with 1,265 additions and 711 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python:
- "3.5"
- "3.6"
- "3.7"
- "3.9"
- "pypy"
install:
- pip install -r requirements-dev.txt
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 3.0.0
- Added: include new endpoints of "API Open Finance"
- Added: include new endpoints of "API Pagamentos"
- Added: include new endpoints of "API Pix"
- Updated: pix_send example
- Update: rename 'pix_cert' for 'certificate' in credentials.py

# 2.0.0
- Added: include new endpoints of Pix API
- Fix: updated dependencies
Expand Down
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ $ pip install gerencianet
```
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

```python
Expand All @@ -28,24 +33,29 @@ from gerencianet import Gerencianet
credentials = {
'client_id': 'client_id',
'client_secret': 'client_secret',
'sandbox': True
'sandbox': True,
'certificate': 'insira-o-caminho-completo-do-certificado'
}

gn = Gerencianet(credentials)

body = {
'items': [{
'name': "Product 1",
'value': 1000,
'amount': 2
}],
'shippings': [{
'name': "Default Shipping Cost",
'value': 100
}]
'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.'
}

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

```

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
'client_id': '',
'client_secret': '',
'sandbox': False,
'pix_cert': 'insira-o-caminho-completo-do-certificado'
'certificate': 'insira-o-caminho-completo-do-certificado'
}
13 changes: 13 additions & 0 deletions examples/default/carnet/cancel_carnet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: utf-8

from gerencianet import Gerencianet
from ...credentials import credentials

gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
}

response = gn.cancel_carnet(params=params)
print(response)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

body = {
'expire_at': '2021-04-12',
'expire_at': '2022-12-12',
'items': [{
'name': "Carnet Item 1",
'value': 1000,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials


gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1,
Expand Down
13 changes: 13 additions & 0 deletions examples/default/carnet/settle_carnet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: utf-8

from gerencianet import Gerencianet
from ...credentials import credentials

gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
}

response = gn.settle_carnet(params=params)
print(response)
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS

gn = Gerencianet(CREDENTIALS)

params = {
'id': 1,
'parcel': 1
}

response = gn.settle_carnet_parcel(params=params)
print(response)
# encoding: utf-8

from gerencianet import Gerencianet
from ...credentials import credentials

gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1,
'parcel': 1
}

response = gn.settle_carnet_parcel(params=params)
print(response)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

body = {
'items': [{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
Expand Down
12 changes: 6 additions & 6 deletions examples/charge_link.py → examples/default/charge/charge_link.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

body = {
'items': [{
Expand All @@ -18,11 +18,11 @@
}

link = {
'billet_discount': 0,
'card_discount': 0,
'billet_discount': 1,
'card_discount': 1,
'message': '',
'expire_at': '2017-12-12',
'request_delivery_address': None,
'expire_at': '2022-12-12',
'request_delivery_address': False,
'payment_method': 'all'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials


gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

body = {
'items': [{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

params = {
'id': 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)


params = {
'id': 1000
'id': 1
}

body = {
Expand Down
6 changes: 3 additions & 3 deletions examples/create_charge_onestep.py → ...s/default/charge/create_charge_onestep.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# encoding: utf-8

from gerencianet import Gerencianet
from credentials import CREDENTIALS
from ...credentials import credentials

gn = Gerencianet(CREDENTIALS)
gn = Gerencianet(credentials.CREDENTIALS)

body = {
'items': [{
Expand All @@ -17,7 +17,7 @@
}],
'payment': {
'banking_billet': {
'expire_at': '2021-12-12',
'expire_at': '2022-12-12',
'customer': {
'name': "Gorbadoc Oldbuck",
'email': "oldbuck@gerencianet.com.br",
Expand Down
Loading

0 comments on commit c0e6adc

Please sign in to comment.