You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/client.md)
34
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.1.0/doc/client.md)
35
35
36
36
The following parameters are configurable for the API Client:
37
37
@@ -46,12 +46,14 @@ The following parameters are configurable for the API Client:
46
46
| backoff_factor |`float`| A backoff factor to apply between attempts after the second try. <br> **Default: 2**|
47
47
| 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]**|
48
48
| retry_methods |`Array of string`| The http methods on which retry is to be done. <br> **Default: ['GET', 'PUT']**|
49
-
| proxy_settings |[`ProxySettings`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/proxy-settings.md)| Optional proxy configuration to route HTTP requests through a proxy server. |
50
-
| logging_configuration |[`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/logging-configuration.md)| The SDK logging configuration for API calls |
51
-
| client_credentials_auth_credentials |[`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md)| The credential object for OAuth 2 Client Credentials Grant |
49
+
| proxy_settings |[`ProxySettings`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.1.0/doc/proxy-settings.md)| Optional proxy configuration to route HTTP requests through a proxy server. |
50
+
| logging_configuration |[`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.1.0/doc/logging-configuration.md)| The SDK logging configuration for API calls |
51
+
| client_credentials_auth_credentials |[`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.1.0/doc/auth/oauth-2-client-credentials-grant.md)| The credential object for OAuth 2 Client Credentials Grant |
See the [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.1.0/doc/environment-based-client-initialization.md) section for details.
95
+
83
96
## Environments
84
97
85
98
The SDK can be configured to use a different environment for making API calls. Available environments are:
@@ -95,36 +108,37 @@ The SDK can be configured to use a different environment for making API calls. A
95
108
96
109
This API uses the following authentication schemes.
The SDK client can also be initialized directly from environment variables using the `from_environment()` class method. This allows the SDK to automatically read configuration values from the runtime environment or a .env file.
5
+
6
+
## Example
7
+
8
+
```python
9
+
from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient
10
+
11
+
# Specify the path to your .env file if it’s located outside the project’s root directory.
You can also specify a path to a `.env` file by passing it to the `from_environment()` method:
16
+
17
+
The same method can accept keyword arguments to override any values read from the environment, and the arguments to override values should follow the same approach as code-based client initialization.
18
+
19
+
```python
20
+
from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient
21
+
22
+
client = PaypalServersdkClient.from_environment(
23
+
dotenv_path='/path/to/.env',
24
+
timeout=0, # overrides timeout from environment variable
25
+
)
26
+
```
27
+
28
+
Values provided through arguments take precedence over those defined in environment variables.
0 commit comments