splitit-apimatic-sdk 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- splitit_apimatic_sdk-1.0.0.dist-info/METADATA +135 -0
- splitit_apimatic_sdk-1.0.0.dist-info/RECORD +92 -0
- splitit_apimatic_sdk-1.0.0.dist-info/WHEEL +5 -0
- splitit_apimatic_sdk-1.0.0.dist-info/licenses/LICENSE +28 -0
- splitit_apimatic_sdk-1.0.0.dist-info/top_level.txt +1 -0
- splititwebapiv4/__init__.py +12 -0
- splititwebapiv4/api_helper.py +19 -0
- splititwebapiv4/configuration.py +267 -0
- splititwebapiv4/controllers/__init__.py +7 -0
- splititwebapiv4/controllers/base_controller.py +67 -0
- splititwebapiv4/controllers/installment_plan_controller.py +430 -0
- splititwebapiv4/controllers/o_auth_authorization_controller.py +87 -0
- splititwebapiv4/exceptions/__init__.py +7 -0
- splititwebapiv4/exceptions/api_error_response_exception.py +71 -0
- splititwebapiv4/exceptions/api_exception.py +36 -0
- splititwebapiv4/exceptions/o_auth_provider_exception.py +73 -0
- splititwebapiv4/http/__init__.py +11 -0
- splititwebapiv4/http/auth/__init__.py +6 -0
- splititwebapiv4/http/auth/api_key.py +100 -0
- splititwebapiv4/http/auth/o_auth_2.py +350 -0
- splititwebapiv4/http/http_call_back.py +20 -0
- splititwebapiv4/http/http_client_provider.py +23 -0
- splititwebapiv4/http/http_method_enum.py +25 -0
- splititwebapiv4/http/http_request.py +55 -0
- splititwebapiv4/http/http_response.py +45 -0
- splititwebapiv4/http/proxy_settings.py +50 -0
- splititwebapiv4/models/__init__.py +66 -0
- splititwebapiv4/models/amount_data.py +98 -0
- splititwebapiv4/models/api_error_model.py +154 -0
- splititwebapiv4/models/apr_data.py +98 -0
- splititwebapiv4/models/authorization_status_enum.py +46 -0
- splititwebapiv4/models/authorize_authorization_data.py +265 -0
- splititwebapiv4/models/authorize_request.py +178 -0
- splititwebapiv4/models/authorize_response.py +357 -0
- splititwebapiv4/models/billing_address_data.py +200 -0
- splititwebapiv4/models/card_details.py +170 -0
- splititwebapiv4/models/card_validity_request.py +89 -0
- splititwebapiv4/models/card_validity_response.py +106 -0
- splititwebapiv4/models/checkout_url_data.py +110 -0
- splititwebapiv4/models/content_segment.py +154 -0
- splititwebapiv4/models/external_provider_types_enum.py +52 -0
- splititwebapiv4/models/inline_content.py +93 -0
- splititwebapiv4/models/installment_item.py +141 -0
- splititwebapiv4/models/installment_plan_details_response.py +459 -0
- splititwebapiv4/models/installment_plan_search_details_response.py +93 -0
- splititwebapiv4/models/installment_plan_search_request.py +109 -0
- splititwebapiv4/models/installment_plan_status_enum.py +70 -0
- splititwebapiv4/models/installment_status_enum.py +61 -0
- splititwebapiv4/models/masked_card_details.py +131 -0
- splititwebapiv4/models/metadata_item.py +108 -0
- splititwebapiv4/models/o_auth_provider_error_enum.py +67 -0
- splititwebapiv4/models/o_auth_scope_o_auth_2_enum.py +42 -0
- splititwebapiv4/models/o_auth_token.py +113 -0
- splititwebapiv4/models/offer_item.py +277 -0
- splititwebapiv4/models/offers_billing_address.py +170 -0
- splititwebapiv4/models/offers_card_details.py +170 -0
- splititwebapiv4/models/offers_merchant_details.py +125 -0
- splititwebapiv4/models/offers_payment_method.py +82 -0
- splititwebapiv4/models/offers_payment_method_response.py +138 -0
- splititwebapiv4/models/offers_request.py +217 -0
- splititwebapiv4/models/offers_response.py +241 -0
- splititwebapiv4/models/offers_shopper_details.py +185 -0
- splititwebapiv4/models/offers_store_location.py +170 -0
- splititwebapiv4/models/payment_link_request.py +329 -0
- splititwebapiv4/models/payment_link_response.py +171 -0
- splititwebapiv4/models/payment_method.py +76 -0
- splititwebapiv4/models/payment_method_data.py +120 -0
- splititwebapiv4/models/payment_method_type_enum.py +40 -0
- splititwebapiv4/models/pis_error_codes_enum.py +763 -0
- splititwebapiv4/models/plan_authorization_data.py +290 -0
- splititwebapiv4/models/plan_links_data.py +154 -0
- splititwebapiv4/models/plan_status_enum.py +52 -0
- splititwebapiv4/models/processing_data.py +85 -0
- splititwebapiv4/models/purchase_method_enum.py +55 -0
- splititwebapiv4/models/redirect_urls.py +121 -0
- splititwebapiv4/models/refund_item.py +215 -0
- splititwebapiv4/models/refund_request.py +98 -0
- splititwebapiv4/models/refund_response.py +167 -0
- splititwebapiv4/models/shipping_status_enum.py +46 -0
- splititwebapiv4/models/shopper_details_data.py +205 -0
- splititwebapiv4/models/three_ds_authentication_data.py +108 -0
- splititwebapiv4/models/three_ds_execute.py +85 -0
- splititwebapiv4/models/three_ds_redirect_data.py +154 -0
- splititwebapiv4/models/three_ds_request_data.py +140 -0
- splititwebapiv4/models/update_offers_payment_method.py +81 -0
- splititwebapiv4/models/update_offers_request.py +171 -0
- splititwebapiv4/models/update_order_request.py +152 -0
- splititwebapiv4/models/update_order_response.py +198 -0
- splititwebapiv4/models/validation_error.py +108 -0
- splititwebapiv4/splititwebapiv_4_client.py +93 -0
- splititwebapiv4/utilities/__init__.py +6 -0
- splititwebapiv4/utilities/file_wrapper.py +45 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: splitit-apimatic-sdk
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: SDK for Splitit webapi
|
|
5
|
+
Author-email: Muhammad Rafay <muhammad.rafay@apimatic.io>
|
|
6
|
+
Project-URL: Documentation, https://www.splitit.com/
|
|
7
|
+
Requires-Python: >=3.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: apimatic-core>=0.2.24,~=0.2.0
|
|
11
|
+
Requires-Dist: apimatic-core-interfaces>=0.1.8,~=0.1.0
|
|
12
|
+
Requires-Dist: apimatic-requests-client-adapter>=0.1.10,~=0.1.0
|
|
13
|
+
Requires-Dist: python-dotenv<2.0,>=0.21
|
|
14
|
+
Provides-Extra: testutils
|
|
15
|
+
Requires-Dist: pytest>=7.2.2; extra == "testutils"
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Getting Started with splitit-web-api-v4
|
|
20
|
+
|
|
21
|
+
## Introduction
|
|
22
|
+
|
|
23
|
+
Splitit Orchestration API for managing installment plans.
|
|
24
|
+
|
|
25
|
+
## Install the Package
|
|
26
|
+
|
|
27
|
+
The package is compatible with Python versions `3.7+`.
|
|
28
|
+
Install the package from PyPi using the following pip command:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install splitit-apimatic-sdk==1.0.0
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
You can also view the package at:
|
|
35
|
+
https://pypi.python.org/pypi/splitit-apimatic-sdk/1.0.0
|
|
36
|
+
|
|
37
|
+
## Initialize the API Client
|
|
38
|
+
|
|
39
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/client.md)
|
|
40
|
+
|
|
41
|
+
The following parameters are configurable for the API Client:
|
|
42
|
+
|
|
43
|
+
| Parameter | Type | Description |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| environment | [`Environment`](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/README.md#environments) | The API environment. <br> **Default: `Environment.SANDBOX`** |
|
|
46
|
+
| http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
|
|
47
|
+
| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
|
|
48
|
+
| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
|
|
49
|
+
| timeout | `float` | The value to use for connection timeout. <br> **Default: 60** |
|
|
50
|
+
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
51
|
+
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
|
|
52
|
+
| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
53
|
+
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
|
|
54
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
55
|
+
| o_auth_2_credentials | [`OAuth2Credentials`](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
|
|
56
|
+
| api_key_credentials | [`ApiKeyCredentials`](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
|
|
57
|
+
|
|
58
|
+
The API client can be initialized as follows:
|
|
59
|
+
|
|
60
|
+
### Code-Based Client Initialization
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from splititwebapiv4.configuration import Environment
|
|
64
|
+
from splititwebapiv4.http.auth.api_key import ApiKeyCredentials
|
|
65
|
+
from splititwebapiv4.http.auth.o_auth_2 import OAuth2Credentials
|
|
66
|
+
from splititwebapiv4.models.o_auth_scope_o_auth_2_enum import OAuthScopeOAuth2Enum
|
|
67
|
+
from splititwebapiv4.splititwebapiv_4_client import Splititwebapiv4Client
|
|
68
|
+
|
|
69
|
+
client = Splititwebapiv4Client(
|
|
70
|
+
o_auth_2_credentials=OAuth2Credentials(
|
|
71
|
+
o_auth_client_id='OAuthClientId',
|
|
72
|
+
o_auth_client_secret='OAuthClientSecret',
|
|
73
|
+
o_auth_scopes=[
|
|
74
|
+
OAuthScopeOAuth2Enum.API_V4
|
|
75
|
+
]
|
|
76
|
+
),
|
|
77
|
+
api_key_credentials=ApiKeyCredentials(
|
|
78
|
+
x_splitit_api_key='X-Splitit-Api-Key'
|
|
79
|
+
),
|
|
80
|
+
environment=Environment.SANDBOX
|
|
81
|
+
)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Environment-Based Client Initialization
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from splititwebapiv4.splititwebapiv_4_client import Splititwebapiv4Client
|
|
88
|
+
|
|
89
|
+
# Specify the path to your .env file if it’s located outside the project’s root directory.
|
|
90
|
+
client = Splititwebapiv4Client.from_environment(dotenv_path='/path/to/.env')
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
See the [Environment-Based Client Initialization](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/environment-based-client-initialization.md) section for details.
|
|
94
|
+
|
|
95
|
+
## Environments
|
|
96
|
+
|
|
97
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
|
98
|
+
|
|
99
|
+
### Fields
|
|
100
|
+
|
|
101
|
+
| Name | Description |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| SANDBOX | **Default** Sandbox Environment (Transactional API) |
|
|
104
|
+
| PRODUCTION | Production Environment (Transactional API) |
|
|
105
|
+
|
|
106
|
+
## Authorization
|
|
107
|
+
|
|
108
|
+
This API uses the following authentication schemes.
|
|
109
|
+
|
|
110
|
+
* [`OAuth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/auth/oauth-2-client-credentials-grant.md)
|
|
111
|
+
* [`ApiKey (Custom Header Signature)`](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/auth/custom-header-signature.md)
|
|
112
|
+
|
|
113
|
+
## List of APIs
|
|
114
|
+
|
|
115
|
+
* [Installment Plan](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/controllers/installment-plan.md)
|
|
116
|
+
|
|
117
|
+
## SDK Infrastructure
|
|
118
|
+
|
|
119
|
+
### Configuration
|
|
120
|
+
|
|
121
|
+
* [ProxySettings](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/proxy-settings.md)
|
|
122
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/environment-based-client-initialization.md)
|
|
123
|
+
|
|
124
|
+
### HTTP
|
|
125
|
+
|
|
126
|
+
* [HttpResponse](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/http-response.md)
|
|
127
|
+
* [HttpRequest](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/http-request.md)
|
|
128
|
+
|
|
129
|
+
### Utilities
|
|
130
|
+
|
|
131
|
+
* [ApiHelper](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/api-helper.md)
|
|
132
|
+
* [HttpDateTime](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/http-date-time.md)
|
|
133
|
+
* [RFC3339DateTime](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/rfc3339-date-time.md)
|
|
134
|
+
* [UnixDateTime](https://www.github.com/sdks-io/splitit-apimatic-python-sdk/tree/1.0.0/doc/unix-date-time.md)
|
|
135
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
splitit_apimatic_sdk-1.0.0.dist-info/licenses/LICENSE,sha256=o5qrSek4x1g9YArvhgZmSORdSoQn7unl7I44zmz7iBc,1213
|
|
2
|
+
splititwebapiv4/__init__.py,sha256=2ad6mgQ67jrSPNXKWTPFS5RDnW0OQ4hZBBj8cXT3LCk,278
|
|
3
|
+
splititwebapiv4/api_helper.py,sha256=xhUGtKUXpNA67sljmZMIhSjKbhTpuxNyAu8WKHFqb6I,543
|
|
4
|
+
splititwebapiv4/configuration.py,sha256=VgA8t_3L97c4rLCL9Yg699MSJMMYv3-J9bg_HWW38DA,10042
|
|
5
|
+
splititwebapiv4/splititwebapiv_4_client.py,sha256=ucWKNkUxRyEXJJqh64vYfnttuENyzYX2d4iFaYGaHEc,3476
|
|
6
|
+
splititwebapiv4/controllers/__init__.py,sha256=baN4iF714IZGxlP_RP0DiHjutZyqr1_llRbDNjQQsQc,220
|
|
7
|
+
splititwebapiv4/controllers/base_controller.py,sha256=ZcDTpH60srzF520VWsdQzkM5JGpBHrLYRqsJPyaDU0Q,1991
|
|
8
|
+
splititwebapiv4/controllers/installment_plan_controller.py,sha256=MPIlTFjweikqxpSEDSPORvJzdgzs838eqzGQ_WCMqTA,17599
|
|
9
|
+
splititwebapiv4/controllers/o_auth_authorization_controller.py,sha256=a6cvOxky6DHUbLtLT6k625zJ6j40llDIGdai6h10DQo,3301
|
|
10
|
+
splititwebapiv4/exceptions/__init__.py,sha256=oVVA5zmnD3UnyeQkdrBuGdZl2mTSg4OlABTqZXa5DkQ,213
|
|
11
|
+
splititwebapiv4/exceptions/api_error_response_exception.py,sha256=GA0lw-INwCNkjYk8fMoTk7Hqig_GQ99q94aYnKCS8OQ,2213
|
|
12
|
+
splititwebapiv4/exceptions/api_exception.py,sha256=AKo14tMYqxcsU3QUjzU9wWjLAptF-O0ahkwJGt7UnBc,1094
|
|
13
|
+
splititwebapiv4/exceptions/o_auth_provider_exception.py,sha256=yp5U5zuqu-hewHZ33eR4_JEzZ3OG6guQ_NagFpNKO90,2366
|
|
14
|
+
splititwebapiv4/http/__init__.py,sha256=0inmS5sUVyFFK7c7ivfex-inFU1efoAoOvqBEEhTLVo,276
|
|
15
|
+
splititwebapiv4/http/http_call_back.py,sha256=wHlm85MgWA76fXZlxjCWycxzcxEtYqw-LT9tkGD07Lw,469
|
|
16
|
+
splititwebapiv4/http/http_client_provider.py,sha256=wdeZEQhZ5-s27XJaocW0wQN7mH3sGI9OPH-wMH_gvf4,737
|
|
17
|
+
splititwebapiv4/http/http_method_enum.py,sha256=nhV2nA21Oo5gVXMMD6ITIXsZ_KlBMN6Jdm0fIrI1ZtA,484
|
|
18
|
+
splititwebapiv4/http/http_request.py,sha256=rVyZzLpnQ0iLGcBy2adbXh6zyq45OSkgrYSp4DKHB3s,1884
|
|
19
|
+
splititwebapiv4/http/http_response.py,sha256=vjgsavh37m74rmLBap4QPo1kspLsDNmfkanFYWOexQg,1479
|
|
20
|
+
splititwebapiv4/http/proxy_settings.py,sha256=XYFiF7dxbUczfxHmwcd-lar-k4rephBYsXOFhwUByig,1458
|
|
21
|
+
splititwebapiv4/http/auth/__init__.py,sha256=o8ETmHJpc3CtkJnHrIq1khS-ThWqTSGpimfbjbaK4kQ,153
|
|
22
|
+
splititwebapiv4/http/auth/api_key.py,sha256=QdzkYIqUzi3AbTwPQ1PL-IxV4UWnxiYtDZo_gc9FDrg,2736
|
|
23
|
+
splititwebapiv4/http/auth/o_auth_2.py,sha256=LgrDcTad4tvbBhJygD6EurWoJr8vqfgCCimLAK_TvfQ,12178
|
|
24
|
+
splititwebapiv4/models/__init__.py,sha256=Ji_O5pLFYX_G6KsHV7JjFVFdKfBq8-Ei4YM0cvL71AE,1906
|
|
25
|
+
splititwebapiv4/models/amount_data.py,sha256=zvfs4Gx27sLe6AeIscfsUri0_OokcYg0F7fyOaTWvBE,2607
|
|
26
|
+
splititwebapiv4/models/api_error_model.py,sha256=6ZnfDOWTW0jqyJwZXpWB5XgZu7xt7fNdyLDceMIj1OE,4511
|
|
27
|
+
splititwebapiv4/models/apr_data.py,sha256=y0Cg867dwt5bYgxveAkc-qWrWONrhC1TRReQHq4mN2U,2598
|
|
28
|
+
splititwebapiv4/models/authorization_status_enum.py,sha256=XcBd1rc1OhfFV65pKkoLucSkKP9WAy2JUkcJBTLVe7Y,1297
|
|
29
|
+
splititwebapiv4/models/authorize_authorization_data.py,sha256=W542Xry88ygO3_JtA1KmmvLDsPTTovHmXUfpH9pBXPM,9501
|
|
30
|
+
splititwebapiv4/models/authorize_request.py,sha256=Qjm15eBeK9qCJJVmQO0WGHcd0_yigRpXe82LMPDGtKY,6213
|
|
31
|
+
splititwebapiv4/models/authorize_response.py,sha256=XUsh0NdQyImW8X2cro5VF4e-cFNloZwj2-rZ1ctfOTs,12676
|
|
32
|
+
splititwebapiv4/models/billing_address_data.py,sha256=_6GIijs3HAs1uy6y0kttqsF2uLd_3aZad-q-P6URV5c,5649
|
|
33
|
+
splititwebapiv4/models/card_details.py,sha256=c5E6hqNVlyg94MgmA32VWgfQW7t3HsdPcsr9wjRe-F0,5059
|
|
34
|
+
splititwebapiv4/models/card_validity_request.py,sha256=ThpfNu8qrxhfaAYsOXeq4nGcEeqjoOljDLoTFhei9GU,2553
|
|
35
|
+
splititwebapiv4/models/card_validity_response.py,sha256=pTU2QQuIc4S-lnRtmSaRk2P_RCR3IAMlz6NqRIJZZIA,3174
|
|
36
|
+
splititwebapiv4/models/checkout_url_data.py,sha256=ROyECFAgpkvGlAPLfKSWZWkz8L14GWWhUTLWbX7TY0o,3113
|
|
37
|
+
splititwebapiv4/models/content_segment.py,sha256=Oz3otbq1gtpHBoy5BroSwUz0AmOpcXX-dWsZqPVK9EM,4099
|
|
38
|
+
splititwebapiv4/models/external_provider_types_enum.py,sha256=V4WSwtCvfJCYrrdDHA73HV1gmLDyAR5UQFz9AQDbHrE,1436
|
|
39
|
+
splititwebapiv4/models/inline_content.py,sha256=yNuyOdJEeenXGAZSwnnQ3S3zojtcMV74Q8ryK6fc2zs,2510
|
|
40
|
+
splititwebapiv4/models/installment_item.py,sha256=nwiQCM0HDKt_JZS8NGwQR5kqgn2BzzwD5q362FptITk,4546
|
|
41
|
+
splititwebapiv4/models/installment_plan_details_response.py,sha256=1sj5JsAT54lF3HdYqGXW5gvBAMnSWM7se2UzES_w5-Q,16180
|
|
42
|
+
splititwebapiv4/models/installment_plan_search_details_response.py,sha256=OOiBa4nVbEHfvgbw-XnSSaF6QDg7lYbdWWN0ycW1W-w,2682
|
|
43
|
+
splititwebapiv4/models/installment_plan_search_request.py,sha256=UWPzPKe_Gnni_KvDeZViAH5mUlIiEXOsu0MzqYUGf6k,3831
|
|
44
|
+
splititwebapiv4/models/installment_plan_status_enum.py,sha256=HAV66gjs9XJh0pP2swgmuRIAHOv1ErsWXr4WgjYkAlc,2032
|
|
45
|
+
splititwebapiv4/models/installment_status_enum.py,sha256=vfhr0LkhiZhos5J2Uz5BCkc5ZJaQ7WzwuG6t-G7PjP8,1730
|
|
46
|
+
splititwebapiv4/models/masked_card_details.py,sha256=vVV6Ky4iCQUsZgHKCJLeNl5sIvHtR37wFGvg9r6PhP8,3759
|
|
47
|
+
splititwebapiv4/models/metadata_item.py,sha256=iO_ySMoamXFvMbWub3vKMCiakZmGqtPI3r5q7erV5MQ,2794
|
|
48
|
+
splititwebapiv4/models/o_auth_provider_error_enum.py,sha256=ApoHaDUm2m1lktGSh7FLNzlAEcJZ1OE59anxhmV3OXs,2532
|
|
49
|
+
splititwebapiv4/models/o_auth_scope_o_auth_2_enum.py,sha256=AMItGwXOjR0XRK4rUMO7fMOTJUPKk9G0ffaKLxMxS-I,1176
|
|
50
|
+
splititwebapiv4/models/o_auth_token.py,sha256=IE5PfBsZOTiZzWz7wSS8iyfZyrSh0Mx0Yl7VEawGwjs,3585
|
|
51
|
+
splititwebapiv4/models/offer_item.py,sha256=sMac3AWfiWumCxMbQBVUq6fQp1hkcoZZnJZpKCt_h00,9689
|
|
52
|
+
splititwebapiv4/models/offers_billing_address.py,sha256=WkoLfmDSDqFOT7WK2aIrTRXY94ovvN57GlVSViz08BY,4866
|
|
53
|
+
splititwebapiv4/models/offers_card_details.py,sha256=bt5HcsPyEg-2P0nsrk-e4PwX2cXaEv_vyfb1xF7zTWU,5077
|
|
54
|
+
splititwebapiv4/models/offers_merchant_details.py,sha256=PQqyH1ZV1W299Z0KL6QSFMlHCi3H4_IiZX7zsd3zX-4,3765
|
|
55
|
+
splititwebapiv4/models/offers_payment_method.py,sha256=BuHeNsA4zzDb-sM7zmN0qCUi7awidddyK_JmSiEdDvk,2399
|
|
56
|
+
splititwebapiv4/models/offers_payment_method_response.py,sha256=AqylkFOU0WEIa2vnLpdth9AQaZqqhUphXNRUVwpC0MQ,4021
|
|
57
|
+
splititwebapiv4/models/offers_request.py,sha256=GBaentE9ZHmbt5H4b7iOWl_kxY0TTcrMrUJ6aMxpSjQ,7777
|
|
58
|
+
splititwebapiv4/models/offers_response.py,sha256=1Gj-8CTuel-r97tCZwd7WcyGdtuFhG0vpXaLm8YXygQ,8490
|
|
59
|
+
splititwebapiv4/models/offers_shopper_details.py,sha256=0B-veMw45e5ILnztX7EQyOeBF9gn54CvrBZYpXDefLA,5901
|
|
60
|
+
splititwebapiv4/models/offers_store_location.py,sha256=W4mFRcknRsaw523RGr_1hc1d-CqjoxV_h0angnyPRmg,4863
|
|
61
|
+
splititwebapiv4/models/payment_link_request.py,sha256=g9zZ1Pej6uOAMtFOTeAwsAqQYt_j7JhW5nXrBr0Cs3U,11762
|
|
62
|
+
splititwebapiv4/models/payment_link_response.py,sha256=JoWFbQbV6GwXcZDiz31KXzxc0qtIuevZnFmMQrVB5O8,5922
|
|
63
|
+
splititwebapiv4/models/payment_method.py,sha256=rEz-Gc-CZaIMk2suMxVmH8CK0jg2zRxIrONO8qtL2PA,2093
|
|
64
|
+
splititwebapiv4/models/payment_method_data.py,sha256=l5LNf4flE547oI-6L0SiQw7W_C_lM_wRqCZXqRg08CA,3375
|
|
65
|
+
splititwebapiv4/models/payment_method_type_enum.py,sha256=9Q21b76AJOycZGQ7kKf0HL7aHT1AKegHaT01PPHDiE8,1141
|
|
66
|
+
splititwebapiv4/models/pis_error_codes_enum.py,sha256=P2EjCFCbKFqum3fFY9cmdJkObT9AhQV0Tz5ipKswors,33051
|
|
67
|
+
splititwebapiv4/models/plan_authorization_data.py,sha256=oWNUxi7c2ByQXNHW6hOnzg1Jk8TcD8KK7BYYFM7Shlc,10289
|
|
68
|
+
splititwebapiv4/models/plan_links_data.py,sha256=hnTzA__yVFX6N4Y8IUtSoKhaK_kXAWRCEVqjDpaKVHQ,4231
|
|
69
|
+
splititwebapiv4/models/plan_status_enum.py,sha256=H5cdS3_oLAdK2wuBHv-mC6hAp5l2RQRgRVh1H48FZJU,1453
|
|
70
|
+
splititwebapiv4/models/processing_data.py,sha256=7o5YY5DqbxRNJNgoiWaiw3truxwmxGphGIPmVLQy7fs,2410
|
|
71
|
+
splititwebapiv4/models/purchase_method_enum.py,sha256=hjuu7z9_k91uWGVFbmH2iYcvPBelHXAgXvZpclzvlFw,1529
|
|
72
|
+
splititwebapiv4/models/redirect_urls.py,sha256=_iyvkCmI7CSbjQC1TJOZrAt6sJkszBjKo6oj9-2E6JU,3579
|
|
73
|
+
splititwebapiv4/models/refund_item.py,sha256=CB0Jpek1LmOxjcZ-rG--vJeR1FbYXRe8F5aBfUyAsGw,7344
|
|
74
|
+
splititwebapiv4/models/refund_request.py,sha256=xWk_JMw79EHQi-P0qLPqt--HlUiLDhXd_Ua_OHy6lMg,2759
|
|
75
|
+
splititwebapiv4/models/refund_response.py,sha256=2sA99Ie9iC5WstoJ3X2EU3VDtCD-Rfu3CGq8mJEQplY,5437
|
|
76
|
+
splititwebapiv4/models/shipping_status_enum.py,sha256=C7KISGgj4TLuHaokoecoznW7EiG3p0Bl00yq2Xwbl-Q,1292
|
|
77
|
+
splititwebapiv4/models/shopper_details_data.py,sha256=vxwsPtH4scCEbTERd9SHvIlZNjRZimLwoeKqSee6uuc,6252
|
|
78
|
+
splititwebapiv4/models/three_ds_authentication_data.py,sha256=e4EH1dCI86Fm5APO27q_g2vDHB8XPMxGLXfqO_Gs8Ts,3538
|
|
79
|
+
splititwebapiv4/models/three_ds_execute.py,sha256=Dv791cfS9lVftHptZzscY0-ItgjKQxi9VE3dIPVKBSk,2244
|
|
80
|
+
splititwebapiv4/models/three_ds_redirect_data.py,sha256=oumzNmHZ61KIkd__3xWZLKMEBtVmGUSKdLkxgq6khVU,4441
|
|
81
|
+
splititwebapiv4/models/three_ds_request_data.py,sha256=Ina-duIn5BmOPm77qrGIaWg2jbMOt7VYObvqvjGgH1M,4402
|
|
82
|
+
splititwebapiv4/models/update_offers_payment_method.py,sha256=6WPiRfnKAdBSU1mpZPoCtOvjcZ7vXCBwOqVOdcautbU,2374
|
|
83
|
+
splititwebapiv4/models/update_offers_request.py,sha256=5E9OBuPqETKAZNXe1-w9UlNf7_zWU8rAQLx_OUxSSkw,5705
|
|
84
|
+
splititwebapiv4/models/update_order_request.py,sha256=rgDhBOm-DRcPOVeWeXskbYMu1zfM_VbiwPWUixvkeq4,5053
|
|
85
|
+
splititwebapiv4/models/update_order_response.py,sha256=FskB09G3tapc9qZcIETtunnLWHSCleucXF8yCrXa-Bc,6828
|
|
86
|
+
splititwebapiv4/models/validation_error.py,sha256=lhSzoxCvonR-Z6WvMqHKQIbsRmAxiMsw8f84uJe2xUc,2897
|
|
87
|
+
splititwebapiv4/utilities/__init__.py,sha256=pq3szt1E0U5M7qGCe9Vdl_jAM7wSgi8mj-UB-Flp6Ow,160
|
|
88
|
+
splititwebapiv4/utilities/file_wrapper.py,sha256=zsfYvIF4gzumrqrZnsBmcHB9EUPRzAX2oohzQBN14nw,1430
|
|
89
|
+
splitit_apimatic_sdk-1.0.0.dist-info/METADATA,sha256=lhdXMZgQAOEZBmkt_wvlw2Bfc9XLmrkNbxY8t6epuQY,6263
|
|
90
|
+
splitit_apimatic_sdk-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
91
|
+
splitit_apimatic_sdk-1.0.0.dist-info/top_level.txt,sha256=Afw-HrP-tv3lU1534DleG15mV_H4b3GvybxyDKEwhEw,16
|
|
92
|
+
splitit_apimatic_sdk-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
License:
|
|
2
|
+
========
|
|
3
|
+
The MIT License (MIT)
|
|
4
|
+
http://opensource.org/licenses/MIT
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2014 - 2026 APIMATIC Limited
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
|
16
|
+
all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
|
25
|
+
|
|
26
|
+
Trade Mark:
|
|
27
|
+
==========
|
|
28
|
+
APIMATIC is a trade mark for APIMATIC Limited
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
splititwebapiv4
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# ruff: noqa: D104 | Missing docstring in public package
|
|
2
|
+
# ruff: noqa: RUF022 | `__all__` is not sorted
|
|
3
|
+
__all__ = [
|
|
4
|
+
"api_helper",
|
|
5
|
+
"configuration",
|
|
6
|
+
"controllers",
|
|
7
|
+
"exceptions",
|
|
8
|
+
"http",
|
|
9
|
+
"models",
|
|
10
|
+
"splititwebapiv_4_client",
|
|
11
|
+
"utilities",
|
|
12
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""
|
|
2
|
+
splititwebapiv4
|
|
3
|
+
|
|
4
|
+
This file was automatically generated by APIMATIC v3.0 (
|
|
5
|
+
https://www.apimatic.io ).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from apimatic_core.utilities.api_helper import ApiHelper as CoreApiHelper
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class APIHelper(CoreApiHelper):
|
|
12
|
+
"""
|
|
13
|
+
A Helper Class for various functions associated with API Calls.
|
|
14
|
+
|
|
15
|
+
This class contains static methods for operations that need to be
|
|
16
|
+
performed during API requests. All of the methods inside this class are
|
|
17
|
+
static methods, there is no need to ever initialise an instance of this
|
|
18
|
+
class.
|
|
19
|
+
"""
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"""splititwebapiv4.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
import os
|
|
8
|
+
from enum import Enum
|
|
9
|
+
|
|
10
|
+
from apimatic_core.http.configurations.http_client_configuration import (
|
|
11
|
+
HttpClientConfiguration,
|
|
12
|
+
)
|
|
13
|
+
from apimatic_requests_client_adapter.requests_client import (
|
|
14
|
+
RequestsClient,
|
|
15
|
+
)
|
|
16
|
+
from dotenv import load_dotenv
|
|
17
|
+
|
|
18
|
+
from splititwebapiv4.http.proxy_settings import (
|
|
19
|
+
ProxySettings,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Environment(Enum):
|
|
24
|
+
"""An enum for SDK environments."""
|
|
25
|
+
|
|
26
|
+
# Sandbox Environment (Transactional API)
|
|
27
|
+
SANDBOX = 0
|
|
28
|
+
# Production Environment (Transactional API)
|
|
29
|
+
PRODUCTION = 1
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def from_value(cls, value, default=None):
|
|
33
|
+
"""Convert a value (string or int) to an Environment enum member.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
value (Union[str, int]): The value to convert.
|
|
37
|
+
default (Environment): The fallback enum member if conversion fails.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
Environment: Matching enum member or fallback if invalid.
|
|
41
|
+
|
|
42
|
+
"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return default
|
|
45
|
+
|
|
46
|
+
# Try to match directly by enum member
|
|
47
|
+
if isinstance(value, cls):
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
# Handle integer or string conversion
|
|
51
|
+
for member in cls:
|
|
52
|
+
if (str(member.value).lower() == str(value).lower()
|
|
53
|
+
or member.name.lower() == str(value).lower()):
|
|
54
|
+
return member
|
|
55
|
+
|
|
56
|
+
# Fallback to provided default
|
|
57
|
+
return default
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class Server(Enum):
|
|
61
|
+
"""An enum for API servers."""
|
|
62
|
+
|
|
63
|
+
DEFAULT = 0
|
|
64
|
+
ACCESS_TOKEN_SERVER = 1
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_value(cls, value, default=None):
|
|
68
|
+
"""Convert a value (string or int) to a Server enum member.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
value (Union[str, int]): The value to convert.
|
|
72
|
+
default (Server): The fallback enum member if conversion fails.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Server: Matching enum member or fallback if invalid.
|
|
76
|
+
|
|
77
|
+
"""
|
|
78
|
+
if value is None:
|
|
79
|
+
return default
|
|
80
|
+
|
|
81
|
+
# Try to match directly by enum member
|
|
82
|
+
if isinstance(value, cls):
|
|
83
|
+
return value
|
|
84
|
+
|
|
85
|
+
# Handle integer or string conversion
|
|
86
|
+
for member in cls:
|
|
87
|
+
if (str(member.value).lower() == str(value).lower()
|
|
88
|
+
or member.name.lower() == str(value).lower()):
|
|
89
|
+
return member
|
|
90
|
+
|
|
91
|
+
# Fallback to provided default
|
|
92
|
+
return default
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class Configuration(HttpClientConfiguration):
|
|
96
|
+
"""A class used for configuring the SDK by a user."""
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def environment(self):
|
|
100
|
+
"""Return current environment."""
|
|
101
|
+
return self._environment
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def o_auth_2_credentials(self):
|
|
105
|
+
"""Return current o_auth_2_credentials."""
|
|
106
|
+
return self._o_auth_2_credentials
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def api_key_credentials(self):
|
|
110
|
+
"""Return current api_key_credentials."""
|
|
111
|
+
return self._api_key_credentials
|
|
112
|
+
|
|
113
|
+
def __init__(self, http_client_instance=None,
|
|
114
|
+
override_http_client_configuration=False, http_call_back=None,
|
|
115
|
+
timeout=60, max_retries=0, backoff_factor=2, retry_statuses=None,
|
|
116
|
+
retry_methods=None, proxy_settings=None,
|
|
117
|
+
environment=Environment.SANDBOX, o_auth_2_credentials=None,
|
|
118
|
+
api_key_credentials=None):
|
|
119
|
+
"""Initialize Configuration object."""
|
|
120
|
+
if retry_methods is None:
|
|
121
|
+
retry_methods = ["GET", "PUT"]
|
|
122
|
+
|
|
123
|
+
if retry_statuses is None:
|
|
124
|
+
retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521,
|
|
125
|
+
522, 524]
|
|
126
|
+
|
|
127
|
+
super().__init__(
|
|
128
|
+
http_client_instance=http_client_instance,
|
|
129
|
+
override_http_client_configuration=override_http_client_configuration,
|
|
130
|
+
http_call_back=http_call_back, timeout=timeout,
|
|
131
|
+
max_retries=max_retries, backoff_factor=backoff_factor,
|
|
132
|
+
retry_statuses=retry_statuses, retry_methods=retry_methods,
|
|
133
|
+
proxy_settings=proxy_settings,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# Current API environment
|
|
137
|
+
self._environment = environment
|
|
138
|
+
|
|
139
|
+
# The object holding OAuth 2 Client Credentials Grant credentials
|
|
140
|
+
self._o_auth_2_credentials = o_auth_2_credentials
|
|
141
|
+
|
|
142
|
+
# The object holding Custom Header Signature credentials
|
|
143
|
+
self._api_key_credentials = api_key_credentials
|
|
144
|
+
|
|
145
|
+
# The Http Client to use for making requests.
|
|
146
|
+
self.set_http_client(self.create_http_client())
|
|
147
|
+
|
|
148
|
+
def clone_with(self, http_client_instance=None,
|
|
149
|
+
override_http_client_configuration=None, http_call_back=None,
|
|
150
|
+
timeout=None, max_retries=None, backoff_factor=None,
|
|
151
|
+
retry_statuses=None, retry_methods=None, proxy_settings=None,
|
|
152
|
+
environment=None, o_auth_2_credentials=None,
|
|
153
|
+
api_key_credentials=None):
|
|
154
|
+
"""Clone configuration with overrides."""
|
|
155
|
+
http_client_instance = http_client_instance or self.http_client_instance
|
|
156
|
+
override_http_client_configuration =\
|
|
157
|
+
(override_http_client_configuration
|
|
158
|
+
or self.override_http_client_configuration)
|
|
159
|
+
http_call_back = http_call_back or self.http_callback
|
|
160
|
+
timeout = timeout or self.timeout
|
|
161
|
+
max_retries = max_retries or self.max_retries
|
|
162
|
+
backoff_factor = backoff_factor or self.backoff_factor
|
|
163
|
+
retry_statuses = retry_statuses or self.retry_statuses
|
|
164
|
+
retry_methods = retry_methods or self.retry_methods
|
|
165
|
+
proxy_settings = proxy_settings or self.proxy_settings
|
|
166
|
+
environment = environment or self.environment
|
|
167
|
+
o_auth_2_credentials = o_auth_2_credentials or self.o_auth_2_credentials
|
|
168
|
+
api_key_credentials = api_key_credentials or self.api_key_credentials
|
|
169
|
+
return Configuration(
|
|
170
|
+
http_client_instance=http_client_instance,
|
|
171
|
+
override_http_client_configuration=override_http_client_configuration,
|
|
172
|
+
http_call_back=http_call_back, timeout=timeout, max_retries=max_retries,
|
|
173
|
+
backoff_factor=backoff_factor, retry_statuses=retry_statuses,
|
|
174
|
+
retry_methods=retry_methods, proxy_settings=proxy_settings,
|
|
175
|
+
environment=environment, o_auth_2_credentials=o_auth_2_credentials,
|
|
176
|
+
api_key_credentials=api_key_credentials,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
def create_http_client(self):
|
|
180
|
+
"""Create the HTTP client instance."""
|
|
181
|
+
return RequestsClient(
|
|
182
|
+
timeout=self.timeout, max_retries=self.max_retries,
|
|
183
|
+
backoff_factor=self.backoff_factor, retry_statuses=self.retry_statuses,
|
|
184
|
+
retry_methods=self.retry_methods,
|
|
185
|
+
http_client_instance=self.http_client_instance,
|
|
186
|
+
override_http_client_configuration=self.override_http_client_configuration,
|
|
187
|
+
response_factory=self.http_response_factory,
|
|
188
|
+
proxies=self.proxy_settings.to_proxies() if self.proxy_settings else None,
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# All the environments the SDK can run in
|
|
192
|
+
environments = {
|
|
193
|
+
Environment.SANDBOX: {
|
|
194
|
+
Server.DEFAULT: "https://orch-api.sandbox.splitit.com",
|
|
195
|
+
Server.ACCESS_TOKEN_SERVER: "https://id.sandbox.splitit.com/connect",
|
|
196
|
+
},
|
|
197
|
+
Environment.PRODUCTION: {
|
|
198
|
+
Server.DEFAULT: "https://orch-api.splitit.com",
|
|
199
|
+
Server.ACCESS_TOKEN_SERVER: "https://id.sandbox.splitit.com/connect",
|
|
200
|
+
},
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
def get_base_uri(self, server=Server.DEFAULT):
|
|
204
|
+
"""Generate the appropriate base URI for the environment and the server.
|
|
205
|
+
|
|
206
|
+
Args:
|
|
207
|
+
server (Configuration.Server): The server enum for which the base
|
|
208
|
+
URI is required.
|
|
209
|
+
|
|
210
|
+
Returns:
|
|
211
|
+
String: The base URI.
|
|
212
|
+
|
|
213
|
+
"""
|
|
214
|
+
return self.environments[self.environment][server]
|
|
215
|
+
|
|
216
|
+
@classmethod
|
|
217
|
+
def from_environment(cls, dotenv_path=None, **overrides):
|
|
218
|
+
"""Create Configuration object from .env and environment variables.
|
|
219
|
+
|
|
220
|
+
Args:
|
|
221
|
+
dotenv_path (str, optional): Path to the .env file to load.
|
|
222
|
+
If None, the default .env file is used.
|
|
223
|
+
**overrides: Optional values overriding setting from environment variables.
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
Configuration: A configuration object populated with the resolved values.
|
|
227
|
+
|
|
228
|
+
"""
|
|
229
|
+
# load .env automatically
|
|
230
|
+
load_dotenv(dotenv_path or None, override=True)
|
|
231
|
+
|
|
232
|
+
override_http_client_configuration = os.getenv(
|
|
233
|
+
"OVERRIDE_HTTP_CLIENT_CONFIGURATION", "false").lower() == "true"
|
|
234
|
+
timeout = int(os.getenv("TIMEOUT", "60"))
|
|
235
|
+
max_retries = int(os.getenv("MAX_RETRIES", "0"))
|
|
236
|
+
backoff_factor = float(os.getenv("BACKOFF_FACTOR", "2"))
|
|
237
|
+
statuses = os.getenv("RETRY_STATUSES", None)
|
|
238
|
+
retry_statuses = [int(v.strip()) for v in statuses.split(",")
|
|
239
|
+
if v.strip().isdigit()] if statuses else None
|
|
240
|
+
methods = os.getenv("RETRY_METHODS", None)
|
|
241
|
+
retry_methods = [v.strip() for v in methods.split(",") if v.strip()]\
|
|
242
|
+
if methods else None
|
|
243
|
+
environment = Environment.from_value(
|
|
244
|
+
os.getenv("ENVIRONMENT"), Environment.SANDBOX)
|
|
245
|
+
|
|
246
|
+
from splititwebapiv4.http.auth.api_key import (
|
|
247
|
+
ApiKeyCredentials,
|
|
248
|
+
)
|
|
249
|
+
from splititwebapiv4.http.auth.o_auth_2 import (
|
|
250
|
+
OAuth2Credentials,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
# Preparing default configuration
|
|
254
|
+
default_config = cls(
|
|
255
|
+
override_http_client_configuration=override_http_client_configuration,
|
|
256
|
+
timeout=timeout,
|
|
257
|
+
max_retries=max_retries,
|
|
258
|
+
backoff_factor=backoff_factor,
|
|
259
|
+
retry_statuses=retry_statuses,
|
|
260
|
+
retry_methods=retry_methods,
|
|
261
|
+
environment=environment,
|
|
262
|
+
proxy_settings=ProxySettings.from_environment(),
|
|
263
|
+
o_auth_2_credentials=OAuth2Credentials.from_environment(),
|
|
264
|
+
api_key_credentials=ApiKeyCredentials.from_environment(),
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
return default_config.clone_with(**overrides)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""splititwebapiv4.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from apimatic_core.api_call import ApiCall
|
|
7
|
+
from apimatic_core.types.error_case import ErrorCase
|
|
8
|
+
|
|
9
|
+
from splititwebapiv4.exceptions.api_exception import (
|
|
10
|
+
APIException,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BaseController(object):
|
|
15
|
+
"""All controllers inherit from this base class.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
config (Configuration): The HttpClient which a specific controller
|
|
19
|
+
instance will use. By default all the controller objects share
|
|
20
|
+
the same HttpClient. A user can use his own custom HttpClient
|
|
21
|
+
as well.
|
|
22
|
+
http_call_back (HttpCallBack): An object which holds call back
|
|
23
|
+
methods to be called before and after the execution of an HttpRequest.
|
|
24
|
+
new_api_call_builder (APICall): Returns the API Call builder instance.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def user_agent():
|
|
30
|
+
"""Return UserAgent value."""
|
|
31
|
+
return "APIMATIC 3.0"
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def user_agent_parameters():
|
|
35
|
+
"""Return UserAgentParameters value."""
|
|
36
|
+
return {
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@staticmethod
|
|
40
|
+
def global_errors():
|
|
41
|
+
"""Return GlobalErrors value."""
|
|
42
|
+
return {
|
|
43
|
+
"default": ErrorCase()
|
|
44
|
+
.error_message("HTTP response not OK.")
|
|
45
|
+
.exception_type(APIException),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
def __init__(self, config):
|
|
49
|
+
"""Initialize BaseController object."""
|
|
50
|
+
self._config = config.get_http_client_configuration()
|
|
51
|
+
self._http_call_back = self.config.http_callback
|
|
52
|
+
self.api_call = ApiCall(config)
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def config(self):
|
|
56
|
+
"""Return Configuration object."""
|
|
57
|
+
return self._config
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def http_call_back(self):
|
|
61
|
+
"""Return HttpCallBack object."""
|
|
62
|
+
return self._http_call_back
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def new_api_call_builder(self):
|
|
66
|
+
"""Return New ApiCallBuilder object."""
|
|
67
|
+
return self.api_call.new_builder
|