|
1 | | -# openapi-client |
2 | | -Secure API |
| 1 | +# AndDone Client Library - Python |
3 | 2 |
|
4 | | -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 3 | +This client library integrates with AndDone's secure APIs. |
5 | 4 |
|
6 | | -- API version: 2.3 |
7 | | -- Package version: 1.0.0 |
8 | | -- Generator version: 7.9.0 |
9 | | -- Build package: org.openapitools.codegen.languages.PythonClientCodegen |
| 5 | +Please see our developer documentation & API Explorer, linked below, for detailed instructions on how to integrate this into your systems. |
10 | 6 |
|
11 | | -## Requirements. |
| 7 | +**Secure API Python Client** |
12 | 8 |
|
13 | | -Python 3.7+ |
| 9 | +This Python package is an auto-generated client for the AndDone Secure API, built using the [OpenAPI Generator](https://openapi-generator.tech). |
14 | 10 |
|
15 | | -## Installation & Usage |
16 | | -### pip install |
| 11 | +- **API version**: 2.3 |
| 12 | +- **Package version**: 1.0.0 |
| 13 | +- **Generator version**: 7.9.0 |
| 14 | +- **Build package**: `org.openapitools.codegen.languages.PythonClientCodegen` |
| 15 | +- **Developer Documentation**: [DevDocs](https://docs.anddone.com/) |
| 16 | +- **API Explorer**: [AndDone API Explorer](https://docs.anddone.com/explorer/) |
17 | 17 |
|
18 | | -If the python package is hosted on a repository, you can install directly using: |
| 18 | +--- |
19 | 19 |
|
20 | | -```sh |
21 | | -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
22 | | -``` |
23 | | -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
| 20 | +## Table of Contents |
| 21 | +- [Requirements](#requirements) |
| 22 | +- [Installation](#installation) |
| 23 | +- [Configuration](#configuration) |
| 24 | +- [Quickstart](#quickstart) |
| 25 | +- [API Endpoints](#api-endpoints) |
| 26 | +- [Models](#models) |
| 27 | +- [Authorization](#authorization) |
| 28 | +- [Support & Versioning](#support--versioning) |
24 | 29 |
|
25 | | -Then import the package: |
26 | | -```python |
27 | | -import openapi_client |
28 | | -``` |
| 30 | +--- |
| 31 | + |
| 32 | +## Requirements |
| 33 | +- **Python 3.7+** |
| 34 | +- Access to **AndDone Merchant Portal** for API keys. |
| 35 | + |
| 36 | +--- |
29 | 37 |
|
30 | | -### Setuptools |
| 38 | +## Installation |
31 | 39 |
|
32 | | -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 40 | +The recommended method is via `pip`: |
33 | 41 |
|
34 | 42 | ```sh |
35 | | -python setup.py install --user |
| 43 | +python -m pip install -r requirements.txt |
36 | 44 | ``` |
37 | | -(or `sudo python setup.py install` to install the package for all users) |
38 | 45 |
|
39 | 46 | Then import the package: |
| 47 | + |
40 | 48 | ```python |
41 | 49 | import openapi_client |
42 | 50 | ``` |
43 | 51 |
|
44 | | -### Tests |
| 52 | +--- |
| 53 | + |
| 54 | +## Configuration |
45 | 55 |
|
46 | | -Execute `pytest` to run the tests. |
| 56 | +1. **Retrieve Developer Credentials:** |
| 57 | + 1. Log in to AndDone Merchant Portal Portal: |
| 58 | + - **UAT**: [https://portal.uat.anddone.com](https://portal.uat.anddone.com) |
| 59 | + - **Production**: [https://portal.anddone.com](https://portal.anddone.com) |
| 60 | + 2. Go to **Developer → API Keys** in the left menu. |
| 61 | + 3. Copy: |
| 62 | + - `xApiKey` (API Key) |
| 63 | + - `xAppKey` (App Key) |
47 | 64 |
|
48 | | -## Getting Started |
49 | | -1. Find and note your company AndDone Developer settings. |
50 | | - 1. Login to (UAT) https://portal.uat.anddone.com/ (Production) https://portal.anddone.com/ |
51 | | - 2. In the left menu, click "Developer" then "API Keys" |
52 | | - 3. Your xApiKey will be the API Key |
53 | | - 4. Your xAppKey will be the App Key |
54 | | -2. You will need to register your Origin with us to execute API calls against our Secure endpoints. |
55 | | - 1. Typically, we use your domain for production or other hosted environments and IP address for local development environments. |
56 | | - 2. Contact AndDone support (integrations@anddone.com) or your onboarding agent to ensure all your domains or IP addresses you may use are registered for use with our secure APIs. |
57 | | -3. Please follow the [installation procedure](#installation--usage) and then modify and run the following: |
| 65 | +2. **Determine Your Origin:** |
| 66 | + The `origin` is your public IP address. |
| 67 | + Find it by searching **"what's my IP"** in Google or visiting [https://www.whatsmyip.org](https://www.whatsmyip.org). |
| 68 | + 1. Contact AndDone support to ensure your origin IP is resitered for use with our secure APIs |
| 69 | + 2. Email: [integrations@anddone.com](mailto:integrations@anddone.com) |
| 70 | + |
| 71 | +3. **Optional: Create a Configuration File:** |
| 72 | + Rename `config.example.json` to `config.json` and fill it with your values: |
| 73 | + |
| 74 | + ```json |
| 75 | + { |
| 76 | + "xApiKey": "YOUR_API_KEY", |
| 77 | + "xAppKey": "YOUR_APP_KEY", |
| 78 | + "xVersion": "2.3", |
| 79 | + "origin": "YOUR_IP_ADDRESS" |
| 80 | + } |
| 81 | + ``` |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Quickstart |
| 86 | + |
| 87 | +Here’s a minimal working example to call the **Secure Create Payment Intent API**: |
58 | 88 |
|
59 | 89 | ```python |
60 | 90 |
|
61 | 91 | from openapi_client.api.secure_payment_intent_api import SecurePaymentIntentApi |
62 | | -from openapi_client import ApiClient |
63 | | -import json |
64 | | - |
65 | | -x_api_key = 'x_api_key_example' # str | an authorization header |
66 | | -x_app_key = 'x_app_key_example' # str | an authorization header |
67 | | -x_version = '2.3' # str | x-version |
68 | | -origin = 'origin_example' # str | origin |
69 | 92 |
|
70 | | -request = { |
71 | | - "YOUR_REQUEST_BODY" |
| 93 | +x_api_key = 'YOUR_API_KEY' |
| 94 | +x_app_key = 'YOUR_APP_KEY' |
| 95 | +x_version = '2.3' |
| 96 | +origin = 'YOUR_ORIGIN' |
| 97 | + |
| 98 | +post_body = { |
| 99 | + "saveForFuture": True, |
| 100 | + "amount": 10000, |
| 101 | + "title": "YOUR UNIQUE TITLE", |
| 102 | + "shortDescription": "shortDescription", |
| 103 | + "paymentDescription": "paymentDescription", |
| 104 | + "invoiceNumber": "postman", |
| 105 | + "expiresIn": "300000", |
| 106 | + "intent": { |
| 107 | + "paymentTypes": [ |
| 108 | + "CreditCard", |
| 109 | + "ACH" |
| 110 | + ] |
| 111 | + }, |
| 112 | + "enablePremiumFinance": True, |
| 113 | + "splits": None, |
| 114 | + "additionalDetailsPreference": "NoAdditionalDetails" |
72 | 115 | } |
73 | 116 |
|
74 | | -# Create an instance of the API class |
75 | 117 | api_instance = SecurePaymentIntentApi() |
| 118 | +response = api_instance.secure_paymentintents_post( |
| 119 | + x_api_key, x_app_key, x_version, origin, post_body |
| 120 | +) |
| 121 | +print(response) |
| 122 | + |
| 123 | + |
| 124 | +``` |
76 | 125 |
|
77 | | -try: |
78 | | - # This API will create a payment intent |
79 | | - api_response = api_instance.secure_paymentintents_post(x_api_key, x_app_key, x_version, origin, request) |
80 | | - print("The response of SecurePaymentIntentApi->secure_paymentintents_post:\n") |
81 | | - print(api_response) |
82 | | -except ApiException as e: |
83 | | - print("Exception when calling SecurePaymentIntentApi->secure_paymentintents_post: %s\n" % e) |
| 126 | +## Alternate approach (Using optional config.json) |
84 | 127 |
|
| 128 | +Here is a more involved installation utilizing the openapi Configuration model. |
| 129 | + |
| 130 | +```python |
| 131 | +import json |
| 132 | +from openapi_client.rest import ApiException |
| 133 | +from openapi_client.api.secure_payment_intent_api import SecurePaymentIntentApi |
| 134 | +from pprint import pprint |
| 135 | + |
| 136 | +# Defining the host is optional and defaults to https://api.uat.anddone.com |
| 137 | +# See configuration.py for a list of all supported configuration parameters. |
| 138 | +configuration = openapi_client.Configuration( |
| 139 | + host = "https://api.uat.anddone.com" |
| 140 | +) |
| 141 | + |
| 142 | +# Enter a context with an instance of the API client |
| 143 | +with openapi_client.ApiClient(configuration) as api_client: |
| 144 | + # Create an instance of the API class |
| 145 | + api_instance = openapi_client.SecureEmbeddedPremiumFinanceApi(api_client) |
| 146 | + # Load credentials from config.json |
| 147 | + with open('config.json') as f: |
| 148 | + config = json.load(f) |
| 149 | + |
| 150 | + pf_policy_update_request_dto = openapi_client.PFPolicyUpdateRequestDTO() # PFPolicyUpdateRequestDTO | Signature Request details (optional) |
| 151 | + |
| 152 | + try: |
| 153 | + # This API is will update the policy number |
| 154 | + api_response = api_instance.secure_epf_merchants_quotes_policy_put(config['xApiKey'], config['xAppKey'], config['xVersion'], config['origin'], pf_policy_update_request_dto=pf_policy_update_request_dto) |
| 155 | + print("The response of SecureEmbeddedPremiumFinanceApi->secure_epf_merchants_quotes_policy_put:\n") |
| 156 | + pprint(api_response) |
| 157 | + except ApiException as e: |
| 158 | + print("Exception when calling SecureEmbeddedPremiumFinanceApi->secure_epf_merchants_quotes_policy_put: %s\n" % e) |
| 159 | + |
85 | 160 | ``` |
86 | 161 |
|
87 | | -## Documentation for API Endpoints |
| 162 | +--- |
| 163 | + |
| 164 | +## API Endpoints |
| 165 | + |
| 166 | +All URIs are relative to: |
| 167 | + |
| 168 | +- **UAT**: `https://api.uat.anddone.com` |
| 169 | +- **Production**: `https://api.anddone.com` |
| 170 | + |
| 171 | +<details> |
| 172 | + <summary>Click to view all endpoints</summary> |
88 | 173 |
|
89 | 174 | All URIs are relative to *https://api.uat.anddone.com* |
90 | 175 |
|
@@ -145,8 +230,14 @@ Class | Method | HTTP request | Description |
145 | 230 | *SecureVendorManagementApi* | [**vendorapi_secure_merchants_vendors_unsuspend_post**](docs/SecureVendorManagementApi.md#vendorapi_secure_merchants_vendors_unsuspend_post) | **POST** /vendorapi/secure/merchants/vendors/unsuspend | This API unsuspends vendor into system |
146 | 231 | *SecureVoidsApi* | [**secure_cancellations_post**](docs/SecureVoidsApi.md#secure_cancellations_post) | **POST** /secure/cancellations | This API cancel a transaction. |
147 | 232 |
|
| 233 | +</details> |
| 234 | + |
| 235 | +--- |
148 | 236 |
|
149 | | -## Documentation For Models |
| 237 | +## Models |
| 238 | + |
| 239 | +<details> |
| 240 | + <summary>Click to view all models</summary> |
150 | 241 |
|
151 | 242 | - [BankDetailDto](docs/BankDetailDto.md) |
152 | 243 | - [CancelPaymentRequestDTO](docs/CancelPaymentRequestDTO.md) |
@@ -336,43 +427,26 @@ Class | Method | HTTP request | Description |
336 | 427 | - [VerifyBankAccountResponse](docs/VerifyBankAccountResponse.md) |
337 | 428 | - [VerifyBankAccountResponseHttpResponse](docs/VerifyBankAccountResponseHttpResponse.md) |
338 | 429 |
|
| 430 | +</details> |
339 | 431 |
|
340 | | -<a id="documentation-for-authorization"></a> |
341 | | -## Documentation For Authorization |
342 | | - |
343 | | - |
344 | | -Authentication schemes defined for the API: |
345 | | -<a id="x-api-key"></a> |
346 | | -### x-api-key |
347 | | - |
348 | | -- **Type**: API key |
349 | | -- **API key parameter name**: x-api-key |
350 | | -- **Location**: HTTP header |
351 | | - |
352 | | -<a id="x-app-key"></a> |
353 | | -### x-app-key |
354 | | - |
355 | | -- **Type**: API key |
356 | | -- **API key parameter name**: x-app-key |
357 | | -- **Location**: HTTP header |
358 | | - |
359 | | -<a id="x-version"></a> |
360 | | -### x-version |
361 | | - |
362 | | -- **Type**: API key |
363 | | -- **API key parameter name**: x-version |
364 | | -- **Location**: HTTP header |
365 | | - |
366 | | -<a id="origin"></a> |
367 | | -### origin |
| 432 | +--- |
368 | 433 |
|
369 | | -- **Type**: API key |
370 | | -- **API key parameter name**: origin |
371 | | -- **Location**: HTTP header |
| 434 | +## Authorization |
372 | 435 |
|
| 436 | +Authentication is handled via API keys in HTTP headers: |
373 | 437 |
|
374 | | -## Author |
| 438 | +| Key | Location | Description | |
| 439 | +|--------------|----------|-----------------------| |
| 440 | +| **x-api-key** | Header | Your API key | |
| 441 | +| **x-app-key** | Header | Your App key | |
| 442 | +| **x-version** | Header | API version (e.g., 2.3) | |
| 443 | +| **origin** | Header | Your public IP address | |
375 | 444 |
|
| 445 | +--- |
376 | 446 |
|
| 447 | +## Support & Versioning |
377 | 448 |
|
| 449 | +- **API Environments:** Use UAT for testing; switch to Production only after validation. |
| 450 | +- **Issues:** Report bugs or request features via the [GitHub Issues](https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-DotNet/issues) page. |
378 | 451 |
|
| 452 | +--- |
0 commit comments