From 3c34eb72f97194c01236e78621d0875b65923180 Mon Sep 17 00:00:00 2001 From: wallee-deployment-user Date: Thu, 11 Jan 2024 09:21:44 +0100 Subject: [PATCH] Release 4.1.0 --- .github/workflows/python-publish.yml | 8 +- LICENSE | 2 +- README.md | 22 +- requirements.txt | 7 +- setup.py | 19 +- test/constants.py | 40 ++ test/test_refund.py | 231 ++++++++++++ test/test_transaction_completion_service.py | 194 ++++++++++ test/test_transaction_iframe_service.py | 40 ++ test/test_transaction_lightbox_service.py | 40 ++ test/test_transaction_payment_page_service.py | 40 ++ test/test_transaction_service.py | 345 ++++++++++++++++++ test/transaction_payment_page_service.py | 55 --- test/transaction_service_test.py | 93 ----- wallee/__init__.py | 2 + wallee/api/__init__.py | 1 + wallee/api/account_service_api.py | 1 + wallee/api/analytics_query_service_api.py | 1 + wallee/api/application_user_service_api.py | 1 + wallee/api/bank_account_service_api.py | 1 + wallee/api/bank_transaction_service_api.py | 1 + wallee/api/card_processing_service_api.py | 1 + wallee/api/charge_attempt_service_api.py | 1 + .../charge_bank_transaction_service_api.py | 1 + ...rge_flow_level_payment_link_service_api.py | 1 + wallee/api/charge_flow_level_service_api.py | 1 + wallee/api/charge_flow_service_api.py | 1 + wallee/api/condition_type_service_api.py | 1 + wallee/api/country_service_api.py | 1 + wallee/api/country_state_service_api.py | 1 + .../api/currency_bank_account_service_api.py | 1 + wallee/api/currency_service_api.py | 1 + wallee/api/customer_address_service_api.py | 1 + wallee/api/customer_comment_service_api.py | 1 + wallee/api/customer_service_api.py | 1 + .../api/debt_collection_case_service_api.py | 1 + ...ebt_collector_configuration_service_api.py | 1 + wallee/api/debt_collector_service_api.py | 1 + wallee/api/delivery_indication_service_api.py | 1 + wallee/api/document_template_service_api.py | 1 + .../api/document_template_type_service_api.py | 1 + ...l_transfer_bank_transaction_service_api.py | 1 + wallee/api/human_user_service_api.py | 1 + wallee/api/installment_payment_service_api.py | 1 + .../installment_payment_slice_service_api.py | 1 + ...nstallment_plan_calculation_service_api.py | 1 + ...tallment_plan_configuration_service_api.py | 1 + ...nt_plan_slice_configuration_service_api.py | 1 + ...l_transfer_bank_transaction_service_api.py | 1 + ...liation_record_invoice_link_service_api.py | 1 + ...voice_reconciliation_record_service_api.py | 1 + .../api/invoice_reimbursement_service_api.py | 1 + .../label_description_group_service_api.py | 1 + wallee/api/label_description_service_api.py | 1 + wallee/api/language_service_api.py | 1 + .../legal_organization_form_service_api.py | 1 + wallee/api/manual_task_service_api.py | 1 + wallee/api/mertic_usage_service_api.py | 1 + ...ent_connector_configuration_service_api.py | 1 + wallee/api/payment_connector_service_api.py | 1 + wallee/api/payment_link_service_api.py | 1 + .../api/payment_method_brand_service_api.py | 1 + ...ayment_method_configuration_service_api.py | 1 + wallee/api/payment_method_service_api.py | 1 + ...ent_processor_configuration_service_api.py | 1 + wallee/api/payment_processor_service_api.py | 1 + wallee/api/payment_terminal_service_api.py | 1 + .../api/payment_terminal_till_service_api.py | 1 + ...erminal_transaction_summary_service_api.py | 1 + wallee/api/payment_web_app_service_api.py | 1 + wallee/api/permission_service_api.py | 1 + .../refund_bank_transaction_service_api.py | 1 + wallee/api/refund_comment_service_api.py | 1 + ...d_recovery_bank_transaction_service_api.py | 1 + wallee/api/refund_service_api.py | 1 + .../shopify_recurring_order_service_api.py | 1 + wallee/api/shopify_subscriber_service_api.py | 1 + ...hopify_subscription_product_service_api.py | 1 + .../api/shopify_subscription_service_api.py | 1 + ...ify_subscription_suspension_service_api.py | 1 + ...hopify_subscription_version_service_api.py | 1 + wallee/api/shopify_transaction_service_api.py | 1 + wallee/api/space_service_api.py | 1 + wallee/api/static_value_service_api.py | 1 + wallee/api/subscriber_service_api.py | 1 + .../api/subscription_affiliate_service_api.py | 1 + wallee/api/subscription_charge_service_api.py | 1 + .../subscription_ledger_entry_service_api.py | 1 + wallee/api/subscription_metric_service_api.py | 1 + .../subscription_metric_usage_service_api.py | 1 + .../subscription_period_bill_service_api.py | 1 + ...ion_product_component_group_service_api.py | 1 + ...scription_product_component_service_api.py | 1 + ...bscription_product_fee_tier_service_api.py | 1 + ...ription_product_metered_fee_service_api.py | 1 + ...cription_product_period_fee_service_api.py | 1 + ...cription_product_retirement_service_api.py | 1 + .../api/subscription_product_service_api.py | 1 + ...scription_product_setup_fee_service_api.py | 1 + ..._product_version_retirement_service_api.py | 1 + ...ubscription_product_version_service_api.py | 1 + wallee/api/subscription_service_api.py | 1 + .../subscription_suspension_service_api.py | 1 + .../api/subscription_version_service_api.py | 1 + wallee/api/token_service_api.py | 104 ++++++ wallee/api/token_version_service_api.py | 1 + wallee/api/transaction_comment_service_api.py | 1 + .../api/transaction_completion_service_api.py | 1 + wallee/api/transaction_iframe_service_api.py | 1 + ...transaction_invoice_comment_service_api.py | 1 + wallee/api/transaction_invoice_service_api.py | 1 + .../api/transaction_lightbox_service_api.py | 1 + ...ansaction_line_item_version_service_api.py | 1 + .../api/transaction_mobile_sdk_service_api.py | 1 + .../transaction_payment_page_service_api.py | 1 + wallee/api/transaction_service_api.py | 1 + .../api/transaction_terminal_service_api.py | 1 + wallee/api/transaction_void_service_api.py | 1 + wallee/api/user_account_role_service_api.py | 1 + wallee/api/user_space_role_service_api.py | 1 + wallee/api/web_app_service_api.py | 1 + wallee/api/webhook_encryption_service_api.py | 147 ++++++++ wallee/api/webhook_listener_service_api.py | 1 + wallee/api/webhook_url_service_api.py | 1 + wallee/api_client.py | 41 ++- wallee/configuration.py | 4 +- wallee/encryption_util.py | 45 +++ wallee/models/__init__.py | 1 + wallee/models/abstract_payment_link_update.py | 4 +- wallee/models/card_authentication_response.py | 6 +- wallee/models/charge_attempt.py | 26 +- wallee/models/payment_connector.py | 28 +- wallee/models/payment_contract.py | 28 +- wallee/models/payment_link.py | 4 +- wallee/models/payment_link_update.py | 4 +- wallee/models/rest_country.py | 88 ++--- .../subscription_component_configuration.py | 80 +++- wallee/models/wallet_type.py | 147 +++++++- .../models/webhook_encryption_public_key.py | 120 ++++++ wallee/rest.py | 5 +- 140 files changed, 1860 insertions(+), 267 deletions(-) create mode 100644 test/constants.py create mode 100644 test/test_refund.py create mode 100644 test/test_transaction_completion_service.py create mode 100644 test/test_transaction_iframe_service.py create mode 100644 test/test_transaction_lightbox_service.py create mode 100644 test/test_transaction_payment_page_service.py create mode 100644 test/test_transaction_service.py delete mode 100644 test/transaction_payment_page_service.py delete mode 100644 test/transaction_service_test.py create mode 100644 wallee/api/webhook_encryption_service_api.py create mode 100644 wallee/encryption_util.py create mode 100644 wallee/models/webhook_encryption_public_key.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d594ebc..9bcf6e1 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,7 +21,7 @@ jobs: test: strategy: matrix: - python-version: [ '3.6', '3.7', '3.8', '3.9' ] + python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ] runs-on: ubuntu-20.04 steps: @@ -33,7 +33,9 @@ jobs: - name: Install dependencies with ${{ matrix.python-version }} run: | + wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py python -m pip install --upgrade pip + pip install -r requirements.txt pip install -r test-requirements.txt python -m pip install build --user @@ -53,10 +55,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.8' + python-version: '3.12' - name: Install dependencies with ${{ matrix.python-version }} run: | + wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py python -m pip install --upgrade pip + pip install -r requirements.txt pip install -r test-requirements.txt python -m pip install build --user diff --git a/LICENSE b/LICENSE index 9debc6c..ac38c25 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 wallee AG + Copyright 2024 wallee AG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 6097eba..c0a91d6 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,40 @@ [![Build Status](https://travis-ci.org/wallee-payment/python-sdk.svg?branch=master)](https://travis-ci.org/wallee-payment/python-sdk) -# wallee Python Library +# wallee Python SDK -The wallee Python library wraps around the wallee API. This library facilitates your interaction with various services such as transactions, accounts, and subscriptions. +Python SDK to access wallee web services API. -## Documentation +Library facilitates your interaction with various services such as transactions, accounts, and subscriptions. + +## API documentation [wallee Web Service API](https://app-wallee.com/doc/api/web-service) ## Requirements -- Python 3.5+ +- Python 3.7+ ## Installation -### pip install (recommended) +### pip3 install (recommended) ```sh -pip install --upgrade wallee +pip3 install --upgrade wallee ``` -### pip install from source via github +### pip3 install from source via github ```sh -pip install git+http://github.com/wallee-payment/python-sdk.git +pip3 install git+http://github.com/wallee-payment/python-sdk.git ``` -(you may need to run `pip` with root permission: `sudo pip install git+http://github.com/wallee-payment/python-sdk.git` ) +(you may need to run `pip3` with root permission: `sudo pip3 install git+http://github.com/wallee-payment/python-sdk.git` ) ### install from source via Setuptools Install via [Setuptools](http://pypi.python.org/pypi/setuptools). ```sh +pip3 install setuptools + python setup.py install ``` (or `sudo python setup.py install` to install the package for all users) diff --git a/requirements.txt b/requirements.txt index bafdc07..67cf8ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ certifi >= 14.05.14 six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.15.1 +python_dateutil >= 2.8.2 +setuptools >= 68.0.0 +urllib3 >= 2.0.7 +cryptography >= 2.0 diff --git a/setup.py b/setup.py index 7745baf..e427e80 100644 --- a/setup.py +++ b/setup.py @@ -6,13 +6,15 @@ long_description = fh.read() NAME = "wallee" -VERSION = "4.0.0" +VERSION = "4.1.0" REQUIRES = [ - "certifi>=2017.4.17", - "python-dateutil>=2.1", - "six>=1.10", - "urllib3>=1.23" + "certifi >= 14.05.14", + "six >= 1.10", + "python_dateutil >= 2.8.2", + "setuptools >= 68.0.0", + "urllib3 >= 2.0.7", + "cryptography >= 2.0" ] @@ -35,12 +37,7 @@ 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', 'Topic :: Office/Business :: Financial :: Point-Of-Sale', ], - python_requires='>=3.5', + python_requires='>=3.7', ) diff --git a/test/constants.py b/test/constants.py new file mode 100644 index 0000000..163fa67 --- /dev/null +++ b/test/constants.py @@ -0,0 +1,40 @@ +from wallee import Configuration + +from wallee.models import ( + LineItem, + LineItemType, + TransactionCreate, + AuthenticatedCardDataCreate, +) + +API_CONFIG = Configuration( + user_id=512, + api_secret="FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=", + request_timeout=30, +) + +SPACE_ID = 405 + +def get_transaction_create(): + return TransactionCreate( + line_items=[ + LineItem( + name="Blue T-Shirt", + unique_id="5412", + sku="blue-t-shirt-123", + quantity=1, + amount_including_tax=3.50, + type=LineItemType.PRODUCT, + ) + ], + auto_confirmation_enabled=True, + currency="CHF", + ) + + +FAKE_CARD_DATA = AuthenticatedCardDataCreate( + primary_account_number="4111111111111111", expiry_date="2026-12" +) + +TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID = 1352 +TEST_CUSTOMER_ID = 7311742 diff --git a/test/test_refund.py b/test/test_refund.py new file mode 100644 index 0000000..3f45ff7 --- /dev/null +++ b/test/test_refund.py @@ -0,0 +1,231 @@ +import unittest + +from constants import ( + API_CONFIG, + SPACE_ID, + TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + FAKE_CARD_DATA, + get_transaction_create +) + +from wallee.api import ( + TransactionServiceApi, + CardProcessingServiceApi, + TransactionCompletionServiceApi, + RefundServiceApi +) + +from wallee.models import ( + TransactionCompletionState, + RefundCreate, + RefundType, + RefundState, + EntityQuery, + EntityQueryFilter, + EntityQueryFilterType, + CriteriaOperator +) + + +class RefundServiceTest(unittest.TestCase): + """RefundServiceApi tests""" + + def setUp(self): + self.transaction_service = TransactionServiceApi(API_CONFIG) + self.transaction_completion_service = TransactionCompletionServiceApi( + API_CONFIG) + self.card_processing_service = CardProcessingServiceApi(API_CONFIG) + self.refund_service = RefundServiceApi(API_CONFIG) + + def tearDown(self): + pass + + def __get_refund_create(self, transaction): + refund_create = RefundCreate( + external_id=str(transaction.id), + type=RefundType.MERCHANT_INITIATED_ONLINE, + amount=transaction.authorization_amount, + transaction=transaction.id, + merchant_reference=transaction.merchant_reference + ) + return refund_create + + def test_refund(self): + """refund() should create a refund for transaction""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + transaction_completion = self.transaction_completion_service.complete_offline( + space_id=SPACE_ID, id=transaction_processed.id) + + self.assertEqual( + TransactionCompletionState.SUCCESSFUL, + transaction_completion.state, + "State must be SUCCESSFUL", + ) + + transaction_read = self.transaction_service.read( + space_id=SPACE_ID, id=transaction_processed.id) + + refund = self.refund_service.refund( + space_id=SPACE_ID, refund=self.__get_refund_create(transaction_read)) + + self.assertEqual( + RefundState.SUCCESSFUL, + refund.state, + "State must be SUCCESSFUL", + ) + + def test_read(self): + """read() should should fetch refund details""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + transaction_completion = self.transaction_completion_service.complete_offline( + space_id=SPACE_ID, id=transaction_processed.id) + + self.assertEqual( + TransactionCompletionState.SUCCESSFUL, + transaction_completion.state, + "State must be SUCCESSFUL", + ) + + transaction_read = self.transaction_service.read( + space_id=SPACE_ID, id=transaction_processed.id) + + refund = self.refund_service.refund( + space_id=SPACE_ID, refund=self.__get_refund_create(transaction_read)) + + self.assertEqual( + RefundState.SUCCESSFUL, + refund.state, + "State must be SUCCESSFUL", + ) + + read_refund = self.refund_service.read( + space_id=SPACE_ID, id=refund.id) + + self.assertEqual( + refund.id, + read_refund.id, + "Refund ids must match", + ) + + def test_search(self): + """search() should find a refund for a given criteria""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + transaction_completion = self.transaction_completion_service.complete_offline( + space_id=SPACE_ID, id=transaction_processed.id) + + self.assertEqual( + TransactionCompletionState.SUCCESSFUL, + transaction_completion.state, + "State must be SUCCESSFUL", + ) + + transaction_read = self.transaction_service.read( + space_id=SPACE_ID, id=transaction_processed.id) + + refund = self.refund_service.refund( + space_id=SPACE_ID, refund=self.__get_refund_create(transaction_read)) + + self.assertEqual( + RefundState.SUCCESSFUL, + refund.state, + "State must be SUCCESSFUL", + ) + + criteria = EntityQuery( + filter=EntityQueryFilter( + field_name="id", + value=transaction_completion.id, + type=EntityQueryFilterType.LEAF, + operator=CriteriaOperator.EQUALS + ) + ) + + refunds_found = self.refund_service.search( + SPACE_ID, query=criteria) + + for ref in refunds_found: + self.assertEqual( + refund.id, + ref.id, + "Refund ids must match", + ) + + def test_count(self): + """count() should count refunds for a given criteria""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + transaction_completion = self.transaction_completion_service.complete_offline( + space_id=SPACE_ID, id=transaction_processed.id) + + self.assertEqual( + TransactionCompletionState.SUCCESSFUL, + transaction_completion.state, + "State must be SUCCESSFUL", + ) + + transaction_read = self.transaction_service.read( + space_id=SPACE_ID, id=transaction_processed.id) + + refund = self.refund_service.refund( + space_id=SPACE_ID, refund=self.__get_refund_create(transaction_read)) + + self.assertEqual( + RefundState.SUCCESSFUL, + refund.state, + "State must be SUCCESSFUL", + ) + + criteria = EntityQueryFilter( + field_name="id", + value=refund.id, + type=EntityQueryFilterType.LEAF, + operator=CriteriaOperator.EQUALS + ) + + count = self.refund_service.count( + SPACE_ID, filter=criteria) + + self.assertEqual(1, count, "Should find 1 refund", ) + + +if __name__ == "__main__": + unittest.main(failfast=True) diff --git a/test/test_transaction_completion_service.py b/test/test_transaction_completion_service.py new file mode 100644 index 0000000..11f9c1f --- /dev/null +++ b/test/test_transaction_completion_service.py @@ -0,0 +1,194 @@ +import unittest + +from constants import ( + API_CONFIG, + SPACE_ID, + get_transaction_create, + TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + FAKE_CARD_DATA +) + +from wallee.api import ( + TransactionServiceApi, + CardProcessingServiceApi, + TransactionCompletionServiceApi, +) + +from wallee.models import ( + TokenizationMode, + TransactionCompletionBehavior, + CustomersPresence, + EntityQueryFilter, + EntityQueryFilterType, + CriteriaOperator, + EntityQuery, + TransactionState, + TransactionCompletionState +) + +class TransactionCompletionServiceTest(unittest.TestCase): + """TransactionCompletionServiceApi tests""" + + def setUp(self): + self.transaction_service = TransactionServiceApi(API_CONFIG) + self.transaction_completion_service = TransactionCompletionServiceApi( + API_CONFIG) + self.card_processing_service = CardProcessingServiceApi(API_CONFIG) + + def tearDown(self): + pass + + def __get_deferred_transaction_create(self): + transaction_create = get_transaction_create() + transaction_create.tokenization_mode = TokenizationMode.FORCE_CREATION + transaction_create.customers_presence = CustomersPresence.NOT_PRESENT + transaction_create.completion_behavior = TransactionCompletionBehavior.COMPLETE_DEFERRED + return transaction_create + + def test_complete_offline(self): + """complete_offline() should complete transaction offline (completion is NOT forwarded to processor)""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=self.__get_deferred_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + self.assertEqual( + TransactionState.AUTHORIZED, + transaction_processed.state, + "State must be AUTHORIZED", + ) + + transaction_completion = self.transaction_completion_service.complete_offline( + space_id=SPACE_ID, id=transaction_processed.id) + + self.assertEqual( + TransactionCompletionState.SUCCESSFUL, + transaction_completion.state, + "State must be SUCCESSFUL", + ) + + def test_complete_online(self): + """complete_online() should complete transaction online (completion is forwarded to processor)""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=self.__get_deferred_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + self.assertEqual( + TransactionState.AUTHORIZED, + transaction_processed.state, + "State must be AUTHORIZED", + ) + + transaction_completion = self.transaction_completion_service.complete_online( + space_id=SPACE_ID, id=transaction_processed.id) + + self.assertEqual( + TransactionCompletionState.SUCCESSFUL, + transaction_completion.state, + "State must be SUCCESSFUL", + ) + + def test_read(self): + """read() should read details of transaction completion by id""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=self.__get_deferred_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + self.assertEqual( + TransactionState.AUTHORIZED, + transaction_processed.state, + "State must be AUTHORIZED", + ) + + transaction_completion = self.transaction_completion_service.complete_online( + space_id=SPACE_ID, id=transaction_processed.id) + + transaction_read = self.transaction_completion_service.read( + space_id=SPACE_ID, id=transaction_completion.id) + + self.assertEqual(transaction_completion.id, + transaction_read.id, "Transaction ids must match", ) + + def test_count(self): + """count() should count transaction completions based on provided criteria""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=self.__get_deferred_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + transaction_completion = self.transaction_completion_service.complete_online( + space_id=SPACE_ID, id=transaction_processed.id) + + criteria = EntityQueryFilter( + field_name="id", + value=transaction_completion.id, + type=EntityQueryFilterType.LEAF, + operator=CriteriaOperator.EQUALS + ) + + count = self.transaction_completion_service.count( + space_id=SPACE_ID, filter=criteria) + + self.assertEqual(1, count, "Count of completions should be 1", ) + + def test_search(self): + """search() should find transaction completions based on provided criteria""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=self.__get_deferred_transaction_create()) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + transaction_completion = self.transaction_completion_service.complete_online( + space_id=SPACE_ID, id=transaction_processed.id) + + criteria = EntityQuery( + filter=EntityQueryFilter( + field_name="id", + value=transaction_completion.id, + type=EntityQueryFilterType.LEAF, + operator=CriteriaOperator.EQUALS + ) + ) + + found_completions = self.transaction_completion_service.search( + space_id=SPACE_ID, query=criteria) + + for compl in found_completions: + self.assertEqual(transaction_completion.id, + compl.id, "Completion id should match") + + +if __name__ == "__main__": + unittest.main(failfast=True) diff --git a/test/test_transaction_iframe_service.py b/test/test_transaction_iframe_service.py new file mode 100644 index 0000000..027ee32 --- /dev/null +++ b/test/test_transaction_iframe_service.py @@ -0,0 +1,40 @@ +import unittest + +from constants import ( + API_CONFIG, + SPACE_ID, + get_transaction_create, +) + +from wallee.api import ( + TransactionServiceApi, + TransactionIframeServiceApi, +) + + +class TransactionIframeServiceTest(unittest.TestCase): + """TransactionIframeServiceApi tests""" + + def setUp(self): + self.transaction_service = TransactionServiceApi(API_CONFIG) + self.transaction_iframe_service = TransactionIframeServiceApi( + API_CONFIG) + + def tearDown(self): + pass + + def test_javascript_url(self): + """javascript_url() should create URL for use in Iframe checkout flow javascript""" + + transaction_create = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + url = self.transaction_iframe_service.javascript_url( + space_id=SPACE_ID, id=transaction_create.id) + + self.assertTrue("securityToken" in url, + "URL must have proper format") + + +if __name__ == '__main__': + unittest.main(failfast=True) diff --git a/test/test_transaction_lightbox_service.py b/test/test_transaction_lightbox_service.py new file mode 100644 index 0000000..19bb2d9 --- /dev/null +++ b/test/test_transaction_lightbox_service.py @@ -0,0 +1,40 @@ +import unittest + +from constants import ( + API_CONFIG, + SPACE_ID, + get_transaction_create, +) + +from wallee.api import ( + TransactionServiceApi, + TransactionLightboxServiceApi +) + + +class TransactionLigthboxServiceTest(unittest.TestCase): + """TransactionLigthboxServiceApi tests""" + + def setUp(self): + self.transaction_service = TransactionServiceApi(API_CONFIG) + self.transaction_lightbox_service = TransactionLightboxServiceApi( + API_CONFIG) + + def tearDown(self): + pass + + def test_javascript_url(self): + """javascript_url() should create URL for use in Lightbox checkout flow javascript""" + + transaction_create = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + url = self.transaction_lightbox_service.javascript_url( + space_id=SPACE_ID, id=transaction_create.id) + + self.assertTrue("securityToken" in url, + "URL must have proper format") + + +if __name__ == '__main__': + unittest.main(failfast=True) diff --git a/test/test_transaction_payment_page_service.py b/test/test_transaction_payment_page_service.py new file mode 100644 index 0000000..ddf4eb3 --- /dev/null +++ b/test/test_transaction_payment_page_service.py @@ -0,0 +1,40 @@ +import unittest + +from constants import ( + API_CONFIG, + SPACE_ID, + get_transaction_create, +) + +from wallee.api import ( + TransactionServiceApi, + TransactionPaymentPageServiceApi +) + + +class TransactionPaymentPageServiceTest(unittest.TestCase): + """TransactionPaymentPageServiceApi tests""" + + def setUp(self): + self.transaction_service = TransactionServiceApi(API_CONFIG) + self.transaction_payment_page_service = TransactionPaymentPageServiceApi( + API_CONFIG) + + def tearDown(self): + pass + + def test_payment_page_url(self): + """payment_page_url() should create payment page URL""" + + transaction_create = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + url = self.transaction_payment_page_service.payment_page_url( + space_id=SPACE_ID, id=transaction_create.id) + + self.assertTrue("securityToken" in url, + "URL must have proper format") + + +if __name__ == '__main__': + unittest.main(failfast=True) diff --git a/test/test_transaction_service.py b/test/test_transaction_service.py new file mode 100644 index 0000000..39fe62a --- /dev/null +++ b/test/test_transaction_service.py @@ -0,0 +1,345 @@ +import unittest + +from constants import ( + API_CONFIG, + SPACE_ID, + get_transaction_create, + FAKE_CARD_DATA, + TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + TEST_CUSTOMER_ID, +) + +from wallee.api import ( + TransactionServiceApi, + CardProcessingServiceApi, + TokenServiceApi, + TransactionCompletionServiceApi, +) +from wallee.models import ( + TransactionState, + EntityQuery, + EntityQueryFilter, + EntityQueryFilterType, + CriteriaOperator, + TokenizationMode, + TransactionCompletionBehavior, + CustomersPresence, + TransactionCompletionState, +) +from wallee.rest import ApiException + + +class TransactionServiceTest(unittest.TestCase): + """TransactionServiceApi tests""" + + def setUp(self): + self.transaction_service = TransactionServiceApi(API_CONFIG) + self.transaction_completion_service = TransactionCompletionServiceApi( + API_CONFIG) + self.card_processing_service = CardProcessingServiceApi(API_CONFIG) + self.token_service = TokenServiceApi(API_CONFIG) + + def tearDown(self): + pass + + def test_create(self): + """create() should create transaction""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + self.assertEqual( + TransactionState.PENDING, transaction.state, "State must be PENDING" + ) + + def test_confirm(self): + """confirm() should mark transaction as confirmed""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_confirmed = self.transaction_service.confirm( + space_id=SPACE_ID, transaction_model=transaction) + + self.assertEqual( + TransactionState.CONFIRMED, + transaction_confirmed.state, + "State must be CONFIRMED", + ) + + def test_create_complete_deferred(self): + """create() with COMPLETE_DEFERRED transaction behaviour should make transaction Authorized when we pay with card details""" + + transaction_create = get_transaction_create() + transaction_create.tokenization_mode = TokenizationMode.FORCE_CREATION + transaction_create.customers_presence = CustomersPresence.NOT_PRESENT + transaction_create.completion_behavior = TransactionCompletionBehavior.COMPLETE_DEFERRED + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=transaction_create) + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + self.assertEqual( + TransactionState.AUTHORIZED, + transaction_processed.state, + "State must be AUTHORIZED", + ) + + def test_create_complete_immediately(self): + """create() with COMPLETE_IMMEDIATELY transaction behaviour should make transaction Fulfilled when we pay with card details""" + + transaction_create = get_transaction_create() + transaction_create.tokenization_mode = TokenizationMode.FORCE_CREATION + transaction_create.customers_presence = CustomersPresence.NOT_PRESENT + transaction_create.completion_behavior = TransactionCompletionBehavior.COMPLETE_IMMEDIATELY + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=transaction_create) + + transaction_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + self.assertEqual(TransactionState.FULFILL, + transaction_processed.state, "State must be FULFILL", ) + + def test_count(self): + """count() should count transactions matching given criteria""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + entity_query_filter = EntityQueryFilter( + field_name="id", + value=transaction.id, + type=EntityQueryFilterType.LEAF, + operator=CriteriaOperator.EQUALS, + ) + + transaction_count = self.transaction_service.count( + space_id=SPACE_ID, filter=entity_query_filter) + + self.assertEqual(1, transaction_count, "Transaction count should be 1") + + def test_create_transaction_credentials(self): + """create_transaction_credentials() should create valid transaction credentials token""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + creds = self.transaction_service.create_transaction_credentials( + space_id=SPACE_ID, id=transaction.id) + + self.assertTrue(creds.startswith(str(SPACE_ID)), + "Transaction credentials token should have valid format", ) + + def test_fetch_payment_methods(self): + """fetch_payment_methods() should fetch payment methods available for the transaction""" + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + payment_methods = self.transaction_service.fetch_payment_methods( + space_id=SPACE_ID, + id=transaction.id, + integration_mode="payment_page", + ) + + self.assertTrue(len(payment_methods) > 0, + "Payment methods should be configured for a given transaction in test space", ) + + def test_read(self): + """read() should read transaction details""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_read = self.transaction_service.read( + space_id=SPACE_ID, id=transaction.id) + + self.assertEqual(transaction.id, transaction_read.id, + "Transaction ids should match") + + self.assertEqual(TransactionState.PENDING, + transaction_read.state, "State must be PENDING") + + def test_read_with_credentials_for_bad_creds(self): + """read_with_credentials() should fail when credentials are bad""" + + try: + self.transaction_service.read_with_credentials( + credentials="invalid_token") + except ApiException as ex: + self.assertEqual( + 442, + ex.status, + "Bad token should produce 442 Unprocessable content HTTP status response", + ) + + def test_read_with_credentials(self): + """read_with_credentials() should read transaction when valid credentials token is provided""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + creds = self.transaction_service.create_transaction_credentials( + space_id=SPACE_ID, id=transaction.id) + + transaction_read = self.transaction_service.read_with_credentials( + credentials=creds) + + self.assertEqual(transaction.id, transaction_read.id, + "Transaction ids should match") + + def test_search(self): + """search() should find transaction by id""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + entity_query_filter = EntityQueryFilter( + field_name="id", + value=transaction.id, + type=EntityQueryFilterType.LEAF, + operator=CriteriaOperator.EQUALS, + ) + entity_query = EntityQuery(filter=entity_query_filter) + + transactions = self.transaction_service.search( + space_id=SPACE_ID, query=entity_query) + + self.assertEqual(1, len(transactions)) + for transaction_found in transactions: + self.assertEqual(transaction.id, transaction_found.id) + + def test_update(self): + """update() should successfully update existing transaction""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + transaction.language = "en-US" + transaction_update = self.transaction_service.update( + space_id=SPACE_ID, entity=transaction) + self.assertEqual("en-US", transaction_update.language) + + def test_process_without_user_interaction(self): + """process_without_user_interaction() should correctly process created transaction without need for user interaction""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + transaction_processed = self.transaction_service.process_without_user_interaction( + space_id=SPACE_ID, id=transaction.id) + + self.assertEqual( + transaction.id, transaction_processed.id, "Transaction ids mush match" + ) + + def test_fetch_one_click_tokens_with_credentials_no_tokens(self): + """fetch_one_click_tokens_with_credentials() should return one-click payment tokens (if any) for provided transaction""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + creds = self.transaction_service.create_transaction_credentials( + space_id=SPACE_ID, id=transaction.id) + + tokens = self.transaction_service.fetch_one_click_tokens_with_credentials( + creds) + + self.assertEqual(0, len(tokens), "Should be no tokens yet") + + def test_fetch_payment_methods_with_credentials(self): + """fetch_one_click_tokens_with_credentials() should return one-click payment tokens (if any) for provided transaction""" + + transaction = self.transaction_service.create( + space_id=SPACE_ID, transaction=get_transaction_create()) + + creds = self.transaction_service.create_transaction_credentials( + space_id=SPACE_ID, id=transaction.id) + + methods = self.transaction_service.fetch_payment_methods_with_credentials( + credentials=creds, integration_mode="payment_page") + + self.assertTrue(len(methods) > 0, + "Should have some payment methods set up") + + def test_process_one_click_token_and_redirect_with_credentials(self): + """process_one_click_token_and_redirect_with_credentials() should create URL that can be used to authorize 2nd transaction after we have created token for 1st authorized transaction""" + + transaction1_create = get_transaction_create() + transaction1_create.tokenization_mode = TokenizationMode.FORCE_CREATION_WITH_ONE_CLICK_PAYMENT + + transaction1_create.customers_presence = CustomersPresence.NOT_PRESENT + transaction1_create.completion_behavior = TransactionCompletionBehavior.COMPLETE_DEFERRED + + transaction1_create.customer_id = TEST_CUSTOMER_ID + + transaction1 = self.transaction_service.create( + space_id=SPACE_ID, transaction=transaction1_create) + + transaction1_processed = self.card_processing_service.process( + space_id=SPACE_ID, + transaction_id=transaction1.id, + payment_method_configuration_id=TEST_CARD_PAYMENT_METHOD_CONFIGURATION_ID, + card_data=FAKE_CARD_DATA, + ) + + token = self.token_service.create_token( + space_id=SPACE_ID, transaction_id=transaction1_processed.id) + token.enabled_for_one_click_payment = True + updated_token = self.token_service.update( + space_id=SPACE_ID, entity=token + ) + + transaction2_create = get_transaction_create() + transaction2_create.tokenization_mode = TokenizationMode.FORCE_CREATION_WITH_ONE_CLICK_PAYMENT + transaction2_create.customers_presence = CustomersPresence.NOT_PRESENT + transaction2_create.completion_behavior = TransactionCompletionBehavior.COMPLETE_DEFERRED + transaction2_create.customer_id = TEST_CUSTOMER_ID + + transaction2 = self.transaction_service.create( + space_id=SPACE_ID, transaction=transaction2_create) + creds2 = self.transaction_service.create_transaction_credentials( + space_id=SPACE_ID, id=transaction2.id) + payment_url2 = self.transaction_service.process_one_click_token_and_redirect_with_credentials( + credentials=creds2, token_id=updated_token.id) + + self.assertTrue("securityToken" in payment_url2, + "URL must be of a proper format") + + transaction2_read = self.transaction_service.read( + space_id=SPACE_ID, id=transaction2.id) + + self.assertEqual( + TransactionState.AUTHORIZED, + transaction2_read.state, + "State must be AUTHORIZED", + ) + + # cleanup - 2nd transaction + transaction2_completed = self.transaction_completion_service.complete_online( + space_id=SPACE_ID, id=transaction2.id) + + self.assertEqual(TransactionCompletionState.SUCCESSFUL, + transaction2_completed.state, "State must be SUCCESSFUL", ) + + # cleanup - 1st transaction + transaction1_completed = self.transaction_completion_service.complete_online( + space_id=SPACE_ID, id=transaction1.id) + + self.assertEqual(TransactionCompletionState.SUCCESSFUL, + transaction1_completed.state, "State must be SUCCESSFUL", ) + + self.token_service.delete(SPACE_ID, token.id) + + +if __name__ == "__main__": + unittest.main(failfast=True) diff --git a/test/transaction_payment_page_service.py b/test/transaction_payment_page_service.py deleted file mode 100644 index 9909b1e..0000000 --- a/test/transaction_payment_page_service.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import - -import unittest - -from wallee import Configuration -from wallee.api import TransactionServiceApi, TransactionPaymentPageServiceApi -from wallee.models import LineItem, LineItemType, TransactionCreate - - -class TransactionPaymentPageServiceTest(unittest.TestCase): - """TransactionPaymentPageService unit test stubs""" - - def setUp(self): - self.space_id = 405 - config = Configuration( - user_id=512, - api_secret='FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=', - default_headers={'x-meta-custom-header': 'value-1', 'x-meta-custom-header-2': 'value-2'}, - # set a custom request timeout if needed. (If not set, then the default value is: 25 seconds) - request_timeout=30 - ) - - self.transaction_service = TransactionServiceApi(configuration=config) - self.transaction_payment_page_service = TransactionPaymentPageServiceApi(configuration=config) - - # create line item - self.line_item = LineItem( - name='Red T-Shirt', - unique_id='5412', - sku='red-t-shirt-123', - quantity=1, - amount_including_tax=3.50, - type=LineItemType.PRODUCT - ) - - # create transaction model - self.transaction = TransactionCreate( - line_items=[self.line_item], - auto_confirmation_enabled=True, - currency='EUR', - ) - - def tearDown(self): - pass - - def test_payment_page_url(self): - """Test case for count""" - transaction_create = self.transaction_service.create(space_id=self.space_id, transaction=self.transaction) - payment_page_url = self.transaction_payment_page_service.payment_page_url(space_id=self.space_id, id=transaction_create.id) - self.assertRegex(payment_page_url, "http") - -if __name__ == '__main__': - unittest.main(failfast=True) diff --git a/test/transaction_service_test.py b/test/transaction_service_test.py deleted file mode 100644 index fc928c0..0000000 --- a/test/transaction_service_test.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import - -import unittest - -from wallee import Configuration -from wallee.api import TransactionServiceApi -from wallee.models import LineItem, LineItemType, TransactionCreate, TransactionState, EntityQuery, \ - EntityQueryFilter, EntityQueryFilterType, CriteriaOperator - - -class TransactionServiceTest(unittest.TestCase): - """TransactionServiceApi unit test stubs""" - - def setUp(self): - self.space_id = 405 - self.transaction_service = TransactionServiceApi(configuration=Configuration( - user_id=512, - api_secret='FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=', - # set a custom request timeout if needed. (If not set, then the default value is: 25 seconds) - request_timeout=30 - )) - - # create line item - self.line_item = LineItem( - name='Red T-Shirt', - unique_id='5412', - sku='red-t-shirt-123', - quantity=1, - amount_including_tax=3.50, - type=LineItemType.PRODUCT - ) - - # create transaction model - self.transaction = TransactionCreate( - line_items=[self.line_item], - auto_confirmation_enabled=True, - currency='EUR', - ) - - def tearDown(self): - pass - - def test_count(self): - """Test case for count""" - transaction_create = self.transaction_service.create(space_id=self.space_id, transaction=self.transaction) - entity_query_filter = EntityQueryFilter( - field_name='id', - value=transaction_create.id, - type=EntityQueryFilterType.LEAF, - operator=CriteriaOperator.EQUALS - ) - transaction_count = self.transaction_service.count(space_id=self.space_id, filter=entity_query_filter) - self.assertEqual(transaction_count, 1) - - def test_create(self): - """Test case for create""" - # send transaction to our API - transaction_create = self.transaction_service.create(space_id=self.space_id, transaction=self.transaction) - self.assertIsInstance(transaction_create.state, TransactionState) - - def test_read(self): - """Test case for read""" - transaction_create = self.transaction_service.create(space_id=self.space_id, transaction=self.transaction) - transaction_read = self.transaction_service.read(space_id=self.space_id, id=transaction_create.id) - self.assertIsInstance(transaction_read.state, TransactionState) - - def test_search(self): - """Test case for search""" - transaction_create = self.transaction_service.create(space_id=self.space_id, transaction=self.transaction) - entity_query_filter = EntityQueryFilter( - field_name='id', - value=transaction_create.id, - type=EntityQueryFilterType.LEAF, - operator=CriteriaOperator.EQUALS - ) - entity_query = EntityQuery(filter=entity_query_filter) - transaction_search = self.transaction_service.search(space_id=self.space_id, query=entity_query) - self.assertEqual(len(transaction_search), 1) - for transaction in transaction_search: - self.assertIsInstance(transaction.state, TransactionState) - - def test_update(self): - """Test case for update""" - transaction_create = self.transaction_service.create(space_id=self.space_id, transaction=self.transaction) - transaction_create.language = 'en-US' - transaction_update = self.transaction_service.update(space_id=self.space_id, entity=transaction_create) - self.assertEqual(transaction_update.language, 'en-US') - - -if __name__ == '__main__': - unittest.main(failfast=True) diff --git a/wallee/__init__.py b/wallee/__init__.py index ef3dc40..7286fe6 100644 --- a/wallee/__init__.py +++ b/wallee/__init__.py @@ -107,6 +107,7 @@ from wallee.api.user_account_role_service_api import UserAccountRoleServiceApi from wallee.api.user_space_role_service_api import UserSpaceRoleServiceApi from wallee.api.web_app_service_api import WebAppServiceApi +from wallee.api.webhook_encryption_service_api import WebhookEncryptionServiceApi from wallee.api.webhook_listener_service_api import WebhookListenerServiceApi from wallee.api.webhook_url_service_api import WebhookUrlServiceApi @@ -478,6 +479,7 @@ from wallee.models.wallet_type import WalletType from wallee.models.web_app_confirmation_request import WebAppConfirmationRequest from wallee.models.web_app_confirmation_response import WebAppConfirmationResponse +from wallee.models.webhook_encryption_public_key import WebhookEncryptionPublicKey from wallee.models.webhook_identity import WebhookIdentity from wallee.models.webhook_listener import WebhookListener from wallee.models.webhook_listener_entity import WebhookListenerEntity diff --git a/wallee/api/__init__.py b/wallee/api/__init__.py index e491194..dca44bb 100644 --- a/wallee/api/__init__.py +++ b/wallee/api/__init__.py @@ -107,5 +107,6 @@ from .user_account_role_service_api import UserAccountRoleServiceApi from .user_space_role_service_api import UserSpaceRoleServiceApi from .web_app_service_api import WebAppServiceApi +from .webhook_encryption_service_api import WebhookEncryptionServiceApi from .webhook_listener_service_api import WebhookListenerServiceApi from .webhook_url_service_api import WebhookUrlServiceApi diff --git a/wallee/api/account_service_api.py b/wallee/api/account_service_api.py index a34bb2c..1ce4d0c 100644 --- a/wallee/api/account_service_api.py +++ b/wallee/api/account_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/analytics_query_service_api.py b/wallee/api/analytics_query_service_api.py index ddd9443..5ba13ad 100644 --- a/wallee/api/analytics_query_service_api.py +++ b/wallee/api/analytics_query_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/application_user_service_api.py b/wallee/api/application_user_service_api.py index 6c67d39..ab159ae 100644 --- a/wallee/api/application_user_service_api.py +++ b/wallee/api/application_user_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/bank_account_service_api.py b/wallee/api/bank_account_service_api.py index 61ad6f9..0f66b6d 100644 --- a/wallee/api/bank_account_service_api.py +++ b/wallee/api/bank_account_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/bank_transaction_service_api.py b/wallee/api/bank_transaction_service_api.py index 52332e3..e12761a 100644 --- a/wallee/api/bank_transaction_service_api.py +++ b/wallee/api/bank_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/card_processing_service_api.py b/wallee/api/card_processing_service_api.py index fb2c867..ca6192b 100644 --- a/wallee/api/card_processing_service_api.py +++ b/wallee/api/card_processing_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/charge_attempt_service_api.py b/wallee/api/charge_attempt_service_api.py index fbe43ea..f1c36ac 100644 --- a/wallee/api/charge_attempt_service_api.py +++ b/wallee/api/charge_attempt_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/charge_bank_transaction_service_api.py b/wallee/api/charge_bank_transaction_service_api.py index 00375c5..09085c2 100644 --- a/wallee/api/charge_bank_transaction_service_api.py +++ b/wallee/api/charge_bank_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/charge_flow_level_payment_link_service_api.py b/wallee/api/charge_flow_level_payment_link_service_api.py index cefec0d..2d2606d 100644 --- a/wallee/api/charge_flow_level_payment_link_service_api.py +++ b/wallee/api/charge_flow_level_payment_link_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/charge_flow_level_service_api.py b/wallee/api/charge_flow_level_service_api.py index 0a7f53b..e5b1c22 100644 --- a/wallee/api/charge_flow_level_service_api.py +++ b/wallee/api/charge_flow_level_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/charge_flow_service_api.py b/wallee/api/charge_flow_service_api.py index 2e607f0..14f3801 100644 --- a/wallee/api/charge_flow_service_api.py +++ b/wallee/api/charge_flow_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/condition_type_service_api.py b/wallee/api/condition_type_service_api.py index 7210ba9..63105a6 100644 --- a/wallee/api/condition_type_service_api.py +++ b/wallee/api/condition_type_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/country_service_api.py b/wallee/api/country_service_api.py index 2704b70..d4a5ee2 100644 --- a/wallee/api/country_service_api.py +++ b/wallee/api/country_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/country_state_service_api.py b/wallee/api/country_state_service_api.py index 246d4cd..8ec2b00 100644 --- a/wallee/api/country_state_service_api.py +++ b/wallee/api/country_state_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/currency_bank_account_service_api.py b/wallee/api/currency_bank_account_service_api.py index f2efd4b..abb4815 100644 --- a/wallee/api/currency_bank_account_service_api.py +++ b/wallee/api/currency_bank_account_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/currency_service_api.py b/wallee/api/currency_service_api.py index 2283da5..fd74a74 100644 --- a/wallee/api/currency_service_api.py +++ b/wallee/api/currency_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/customer_address_service_api.py b/wallee/api/customer_address_service_api.py index cb2e1c9..5354bce 100644 --- a/wallee/api/customer_address_service_api.py +++ b/wallee/api/customer_address_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/customer_comment_service_api.py b/wallee/api/customer_comment_service_api.py index 79c1d9e..b58b810 100644 --- a/wallee/api/customer_comment_service_api.py +++ b/wallee/api/customer_comment_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/customer_service_api.py b/wallee/api/customer_service_api.py index 363f0fd..7bc06e6 100644 --- a/wallee/api/customer_service_api.py +++ b/wallee/api/customer_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/debt_collection_case_service_api.py b/wallee/api/debt_collection_case_service_api.py index a162daa..436665c 100644 --- a/wallee/api/debt_collection_case_service_api.py +++ b/wallee/api/debt_collection_case_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/debt_collector_configuration_service_api.py b/wallee/api/debt_collector_configuration_service_api.py index c099891..63bdaa4 100644 --- a/wallee/api/debt_collector_configuration_service_api.py +++ b/wallee/api/debt_collector_configuration_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/debt_collector_service_api.py b/wallee/api/debt_collector_service_api.py index eefe8ad..06e237c 100644 --- a/wallee/api/debt_collector_service_api.py +++ b/wallee/api/debt_collector_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/delivery_indication_service_api.py b/wallee/api/delivery_indication_service_api.py index 78b0389..e8320c8 100644 --- a/wallee/api/delivery_indication_service_api.py +++ b/wallee/api/delivery_indication_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/document_template_service_api.py b/wallee/api/document_template_service_api.py index 7705919..d4fe3ce 100644 --- a/wallee/api/document_template_service_api.py +++ b/wallee/api/document_template_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/document_template_type_service_api.py b/wallee/api/document_template_type_service_api.py index cce30b6..cf593f7 100644 --- a/wallee/api/document_template_type_service_api.py +++ b/wallee/api/document_template_type_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/external_transfer_bank_transaction_service_api.py b/wallee/api/external_transfer_bank_transaction_service_api.py index e593a9c..9af5b9c 100644 --- a/wallee/api/external_transfer_bank_transaction_service_api.py +++ b/wallee/api/external_transfer_bank_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/human_user_service_api.py b/wallee/api/human_user_service_api.py index 1cfd6b7..ddc1e1e 100644 --- a/wallee/api/human_user_service_api.py +++ b/wallee/api/human_user_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/installment_payment_service_api.py b/wallee/api/installment_payment_service_api.py index 2c962cc..5a2d5ba 100644 --- a/wallee/api/installment_payment_service_api.py +++ b/wallee/api/installment_payment_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/installment_payment_slice_service_api.py b/wallee/api/installment_payment_slice_service_api.py index 510d9e8..ca60947 100644 --- a/wallee/api/installment_payment_slice_service_api.py +++ b/wallee/api/installment_payment_slice_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/installment_plan_calculation_service_api.py b/wallee/api/installment_plan_calculation_service_api.py index 741038d..0283282 100644 --- a/wallee/api/installment_plan_calculation_service_api.py +++ b/wallee/api/installment_plan_calculation_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/installment_plan_configuration_service_api.py b/wallee/api/installment_plan_configuration_service_api.py index cc7930b..955dd8e 100644 --- a/wallee/api/installment_plan_configuration_service_api.py +++ b/wallee/api/installment_plan_configuration_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/installment_plan_slice_configuration_service_api.py b/wallee/api/installment_plan_slice_configuration_service_api.py index 5f7eb70..02e2769 100644 --- a/wallee/api/installment_plan_slice_configuration_service_api.py +++ b/wallee/api/installment_plan_slice_configuration_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/internal_transfer_bank_transaction_service_api.py b/wallee/api/internal_transfer_bank_transaction_service_api.py index 2e85020..7c38b2a 100644 --- a/wallee/api/internal_transfer_bank_transaction_service_api.py +++ b/wallee/api/internal_transfer_bank_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/invoice_reconciliation_record_invoice_link_service_api.py b/wallee/api/invoice_reconciliation_record_invoice_link_service_api.py index 0053c9b..4fe137d 100644 --- a/wallee/api/invoice_reconciliation_record_invoice_link_service_api.py +++ b/wallee/api/invoice_reconciliation_record_invoice_link_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/invoice_reconciliation_record_service_api.py b/wallee/api/invoice_reconciliation_record_service_api.py index 4fe167f..cdcc11b 100644 --- a/wallee/api/invoice_reconciliation_record_service_api.py +++ b/wallee/api/invoice_reconciliation_record_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/invoice_reimbursement_service_api.py b/wallee/api/invoice_reimbursement_service_api.py index 1fb44af..a5760f3 100644 --- a/wallee/api/invoice_reimbursement_service_api.py +++ b/wallee/api/invoice_reimbursement_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/label_description_group_service_api.py b/wallee/api/label_description_group_service_api.py index 0f4d540..c0b8df6 100644 --- a/wallee/api/label_description_group_service_api.py +++ b/wallee/api/label_description_group_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/label_description_service_api.py b/wallee/api/label_description_service_api.py index 7ca1c6e..ee21b35 100644 --- a/wallee/api/label_description_service_api.py +++ b/wallee/api/label_description_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/language_service_api.py b/wallee/api/language_service_api.py index bddf163..e60c473 100644 --- a/wallee/api/language_service_api.py +++ b/wallee/api/language_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/legal_organization_form_service_api.py b/wallee/api/legal_organization_form_service_api.py index 116f8e5..34183d9 100644 --- a/wallee/api/legal_organization_form_service_api.py +++ b/wallee/api/legal_organization_form_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/manual_task_service_api.py b/wallee/api/manual_task_service_api.py index 6d93ddb..5d776ec 100644 --- a/wallee/api/manual_task_service_api.py +++ b/wallee/api/manual_task_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/mertic_usage_service_api.py b/wallee/api/mertic_usage_service_api.py index 97487a7..2474921 100644 --- a/wallee/api/mertic_usage_service_api.py +++ b/wallee/api/mertic_usage_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_connector_configuration_service_api.py b/wallee/api/payment_connector_configuration_service_api.py index 46c79a0..0e9cb1b 100644 --- a/wallee/api/payment_connector_configuration_service_api.py +++ b/wallee/api/payment_connector_configuration_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_connector_service_api.py b/wallee/api/payment_connector_service_api.py index e3a1d74..b1e7bd0 100644 --- a/wallee/api/payment_connector_service_api.py +++ b/wallee/api/payment_connector_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_link_service_api.py b/wallee/api/payment_link_service_api.py index e1b62f6..08d5f62 100644 --- a/wallee/api/payment_link_service_api.py +++ b/wallee/api/payment_link_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_method_brand_service_api.py b/wallee/api/payment_method_brand_service_api.py index 025348f..13d7d16 100644 --- a/wallee/api/payment_method_brand_service_api.py +++ b/wallee/api/payment_method_brand_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_method_configuration_service_api.py b/wallee/api/payment_method_configuration_service_api.py index 9e8df24..62008e3 100644 --- a/wallee/api/payment_method_configuration_service_api.py +++ b/wallee/api/payment_method_configuration_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_method_service_api.py b/wallee/api/payment_method_service_api.py index c7bb515..ffc0509 100644 --- a/wallee/api/payment_method_service_api.py +++ b/wallee/api/payment_method_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_processor_configuration_service_api.py b/wallee/api/payment_processor_configuration_service_api.py index 4bd3a8e..88bc485 100644 --- a/wallee/api/payment_processor_configuration_service_api.py +++ b/wallee/api/payment_processor_configuration_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_processor_service_api.py b/wallee/api/payment_processor_service_api.py index a0f34e1..cc16583 100644 --- a/wallee/api/payment_processor_service_api.py +++ b/wallee/api/payment_processor_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_terminal_service_api.py b/wallee/api/payment_terminal_service_api.py index e73655e..e08e349 100644 --- a/wallee/api/payment_terminal_service_api.py +++ b/wallee/api/payment_terminal_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_terminal_till_service_api.py b/wallee/api/payment_terminal_till_service_api.py index da418dd..3cf01be 100644 --- a/wallee/api/payment_terminal_till_service_api.py +++ b/wallee/api/payment_terminal_till_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_terminal_transaction_summary_service_api.py b/wallee/api/payment_terminal_transaction_summary_service_api.py index d7c4fc1..4e3cbe7 100644 --- a/wallee/api/payment_terminal_transaction_summary_service_api.py +++ b/wallee/api/payment_terminal_transaction_summary_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/payment_web_app_service_api.py b/wallee/api/payment_web_app_service_api.py index 8ae5a57..0f2c3e0 100644 --- a/wallee/api/payment_web_app_service_api.py +++ b/wallee/api/payment_web_app_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/permission_service_api.py b/wallee/api/permission_service_api.py index db41f8e..4f84f66 100644 --- a/wallee/api/permission_service_api.py +++ b/wallee/api/permission_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/refund_bank_transaction_service_api.py b/wallee/api/refund_bank_transaction_service_api.py index 679b6d1..1cc558d 100644 --- a/wallee/api/refund_bank_transaction_service_api.py +++ b/wallee/api/refund_bank_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/refund_comment_service_api.py b/wallee/api/refund_comment_service_api.py index b70fa33..080a806 100644 --- a/wallee/api/refund_comment_service_api.py +++ b/wallee/api/refund_comment_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/refund_recovery_bank_transaction_service_api.py b/wallee/api/refund_recovery_bank_transaction_service_api.py index e9baa1d..7386377 100644 --- a/wallee/api/refund_recovery_bank_transaction_service_api.py +++ b/wallee/api/refund_recovery_bank_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/refund_service_api.py b/wallee/api/refund_service_api.py index c4fe5f1..b00f6da 100644 --- a/wallee/api/refund_service_api.py +++ b/wallee/api/refund_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_recurring_order_service_api.py b/wallee/api/shopify_recurring_order_service_api.py index 3bd66a9..962741b 100644 --- a/wallee/api/shopify_recurring_order_service_api.py +++ b/wallee/api/shopify_recurring_order_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_subscriber_service_api.py b/wallee/api/shopify_subscriber_service_api.py index 77110b5..798a763 100644 --- a/wallee/api/shopify_subscriber_service_api.py +++ b/wallee/api/shopify_subscriber_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_subscription_product_service_api.py b/wallee/api/shopify_subscription_product_service_api.py index a3d17e6..1b7964b 100644 --- a/wallee/api/shopify_subscription_product_service_api.py +++ b/wallee/api/shopify_subscription_product_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_subscription_service_api.py b/wallee/api/shopify_subscription_service_api.py index 50b4007..876f8a6 100644 --- a/wallee/api/shopify_subscription_service_api.py +++ b/wallee/api/shopify_subscription_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_subscription_suspension_service_api.py b/wallee/api/shopify_subscription_suspension_service_api.py index 6d3870e..5e9405e 100644 --- a/wallee/api/shopify_subscription_suspension_service_api.py +++ b/wallee/api/shopify_subscription_suspension_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_subscription_version_service_api.py b/wallee/api/shopify_subscription_version_service_api.py index 60f44ac..1a2f13d 100644 --- a/wallee/api/shopify_subscription_version_service_api.py +++ b/wallee/api/shopify_subscription_version_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/shopify_transaction_service_api.py b/wallee/api/shopify_transaction_service_api.py index 2cd82ce..4ee9e46 100644 --- a/wallee/api/shopify_transaction_service_api.py +++ b/wallee/api/shopify_transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/space_service_api.py b/wallee/api/space_service_api.py index e61626c..3c05f24 100644 --- a/wallee/api/space_service_api.py +++ b/wallee/api/space_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/static_value_service_api.py b/wallee/api/static_value_service_api.py index c92ff52..d78eaaf 100644 --- a/wallee/api/static_value_service_api.py +++ b/wallee/api/static_value_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscriber_service_api.py b/wallee/api/subscriber_service_api.py index 0ff2f74..d64ea72 100644 --- a/wallee/api/subscriber_service_api.py +++ b/wallee/api/subscriber_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_affiliate_service_api.py b/wallee/api/subscription_affiliate_service_api.py index 6b4787f..b5df589 100644 --- a/wallee/api/subscription_affiliate_service_api.py +++ b/wallee/api/subscription_affiliate_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_charge_service_api.py b/wallee/api/subscription_charge_service_api.py index db47728..4e388df 100644 --- a/wallee/api/subscription_charge_service_api.py +++ b/wallee/api/subscription_charge_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_ledger_entry_service_api.py b/wallee/api/subscription_ledger_entry_service_api.py index c4ba106..8d0f6cc 100644 --- a/wallee/api/subscription_ledger_entry_service_api.py +++ b/wallee/api/subscription_ledger_entry_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_metric_service_api.py b/wallee/api/subscription_metric_service_api.py index bc681d8..121dd70 100644 --- a/wallee/api/subscription_metric_service_api.py +++ b/wallee/api/subscription_metric_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_metric_usage_service_api.py b/wallee/api/subscription_metric_usage_service_api.py index bbf97c8..07c4c20 100644 --- a/wallee/api/subscription_metric_usage_service_api.py +++ b/wallee/api/subscription_metric_usage_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_period_bill_service_api.py b/wallee/api/subscription_period_bill_service_api.py index c745072..9e9454e 100644 --- a/wallee/api/subscription_period_bill_service_api.py +++ b/wallee/api/subscription_period_bill_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_component_group_service_api.py b/wallee/api/subscription_product_component_group_service_api.py index 1936108..b3f47a0 100644 --- a/wallee/api/subscription_product_component_group_service_api.py +++ b/wallee/api/subscription_product_component_group_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_component_service_api.py b/wallee/api/subscription_product_component_service_api.py index 99dc7ae..85cd3c6 100644 --- a/wallee/api/subscription_product_component_service_api.py +++ b/wallee/api/subscription_product_component_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_fee_tier_service_api.py b/wallee/api/subscription_product_fee_tier_service_api.py index c8b305a..e03c74b 100644 --- a/wallee/api/subscription_product_fee_tier_service_api.py +++ b/wallee/api/subscription_product_fee_tier_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_metered_fee_service_api.py b/wallee/api/subscription_product_metered_fee_service_api.py index f6024a5..12fa6f5 100644 --- a/wallee/api/subscription_product_metered_fee_service_api.py +++ b/wallee/api/subscription_product_metered_fee_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_period_fee_service_api.py b/wallee/api/subscription_product_period_fee_service_api.py index b8f8d14..c31e149 100644 --- a/wallee/api/subscription_product_period_fee_service_api.py +++ b/wallee/api/subscription_product_period_fee_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_retirement_service_api.py b/wallee/api/subscription_product_retirement_service_api.py index e04c1a1..bbf91bf 100644 --- a/wallee/api/subscription_product_retirement_service_api.py +++ b/wallee/api/subscription_product_retirement_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_service_api.py b/wallee/api/subscription_product_service_api.py index e5e3385..6d3a4ba 100644 --- a/wallee/api/subscription_product_service_api.py +++ b/wallee/api/subscription_product_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_setup_fee_service_api.py b/wallee/api/subscription_product_setup_fee_service_api.py index 3448a11..e75369d 100644 --- a/wallee/api/subscription_product_setup_fee_service_api.py +++ b/wallee/api/subscription_product_setup_fee_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_version_retirement_service_api.py b/wallee/api/subscription_product_version_retirement_service_api.py index cb7b844..1d57087 100644 --- a/wallee/api/subscription_product_version_retirement_service_api.py +++ b/wallee/api/subscription_product_version_retirement_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_product_version_service_api.py b/wallee/api/subscription_product_version_service_api.py index 042cfa1..234862c 100644 --- a/wallee/api/subscription_product_version_service_api.py +++ b/wallee/api/subscription_product_version_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_service_api.py b/wallee/api/subscription_service_api.py index ec0ccd5..787771c 100644 --- a/wallee/api/subscription_service_api.py +++ b/wallee/api/subscription_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_suspension_service_api.py b/wallee/api/subscription_suspension_service_api.py index e3934fb..c39c210 100644 --- a/wallee/api/subscription_suspension_service_api.py +++ b/wallee/api/subscription_suspension_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/subscription_version_service_api.py b/wallee/api/subscription_version_service_api.py index 9d073f3..6574d3c 100644 --- a/wallee/api/subscription_version_service_api.py +++ b/wallee/api/subscription_version_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/token_service_api.py b/wallee/api/token_service_api.py index ebb2cc8..5a88688 100644 --- a/wallee/api/token_service_api.py +++ b/wallee/api/token_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient @@ -332,6 +333,109 @@ def create_with_http_info(self, space_id, entity, **kwargs): _request_timeout=params.get('request_timeout'), collection_formats=collection_formats) + def create_token(self, space_id, transaction_id, **kwargs): + """Create Token + + This operation creates a token for the given transaction. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True. + + >>> thread = api.create_token(space_id, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int space_id: (required) + :param int transaction_id: The id of the transaction for which we want to create the token. (required) + :return: Token + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + + kwargs['request_timeout'] = self.api_client.configuration.request_timeout + if kwargs.get('async_req'): + return self.create_token_with_http_info(space_id, transaction_id, **kwargs) + else: + (data) = self.create_token_with_http_info(space_id, transaction_id, **kwargs) + return data + + def create_token_with_http_info(self, space_id, transaction_id, **kwargs): + """Create Token + + This operation creates a token for the given transaction. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True. + + >>> thread = api.create_token_with_http_info(space_id, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int space_id: (required) + :param int transaction_id: The id of the transaction for which we want to create the token. (required) + :return: Token + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['space_id', 'transaction_id'] + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_token" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'space_id' is set + if ('space_id' not in params or + params['space_id'] is None): + raise ValueError("Missing the required parameter `space_id` when calling `create_token`") + # verify the required parameter 'transaction_id' is set + if ('transaction_id' not in params or + params['transaction_id'] is None): + raise ValueError("Missing the required parameter `transaction_id` when calling `create_token`") + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'space_id' in params: + query_params.append(('spaceId', params['space_id'])) + if 'transaction_id' in params: + query_params.append(('transactionId', params['transaction_id'])) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] + + return self.api_client.call_api( + '/token/create-token', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Token', + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('request_timeout'), + collection_formats=collection_formats) + def create_token_based_on_transaction(self, space_id, transaction_id, **kwargs): """Create Token Based On Transaction diff --git a/wallee/api/token_version_service_api.py b/wallee/api/token_version_service_api.py index 65a37fd..31fae11 100644 --- a/wallee/api/token_version_service_api.py +++ b/wallee/api/token_version_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_comment_service_api.py b/wallee/api/transaction_comment_service_api.py index f75f956..6492439 100644 --- a/wallee/api/transaction_comment_service_api.py +++ b/wallee/api/transaction_comment_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_completion_service_api.py b/wallee/api/transaction_completion_service_api.py index 3855f83..0b7587f 100644 --- a/wallee/api/transaction_completion_service_api.py +++ b/wallee/api/transaction_completion_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_iframe_service_api.py b/wallee/api/transaction_iframe_service_api.py index 4963fe6..a127ee5 100644 --- a/wallee/api/transaction_iframe_service_api.py +++ b/wallee/api/transaction_iframe_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_invoice_comment_service_api.py b/wallee/api/transaction_invoice_comment_service_api.py index 787d096..a8da855 100644 --- a/wallee/api/transaction_invoice_comment_service_api.py +++ b/wallee/api/transaction_invoice_comment_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_invoice_service_api.py b/wallee/api/transaction_invoice_service_api.py index b5dbc44..243f07f 100644 --- a/wallee/api/transaction_invoice_service_api.py +++ b/wallee/api/transaction_invoice_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_lightbox_service_api.py b/wallee/api/transaction_lightbox_service_api.py index 54f6cc4..d5ed5bd 100644 --- a/wallee/api/transaction_lightbox_service_api.py +++ b/wallee/api/transaction_lightbox_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_line_item_version_service_api.py b/wallee/api/transaction_line_item_version_service_api.py index a8bca6a..022e5a1 100644 --- a/wallee/api/transaction_line_item_version_service_api.py +++ b/wallee/api/transaction_line_item_version_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_mobile_sdk_service_api.py b/wallee/api/transaction_mobile_sdk_service_api.py index 9298811..15c1390 100644 --- a/wallee/api/transaction_mobile_sdk_service_api.py +++ b/wallee/api/transaction_mobile_sdk_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_payment_page_service_api.py b/wallee/api/transaction_payment_page_service_api.py index 9d0cf41..cca575e 100644 --- a/wallee/api/transaction_payment_page_service_api.py +++ b/wallee/api/transaction_payment_page_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_service_api.py b/wallee/api/transaction_service_api.py index 205b6ea..a4d409e 100644 --- a/wallee/api/transaction_service_api.py +++ b/wallee/api/transaction_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_terminal_service_api.py b/wallee/api/transaction_terminal_service_api.py index 5ef6376..2671191 100644 --- a/wallee/api/transaction_terminal_service_api.py +++ b/wallee/api/transaction_terminal_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/transaction_void_service_api.py b/wallee/api/transaction_void_service_api.py index 4257446..62d424d 100644 --- a/wallee/api/transaction_void_service_api.py +++ b/wallee/api/transaction_void_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/user_account_role_service_api.py b/wallee/api/user_account_role_service_api.py index cd9c4af..803f960 100644 --- a/wallee/api/user_account_role_service_api.py +++ b/wallee/api/user_account_role_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/user_space_role_service_api.py b/wallee/api/user_space_role_service_api.py index 934ecc0..da9f15f 100644 --- a/wallee/api/user_space_role_service_api.py +++ b/wallee/api/user_space_role_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/web_app_service_api.py b/wallee/api/web_app_service_api.py index 15f8685..3eb32c6 100644 --- a/wallee/api/web_app_service_api.py +++ b/wallee/api/web_app_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/webhook_encryption_service_api.py b/wallee/api/webhook_encryption_service_api.py new file mode 100644 index 0000000..5b681ce --- /dev/null +++ b/wallee/api/webhook_encryption_service_api.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +from __future__ import absolute_import + +import six +import re + +from wallee.api_client import ApiClient +from wallee.encryption_util import EncryptionUtil + +class WebhookEncryptionServiceApi: + + def __init__(self, configuration): + self.api_client = ApiClient(configuration=configuration) + + def read(self, id, **kwargs): + """Read + + Reads the entity with the given 'id' and returns it. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True. + + >>> thread = api.read(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: The ID of the key version. (required) + :return: WebhookEncryptionPublicKey + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + + kwargs['request_timeout'] = self.api_client.configuration.request_timeout + if kwargs.get('async_req'): + return self.read_with_http_info(id, **kwargs) + else: + (data) = self.read_with_http_info(id, **kwargs) + return data + + def read_with_http_info(self, id, **kwargs): + """Read + + Reads the entity with the given 'id' and returns it. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True. + + >>> thread = api.read_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: The ID of the key version. (required) + :return: WebhookEncryptionPublicKey + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method read" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `read`") + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'id' in params: + query_params.append(('id', params['id'])) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json;charset=utf-8']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( + ['*/*']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api( + '/webhook-encryption/read', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookEncryptionPublicKey', + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('request_timeout'), + collection_formats=collection_formats) + + def is_content_valid(self, signature_header, content_to_verify): + """Verify webhook content using signature header + + Verifies webhook content using signature header. + + :param str signature_header: Signature header 'X-Signature' value from the Http request + :param str content_to_verify: Raw webhook content in String format + :return: bool if webhook content body conforms with signature header + """ + regex = r"^algorithm=([a-zA-Z0-9]+),\skeyId=([a-z0-9\-]+),\s{1}signature=([a-zA-Z0-9+\/=]+)$" + pattern = re.compile(regex) + matcher = pattern.match(signature_header) + + if matcher: + signature_algorithm = matcher.group(1) + public_key_id = matcher.group(2) + content_signature = matcher.group(3) + + public_key = WebhookEncryptionServiceApi.read(self, public_key_id) + + if public_key.public_key is None: + raise ValueError(f"Could not find public key with id {public_key_id}") + + return EncryptionUtil.is_content_valid(content_to_verify, content_signature, public_key.public_key, + signature_algorithm) + else: + raise ValueError( + "Invalid webhook signature header. Expected format: 'algorithm=, keyId=, " + "signature='") diff --git a/wallee/api/webhook_listener_service_api.py b/wallee/api/webhook_listener_service_api.py index 066227a..295664f 100644 --- a/wallee/api/webhook_listener_service_api.py +++ b/wallee/api/webhook_listener_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api/webhook_url_service_api.py b/wallee/api/webhook_url_service_api.py index 139185c..fd9f5d3 100644 --- a/wallee/api/webhook_url_service_api.py +++ b/wallee/api/webhook_url_service_api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import six +import re from wallee.api_client import ApiClient diff --git a/wallee/api_client.py b/wallee/api_client.py index eb32bd0..30b0ee8 100644 --- a/wallee/api_client.py +++ b/wallee/api_client.py @@ -4,7 +4,7 @@ Python SDK - OpenAPI spec version: 4.0.0 + OpenAPI spec version: 4.1.0 """ @@ -26,6 +26,9 @@ import six import platform from six.moves.urllib.parse import quote +from dateutil.parser import parse as date_util_parse +import sys + from wallee.configuration import Configuration import wallee.models @@ -64,7 +67,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'wallee/4.0.0/python' + self.user_agent = 'wallee/4.1.0/python' def __del__(self): if self._pool is not None: @@ -103,7 +106,7 @@ def __call_api( # predefined default headers default_headers = { - 'x-meta-sdk-version': '4.0.0', + 'x-meta-sdk-version': '4.1.0', 'x-meta-sdk-language': 'python', 'x-meta-sdk-provider': 'wallee', 'x-meta-sdk-language-version': platform.python_version() @@ -560,6 +563,14 @@ def __deserialize_object(self, value): """ return value + # TODO remove when the lowest supported Python version is 3.11+ . Then - also remove "python_dateutil" dependency from pip installs + # https://stackoverflow.com/questions/55542280 + def __parse_iso_date(self, string): + if (sys.version_info < (3, 11)): + return date_util_parse(string).date() + + return datetime.datetime.fromisoformat(string) + def __deserialize_date(self, string): """Deserializes string to date. @@ -567,8 +578,7 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse - return parse(string).date() + return self.__parse_iso_date(string) except ImportError: return string except ValueError: @@ -586,8 +596,7 @@ def __deserialize_datatime(self, string): :return: datetime. """ try: - from dateutil.parser import parse - return parse(string) + return self.__parse_iso_date(string) except ImportError: return string except ValueError: @@ -612,27 +621,31 @@ def __deserialize_model(self, data, klass): if issubclass(klass, Enum): return getattr(klass, data) + + class_instance = klass() + swagger_types = class_instance.swagger_types + attribute_map = class_instance.attribute_map - if (not klass.swagger_types and + if (not swagger_types and not self.__hasattr(klass, 'get_real_child_model')): return data kwargs = {} - if klass.swagger_types is not None: - for attr, attr_type in six.iteritems(klass.swagger_types): + if swagger_types is not None: + for attr, attr_type in six.iteritems(swagger_types): if (data is not None and - klass.attribute_map[attr] in data and + attribute_map[attr] in data and isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] + value = data[attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) instance = klass(**kwargs) if (isinstance(instance, dict) and - klass.swagger_types is not None and + swagger_types is not None and isinstance(data, dict)): for key, value in data.items(): - if key not in klass.swagger_types: + if key not in swagger_types: instance[key] = value if self.__hasattr(instance, 'get_real_child_model'): klass_name = instance.get_real_child_model(data) diff --git a/wallee/configuration.py b/wallee/configuration.py index 2b3ffc5..47dab8d 100644 --- a/wallee/configuration.py +++ b/wallee/configuration.py @@ -262,6 +262,6 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 4.0.0\n"\ - "SDK Package Version: 4.0.0".\ + "Version of the API: 4.1.0\n"\ + "SDK Package Version: 4.1.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/wallee/encryption_util.py b/wallee/encryption_util.py new file mode 100644 index 0000000..3849769 --- /dev/null +++ b/wallee/encryption_util.py @@ -0,0 +1,45 @@ +import base64 +import binascii + +from cryptography.exceptions import InvalidSignature +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes + + +class EncryptionUtil: + @staticmethod + def is_content_valid(content, signature, public_key, encryption_algorithm): + algorithm_class = EncryptionUtil._get_algorithm_class(encryption_algorithm) + if algorithm_class is None: + raise ValueError(f"Unsupported algorithm: {encryption_algorithm}") + + try: + signature = base64.b64decode(signature) + except binascii.Error: + raise ValueError("Invalid signature value format") + + try: + public_key_bytes = base64.b64decode(public_key) + except binascii.Error: + raise ValueError("Invalid public key value format") + + public_key = serialization.load_der_public_key(public_key_bytes, backend=default_backend()) + + try: + public_key.verify( + signature, + content.encode('utf-8'), + algorithm_class(hashes.SHA256()) + ) + return True + except InvalidSignature: + return False + + @staticmethod + def _get_algorithm_class(algorithm): + switch = { + 'SHA256withECDSA': ec.ECDSA, + } + return switch.get(algorithm, None) \ No newline at end of file diff --git a/wallee/models/__init__.py b/wallee/models/__init__.py index 510c1ab..af37fd5 100644 --- a/wallee/models/__init__.py +++ b/wallee/models/__init__.py @@ -365,6 +365,7 @@ from .wallet_type import WalletType from .web_app_confirmation_request import WebAppConfirmationRequest from .web_app_confirmation_response import WebAppConfirmationResponse +from .webhook_encryption_public_key import WebhookEncryptionPublicKey from .webhook_identity import WebhookIdentity from .webhook_listener import WebhookListener from .webhook_listener_entity import WebhookListenerEntity diff --git a/wallee/models/abstract_payment_link_update.py b/wallee/models/abstract_payment_link_update.py index 0ae9d09..0457366 100644 --- a/wallee/models/abstract_payment_link_update.py +++ b/wallee/models/abstract_payment_link_update.py @@ -221,7 +221,7 @@ def language(self, language): def line_items(self): """Gets the line_items of this AbstractPaymentLinkUpdate. - The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. If no amount for the payment link is defined, the additional checkout page to enter the amount is shown to the consumer. :return: The line_items of this AbstractPaymentLinkUpdate. :rtype: list[LineItemCreate] @@ -232,7 +232,7 @@ def line_items(self): def line_items(self, line_items): """Sets the line_items of this AbstractPaymentLinkUpdate. - The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. If no amount for the payment link is defined, the additional checkout page to enter the amount is shown to the consumer. :param line_items: The line_items of this AbstractPaymentLinkUpdate. :type: list[LineItemCreate] diff --git a/wallee/models/card_authentication_response.py b/wallee/models/card_authentication_response.py index e622553..31dc4c1 100644 --- a/wallee/models/card_authentication_response.py +++ b/wallee/models/card_authentication_response.py @@ -5,9 +5,9 @@ @unique class CardAuthenticationResponse(Enum): - ENROLLMENT_VERIFICATION_ERROR = "ENROLLMENT_VERIFICATION_ERROR" + FULLY_AUTHENTICATED = "FULLY_AUTHENTICATED" + AUTHENTICATION_NOT_REQUIRED = "AUTHENTICATION_NOT_REQUIRED" NOT_ENROLLED = "NOT_ENROLLED" + ENROLLMENT_ERROR = "ENROLLMENT_ERROR" AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR" - AUTHENTICATION_NOT_REQUIRED = "AUTHENTICATION_NOT_REQUIRED" - FULLY_AUTHENTICATED = "FULLY_AUTHENTICATED" diff --git a/wallee/models/charge_attempt.py b/wallee/models/charge_attempt.py index 5f69ad3..ee26f95 100644 --- a/wallee/models/charge_attempt.py +++ b/wallee/models/charge_attempt.py @@ -34,11 +34,11 @@ class ChargeAttempt(TransactionAwareEntity): 'token_version': 'TokenVersion', 'user_failure_message': 'str', 'version': 'int', - 'wallet_type': 'WalletType', + 'wallet': 'WalletType', } attribute_map = { - 'charge': 'charge','completion_behavior': 'completionBehavior','connector_configuration': 'connectorConfiguration','created_on': 'createdOn','customers_presence': 'customersPresence','environment': 'environment','failed_on': 'failedOn','failure_reason': 'failureReason','initializing_token_version': 'initializingTokenVersion','invocation': 'invocation','labels': 'labels','language': 'language','next_update_on': 'nextUpdateOn','planned_purge_date': 'plannedPurgeDate','redirection_url': 'redirectionUrl','sales_channel': 'salesChannel','space_view_id': 'spaceViewId','state': 'state','succeeded_on': 'succeededOn','terminal': 'terminal','time_zone': 'timeZone','timeout_on': 'timeoutOn','token_version': 'tokenVersion','user_failure_message': 'userFailureMessage','version': 'version','wallet_type': 'walletType', + 'charge': 'charge','completion_behavior': 'completionBehavior','connector_configuration': 'connectorConfiguration','created_on': 'createdOn','customers_presence': 'customersPresence','environment': 'environment','failed_on': 'failedOn','failure_reason': 'failureReason','initializing_token_version': 'initializingTokenVersion','invocation': 'invocation','labels': 'labels','language': 'language','next_update_on': 'nextUpdateOn','planned_purge_date': 'plannedPurgeDate','redirection_url': 'redirectionUrl','sales_channel': 'salesChannel','space_view_id': 'spaceViewId','state': 'state','succeeded_on': 'succeededOn','terminal': 'terminal','time_zone': 'timeZone','timeout_on': 'timeoutOn','token_version': 'tokenVersion','user_failure_message': 'userFailureMessage','version': 'version','wallet': 'wallet', } @@ -67,7 +67,7 @@ class ChargeAttempt(TransactionAwareEntity): _token_version = None _user_failure_message = None _version = None - _wallet_type = None + _wallet = None def __init__(self, **kwargs): self.discriminator = None @@ -97,7 +97,7 @@ def __init__(self, **kwargs): self.token_version = kwargs.get('token_version', None) self.user_failure_message = kwargs.get('user_failure_message', None) self.version = kwargs.get('version', None) - self.wallet_type = kwargs.get('wallet_type', None) + self.wallet = kwargs.get('wallet', None) super().__init__(**kwargs) self.swagger_types.update(super().swagger_types) self.attribute_map.update(super().attribute_map) @@ -681,27 +681,27 @@ def version(self, version): self._version = version @property - def wallet_type(self): - """Gets the wallet_type of this ChargeAttempt. + def wallet(self): + """Gets the wallet of this ChargeAttempt. - :return: The wallet_type of this ChargeAttempt. + :return: The wallet of this ChargeAttempt. :rtype: WalletType """ - return self._wallet_type + return self._wallet - @wallet_type.setter - def wallet_type(self, wallet_type): - """Sets the wallet_type of this ChargeAttempt. + @wallet.setter + def wallet(self, wallet): + """Sets the wallet of this ChargeAttempt. - :param wallet_type: The wallet_type of this ChargeAttempt. + :param wallet: The wallet of this ChargeAttempt. :type: WalletType """ - self._wallet_type = wallet_type + self._wallet = wallet def to_dict(self): diff --git a/wallee/models/payment_connector.py b/wallee/models/payment_connector.py index 685e8f8..845eb70 100644 --- a/wallee/models/payment_connector.py +++ b/wallee/models/payment_connector.py @@ -20,12 +20,13 @@ class PaymentConnector: 'payment_method_brand': 'PaymentMethodBrand', 'primary_risk_taker': 'PaymentPrimaryRiskTaker', 'processor': 'int', + 'supported_currencies': 'list[str]', 'supported_customers_presences': 'list[CustomersPresence]', 'supported_features': 'list[int]', } attribute_map = { - 'data_collection_type': 'dataCollectionType','deprecated': 'deprecated','deprecation_reason': 'deprecationReason','description': 'description','feature': 'feature','id': 'id','name': 'name','payment_method': 'paymentMethod','payment_method_brand': 'paymentMethodBrand','primary_risk_taker': 'primaryRiskTaker','processor': 'processor','supported_customers_presences': 'supportedCustomersPresences','supported_features': 'supportedFeatures', + 'data_collection_type': 'dataCollectionType','deprecated': 'deprecated','deprecation_reason': 'deprecationReason','description': 'description','feature': 'feature','id': 'id','name': 'name','payment_method': 'paymentMethod','payment_method_brand': 'paymentMethodBrand','primary_risk_taker': 'primaryRiskTaker','processor': 'processor','supported_currencies': 'supportedCurrencies','supported_customers_presences': 'supportedCustomersPresences','supported_features': 'supportedFeatures', } @@ -40,6 +41,7 @@ class PaymentConnector: _payment_method_brand = None _primary_risk_taker = None _processor = None + _supported_currencies = None _supported_customers_presences = None _supported_features = None @@ -57,6 +59,7 @@ def __init__(self, **kwargs): self.payment_method_brand = kwargs.get('payment_method_brand', None) self.primary_risk_taker = kwargs.get('primary_risk_taker', None) self.processor = kwargs.get('processor', None) + self.supported_currencies = kwargs.get('supported_currencies', None) self.supported_customers_presences = kwargs.get('supported_customers_presences', None) self.supported_features = kwargs.get('supported_features', None) @@ -315,6 +318,29 @@ def processor(self, processor): self._processor = processor + @property + def supported_currencies(self): + """Gets the supported_currencies of this PaymentConnector. + + + + :return: The supported_currencies of this PaymentConnector. + :rtype: list[str] + """ + return self._supported_currencies + + @supported_currencies.setter + def supported_currencies(self, supported_currencies): + """Sets the supported_currencies of this PaymentConnector. + + + + :param supported_currencies: The supported_currencies of this PaymentConnector. + :type: list[str] + """ + + self._supported_currencies = supported_currencies + @property def supported_customers_presences(self): """Gets the supported_customers_presences of this PaymentConnector. diff --git a/wallee/models/payment_contract.py b/wallee/models/payment_contract.py index d51c7e9..f489339 100644 --- a/wallee/models/payment_contract.py +++ b/wallee/models/payment_contract.py @@ -17,6 +17,7 @@ class PaymentContract: 'created_on': 'datetime', 'external_id': 'str', 'id': 'int', + 'last_modified_date': 'datetime', 'rejected_on': 'datetime', 'rejection_reason': 'FailureReason', 'start_terminating_on': 'datetime', @@ -27,7 +28,7 @@ class PaymentContract: } attribute_map = { - 'account': 'account','activated_on': 'activatedOn','contract_identifier': 'contractIdentifier','contract_type': 'contractType','created_by': 'createdBy','created_on': 'createdOn','external_id': 'externalId','id': 'id','rejected_on': 'rejectedOn','rejection_reason': 'rejectionReason','start_terminating_on': 'startTerminatingOn','state': 'state','terminated_by': 'terminatedBy','terminated_on': 'terminatedOn','version': 'version', + 'account': 'account','activated_on': 'activatedOn','contract_identifier': 'contractIdentifier','contract_type': 'contractType','created_by': 'createdBy','created_on': 'createdOn','external_id': 'externalId','id': 'id','last_modified_date': 'lastModifiedDate','rejected_on': 'rejectedOn','rejection_reason': 'rejectionReason','start_terminating_on': 'startTerminatingOn','state': 'state','terminated_by': 'terminatedBy','terminated_on': 'terminatedOn','version': 'version', } @@ -39,6 +40,7 @@ class PaymentContract: _created_on = None _external_id = None _id = None + _last_modified_date = None _rejected_on = None _rejection_reason = None _start_terminating_on = None @@ -58,6 +60,7 @@ def __init__(self, **kwargs): self.created_on = kwargs.get('created_on', None) self.external_id = kwargs.get('external_id', None) self.id = kwargs.get('id', None) + self.last_modified_date = kwargs.get('last_modified_date', None) self.rejected_on = kwargs.get('rejected_on', None) self.rejection_reason = kwargs.get('rejection_reason', None) self.start_terminating_on = kwargs.get('start_terminating_on', None) @@ -252,6 +255,29 @@ def id(self, id): self._id = id + @property + def last_modified_date(self): + """Gets the last_modified_date of this PaymentContract. + + The date and time when the object was last modified. + + :return: The last_modified_date of this PaymentContract. + :rtype: datetime + """ + return self._last_modified_date + + @last_modified_date.setter + def last_modified_date(self, last_modified_date): + """Sets the last_modified_date of this PaymentContract. + + The date and time when the object was last modified. + + :param last_modified_date: The last_modified_date of this PaymentContract. + :type: datetime + """ + + self._last_modified_date = last_modified_date + @property def rejected_on(self): """Gets the rejected_on of this PaymentContract. diff --git a/wallee/models/payment_link.py b/wallee/models/payment_link.py index f6e503f..6a4c52d 100644 --- a/wallee/models/payment_link.py +++ b/wallee/models/payment_link.py @@ -291,7 +291,7 @@ def language(self, language): def line_items(self): """Gets the line_items of this PaymentLink. - The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. If no amount for the payment link is defined, the additional checkout page to enter the amount is shown to the consumer. :return: The line_items of this PaymentLink. :rtype: list[LineItem] @@ -302,7 +302,7 @@ def line_items(self): def line_items(self, line_items): """Sets the line_items of this PaymentLink. - The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. If no amount for the payment link is defined, the additional checkout page to enter the amount is shown to the consumer. :param line_items: The line_items of this PaymentLink. :type: list[LineItem] diff --git a/wallee/models/payment_link_update.py b/wallee/models/payment_link_update.py index f360965..edd0e52 100644 --- a/wallee/models/payment_link_update.py +++ b/wallee/models/payment_link_update.py @@ -279,7 +279,7 @@ def language(self, language): def line_items(self): """Gets the line_items of this PaymentLinkUpdate. - The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. If no amount for the payment link is defined, the additional checkout page to enter the amount is shown to the consumer. :return: The line_items of this PaymentLinkUpdate. :rtype: list[LineItemCreate] @@ -290,7 +290,7 @@ def line_items(self): def line_items(self, line_items): """Sets the line_items of this PaymentLinkUpdate. - The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. If no amount for the payment link is defined, the additional checkout page to enter the amount is shown to the consumer. :param line_items: The line_items of this PaymentLinkUpdate. :type: list[LineItemCreate] diff --git a/wallee/models/rest_country.py b/wallee/models/rest_country.py index f09697a..9ae82b6 100644 --- a/wallee/models/rest_country.py +++ b/wallee/models/rest_country.py @@ -9,22 +9,22 @@ class RestCountry: swagger_types = { - 'iso_code2_letter': 'str', - 'iso_code3_letter': 'str', 'address_format': 'RestAddressFormat', + 'iso_code2': 'str', + 'iso_code3': 'str', 'name': 'str', 'numeric_code': 'str', 'state_codes': 'list[str]', } attribute_map = { - 'iso_code2_letter': 'ISOCode2Letter','iso_code3_letter': 'ISOCode3Letter','address_format': 'addressFormat','name': 'name','numeric_code': 'numericCode','state_codes': 'stateCodes', + 'address_format': 'addressFormat','iso_code2': 'isoCode2','iso_code3': 'isoCode3','name': 'name','numeric_code': 'numericCode','state_codes': 'stateCodes', } - _iso_code2_letter = None - _iso_code3_letter = None _address_format = None + _iso_code2 = None + _iso_code3 = None _name = None _numeric_code = None _state_codes = None @@ -32,9 +32,9 @@ class RestCountry: def __init__(self, **kwargs): self.discriminator = None - self.iso_code2_letter = kwargs.get('iso_code2_letter', None) - self.iso_code3_letter = kwargs.get('iso_code3_letter', None) self.address_format = kwargs.get('address_format', None) + self.iso_code2 = kwargs.get('iso_code2', None) + self.iso_code3 = kwargs.get('iso_code3', None) self.name = kwargs.get('name', None) self.numeric_code = kwargs.get('numeric_code', None) self.state_codes = kwargs.get('state_codes', None) @@ -42,73 +42,73 @@ def __init__(self, **kwargs): @property - def iso_code2_letter(self): - """Gets the iso_code2_letter of this RestCountry. + def address_format(self): + """Gets the address_format of this RestCountry. - The country's two-letter code (ISO 3166-1 alpha-2 format). + Specifies the country's way of formatting addresses. - :return: The iso_code2_letter of this RestCountry. - :rtype: str + :return: The address_format of this RestCountry. + :rtype: RestAddressFormat """ - return self._iso_code2_letter + return self._address_format - @iso_code2_letter.setter - def iso_code2_letter(self, iso_code2_letter): - """Sets the iso_code2_letter of this RestCountry. + @address_format.setter + def address_format(self, address_format): + """Sets the address_format of this RestCountry. - The country's two-letter code (ISO 3166-1 alpha-2 format). + Specifies the country's way of formatting addresses. - :param iso_code2_letter: The iso_code2_letter of this RestCountry. - :type: str + :param address_format: The address_format of this RestCountry. + :type: RestAddressFormat """ - self._iso_code2_letter = iso_code2_letter + self._address_format = address_format @property - def iso_code3_letter(self): - """Gets the iso_code3_letter of this RestCountry. + def iso_code2(self): + """Gets the iso_code2 of this RestCountry. - The country's three-letter code (ISO 3166-1 alpha-3 format). + The country's two-letter code (ISO 3166-1 alpha-2 format). - :return: The iso_code3_letter of this RestCountry. + :return: The iso_code2 of this RestCountry. :rtype: str """ - return self._iso_code3_letter + return self._iso_code2 - @iso_code3_letter.setter - def iso_code3_letter(self, iso_code3_letter): - """Sets the iso_code3_letter of this RestCountry. + @iso_code2.setter + def iso_code2(self, iso_code2): + """Sets the iso_code2 of this RestCountry. - The country's three-letter code (ISO 3166-1 alpha-3 format). + The country's two-letter code (ISO 3166-1 alpha-2 format). - :param iso_code3_letter: The iso_code3_letter of this RestCountry. + :param iso_code2: The iso_code2 of this RestCountry. :type: str """ - self._iso_code3_letter = iso_code3_letter + self._iso_code2 = iso_code2 @property - def address_format(self): - """Gets the address_format of this RestCountry. + def iso_code3(self): + """Gets the iso_code3 of this RestCountry. - Specifies the country's way of formatting addresses. + The country's three-letter code (ISO 3166-1 alpha-3 format). - :return: The address_format of this RestCountry. - :rtype: RestAddressFormat + :return: The iso_code3 of this RestCountry. + :rtype: str """ - return self._address_format + return self._iso_code3 - @address_format.setter - def address_format(self, address_format): - """Sets the address_format of this RestCountry. + @iso_code3.setter + def iso_code3(self, iso_code3): + """Sets the iso_code3 of this RestCountry. - Specifies the country's way of formatting addresses. + The country's three-letter code (ISO 3166-1 alpha-3 format). - :param address_format: The address_format of this RestCountry. - :type: RestAddressFormat + :param iso_code3: The iso_code3 of this RestCountry. + :type: str """ - self._address_format = address_format + self._iso_code3 = iso_code3 @property def name(self): diff --git a/wallee/models/subscription_component_configuration.py b/wallee/models/subscription_component_configuration.py index 389aeb7..fadcf76 100644 --- a/wallee/models/subscription_component_configuration.py +++ b/wallee/models/subscription_component_configuration.py @@ -10,22 +10,31 @@ class SubscriptionComponentConfiguration: swagger_types = { 'component': 'int', + 'id': 'int', + 'linked_space_id': 'int', 'quantity': 'float', + 'version': 'int', } attribute_map = { - 'component': 'component','quantity': 'quantity', + 'component': 'component','id': 'id','linked_space_id': 'linkedSpaceId','quantity': 'quantity','version': 'version', } _component = None + _id = None + _linked_space_id = None _quantity = None + _version = None def __init__(self, **kwargs): self.discriminator = None self.component = kwargs.get('component', None) + self.id = kwargs.get('id', None) + self.linked_space_id = kwargs.get('linked_space_id', None) self.quantity = kwargs.get('quantity', None) + self.version = kwargs.get('version', None) @@ -52,6 +61,52 @@ def component(self, component): self._component = component + @property + def id(self): + """Gets the id of this SubscriptionComponentConfiguration. + + A unique identifier for the object. + + :return: The id of this SubscriptionComponentConfiguration. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SubscriptionComponentConfiguration. + + A unique identifier for the object. + + :param id: The id of this SubscriptionComponentConfiguration. + :type: int + """ + + self._id = id + + @property + def linked_space_id(self): + """Gets the linked_space_id of this SubscriptionComponentConfiguration. + + The ID of the space this object belongs to. + + :return: The linked_space_id of this SubscriptionComponentConfiguration. + :rtype: int + """ + return self._linked_space_id + + @linked_space_id.setter + def linked_space_id(self, linked_space_id): + """Sets the linked_space_id of this SubscriptionComponentConfiguration. + + The ID of the space this object belongs to. + + :param linked_space_id: The linked_space_id of this SubscriptionComponentConfiguration. + :type: int + """ + + self._linked_space_id = linked_space_id + @property def quantity(self): """Gets the quantity of this SubscriptionComponentConfiguration. @@ -75,6 +130,29 @@ def quantity(self, quantity): self._quantity = quantity + @property + def version(self): + """Gets the version of this SubscriptionComponentConfiguration. + + The version is used for optimistic locking and incremented whenever the object is updated. + + :return: The version of this SubscriptionComponentConfiguration. + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SubscriptionComponentConfiguration. + + The version is used for optimistic locking and incremented whenever the object is updated. + + :param version: The version of this SubscriptionComponentConfiguration. + :type: int + """ + + self._version = version + def to_dict(self): result = {} diff --git a/wallee/models/wallet_type.py b/wallee/models/wallet_type.py index 8cfbfe1..fa611d5 100644 --- a/wallee/models/wallet_type.py +++ b/wallee/models/wallet_type.py @@ -1,11 +1,146 @@ # coding: utf-8 -from enum import Enum, unique +import pprint +import six +from enum import Enum -@unique -class WalletType(Enum): + +class WalletType: + + swagger_types = { + + 'description': 'dict(str, str)', + 'id': 'int', + 'name': 'dict(str, str)', + } + + attribute_map = { + 'description': 'description','id': 'id','name': 'name', + } + + + _description = None + _id = None + _name = None + + def __init__(self, **kwargs): + self.discriminator = None + + self.description = kwargs.get('description', None) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + + + + @property + def description(self): + """Gets the description of this WalletType. + + The localized description of the object. + + :return: The description of this WalletType. + :rtype: dict(str, str) + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this WalletType. + + The localized description of the object. + + :param description: The description of this WalletType. + :type: dict(str, str) + """ + + self._description = description + + @property + def id(self): + """Gets the id of this WalletType. + + A unique identifier for the object. + + :return: The id of this WalletType. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this WalletType. + + A unique identifier for the object. + + :param id: The id of this WalletType. + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this WalletType. + + The localized name of the object. + + :return: The name of this WalletType. + :rtype: dict(str, str) + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this WalletType. + + The localized name of the object. + + :param name: The name of this WalletType. + :type: dict(str, str) + """ + + self._name = name - APPLE_PAY = "APPLE_PAY" - CLICK_TO_PAY = "CLICK_TO_PAY" - NONE = "NONE" + def to_dict(self): + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif isinstance(value, Enum): + result[attr] = value.value + else: + result[attr] = value + if issubclass(WalletType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + return pprint.pformat(self.to_dict()) + + def __repr__(self): + return self.to_str() + + def __eq__(self, other): + if not isinstance(other, WalletType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/wallee/models/webhook_encryption_public_key.py b/wallee/models/webhook_encryption_public_key.py new file mode 100644 index 0000000..84b78af --- /dev/null +++ b/wallee/models/webhook_encryption_public_key.py @@ -0,0 +1,120 @@ +# coding: utf-8 +import pprint +import six +from enum import Enum + + + +class WebhookEncryptionPublicKey: + + swagger_types = { + + 'id': 'str', + 'public_key': 'str', + } + + attribute_map = { + 'id': 'id','public_key': 'publicKey', + } + + + _id = None + _public_key = None + + def __init__(self, **kwargs): + self.discriminator = None + + self.id = kwargs.get('id', None) + self.public_key = kwargs.get('public_key', None) + + + + @property + def id(self): + """Gets the id of this WebhookEncryptionPublicKey. + + The ID of encryption key + + :return: The id of this WebhookEncryptionPublicKey. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this WebhookEncryptionPublicKey. + + The ID of encryption key + + :param id: The id of this WebhookEncryptionPublicKey. + :type: str + """ + + self._id = id + + @property + def public_key(self): + """Gets the public_key of this WebhookEncryptionPublicKey. + + The BASE64 encoded public key + + :return: The public_key of this WebhookEncryptionPublicKey. + :rtype: str + """ + return self._public_key + + @public_key.setter + def public_key(self, public_key): + """Sets the public_key of this WebhookEncryptionPublicKey. + + The BASE64 encoded public key + + :param public_key: The public_key of this WebhookEncryptionPublicKey. + :type: str + """ + + self._public_key = public_key + + + def to_dict(self): + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif isinstance(value, Enum): + result[attr] = value.value + else: + result[attr] = value + if issubclass(WebhookEncryptionPublicKey, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + return pprint.pformat(self.to_dict()) + + def __repr__(self): + return self.to_str() + + def __eq__(self, other): + if not isinstance(other, WebhookEncryptionPublicKey): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/wallee/rest.py b/wallee/rest.py index 95e7de5..e8a0df2 100644 --- a/wallee/rest.py +++ b/wallee/rest.py @@ -31,11 +31,12 @@ def __init__(self, resp): def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.urllib3_response.headers + def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.urllib3_response.headers.get(name, default) class RESTClientObject: