This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/documentar bankaccount (#111)
* Subindo estado atual * Muda list_bank_accounts para list_bank_accounts_by_seller * Adiciona exemplos de create, list e delete de BankAccount * Adiciona na documentação exemplos de BankAccount * Formatação * fmt * Corrige testes de list_bank_accounts_by_seller * Update examples/bank_account/bank_account_create.py Confiando que não vai quebrar nada. Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com> * Update examples/bank_account/bank_account_remove.py Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com> * Adiciona docstring Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com>
- Loading branch information
1 parent
415ec12
commit b7f4513
Showing
11 changed files
with
182 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Exemplos de conta bancária | ||
======================================== | ||
|
||
Criar conta bancária | ||
----------------------------------------- | ||
.. literalinclude:: ../../examples/bank_account/bank_account_create.py | ||
|
||
Lista as contas bancárias de um vendedor | ||
----------------------------------------- | ||
.. literalinclude:: ../../examples/bank_account/bank_account_list.py | ||
|
||
Remover a conta bancária de um vendedor | ||
----------------------------------------- | ||
.. literalinclude:: ../../examples/bank_account/bank_account_delete.py |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os | ||
|
||
from zoop_wrapper import ZoopWrapper, BankAccount | ||
from examples.utils import dump_response | ||
|
||
|
||
""" | ||
Nesse momento as constantes podem ser criadas no arquivo .py. | ||
Mas é recomendado utilizar como variável de ambiente em um '.env' | ||
""" | ||
from zoop_wrapper.constants import MARKETPLACE_ID, ZOOP_KEY | ||
|
||
|
||
client = ZoopWrapper(marketplace_id=MARKETPLACE_ID, key=ZOOP_KEY) | ||
|
||
seller_brian = "0b05a360f4b749498f74e13004c08024" | ||
brian = client.retrieve_seller(seller_brian) | ||
|
||
ba = { | ||
"account_number": "123", | ||
"bank_code": "237", | ||
"holder_name": "Algum Nome", | ||
"routing_number": "foo", | ||
"taxpayer_id": brian.instance.taxpayer_id, | ||
"type": BankAccount.SAVING_TYPE, | ||
} | ||
|
||
response = client.add_bank_account(ba) | ||
|
||
dump_response(response, os.path.basename(__file__).split(".")[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
from zoop_wrapper import ZoopWrapper | ||
from examples.utils import dump_response | ||
|
||
""" | ||
Nesse momento as constantes podem ser criadas no arquivo .py. | ||
Mas é recomendado utilizar como variável de ambiente em um '.env' | ||
""" | ||
from zoop_wrapper.constants import MARKETPLACE_ID, ZOOP_KEY | ||
|
||
|
||
client = ZoopWrapper(marketplace_id=MARKETPLACE_ID, key=ZOOP_KEY) | ||
|
||
seller_brian = "0b05a360f4b749498f74e13004c08024" | ||
|
||
response = client.list_bank_accounts_by_seller(seller_brian) | ||
|
||
dump_response(response, os.path.basename(__file__).split(".")[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
from zoop_wrapper import ZoopWrapper | ||
from examples.utils import dump_response | ||
|
||
|
||
""" | ||
Nesse momento as constantes podem ser criadas no arquivo .py. | ||
Mas é recomendado utilizar como variável de ambiente em um '.env' | ||
""" | ||
from zoop_wrapper.constants import MARKETPLACE_ID, ZOOP_KEY | ||
|
||
|
||
client = ZoopWrapper(marketplace_id=MARKETPLACE_ID, key=ZOOP_KEY) | ||
|
||
|
||
response = client.remove_bank_account("e85edf6d0add48339e3d8189f615c3b1") | ||
|
||
dump_response(response, os.path.basename(__file__).split(".")[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"id": "e85edf6d0add48339e3d8189f615c3b1", | ||
"resource": "bank_account", | ||
"holder_name": "Algum Nome", | ||
"taxpayer_id": "94998862499", | ||
"description": null, | ||
"bank_name": "Banco Bradesco S.A.", | ||
"bank_code": "237", | ||
"type": "Savings", | ||
"account_number": "123", | ||
"country_code": "BR", | ||
"routing_number": "foo", | ||
"routing_check_digit": null, | ||
"phone_number": null, | ||
"is_active": true, | ||
"is_verified": false, | ||
"debitable": false, | ||
"customer": "0b05a360f4b749498f74e13004c08024", | ||
"fingerprint": "5415ba4927cb5cec4aa4dfd309a4f6813b5f2644423533ffb2d245713a285a61", | ||
"address": null, | ||
"verification_checklist": { | ||
"postal_code_check": "unchecked", | ||
"address_line1_check": "unchecked", | ||
"deposit_check": "unchecked" | ||
}, | ||
"metadata": {}, | ||
"uri": "/v1/marketplaces/foo/bank_accounts/e85edf6d0add48339e3d8189f615c3b1", | ||
"created_at": "2020-10-09T19:54:56+00:00", | ||
"updated_at": "2020-10-09T19:54:57+00:00" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"resource": "list", | ||
"uri": "/v1/marketplaces/foo/sellers/0b05a360f4b749498f74e13004c08024/bank_accounts?limit=100&offset=0", | ||
"items": [ | ||
{ | ||
"id": "682cd3a336124ca1a9a891195960c16e", | ||
"resource": "bank_account", | ||
"holder_name": "Algum Nome", | ||
"taxpayer_id": "94998862499", | ||
"description": null, | ||
"bank_name": "Banco Bradesco S.A.", | ||
"bank_code": "237", | ||
"type": "Savings", | ||
"last4_digits": "123", | ||
"account_number": "123", | ||
"country_code": "BR", | ||
"routing_number": "foo", | ||
"routing_check_digit": null, | ||
"phone_number": null, | ||
"is_active": true, | ||
"is_verified": false, | ||
"debitable": false, | ||
"customer": "0b05a360f4b749498f74e13004c08024", | ||
"fingerprint": "5415ba4927cb5cec4aa4dfd309a4f6813b5f2644423533ffb2d245713a285a61", | ||
"address": null, | ||
"verification_checklist": { | ||
"postal_code_check": "unchecked", | ||
"address_line1_check": "unchecked", | ||
"deposit_check": "unchecked" | ||
}, | ||
"metadata": {}, | ||
"uri": "/v1/marketplaces/foo/bank_accounts/682cd3a336124ca1a9a891195960c16e", | ||
"created_at": "2020-10-09T19:50:37+00:00", | ||
"updated_at": "2020-10-09T19:50:37+00:00" | ||
} | ||
], | ||
"limit": 100, | ||
"offset": 0, | ||
"has_more": false, | ||
"query_count": 0, | ||
"total": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"id": "e85edf6d0add48339e3d8189f615c3b1", | ||
"resource": "bank_account", | ||
"deleted": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters