|
6 | 6 | ### Important Notes
|
7 | 7 |
|
8 | 8 | - **Available Features:** This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
|
9 |
| -- **API Changes:** Expect potential changes in APIs and features as we finalize the product. |
10 | 9 |
|
11 | 10 | ### Information
|
12 | 11 |
|
13 | 12 | The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers:
|
14 | 13 |
|
15 |
| -- Orders Controller: <a href="https://developer.paypal.com/docs/api/orders/v2/">Orders API v2</a> |
16 |
| -- Payments Controller: <a href="https://developer.paypal.com/docs/api/payments/v2/">Payments API v2</a> |
17 |
| -- Vault Controller: <a href="https://developer.paypal.com/docs/api/payment-tokens/v3/">Payment Method Tokens API v3</a> *Available in the US only.* |
18 |
| - |
19 |
| -Find out more here: [https://developer.paypal.com/docs/api/orders/v2/](https://developer.paypal.com/docs/api/orders/v2/) |
| 14 | +- Orders Controller: [Orders API v2](https://developer.paypal.com/docs/api/orders/v2/) |
| 15 | +- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2 |
| 16 | +- Vault Controller: [Payment Method Tokens API v3](https://developer.paypal.com/docs/api/payment-tokens/v3/) *Available in the US only.* |
20 | 17 |
|
21 | 18 | ## Install the Package
|
22 | 19 |
|
23 | 20 | Run the following command from your project directory to install the package from npm:
|
24 | 21 |
|
25 | 22 | ```bash
|
26 |
| -npm install @paypal/paypal-server-sdk@1.0.0 |
| 23 | +npm install @paypal/paypal-server-sdk@1.1.0 |
27 | 24 | ```
|
28 | 25 |
|
29 |
| -For additional package details, see the [Npm page for the @paypal/paypal-server-sdk@1.0.0 npm](https://www.npmjs.com/package/@paypal/paypal-server-sdk/v/1.0.0). |
| 26 | +For additional package details, see the [Npm page for the @paypal/paypal-server-sdk@1.1.0 npm](https://www.npmjs.com/package/@paypal/paypal-server-sdk/v/1.1.0). |
30 | 27 |
|
31 | 28 | ## Initialize the API Client
|
32 | 29 |
|
33 |
| -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/client.md) |
| 30 | +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/client.md) |
34 | 31 |
|
35 | 32 | The following parameters are configurable for the API Client:
|
36 | 33 |
|
37 | 34 | | Parameter | Type | Description |
|
38 | 35 | | --- | --- | --- |
|
39 |
| -| `environment` | `Environment` | The API environment. <br> **Default: `Environment.Sandbox`** | |
40 |
| -| `timeout` | `number` | Timeout for API calls.<br>*Default*: `0` | |
41 |
| -| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. | |
42 |
| -| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. | |
43 |
| -| `logging` | [`PartialLoggingOptions`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/partial-logging-options.md) | Logging Configuration to enable logging | |
44 |
| -| `clientCredentialsAuthCredentials` | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for clientCredentialsAuth | |
45 |
| - |
46 |
| -### HttpClientOptions |
47 |
| - |
48 |
| -| Parameter | Type | Description | |
49 |
| -| --- | --- | --- | |
50 |
| -| `timeout` | `number` | Timeout in milliseconds. | |
51 |
| -| `httpAgent` | `any` | Custom http agent to be used when performing http requests. | |
52 |
| -| `httpsAgent` | `any` | Custom https agent to be used when performing http requests. | |
53 |
| -| `retryConfig` | `Partial<RetryConfiguration>` | Configurations to retry requests. | |
54 |
| - |
55 |
| -### RetryConfiguration |
56 |
| - |
57 |
| -| Parameter | Type | Description | |
58 |
| -| --- | --- | --- | |
59 |
| -| `maxNumberOfRetries` | `number` | Maximum number of retries. <br> *Default*: `0` | |
60 |
| -| `retryOnTimeout` | `boolean` | Whether to retry on request timeout. <br> *Default*: `true` | |
61 |
| -| `retryInterval` | `number` | Interval before next retry. Used in calculation of wait time for next request in case of failure. <br> *Default*: `1` | |
62 |
| -| `maximumRetryWaitTime` | `number` | Overall wait time for the requests getting retried. <br> *Default*: `0` | |
63 |
| -| `backoffFactor` | `number` | Used in calculation of wait time for next request in case of failure. <br> *Default*: `2` | |
64 |
| -| `httpStatusCodesToRetry` | `number[]` | Http status codes to retry against. <br> *Default*: `[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]` | |
65 |
| -| `httpMethodsToRetry` | `HttpMethod[]` | Http methods to retry against. <br> *Default*: `['GET', 'PUT']` | |
| 36 | +| environment | `Environment` | The API environment. <br> **Default: `Environment.Sandbox`** | |
| 37 | +| timeout | `number` | Timeout for API calls.<br>*Default*: `0` | |
| 38 | +| httpClientOptions | [`Partial<HttpClientOptions>`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/http-client-options.md) | Stable configurable http client options. | |
| 39 | +| unstableHttpClientOptions | `any` | Unstable configurable http client options. | |
| 40 | +| logging | [`PartialLoggingOptions`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/partial-logging-options.md) | Logging Configuration to enable logging | |
| 41 | +| clientCredentialsAuthCredentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for clientCredentialsAuth | |
66 | 42 |
|
67 | 43 | The API client can be initialized as follows:
|
68 | 44 |
|
@@ -101,21 +77,31 @@ The SDK can be configured to use a different environment for making API calls. A
|
101 | 77 |
|
102 | 78 | This API uses the following authentication schemes.
|
103 | 79 |
|
104 |
| -* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/auth/oauth-2-client-credentials-grant.md) |
| 80 | +* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) |
105 | 81 |
|
106 | 82 | ## List of APIs
|
107 | 83 |
|
108 |
| -* [Orders](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/controllers/orders.md) |
109 |
| -* [Payments](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/controllers/payments.md) |
110 |
| -* [Vault](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/controllers/vault.md) |
| 84 | +* [Orders](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/controllers/orders.md) |
| 85 | +* [Payments](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/controllers/payments.md) |
| 86 | +* [Vault](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/controllers/vault.md) |
| 87 | + |
| 88 | +## SDK Infrastructure |
| 89 | + |
| 90 | +### Configuration |
| 91 | + |
| 92 | +* [HttpClientOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/http-client-options.md) |
| 93 | +* [RetryConfiguration](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/retry-configuration.md) |
| 94 | +* [PartialLoggingOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/partial-logging-options.md) |
| 95 | +* [PartialRequestLoggingOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/partial-request-logging-options.md) |
| 96 | +* [PartialResponseLoggingOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/partial-response-logging-options.md) |
| 97 | +* [LoggerInterface](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/logger-interface.md) |
| 98 | + |
| 99 | +### HTTP |
| 100 | + |
| 101 | +* [HttpRequest](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/http-request.md) |
111 | 102 |
|
112 |
| -## Classes Documentation |
| 103 | +### Utilities |
113 | 104 |
|
114 |
| -* [ApiResponse](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/api-response.md) |
115 |
| -* [HttpRequest](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/http-request.md) |
116 |
| -* [ApiError](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/api-error.md) |
117 |
| -* [PartialLoggingOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/partial-logging-options.md) |
118 |
| -* [PartialRequestLoggingOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/partial-request-logging-options.md) |
119 |
| -* [PartialResponseLoggingOptions](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/partial-response-logging-options.md) |
120 |
| -* [LoggerInterface](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.0.0/doc/logger-interface.md) |
| 105 | +* [ApiResponse](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/api-response.md) |
| 106 | +* [ApiError](https://www.github.com/paypal/PayPal-TypeScript-Server-SDK/tree/1.1.0/doc/api-error.md) |
121 | 107 |
|
0 commit comments