Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ The package is compatible with Python versions `3.7+`.
Install the package from PyPi using the following pip command:

```bash
pip install paypal-server-sdk==2.3.0
pip install paypal-server-sdk==2.4.0
```

You can also view the package at:
https://pypi.python.org/pypi/paypal-server-sdk/2.3.0
https://pypi.python.org/pypi/paypal-server-sdk/2.4.0

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/client.md)

The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| environment | [`Environment`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/README.md#environments) | The API environment. <br> **Default: `Environment.SANDBOX`** |
| environment | [`Environment`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/README.md#environments) | The API environment. <br> **Default: `Environment.SANDBOX`** |
| http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
Expand All @@ -46,9 +46,9 @@ The following parameters are configurable for the API Client:
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
| 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]** |
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
| proxy_settings | [`ProxySettings`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/logging-configuration.md) | The SDK logging configuration for API calls |
| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
| proxy_settings | [`ProxySettings`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/logging-configuration.md) | The SDK logging configuration for API calls |
| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |

The API client can be initialized as follows:

Expand Down Expand Up @@ -91,7 +91,7 @@ from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient
client = PaypalServersdkClient.from_environment(dotenv_path='/path/to/.env')
```

See the [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/environment-based-client-initialization.md) section for details.
See the [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/environment-based-client-initialization.md) section for details.

## Environments

Expand All @@ -108,37 +108,37 @@ The SDK can be configured to use a different environment for making API calls. A

This API uses the following authentication schemes.

* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/auth/oauth-2-client-credentials-grant.md)
* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/auth/oauth-2-client-credentials-grant.md)

## List of APIs

* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/orders.md)
* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/payments.md)
* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/vault.md)
* [Transaction Search](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/transaction-search.md)
* [Subscriptions](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/subscriptions.md)
* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/orders.md)
* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/payments.md)
* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/vault.md)
* [Transaction Search](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/transaction-search.md)
* [Subscriptions](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/subscriptions.md)

## SDK Infrastructure

### Configuration

* [ProxySettings](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/proxy-settings.md)
* [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/environment-based-client-initialization.md)
* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/abstract-logger.md)
* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/logging-configuration.md)
* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/request-logging-configuration.md)
* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/response-logging-configuration.md)
* [ProxySettings](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/proxy-settings.md)
* [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/environment-based-client-initialization.md)
* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/abstract-logger.md)
* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/logging-configuration.md)
* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/request-logging-configuration.md)
* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/response-logging-configuration.md)

### HTTP

* [HttpResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/http-request.md)
* [HttpResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/http-request.md)

### Utilities

* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/api-response.md)
* [ApiHelper](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/api-helper.md)
* [HttpDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/http-date-time.md)
* [RFC3339DateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/rfc3339-date-time.md)
* [UnixDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/unix-date-time.md)
* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/api-response.md)
* [ApiHelper](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/api-helper.md)
* [HttpDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/http-date-time.md)
* [RFC3339DateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/rfc3339-date-time.md)
* [UnixDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/unix-date-time.md)

12 changes: 7 additions & 5 deletions doc/models/activate-subscription-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ The activate subscription request details.
| --- | --- | --- | --- |
| `reason` | `str` | Optional | The reason for activation of a subscription. Required to reactivate the subscription.<br><br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` |

## Example (as JSON)
## Example

```json
{
"reason": "reason4"
}
```python
from paypalserversdk.models.activate_subscription_request import ActivateSubscriptionRequest

activate_subscription_request = ActivateSubscriptionRequest(
reason='reason4'
)
```

14 changes: 8 additions & 6 deletions doc/models/activity-timestamps.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ The date and time stamps that are common to authorized payment, captured payment
| `create_time` | `str` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.<br><br>**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` |
| `update_time` | `str` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.<br><br>**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` |

## Example (as JSON)
## Example

```json
{
"create_time": "create_time2",
"update_time": "update_time2"
}
```python
from paypalserversdk.models.activity_timestamps import ActivityTimestamps

activity_timestamps = ActivityTimestamps(
create_time='create_time8',
update_time='update_time4'
)
```

24 changes: 13 additions & 11 deletions doc/models/address.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ The portable international postal address. Maps to [AddressValidationMetadata](h
| `postal_code` | `str` | Optional | The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).<br><br>**Constraints**: *Maximum Length*: `60` |
| `country_code` | `str` | Required | The [2-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.<br><br>**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` |

## Example (as JSON)

```json
{
"address_line_1": "address_line_18",
"address_line_2": "address_line_28",
"admin_area_2": "admin_area_22",
"admin_area_1": "admin_area_14",
"postal_code": "postal_code0",
"country_code": "country_code8"
}
## Example

```python
from paypalserversdk.models.address import Address

address = Address(
country_code='country_code6',
address_line_1='address_line_16',
address_line_2='address_line_26',
admin_area_2='admin_area_20',
admin_area_1='admin_area_12',
postal_code='postal_code8'
)
```

53 changes: 28 additions & 25 deletions doc/models/amount-breakdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,33 @@ The breakdown of the amount. Breakdown provides details such as total item amoun
| `shipping_discount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. |
| `discount` | [`Money`](../../doc/models/money.md) | Optional | The discount amount and currency code. For list of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. |

## Example (as JSON)

```json
{
"item_total": {
"currency_code": "currency_code0",
"value": "value6"
},
"shipping": {
"currency_code": "currency_code0",
"value": "value6"
},
"handling": {
"currency_code": "currency_code2",
"value": "value8"
},
"tax_total": {
"currency_code": "currency_code4",
"value": "value0"
},
"insurance": {
"currency_code": "currency_code2",
"value": "value8"
}
}
## Example

```python
from paypalserversdk.models.amount_breakdown import AmountBreakdown
from paypalserversdk.models.money import Money

amount_breakdown = AmountBreakdown(
item_total=Money(
currency_code='currency_code0',
value='value6'
),
shipping=Money(
currency_code='currency_code0',
value='value6'
),
handling=Money(
currency_code='currency_code2',
value='value8'
),
tax_total=Money(
currency_code='currency_code4',
value='value0'
),
insurance=Money(
currency_code='currency_code2',
value='value8'
)
)
```

62 changes: 33 additions & 29 deletions doc/models/amount-with-breakdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,38 @@ The total order amount with an optional breakdown that provides details, such as
| `value` | `str` | Required | The value, which might be: An integer for currencies like `JPY` that are not typically fractional. A decimal fraction for currencies like `TND` that are subdivided into thousandths. For the required number of decimal places for a currency code, see [Currency Codes](https://developer.paypal.com/api/rest/reference/currency-codes/).<br><br>**Constraints**: *Maximum Length*: `32`, *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` |
| `breakdown` | [`AmountBreakdown`](../../doc/models/amount-breakdown.md) | Optional | The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. |

## Example (as JSON)

```json
{
"currency_code": "currency_code4",
"value": "value0",
"breakdown": {
"item_total": {
"currency_code": "currency_code0",
"value": "value6"
},
"shipping": {
"currency_code": "currency_code0",
"value": "value6"
},
"handling": {
"currency_code": "currency_code2",
"value": "value8"
},
"tax_total": {
"currency_code": "currency_code4",
"value": "value0"
},
"insurance": {
"currency_code": "currency_code2",
"value": "value8"
}
}
}
## Example

```python
from paypalserversdk.models.amount_breakdown import AmountBreakdown
from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown
from paypalserversdk.models.money import Money

amount_with_breakdown = AmountWithBreakdown(
currency_code='currency_code0',
value='value6',
breakdown=AmountBreakdown(
item_total=Money(
currency_code='currency_code0',
value='value6'
),
shipping=Money(
currency_code='currency_code0',
value='value6'
),
handling=Money(
currency_code='currency_code2',
value='value8'
),
tax_total=Money(
currency_code='currency_code4',
value='value0'
),
insurance=Money(
currency_code='currency_code2',
value='value8'
)
)
)
```

26 changes: 13 additions & 13 deletions doc/models/app-switch-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Merchant provided details of the native app or mobile web browser to facilitate
| `native_app` | [`NativeAppContext`](../../doc/models/native-app-context.md) | Optional | Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. |
| `mobile_web` | [`MobileWebContext`](../../doc/models/mobile-web-context.md) | Optional | Buyer's mobile web browser context to app switch to the PayPal consumer app. |

## Example (as JSON)

```json
{
"native_app": {
"os_type": "IOS",
"os_version": "os_version0"
},
"mobile_web": {
"return_flow": "AUTO",
"buyer_user_agent": "buyer_user_agent8"
}
}
## Example

```python
from paypalserversdk.models.app_switch_context import AppSwitchContext
from paypalserversdk.models.mobile_web_context import MobileWebContext
from paypalserversdk.models.native_app_context import NativeAppContext

app_switch_context = AppSwitchContext(
native_app=NativeAppContext(),
mobile_web=MobileWebContext(
buyer_user_agent='buyer_user_agent8'
)
)
```

45 changes: 22 additions & 23 deletions doc/models/apple-pay-attributes-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,27 @@ Additional attributes associated with the use of Apple Pay.
| --- | --- | --- | --- |
| `vault` | [`VaultResponse`](../../doc/models/vault-response.md) | Optional | The details about a saved payment source. |

## Example (as JSON)

```json
{
"vault": {
"id": "id6",
"status": "APPROVED",
"customer": {
"id": "id0",
"name": {
"given_name": "given_name2",
"surname": "surname8"
}
},
"links": [
{
"href": "href6",
"rel": "rel0",
"method": "HEAD"
}
]
}
}
## Example

```python
from paypalserversdk.models.apple_pay_attributes_response import ApplePayAttributesResponse
from paypalserversdk.models.name import Name
from paypalserversdk.models.vault_customer import VaultCustomer
from paypalserversdk.models.vault_response import VaultResponse
from paypalserversdk.models.vault_status import VaultStatus

apple_pay_attributes_response = ApplePayAttributesResponse(
vault=VaultResponse(
id='id6',
status=VaultStatus.APPROVED,
customer=VaultCustomer(
id='id0',
name=Name(
given_name='given_name2',
surname='surname8'
)
)
)
)
```

Loading
Loading