From dc37a493ed3a88d085cc86db3f5dafddd6257a6f Mon Sep 17 00:00:00 2001 From: Allisson Azevedo Date: Wed, 2 Oct 2019 18:50:10 -0300 Subject: [PATCH] =?UTF-8?q?Vers=C3=A3o=201.0.0=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Versão 1.0.0 * Adicionando o flake8 --- .pre-commit-config.yaml | 21 + .travis.yml | 6 +- CHANGES.rst | 6 + Makefile | 3 + requirements-dev.txt | 12 +- resources/cassettes/test_bill_create.yaml | 36 -- resources/cassettes/test_bill_destroy.yaml | 34 -- resources/cassettes/test_bill_list.yaml | 35 -- resources/cassettes/test_bill_retrieve.yaml | 33 -- resources/cassettes/test_bill_update.yaml | 36 -- resources/cassettes/test_charge_charge.yaml | 34 -- resources/cassettes/test_charge_destroy.yaml | 32 -- resources/cassettes/test_charge_list.yaml | 43 -- resources/cassettes/test_charge_retrieve.yaml | 31 -- resources/cassettes/test_charge_update.yaml | 32 -- resources/cassettes/test_customer_create.yaml | 30 -- .../cassettes/test_customer_destroy.yaml | 30 -- resources/cassettes/test_customer_list.yaml | 31 -- .../cassettes/test_customer_retrieve.yaml | 29 -- resources/cassettes/test_customer_update.yaml | 30 -- .../cassettes/test_payment_methods_list.yaml | 30 -- .../test_payment_methods_retrieve.yaml | 30 -- .../test_payment_profiles_create.yaml | 35 -- .../test_payment_profiles_destroy.yaml | 33 -- .../cassettes/test_payment_profiles_list.yaml | 34 -- .../test_payment_profiles_retrieve.yaml | 32 -- .../test_payment_profiles_verify.yaml | 31 -- resources/cassettes/test_product_create.yaml | 32 -- resources/cassettes/test_product_list.yaml | 32 -- .../cassettes/test_product_retrieve.yaml | 30 -- resources/cassettes/test_product_update.yaml | 31 -- setup.py | 59 ++- tests/conftest.py | 109 +---- tests/test_api.py | 18 +- tests/test_api_resources.py | 227 ---------- tests/vcr.py | 10 - vindi/api.py | 86 ++-- vindi/resource.py | 386 ++++-------------- 38 files changed, 186 insertions(+), 1603 deletions(-) create mode 100644 .pre-commit-config.yaml delete mode 100644 resources/cassettes/test_bill_create.yaml delete mode 100644 resources/cassettes/test_bill_destroy.yaml delete mode 100644 resources/cassettes/test_bill_list.yaml delete mode 100644 resources/cassettes/test_bill_retrieve.yaml delete mode 100644 resources/cassettes/test_bill_update.yaml delete mode 100644 resources/cassettes/test_charge_charge.yaml delete mode 100644 resources/cassettes/test_charge_destroy.yaml delete mode 100644 resources/cassettes/test_charge_list.yaml delete mode 100644 resources/cassettes/test_charge_retrieve.yaml delete mode 100644 resources/cassettes/test_charge_update.yaml delete mode 100644 resources/cassettes/test_customer_create.yaml delete mode 100644 resources/cassettes/test_customer_destroy.yaml delete mode 100644 resources/cassettes/test_customer_list.yaml delete mode 100644 resources/cassettes/test_customer_retrieve.yaml delete mode 100644 resources/cassettes/test_customer_update.yaml delete mode 100644 resources/cassettes/test_payment_methods_list.yaml delete mode 100644 resources/cassettes/test_payment_methods_retrieve.yaml delete mode 100644 resources/cassettes/test_payment_profiles_create.yaml delete mode 100644 resources/cassettes/test_payment_profiles_destroy.yaml delete mode 100644 resources/cassettes/test_payment_profiles_list.yaml delete mode 100644 resources/cassettes/test_payment_profiles_retrieve.yaml delete mode 100644 resources/cassettes/test_payment_profiles_verify.yaml delete mode 100644 resources/cassettes/test_product_create.yaml delete mode 100644 resources/cassettes/test_product_list.yaml delete mode 100644 resources/cassettes/test_product_retrieve.yaml delete mode 100644 resources/cassettes/test_product_update.yaml delete mode 100644 tests/test_api_resources.py delete mode 100644 tests/vcr.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..06960c2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +repos: +- repo: local + hooks: + - id: black + name: black + entry: black + language: system + types: [python] + args: ['--diff'] + - id: isort + name: isort + entry: isort + language: system + types: [python] + args: ['--check-only'] + - id: flake8 + name: flake8 + entry: flake8 + language: system + types: [python] + args: ['--ignore=E501,W503'] diff --git a/.travis.yml b/.travis.yml index b2644ac..c713524 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ language: python python: - - "3.5" - "3.6" + - "3.7" # command to install dependencies install: - pip install -r requirements-dev.txt +before_script: + - make lint # command to run tests script: pytest after_success: - coveralls \ No newline at end of file + coveralls diff --git a/CHANGES.rst b/CHANGES.rst index 1df6484..f740f86 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,12 @@ Changelog --------- +1.0.0 +~~~~~ + +* Suporte a python 3.5 removido. +* Versão do simple-rest-client atualizada para >= 1.0.0 + 0.2.0 ~~~~~ diff --git a/Makefile b/Makefile index b3b2df2..99baa49 100644 --- a/Makefile +++ b/Makefile @@ -25,3 +25,6 @@ release: dist git tag `python setup.py -q version` git push origin `python setup.py -q version` twine upload dist/* + +lint: + SKIP=no-commit-to-branch pre-commit run -a -v diff --git a/requirements-dev.txt b/requirements-dev.txt index a69f9ce..6021c56 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,12 @@ -r requirements.txt +Sphinx +black +coveralls +flake8 +isort +pre-commit pytest pytest-cov -vcrpy -coveralls -Sphinx twine -wheel \ No newline at end of file +vcrpy +wheel diff --git a/resources/cassettes/test_bill_create.yaml b/resources/cassettes/test_bill_create.yaml deleted file mode 100644 index fbf42f4..0000000 --- a/resources/cassettes/test_bill_create.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: '{"customer_id": 2481258, "code": "my-first-bill", "installments": 1, "payment_method_code": - "credit_card", "bill_items": [{"product_code": "product-1", "amount": 100.0}], - "payment_profile": {"id": 2284520}}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['206'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: POST - uri: https://app.vindi.com.br/api/v1/bills - response: - body: {string: "{\"bill\":{\"id\":7064381,\"code\":\"my-first-bill\",\"amount\":\"100.0\",\"installments\":1,\"status\":\"pending\",\"seen_at\":null,\"billing_at\":null,\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"url\":\"https://app.vindi.com.br/customer/bills/7064381?token=db96ea6a-561f-44ab-a040-b0909c739564\",\"created_at\":\"2017-04-21T09:18:55.000-03:00\",\"updated_at\":\"2017-04-21T09:18:56.000-03:00\",\"bill_items\":[{\"id\":8362517,\"amount\":\"100.0\",\"quantity\":null,\"pricing_range_id\":null,\"description\":null,\"pricing_schema\":null,\"product\":{\"id\":82534,\"name\":\"Product - 1\",\"code\":\"product-1\"},\"product_item\":null,\"discount\":null}],\"charges\":[{\"id\":6803582,\"amount\":\"100.0\",\"status\":\"pending\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T09:18:56.000-03:00\",\"updated_at\":\"2017-04-21T09:18:56.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"}}],\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null},\"period\":null,\"subscription\":null,\"metadata\":{},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['1561'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 12:18:56 GMT'] - ETag: [W/"4c7430bea9c7892cad07e10dbefd87cc"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492777195'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [885764eb-c2f6-444d-b1ba-fbf217f9ec45] - X-Runtime: ['0.296408'] - status: {code: 201, message: Created} -version: 1 diff --git a/resources/cassettes/test_bill_destroy.yaml b/resources/cassettes/test_bill_destroy.yaml deleted file mode 100644 index a41d2c0..0000000 --- a/resources/cassettes/test_bill_destroy.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: DELETE - uri: https://app.vindi.com.br/api/v1/bills/7071692 - response: - body: {string: "{\"bill\":{\"id\":7071692,\"code\":\"my-third-bill\",\"amount\":\"0.0\",\"installments\":1,\"status\":\"canceled\",\"seen_at\":null,\"billing_at\":\"2017-04-21T00:00:00.000-03:00\",\"due_at\":\"2017-04-21T23:59:59.000-03:00\",\"url\":\"https://app.vindi.com.br/customer/bills/7071692?token=4acee607-f2b6-433a-8134-67be26553f97\",\"created_at\":\"2017-04-21T11:08:49.000-03:00\",\"updated_at\":\"2017-04-21T11:49:06.666-03:00\",\"bill_items\":[{\"id\":8371854,\"amount\":\"100.0\",\"quantity\":null,\"pricing_range_id\":null,\"description\":null,\"pricing_schema\":null,\"product\":{\"id\":82534,\"name\":\"Product - 1\",\"code\":\"product-1\"},\"product_item\":null,\"discount\":null}],\"charges\":[{\"id\":6810651,\"amount\":\"100.0\",\"status\":\"canceled\",\"due_at\":\"2017-04-21T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T11:08:49.000-03:00\",\"updated_at\":\"2017-04-21T11:49:06.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"}}],\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null},\"period\":null,\"subscription\":null,\"metadata\":{},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['1588'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 14:49:06 GMT'] - ETag: [W/"cd9afb6ea9fb00294280b967826cc5bd"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['118'] - Rate-Limit-Reset: ['1492786149'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [fbe252be-cb20-4f66-b0bb-baf2ef04f1ac] - X-Runtime: ['0.112778'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_bill_list.yaml b/resources/cassettes/test_bill_list.yaml deleted file mode 100644 index 58b480a..0000000 --- a/resources/cassettes/test_bill_list.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/bills - response: - body: {string: "{\"bills\":[{\"id\":7064381,\"code\":\"my-first-bill\",\"amount\":\"100.0\",\"installments\":1,\"status\":\"pending\",\"seen_at\":null,\"billing_at\":null,\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"url\":\"https://app.vindi.com.br/customer/bills/7064381?token=db96ea6a-561f-44ab-a040-b0909c739564\",\"created_at\":\"2017-04-21T09:18:55.000-03:00\",\"updated_at\":\"2017-04-21T09:18:56.000-03:00\",\"bill_items\":[{\"id\":8362517,\"amount\":\"100.0\",\"quantity\":null,\"pricing_range_id\":null,\"description\":null,\"pricing_schema\":null,\"product\":{\"id\":82534,\"name\":\"Product - 1\",\"code\":\"product-1\"},\"product_item\":null,\"discount\":null}],\"charges\":[{\"id\":6803582,\"amount\":\"100.0\",\"status\":\"pending\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T09:18:56.000-03:00\",\"updated_at\":\"2017-04-21T09:18:56.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"}}],\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null},\"period\":null,\"subscription\":null,\"metadata\":{},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}}]}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['1564'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 12:21:51 GMT'] - ETag: [W/"bdd79778039b209ced3f464578a4a527"] - Per-Page: ['25'] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492777371'] - Server: [nginx] - Total: ['1'] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [5e28c6d7-9dd1-42ec-87e9-308a00a6ccc2] - X-Runtime: ['0.040105'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_bill_retrieve.yaml b/resources/cassettes/test_bill_retrieve.yaml deleted file mode 100644 index ad81702..0000000 --- a/resources/cassettes/test_bill_retrieve.yaml +++ /dev/null @@ -1,33 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/bills/7064381 - response: - body: {string: "{\"bill\":{\"id\":7064381,\"code\":\"my-first-bill\",\"amount\":\"100.0\",\"installments\":1,\"status\":\"pending\",\"seen_at\":null,\"billing_at\":null,\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"url\":\"https://app.vindi.com.br/customer/bills/7064381?token=db96ea6a-561f-44ab-a040-b0909c739564\",\"created_at\":\"2017-04-21T09:18:55.000-03:00\",\"updated_at\":\"2017-04-21T09:18:56.000-03:00\",\"bill_items\":[{\"id\":8362517,\"amount\":\"100.0\",\"quantity\":null,\"pricing_range_id\":null,\"description\":null,\"pricing_schema\":null,\"product\":{\"id\":82534,\"name\":\"Product - 1\",\"code\":\"product-1\"},\"product_item\":null,\"discount\":null}],\"charges\":[{\"id\":6803582,\"amount\":\"100.0\",\"status\":\"pending\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T09:18:56.000-03:00\",\"updated_at\":\"2017-04-21T09:18:56.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"}}],\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null},\"period\":null,\"subscription\":null,\"metadata\":{},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['1561'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 12:23:05 GMT'] - ETag: [W/"4c7430bea9c7892cad07e10dbefd87cc"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492777445'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [cdbd7ba3-40f3-4937-97d5-549074eac0bd] - X-Runtime: ['0.040206'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_bill_update.yaml b/resources/cassettes/test_bill_update.yaml deleted file mode 100644 index 6e8691a..0000000 --- a/resources/cassettes/test_bill_update.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: '{"code": "first-bill"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['22'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: PUT - uri: https://app.vindi.com.br/api/v1/bills/7064381 - response: - body: {string: "{\"bill\":{\"id\":7064381,\"code\":\"first-bill\",\"amount\":\"100.0\",\"installments\":1,\"status\":\"paid\",\"seen_at\":\"2017-04-21T09:25:17.000-03:00\",\"billing_at\":null,\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"url\":\"https://app.vindi.com.br/customer/bills/7064381?token=db96ea6a-561f-44ab-a040-b0909c739564\",\"created_at\":\"2017-04-21T09:18:55.000-03:00\",\"updated_at\":\"2017-04-21T11:44:02.492-03:00\",\"bill_items\":[{\"id\":8362517,\"amount\":\"100.0\",\"quantity\":null,\"pricing_range_id\":null,\"description\":null,\"pricing_schema\":null,\"product\":{\"id\":82534,\"name\":\"Product - 1\",\"code\":\"product-1\"},\"product_item\":null,\"discount\":null}],\"charges\":[{\"id\":6803582,\"amount\":\"100.0\",\"status\":\"paid\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":\"2017-04-21T10:40:52.000-03:00\",\"installments\":1,\"attempt_count\":1,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T09:18:56.000-03:00\",\"updated_at\":\"2017-04-21T10:40:52.000-03:00\",\"last_transaction\":{\"id\":10384095,\"transaction_type\":\"charge\",\"status\":\"success\",\"amount\":\"100.0\",\"installments\":1,\"gateway_message\":\"Transacao - aprovada\",\"gateway_response_code\":\"\",\"gateway_authorization\":\"2C2B04FE23B6958DF90E72AADEA3AD87\",\"gateway_transaction_id\":\"dacbe4d7-591c-4949-ae6e-5932aa2501be\",\"gateway_response_fields\":{\"test_auth\":\"cfa315f873c37a4cfca1\"},\"fraud_detector_score\":null,\"fraud_detector_status\":null,\"fraud_detector_id\":null,\"created_at\":\"2017-04-21T10:40:52.000-03:00\",\"gateway\":{\"id\":10371,\"connector\":\"test\"},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"}}],\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null},\"period\":null,\"subscription\":null,\"metadata\":{},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['2510'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 14:44:02 GMT'] - ETag: [W/"6a48b84d304c981e175ebf9f46aedcc9"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492785902'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [092d54bc-c315-4ee3-a0b0-7eb239f08202] - X-Runtime: ['0.099385'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_charge_charge.yaml b/resources/cassettes/test_charge_charge.yaml deleted file mode 100644 index b76ce98..0000000 --- a/resources/cassettes/test_charge_charge.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: POST - uri: https://app.vindi.com.br/api/v1/charges/6810923/charge - response: - body: {string: "{\"charge\":{\"id\":6810923,\"amount\":\"100.0\",\"status\":\"paid\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":\"2017-04-21T12:06:47.000-03:00\",\"installments\":2,\"attempt_count\":1,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T11:12:04.000-03:00\",\"updated_at\":\"2017-04-21T12:06:47.000-03:00\",\"last_transaction\":{\"id\":10396048,\"transaction_type\":\"charge\",\"status\":\"success\",\"amount\":\"100.0\",\"installments\":2,\"gateway_message\":\"Transacao - aprovada\",\"gateway_response_code\":\"\",\"gateway_authorization\":\"D2186DDB040BE6B676D5D71E18840BFA\",\"gateway_transaction_id\":\"9f9d9350-25aa-4640-a086-e5fbce85eb65\",\"gateway_response_fields\":{\"test_auth\":\"5786a017cbdd8323c359\"},\"fraud_detector_score\":null,\"fraud_detector_status\":null,\"fraud_detector_id\":null,\"created_at\":\"2017-04-21T12:06:47.000-03:00\",\"gateway\":{\"id\":10371,\"connector\":\"test\"},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7071972,\"code\":\"my-fourth-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['1507'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 15:06:47 GMT'] - ETag: [W/"df8bfecdd9105168d21db87fc27a26aa"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492787267'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [c1e109fe-63aa-495a-b8ee-f3de4c06c4c0] - X-Runtime: ['0.173296'] - status: {code: 201, message: Created} -version: 1 diff --git a/resources/cassettes/test_charge_destroy.yaml b/resources/cassettes/test_charge_destroy.yaml deleted file mode 100644 index f505d0a..0000000 --- a/resources/cassettes/test_charge_destroy.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: DELETE - uri: https://app.vindi.com.br/api/v1/charges/6814889 - response: - body: {string: "{\"charge\":{\"id\":6814889,\"amount\":\"100.0\",\"status\":\"canceled\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T12:11:49.000-03:00\",\"updated_at\":\"2017-04-21T12:13:44.521-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7076080,\"code\":\"my-fifth-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['579'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 15:13:44 GMT'] - ETag: [W/"0befc147fbde8e7eeee846985260c62e"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['118'] - Rate-Limit-Reset: ['1492787646'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [df5eb926-265c-49d4-862d-b96328aa7112] - X-Runtime: ['0.050420'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_charge_list.yaml b/resources/cassettes/test_charge_list.yaml deleted file mode 100644 index 66cccda..0000000 --- a/resources/cassettes/test_charge_list.yaml +++ /dev/null @@ -1,43 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/charges - response: - body: {string: "{\"charges\":[{\"id\":6803582,\"amount\":\"100.0\",\"status\":\"paid\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":\"2017-04-21T10:40:52.000-03:00\",\"installments\":1,\"attempt_count\":1,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T09:18:56.000-03:00\",\"updated_at\":\"2017-04-21T10:40:52.000-03:00\",\"last_transaction\":{\"id\":10384095,\"transaction_type\":\"charge\",\"status\":\"success\",\"amount\":\"100.0\",\"installments\":1,\"gateway_message\":\"Transacao - aprovada\",\"gateway_response_code\":\"\",\"gateway_authorization\":\"2C2B04FE23B6958DF90E72AADEA3AD87\",\"gateway_transaction_id\":\"dacbe4d7-591c-4949-ae6e-5932aa2501be\",\"gateway_response_fields\":{\"test_auth\":\"cfa315f873c37a4cfca1\"},\"fraud_detector_score\":null,\"fraud_detector_status\":null,\"fraud_detector_id\":null,\"created_at\":\"2017-04-21T10:40:52.000-03:00\",\"gateway\":{\"id\":10371,\"connector\":\"test\"},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7064381,\"code\":\"first-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}},{\"id\":6808320,\"amount\":\"100.0\",\"status\":\"paid\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":\"2017-04-21T10:48:09.000-03:00\",\"installments\":1,\"attempt_count\":1,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T10:44:59.000-03:00\",\"updated_at\":\"2017-04-21T10:48:09.000-03:00\",\"last_transaction\":{\"id\":10385265,\"transaction_type\":\"charge\",\"status\":\"success\",\"amount\":\"100.0\",\"installments\":1,\"gateway_message\":\"Transacao - aprovada\",\"gateway_response_code\":\"\",\"gateway_authorization\":\"A7E5378655F8AC4A689295CDE09E042F\",\"gateway_transaction_id\":\"89200ced-93c8-4f81-b731-b1b61df60b97\",\"gateway_response_fields\":{\"test_auth\":\"b8dc449676c12b7d14ff\"},\"fraud_detector_score\":null,\"fraud_detector_status\":null,\"fraud_detector_id\":null,\"created_at\":\"2017-04-21T10:48:09.000-03:00\",\"gateway\":{\"id\":10371,\"connector\":\"test\"},\"payment_profile\":{\"id\":2284520,\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}}},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7069267,\"code\":\"my-second-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}},{\"id\":6810651,\"amount\":\"100.0\",\"status\":\"canceled\",\"due_at\":\"2017-04-21T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T11:08:49.000-03:00\",\"updated_at\":\"2017-04-21T11:49:06.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7071692,\"code\":\"my-third-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}},{\"id\":6810923,\"amount\":\"100.0\",\"status\":\"pending\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T11:12:04.000-03:00\",\"updated_at\":\"2017-04-21T11:12:04.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7071972,\"code\":\"my-fourth-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}]}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['4141'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 14:58:09 GMT'] - ETag: [W/"b73237905ac23c0a463d45bb33f873fb"] - Per-Page: ['25'] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492786749'] - Server: [nginx] - Total: ['4'] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [f2541688-d425-421e-a76e-f4b7e5cd5f77] - X-Runtime: ['0.064298'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_charge_retrieve.yaml b/resources/cassettes/test_charge_retrieve.yaml deleted file mode 100644 index c21c547..0000000 --- a/resources/cassettes/test_charge_retrieve.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/charges/6810923 - response: - body: {string: "{\"charge\":{\"id\":6810923,\"amount\":\"100.0\",\"status\":\"pending\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":1,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T11:12:04.000-03:00\",\"updated_at\":\"2017-04-21T11:12:04.000-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7071972,\"code\":\"my-fourth-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['579'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 15:01:52 GMT'] - ETag: [W/"db9641d1613cd172871de1c4648e5ae8"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492786972'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [406f2c93-1c93-4e58-af60-2fc7e4ca2254] - X-Runtime: ['0.025687'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_charge_update.yaml b/resources/cassettes/test_charge_update.yaml deleted file mode 100644 index a71d6bd..0000000 --- a/resources/cassettes/test_charge_update.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: '{"installments": 2}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['19'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: PUT - uri: https://app.vindi.com.br/api/v1/charges/6810923 - response: - body: {string: "{\"charge\":{\"id\":6810923,\"amount\":\"100.0\",\"status\":\"pending\",\"due_at\":\"2017-04-24T23:59:59.000-03:00\",\"paid_at\":null,\"installments\":2,\"attempt_count\":0,\"next_attempt\":null,\"print_url\":null,\"created_at\":\"2017-04-21T11:12:04.000-03:00\",\"updated_at\":\"2017-04-21T12:04:46.197-03:00\",\"last_transaction\":null,\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"bill\":{\"id\":7071972,\"code\":\"my-fourth-bill\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['579'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Fri, 21 Apr 2017 15:04:46 GMT'] - ETag: [W/"e90c8e22a64371bd1a57151ecd62bcaf"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492787146'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [4fe6c564-84fe-4e51-a325-6b124ccff2bf] - X-Runtime: ['0.053131'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_customer_create.yaml b/resources/cassettes/test_customer_create.yaml deleted file mode 100644 index dfd27db..0000000 --- a/resources/cassettes/test_customer_create.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: '{"name": "John Doe", "email": "john@doe.com"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['45'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: POST - uri: https://app.vindi.com.br/api/v1/customers - response: - body: {string: '{"customer":{"id":2481112,"name":"John Doe","email":"john@doe.com","registry_code":null,"code":null,"notes":null,"status":"inactive","created_at":"2017-04-19T13:08:51.795-03:00","updated_at":"2017-04-19T13:08:51.795-03:00","metadata":{},"address":{"street":null,"number":null,"additional_details":null,"zipcode":null,"neighborhood":null,"city":null,"state":null,"country":null},"phones":[]}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['391'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Wed, 19 Apr 2017 16:08:51 GMT'] - ETag: [W/"40dbc378166c4c52eb3021afb51d185a"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492618191'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [38085863-de04-45ec-a29f-1b707c7ab68b] - X-Runtime: ['0.057048'] - status: {code: 201, message: Created} -version: 1 diff --git a/resources/cassettes/test_customer_destroy.yaml b/resources/cassettes/test_customer_destroy.yaml deleted file mode 100644 index 7f0aca9..0000000 --- a/resources/cassettes/test_customer_destroy.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: DELETE - uri: https://app.vindi.com.br/api/v1/customers/2481112 - response: - body: {string: '{"customer":{"id":2481112,"name":"Jane Doe","email":"jane@doe.com","registry_code":null,"code":null,"notes":null,"status":"archived","created_at":"2017-04-19T13:08:51.000-03:00","updated_at":"2017-04-19T13:25:57.301-03:00","metadata":{},"address":{"street":null,"number":null,"additional_details":null,"zipcode":null,"neighborhood":null,"city":null,"state":null,"country":null},"phones":[]}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['391'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Wed, 19 Apr 2017 16:25:57 GMT'] - ETag: [W/"e5bab4d004af325bcf367d4dd7af0f3c"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492619217'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [30989636-e009-4fb5-bc60-55869c6fc11e] - X-Runtime: ['0.103460'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_customer_list.yaml b/resources/cassettes/test_customer_list.yaml deleted file mode 100644 index 2648034..0000000 --- a/resources/cassettes/test_customer_list.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/customers - response: - body: {string: '{"customers":[{"id":2481112,"name":"John Doe","email":"john@doe.com","registry_code":null,"code":null,"notes":null,"status":"inactive","created_at":"2017-04-19T13:08:51.000-03:00","updated_at":"2017-04-19T13:08:51.000-03:00","metadata":{},"address":{"street":null,"number":null,"additional_details":null,"zipcode":null,"neighborhood":null,"city":null,"state":null,"country":null},"phones":[]}]}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['394'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Wed, 19 Apr 2017 16:11:42 GMT'] - ETag: [W/"a9fe62d7b97266cabf07375a40ff91f9"] - Per-Page: ['25'] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492618362'] - Server: [nginx] - Total: ['1'] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [cd47987b-4587-4418-8877-2861f5bc19dc] - X-Runtime: ['0.029472'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_customer_retrieve.yaml b/resources/cassettes/test_customer_retrieve.yaml deleted file mode 100644 index 6707fcc..0000000 --- a/resources/cassettes/test_customer_retrieve.yaml +++ /dev/null @@ -1,29 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/customers/2481112 - response: - body: {string: '{"customer":{"id":2481112,"name":"John Doe","email":"john@doe.com","registry_code":null,"code":null,"notes":null,"status":"inactive","created_at":"2017-04-19T13:08:51.000-03:00","updated_at":"2017-04-19T13:08:51.000-03:00","metadata":{},"address":{"street":null,"number":null,"additional_details":null,"zipcode":null,"neighborhood":null,"city":null,"state":null,"country":null},"phones":[]}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['391'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Wed, 19 Apr 2017 16:19:50 GMT'] - ETag: [W/"702a3fd627b8e925848e29315fa67d72"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492618849'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [72f86328-e3ee-4921-bc69-c549c2d4f6be] - X-Runtime: ['0.024208'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_customer_update.yaml b/resources/cassettes/test_customer_update.yaml deleted file mode 100644 index 0e9341f..0000000 --- a/resources/cassettes/test_customer_update.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: '{"name": "Jane Doe", "email": "jane@doe.com"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['45'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: PUT - uri: https://app.vindi.com.br/api/v1/customers/2481112 - response: - body: {string: '{"customer":{"id":2481112,"name":"Jane Doe","email":"jane@doe.com","registry_code":null,"code":null,"notes":null,"status":"inactive","created_at":"2017-04-19T13:08:51.000-03:00","updated_at":"2017-04-19T13:22:46.794-03:00","metadata":{},"address":{"street":null,"number":null,"additional_details":null,"zipcode":null,"neighborhood":null,"city":null,"state":null,"country":null},"phones":[]}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['391'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Wed, 19 Apr 2017 16:22:46 GMT'] - ETag: [W/"61ef9921ac8c5ece795fee47abe22bb5"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492619026'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [dde16aac-9849-43e3-87c7-0585eefb2c08] - X-Runtime: ['0.046789'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_payment_methods_list.yaml b/resources/cassettes/test_payment_methods_list.yaml deleted file mode 100644 index beedcb1..0000000 --- a/resources/cassettes/test_payment_methods_list.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/payment_methods - response: - body: {string: "{\"payment_methods\":[{\"id\":17294,\"public_name\":\"Dinheiro\",\"name\":\"Dinheiro\",\"code\":\"cash\",\"type\":\"PaymentMethod::Cash\",\"status\":\"inactive\",\"settings\":{\"due_days\":3},\"set_subscription_on_success\":\"do_not_set\",\"allow_as_alternative\":false,\"payment_companies\":[],\"maximum_attempts\":null,\"created_at\":\"2017-03-10T14:20:47.000-03:00\",\"updated_at\":\"2017-03-10T14:20:47.000-03:00\"},{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\",\"status\":\"active\",\"settings\":{\"automatic_bill_charge\":true},\"set_subscription_on_success\":\"set_without_authorization\",\"allow_as_alternative\":true,\"payment_companies\":[{\"id\":2,\"name\":\"Visa\",\"code\":\"visa\"},{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}],\"maximum_attempts\":5,\"created_at\":\"2017-03-10T14:20:47.000-03:00\",\"updated_at\":\"2017-03-10T14:20:47.000-03:00\"}]}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['874'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:41:00 GMT'] - ETag: [W/"e3faf6f5a4cade442dd9b907b4190a43"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492688520'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [bc7c1f63-d435-42c8-a01d-104d1ba9eb1a] - X-Runtime: ['0.031459'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_payment_methods_retrieve.yaml b/resources/cassettes/test_payment_methods_retrieve.yaml deleted file mode 100644 index b99d8c4..0000000 --- a/resources/cassettes/test_payment_methods_retrieve.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/payment_methods/17293 - response: - body: {string: "{\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\",\"status\":\"active\",\"settings\":{\"automatic_bill_charge\":true},\"set_subscription_on_success\":\"set_without_authorization\",\"allow_as_alternative\":true,\"payment_companies\":[{\"id\":2,\"name\":\"Visa\",\"code\":\"visa\"},{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"}],\"maximum_attempts\":5,\"created_at\":\"2017-03-10T14:20:47.000-03:00\",\"updated_at\":\"2017-03-10T14:20:47.000-03:00\"}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['517'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:46:48 GMT'] - ETag: [W/"712ef6cbb97c10e61e337fc0afd2e806"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492688868'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [38a792a4-b65f-488a-8aba-76daf30074b4] - X-Runtime: ['0.024082'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_payment_profiles_create.yaml b/resources/cassettes/test_payment_profiles_create.yaml deleted file mode 100644 index 96ad368..0000000 --- a/resources/cassettes/test_payment_profiles_create.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: '{"holder_name": "John Doe", "card_expiration": "12/2020", "card_number": - "5555555555555557", "card_cvv": "123", "payment_method_code": "credit_card", - "payment_company_code": "mastercard", "customer_id": 2481258}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['211'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: POST - uri: https://app.vindi.com.br/api/v1/payment_profiles - response: - body: {string: "{\"payment_profile\":{\"id\":2284520,\"status\":\"active\",\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.999-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"type\":\"PaymentProfile::CreditCard\",\"created_at\":\"2017-04-20T08:59:01.672-03:00\",\"updated_at\":\"2017-04-20T08:59:01.672-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['721'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:59:01 GMT'] - ETag: [W/"53b54710a260c662358cf53952594ab8"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492689601'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [0e6a29e2-fd75-4bbc-acfd-9737a906dd52] - X-Runtime: ['0.075400'] - status: {code: 201, message: Created} -version: 1 diff --git a/resources/cassettes/test_payment_profiles_destroy.yaml b/resources/cassettes/test_payment_profiles_destroy.yaml deleted file mode 100644 index 1a24bb9..0000000 --- a/resources/cassettes/test_payment_profiles_destroy.yaml +++ /dev/null @@ -1,33 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: DELETE - uri: https://app.vindi.com.br/api/v1/payment_profiles/2284520 - response: - body: {string: "{\"payment_profile\":{\"id\":2284520,\"status\":\"inactive\",\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"type\":\"PaymentProfile::CreditCard\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"updated_at\":\"2017-04-20T09:12:59.611-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['723'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 12:12:59 GMT'] - ETag: [W/"d41562ef5af6759c55390d4e3fad9ed6"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492690439'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [94dd7c04-be9a-4068-a2eb-a2bc5186e93c] - X-Runtime: ['0.055947'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_payment_profiles_list.yaml b/resources/cassettes/test_payment_profiles_list.yaml deleted file mode 100644 index 65cc0a4..0000000 --- a/resources/cassettes/test_payment_profiles_list.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/payment_profiles - response: - body: {string: "{\"payment_profiles\":[{\"id\":2284520,\"status\":\"active\",\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"type\":\"PaymentProfile::CreditCard\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"updated_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}]}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['724'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 12:04:13 GMT'] - ETag: [W/"f35796d357de9b851738efb61af6bea9"] - Per-Page: ['25'] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492689913'] - Server: [nginx] - Total: ['1'] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [89832d0c-05d1-46a3-a956-e739addef3a4] - X-Runtime: ['0.189290'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_payment_profiles_retrieve.yaml b/resources/cassettes/test_payment_profiles_retrieve.yaml deleted file mode 100644 index d9b69aa..0000000 --- a/resources/cassettes/test_payment_profiles_retrieve.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/payment_profiles/2284520 - response: - body: {string: "{\"payment_profile\":{\"id\":2284520,\"status\":\"active\",\"holder_name\":\"JOHN - DOE\",\"registry_code\":null,\"bank_branch\":null,\"bank_account\":null,\"card_expiration\":\"2020-12-31T23:59:59.000-02:00\",\"card_number_first_six\":\"555555\",\"card_number_last_four\":\"5557\",\"token\":\"ba3cf5f2-143f-44df-b09e-0bc69dfb7a96\",\"type\":\"PaymentProfile::CreditCard\",\"created_at\":\"2017-04-20T08:59:01.000-03:00\",\"updated_at\":\"2017-04-20T08:59:01.000-03:00\",\"payment_company\":{\"id\":1,\"name\":\"MasterCard\",\"code\":\"mastercard\"},\"payment_method\":{\"id\":17293,\"public_name\":\"Cart\xE3o - de cr\xE9dito\",\"name\":\"Cart\xE3o de cr\xE9dito\",\"code\":\"credit_card\",\"type\":\"PaymentMethod::CreditCard\"},\"customer\":{\"id\":2481258,\"name\":\"John - Doe\",\"email\":\"john@doe.com\",\"code\":null}}}"} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['721'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 12:05:28 GMT'] - ETag: [W/"9e57fe1251f2a26f253cdc1dc28f6026"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492689988'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [33674a87-c3f7-4593-9964-631e1aef2664] - X-Runtime: ['0.024346'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_payment_profiles_verify.yaml b/resources/cassettes/test_payment_profiles_verify.yaml deleted file mode 100644 index 3c8d255..0000000 --- a/resources/cassettes/test_payment_profiles_verify.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: POST - uri: https://app.vindi.com.br/api/v1/payment_profiles/2284520/verify - response: - body: {string: '{"transaction":{"id":10333269,"charge_id":null,"gateway_id":10371,"payment_profile_id":2284520,"customer_id":2481258,"amount":null,"gateway_transaction_id":"a5e1bead-670c-4343-b855-8600cfd284de","gateway_response_code":"","gateway_message":"Transacao - aprovada","status":"success","transaction_type":"verify","created_at":"2017-04-20T09:07:29.442-03:00","updated_at":"2017-04-20T09:07:29.465-03:00","payment_method_id":17293,"import_batch_id":null,"installments":null,"export_batch_id":null,"gateway_authorization":"D3BF453517305CD60C7DA7F5178F9FA4","print_job_id":null,"remote_created_at":null,"gateway_response_fields":{"test_auth":"4018c5f42b81e3cf264f"},"attempt_number":null,"fraud_detector_score":null,"fraud_detector_id":null,"fraud_detector_status":null,"recovery_type":null,"merchant_id":5963}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['802'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 12:07:29 GMT'] - ETag: [W/"149563cb80953d59aef1bf029cc596c5"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492690109'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [74248d84-f8b0-4737-b485-62f17d3952de] - X-Runtime: ['0.083059'] - status: {code: 201, message: Created} -version: 1 diff --git a/resources/cassettes/test_product_create.yaml b/resources/cassettes/test_product_create.yaml deleted file mode 100644 index 30ece00..0000000 --- a/resources/cassettes/test_product_create.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: '{"name": "Product One", "code": "product-one", "status": "active", "pricing_schema": - {"price": 100.0, "schema_type": "flat"}}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['125'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: POST - uri: https://app.vindi.com.br/api/v1/products - response: - body: {string: '{"product":{"id":82534,"name":"Product One","code":"product-one","unit":null,"status":"active","description":null,"invoice":"always","created_at":"2017-04-20T08:27:28.000-03:00","updated_at":"2017-04-20T08:27:28.000-03:00","pricing_schema":{"id":1196727,"short_format":"R$ - 100,00","price":"100.0","minimum_price":null,"schema_type":"flat","pricing_ranges":[],"created_at":"2017-04-20T08:27:28.000-03:00"},"metadata":{}}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['420'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:27:28 GMT'] - ETag: [W/"db4eec832a8b6a04b736dbe3ae08c8f3"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492687708'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [1ec07fe3-2c98-4b8f-910c-98c06b8b648e] - X-Runtime: ['0.063646'] - status: {code: 201, message: Created} -version: 1 diff --git a/resources/cassettes/test_product_list.yaml b/resources/cassettes/test_product_list.yaml deleted file mode 100644 index 5f1dcc6..0000000 --- a/resources/cassettes/test_product_list.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/products - response: - body: {string: '{"products":[{"id":82534,"name":"Product One","code":"product-one","unit":null,"status":"active","description":null,"invoice":"always","created_at":"2017-04-20T08:27:28.000-03:00","updated_at":"2017-04-20T08:27:28.000-03:00","pricing_schema":{"id":1196727,"short_format":"R$ - 100,00","price":"100.0","minimum_price":null,"schema_type":"flat","pricing_ranges":[],"created_at":"2017-04-20T08:27:28.000-03:00"},"metadata":{}}]}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['423'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:30:46 GMT'] - ETag: [W/"26e4e0a1457227481682364da47362a4"] - Per-Page: ['25'] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492687906'] - Server: [nginx] - Total: ['1'] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [5d710ea1-a7d9-453a-b890-2fce3b67b67c] - X-Runtime: ['0.030911'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_product_retrieve.yaml b/resources/cassettes/test_product_retrieve.yaml deleted file mode 100644 index 918b3d0..0000000 --- a/resources/cassettes/test_product_retrieve.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: GET - uri: https://app.vindi.com.br/api/v1/products/82534 - response: - body: {string: '{"product":{"id":82534,"name":"Product One","code":"product-one","unit":null,"status":"active","description":null,"invoice":"always","created_at":"2017-04-20T08:27:28.000-03:00","updated_at":"2017-04-20T08:27:28.000-03:00","pricing_schema":{"id":1196727,"short_format":"R$ - 100,00","price":"100.0","minimum_price":null,"schema_type":"flat","pricing_ranges":[],"created_at":"2017-04-20T08:27:28.000-03:00"},"metadata":{}}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['420'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:31:59 GMT'] - ETag: [W/"db4eec832a8b6a04b736dbe3ae08c8f3"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492687979'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [c5568165-7bfb-4c33-9771-2c2e2b22106e] - X-Runtime: ['0.023803'] - status: {code: 200, message: OK} -version: 1 diff --git a/resources/cassettes/test_product_update.yaml b/resources/cassettes/test_product_update.yaml deleted file mode 100644 index fbeb8cb..0000000 --- a/resources/cassettes/test_product_update.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '{"name": "Product 1", "code": "product-1"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['42'] - Content-Type: [application/json] - User-Agent: [python-requests/2.13.0] - method: PUT - uri: https://app.vindi.com.br/api/v1/products/82534 - response: - body: {string: '{"product":{"id":82534,"name":"Product 1","code":"product-1","unit":null,"status":"active","description":null,"invoice":"always","created_at":"2017-04-20T08:27:28.000-03:00","updated_at":"2017-04-20T08:35:49.000-03:00","pricing_schema":{"id":1196727,"short_format":"R$ - 100,00","price":"100.0","minimum_price":null,"schema_type":"flat","pricing_ranges":[],"created_at":"2017-04-20T08:27:28.000-03:00"},"metadata":{}}}'} - headers: - Cache-Control: ['max-age=0, private, must-revalidate'] - Connection: [keep-alive] - Content-Length: ['416'] - Content-Type: [application/json; charset=UTF-8] - Date: ['Thu, 20 Apr 2017 11:35:49 GMT'] - ETag: [W/"facefacb2ef929428ffe4849c618dfe2"] - Rate-Limit-Limit: ['120'] - Rate-Limit-Remaining: ['119'] - Rate-Limit-Reset: ['1492688209'] - Server: [nginx] - Vindi-Merchant-Id: ['5963'] - X-Request-Id: [c09673fc-ca74-4c7d-93be-5e180b174be5] - X-Runtime: ['0.051080'] - status: {code: 200, message: OK} -version: 1 diff --git a/setup.py b/setup.py index 79316b3..6af1e50 100644 --- a/setup.py +++ b/setup.py @@ -2,42 +2,35 @@ import os import re -from setuptools import setup, find_packages, Command +from setuptools import Command, find_packages, setup here = os.path.abspath(os.path.dirname(__file__)) -version = '0.0.0' -changes = os.path.join(here, 'CHANGES.rst') -match = r'^#*\s*(?P[0-9]+\.[0-9]+(\.[0-9]+)?)$' -with codecs.open(changes, encoding='utf-8') as changes: +version = "0.0.0" +changes = os.path.join(here, "CHANGES.rst") +match = r"^#*\s*(?P[0-9]+\.[0-9]+(\.[0-9]+)?)$" +with codecs.open(changes, encoding="utf-8") as changes: for line in changes: res = re.match(match, line) if res: - version = res.group('version') + version = res.group("version") break # Get the long description -with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: +with codecs.open(os.path.join(here, "README.rst"), encoding="utf-8") as f: long_description = f.read() # Get version -with codecs.open(os.path.join(here, 'CHANGES.rst'), encoding='utf-8') as f: +with codecs.open(os.path.join(here, "CHANGES.rst"), encoding="utf-8") as f: changelog = f.read() -install_requirements = [ - 'simple-rest-client>=0.1.1', -] -tests_requirements = [ - 'pytest', - 'pytest-cov', - 'vcrpy', - 'coveralls', -] +install_requirements = ["simple-rest-client>=1.0.0"] +tests_requirements = ["pytest", "pytest-cov", "coveralls"] class VersionCommand(Command): - description = 'print library version' + description = "print library version" user_options = [] def initialize_options(self): @@ -51,26 +44,24 @@ def run(self): setup( - name='vindi', + name="vindi", version=version, - description='Integração com API da Vindi (Python 3.5+)', + description="Integração com API da Vindi (Python 3.6+)", long_description=long_description, - url='https://github.com/allisson/python-vindi', - author='Allisson Azevedo', - author_email='allisson@gmail.com', + url="https://github.com/allisson/python-vindi", + author="Allisson Azevedo", + author_email="allisson@gmail.com", classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Topic :: Software Development :: Libraries', + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Software Development :: Libraries", ], - keywords='rest client http vindi', - packages=find_packages(exclude=['docs', 'tests*']), - setup_requires=['pytest-runner'], + keywords="rest client http vindi", + packages=find_packages(exclude=["docs", "tests*"]), + setup_requires=["pytest-runner"], install_requires=install_requirements, tests_require=tests_requirements, - cmdclass={ - 'version': VersionCommand, - }, + cmdclass={"version": VersionCommand}, ) diff --git a/tests/conftest.py b/tests/conftest.py index 428d5a9..c3fb5f0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,111 +7,4 @@ @pytest.fixture def api(): - return get_api_instance(token=os.getenv('API_TOKEN', '')) - - -@pytest.fixture -def customer_data(): - return { - 'customer': { - 'id': 2481112, - 'name': 'John Doe', - 'email': 'john@doe.com', - 'registry_code': None, - 'code': None, - 'notes': None, - 'status': 'inactive', - 'created_at': '2017-04-19T13:08:51.795-03:00', - 'updated_at': '2017-04-19T13:08:51.795-03:00', - 'metadata': {}, - 'address': { - 'street': None, - 'number': None, - 'additional_details': None, - 'zipcode': None, - 'neighborhood': None, - 'city': None, - 'state': None, - 'country': None - }, - 'phones': [] - } - } - - -@pytest.fixture -def product_data(): - return { - 'product': { - 'id': 82534, - 'name': 'Product One', - 'code': 'product-one', - 'unit': None, - 'status': 'active', - 'description': None, - 'invoice': 'always', - 'created_at': '2017-04-20T08:27:28.000-03:00', - 'updated_at': '2017-04-20T08:27:28.000-03:00', - 'pricing_schema': { - 'id': 1196727, - 'short_format': 'R$ 100,00', - 'price': '100.0', - 'minimum_price': None, - 'schema_type': 'flat', - 'pricing_ranges': [], - 'created_at': '2017-04-20T08:27:28.000-03:00' - }, - 'metadata': {} - } - } - - -@pytest.fixture -def payment_method_data(): - return { - 'payment_method': { - 'id': 17293 - } - } - - -@pytest.fixture -def payment_profile_data(): - return { - 'id': 2284520, - 'holder_name': 'John Doe', - 'card_expiration': '12/2020', - 'card_number': '5555555555555557', - 'card_cvv': '123', - 'payment_method_code': 'credit_card', - 'payment_company_code': 'mastercard', - 'customer_id': 2481258 - } - - -@pytest.fixture -def bill_data(): - return { - 'id': 7064381, - 'customer_id': 2481258, - 'code': 'my-first-bill', - 'installments': 1, - 'payment_method_code': 'credit_card', - 'bill_items': [{ - 'product_code': 'product-1', - 'amount': 100.00 - }], - 'payment_profile': { - 'id': 2284520 - } - } - - -@pytest.fixture -def charge_data(): - return { - 'id': 6810923, - 'amount': '100.0', - 'status': 'pending', - 'due_at': '2017-04-24T23:59:59.000-03:00', - } + return get_api_instance(token=os.getenv("API_TOKEN", "")) diff --git a/tests/test_api.py b/tests/test_api.py index 25ed2e1..dcfa4aa 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -2,16 +2,18 @@ def test_get_api_instance(): - api = get_api_instance(token='') - assert api.api_root_url == 'https://app.vindi.com.br/api/v1/' - assert api.headers['Authorization'] == 'Basic Og==' - assert api.headers['Content-Type'] == 'application/json' + api = get_api_instance(token="") + assert api.api_root_url == "https://app.vindi.com.br/api/v1/" + assert api.headers["Authorization"] == "Basic Og==" + assert api.headers["Content-Type"] == "application/json" assert api.json_encode_body def test_get_api_instance_with_api_root_url(): - api = get_api_instance(token='', api_root_url='https://sandbox-app.vindi.com.br/api/v1/') - assert api.api_root_url == 'https://sandbox-app.vindi.com.br/api/v1/' - assert api.headers['Authorization'] == 'Basic Og==' - assert api.headers['Content-Type'] == 'application/json' + api = get_api_instance( + token="", api_root_url="https://sandbox-app.vindi.com.br/api/v1/" + ) + assert api.api_root_url == "https://sandbox-app.vindi.com.br/api/v1/" + assert api.headers["Authorization"] == "Basic Og==" + assert api.headers["Content-Type"] == "application/json" assert api.json_encode_body diff --git a/tests/test_api_resources.py b/tests/test_api_resources.py deleted file mode 100644 index afb311d..0000000 --- a/tests/test_api_resources.py +++ /dev/null @@ -1,227 +0,0 @@ -import status - -from tests.vcr import vcr - - -@vcr.use_cassette() -def test_customer_create(api, customer_data): - body = { - 'name': customer_data['customer']['name'], - 'email': customer_data['customer']['email'] - } - response = api.customers.create(body=body) - assert response.status_code == status.HTTP_201_CREATED - assert response.body['customer']['id'] == customer_data['customer']['id'] - - -@vcr.use_cassette() -def test_customer_list(api): - response = api.customers.list() - assert response.status_code == status.HTTP_200_OK - assert 'customers' in response.body - - -@vcr.use_cassette() -def test_customer_retrieve(api, customer_data): - response = api.customers.retrieve(customer_data['customer']['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['customer']['id'] == customer_data['customer']['id'] - - -@vcr.use_cassette() -def test_customer_update(api, customer_data): - body = { - 'name': 'Jane Doe', - 'email': 'jane@doe.com' - } - response = api.customers.update(customer_data['customer']['id'], body=body) - assert response.status_code == status.HTTP_200_OK - assert response.body['customer']['id'] == customer_data['customer']['id'] - assert response.body['customer']['name'] == body['name'] - assert response.body['customer']['email'] == body['email'] - - -@vcr.use_cassette() -def test_customer_destroy(api, customer_data): - response = api.customers.destroy(customer_data['customer']['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['customer']['id'] == customer_data['customer']['id'] - assert response.body['customer']['status'] == 'archived' - - -@vcr.use_cassette() -def test_product_create(api, product_data): - body = { - 'name': product_data['product']['name'], - 'code': product_data['product']['code'], - 'status': product_data['product']['status'], - 'pricing_schema': { - 'price': product_data['product']['pricing_schema']['price'], - 'schema_type': product_data['product']['pricing_schema']['schema_type'], - } - } - response = api.products.create(body=body) - assert response.status_code == status.HTTP_201_CREATED - assert response.body['product']['id'] == product_data['product']['id'] - - -@vcr.use_cassette() -def test_product_list(api): - response = api.products.list() - assert response.status_code == status.HTTP_200_OK - assert 'products' in response.body - - -@vcr.use_cassette() -def test_product_retrieve(api, product_data): - response = api.products.retrieve(product_data['product']['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['product']['id'] == product_data['product']['id'] - - -@vcr.use_cassette() -def test_product_update(api, product_data): - body = { - 'name': 'Product 1', - 'code': 'product-1', - } - response = api.products.update(product_data['product']['id'], body=body) - assert response.status_code == status.HTTP_200_OK - assert response.body['product']['id'] == product_data['product']['id'] - assert response.body['product']['name'] == body['name'] - assert response.body['product']['code'] == body['code'] - - -@vcr.use_cassette() -def test_payment_methods_list(api): - response = api.payment_methods.list() - assert response.status_code == status.HTTP_200_OK - assert 'payment_methods' in response.body - - -@vcr.use_cassette() -def test_payment_methods_retrieve(api, payment_method_data): - response = api.payment_methods.retrieve(payment_method_data['payment_method']['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['payment_method']['id'] == payment_method_data['payment_method']['id'] - - -@vcr.use_cassette() -def test_payment_profiles_create(api, payment_profile_data): - body = payment_profile_data - response = api.payment_profiles.create(body=body) - assert response.status_code == status.HTTP_201_CREATED - assert response.body['payment_profile']['id'] == payment_profile_data['id'] - - -@vcr.use_cassette() -def test_payment_profiles_list(api): - response = api.payment_profiles.list() - assert response.status_code == status.HTTP_200_OK - assert 'payment_profiles' in response.body - - -@vcr.use_cassette() -def test_payment_profiles_retrieve(api, payment_profile_data): - response = api.payment_profiles.retrieve(payment_profile_data['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['payment_profile']['id'] == payment_profile_data['id'] - - -@vcr.use_cassette() -def test_payment_profiles_verify(api, payment_profile_data): - response = api.payment_profiles.verify(payment_profile_data['id']) - assert response.status_code == status.HTTP_201_CREATED - assert 'transaction' in response.body - - -@vcr.use_cassette() -def test_payment_profiles_destroy(api, payment_profile_data): - response = api.payment_profiles.destroy(payment_profile_data['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['payment_profile']['id'] == payment_profile_data['id'] - assert response.body['payment_profile']['status'] == 'inactive' - - -@vcr.use_cassette() -def test_bill_create(api, bill_data): - body = bill_data - response = api.bills.create(body=body) - assert response.status_code == status.HTTP_201_CREATED - assert response.body['bill']['id'] == bill_data['id'] - - -@vcr.use_cassette() -def test_bill_list(api): - response = api.bills.list() - assert response.status_code == status.HTTP_200_OK - assert 'bills' in response.body - - -@vcr.use_cassette() -def test_bill_retrieve(api, bill_data): - response = api.bills.retrieve(bill_data['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['bill']['id'] == bill_data['id'] - - -@vcr.use_cassette() -def test_bill_update(api, bill_data): - body = { - 'code': 'first-bill' - } - response = api.bills.update(bill_data['id'], body=body) - assert response.status_code == status.HTTP_200_OK - assert response.body['bill']['id'] == bill_data['id'] - assert response.body['bill']['code'] == body['code'] - - -@vcr.use_cassette() -def test_bill_destroy(api): - id = 7071692 - response = api.bills.destroy(id) - assert response.status_code == status.HTTP_200_OK - assert response.body['bill']['id'] == id - assert response.body['bill']['status'] == 'canceled' - - -@vcr.use_cassette() -def test_charge_list(api): - response = api.charges.list() - assert response.status_code == status.HTTP_200_OK - assert 'charges' in response.body - - -@vcr.use_cassette() -def test_charge_retrieve(api, charge_data): - response = api.charges.retrieve(charge_data['id']) - assert response.status_code == status.HTTP_200_OK - assert response.body['charge']['id'] == charge_data['id'] - - -@vcr.use_cassette() -def test_charge_update(api, charge_data): - body = { - 'installments': 2 - } - response = api.charges.update(charge_data['id'], body=body) - assert response.status_code == status.HTTP_200_OK - assert response.body['charge']['id'] == charge_data['id'] - assert response.body['charge']['installments'] == body['installments'] - - -@vcr.use_cassette() -def test_charge_destroy(api): - id = 6814889 - response = api.charges.destroy(id) - assert response.status_code == status.HTTP_200_OK - assert response.body['charge']['id'] == id - assert response.body['charge']['status'] == 'canceled' - - -@vcr.use_cassette() -def test_charge_charge(api, charge_data): - response = api.charges.charge(charge_data['id']) - assert response.status_code == status.HTTP_201_CREATED - assert response.body['charge']['id'] == charge_data['id'] - assert response.body['charge']['status'] == 'paid' diff --git a/tests/vcr.py b/tests/vcr.py deleted file mode 100644 index 498647b..0000000 --- a/tests/vcr.py +++ /dev/null @@ -1,10 +0,0 @@ -from vcr import VCR - - -vcr = VCR( - cassette_library_dir='resources/cassettes', - path_transformer=VCR.ensure_suffix('.yaml'), - filter_headers=['authorization'], - record_mode='once', - match_on=['method', 'path', 'query'], -) diff --git a/vindi/api.py b/vindi/api.py index 4a56e49..262d3a7 100644 --- a/vindi/api.py +++ b/vindi/api.py @@ -4,85 +4,63 @@ from vindi import resource -def get_api_instance(token='', api_root_url=None, timeout=3): +def get_api_instance(token="", api_root_url=None, timeout=3): headers = { - 'Authorization': basic_http_auth(token, ''), - 'Content-Type': 'application/json' + "Authorization": basic_http_auth(token, ""), + "Content-Type": "application/json", } import_batches_headers = { - 'Authorization': basic_http_auth(token, ''), - 'Content-Type': 'multipart/form-data' + "Authorization": basic_http_auth(token, ""), + "Content-Type": "multipart/form-data", } - api_root_url = api_root_url or 'https://app.vindi.com.br/api/v1/' + api_root_url = api_root_url or "https://app.vindi.com.br/api/v1/" api = API( - api_root_url=api_root_url, headers=headers, json_encode_body=True, - timeout=timeout + api_root_url=api_root_url, + headers=headers, + json_encode_body=True, + timeout=timeout, ) api.add_resource( - resource_name='customers', resource_class=resource.CustomerResource + resource_name="customers", resource_class=resource.CustomerResource ) + api.add_resource(resource_name="plans", resource_class=resource.PlanResource) + api.add_resource(resource_name="products", resource_class=resource.ProductResource) api.add_resource( - resource_name='plans', resource_class=resource.PlanResource + resource_name="payment_methods", resource_class=resource.PaymentMethodResource ) api.add_resource( - resource_name='products', resource_class=resource.ProductResource + resource_name="discounts", resource_class=resource.DiscountResource ) api.add_resource( - resource_name='payment_methods', - resource_class=resource.PaymentMethodResource + resource_name="subscriptions", resource_class=resource.SubscriptionResource ) api.add_resource( - resource_name='discounts', resource_class=resource.DiscountResource + resource_name="product_items", resource_class=resource.ProductItemResource ) + api.add_resource(resource_name="periods", resource_class=resource.PeriodResource) + api.add_resource(resource_name="bills", resource_class=resource.BillResource) api.add_resource( - resource_name='subscriptions', - resource_class=resource.SubscriptionResource + resource_name="bill_items", resource_class=resource.BillItemResource ) + api.add_resource(resource_name="charges", resource_class=resource.ChargeResource) api.add_resource( - resource_name='product_items', - resource_class=resource.ProductItemResource + resource_name="transactions", resource_class=resource.TransactionResource ) api.add_resource( - resource_name='periods', resource_class=resource.PeriodResource + resource_name="payment_profiles", resource_class=resource.PaymentProfileResource ) + api.add_resource(resource_name="usages", resource_class=resource.UsageResource) + api.add_resource(resource_name="invoices", resource_class=resource.InvoiceResource) api.add_resource( - resource_name='bills', resource_class=resource.BillResource + resource_name="movements", resource_class=resource.MovementResource ) + api.add_resource(resource_name="messages", resource_class=resource.MessageResource) api.add_resource( - resource_name='bill_items', resource_class=resource.BillItemResource - ) - api.add_resource( - resource_name='charges', resource_class=resource.ChargeResource - ) - api.add_resource( - resource_name='transactions', - resource_class=resource.TransactionResource - ) - api.add_resource( - resource_name='payment_profiles', - resource_class=resource.PaymentProfileResource - ) - api.add_resource( - resource_name='usages', resource_class=resource.UsageResource - ) - api.add_resource( - resource_name='invoices', resource_class=resource.InvoiceResource - ) - api.add_resource( - resource_name='movements', resource_class=resource.MovementResource - ) - api.add_resource( - resource_name='messages', resource_class=resource.MessageResource - ) - api.add_resource( - resource_name='import_batches', + resource_name="import_batches", resource_class=resource.ImportBatchResource, - json_encode_body=False, headers=import_batches_headers - ) - api.add_resource( - resource_name='merchant', resource_class=resource.MerchantResource - ) - api.add_resource( - resource_name='issues', resource_class=resource.IssueResource + json_encode_body=False, + headers=import_batches_headers, ) + api.add_resource(resource_name="merchant", resource_class=resource.MerchantResource) + api.add_resource(resource_name="issues", resource_class=resource.IssueResource) return api diff --git a/vindi/resource.py b/vindi/resource.py index 052d119..9df1443 100644 --- a/vindi/resource.py +++ b/vindi/resource.py @@ -3,403 +3,169 @@ class CustomerResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'customers' - }, - 'create': { - 'method': 'POST', - 'url': 'customers' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'customers/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'customers/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'customers/{}', - }, + "list": {"method": "GET", "url": "customers"}, + "create": {"method": "POST", "url": "customers"}, + "retrieve": {"method": "GET", "url": "customers/{}"}, + "update": {"method": "PUT", "url": "customers/{}"}, + "destroy": {"method": "DELETE", "url": "customers/{}"}, } class PlanResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'plans' - }, - 'create': { - 'method': 'POST', - 'url': 'plans' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'plans/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'plans/{}', - } + "list": {"method": "GET", "url": "plans"}, + "create": {"method": "POST", "url": "plans"}, + "retrieve": {"method": "GET", "url": "plans/{}"}, + "update": {"method": "PUT", "url": "plans/{}"}, } class ProductResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'products' - }, - 'create': { - 'method': 'POST', - 'url': 'products' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'products/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'products/{}', - } + "list": {"method": "GET", "url": "products"}, + "create": {"method": "POST", "url": "products"}, + "retrieve": {"method": "GET", "url": "products/{}"}, + "update": {"method": "PUT", "url": "products/{}"}, } class PaymentMethodResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'payment_methods' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'payment_methods/{}', - } + "list": {"method": "GET", "url": "payment_methods"}, + "retrieve": {"method": "GET", "url": "payment_methods/{}"}, } class DiscountResource(Resource): actions = { - 'create': { - 'method': 'POST', - 'url': 'discounts' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'discounts/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'discounts/{}', - }, + "create": {"method": "POST", "url": "discounts"}, + "retrieve": {"method": "GET", "url": "discounts/{}"}, + "destroy": {"method": "DELETE", "url": "discounts/{}"}, } class SubscriptionResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'subscriptions' - }, - 'create': { - 'method': 'POST', - 'url': 'subscriptions' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'subscriptions/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'subscriptions/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'subscriptions/{}', - }, - 'renew': { - 'method': 'POST', - 'url': 'subscriptions/{}/renew', - }, - 'reactivate': { - 'method': 'POST', - 'url': 'subscriptions/{}/reactivate', - }, + "list": {"method": "GET", "url": "subscriptions"}, + "create": {"method": "POST", "url": "subscriptions"}, + "retrieve": {"method": "GET", "url": "subscriptions/{}"}, + "update": {"method": "PUT", "url": "subscriptions/{}"}, + "destroy": {"method": "DELETE", "url": "subscriptions/{}"}, + "renew": {"method": "POST", "url": "subscriptions/{}/renew"}, + "reactivate": {"method": "POST", "url": "subscriptions/{}/reactivate"}, } class ProductItemResource(Resource): actions = { - 'create': { - 'method': 'POST', - 'url': 'product_items' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'product_items/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'product_items/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'product_items/{}', - }, + "create": {"method": "POST", "url": "product_items"}, + "retrieve": {"method": "GET", "url": "product_items/{}"}, + "update": {"method": "PUT", "url": "product_items/{}"}, + "destroy": {"method": "DELETE", "url": "product_items/{}"}, } class PeriodResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'periods' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'periods/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'periods/{}', - }, - 'bill': { - 'method': 'POST', - 'url': 'periods/{}/bill', - }, + "list": {"method": "GET", "url": "periods"}, + "retrieve": {"method": "GET", "url": "periods/{}"}, + "update": {"method": "PUT", "url": "periods/{}"}, + "bill": {"method": "POST", "url": "periods/{}/bill"}, } class BillResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'bills' - }, - 'create': { - 'method': 'POST', - 'url': 'bills' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'bills/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'bills/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'bills/{}', - }, - 'approve': { - 'method': 'POST', - 'url': 'bills/{}/approve', - }, - 'charge': { - 'method': 'POST', - 'url': 'bills/{}/charge', - }, + "list": {"method": "GET", "url": "bills"}, + "create": {"method": "POST", "url": "bills"}, + "retrieve": {"method": "GET", "url": "bills/{}"}, + "update": {"method": "PUT", "url": "bills/{}"}, + "destroy": {"method": "DELETE", "url": "bills/{}"}, + "approve": {"method": "POST", "url": "bills/{}/approve"}, + "charge": {"method": "POST", "url": "bills/{}/charge"}, } class BillItemResource(Resource): - actions = { - 'retrieve': { - 'method': 'GET', - 'url': 'bill_items/{}', - }, - } + actions = {"retrieve": {"method": "GET", "url": "bill_items/{}"}} class ChargeResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'charges' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'charges/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'charges/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'charges/{}', - }, - 'reissue': { - 'method': 'POST', - 'url': 'charges/{}/reissue', - }, - 'charge': { - 'method': 'POST', - 'url': 'charges/{}/charge', - }, - 'refund': { - 'method': 'POST', - 'url': 'charges/{}/refund', - }, - 'fraud_review': { - 'method': 'POST', - 'url': 'charges/{}/fraud_review', - }, + "list": {"method": "GET", "url": "charges"}, + "retrieve": {"method": "GET", "url": "charges/{}"}, + "update": {"method": "PUT", "url": "charges/{}"}, + "destroy": {"method": "DELETE", "url": "charges/{}"}, + "reissue": {"method": "POST", "url": "charges/{}/reissue"}, + "charge": {"method": "POST", "url": "charges/{}/charge"}, + "refund": {"method": "POST", "url": "charges/{}/refund"}, + "fraud_review": {"method": "POST", "url": "charges/{}/fraud_review"}, } class TransactionResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'transactions' - }, - 'create': { - 'method': 'POST', - 'url': 'transactions' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'transactions/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'transactions/{}', - }, + "list": {"method": "GET", "url": "transactions"}, + "create": {"method": "POST", "url": "transactions"}, + "retrieve": {"method": "GET", "url": "transactions/{}"}, + "update": {"method": "PUT", "url": "transactions/{}"}, } class PaymentProfileResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'payment_profiles' - }, - 'create': { - 'method': 'POST', - 'url': 'payment_profiles' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'payment_profiles/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'payment_profiles/{}', - }, - 'verify': { - 'method': 'POST', - 'url': 'payment_profiles/{}/verify', - }, + "list": {"method": "GET", "url": "payment_profiles"}, + "create": {"method": "POST", "url": "payment_profiles"}, + "retrieve": {"method": "GET", "url": "payment_profiles/{}"}, + "destroy": {"method": "DELETE", "url": "payment_profiles/{}"}, + "verify": {"method": "POST", "url": "payment_profiles/{}/verify"}, } class UsageResource(Resource): actions = { - 'create': { - 'method': 'POST', - 'url': 'usages' - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'usages/{}', - }, + "create": {"method": "POST", "url": "usages"}, + "destroy": {"method": "DELETE", "url": "usages/{}"}, } class InvoiceResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'invoices' - }, - 'create': { - 'method': 'POST', - 'url': 'invoices' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'invoices/{}', - }, - 'destroy': { - 'method': 'DELETE', - 'url': 'invoices/{}', - }, - 'retry': { - 'method': 'POST', - 'url': 'invoices/{}/retry', - }, + "list": {"method": "GET", "url": "invoices"}, + "create": {"method": "POST", "url": "invoices"}, + "retrieve": {"method": "GET", "url": "invoices/{}"}, + "destroy": {"method": "DELETE", "url": "invoices/{}"}, + "retry": {"method": "POST", "url": "invoices/{}/retry"}, } class MovementResource(Resource): - actions = { - 'create': { - 'method': 'POST', - 'url': 'movements' - }, - } + actions = {"create": {"method": "POST", "url": "movements"}} class MessageResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'messages' - }, - 'create': { - 'method': 'POST', - 'url': 'messages' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'messages/{}', - }, + "list": {"method": "GET", "url": "messages"}, + "create": {"method": "POST", "url": "messages"}, + "retrieve": {"method": "GET", "url": "messages/{}"}, } class ImportBatchResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'import_batches' - }, - 'create': { - 'method': 'POST', - 'url': 'import_batches' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'import_batches/{}', - }, + "list": {"method": "GET", "url": "import_batches"}, + "create": {"method": "POST", "url": "import_batches"}, + "retrieve": {"method": "GET", "url": "import_batches/{}"}, } class MerchantResource(Resource): - actions = { - 'list': { - 'method': 'GET', - 'url': 'merchant' - }, - } + actions = {"list": {"method": "GET", "url": "merchant"}} class IssueResource(Resource): actions = { - 'list': { - 'method': 'GET', - 'url': 'issues' - }, - 'retrieve': { - 'method': 'GET', - 'url': 'issues/{}', - }, - 'update': { - 'method': 'PUT', - 'url': 'issues/{}', - }, + "list": {"method": "GET", "url": "issues"}, + "retrieve": {"method": "GET", "url": "issues/{}"}, + "update": {"method": "PUT", "url": "issues/{}"}, }