Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 1.1.0
- Added new models to support Apple Pay, Google Pay
- Expanded models to support additional optional fields
- Bug fixes
- Documentation updates

## 1.0.0
- GA Release for Orders, Payments, and Vault APIs
74 changes: 41 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,46 @@
### Important Notes

- **Available Features:** This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
- **API Changes:** Expect potential changes in APIs and features as we finalize the product.

### Information

The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers:

- Orders Controller: <a href="https://developer.paypal.com/docs/api/orders/v2/">Orders API v2</a>
- Payments Controller: <a href="https://developer.paypal.com/docs/api/payments/v2/">Payments API v2</a>
- Vault Controller: <a href="https://developer.paypal.com/docs/api/payment-tokens/v3/">Payment Method Tokens API v3</a> *Available in the US only.*

Find out more here: [https://developer.paypal.com/docs/api/orders/v2/](https://developer.paypal.com/docs/api/orders/v2/)
- Orders Controller: [Orders API v2](https://developer.paypal.com/docs/api/orders/v2/)
- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2
- Vault Controller: [Payment Method Tokens API v3](https://developer.paypal.com/docs/api/payment-tokens/v3/) *Available in the US only.*

## Install the Package

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==1.0.0
pip install paypal-server-sdk==1.1.0
```

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

## Initialize the API Client

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

The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `environment` | `Environment` | The API environment. <br> **Default: `Environment.SANDBOX`** |
| `http_client_instance` | `HttpClient` | 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 |
| `timeout` | `float` | The value to use for connection timeout. <br> **Default: 60** |
| `max_retries` | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
| `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']** |
| `logging_configuration` | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.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/1.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
| environment | `Environment` | The API environment. <br> **Default: `Environment.SANDBOX`** |
| http_client_instance | `HttpClient` | 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 |
| timeout | `float` | The value to use for connection timeout. <br> **Default: 60** |
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
| 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']** |
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.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/1.1.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 @@ -86,22 +83,33 @@ 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/1.0.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/1.1.0/doc/auth/oauth-2-client-credentials-grant.md)

## List of APIs

* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/controllers/orders.md)
* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/controllers/payments.md)
* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/controllers/vault.md)
* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/controllers/orders.md)
* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/controllers/payments.md)
* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/controllers/vault.md)

## SDK Infrastructure

### Configuration

* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/abstract-logger.md)
* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/logging-configuration.md)
* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/request-logging-configuration.md)
* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/response-logging-configuration.md)

### HTTP

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

## Classes Documentation
### Utilities

* [Utility Classes](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/http-request.md)
* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/api-response.md)
* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/logging-configuration.md)
* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/request-logging-configuration.md)
* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/response-logging-configuration.md)
* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.0.0/doc/abstract-logger.md)
* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/api-response.md)
* [ApiHelper](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/api-helper.md)
* [HttpDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/http-date-time.md)
* [RFC3339DateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/rfc3339-date-time.md)
* [UnixDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/1.1.0/doc/unix-date-time.md)

2 changes: 1 addition & 1 deletion doc/abstract-logger.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# AbstractLogger Class
# AbstractLogger

An abstract class for custom logger implementation.

Expand Down
11 changes: 11 additions & 0 deletions doc/api-helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# ApiHelper

A utility class for processing API Calls. Also contains classes for supporting standard datetime formats.

## Methods

| Name | Description |
| --- | --- |
| json_deserialize | Deserializes a JSON string to a Python dictionary. |

4 changes: 2 additions & 2 deletions doc/api-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ An object with the response value as well as other useful information such as st
| reason_phrase | `str` | The reason phrase returned with the status code. |
| headers | `dict[str, str]` | The HTTP response headers. |
| text | `str` | The raw response body as a string. |
| request | [`HttpRequest`](http-request.md) | The original HTTP request sent. |
| request | [`HttpRequest`](../doc/http-request.md) | The original HTTP request sent. |
| body | `Any` | The parsed response data, if applicable. |

## Example Usage
## Usage Example

```python
try:
Expand Down
22 changes: 11 additions & 11 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `environment` | `Environment` | The API environment. <br> **Default: `Environment.SANDBOX`** |
| `http_client_instance` | `HttpClient` | 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 |
| `timeout` | `float` | The value to use for connection timeout. <br> **Default: 60** |
| `max_retries` | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
| `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']** |
| `logging_configuration` | [`LoggingConfiguration`](logging-configuration.md) | The SDK logging configuration for API calls |
| `client_credentials_auth_credentials` | [`ClientCredentialsAuthCredentials`](auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
| environment | `Environment` | The API environment. <br> **Default: `Environment.SANDBOX`** |
| http_client_instance | `HttpClient` | 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 |
| timeout | `float` | The value to use for connection timeout. <br> **Default: 60** |
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
| 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']** |
| logging_configuration | [`LoggingConfiguration`](../doc/logging-configuration.md) | The SDK logging configuration for API calls |
| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](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
Loading