diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 176ecf9..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -## 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 \ No newline at end of file diff --git a/README.md b/README.md index ba32e53..5305939 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,17 @@ ### 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. +- **Available Features:** This SDK currently contains only 5 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future. ### Information The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers: - 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 +- 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.* +- Transaction Search Controller: [Transaction Search API v1](https://developer.paypal.com/docs/api/transaction-search/v1/) +- Subscriptions Controller: [Subscriptions API v1](https://developer.paypal.com/docs/api/subscriptions/v1/) ## Install the Package @@ -21,22 +23,22 @@ 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.1.0 +pip install paypal-server-sdk==2.0.0 ``` You can also view the package at: -https://pypi.python.org/pypi/paypal-server-sdk/1.1.0 +https://pypi.python.org/pypi/paypal-server-sdk/2.0.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.1.0/doc/client.md) +**_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) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | environment | `Environment` | The API environment.
**Default: `Environment.SANDBOX`** | -| http_client_instance | `HttpClient` | The Http Client passed from the sdk user for making requests | +| 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 | | timeout | `float` | The value to use for connection timeout.
**Default: 60** | @@ -44,12 +46,22 @@ The following parameters are configurable for the API Client: | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**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.
**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 | +| 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. | +| 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 | +| 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 | The API client can be initialized as follows: ```python +import logging + +from paypalserversdk.configuration import Environment +from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials +from paypalserversdk.logging.configuration.api_logging_configuration import LoggingConfiguration +from paypalserversdk.logging.configuration.api_logging_configuration import RequestLoggingConfiguration +from paypalserversdk.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration +from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient + client = PaypalServersdkClient( client_credentials_auth_credentials=ClientCredentialsAuthCredentials( o_auth_client_id='OAuthClientId', @@ -83,33 +95,36 @@ 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.1.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.0.0/doc/auth/oauth-2-client-credentials-grant.md) ## List of APIs -* [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) +* [Transactionsearch](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/controllers/transactionsearch.md) +* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/controllers/orders.md) +* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/controllers/payments.md) +* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/controllers/vault.md) +* [Subscriptions](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/controllers/subscriptions.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) +* [ProxySettings](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/proxy-settings.md) +* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/abstract-logger.md) +* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/logging-configuration.md) +* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/request-logging-configuration.md) +* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.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) +* [HttpResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/http-request.md) ### Utilities -* [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) +* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/api-response.md) +* [ApiHelper](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/api-helper.md) +* [HttpDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/http-date-time.md) +* [RFC3339DateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/rfc3339-date-time.md) +* [UnixDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.0.0/doc/unix-date-time.md) diff --git a/doc/auth/oauth-2-client-credentials-grant.md b/doc/auth/oauth-2-client-credentials-grant.md index 43f6aa0..2b7f675 100644 --- a/doc/auth/oauth-2-client-credentials-grant.md +++ b/doc/auth/oauth-2-client-credentials-grant.md @@ -27,6 +27,9 @@ Documentation for accessing and setting credentials for Oauth2. You must initialize the client with *OAuth 2.0 Client Credentials Grant* credentials as shown in the following code snippet. This will fetch the OAuth token automatically when any of the endpoints, requiring *OAuth 2.0 Client Credentials Grant* authentication, are called. ```python +from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials +from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient + client = PaypalServersdkClient( client_credentials_auth_credentials=ClientCredentialsAuthCredentials( o_auth_client_id='OAuthClientId', @@ -44,6 +47,9 @@ Your application can also manually provide an OAuthToken using the setter `o_aut Whenever the OAuth Token gets updated, the provided callback implementation will be executed. For instance, you may use it to store your access token whenever it gets updated. ```python +from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials +from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient + client = PaypalServersdkClient( client_credentials_auth_credentials=ClientCredentialsAuthCredentials( o_auth_client_id='OAuthClientId', @@ -61,6 +67,9 @@ client = PaypalServersdkClient( To authorize a client using a stored access token, set up the `o_auth_token_provider` in `ClientCredentialsAuthCredentials` along with the other auth parameters before creating the client: ```python +from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials +from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient + def _o_auth_token_provider(last_oauth_token, auth_manager): # Add the callback handler to provide a new OAuth token # It will be triggered whenever the last provided o_auth_token is null or expired diff --git a/doc/client.md b/doc/client.md index bbbbe88..9008a98 100644 --- a/doc/client.md +++ b/doc/client.md @@ -6,7 +6,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | environment | `Environment` | The API environment.
**Default: `Environment.SANDBOX`** | -| http_client_instance | `HttpClient` | The Http Client passed from the sdk user for making requests | +| 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 | | timeout | `float` | The value to use for connection timeout.
**Default: 60** | @@ -14,12 +14,22 @@ The following parameters are configurable for the API Client: | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**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.
**Default: ['GET', 'PUT']** | +| proxy_settings | [`ProxySettings`](../doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | | 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: ```python +import logging + +from paypalserversdk.configuration import Environment +from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials +from paypalserversdk.logging.configuration.api_logging_configuration import LoggingConfiguration +from paypalserversdk.logging.configuration.api_logging_configuration import RequestLoggingConfiguration +from paypalserversdk.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration +from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient + client = PaypalServersdkClient( client_credentials_auth_credentials=ClientCredentialsAuthCredentials( o_auth_client_id='OAuthClientId', @@ -49,5 +59,7 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al | orders | Gets OrdersController | | payments | Gets PaymentsController | | vault | Gets VaultController | +| transaction_search | Gets TransactionSearchController | +| subscriptions | Gets SubscriptionsController | | o_auth_authorization | Gets OAuthAuthorizationController | diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md index 6fdb78f..9a7a059 100644 --- a/doc/controllers/orders.md +++ b/doc/controllers/orders.md @@ -12,50 +12,64 @@ orders_controller = client.orders ## Methods -* [Patch Order](../../doc/controllers/orders.md#patch-order) -* [Authorize Order](../../doc/controllers/orders.md#authorize-order) -* [Update Order Tracking](../../doc/controllers/orders.md#update-order-tracking) -* [Create Order Tracking](../../doc/controllers/orders.md#create-order-tracking) * [Create Order](../../doc/controllers/orders.md#create-order) -* [Capture Order](../../doc/controllers/orders.md#capture-order) * [Get Order](../../doc/controllers/orders.md#get-order) +* [Patch Order](../../doc/controllers/orders.md#patch-order) * [Confirm Order](../../doc/controllers/orders.md#confirm-order) +* [Authorize Order](../../doc/controllers/orders.md#authorize-order) +* [Capture Order](../../doc/controllers/orders.md#capture-order) +* [Create Order Tracking](../../doc/controllers/orders.md#create-order-tracking) +* [Update Order Tracking](../../doc/controllers/orders.md#update-order-tracking) -# Patch Order +# Create Order -Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

To make an update, you must provide a `reference_id`. If you omit this value with an order that contains only one purchase unit, PayPal sets the value to `default` which enables you to use the path: \"/purchase_units/@reference_id=='default'/{attribute-or-object}\". Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.
Note: For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes or objects:

AttributeOpNotes
intentreplace
payerreplace, addUsing replace op for payer will replace the whole payer object with the value sent in request.
purchase_unitsreplace, add
purchase_units[].custom_idreplace, add, remove
purchase_units[].descriptionreplace, add, remove
purchase_units[].payee.emailreplace
purchase_units[].shipping.namereplace, add
purchase_units[].shipping.email_addressreplace, add
purchase_units[].shipping.phone_numberreplace, add
purchase_units[].shipping.optionsreplace, add
purchase_units[].shipping.addressreplace, add
purchase_units[].shipping.typereplace, add
purchase_units[].soft_descriptorreplace, remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, remove
purchase_units[].invoice_idreplace, add, remove
purchase_units[].payment_instructionreplace
purchase_units[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is INSTANT.
purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove
purchase_units[].payment_instruction.platform_feesreplace, add, remove
purchase_units[].supplementary_data.airlinereplace, add, remove
purchase_units[].supplementary_data.cardreplace, add, remove
application_context.client_configurationreplace, add
+Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 errors. ```python -def patch_order(self, - options=dict()) +def create_order(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | The ID of the order to update.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | +| `paypal_partner_attribution_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `paypal_client_metadata_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`List[Patch]`](../../doc/models/patch.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```python collect = { - 'id': 'id0', - 'body': [ - Patch( - op=PatchOp.ADD - ) - ] + 'body': OrderRequest( + intent=CheckoutPaymentIntent.CAPTURE, + purchase_units=[ + PurchaseUnitRequest( + amount=AmountWithBreakdown( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ), + 'prefer': 'return=minimal' } -result = orders_controller.patch_order(collect) +result = orders_controller.create_order(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -64,76 +78,72 @@ result = orders_controller.patch_order(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Authorize Order +# Get Order -Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors. +Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors. ```python -def authorize_order(self, - options=dict()) +def get_order(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | The ID of the order for which to authorize.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `id` | `str` | Template, Required | The ID of the order for which to show details.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | -| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | -| `paypal_client_metadata_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | +| `fields` | `str` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.

**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```python collect = { - 'id': 'id0', - 'prefer': 'return=minimal' + 'id': 'id0' } -result = orders_controller.authorize_order(collect) +result = orders_controller.get_order(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Update Order Tracking +# Patch Order -Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported. +Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

To make an update, you must provide a `reference_id`. If you omit this value with an order that contains only one purchase unit, PayPal sets the value to `default` which enables you to use the path: \"/purchase_units/@reference_id=='default'/{attribute-or-object}\". Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.
Note: For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes or objects:

AttributeOpNotes
intentreplace
payerreplace, addUsing replace op for payer will replace the whole payer object with the value sent in request.
purchase_unitsreplace, add
purchase_units[].custom_idreplace, add, remove
purchase_units[].descriptionreplace, add, remove
purchase_units[].payee.emailreplace
purchase_units[].shipping.namereplace, add
purchase_units[].shipping.email_addressreplace, add
purchase_units[].shipping.phone_numberreplace, add
purchase_units[].shipping.optionsreplace, add
purchase_units[].shipping.addressreplace, add
purchase_units[].shipping.typereplace, add
purchase_units[].soft_descriptorreplace, remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, remove
purchase_units[].invoice_idreplace, add, remove
purchase_units[].payment_instructionreplace
purchase_units[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is INSTANT.
purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove
purchase_units[].payment_instruction.platform_feesreplace, add, remove
purchase_units[].supplementary_data.airlinereplace, add, remove
purchase_units[].supplementary_data.cardreplace, add, remove
application_context.client_configurationreplace, add
```python -def update_order_tracking(self, - options=dict()) +def patch_order(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `tracker_id` | `str` | Template, Required | The order tracking ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `id` | `str` | Template, Required | The ID of the order to update.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`List[Patch]`](../../doc/models/patch.md) | Body, Optional | - | +| `body` | [`List[Patch]`](../../doc/models/patch.md) | Body, Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | ## Response Type @@ -144,14 +154,18 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. ```python collect = { 'id': 'id0', - 'tracker_id': 'tracker_id2', 'body': [ Patch( op=PatchOp.ADD ) ] } -result = orders_controller.update_order_tracking(collect) +result = orders_controller.patch_order(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -159,29 +173,30 @@ result = orders_controller.update_order_tracking(collect) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Order Tracking +# Confirm Order -Adds tracking information for an Order. +Payer confirms their intent to pay for the the Order with the given payment source. ```python -def create_order_tracking(self, - options=dict()) +def confirm_order(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `body` | [`OrderTrackerRequest`](../../doc/models/order-tracker-request.md) | Body, Required | - | +| `id` | `str` | Template, Required | The ID of the order for which the payer confirms their intent to pay.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_client_metadata_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | +| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | ## Response Type @@ -192,12 +207,14 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The ```python collect = { 'id': 'id0', - 'body': OrderTrackerRequest( - capture_id='capture_id8', - notify_payer=False - ) + 'prefer': 'return=minimal' } -result = orders_controller.create_order_tracking(collect) +result = orders_controller.confirm_order(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -206,55 +223,49 @@ result = orders_controller.create_order_tracking(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Order +# Authorize Order -Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 errors. +Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors. ```python -def create_order(self, - options=dict()) +def authorize_order(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | +| `id` | `str` | Template, Required | The ID of the order for which to authorize.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | | `paypal_request_id` | `str` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | -| `paypal_partner_attribution_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `paypal_client_metadata_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | +| `paypal_client_metadata_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). ## Example Usage ```python collect = { - 'body': OrderRequest( - intent=CheckoutPaymentIntent.CAPTURE, - purchase_units=[ - PurchaseUnitRequest( - amount=AmountWithBreakdown( - currency_code='currency_code6', - value='value0' - ) - ) - ] - ), + 'id': 'id0', 'prefer': 'return=minimal' } -result = orders_controller.create_order(collect) +result = orders_controller.authorize_order(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -263,7 +274,10 @@ result = orders_controller.create_order(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -300,6 +314,11 @@ collect = { 'prefer': 'return=minimal' } result = orders_controller.capture_order(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -315,23 +334,22 @@ result = orders_controller.capture_order(collect) | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Order +# Create Order Tracking -Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors. +Adds tracking information for an Order. ```python -def get_order(self, - options=dict()) +def create_order_tracking(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | The ID of the order for which to show details.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `id` | `str` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `body` | [`OrderTrackerRequest`](../../doc/models/order-tracker-request.md) | Body, Required | - | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `fields` | `str` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.

**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type @@ -341,51 +359,72 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The ```python collect = { - 'id': 'id0' + 'id': 'id0', + 'body': OrderTrackerRequest( + capture_id='capture_id8', + notify_payer=False + ) } -result = orders_controller.get_order(collect) +result = orders_controller.create_order_tracking(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Confirm Order +# Update Order Tracking -Payer confirms their intent to pay for the the Order with the given payment source. +Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported. ```python -def confirm_order(self, - options=dict()) +def update_order_tracking(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | The ID of the order for which the payer confirms their intent to pay.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_client_metadata_id` | `str` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `id` | `str` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `tracker_id` | `str` | Template, Required | The order tracking ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | -| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | +| `body` | [`List[Patch]`](../../doc/models/patch.md) | Body, Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. ## Example Usage ```python collect = { 'id': 'id0', - 'prefer': 'return=minimal' + 'tracker_id': 'tracker_id2', + 'body': [ + Patch( + op=PatchOp.ADD + ) + ] } -result = orders_controller.confirm_order(collect) +result = orders_controller.update_order_tracking(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -394,6 +433,7 @@ result = orders_controller.confirm_order(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | diff --git a/doc/controllers/payments.md b/doc/controllers/payments.md index a233175..c388a0c 100644 --- a/doc/controllers/payments.md +++ b/doc/controllers/payments.md @@ -12,81 +12,80 @@ payments_controller = client.payments ## Methods +* [Get Authorized Payment](../../doc/controllers/payments.md#get-authorized-payment) * [Capture Authorized Payment](../../doc/controllers/payments.md#capture-authorized-payment) -* [Get Captured Payment](../../doc/controllers/payments.md#get-captured-payment) * [Reauthorize Payment](../../doc/controllers/payments.md#reauthorize-payment) * [Void Payment](../../doc/controllers/payments.md#void-payment) +* [Get Captured Payment](../../doc/controllers/payments.md#get-captured-payment) * [Refund Captured Payment](../../doc/controllers/payments.md#refund-captured-payment) -* [Get Authorized Payment](../../doc/controllers/payments.md#get-authorized-payment) * [Get Refund](../../doc/controllers/payments.md#get-refund) -# Capture Authorized Payment +# Get Authorized Payment -Captures an authorized payment, by ID. +Shows details for an authorized payment, by ID. ```python -def capture_authorized_payment(self, - options=dict()) +def get_authorized_payment(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorization_id` | `str` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | +| `authorization_id` | `str` | Template, Required | The ID of the authorized payment for which to show details. | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 45 days. | -| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | -| `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). ## Example Usage ```python collect = { - 'authorization_id': 'authorization_id8', - 'prefer': 'return=minimal', - 'body': CaptureRequest( - final_capture=False - ) + 'authorization_id': 'authorization_id8' } -result = payments_controller.capture_authorized_payment(collect) +result = payments_controller.get_authorized_payment(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 409 | The server has detected a conflict while processing this request. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The request failed because it is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Captured Payment +# Capture Authorized Payment -Shows details for a captured payment, by ID. +Captures an authorized payment, by ID. ```python -def get_captured_payment(self, - options=dict()) +def capture_authorized_payment(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `capture_id` | `str` | Template, Required | The PayPal-generated ID for the captured payment for which to show details. | +| `authorization_id` | `str` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 45 days. | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | +| `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type @@ -96,25 +95,37 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The ```python collect = { - 'capture_id': 'capture_id2' + 'authorization_id': 'authorization_id8', + 'prefer': 'return=minimal', + 'body': CaptureRequest( + final_capture=False + ) } -result = payments_controller.get_captured_payment(collect) +result = payments_controller.capture_authorized_payment(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | +| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 409 | The server has detected a conflict while processing this request. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The request failed because it is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | # Reauthorize Payment -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. Note: This request is currently not supported for Partner use cases. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. ```python def reauthorize_payment(self, @@ -143,6 +154,11 @@ collect = { 'prefer': 'return=minimal' } result = payments_controller.reauthorize_payment(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -151,6 +167,7 @@ result = payments_controller.reauthorize_payment(collect) | --- | --- | --- | | 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | @@ -188,6 +205,11 @@ collect = { 'prefer': 'return=minimal' } result = payments_controller.void_payment(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -203,90 +225,100 @@ result = payments_controller.void_payment(collect) | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Refund Captured Payment +# Get Captured Payment -Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body. +Shows details for a captured payment, by ID. ```python -def refund_captured_payment(self, - options=dict()) +def get_captured_payment(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `capture_id` | `str` | Template, Required | The PayPal-generated ID for the captured payment to refund. | +| `capture_id` | `str` | Template, Required | The PayPal-generated ID for the captured payment for which to show details. | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 45 days. | -| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | -| `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | -| `body` | [`RefundRequest`](../../doc/models/refund-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). ## Example Usage ```python collect = { - 'capture_id': 'capture_id2', - 'prefer': 'return=minimal' + 'capture_id': 'capture_id2' } -result = payments_controller.refund_captured_payment(collect) +result = payments_controller.get_captured_payment(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Authorized Payment +# Refund Captured Payment -Shows details for an authorized payment, by ID. +Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body. ```python -def get_authorized_payment(self, - options=dict()) +def refund_captured_payment(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorization_id` | `str` | Template, Required | The ID of the authorized payment for which to show details. | +| `capture_id` | `str` | Template, Required | The PayPal-generated ID for the captured payment to refund. | | `paypal_mock_response` | `str` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 45 days. | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | | `paypal_auth_assertion` | `str` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | +| `body` | [`RefundRequest`](../../doc/models/refund-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). ## Example Usage ```python collect = { - 'authorization_id': 'authorization_id8' + 'capture_id': 'capture_id2', + 'prefer': 'return=minimal' } -result = payments_controller.get_authorized_payment(collect) +result = payments_controller.refund_captured_payment(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | +| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -319,6 +351,11 @@ collect = { 'refund_id': 'refund_id4' } result = payments_controller.get_refund(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md new file mode 100644 index 0000000..109bf7d --- /dev/null +++ b/doc/controllers/subscriptions.md @@ -0,0 +1,879 @@ +# Subscriptions + +Use the `/subscriptions` resource to create, update, retrieve, and cancel subscriptions and their associated plans. + +```python +subscriptions_controller = client.subscriptions +``` + +## Class Name + +`SubscriptionsController` + +## Methods + +* [Create Billing Plan](../../doc/controllers/subscriptions.md#create-billing-plan) +* [List Billing Plans](../../doc/controllers/subscriptions.md#list-billing-plans) +* [Get Billing Plan](../../doc/controllers/subscriptions.md#get-billing-plan) +* [Patch Billing Plan](../../doc/controllers/subscriptions.md#patch-billing-plan) +* [Activate Billing Plan](../../doc/controllers/subscriptions.md#activate-billing-plan) +* [Deactivate Billing Plan](../../doc/controllers/subscriptions.md#deactivate-billing-plan) +* [Update Billing Plan Pricing Schemes](../../doc/controllers/subscriptions.md#update-billing-plan-pricing-schemes) +* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) +* [List Subscriptions](../../doc/controllers/subscriptions.md#list-subscriptions) +* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) +* [Patch Subscription](../../doc/controllers/subscriptions.md#patch-subscription) +* [Revise Subscription](../../doc/controllers/subscriptions.md#revise-subscription) +* [Suspend Subscription](../../doc/controllers/subscriptions.md#suspend-subscription) +* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) +* [Activate Subscription](../../doc/controllers/subscriptions.md#activate-subscription) +* [Capture Subscription](../../doc/controllers/subscriptions.md#capture-subscription) +* [List Subscription Transactions](../../doc/controllers/subscriptions.md#list-subscription-transactions) + + +# Create Billing Plan + +Creates a plan that defines pricing and billing cycle details for subscriptions. + +```python +def create_billing_plan(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 72 hours. | +| `body` | [`PlanRequest`](../../doc/models/plan-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`BillingPlan`](../../doc/models/billing-plan.md). + +## Example Usage + +```python +collect = { + 'prefer': 'return=minimal', + 'body': PlanRequest( + product_id='product_id2', + name='name6', + billing_cycles=[ + SubscriptionBillingCycle( + frequency=Frequency( + interval_unit=IntervalUnit.DAY, + interval_count=1 + ), + tenure_type=TenureType.REGULAR, + sequence=8, + total_cycles=1 + ) + ], + payment_preferences=PaymentPreferences( + auto_bill_outstanding=True, + setup_fee_failure_action=SetupFeeFailureAction.CANCEL, + payment_failure_threshold=0 + ), + status=PlanRequestStatus.ACTIVE, + quantity_supported=False + ) +} +result = subscriptions_controller.create_billing_plan(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Billing Plans + +Lists billing plans. + +```python +def list_billing_plans(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, name, description and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `product_id` | `str` | Query, Optional | Filters the response by a Product ID.

**Constraints**: *Minimum Length*: `6`, *Maximum Length*: `50` | +| `page_size` | `int` | Query, Optional | The number of items to return in the response.

**Default**: `10`

**Constraints**: `>= 1`, `<= 20` | +| `page` | `int` | Query, Optional | A non-zero integer which is the start index of the entire list of items to return in the response. The combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items.

**Default**: `1`

**Constraints**: `>= 1`, `<= 100000` | +| `total_required` | `bool` | Query, Optional | Indicates whether to show the total count in the response.

**Default**: `False` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PlanCollection`](../../doc/models/plan-collection.md). + +## Example Usage + +```python +collect = { + 'prefer': 'return=minimal', + 'page_size': 10, + 'page': 1, + 'total_required': False +} +result = subscriptions_controller.list_billing_plans(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Get Billing Plan + +Shows details for a plan, by ID. + +```python +def get_billing_plan(self, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`BillingPlan`](../../doc/models/billing-plan.md). + +## Example Usage + +```python +id = 'id0' + +result = subscriptions_controller.get_billing_plan(id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Patch Billing Plan + +Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` plan, you can make only status updates. You can patch these attributes and objects: Attribute or object Operations description replace payment_preferences.auto_bill_outstanding replace taxes.percentage replace payment_preferences.payment_failure_threshold replace payment_preferences.setup_fee replace payment_preferences.setup_fee_failure_action replace name replace + +```python +def patch_billing_plan(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the plan. | +| `body` | [`List[Patch]`](../../doc/models/patch.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +collect = { + 'id': 'id0', + 'body': [ + Patch( + op=PatchOp.ADD + ) + ] +} +result = subscriptions_controller.patch_billing_plan(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Activate Billing Plan + +Activates a plan, by ID. + +```python +def activate_billing_plan(self, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +id = 'id0' + +result = subscriptions_controller.activate_billing_plan(id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Deactivate Billing Plan + +Deactivates a plan, by ID. + +```python +def deactivate_billing_plan(self, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +id = 'id0' + +result = subscriptions_controller.deactivate_billing_plan(id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Update Billing Plan Pricing Schemes + +Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month. + +```python +def update_billing_plan_pricing_schemes(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID for the plan. | +| `body` | [`UpdatePricingSchemesRequest`](../../doc/models/update-pricing-schemes-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +collect = { + 'id': 'id0', + 'body': UpdatePricingSchemesRequest( + pricing_schemes=[ + UpdatePricingScheme( + billing_cycle_sequence=34, + pricing_scheme=SubscriptionPricingScheme() + ) + ] + ) +} +result = subscriptions_controller.update_billing_plan_pricing_schemes(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Create Subscription + +Creates a subscription. + +```python +def create_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `str` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 72 hours. | +| `paypal_client_metadata_id` | `str` | Header, Optional | The PayPal Client Metadata Id(CMID) is used to provide device-specific information to PayPal's risk engine. This is crucial for transactions that require device-specific risk assessments. Merchants typically use the Paypal SDK that automatically submits the CMID or they use tools like Fraudnet JS for web or Magnes JS for mobile to generate the CMID on the frontend and then pass it to the API as part of the request headers.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Subscription`](../../doc/models/subscription.md). + +## Example Usage + +```python +collect = { + 'prefer': 'return=minimal', + 'body': CreateSubscriptionRequest( + plan_id='plan_id8', + auto_renewal=False + ) +} +result = subscriptions_controller.create_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Subscriptions + +List all subscriptions for merchant account. + +```python +def list_subscriptions(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_ids` | `str` | Query, Optional | Filters the response by list of plan IDs. Filter supports upto 70 plan IDs. URLs should not exceed a length of 2000 characters. | +| `statuses` | `str` | Query, Optional | Filters the response by list of subscription statuses.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `70`, *Pattern*: `^[A-Z_,]+$` | +| `created_after` | `str` | Query, Optional | Filters the response by subscription creation start time for a range of subscriptions.

**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})$` | +| `created_before` | `str` | Query, Optional | Filters the response by subscription creation end time for a range of subscriptions.

**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})$` | +| `status_updated_before` | `str` | Query, Optional | Filters the response by status update start time for a range of subscriptions.

**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})$` | +| `status_updated_after` | `str` | Query, Optional | Filters the response by status update end time for a range of subscriptions.

**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})$` | +| `filter` | `str` | Query, Optional | Filter the response using complex expressions that could use comparison operators like ge, gt, le, lt and logical operators such as 'and' and 'or'.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `100` | +| `page_size` | `int` | Query, Optional | The number of items to return in the response.

**Default**: `10`

**Constraints**: `>= 1`, `<= 20` | +| `page` | `int` | Query, Optional | A non-zero integer which is the start index of the entire list of items to return in the response. The combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items.

**Default**: `1`

**Constraints**: `>= 1`, `<= 10000000` | +| `customer_ids` | `List[str]` | Query, Optional | Filters the response by comma separated vault customer IDs (FSS subscriptions only).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10`, *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SubscriptionCollection`](../../doc/models/subscription-collection.md). + +## Example Usage + +```python +collect = { + 'page_size': 10, + 'page': 1 +} +result = subscriptions_controller.list_subscriptions(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Get Subscription + +Shows details for a subscription, by ID. + +```python +def get_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `fields` | `str` | Query, Optional | List of fields that are to be returned in the response. Possible value for fields are last_failed_payment and plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`Subscription`](../../doc/models/subscription.md). + +## Example Usage + +```python +collect = { + 'id': 'id0' +} +result = subscriptions_controller.get_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Patch Subscription + +Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan level default attributes by providing customised values for plan path in the patch request. You cannot update attributes that have already completed (Example - trial cycles can’t be updated if completed). Once overridden, changes to plan resource will not impact subscription. Any price update will not impact billing cycles within next 10 days (Applicable only for subscriptions funded by PayPal account). Following are the fields eligible for patch. Attribute or object Operations billing_info.outstanding_balance replace custom_id add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.fixed_price add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace plan.billing_cycles[@sequence==n]. total_cycles replace plan.payment_preferences. auto_bill_outstanding replace plan.payment_preferences. payment_failure_threshold replace plan.taxes.inclusive add,replace plan.taxes.percentage add,replace shipping_amount add,replace start_time replace subscriber.shipping_address add,replace subscriber.payment_source (for subscriptions funded by card payments) replace + +```python +def patch_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID for the subscription. | +| `body` | [`List[Patch]`](../../doc/models/patch.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +collect = { + 'id': 'id0', + 'body': [ + Patch( + op=PatchOp.ADD + ) + ] +} +result = subscriptions_controller.patch_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Revise Subscription + +Updates the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount`, `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +```python +def revise_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `body` | [`ModifySubscriptionRequest`](../../doc/models/modify-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`ModifySubscriptionResponse`](../../doc/models/modify-subscription-response.md). + +## Example Usage + +```python +collect = { + 'id': 'id0' +} +result = subscriptions_controller.revise_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Suspend Subscription + +Suspends the subscription. + +```python +def suspend_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `body` | [`SuspendSubscription`](../../doc/models/suspend-subscription.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +collect = { + 'id': 'id0' +} +result = subscriptions_controller.suspend_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Cancel Subscription + +Cancels the subscription. + +```python +def cancel_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `body` | [`CancelSubscriptionRequest`](../../doc/models/cancel-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +collect = { + 'id': 'id0' +} +result = subscriptions_controller.cancel_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Activate Subscription + +Activates the subscription. + +```python +def activate_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `body` | [`ActivateSubscriptionRequest`](../../doc/models/activate-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```python +collect = { + 'id': 'id0' +} +result = subscriptions_controller.activate_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Capture Subscription + +Captures an authorized payment from the subscriber on the subscription. + +```python +def capture_subscription(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 72 hours. | +| `body` | [`CaptureSubscriptionRequest`](../../doc/models/capture-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SubscriptionTransactionDetails`](../../doc/models/subscription-transaction-details.md). + +## Example Usage + +```python +collect = { + 'id': 'id0' +} +result = subscriptions_controller.capture_subscription(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Subscription Transactions + +Lists transactions for a subscription. + +```python +def list_subscription_transactions(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Template, Required | The ID of the subscription. | +| `start_time` | `str` | Query, Required | The start time of the range of transactions to list.

**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})$` | +| `end_time` | `str` | Query, Required | The end time of the range of transactions to list.

**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})$` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`TransactionsList`](../../doc/models/transactions-list.md). + +## Example Usage + +```python +collect = { + 'id': 'id0', + 'start_time': 'start_time6', + 'end_time': 'end_time2' +} +result = subscriptions_controller.list_subscription_transactions(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + diff --git a/doc/controllers/transactionsearch.md b/doc/controllers/transactionsearch.md new file mode 100644 index 0000000..c900f05 --- /dev/null +++ b/doc/controllers/transactionsearch.md @@ -0,0 +1,115 @@ +# Transactionsearch + +```python +transactionsearch_controller = client.transactionsearch +``` + +## Class Name + +`TransactionsearchController` + +## Methods + +* [Search Transactions](../../doc/controllers/transactionsearch.md#search-transactions) +* [Search Balances](../../doc/controllers/transactionsearch.md#search-balances) + + +# Search Transactions + +Lists transactions. Specify one or more query parameters to filter the transaction that appear in the response. Notes: If you specify one or more optional query parameters, the ending_balance response field is empty. It takes a maximum of three hours for executed transactions to appear in the list transactions call. This call lists transaction for the previous three years. + +```python +def search_transactions(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `start_date` | `str` | Query, Required | Filters the transactions in the response by a start date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional.

**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})$` | +| `end_date` | `str` | Query, Required | Filters the transactions in the response by an end date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional. The maximum supported range is 31 days.

**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})$` | +| `transaction_id` | `str` | Query, Optional | Filters the transactions in the response by a PayPal transaction ID. A valid transaction ID is 17 characters long, except for an order ID, which is 19 characters long. Note: A transaction ID is not unique in the reporting system. The response can list two transactions with the same ID. One transaction can be balance affecting while the other is non-balance affecting.

**Constraints**: *Minimum Length*: `17`, *Maximum Length*: `19` | +| `transaction_type` | `str` | Query, Optional | Filters the transactions in the response by a PayPal transaction event code. See [Transaction event codes](/docs/integration/direct/transaction-search/transaction-event-codes/). | +| `transaction_status` | `str` | Query, Optional | Filters the transactions in the response by a PayPal transaction status code. Value is: Status code Description D PayPal or merchant rules denied the transaction. P The transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S. S The transaction successfully completed without a denial and after any pending statuses. V A successful transaction was reversed and funds were refunded to the original sender. | +| `transaction_amount` | `str` | Query, Optional | Filters the transactions in the response by a gross transaction amount range. Specify the range as `TO`, where ` ` is the lower limit of the gross PayPal transaction amount and ` ` is the upper limit of the gross transaction amount. Specify the amounts in lower denominations. For example, to search for transactions from $5.00 to $10.05, specify `[500 TO 1005]`. Note:The values must be URL encoded. | +| `transaction_currency` | `str` | Query, Optional | Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency. | +| `payment_instrument_type` | `str` | Query, Optional | Filters the transactions in the response by a payment instrument type. Value is either: CREDITCARD. Returns a direct credit card transaction with a corresponding value. DEBITCARD. Returns a debit card transaction with a corresponding value. If you omit this parameter, the API does not apply this filter. | +| `store_id` | `str` | Query, Optional | Filters the transactions in the response by a store ID. | +| `terminal_id` | `str` | Query, Optional | Filters the transactions in the response by a terminal ID. | +| `fields` | `str` | Query, Optional | Indicates which fields appear in the response. Value is a single field or a comma-separated list of fields. The transaction_info value returns only the transaction details in the response. To include all fields in the response, specify fields=all. Valid fields are: transaction_info. The transaction information. Includes the ID of the PayPal account of the payee, the PayPal-generated transaction ID, the PayPal-generated base ID, the PayPal reference ID type, the transaction event code, the date and time when the transaction was initiated and was last updated, the transaction amounts including the PayPal fee, any discounts, insurance, the transaction status, and other information about the transaction. payer_info. The payer information. Includes the PayPal customer account ID and the payer's email address, primary phone number, name, country code, address, and whether the payer is verified or unverified. shipping_info. The shipping information. Includes the recipient's name, the shipping method for this order, the shipping address for this order, and the secondary address associated with this order. auction_info. The auction information. Includes the name of the auction site, the auction site URL, the ID of the customer who makes the purchase in the auction, and the date and time when the auction closes. cart_info. The cart information. Includes an array of item details, whether the item amount or the shipping amount already includes tax, and the ID of the invoice for PayPal-generated invoices. incentive_info. An array of incentive detail objects. Each object includes the incentive, such as a special offer or coupon, the incentive amount, and the incentive program code that identifies a merchant loyalty or incentive program. store_info. The store information. Includes the ID of the merchant store and the terminal ID for the checkout stand in the merchant store.

**Default**: `'transaction_info'` | +| `balance_affecting_records_only` | `str` | Query, Optional | Indicates whether the response includes only balance-impacting transactions or all transactions. Value is either: Y. The default. The response includes only balance transactions. N. The response includes all transactions.

**Default**: `'Y'` | +| `page_size` | `int` | Query, Optional | The number of items to return in the response. So, the combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items.

**Default**: `100`

**Constraints**: `>= 1`, `<= 500` | +| `page` | `int` | Query, Optional | The zero-relative start index of the entire list of items that are returned in the response. So, the combination of `page=1` and `page_size=20` returns the first 20 items.

**Default**: `1`

**Constraints**: `>= 1`, `<= 2147483647` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SearchResponse`](../../doc/models/search-response.md). + +## Example Usage + +```python +collect = { + 'start_date': 'start_date6', + 'end_date': 'end_date0', + 'fields': 'transaction_info', + 'balance_affecting_records_only': 'Y', + 'page_size': 100, + 'page': 1 +} +result = transaction_search_controller.search_transactions(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| Default | The error response. | [`SearchErrorException`](../../doc/models/search-error-exception.md) | + + +# Search Balances + +List all balances. Specify date time to list balances for that time that appear in the response. Notes: It takes a maximum of three hours for balances to appear in the list balances call. This call lists balances upto the previous three years. + +```python +def search_balances(self, + options=dict()) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `as_of_time` | `str` | Query, Optional | List balances in the response at the date time provided, will return the last refreshed balance in the system when not provided.

**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})$` | +| `currency_code` | `str` | Query, Optional | Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`BalancesResponse`](../../doc/models/balances-response.md). + +## Example Usage + +```python +collect = {} +result = transaction_search_controller.search_balances(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | The request is not well-formed, is syntactically incorrect, or violates schema. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| 500 | An internal server error occurred. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| Default | The error response. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | + diff --git a/doc/controllers/vault.md b/doc/controllers/vault.md index f166b8c..c70b962 100644 --- a/doc/controllers/vault.md +++ b/doc/controllers/vault.md @@ -12,39 +12,48 @@ vault_controller = client.vault ## Methods -* [Delete Payment Token](../../doc/controllers/vault.md#delete-payment-token) -* [Create Setup Token](../../doc/controllers/vault.md#create-setup-token) -* [Get Setup Token](../../doc/controllers/vault.md#get-setup-token) * [Create Payment Token](../../doc/controllers/vault.md#create-payment-token) * [List Customer Payment Tokens](../../doc/controllers/vault.md#list-customer-payment-tokens) * [Get Payment Token](../../doc/controllers/vault.md#get-payment-token) +* [Delete Payment Token](../../doc/controllers/vault.md#delete-payment-token) +* [Create Setup Token](../../doc/controllers/vault.md#create-setup-token) +* [Get Setup Token](../../doc/controllers/vault.md#get-setup-token) -# Delete Payment Token +# Create Payment Token -Delete the payment token associated with the payment token id. +Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. ```python -def delete_payment_token(self, - id) +def create_payment_token(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108`, *Pattern*: `^.*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). ## Example Usage ```python -id = 'id0' +collect = { + 'body': PaymentTokenRequest( + payment_source=PaymentTokenRequestPaymentSource() + ) +} +result = vault_controller.create_payment_token(collect) -result = vault_controller.delete_payment_token(id) +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -53,38 +62,48 @@ result = vault_controller.delete_payment_token(id) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Setup Token +# List Customer Payment Tokens -Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer. +Returns all payment tokens for a customer. ```python -def create_setup_token(self, - options=dict()) +def list_customer_payment_tokens(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`SetupTokenRequest`](../../doc/models/setup-token-request.md) | Body, Required | Setup Token creation with a instrument type optional financial instrument details and customer_id. | -| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | +| `customer_id` | `str` | Query, Required | A unique identifier representing a specific customer in merchant's/partner's system or records.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `page_size` | `int` | Query, Optional | A non-negative, non-zero integer indicating the maximum number of results to return at one time.

**Default**: `5`

**Constraints**: `>= 1`, `<= 5` | +| `page` | `int` | Query, Optional | A non-negative, non-zero integer representing the page of the results.

**Default**: `1`

**Constraints**: `>= 1`, `<= 10` | +| `total_required` | `bool` | Query, Optional | A boolean indicating total number of items (total_items) and pages (total_pages) are expected to be returned in the response.

**Default**: `False` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`CustomerVaultPaymentTokensResponse`](../../doc/models/customer-vault-payment-tokens-response.md). ## Example Usage ```python collect = { - 'body': SetupTokenRequest( - payment_source=SetupTokenRequestPaymentSource() - ) + 'customer_id': 'customer_id8', + 'page_size': 5, + 'page': 1, + 'total_required': False } -result = vault_controller.create_setup_token(collect) +result = vault_controller.list_customer_payment_tokens(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -93,35 +112,39 @@ result = vault_controller.create_setup_token(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Setup Token +# Get Payment Token -Returns a readable representation of temporarily vaulted payment source associated with the setup token id. +Returns a readable representation of vaulted payment source associated with the payment token id. ```python -def get_setup_token(self, - id) +def get_payment_token(self, + id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | ID of the setup token.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `str` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). ## Example Usage ```python id = 'id0' -result = vault_controller.get_setup_token(id) +result = vault_controller.get_payment_token(id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -134,35 +157,36 @@ result = vault_controller.get_setup_token(id) | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Payment Token +# Delete Payment Token -Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. +Delete the payment token associated with the payment token id. ```python -def create_payment_token(self, - options=dict()) +def delete_payment_token(self, + id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. | -| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | +| `id` | `str` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. ## Example Usage ```python -collect = { - 'body': PaymentTokenRequest( - payment_source=PaymentTokenRequestPaymentSource() - ) -} -result = vault_controller.create_payment_token(collect) +id = 'id0' + +result = vault_controller.delete_payment_token(id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -171,43 +195,43 @@ result = vault_controller.create_payment_token(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# List Customer Payment Tokens +# Create Setup Token -Returns all payment tokens for a customer. +Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer. ```python -def list_customer_payment_tokens(self, - options=dict()) +def create_setup_token(self, + options=dict()) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customer_id` | `str` | Query, Required | A unique identifier representing a specific customer in merchant's/partner's system or records.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | -| `page_size` | `int` | Query, Optional | A non-negative, non-zero integer indicating the maximum number of results to return at one time.

**Default**: `5`

**Constraints**: `>= 1`, `<= 5` | -| `page` | `int` | Query, Optional | A non-negative, non-zero integer representing the page of the results.

**Default**: `1`

**Constraints**: `>= 1`, `<= 10` | -| `total_required` | `bool` | Query, Optional | A boolean indicating total number of items (total_items) and pages (total_pages) are expected to be returned in the response.

**Default**: `False` | +| `body` | [`SetupTokenRequest`](../../doc/models/setup-token-request.md) | Body, Required | Setup Token creation with a instrument type optional financial instrument details and customer_id. | +| `paypal_request_id` | `str` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108`, *Pattern*: `^.*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`CustomerVaultPaymentTokensResponse`](../../doc/models/customer-vault-payment-tokens-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). ## Example Usage ```python collect = { - 'customer_id': 'customer_id8', - 'page_size': 5, - 'page': 1, - 'total_required': False + 'body': SetupTokenRequest( + payment_source=SetupTokenRequestPaymentSource() + ) } -result = vault_controller.list_customer_payment_tokens(collect) +result = vault_controller.create_setup_token(collect) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors @@ -216,34 +240,40 @@ result = vault_controller.list_customer_payment_tokens(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Payment Token +# Get Setup Token -Returns a readable representation of vaulted payment source associated with the payment token id. +Returns a readable representation of temporarily vaulted payment source associated with the setup token id. ```python -def get_payment_token(self, - id) +def get_setup_token(self, + id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `str` | Template, Required | ID of the setup token.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `body` property of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). ## Example Usage ```python id = 'id0' -result = vault_controller.get_payment_token(id) +result = vault_controller.get_setup_token(id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) ``` ## Errors diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md new file mode 100644 index 0000000..f26d728 --- /dev/null +++ b/doc/models/activate-subscription-request.md @@ -0,0 +1,23 @@ + +# Activate Subscription Request + +The activate subscription request details. + +## Structure + +`ActivateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `str` | Optional | The reason for activation of a subscription. Required to reactivate the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "reason": "reason4" +} +``` + diff --git a/doc/models/amount-breakdown.md b/doc/models/amount-breakdown.md index 00d190f..ceae3b3 100644 --- a/doc/models/amount-breakdown.md +++ b/doc/models/amount-breakdown.md @@ -17,7 +17,7 @@ The breakdown of the amount. Breakdown provides details such as total item amoun | `tax_total` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `insurance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `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 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) diff --git a/doc/models/app-switch-context.md b/doc/models/app-switch-context.md new file mode 100644 index 0000000..6d273d6 --- /dev/null +++ b/doc/models/app-switch-context.md @@ -0,0 +1,31 @@ + +# App Switch Context + +Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. + +## Structure + +`AppSwitchContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `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" + } +} +``` + diff --git a/doc/models/apple-pay-card-response.md b/doc/models/apple-pay-card-response.md index bbbdbac..6ac88d6 100644 --- a/doc/models/apple-pay-card-response.md +++ b/doc/models/apple-pay-card-response.md @@ -31,9 +31,9 @@ The Card from Apple Pay Wallet used to fund the payment. { "name": "name4", "last_digits": "last_digits8", - "brand": "HIPER", + "brand": "ACCEL", "available_networks": [ - "RUPAY" + "STAR_ACCESS" ], "type": "DEBIT" } diff --git a/doc/models/apple-pay-card.md b/doc/models/apple-pay-card.md index c2d0ab0..0763507 100644 --- a/doc/models/apple-pay-card.md +++ b/doc/models/apple-pay-card.md @@ -24,7 +24,7 @@ The payment card to be used to fund a payment. Can be a credit or debit card. "name": "name4", "last_digits": "last_digits8", "type": "UNKNOWN", - "brand": "AMEX", + "brand": "SWITCH", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/apple-pay-decrypted-token-data.md b/doc/models/apple-pay-decrypted-token-data.md index 9c3c767..c79e1d2 100644 --- a/doc/models/apple-pay-decrypted-token-data.md +++ b/doc/models/apple-pay-decrypted-token-data.md @@ -29,7 +29,7 @@ Information about the Payment data obtained by decrypting Apple Pay token. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id2", diff --git a/doc/models/apple-pay-payment-token.md b/doc/models/apple-pay-payment-token.md index 29dde70..6acc8bc 100644 --- a/doc/models/apple-pay-payment-token.md +++ b/doc/models/apple-pay-payment-token.md @@ -21,7 +21,7 @@ A resource representing a response for Apple Pay. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/apple-pay-request-card.md b/doc/models/apple-pay-request-card.md new file mode 100644 index 0000000..50b1af9 --- /dev/null +++ b/doc/models/apple-pay-request-card.md @@ -0,0 +1,34 @@ + +# Apple Pay Request Card + +The payment card to be used to fund a payment. Can be a credit or debit card. + +## Structure + +`ApplePayRequestCard` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `mtype` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | + +## Example (as JSON) + +```json +{ + "type": "PREPAID", + "brand": "PULSE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } +} +``` + diff --git a/doc/models/apple-pay-request.md b/doc/models/apple-pay-request.md index 18a1c9a..dff5e3d 100644 --- a/doc/models/apple-pay-request.md +++ b/doc/models/apple-pay-request.md @@ -40,7 +40,7 @@ Information needed to pay using ApplePay. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", diff --git a/doc/models/apple-pay-tokenized-card.md b/doc/models/apple-pay-tokenized-card.md index 5731e09..02f961f 100644 --- a/doc/models/apple-pay-tokenized-card.md +++ b/doc/models/apple-pay-tokenized-card.md @@ -14,7 +14,7 @@ The payment card to use to fund a payment. Can be a credit or debit card. | `name` | `str` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.{1,300}$` | | `number` | `str` | Optional | The primary account number (PAN) for the payment card.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | | `expiry` | `str` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | -| `card_type` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `card_type` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card brand or network. Typically used in the response.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `mtype` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | diff --git a/doc/models/application-context-user-action.md b/doc/models/application-context-user-action.md new file mode 100644 index 0000000..f6595f7 --- /dev/null +++ b/doc/models/application-context-user-action.md @@ -0,0 +1,16 @@ + +# Application Context User Action + +Configures the label name to `Continue` or `Subscribe Now` for subscription consent experience. + +## Enumeration + +`ApplicationContextUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CONTINUE` | After you redirect the customer to the PayPal subscription consent page, a Continue button appears. Use this option when you want to control the activation of the subscription and do not want PayPal to activate the subscription. | +| `SUBSCRIBE_NOW` | After you redirect the customer to the PayPal subscription consent page, a Subscribe Now button appears. Use this option when you want PayPal to activate the subscription. | + diff --git a/doc/models/auction-information.md b/doc/models/auction-information.md new file mode 100644 index 0000000..ec5f96f --- /dev/null +++ b/doc/models/auction-information.md @@ -0,0 +1,29 @@ + +# Auction Information + +The auction information. + +## Structure + +`AuctionInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `auction_site` | `str` | Optional | The name of the auction site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `auction_item_site` | `str` | Optional | The auction site URL.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `auction_buyer_id` | `str` | Optional | The ID of the buyer who makes the purchase in the auction. This ID might be different from the payer ID provided for the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `auction_closing_date` | `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.

**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) + +```json +{ + "auction_site": "auction_site6", + "auction_item_site": "auction_item_site8", + "auction_buyer_id": "auction_buyer_id0", + "auction_closing_date": "auction_closing_date0" +} +``` + diff --git a/doc/models/authorization-with-additional-data.md b/doc/models/authorization-with-additional-data.md index e037595..995cd9a 100644 --- a/doc/models/authorization-with-additional-data.md +++ b/doc/models/authorization-with-additional-data.md @@ -17,7 +17,7 @@ The authorization with additional payment details, such as risk assessment and p | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `expiration_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.

**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})$` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | diff --git a/doc/models/authorization.md b/doc/models/authorization.md index 3a71642..23c47a4 100644 --- a/doc/models/authorization.md +++ b/doc/models/authorization.md @@ -17,7 +17,7 @@ The authorized payment transaction. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `expiration_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.

**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})$` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | diff --git a/doc/models/balance-information.md b/doc/models/balance-information.md new file mode 100644 index 0000000..526c33a --- /dev/null +++ b/doc/models/balance-information.md @@ -0,0 +1,40 @@ + +# Balance Information + +The Balance information. + +## Structure + +`BalanceInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `currency` | `str` | Required | The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | +| `primary` | `bool` | Optional | Optional field representing if the currency is primary currency or not. | +| `total_balance` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `available_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `withheld_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "currency": "currency4", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } +} +``` + diff --git a/doc/models/balances-response.md b/doc/models/balances-response.md new file mode 100644 index 0000000..efdedfc --- /dev/null +++ b/doc/models/balances-response.md @@ -0,0 +1,78 @@ + +# Balances Response + +The balances response information. + +## Structure + +`BalancesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `balances` | [`List[BalanceInformation]`](../../doc/models/balance-information.md) | Optional | An array of balance detail objects.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `200` | +| `account_id` | `str` | Optional | The PayPal payer ID, which is a masked version of the PayPal account number intended for use with third parties. The account number is reversibly encrypted and a proprietary variant of Base32 is used to encode the result.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | +| `as_of_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.

**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})$` | +| `last_refresh_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.

**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) + +```json +{ + "balances": [ + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + }, + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + }, + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + } + ], + "account_id": "account_id0", + "as_of_time": "as_of_time2", + "last_refresh_time": "last_refresh_time0" +} +``` + diff --git a/doc/models/bank-request.md b/doc/models/bank-request.md new file mode 100644 index 0000000..8ce3f2f --- /dev/null +++ b/doc/models/bank-request.md @@ -0,0 +1,34 @@ + +# Bank Request + +A Resource representing a request to vault a Bank used for ACH Debit. + +## Structure + +`BankRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ach_debit` | `Any` | Optional | A Resource representing a request to vault a ACH Debit. | +| `sepa_debit` | [`SepaDebitRequest`](../../doc/models/sepa-debit-request.md) | Optional | An API resource denoting a request to securely store a SEPA Debit. | + +## Example (as JSON) + +```json +{ + "ach_debit": { + "key1": "val1", + "key2": "val2" + }, + "sepa_debit": { + "experience_context": { + "locale": "locale6", + "return_url": "return_url4", + "cancel_url": "cancel_url6" + } + } +} +``` + diff --git a/doc/models/billing-cycle-override.md b/doc/models/billing-cycle-override.md new file mode 100644 index 0000000..b68dd01 --- /dev/null +++ b/doc/models/billing-cycle-override.md @@ -0,0 +1,61 @@ + +# Billing Cycle Override + +The billing cycle details to override at subscription level. The subscription billing cycle definition has to adhere to the plan billing cycle definition. + +## Structure + +`BillingCycleOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Optional | The pricing scheme details. | +| `sequence` | `int` | Required | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Constraints**: `>= 1`, `<= 99` | +| `total_cycles` | `int` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 58, + "total_cycles": 248 +} +``` + diff --git a/doc/models/billing-cycle.md b/doc/models/billing-cycle.md index 0e522a4..4a54d44 100644 --- a/doc/models/billing-cycle.md +++ b/doc/models/billing-cycle.md @@ -13,7 +13,6 @@ The billing cycle providing details of the billing frequency, amount, duration a | --- | --- | --- | --- | | `tenure_type` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The pricing scheme details. | -| `frequency` | `Any` | Optional | The frequency details for this billing cycle. | | `total_cycles` | `int` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | | `sequence` | `int` | Optional | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Default**: `1`

**Constraints**: `>= 1`, `<= 3` | | `start_date` | `str` | Optional | The stand-alone date, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard `date_time` type. This regular expression does not validate all dates. For example, February 31 is valid and nothing is known about leap years.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `10`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])$` | @@ -36,10 +35,6 @@ The billing cycle providing details of the billing frequency, amount, duration a "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date0" } ``` diff --git a/doc/models/billing-plan.md b/doc/models/billing-plan.md new file mode 100644 index 0000000..c74e6e2 --- /dev/null +++ b/doc/models/billing-plan.md @@ -0,0 +1,40 @@ + +# Billing Plan + +The plan details. + +## Structure + +`BillingPlan` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `product_id` | `str` | Optional | The ID for the product.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | +| `name` | `str` | Optional | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `status` | [`SubscriptionPlanStatus`](../../doc/models/subscription-plan-status.md) | Optional | The plan status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `description` | `str` | Optional | The detailed description of the plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `billing_cycles` | [`List[SubscriptionBillingCycle]`](../../doc/models/subscription-billing-cycle.md) | Optional | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Optional | The payment preferences for a subscription. | +| `merchant_preferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | +| `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | +| `quantity_supported` | `bool` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `False` | +| `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.

**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.

**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})$` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "quantity_supported": false, + "id": "id0", + "product_id": "product_id4", + "name": "name0", + "status": "CREATED", + "description": "description0" +} +``` + diff --git a/doc/models/blik-experience-context.md b/doc/models/blik-experience-context.md index d34757f..0bac3c5 100644 --- a/doc/models/blik-experience-context.md +++ b/doc/models/blik-experience-context.md @@ -13,7 +13,7 @@ Customizes the payer experience during the approval process for the BLIK payment | --- | --- | --- | --- | | `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `str` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | -| `shipping_preference` | [`ShippingPreference`](../../doc/models/shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `return_url` | `str` | Optional | Describes the URL. | | `cancel_url` | `str` | Optional | Describes the URL. | | `consumer_ip` | `str` | Optional | An Internet Protocol address (IP address). This address assigns a numerical label to each device that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6 addresses.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `39`, *Pattern*: `^(([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])\.){3}([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])$\|^(([a-zA-Z]\|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]\|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$\|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}\|:))\|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}\|((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})\|:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})\|((:[0-9A-Fa-f]{1,4})?:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})\|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})\|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})\|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(:(((:[0-9A-Fa-f]{1,4}){1,7})\|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:)))(%.+)?\s*$` | diff --git a/doc/models/cancel-subscription-request.md b/doc/models/cancel-subscription-request.md new file mode 100644 index 0000000..d808a21 --- /dev/null +++ b/doc/models/cancel-subscription-request.md @@ -0,0 +1,23 @@ + +# Cancel Subscription Request + +The cancel subscription request details. + +## Structure + +`CancelSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `str` | Required | The reason for the cancellation of a subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "reason": "reason8" +} +``` + diff --git a/doc/models/capture-request.md b/doc/models/capture-request.md index c531704..480da1e 100644 --- a/doc/models/capture-request.md +++ b/doc/models/capture-request.md @@ -1,6 +1,8 @@ # Capture Request +Captures either a portion or the full authorized amount of an authorized payment. + ## Structure `CaptureRequest` @@ -9,11 +11,11 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.{1,127}$` | -| `note_to_payer` | `str` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^.{1,255}$` | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Maximum Length*: `127` | | `final_capture` | `bool` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `False` | | `payment_instruction` | [`CapturePaymentInstruction`](../../doc/models/capture-payment-instruction.md) | Optional | Any additional payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. | +| `note_to_payer` | `str` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Maximum Length*: `255` | | `soft_descriptor` | `str` | Optional | The payment descriptor on the payer's account statement.

**Constraints**: *Maximum Length*: `22` | ## Example (as JSON) @@ -21,12 +23,11 @@ ```json { "final_capture": false, - "invoice_id": "invoice_id4", - "note_to_payer": "note_to_payer6", "amount": { "currency_code": "currency_code6", "value": "value0" }, + "invoice_id": "invoice_id4", "payment_instruction": { "platform_fees": [ { @@ -62,7 +63,8 @@ ], "disbursement_mode": "INSTANT", "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - } + }, + "note_to_payer": "note_to_payer6" } ``` diff --git a/doc/models/capture-subscription-request.md b/doc/models/capture-subscription-request.md new file mode 100644 index 0000000..10cc2ad --- /dev/null +++ b/doc/models/capture-subscription-request.md @@ -0,0 +1,30 @@ + +# Capture Subscription Request + +The charge amount from the subscriber. + +## Structure + +`CaptureSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `note` | `str` | Required | The reason or note for the subscription charge.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | +| `capture_type` | [`CaptureType`](../../doc/models/capture-type.md) | Required | The type of capture.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "note": "note4", + "capture_type": "OUTSTANDING_BALANCE", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } +} +``` + diff --git a/doc/models/capture-type.md b/doc/models/capture-type.md new file mode 100644 index 0000000..4739ebd --- /dev/null +++ b/doc/models/capture-type.md @@ -0,0 +1,15 @@ + +# Capture Type + +The type of capture. + +## Enumeration + +`CaptureType` + +## Fields + +| Name | Description | +| --- | --- | +| `OUTSTANDING_BALANCE` | The outstanding balance that the subscriber must clear. | + diff --git a/doc/models/captured-payment.md b/doc/models/captured-payment.md index 9c1926d..d4dcb36 100644 --- a/doc/models/captured-payment.md +++ b/doc/models/captured-payment.md @@ -17,13 +17,13 @@ A captured payment. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `final_capture` | `bool` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `False` | | `seller_receivable_breakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `'INSTANT'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -| `processor_response` | [`PaymentsProcessorResponse`](../../doc/models/payments-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | +| `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `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.

**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.

**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})$` | | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md index 9c5600c..d02e168 100644 --- a/doc/models/card-brand.md +++ b/doc/models/card-brand.md @@ -35,5 +35,10 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `GE` | The GE Credit Union 3Point card payment network. | | `SYNCHRONY` | The Synchrony Financial (SYF) payment network. | | `EFTPOS` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | +| `CARTE_BANCAIRE` | The Carte Bancaire payment network. | +| `STAR_ACCESS` | The Star Access payment network. | +| `PULSE` | The Pulse payment network. | +| `NYCE` | The NYCE payment network. | +| `ACCEL` | The Accel payment network. | | `UNKNOWN` | UNKNOWN payment network. | diff --git a/doc/models/card-customer.md b/doc/models/card-customer.md new file mode 100644 index 0000000..2c34991 --- /dev/null +++ b/doc/models/card-customer.md @@ -0,0 +1,34 @@ + +# Card Customer + +The details about a customer in PayPal's system of record. + +## Structure + +`CardCustomer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | +| `merchant_customer_id` | `str` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | + +## Example (as JSON) + +```json +{ + "id": "id2", + "email_address": "email_address0", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "merchant_customer_id": "merchant_customer_id4" +} +``` + diff --git a/doc/models/card-response-with-billing-address.md b/doc/models/card-response-with-billing-address.md new file mode 100644 index 0000000..6071ee3 --- /dev/null +++ b/doc/models/card-response-with-billing-address.md @@ -0,0 +1,36 @@ + +# Card Response With Billing Address + +The payment card used to fund the payment. Card can be a credit or debit card. + +## Structure + +`CardResponseWithBillingAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `300` | +| `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | +| `expiry` | `str` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | +| `currency_code` | `str` | Optional | The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | + +## Example (as JSON) + +```json +{ + "name": "name0", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry8", + "currency_code": "currency_code4" +} +``` + diff --git a/doc/models/card-response.md b/doc/models/card-response.md index 28b8835..a362009 100644 --- a/doc/models/card-response.md +++ b/doc/models/card-response.md @@ -29,11 +29,11 @@ The payment card to use to fund a payment. Card can be a credit or debit card. { "name": "name0", "last_digits": "last_digits4", - "brand": "UNKNOWN", + "brand": "CARTE_BANCAIRE", "available_networks": [ - "CONFIDIS", - "CONFIGOGA", - "CB_NATIONALE" + "ELO", + "DINERS", + "CHINA_UNION_PAY" ], "type": "CREDIT" } diff --git a/doc/models/card-stored-credential.md b/doc/models/card-stored-credential.md index 0b58e0f..c4501de 100644 --- a/doc/models/card-stored-credential.md +++ b/doc/models/card-stored-credential.md @@ -14,7 +14,7 @@ Provides additional details to process a payment using a `card` that has been st | `payment_initiator` | [`PaymentInitiator`](../../doc/models/payment-initiator.md) | Required | The person or party who initiated or triggered the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_type` | [`StoredPaymentSourcePaymentType`](../../doc/models/stored-payment-source-payment-type.md) | Required | Indicates the type of the stored payment_source payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `'DERIVED'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `previous_network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `previous_network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | ## Example (as JSON) @@ -26,7 +26,7 @@ Provides additional details to process a payment using a `card` that has been st "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/card-verification-details.md b/doc/models/card-verification-details.md index 26a2004..4c9fe7c 100644 --- a/doc/models/card-verification-details.md +++ b/doc/models/card-verification-details.md @@ -13,8 +13,8 @@ Card Verification details including the authorization details and 3D SECURE deta | --- | --- | --- | --- | | `network_transaction_id` | `str` | Optional | DEPRECATED. This field is DEPRECATED. Please find the network transaction id data in the 'id' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1024`, *Pattern*: `^[a-zA-Z0-9-_@.:&+=*^'~#!$%()]+$` | | `date` | `str` | Optional | DEPRECATED. This field is DEPRECATED. Please find the date data in the 'date' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | -| `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -| `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.

**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})$` | +| `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | DEPRECATED. This field is DEPRECATED. Please find the network data in the 'network' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `time` | `str` | Optional | DEPRECATED. This field is DEPRECATED. Please find the time data in the 'time' field under the 'network_transaction_reference' object instead of the 'verification' object.

**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})$` | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `processor_response` | [`CardVerificationProcessorResponse`](../../doc/models/card-verification-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `three_d_secure` | `Any` | Optional | DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in the 'three_d_secure' object under the 'authentication_result' object instead of the 'verification' object. | @@ -25,7 +25,7 @@ Card Verification details including the authorization details and 3D SECURE deta { "network_transaction_id": "network_transaction_id4", "date": "date8", - "network": "EFTPOS", + "network": "ACCEL", "time": "time2", "amount": { "currency_code": "currency_code6", diff --git a/doc/models/cart-information.md b/doc/models/cart-information.md new file mode 100644 index 0000000..c65e976 --- /dev/null +++ b/doc/models/cart-information.md @@ -0,0 +1,35 @@ + +# Cart Information + +The cart information. + +## Structure + +`CartInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `item_details` | [`List[ItemDetails]`](../../doc/models/item-details.md) | Optional | An array of item details.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | +| `tax_inclusive` | `bool` | Optional | Indicates whether the item amount or the shipping amount already includes tax.

**Default**: `False` | +| `paypal_invoice_id` | `str` | Optional | The ID of the invoice. Appears for only PayPal-generated invoices.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | + +## Example (as JSON) + +```json +{ + "tax_inclusive": false, + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "paypal_invoice_id": "paypal_invoice_id2" +} +``` + diff --git a/doc/models/checkout-option.md b/doc/models/checkout-option.md new file mode 100644 index 0000000..06dccc7 --- /dev/null +++ b/doc/models/checkout-option.md @@ -0,0 +1,25 @@ + +# Checkout Option + +A checkout option as a name-and-value pair. + +## Structure + +`CheckoutOption` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkout_option_name` | `str` | Optional | The checkout option name, such as `color` or `texture`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `checkout_option_value` | `str` | Optional | The checkout option value. For example, the checkout option `color` might be `blue` or `red` while the checkout option `texture` might be `smooth` or `rippled`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | + +## Example (as JSON) + +```json +{ + "checkout_option_name": "checkout_option_name6", + "checkout_option_value": "checkout_option_value0" +} +``` + diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md index 85f6f68..b728797 100644 --- a/doc/models/confirm-order-request.md +++ b/doc/models/confirm-order-request.md @@ -97,7 +97,7 @@ Payer confirms the intent to pay for the Order using the provided payment source "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md new file mode 100644 index 0000000..99eadf4 --- /dev/null +++ b/doc/models/create-subscription-request.md @@ -0,0 +1,82 @@ + +# Create Subscription Request + +The create subscription request details. + +## Structure + +`CreateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_id` | `str` | Required | The ID of the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `start_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.

**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})$` | +| `quantity` | `str` | Optional | The quantity of the product in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `subscriber` | [`SubscriberRequest`](../../doc/models/subscriber-request.md) | Optional | The subscriber request information . | +| `auto_renewal` | `bool` | Optional | DEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete.

**Default**: `False` | +| `application_context` | [`SubscriptionApplicationContext`](../../doc/models/subscription-application-context.md) | Optional | DEPRECATED. The application context, which customizes the payer experience during the subscription approval process with PayPal. | +| `custom_id` | `str` | Optional | The custom id for the subscription. Can be invoice id.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\x20-\x7E]+` | +| `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id8", + "auto_renewal": false, + "start_time": "start_time0", + "quantity": "quantity2", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "subscriber": { + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } + } + } +} +``` + diff --git a/doc/models/customer-vault-payment-tokens-response.md b/doc/models/customer-vault-payment-tokens-response.md index daf492d..8d79bfc 100644 --- a/doc/models/customer-vault-payment-tokens-response.md +++ b/doc/models/customer-vault-payment-tokens-response.md @@ -48,7 +48,7 @@ Collection of payment tokens saved for a given customer. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -66,6 +66,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -90,6 +91,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -112,7 +114,7 @@ Collection of payment tokens saved for a given customer. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", @@ -147,7 +149,7 @@ Collection of payment tokens saved for a given customer. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -165,6 +167,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -189,6 +192,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -211,7 +215,7 @@ Collection of payment tokens saved for a given customer. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/cycle-execution.md b/doc/models/cycle-execution.md new file mode 100644 index 0000000..fa46ee2 --- /dev/null +++ b/doc/models/cycle-execution.md @@ -0,0 +1,33 @@ + +# Cycle Execution + +The regular and trial execution details for a billing cycle. + +## Structure + +`CycleExecution` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `tenure_type` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The type of the billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `sequence` | `int` | Required | The order in which to run this cycle among other billing cycles.

**Constraints**: `>= 0`, `<= 99` | +| `cycles_completed` | `int` | Required | The number of billing cycles that have completed.

**Constraints**: `>= 0`, `<= 9999` | +| `cycles_remaining` | `int` | Optional | For a finite billing cycle, cycles_remaining is the number of remaining cycles. For an infinite billing cycle, cycles_remaining is set as 0.

**Constraints**: `>= 0`, `<= 9999` | +| `current_pricing_scheme_version` | `int` | Optional | The active pricing scheme version for the billing cycle.

**Constraints**: `>= 1`, `<= 99` | +| `total_cycles` | `int` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "tenure_type": "REGULAR", + "sequence": 99, + "cycles_completed": 172, + "cycles_remaining": 208, + "current_pricing_scheme_version": 99, + "total_cycles": 60 +} +``` + diff --git a/doc/models/default-error-exception.md b/doc/models/default-error-exception.md new file mode 100644 index 0000000..897fc8d --- /dev/null +++ b/doc/models/default-error-exception.md @@ -0,0 +1,47 @@ + +# Default Error Exception + +The error details. + +## Structure + +`DefaultErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Required | The human-readable, unique name of the error. | +| `message` | `str` | Required | The message that describes the error. | +| `debug_id` | `str` | Required | The PayPal internal ID. Used for correlation purposes. | +| `information_link` | `str` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | +| `details` | [`List[TransactionSearchErrorDetails]`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "name": "name2", + "message": "message2", + "debug_id": "debug_id8", + "information_link": "information_link4", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/experience-context-shipping-preference.md b/doc/models/experience-context-shipping-preference.md new file mode 100644 index 0000000..7faad7c --- /dev/null +++ b/doc/models/experience-context-shipping-preference.md @@ -0,0 +1,17 @@ + +# Experience Context Shipping Preference + +The location from which the shipping address is derived., The shipping preference. This only applies to PayPal payment source., The shipping preference. This only applies to PayPal payment source., The location from which the shipping address is derived. + +## Enumeration + +`ExperienceContextShippingPreference` + +## Fields + +| Name | Description | +| --- | --- | +| `GET_FROM_FILE` | Get the customer-provided shipping address on the PayPal site. | +| `NO_SHIPPING` | Redacts the shipping address from the PayPal site. Recommended for digital goods. | +| `SET_PROVIDED_ADDRESS` | Merchant sends the shipping address using purchase_units.shipping.address. The customer cannot change this address on the PayPal site. | + diff --git a/doc/models/experience-context.md b/doc/models/experience-context.md index 0ebdbeb..5c58e3e 100644 --- a/doc/models/experience-context.md +++ b/doc/models/experience-context.md @@ -13,7 +13,7 @@ Customizes the payer experience during the approval process for the payment. | --- | --- | --- | --- | | `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `str` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | -| `shipping_preference` | [`ShippingPreference`](../../doc/models/shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `return_url` | `str` | Optional | Describes the URL. | | `cancel_url` | `str` | Optional | Describes the URL. | diff --git a/doc/models/experience-status.md b/doc/models/experience-status.md new file mode 100644 index 0000000..65f589a --- /dev/null +++ b/doc/models/experience-status.md @@ -0,0 +1,18 @@ + +# Experience Status + +This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process. + +## Enumeration + +`ExperienceStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `NOT_STARTED` | PayPal checkout process has not yet begun. | +| `IN_PROGRESS` | PayPal checkout initiated. User is on the checkout page for order review before approval. | +| `CANCELED` | PayPal checkout is canceled (by closing the checkout window or clicking cancel) before the order approval. | +| `APPROVED` | Order is approved. User has completed the checkout process. | + diff --git a/doc/models/failed-payment-details.md b/doc/models/failed-payment-details.md new file mode 100644 index 0000000..d42f2d2 --- /dev/null +++ b/doc/models/failed-payment-details.md @@ -0,0 +1,32 @@ + +# Failed Payment Details + +The details for the failed payment of the subscription. + +## Structure + +`FailedPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `time` | `str` | Required | 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.

**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})$` | +| `reason_code` | [`ReasonCode`](../../doc/models/reason-code.md) | Optional | The reason code for the payment failure.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `120`, *Pattern*: `^[A-Z_]+$` | +| `next_payment_retry_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.

**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) + +```json +{ + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time6", + "reason_code": "TRANSACTION_RECEIVING_LIMIT_EXCEEDED", + "next_payment_retry_time": "next_payment_retry_time6" +} +``` + diff --git a/doc/models/frequency.md b/doc/models/frequency.md new file mode 100644 index 0000000..f5c3a80 --- /dev/null +++ b/doc/models/frequency.md @@ -0,0 +1,25 @@ + +# Frequency + +The frequency of the billing cycle. + +## Structure + +`Frequency` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | The interval at which the subscription is charged or billed.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `interval_count` | `int` | Optional | The number of intervals after which a subscriber is billed. For example, if the `interval_unit` is `DAY` with an `interval_count` of `2`, the subscription is billed once every two days. The following table lists the maximum allowed values for the `interval_count` for each `interval_unit`: Interval unit Maximum interval count DAY 365 WEEK 52 MONTH 12 YEAR 1

**Default**: `1`

**Constraints**: `>= 1`, `<= 365` | + +## Example (as JSON) + +```json +{ + "interval_unit": "DAY", + "interval_count": 1 +} +``` + diff --git a/doc/models/google-pay-card-response.md b/doc/models/google-pay-card-response.md index 15b84b2..efc85a8 100644 --- a/doc/models/google-pay-card-response.md +++ b/doc/models/google-pay-card-response.md @@ -25,7 +25,7 @@ The payment card to use to fund a Google Pay payment response. Can be a credit o "name": "name4", "last_digits": "last_digits8", "type": "DEBIT", - "brand": "ELECTRON", + "brand": "ACCEL", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-request-card.md b/doc/models/google-pay-request-card.md index 1a4f6ba..937d4d5 100644 --- a/doc/models/google-pay-request-card.md +++ b/doc/models/google-pay-request-card.md @@ -22,7 +22,7 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car { "name": "name8", "type": "STORE", - "brand": "DISCOVER", + "brand": "CONFIDIS", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md index 54cfc93..b239433 100644 --- a/doc/models/google-pay-request.md +++ b/doc/models/google-pay-request.md @@ -32,7 +32,7 @@ Information needed to pay using Google Pay. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-wallet-response.md b/doc/models/google-pay-wallet-response.md index 85df3df..631f521 100644 --- a/doc/models/google-pay-wallet-response.md +++ b/doc/models/google-pay-wallet-response.md @@ -30,7 +30,7 @@ Google Pay Wallet payment data. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/incentive-details.md b/doc/models/incentive-details.md new file mode 100644 index 0000000..d7179a7 --- /dev/null +++ b/doc/models/incentive-details.md @@ -0,0 +1,32 @@ + +# Incentive Details + +The incentive details. + +## Structure + +`IncentiveDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `incentive_type` | `str` | Optional | The type of incentive, such as a special offer or coupon.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `incentive_code` | `str` | Optional | The code that identifies an incentive, such as a coupon.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `incentive_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `incentive_program_code` | `str` | Optional | The incentive program code that identifies a merchant loyalty or incentive program.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | + +## Example (as JSON) + +```json +{ + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" +} +``` + diff --git a/doc/models/incentive-information.md b/doc/models/incentive-information.md new file mode 100644 index 0000000..507a04b --- /dev/null +++ b/doc/models/incentive-information.md @@ -0,0 +1,51 @@ + +# Incentive Information + +The incentive details. + +## Structure + +`IncentiveInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `incentive_details` | [`List[IncentiveDetails]`](../../doc/models/incentive-details.md) | Optional | An array of incentive details.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | + +## Example (as JSON) + +```json +{ + "incentive_details": [ + { + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" + }, + { + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" + }, + { + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" + } + ] +} +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md new file mode 100644 index 0000000..df7ce04 --- /dev/null +++ b/doc/models/interval-unit.md @@ -0,0 +1,18 @@ + +# Interval Unit + +The interval at which the subscription is charged or billed. + +## Enumeration + +`IntervalUnit` + +## Fields + +| Name | Description | +| --- | --- | +| `DAY` | A daily billing cycle. | +| `WEEK` | A weekly billing cycle. | +| `MONTH` | A monthly billing cycle. | +| `YEAR` | A yearly billing cycle. | + diff --git a/doc/models/item-details.md b/doc/models/item-details.md new file mode 100644 index 0000000..9a4b34b --- /dev/null +++ b/doc/models/item-details.md @@ -0,0 +1,45 @@ + +# Item Details + +The item details. + +## Structure + +`ItemDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `item_code` | `str` | Optional | An item code that identifies a merchant's goods or service.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_name` | `str` | Optional | The item name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_description` | `str` | Optional | The item description.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_options` | `str` | Optional | The item options. Describes option choices on the purchase of the item in some detail.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_quantity` | `str` | Optional | The number of purchased units of goods or a service.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_unit_price` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `item_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `adjustment_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `gift_wrap_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tax_percentage` | `str` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `tax_amounts` | [`List[TaxAmount]`](../../doc/models/tax-amount.md) | Optional | An array of tax amounts levied by a government on the purchase of goods or services.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | +| `basic_shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `extra_shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `handling_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `insurance_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `total_item_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `invoice_number` | `str` | Optional | The invoice number. An alphanumeric string that identifies a billing for a merchant.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `checkout_options` | [`List[CheckoutOption]`](../../doc/models/checkout-option.md) | Optional | An array of checkout options. Each option has a name and value.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | + +## Example (as JSON) + +```json +{ + "item_code": "item_code4", + "item_name": "item_name2", + "item_description": "item_description0", + "item_options": "item_options4", + "item_quantity": "item_quantity4" +} +``` + diff --git a/doc/models/item-request.md b/doc/models/item-request.md new file mode 100644 index 0000000..e5a3ab5 --- /dev/null +++ b/doc/models/item-request.md @@ -0,0 +1,46 @@ + +# Item Request + +The details for the items to be purchased. + +## Structure + +`ItemRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Required | The item name or title.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | +| `unit_amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tax` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `quantity` | `str` | Required | The item quantity. Must be a whole number.

**Constraints**: *Maximum Length*: `10`, *Pattern*: `^[1-9][0-9]{0,9}$` | +| `description` | `str` | Optional | This field supports up to 4000 characters, but any content beyond 2048 characters (including spaces) will be truncated. The 2048 character limit is reflected in the response representation of this field.

**Constraints**: *Maximum Length*: `4000` | +| `sku` | `str` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | +| `url` | `str` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | +| `category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | The item category type.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20` | +| `image_url` | `str` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | +| `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | +| `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | + +## Example (as JSON) + +```json +{ + "name": "name0", + "unit_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "tax": { + "currency_code": "currency_code0", + "value": "value6" + }, + "quantity": "quantity6", + "description": "description0", + "sku": "sku6", + "url": "url4", + "category": "DIGITAL_GOODS" +} +``` + diff --git a/doc/models/item.md b/doc/models/item.md index 580fa05..6a6fbbf 100644 --- a/doc/models/item.md +++ b/doc/models/item.md @@ -19,7 +19,7 @@ The details for the items to be purchased. | `sku` | `str` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | | `url` | `str` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | | `category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | The item category type.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20` | -| `image_url` | `str` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | +| `image_url` | `str` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)(\?.*)?$` | | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | | `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | diff --git a/doc/models/last-payment-details.md b/doc/models/last-payment-details.md new file mode 100644 index 0000000..9dcb39d --- /dev/null +++ b/doc/models/last-payment-details.md @@ -0,0 +1,26 @@ + +# Last Payment Details + +## Structure + +`LastPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `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.

**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) + +```json +{ + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time0" +} +``` + diff --git a/doc/models/line-item.md b/doc/models/line-item.md index 652f770..6a397c3 100644 --- a/doc/models/line-item.md +++ b/doc/models/line-item.md @@ -16,7 +16,7 @@ The line items for this purchase. If your merchant account has been configured f | `description` | `str` | Optional | The detailed item description.

**Constraints**: *Maximum Length*: `2048` | | `sku` | `str` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | | `url` | `str` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | -| `image_url` | `str` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | +| `image_url` | `str` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)(\?.*)?$` | | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | | `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | | `unit_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | diff --git a/doc/models/link-http-method.md b/doc/models/link-http-method.md index 0d9087f..4e22f23 100644 --- a/doc/models/link-http-method.md +++ b/doc/models/link-http-method.md @@ -9,14 +9,14 @@ The HTTP method required to make the related call. ## Fields -| Name | -| --- | -| `GET` | -| `POST` | -| `PUT` | -| `DELETE` | -| `HEAD` | -| `CONNECT` | -| `OPTIONS` | -| `PATCH` | +| Name | Description | +| --- | --- | +| `GET` | The HTTP GET method. | +| `POST` | The HTTP POST method. | +| `PUT` | The HTTP PUT method. | +| `DELETE` | The HTTP DELETE method. | +| `HEAD` | The HTTP HEAD method. | +| `CONNECT` | The HTTP CONNECT method. | +| `OPTIONS` | The HTTP OPTIONS method. | +| `PATCH` | The HTTP PATCH method. | diff --git a/doc/models/merchant-preferences.md b/doc/models/merchant-preferences.md new file mode 100644 index 0000000..c98536c --- /dev/null +++ b/doc/models/merchant-preferences.md @@ -0,0 +1,25 @@ + +# Merchant Preferences + +The merchant preferences for a subscription. + +## Structure + +`MerchantPreferences` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `return_url` | `str` | Optional | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | +| `cancel_url` | `str` | Optional | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | + +## Example (as JSON) + +```json +{ + "return_url": "return_url8", + "cancel_url": "cancel_url0" +} +``` + diff --git a/doc/models/mobile-return-flow.md b/doc/models/mobile-return-flow.md new file mode 100644 index 0000000..4236a9b --- /dev/null +++ b/doc/models/mobile-return-flow.md @@ -0,0 +1,16 @@ + +# Mobile Return Flow + +Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the PayPal App. + +## Enumeration + +`MobileReturnFlow` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTO` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | +| `MANUAL` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | + diff --git a/doc/models/mobile-web-context.md b/doc/models/mobile-web-context.md new file mode 100644 index 0000000..fda4e23 --- /dev/null +++ b/doc/models/mobile-web-context.md @@ -0,0 +1,25 @@ + +# Mobile Web Context + +Buyer's mobile web browser context to app switch to the PayPal consumer app. + +## Structure + +`MobileWebContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `return_flow` | [`MobileReturnFlow`](../../doc/models/mobile-return-flow.md) | Optional | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the PayPal App.

**Default**: `'AUTO'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | +| `buyer_user_agent` | `str` | Optional | User agent from the request originating from the buyer's device. This will be used to identify the buyer's operating system and browser versions. NOTE: Merchants must not alter or modify the buyer's device user agent.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `512`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "return_flow": "AUTO", + "buyer_user_agent": "buyer_user_agent8" +} +``` + diff --git a/doc/models/modify-subscription-request.md b/doc/models/modify-subscription-request.md new file mode 100644 index 0000000..97bc9b4 --- /dev/null +++ b/doc/models/modify-subscription-request.md @@ -0,0 +1,66 @@ + +# Modify Subscription Request + +The request to update the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount` and `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +## Structure + +`ModifySubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_id` | `str` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `quantity` | `str` | Optional | The quantity of the product or service in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `application_context` | [`SubscriptionPatchApplicationContext`](../../doc/models/subscription-patch-application-context.md) | Optional | The application context, which customizes the payer experience during the subscription approval process with PayPal. | +| `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id6", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "application_context": { + "brand_name": "brand_name8", + "locale": "locale2", + "shipping_preference": "SET_PROVIDED_ADDRESS", + "payment_method": { + "payee_preferred": "UNRESTRICTED" + }, + "return_url": "return_url0", + "cancel_url": "cancel_url2" + } +} +``` + diff --git a/doc/models/modify-subscription-response.md b/doc/models/modify-subscription-response.md new file mode 100644 index 0000000..fd81ea7 --- /dev/null +++ b/doc/models/modify-subscription-response.md @@ -0,0 +1,152 @@ + +# Modify Subscription Response + +The response to a request to update the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount` and `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +## Structure + +`ModifySubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_id` | `str` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `quantity` | `str` | Optional | The quantity of the product or service in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | +| `plan_overridden` | `bool` | Optional | Indicates whether the subscription has overridden any plan attributes. | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id6", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "plan": { + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } + } +} +``` + diff --git a/doc/models/native-app-context.md b/doc/models/native-app-context.md new file mode 100644 index 0000000..ebc7ad1 --- /dev/null +++ b/doc/models/native-app-context.md @@ -0,0 +1,25 @@ + +# Native App Context + +Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. + +## Structure + +`NativeAppContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `os_type` | [`OsType`](../../doc/models/os-type.md) | Optional | Operating System type of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `7`, *Pattern*: `^[A-Z_]+$` | +| `os_version` | `str` | Optional | Operating System version of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "os_type": "ANDROID", + "os_version": "os_version0" +} +``` + diff --git a/doc/models/network-transaction-reference-entity.md b/doc/models/network-transaction-reference-entity.md index 5a96780..41d51b9 100644 --- a/doc/models/network-transaction-reference-entity.md +++ b/doc/models/network-transaction-reference-entity.md @@ -22,7 +22,7 @@ Previous network transaction reference including id and network. { "id": "id6", "date": "date2", - "network": "SYNCHRONY", + "network": "CONFIDIS", "time": "time6" } ``` diff --git a/doc/models/network-transaction-reference.md b/doc/models/network-transaction.md similarity index 74% rename from doc/models/network-transaction-reference.md rename to doc/models/network-transaction.md index ca7037f..cf97852 100644 --- a/doc/models/network-transaction-reference.md +++ b/doc/models/network-transaction.md @@ -1,18 +1,18 @@ -# Network Transaction Reference +# Network Transaction Reference values used by the card network to identify a transaction. ## Structure -`NetworkTransactionReference` +`NetworkTransaction` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Required | Transaction reference id returned by the scheme. For Visa and Amex, this is the "Tran id" field in response. For MasterCard, this is the "BankNet reference id" field in response. For Discover, this is the "NRID" field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -.

**Constraints**: *Minimum Length*: `9`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9-_@.:&+=*^'~#!$%()]+$` | -| `date` | `str` | Optional | The date that the transaction was authorized by the scheme. This field may not be returned for all networks. MasterCard refers to this field as "BankNet reference date.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | +| `id` | `str` | Optional | Transaction reference id returned by the scheme. For Visa and Amex, this is the "Tran id" field in response. For MasterCard, this is the "BankNet reference id" field in response. For Discover, this is the "NRID" field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -.

**Constraints**: *Minimum Length*: `9`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9-_@.:&+=*^'~#!$%()]+$` | +| `date` | `str` | Optional | The date that the transaction was authorized by the scheme. This field may not be returned for all networks. MasterCard refers to this field as "BankNet reference date". For some specific networks, such as MasterCard and Discover, this date field is mandatory when the `previous_network_transaction_reference_id` is passed.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | | `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `acquirer_reference_number` | `str` | Optional | Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9]+$` | @@ -20,10 +20,10 @@ Reference values used by the card network to identify a transaction. ```json { - "id": "id6", - "date": "date8", - "network": "ELECTRON", - "acquirer_reference_number": "acquirer_reference_number2" + "id": "id0", + "date": "date4", + "network": "CETELEM", + "acquirer_reference_number": "acquirer_reference_number8" } ``` diff --git a/doc/models/order-application-context-shipping-preference.md b/doc/models/order-application-context-shipping-preference.md index 62f08d8..407668d 100644 --- a/doc/models/order-application-context-shipping-preference.md +++ b/doc/models/order-application-context-shipping-preference.md @@ -1,7 +1,7 @@ # Order Application Context Shipping Preference -DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object., The shipping preference. This only applies to PayPal payment source., The shipping preference. This only applies to PayPal payment source. +DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object. ## Enumeration diff --git a/doc/models/order-application-context.md b/doc/models/order-application-context.md index 825a39b..5d74c98 100644 --- a/doc/models/order-application-context.md +++ b/doc/models/order-application-context.md @@ -12,14 +12,14 @@ Customizes the payer experience during the approval process for the payment with | Name | Type | Tags | Description | | --- | --- | --- | --- | | `brand_name` | `str` | Optional | DEPRECATED. The label that overrides the business name in the PayPal account on the PayPal site. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.brand_name`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | -| `locale` | `str` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `locale` | `str` | Optional | DEPRECATED. The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.locale`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | | `landing_page` | [`OrderApplicationContextLandingPage`](../../doc/models/order-application-context-landing-page.md) | Optional | DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for customer checkout. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.landing_page`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Default**: `'NO_PREFERENCE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[0-9A-Z_]+$` | | `shipping_preference` | [`OrderApplicationContextShippingPreference`](../../doc/models/order-application-context-shipping-preference.md) | Optional | DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[0-9A-Z_]+$` | | `user_action` | [`OrderApplicationContextUserAction`](../../doc/models/order-application-context-user-action.md) | Optional | DEPRECATED. Configures a Continue or Pay Now checkout flow. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.user_action`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Default**: `'CONTINUE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | -| `payment_method` | [`PaymentMethodPreference`](../../doc/models/payment-method-preference.md) | Optional | The customer and merchant payment preferences. | +| `payment_method` | [`PaymentMethodPreference`](../../doc/models/payment-method-preference.md) | Optional | DEPRECATED. The customer and merchant payment preferences. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.payment_method_selected`). Please specify this field in the `experience_context` object instead of the `application_context` object.. | | `return_url` | `str` | Optional | DEPRECATED. The URL where the customer is redirected after the customer approves the payment. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.return_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. | | `cancel_url` | `str` | Optional | DEPRECATED. The URL where the customer is redirected after the customer cancels the payment. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.cancel_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. | -| `stored_payment_source` | [`StoredPaymentSource`](../../doc/models/stored-payment-source.md) | Optional | Provides additional details to process a payment using a `payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. | +| `stored_payment_source` | [`StoredPaymentSource`](../../doc/models/stored-payment-source.md) | Optional | DEPRECATED. Provides additional details to process a payment using a `payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. . The fields in `stored_payment_source` are now available in the `stored_credential` object under the `payment_source` which supports them (eg. `payment_source.card.stored_credential.payment_initiator`). Please specify this field in the `payment_source` object instead of the `application_context` object. | ## Example (as JSON) diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md index be11470..3834c7b 100644 --- a/doc/models/order-authorize-request-payment-source.md +++ b/doc/models/order-authorize-request-payment-source.md @@ -71,7 +71,7 @@ The payment source definition. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -94,7 +94,7 @@ The payment source definition. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md index b3f39c8..331a5ca 100644 --- a/doc/models/order-authorize-request.md +++ b/doc/models/order-authorize-request.md @@ -67,7 +67,7 @@ The authorization of an order request. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -90,7 +90,7 @@ The authorization of an order request. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-response-payment-source.md b/doc/models/order-authorize-response-payment-source.md index 05812b1..94a9e35 100644 --- a/doc/models/order-authorize-response-payment-source.md +++ b/doc/models/order-authorize-response-payment-source.md @@ -24,9 +24,9 @@ The payment source used to fund the payment. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, @@ -60,7 +60,7 @@ The payment source used to fund the payment. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md index fed938c..978d053 100644 --- a/doc/models/order-authorize-response.md +++ b/doc/models/order-authorize-response.md @@ -1,6 +1,8 @@ # Order Authorize Response +The order authorize response. + ## Structure `OrderAuthorizeResponse` @@ -14,10 +16,10 @@ | `id` | `str` | Optional | The ID of the order. | | `payment_source` | [`OrderAuthorizeResponsePaymentSource`](../../doc/models/order-authorize-response-payment-source.md) | Optional | The payment source used to fund the payment. | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | +| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | The customer who approves and pays for the order. The customer is also known as the payer. | | `purchase_units` | [`List[PurchaseUnit]`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links) that are either relevant to the issue by providing additional information or offering potential resolutions.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `4` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | ## Example (as JSON) @@ -30,9 +32,9 @@ "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, @@ -66,7 +68,7 @@ "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-billing-plan.md b/doc/models/order-billing-plan.md index 2fa3c2e..cfab070 100644 --- a/doc/models/order-billing-plan.md +++ b/doc/models/order-billing-plan.md @@ -35,10 +35,6 @@ Metadata for merchant-managed recurring billing plans. Valid only during the sav "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date6" } ], diff --git a/doc/models/order-capture-request-payment-source.md b/doc/models/order-capture-request-payment-source.md index d07fbf8..4fde855 100644 --- a/doc/models/order-capture-request-payment-source.md +++ b/doc/models/order-capture-request-payment-source.md @@ -71,7 +71,7 @@ The payment source definition. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -94,7 +94,7 @@ The payment source definition. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-capture-request.md b/doc/models/order-capture-request.md index 9fedad1..0c73415 100644 --- a/doc/models/order-capture-request.md +++ b/doc/models/order-capture-request.md @@ -67,7 +67,7 @@ Completes an capture payment for an order. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -90,7 +90,7 @@ Completes an capture payment for an order. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-confirm-application-context.md b/doc/models/order-confirm-application-context.md index f1c12b0..ea64a9c 100644 --- a/doc/models/order-confirm-application-context.md +++ b/doc/models/order-confirm-application-context.md @@ -32,7 +32,7 @@ Customizes the payer confirmation experience. "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/order-request.md b/doc/models/order-request.md index 5e3a1c3..4098b36 100644 --- a/doc/models/order-request.md +++ b/doc/models/order-request.md @@ -12,7 +12,7 @@ The order request details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Required | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | +| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be used with the `payment_source.paypal` object. In order to make this design more clear, the details in the `payer` object are now available under `payment_source.paypal`. Please use `payment_source.paypal`. | | `purchase_units` | [`List[PurchaseUnitRequest]`](../../doc/models/purchase-unit-request.md) | Required | An array of purchase units. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or partial order that the payer intends to purchase from the payee.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `payment_source` | [`PaymentSource`](../../doc/models/payment-source.md) | Optional | The payment source definition. | | `application_context` | [`OrderApplicationContext`](../../doc/models/order-application-context.md) | Optional | Customizes the payer experience during the approval process for the payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values. | diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md index 202aa2f..1ee4814 100644 --- a/doc/models/order-tracker-request.md +++ b/doc/models/order-tracker-request.md @@ -25,7 +25,7 @@ The tracking details of an order. "capture_id": "capture_id0", "notify_payer": false, "tracking_number": "tracking_number6", - "carrier": "LEADER", + "carrier": "ZELERIS", "carrier_name_other": "carrier_name_other0", "items": [ { diff --git a/doc/models/order-update-callback-error-response-details.md b/doc/models/order-update-callback-error-response-details.md deleted file mode 100644 index aacdf30..0000000 --- a/doc/models/order-update-callback-error-response-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Update Callback Error Response Details - -The error details. Required for client-side `4XX` errors. - -## Structure - -`OrderUpdateCallbackErrorResponseDetails` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `field` | `str` | Optional | The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -| `value` | `str` | Optional | The value of the field that caused the error.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `1024`, *Pattern*: `^.*$` | -| `issue` | `str` | Required | The unique, fine-grained application-level error code.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `256`, *Pattern*: `^.*$` | - -## Example (as JSON) - -```json -{ - "field": "field8", - "value": "value6", - "issue": "issue0" -} -``` - diff --git a/doc/models/order-update-callback-error-response.md b/doc/models/order-update-callback-error-response.md deleted file mode 100644 index 30c2197..0000000 --- a/doc/models/order-update-callback-error-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Order Update Callback Error Response - -The error details. - -## Structure - -`OrderUpdateCallbackErrorResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `str` | Required | The human-readable, unique name of the error.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -| `message` | `str` | Optional | The message that describes the error.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^.*$` | -| `details` | [`List[OrderUpdateCallbackErrorResponseDetails]`](../../doc/models/order-update-callback-error-response-details.md) | Optional | An array of additional details about the error.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `100` | - -## Example (as JSON) - -```json -{ - "name": "name2", - "message": "message8", - "details": [ - { - "field": "field4", - "value": "value2", - "issue": "issue6" - }, - { - "field": "field4", - "value": "value2", - "issue": "issue6" - } - ] -} -``` - diff --git a/doc/models/order-update-callback-request.md b/doc/models/order-update-callback-request.md deleted file mode 100644 index 24b1fb9..0000000 --- a/doc/models/order-update-callback-request.md +++ /dev/null @@ -1,115 +0,0 @@ - -# Order Update Callback Request - -Shipping Options Callback request. This will be implemented by the merchants. - -## Structure - -`OrderUpdateCallbackRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `str` | Optional | The ID of the order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9-]+$` | -| `shipping_address` | [`OrderUpdateCallbackShippingAddress`](../../doc/models/order-update-callback-shipping-address.md) | Required | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -| `shipping_option` | [`OrderUpdateCallbackShippingOption`](../../doc/models/order-update-callback-shipping-option.md) | Optional | The options that the payee or merchant offers to the payer to ship or pick up their items. | -| `purchase_units` | [`List[PurchaseUnitRequest]`](../../doc/models/purchase-unit-request.md) | Required | An array of purchase units. At present only 1 purchase_unit is supported. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or partial order that the payer intends to purchase from the payee.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `1` | - -## Example (as JSON) - -```json -{ - "shipping_address": { - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "purchase_units": [ - { - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "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" - } - } - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "payment_instruction": { - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } - ], - "disbursement_mode": "INSTANT", - "payee_pricing_tier_id": "payee_pricing_tier_id2", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - }, - "description": "description6", - "custom_id": "custom_id4" - } - ], - "id": "id2", - "shipping_option": { - "id": "id4", - "label": "label4", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } -} -``` - diff --git a/doc/models/order-update-callback-response.md b/doc/models/order-update-callback-response.md deleted file mode 100644 index 8422bba..0000000 --- a/doc/models/order-update-callback-response.md +++ /dev/null @@ -1,83 +0,0 @@ - -# Order Update Callback Response - -Returns the updated shipping options for an order. - -## Structure - -`OrderUpdateCallbackResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `str` | Optional | The ID of the order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9-]+$` | -| `purchase_units` | [`ShippingOptionsPurchaseUnit`](../../doc/models/shipping-options-purchase-unit.md) | Optional | This would contain shipping option and amount data at purchase unit level. | - -## Example (as JSON) - -```json -{ - "id": "id2", - "purchase_units": { - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "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" - } - } - }, - "items": [ - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - } - ], - "shipping_options": [ - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] - } -} -``` - diff --git a/doc/models/order-update-callback-shipping-address.md b/doc/models/order-update-callback-shipping-address.md deleted file mode 100644 index 05d007a..0000000 --- a/doc/models/order-update-callback-shipping-address.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Order Update Callback Shipping Address - -The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). - -## Structure - -`OrderUpdateCallbackShippingAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `admin_area_2` | `str` | Optional | A city, town, or village. Smaller than `admin_area_level_1`.

**Constraints**: *Maximum Length*: `120` | -| `admin_area_1` | `str` | Optional | The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`. Value, by country, is: UK. A county. US. A state. Canada. A province. Japan. A prefecture. Switzerland. A *kanton*.

**Constraints**: *Maximum Length*: `300` | -| `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).

**Constraints**: *Maximum Length*: `60` | -| `country_code` | `str` | Required | The [2-character ISO 3166-1 code](/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.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | - -## Example (as JSON) - -```json -{ - "admin_area_2": "admin_area_26", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" -} -``` - diff --git a/doc/models/order-update-callback-shipping-option.md b/doc/models/order-update-callback-shipping-option.md deleted file mode 100644 index 5a75fdb..0000000 --- a/doc/models/order-update-callback-shipping-option.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Order Update Callback Shipping Option - -The options that the payee or merchant offers to the payer to ship or pick up their items. - -## Structure - -`OrderUpdateCallbackShippingOption` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `str` | Required | A unique ID that identifies a payer-selected shipping option.

**Constraints**: *Maximum Length*: `127` | -| `label` | `str` | Required | A description that the payer sees, which helps them choose an appropriate shipping option. For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or `USPS yōuxiān fā huò`. Localize this description to the payer's locale.

**Constraints**: *Maximum Length*: `127` | -| `mtype` | [`ShippingType`](../../doc/models/shipping-type.md) | Optional | A classification for the method of purchase fulfillment. | -| `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | - -## Example (as JSON) - -```json -{ - "id": "id8", - "label": "label8", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} -``` - diff --git a/doc/models/order.md b/doc/models/order.md index fe72ebd..a5f6741 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -16,7 +16,7 @@ The order details. | `id` | `str` | Optional | The ID of the order. | | `payment_source` | [`PaymentSourceResponse`](../../doc/models/payment-source-response.md) | Optional | The payment source used to fund the payment. | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | +| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be used with the `payment_source.paypal` object. In order to make this design more clear, the details in the `payer` object are now available under `payment_source.paypal`. Please use `payment_source.paypal`. | | `purchase_units` | [`List[PurchaseUnit]`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | @@ -32,9 +32,9 @@ The order details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, diff --git a/doc/models/orders-capture.md b/doc/models/orders-capture.md index 7bc6064..45f69fc 100644 --- a/doc/models/orders-capture.md +++ b/doc/models/orders-capture.md @@ -17,7 +17,7 @@ A captured payment. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `final_capture` | `bool` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `False` | | `seller_receivable_breakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | diff --git a/doc/models/os-type.md b/doc/models/os-type.md new file mode 100644 index 0000000..75d9fb7 --- /dev/null +++ b/doc/models/os-type.md @@ -0,0 +1,17 @@ + +# Os Type + +Operating System type of the device that the buyer is using. + +## Enumeration + +`OsType` + +## Fields + +| Name | Description | +| --- | --- | +| `ANDROID` | Google Android OS. | +| `IOS` | Apple OS typically found in Apple mobile devices. | +| `OTHER` | Any other OS type. | + diff --git a/doc/models/payer-information.md b/doc/models/payer-information.md new file mode 100644 index 0000000..2612ee3 --- /dev/null +++ b/doc/models/payer-information.md @@ -0,0 +1,38 @@ + +# Payer Information + +The payer information. + +## Structure + +`PayerInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `account_id` | `str` | Optional | The PayPal` customer account ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: `^.+@[^"\-].+$` | +| `phone_number` | [`Phone`](../../doc/models/phone.md) | Optional | The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | +| `address_status` | `str` | Optional | The address status of the payer. Value is either: Y. Verified. N. Not verified.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[N\|Y]$` | +| `payer_status` | `str` | Optional | The status of the payer. Value is `Y` or `N`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[N\|Y]$` | +| `payer_name` | [`PayerName`](../../doc/models/payer-name.md) | Optional | The name of the party. | +| `country_code` | `str` | Optional | The [two-character ISO 3166-1 code](/docs/integration/direct/rest/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.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | +| `address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | + +## Example (as JSON) + +```json +{ + "account_id": "account_id6", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status8" +} +``` + diff --git a/doc/models/payer-name.md b/doc/models/payer-name.md new file mode 100644 index 0000000..bfeb5ce --- /dev/null +++ b/doc/models/payer-name.md @@ -0,0 +1,33 @@ + +# Payer Name + +The name of the party. + +## Structure + +`PayerName` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefix` | `str` | Optional | The prefix, or title, to the party's name.

**Constraints**: *Maximum Length*: `140` | +| `given_name` | `str` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | +| `surname` | `str` | Optional | When the party is a person, the party's surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother's, surname.

**Constraints**: *Maximum Length*: `140` | +| `middle_name` | `str` | Optional | When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.

**Constraints**: *Maximum Length*: `140` | +| `suffix` | `str` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | +| `alternate_full_name` | `str` | Optional | DEPRECATED. The party's alternate name. Can be a business name, nickname, or any other name that cannot be split into first, last name. Required when the party is a business.

**Constraints**: *Maximum Length*: `300` | +| `full_name` | `str` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | + +## Example (as JSON) + +```json +{ + "prefix": "prefix4", + "given_name": "given_name8", + "surname": "surname8", + "middle_name": "middle_name6", + "suffix": "suffix6" +} +``` + diff --git a/doc/models/payer.md b/doc/models/payer.md index cb43ed4..6ed31b9 100644 --- a/doc/models/payer.md +++ b/doc/models/payer.md @@ -1,6 +1,8 @@ # Payer +The customer who approves and pays for the order. The customer is also known as the payer. + ## Structure `Payer` diff --git a/doc/models/payment-authorization.md b/doc/models/payment-authorization.md index c26f60f..659c801 100644 --- a/doc/models/payment-authorization.md +++ b/doc/models/payment-authorization.md @@ -17,7 +17,7 @@ The authorized payment transaction. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `expiration_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.

**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})$` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | diff --git a/doc/models/payment-method.md b/doc/models/payment-method.md new file mode 100644 index 0000000..d7a066b --- /dev/null +++ b/doc/models/payment-method.md @@ -0,0 +1,23 @@ + +# Payment Method + +The customer and merchant payment preferences. + +## Structure + +`PaymentMethod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payee_preferred` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `'UNRESTRICTED'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | + +## Example (as JSON) + +```json +{ + "payee_preferred": "UNRESTRICTED" +} +``` + diff --git a/doc/models/payment-preferences-override.md b/doc/models/payment-preferences-override.md new file mode 100644 index 0000000..fb1acd0 --- /dev/null +++ b/doc/models/payment-preferences-override.md @@ -0,0 +1,32 @@ + +# Payment Preferences Override + +The payment preferences to override at subscription level. + +## Structure + +`PaymentPreferencesOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `auto_bill_outstanding` | `bool` | Optional | Indicates whether to automatically bill the outstanding amount in the next billing cycle. | +| `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `setup_fee_failure_action` | [`SetupFeeFailureAction`](../../doc/models/setup-fee-failure-action.md) | Optional | The action to take on the subscription if the initial payment for the setup fails.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_failure_threshold` | `int` | Optional | The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 80 +} +``` + diff --git a/doc/models/payment-preferences.md b/doc/models/payment-preferences.md new file mode 100644 index 0000000..87cef32 --- /dev/null +++ b/doc/models/payment-preferences.md @@ -0,0 +1,32 @@ + +# Payment Preferences + +The payment preferences for a subscription. + +## Structure + +`PaymentPreferences` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `auto_bill_outstanding` | `bool` | Optional | Indicates whether to automatically bill the outstanding amount in the next billing cycle.

**Default**: `True` | +| `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `setup_fee_failure_action` | [`SetupFeeFailureAction`](../../doc/models/setup-fee-failure-action.md) | Optional | The action to take on the subscription if the initial payment for the setup fails.

**Default**: `'CANCEL'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_failure_threshold` | `int` | Optional | The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.

**Default**: `0`

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "auto_bill_outstanding": true, + "setup_fee_failure_action": "CANCEL", + "payment_failure_threshold": 0, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + } +} +``` + diff --git a/doc/models/payment-source-response.md b/doc/models/payment-source-response.md index 0dfa97c..e413435 100644 --- a/doc/models/payment-source-response.md +++ b/doc/models/payment-source-response.md @@ -33,9 +33,9 @@ The payment source used to fund the payment. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, diff --git a/doc/models/payment-token-request-card.md b/doc/models/payment-token-request-card.md index e00b336..66015ce 100644 --- a/doc/models/payment-token-request-card.md +++ b/doc/models/payment-token-request-card.md @@ -26,7 +26,7 @@ A Resource representing a request to vault a Card. "number": "number8", "expiry": "expiry2", "security_code": "security_code6", - "brand": "EFTPOS" + "brand": "HIPER" } ``` diff --git a/doc/models/payment-token-request-payment-source.md b/doc/models/payment-token-request-payment-source.md index 1e007b5..b7d8b30 100644 --- a/doc/models/payment-token-request-payment-source.md +++ b/doc/models/payment-token-request-payment-source.md @@ -23,7 +23,7 @@ The payment method to vault with the instrument details. "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "token": { "id": "id6", diff --git a/doc/models/payment-token-request.md b/doc/models/payment-token-request.md index 4b90441..6354de7 100644 --- a/doc/models/payment-token-request.md +++ b/doc/models/payment-token-request.md @@ -28,7 +28,7 @@ Payment Token Request where the `source` defines the type of instrument to be st "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "token": { "id": "id6", diff --git a/doc/models/payment-token-response-payment-source.md b/doc/models/payment-token-response-payment-source.md index 0842cc8..c6d9d42 100644 --- a/doc/models/payment-token-response-payment-source.md +++ b/doc/models/payment-token-response-payment-source.md @@ -12,8 +12,8 @@ The vaulted payment method details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `card` | [`CardPaymentTokenEntity`](../../doc/models/card-payment-token-entity.md) | Optional | Full representation of a Card Payment Token including network token. | -| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | - | -| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | - | +| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | Full representation of a PayPal Payment Token. | +| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | Full representation of a Venmo Payment Token. | | `apple_pay` | [`ApplePayPaymentToken`](../../doc/models/apple-pay-payment-token.md) | Optional | A resource representing a response for Apple Pay. | ## Example (as JSON) @@ -23,7 +23,7 @@ The vaulted payment method details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -41,6 +41,7 @@ The vaulted payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -65,6 +66,7 @@ The vaulted payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -87,7 +89,7 @@ The vaulted payment method details. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/payment-token-response.md b/doc/models/payment-token-response.md index 5c5d207..cc7a19a 100644 --- a/doc/models/payment-token-response.md +++ b/doc/models/payment-token-response.md @@ -11,7 +11,7 @@ Full representation of a saved payment token. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Optional | The PayPal-generated ID for the vault token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `str` | Optional | The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's server so the saved payment source can be used for future transactions.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `customer` | [`CustomerResponse`](../../doc/models/customer-response.md) | Optional | Customer in merchant's or partner's system of records. | | `payment_source` | [`PaymentTokenResponsePaymentSource`](../../doc/models/payment-token-response-payment-source.md) | Optional | The vaulted payment method details. | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | @@ -29,7 +29,7 @@ Full representation of a saved payment token. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -47,6 +47,7 @@ Full representation of a saved payment token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -71,6 +72,7 @@ Full representation of a saved payment token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -93,7 +95,7 @@ Full representation of a saved payment token. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/payment-token-status.md b/doc/models/payment-token-status.md index d9faa19..6b70b87 100644 --- a/doc/models/payment-token-status.md +++ b/doc/models/payment-token-status.md @@ -12,7 +12,7 @@ The status of the payment token. | Name | Description | | --- | --- | | `CREATED` | A setup token is initialized with minimal information, more data must be added to the setup-token to be vaulted | -| `PAYER_ACTION_REQUIRED` | A contingecy on payer approval is required before the payment method can be saved. | +| `PAYER_ACTION_REQUIRED` | A contingency on payer approval is required before the payment method can be saved. | | `APPROVED` | Setup token is ready to be vaulted. If a buyer approval contigency was returned, it is has been approved. | | `VAULTED` | The payment token has been vaulted. | | `TOKENIZED` | A vaulted payment method token has been tokenized for short term (one time) use. | diff --git a/doc/models/payments-capture.md b/doc/models/payments-capture.md index 33784bb..a7ba203 100644 --- a/doc/models/payments-capture.md +++ b/doc/models/payments-capture.md @@ -17,13 +17,13 @@ A captured payment. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `final_capture` | `bool` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `False` | | `seller_receivable_breakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `'INSTANT'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -| `processor_response` | [`PaymentsProcessorResponse`](../../doc/models/payments-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | +| `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `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.

**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.

**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})$` | diff --git a/doc/models/payments-payment-advice-code.md b/doc/models/payments-payment-advice-code.md deleted file mode 100644 index 6e6cc50..0000000 --- a/doc/models/payments-payment-advice-code.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Payments Payment Advice Code - -The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. - -## Enumeration - -`PaymentsPaymentAdviceCode` - -## Fields - -| Name | Description | -| --- | --- | -| `PAYMENTADVICE_01` | For Mastercard, expired card account upgrade or portfolio sale conversion. Obtain new account information before next billing cycle. | -| `PAYMENTADVICE_02` | For Mastercard, over credit limit or insufficient funds. Retry the transaction 72 hours later. For Visa, the card holder wants to stop only one specific payment in the recurring payment relationship. The merchant must NOT resubmit the same transaction. The merchant can continue the billing process in the subsequent billing period. | -| `PAYMENTADVICE_03` | For Mastercard, account closed as fraudulent. Obtain another type of payment from customer due to account being closed or fraud. Possible reason: Account closed as fraudulent. For Visa, the card holder wants to stop all recurring payment transactions for a specific merchant. Stop recurring payment requests. | -| `PAYMENTADVICE_21` | For Mastercard, the card holder has been unsuccessful at canceling recurring payment through merchant. Stop recurring payment requests. For Visa, all recurring payments were canceled for the card number requested. Stop recurring payment requests. | - diff --git a/doc/models/payments-processor-response.md b/doc/models/payments-processor-response.md deleted file mode 100644 index dc83297..0000000 --- a/doc/models/payments-processor-response.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Payments Processor Response - -The processor response information for payment requests, such as direct credit card transactions. - -## Structure - -`PaymentsProcessorResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `avs_code` | [`AvsCode`](../../doc/models/avs-code.md) | Optional | The address verification code for Visa, Discover, Mastercard, or American Express transactions. | -| `cvv_code` | [`CvvCode`](../../doc/models/cvv-code.md) | Optional | The card verification value code for for Visa, Discover, Mastercard, or American Express. | -| `response_code` | [`ProcessorResponseCode`](../../doc/models/processor-response-code.md) | Optional | Processor response code for the non-PayPal payment processor errors. | -| `payment_advice_code` | [`PaymentsPaymentAdviceCode`](../../doc/models/payments-payment-advice-code.md) | Optional | The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. | - -## Example (as JSON) - -```json -{ - "avs_code": "A", - "cvv_code": "E", - "response_code": "5150", - "payment_advice_code": "01" -} -``` - diff --git a/doc/models/paypal-experience-landing-page.md b/doc/models/paypal-experience-landing-page.md index b0e40f7..1936c28 100644 --- a/doc/models/paypal-experience-landing-page.md +++ b/doc/models/paypal-experience-landing-page.md @@ -14,4 +14,5 @@ The type of landing page to show on the PayPal site for customer checkout. | `LOGIN` | When the customer clicks PayPal Checkout, the customer is redirected to a page to log in to PayPal and approve the payment. | | `GUEST_CHECKOUT` | When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. This option has previously been also called as 'BILLING' | | `NO_PREFERENCE` | When the customer clicks PayPal Checkout, the customer is redirected to either a page to log in to PayPal and approve the payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase, depending on their previous interaction with PayPal. | +| `BILLING` | DEPRECATED - please use GUEST_CHECKOUT. All implementations of 'BILLING' will be routed to 'GUEST_CHECKOUT'. When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. | diff --git a/doc/models/paypal-payment-token.md b/doc/models/paypal-payment-token.md index 633e199..3796819 100644 --- a/doc/models/paypal-payment-token.md +++ b/doc/models/paypal-payment-token.md @@ -1,6 +1,8 @@ # Paypal Payment Token +Full representation of a PayPal Payment Token. + ## Structure `PaypalPaymentToken` @@ -15,7 +17,7 @@ | `permit_multiple_payment_tokens` | `bool` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `False` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `email_address` | `str` | Optional | The internationalized email address.
Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.


**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `payer_id` | `str` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | @@ -34,6 +36,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/paypal-reference-id-type.md b/doc/models/paypal-reference-id-type.md new file mode 100644 index 0000000..dacdea4 --- /dev/null +++ b/doc/models/paypal-reference-id-type.md @@ -0,0 +1,18 @@ + +# Paypal Reference Id Type + +The PayPal reference ID type. + +## Enumeration + +`PaypalReferenceIdType` + +## Fields + +| Name | Description | +| --- | --- | +| `ODR` | An order ID. | +| `TXN` | A transaction ID. | +| `SUB` | A subscription ID. | +| `PAP` | A pre-approved payment ID. | + diff --git a/doc/models/paypal-wallet-attributes.md b/doc/models/paypal-wallet-attributes.md index b9270f5..9542d29 100644 --- a/doc/models/paypal-wallet-attributes.md +++ b/doc/models/paypal-wallet-attributes.md @@ -12,7 +12,7 @@ Additional attributes associated with the use of this PayPal Wallet. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `customer` | [`PaypalWalletCustomerRequest`](../../doc/models/paypal-wallet-customer-request.md) | Optional | - | -| `vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | - | +| `vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | Resource consolidating common request and response attributes for vaulting PayPal Wallet. | ## Example (as JSON) @@ -34,7 +34,6 @@ Additional attributes associated with the use of this PayPal Wallet. "merchant_customer_id": "merchant_customer_id2" }, "vault": { - "store_in_vault": "ON_SUCCESS", "description": "description6", "usage_pattern": "THRESHOLD_PREPAID", "usage_type": "MERCHANT", diff --git a/doc/models/paypal-wallet-experience-context.md b/doc/models/paypal-wallet-experience-context.md index b242095..e7d2697 100644 --- a/doc/models/paypal-wallet-experience-context.md +++ b/doc/models/paypal-wallet-experience-context.md @@ -17,6 +17,7 @@ Customizes the payer experience during the approval process for payment with Pay | `contact_preference` | [`PaypalWalletContactPreference`](../../doc/models/paypal-wallet-contact-preference.md) | Optional | The preference to display the contact information (buyer’s shipping email & phone number) on PayPal's checkout for easy merchant-buyer communication.

**Default**: `'NO_CONTACT_INFO'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `return_url` | `str` | Optional | Describes the URL. | | `cancel_url` | `str` | Optional | Describes the URL. | +| `app_switch_context` | [`AppSwitchContext`](../../doc/models/app-switch-context.md) | Optional | Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. | | `landing_page` | [`PaypalExperienceLandingPage`](../../doc/models/paypal-experience-landing-page.md) | Optional | The type of landing page to show on the PayPal site for customer checkout.

**Default**: `'NO_PREFERENCE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[0-9A-Z_]+$` | | `user_action` | [`PaypalExperienceUserAction`](../../doc/models/paypal-experience-user-action.md) | Optional | Configures a Continue or Pay Now checkout flow.

**Default**: `'CONTINUE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_method_preference` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `'UNRESTRICTED'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | diff --git a/doc/models/paypal-wallet-response.md b/doc/models/paypal-wallet-response.md index e1704ea..093f17a 100644 --- a/doc/models/paypal-wallet-response.md +++ b/doc/models/paypal-wallet-response.md @@ -23,6 +23,7 @@ The PayPal Wallet response. | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `attributes` | [`PaypalWalletAttributesResponse`](../../doc/models/paypal-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a PayPal Wallet. | | `stored_credential` | [`PaypalWalletStoredCredential`](../../doc/models/paypal-wallet-stored-credential.md) | Optional | Provides additional details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored. | +| `experience_status` | [`ExperienceStatus`](../../doc/models/experience-status.md) | Optional | This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | ## Example (as JSON) diff --git a/doc/models/paypal-wallet-stored-credential.md b/doc/models/paypal-wallet-stored-credential.md index a986e62..f94f1f9 100644 --- a/doc/models/paypal-wallet-stored-credential.md +++ b/doc/models/paypal-wallet-stored-credential.md @@ -12,7 +12,7 @@ Provides additional details to process a payment using the PayPal wallet billing | Name | Type | Tags | Description | | --- | --- | --- | --- | | `payment_initiator` | [`PaymentInitiator`](../../doc/models/payment-initiator.md) | Required | The person or party who initiated or triggered the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `charge_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | +| `charge_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | DEPRECATED. Expected business/pricing model for the billing agreement, Please use usage_pattern instead.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | | `usage_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `'DERIVED'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | diff --git a/doc/models/paypal-wallet-vault-instruction.md b/doc/models/paypal-wallet-vault-instruction.md index 9008d12..b268b37 100644 --- a/doc/models/paypal-wallet-vault-instruction.md +++ b/doc/models/paypal-wallet-vault-instruction.md @@ -1,6 +1,8 @@ # Paypal Wallet Vault Instruction +Resource consolidating common request and response attributes for vaulting PayPal Wallet. + ## Structure `PaypalWalletVaultInstruction` @@ -9,7 +11,6 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `store_in_vault` | [`StoreInVaultInstruction`](../../doc/models/store-in-vault-instruction.md) | Optional | Defines how and when the payment source gets vaulted.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `description` | `str` | Optional | The description displayed to PayPal consumer on the approval flow for PayPal, as well as on the PayPal payment token management experience on PayPal.com.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | | `usage_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Required | The usage type associated with the PayPal payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | @@ -23,7 +24,6 @@ "usage_type": "MERCHANT", "customer_type": "CONSUMER", "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", "description": "description4", "usage_pattern": "UNSCHEDULED_PREPAID" } diff --git a/doc/models/phone-number-with-country-code.md b/doc/models/phone-number-with-country-code.md index 968e88d..370cb6c 100644 --- a/doc/models/phone-number-with-country-code.md +++ b/doc/models/phone-number-with-country-code.md @@ -1,7 +1,7 @@ # Phone Number With Country Code -The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). ## Structure diff --git a/doc/models/phone-number-with-optional-country-code.md b/doc/models/phone-number-with-optional-country-code.md new file mode 100644 index 0000000..abded6a --- /dev/null +++ b/doc/models/phone-number-with-optional-country-code.md @@ -0,0 +1,25 @@ + +# Phone Number With Optional Country Code + +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). + +## Structure + +`PhoneNumberWithOptionalCountryCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `country_code` | `str` | Optional | The country calling code (CC), in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the CC and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `3`, *Pattern*: `^[0-9]{1,3}?$` | +| `national_number` | `str` | Required | The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[0-9]{1,14}?$` | + +## Example (as JSON) + +```json +{ + "country_code": "country_code6", + "national_number": "national_number0" +} +``` + diff --git a/doc/models/phone-number.md b/doc/models/phone-number.md index e9dd88b..1215e7b 100644 --- a/doc/models/phone-number.md +++ b/doc/models/phone-number.md @@ -1,7 +1,7 @@ # Phone Number -The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). ## Structure diff --git a/doc/models/phone-type.md b/doc/models/phone-type.md index 99bb423..a289eb6 100644 --- a/doc/models/phone-type.md +++ b/doc/models/phone-type.md @@ -9,11 +9,11 @@ The phone type. ## Fields -| Name | -| --- | -| `FAX` | -| `HOME` | -| `MOBILE` | -| `OTHER` | -| `PAGER` | +| Name | Description | +| --- | --- | +| `FAX` | Fax number. | +| `HOME` | Home phone number. | +| `MOBILE` | Mobile phone number. | +| `OTHER` | Other phone number. | +| `PAGER` | Pager number. | diff --git a/doc/models/plan-collection.md b/doc/models/plan-collection.md new file mode 100644 index 0000000..6707dcd --- /dev/null +++ b/doc/models/plan-collection.md @@ -0,0 +1,53 @@ + +# Plan Collection + +The list of plans with details. + +## Structure + +`PlanCollection` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plans` | [`List[BillingPlan]`](../../doc/models/billing-plan.md) | Optional | An array of plans.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | +| `total_items` | `int` | Optional | The total number of items.

**Constraints**: `>= 0`, `<= 500000000` | +| `total_pages` | `int` | Optional | The total number of pages.

**Constraints**: `>= 0`, `<= 100000000` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "plans": [ + { + "id": "id4", + "product_id": "product_id0", + "name": "name4", + "status": "INACTIVE", + "description": "description4" + } + ], + "total_items": 158, + "total_pages": 194, + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/plan-details.md b/doc/models/plan-details.md new file mode 100644 index 0000000..34f1612 --- /dev/null +++ b/doc/models/plan-details.md @@ -0,0 +1,176 @@ + +# Plan Details + +The plan details. + +## Structure + +`PlanDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `product_id` | `str` | Optional | The ID for the product.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | +| `name` | `str` | Optional | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `description` | `str` | Optional | The detailed description of the plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `billing_cycles` | [`List[SubscriptionBillingCycle]`](../../doc/models/subscription-billing-cycle.md) | Optional | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Optional | The payment preferences for a subscription. | +| `merchant_preferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | +| `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | +| `quantity_supported` | `bool` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `False` | + +## Example (as JSON) + +```json +{ + "quantity_supported": false, + "product_id": "product_id6", + "name": "name8", + "description": "description2", + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "frequency": { + "interval_unit": "DAY", + "interval_count": 94 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "frequency": { + "interval_unit": "DAY", + "interval_count": 94 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "frequency": { + "interval_unit": "DAY", + "interval_count": 94 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + } +} +``` + diff --git a/doc/models/plan-override.md b/doc/models/plan-override.md new file mode 100644 index 0000000..dc5d01a --- /dev/null +++ b/doc/models/plan-override.md @@ -0,0 +1,156 @@ + +# Plan Override + +An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. + +## Structure + +`PlanOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `billing_cycles` | [`List[BillingCycleOverride]`](../../doc/models/billing-cycle-override.md) | Optional | An array of billing cycles for trial billing and regular billing. The subscription billing cycle definition has to adhere to the plan billing cycle definition.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferencesOverride`](../../doc/models/payment-preferences-override.md) | Optional | The payment preferences to override at subscription level. | +| `taxes` | [`TaxesOverride`](../../doc/models/taxes-override.md) | Optional | The tax details. | + +## Example (as JSON) + +```json +{ + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } +} +``` + diff --git a/doc/models/plan-request-status.md b/doc/models/plan-request-status.md new file mode 100644 index 0000000..ec9a2a0 --- /dev/null +++ b/doc/models/plan-request-status.md @@ -0,0 +1,17 @@ + +# Plan Request Status + +The initial state of the plan. Allowed input values are CREATED and ACTIVE. + +## Enumeration + +`PlanRequestStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `CREATED` | The plan was created. You cannot create subscriptions for a plan in this state. | +| `INACTIVE` | The plan is inactive. | +| `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | + diff --git a/doc/models/plan-request.md b/doc/models/plan-request.md new file mode 100644 index 0000000..ed57a5b --- /dev/null +++ b/doc/models/plan-request.md @@ -0,0 +1,98 @@ + +# Plan Request + +The create plan request details. + +## Structure + +`PlanRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `product_id` | `str` | Required | The ID of the product created through Catalog Products API.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | +| `name` | `str` | Required | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `status` | [`PlanRequestStatus`](../../doc/models/plan-request-status.md) | Optional | The initial state of the plan. Allowed input values are CREATED and ACTIVE.

**Default**: `'ACTIVE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `description` | `str` | Optional | The detailed description of the plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `billing_cycles` | [`List[SubscriptionBillingCycle]`](../../doc/models/subscription-billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Required | The payment preferences for a subscription. | +| `merchant_preferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | +| `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | +| `quantity_supported` | `bool` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `False` | + +## Example (as JSON) + +```json +{ + "product_id": "product_id2", + "name": "name2", + "status": "ACTIVE", + "billing_cycles": [ + { + "frequency": { + "interval_unit": "DAY", + "interval_count": 1 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 1, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } + } + ], + "payment_preferences": { + "auto_bill_outstanding": true, + "setup_fee_failure_action": "CANCEL", + "payment_failure_threshold": 0, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + } + }, + "quantity_supported": false, + "description": "description8", + "merchant_preferences": { + "return_url": "return_url4", + "cancel_url": "cancel_url6" + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } +} +``` + diff --git a/doc/models/plan.md b/doc/models/plan.md index 597685b..2ab62d1 100644 --- a/doc/models/plan.md +++ b/doc/models/plan.md @@ -12,7 +12,6 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `billing_cycles` | [`List[BillingCycle]`](../../doc/models/billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `3` | -| `product` | `Any` | Optional | Product details associated with any one-time product purchase. | | `one_time_charges` | [`OneTimeCharge`](../../doc/models/one-time-charge.md) | Required | The one-time charge info at the time of checkout. | | `name` | `str` | Optional | Name of the recurring plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[A-Za-z0-9() +',.:-]+$` | @@ -36,10 +35,6 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date6" } ], @@ -69,10 +64,6 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. "value": "value8" } }, - "product": { - "key1": "val1", - "key2": "val2" - }, "name": "name8" } ``` diff --git a/doc/models/pricing-tier.md b/doc/models/pricing-tier.md new file mode 100644 index 0000000..a3d9e5c --- /dev/null +++ b/doc/models/pricing-tier.md @@ -0,0 +1,30 @@ + +# Pricing Tier + +The pricing tier details. + +## Structure + +`PricingTier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `starting_quantity` | `str` | Required | The starting quantity for the tier.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `ending_quantity` | `str` | Optional | The ending quantity for the tier. Optional for the last tier.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "starting_quantity": "starting_quantity4", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } +} +``` + diff --git a/doc/models/purchase-unit-request.md b/doc/models/purchase-unit-request.md index e2b431b..7fa83e1 100644 --- a/doc/models/purchase-unit-request.md +++ b/doc/models/purchase-unit-request.md @@ -15,11 +15,11 @@ The purchase unit request. Includes required information for the payment contrac | `amount` | [`AmountWithBreakdown`](../../doc/models/amount-with-breakdown.md) | Required | The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` plus `handling` plus `insurance` minus `shipping_discount` minus discount. The amount must be a positive number. For listed of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | | `payment_instruction` | [`PaymentInstruction`](../../doc/models/payment-instruction.md) | Optional | Any additional payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. | -| `description` | `str` | Optional | The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of character; (e.g. accented character, Japanese characters) the number of characters that that can be specified as input might not equal the permissible max length.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | +| `description` | `str` | Optional | This field supports up to 3,000 characters, but any content beyond 127 characters (including spaces) will be truncated. The 127 character limit is reflected in the response representation of this field. The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of character; (e.g. accented character, Japanese characters) the number of characters that that can be specified as input might not equal the permissible max length.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `3000` | | `custom_id` | `str` | Optional | The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | -| `soft_descriptor` | `str` | Optional | The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement. If an Order is paid using the "PayPal Wallet", the statement descriptor will appear in following format on the payer's card statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant descriptor is the descriptor of the merchant’s payment receiving preferences which can be seen by logging into the merchant account https://www.sandbox.paypal.com/businessprofile/settings/info/edit The PAYPAL prefix uses 8 characters. Only the first 22 characters will be displayed in the statement. For example, if: The PayPal prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. The soft descriptor is 800-123-1234. Then, the statement descriptor on the card is PAYPAL * Janes Gift 80.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22` | -| `items` | [`List[Item]`](../../doc/models/item.md) | Optional | An array of items that the customer purchases from the merchant. | +| `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. invoice_id values are required to be unique within each merchant account by default. Although the uniqueness validation is configurable, disabling this behavior will remove the account's ability to use invoice_id in other APIs as an identifier. It is highly recommended to keep a unique invoice_id for each Order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | +| `soft_descriptor` | `str` | Optional | This field supports up to 127 characters, but any content beyond 22 characters (including spaces) will be truncated. The 22 character limit is reflected in the response representation of this field. The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement. If an Order is paid using the "PayPal Wallet", the statement descriptor will appear in following format on the payer's card statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant descriptor is the descriptor of the merchant’s payment receiving preferences which can be seen by logging into the merchant account https://www.sandbox.paypal.com/businessprofile/settings/info/edit The PAYPAL prefix uses 8 characters. Only the first 22 characters will be displayed in the statement. For example, if: The PayPal prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. The soft descriptor is 800-123-1234. Then, the statement descriptor on the card is PAYPAL * Janes Gift 80.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000` | +| `items` | [`List[ItemRequest]`](../../doc/models/item-request.md) | Optional | An array of items that the customer purchases from the merchant. | | `shipping` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | | `supplementary_data` | [`SupplementaryData`](../../doc/models/supplementary-data.md) | Optional | Supplementary data about a payment. This object passes information that can be used to improve risk assessments and processing costs, for example, by providing Level 2 and Level 3 payment data. | diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md new file mode 100644 index 0000000..008a6e1 --- /dev/null +++ b/doc/models/reason-code.md @@ -0,0 +1,22 @@ + +# Reason Code + +The reason code for the payment failure. + +## Enumeration + +`ReasonCode` + +## Fields + +| Name | Description | +| --- | --- | +| `PAYMENT_DENIED` | PayPal declined the payment due to one or more customer issues. | +| `INTERNAL_SERVER_ERROR` | An internal server error has occurred. | +| `PAYEE_ACCOUNT_RESTRICTED` | The payee account is not in good standing and cannot receive payments. | +| `PAYER_ACCOUNT_RESTRICTED` | The payer account is not in good standing and cannot make payments. | +| `PAYER_CANNOT_PAY` | Payer cannot pay for this transaction. | +| `SENDING_LIMIT_EXCEEDED` | The transaction exceeds the payer's sending limit. | +| `TRANSACTION_RECEIVING_LIMIT_EXCEEDED` | The transaction exceeds the receiver's receiving limit. | +| `CURRENCY_MISMATCH` | The transaction is declined due to a currency mismatch. | + diff --git a/doc/models/reauthorize-request.md b/doc/models/reauthorize-request.md index bf76789..5c1ccaf 100644 --- a/doc/models/reauthorize-request.md +++ b/doc/models/reauthorize-request.md @@ -1,7 +1,7 @@ # Reauthorize Request -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. Note: This request is currently not supported for Partner use cases. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. ## Structure diff --git a/doc/models/return-flow.md b/doc/models/return-flow.md new file mode 100644 index 0000000..f717f6c --- /dev/null +++ b/doc/models/return-flow.md @@ -0,0 +1,16 @@ + +# Return Flow + +Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App. + +## Enumeration + +`ReturnFlow` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTO` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | +| `MANUAL` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | + diff --git a/doc/models/search-error-exception.md b/doc/models/search-error-exception.md new file mode 100644 index 0000000..2defb0c --- /dev/null +++ b/doc/models/search-error-exception.md @@ -0,0 +1,51 @@ + +# Search Error Exception + +The error details. + +## Structure + +`SearchErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Required | The human-readable, unique name of the error. | +| `message` | `str` | Required | The message that describes the error. | +| `debug_id` | `str` | Required | The PayPal internal ID. Used for correlation purposes. | +| `information_link` | `str` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | +| `details` | [`List[TransactionSearchErrorDetails]`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `total_items` | `int` | Optional | The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | +| `maximum_items` | `int` | Optional | The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | + +## Example (as JSON) + +```json +{ + "name": "name8", + "message": "message8", + "debug_id": "debug_id6", + "information_link": "information_link0", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "total_items": 20, + "maximum_items": 206 +} +``` + diff --git a/doc/models/search-response.md b/doc/models/search-response.md new file mode 100644 index 0000000..617c847 --- /dev/null +++ b/doc/models/search-response.md @@ -0,0 +1,228 @@ + +# Search Response + +The search response information. + +## Structure + +`SearchResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transaction_details` | [`List[TransactionDetails]`](../../doc/models/transaction-details.md) | Optional | An array of transaction detail objects.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `2147483647` | +| `account_number` | `str` | Optional | The merchant account number.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `start_date` | `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.

**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})$` | +| `end_date` | `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.

**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})$` | +| `last_refreshed_datetime` | `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.

**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})$` | +| `page` | `int` | Optional | A zero-relative index of transactions.

**Constraints**: `>= 0`, `<= 2147483647` | +| `total_items` | `int` | Optional | The total number of transactions as an integer beginning with the specified `page` in the full result and not just in this response.

**Constraints**: `>= 0`, `<= 2147483647` | +| `total_pages` | `int` | Optional | The total number of pages, as an `integer`, when the `total_items` is divided into pages of the specified `page_size`.

**Constraints**: `>= 0`, `<= 2147483647` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | + +## Example (as JSON) + +```json +{ + "transaction_details": [ + { + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } + }, + { + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } + }, + { + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } + } + ], + "account_number": "account_number8", + "start_date": "start_date2", + "end_date": "end_date8", + "last_refreshed_datetime": "last_refreshed_datetime4" +} +``` + diff --git a/doc/models/sepa-debit-experience-context.md b/doc/models/sepa-debit-experience-context.md new file mode 100644 index 0000000..003a3c8 --- /dev/null +++ b/doc/models/sepa-debit-experience-context.md @@ -0,0 +1,27 @@ + +# Sepa Debit Experience Context + +Customizes the payer experience during the approval process for the SEPA Debit payment. + +## Structure + +`SepaDebitExperienceContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locale` | `str` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `return_url` | `str` | Required | Describes the URL. | +| `cancel_url` | `str` | Required | Describes the URL. | + +## Example (as JSON) + +```json +{ + "locale": "locale8", + "return_url": "return_url6", + "cancel_url": "cancel_url8" +} +``` + diff --git a/doc/models/sepa-debit-request.md b/doc/models/sepa-debit-request.md new file mode 100644 index 0000000..74109fa --- /dev/null +++ b/doc/models/sepa-debit-request.md @@ -0,0 +1,27 @@ + +# Sepa Debit Request + +An API resource denoting a request to securely store a SEPA Debit. + +## Structure + +`SepaDebitRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `experience_context` | [`SepaDebitExperienceContext`](../../doc/models/sepa-debit-experience-context.md) | Optional | Customizes the payer experience during the approval process for the SEPA Debit payment. | + +## Example (as JSON) + +```json +{ + "experience_context": { + "locale": "locale6", + "return_url": "return_url4", + "cancel_url": "cancel_url6" + } +} +``` + diff --git a/doc/models/setup-fee-failure-action.md b/doc/models/setup-fee-failure-action.md new file mode 100644 index 0000000..714e6e7 --- /dev/null +++ b/doc/models/setup-fee-failure-action.md @@ -0,0 +1,16 @@ + +# Setup Fee Failure Action + +The action to take on the subscription if the initial payment for the setup fails. + +## Enumeration + +`SetupFeeFailureAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CONTINUE` | Continues the subscription if the initial payment for the setup fails. | +| `CANCEL` | Cancels the subscription if the initial payment for the setup fails. | + diff --git a/doc/models/setup-token-request-card.md b/doc/models/setup-token-request-card.md index 7331f94..96a0ecf 100644 --- a/doc/models/setup-token-request-card.md +++ b/doc/models/setup-token-request-card.md @@ -18,7 +18,7 @@ A Resource representing a request to vault a Card. | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `verification_method` | [`VaultCardVerificationMethod`](../../doc/models/vault-card-verification-method.md) | Optional | The verification method of the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `experience_context` | [`SetupTokenCardExperienceContext`](../../doc/models/setup-token-card-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | +| `experience_context` | [`VaultCardExperienceContext`](../../doc/models/vault-card-experience-context.md) | Optional | A resource representing an experience context of vault a card. | ## Example (as JSON) @@ -28,7 +28,7 @@ A Resource representing a request to vault a Card. "number": "number0", "expiry": "expiry0", "security_code": "security_code4", - "brand": "DINERS" + "brand": "STAR" } ``` diff --git a/doc/models/setup-token-request-payment-source.md b/doc/models/setup-token-request-payment-source.md index 1f27aff..c08c413 100644 --- a/doc/models/setup-token-request-payment-source.md +++ b/doc/models/setup-token-request-payment-source.md @@ -13,8 +13,10 @@ The payment method to vault with the instrument details. | --- | --- | --- | --- | | `card` | [`SetupTokenRequestCard`](../../doc/models/setup-token-request-card.md) | Optional | A Resource representing a request to vault a Card. | | `paypal` | [`VaultPaypalWalletRequest`](../../doc/models/vault-paypal-wallet-request.md) | Optional | A resource representing a request to vault PayPal Wallet. | -| `venmo` | [`VaultVenmoRequest`](../../doc/models/vault-venmo-request.md) | Optional | - | +| `venmo` | [`VaultVenmoRequest`](../../doc/models/vault-venmo-request.md) | Optional | A resource representing a request to vault Venmo. | +| `apple_pay` | [`VaultApplePayRequest`](../../doc/models/vault-apple-pay-request.md) | Optional | A resource representing a request to vault Apple Pay. | | `token` | [`VaultTokenRequest`](../../doc/models/vault-token-request.md) | Optional | The Tokenized Payment Source representing a Request to Vault a Token. | +| `bank` | [`BankRequest`](../../doc/models/bank-request.md) | Optional | A Resource representing a request to vault a Bank used for ACH Debit. | ## Example (as JSON) @@ -25,7 +27,7 @@ The payment method to vault with the instrument details. "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "paypal": { "description": "description2", @@ -34,6 +36,7 @@ The payment method to vault with the instrument details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -58,6 +61,7 @@ The payment method to vault with the instrument details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -75,6 +79,21 @@ The payment method to vault with the instrument details. "permit_multiple_payment_tokens": false, "usage_type": "MERCHANT" }, + "apple_pay": { + "token": "token6", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } + }, "token": { "id": "id6", "type": "SETUP_TOKEN" diff --git a/doc/models/setup-token-request.md b/doc/models/setup-token-request.md index a7ef369..af4a46e 100644 --- a/doc/models/setup-token-request.md +++ b/doc/models/setup-token-request.md @@ -28,7 +28,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "paypal": { "description": "description2", @@ -37,6 +37,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -61,6 +62,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -78,6 +80,21 @@ Setup Token Request where the `source` defines the type of instrument to be stor "permit_multiple_payment_tokens": false, "usage_type": "MERCHANT" }, + "apple_pay": { + "token": "token6", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } + }, "token": { "id": "id6", "type": "SETUP_TOKEN" diff --git a/doc/models/setup-token-response-card.md b/doc/models/setup-token-response-card.md index 88ab316..cd03738 100644 --- a/doc/models/setup-token-response-card.md +++ b/doc/models/setup-token-response-card.md @@ -27,7 +27,7 @@ { "name": "name8", "last_digits": "last_digits2", - "brand": "ELO", + "brand": "DISCOVER", "expiry": "expiry6", "billing_address": { "address_line_1": "address_line_12", diff --git a/doc/models/setup-token-response-payment-source.md b/doc/models/setup-token-response-payment-source.md index 7d441bc..4cfea87 100644 --- a/doc/models/setup-token-response-payment-source.md +++ b/doc/models/setup-token-response-payment-source.md @@ -12,8 +12,8 @@ The setup payment method details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `card` | [`SetupTokenResponseCard`](../../doc/models/setup-token-response-card.md) | Optional | - | -| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | - | -| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | - | +| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | Full representation of a PayPal Payment Token. | +| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | Full representation of a Venmo Payment Token. | ## Example (as JSON) @@ -22,7 +22,7 @@ The setup payment method details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -40,6 +40,7 @@ The setup payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -64,6 +65,7 @@ The setup payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/setup-token-response.md b/doc/models/setup-token-response.md index 28ac7ee..26fd1b7 100644 --- a/doc/models/setup-token-response.md +++ b/doc/models/setup-token-response.md @@ -11,7 +11,7 @@ Minimal representation of a cached setup token. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `str` | Optional | The PayPal-generated ID for the vault token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `str` | Optional | The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's server so the saved payment source can be used for future transactions.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `customer` | [`Customer`](../../doc/models/customer.md) | Optional | This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. | | `status` | [`PaymentTokenStatus`](../../doc/models/payment-token-status.md) | Optional | The status of the payment token.

**Default**: `'CREATED'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_source` | [`SetupTokenResponsePaymentSource`](../../doc/models/setup-token-response-payment-source.md) | Optional | The setup payment method details. | @@ -31,7 +31,7 @@ Minimal representation of a cached setup token. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -49,6 +49,7 @@ Minimal representation of a cached setup token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -73,6 +74,7 @@ Minimal representation of a cached setup token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md index 1a71f58..806a9b6 100644 --- a/doc/models/shipment-carrier.md +++ b/doc/models/shipment-carrier.md @@ -1387,4 +1387,40 @@ The carrier for the shipment. Some carriers have a global version as well as loc | `UPS_CHECKER` | ups-checker. | | `WINESHIPPING` | Wineshipping. | | `SPEDISCI` | Spedisci online. | +| `FOURKITES` | Fourkites. | +| `ETONAS` | Etonas. | +| `FINMILE` | Fin Mile. | +| `UNIUNI` | Uniuni. | +| `RODONAVES` | Rodonaves. | +| `INPOST_IT` | Inpost Italy. | +| `TFORCE_FREIGHT` | Tforce Freight. | +| `RICHMOM` | Rich Mom. | +| `FRANCO` | Corriere Franco. | +| `ECPARCEL` | Ecparcel. | +| `FEDEX_CHINA` | Fedex China. | +| `GOFO_EXPRESS` | Gofo Express. | +| `SHIPBOB` | Shipbob. | +| `JERSEYPOST_ATLAS` | Jersey Post Group. | +| `CORETRAILS` | Coretrails. | +| `RHENUS_ITALY` | Rhenus Logistics Italy. | +| `JADLOG` | Jadlog. | +| `JITSU` | Jitsu. | +| `YANWEN_EXPRESS` | Yanwen Express. | +| `DASHLINK` | Dashlink. | +| `SEINO_SUPER_EXPRESS` | Seino Super Express. | +| `FLOSHIP` | Floship. | +| `METROSCG` | Metro Supply Chain. | +| `SENDPARCEL` | Sendparcel. | +| `P2P` | P2p. | +| `CN_EXPRESS` | Cn Express. | +| `CIRROTRACK` | Cirro Track. | +| `LAND_LOGISTICS` | Land Logistics. | +| `VEHO` | Veho. | +| `MEDLINE` | Medline. | +| `VDTRACK` | Vdtrack. | +| `SINO_SCM` | Sino Scm. | +| `ENUM_3PE_EXPRESS` | 3pe Express. | +| `SWIFTX` | Swiftx. | +| `SFYDEXPRESS` | Sfyd Express. | +| `TOPTRANS` | Toptrans. | diff --git a/doc/models/shipping-information.md b/doc/models/shipping-information.md new file mode 100644 index 0000000..6e0ea83 --- /dev/null +++ b/doc/models/shipping-information.md @@ -0,0 +1,43 @@ + +# Shipping Information + +The shipping information. + +## Structure + +`ShippingInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Optional | The recipient's name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `method` | `str` | Optional | The shipping method that is associated with this order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | +| `secondary_shipping_address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | + +## Example (as JSON) + +```json +{ + "name": "name8", + "method": "method2", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } +} +``` + diff --git a/doc/models/shipping-options-purchase-unit.md b/doc/models/shipping-options-purchase-unit.md deleted file mode 100644 index 9981563..0000000 --- a/doc/models/shipping-options-purchase-unit.md +++ /dev/null @@ -1,108 +0,0 @@ - -# Shipping Options Purchase Unit - -This would contain shipping option and amount data at purchase unit level. - -## Structure - -`ShippingOptionsPurchaseUnit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `reference_id` | `str` | Optional | The API caller-provided external ID for the purchase unit. Required for multiple purchase units when you must update the order through `PATCH`. If you omit this value and the order contains only one purchase unit, PayPal sets this value to `default`. Note: If there are multiple purchase units, reference_id is required for each purchase unit.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -| `amount` | [`AmountWithBreakdown`](../../doc/models/amount-with-breakdown.md) | Optional | The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` plus `handling` plus `insurance` minus `shipping_discount` minus discount. The amount must be a positive number. For listed of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. | -| `items` | [`List[Item]`](../../doc/models/item.md) | Optional | An array of items that the customer purchases from the merchant. | -| `shipping_options` | [`List[ShippingOption]`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | - -## Example (as JSON) - -```json -{ - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "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" - } - } - }, - "items": [ - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - }, - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - } - ], - "shipping_options": [ - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] -} -``` - diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md index 2584994..c68bcd9 100644 --- a/doc/models/shipping-with-tracking-details.md +++ b/doc/models/shipping-with-tracking-details.md @@ -1,8 +1,6 @@ # Shipping With Tracking Details -The order shipping details. - ## Structure `ShippingWithTrackingDetails` @@ -11,18 +9,72 @@ The order shipping details. | Name | Type | Tags | Description | | --- | --- | --- | --- | +| `trackers` | [`List[OrderTrackerResponse]`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | | `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | -| `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | +| `phone_number` | [`PhoneNumberWithOptionalCountryCode`](../../doc/models/phone-number-with-optional-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `mtype` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `options` | [`List[ShippingOption]`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -| `trackers` | [`List[OrderTrackerResponse]`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | ## Example (as JSON) ```json { + "trackers": [ + { + "id": "id2", + "status": "CANCELLED", + "items": [ + { + "name": "name8", + "quantity": "quantity4", + "sku": "sku6", + "url": "url2", + "image_url": "image_url4" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "create_time": "create_time8" + }, + { + "id": "id2", + "status": "CANCELLED", + "items": [ + { + "name": "name8", + "quantity": "quantity4", + "sku": "sku6", + "url": "url2", + "image_url": "image_url4" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "create_time": "create_time8" + } + ], "name": { "full_name": "full_name6" }, @@ -31,29 +83,7 @@ The order shipping details. "country_code": "country_code2", "national_number": "national_number6" }, - "type": "SHIPPING", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] + "type": "SHIPPING" } ``` diff --git a/doc/models/simple-postal-address-coarse-grained.md b/doc/models/simple-postal-address-coarse-grained.md new file mode 100644 index 0000000..475237b --- /dev/null +++ b/doc/models/simple-postal-address-coarse-grained.md @@ -0,0 +1,33 @@ + +# Simple Postal Address Coarse Grained + +A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. + +## Structure + +`SimplePostalAddressCoarseGrained` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `line_1` | `str` | Required | The first line of the address. For example, number or street. | +| `line_2` | `str` | Optional | The second line of the address. For example, suite or apartment number. | +| `city` | `str` | Required | The city name. | +| `state` | `str` | Optional | The [code](/docs/api/reference/state-codes/) for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: [Argentina](/docs/api/reference/state-codes/#argentina), [Brazil](/docs/api/reference/state-codes/#brazil), [Canada](/docs/api/reference/state-codes/#canada), [China](/docs/api/reference/state-codes/#china), [India](/docs/api/reference/state-codes/#india), [Italy](/docs/api/reference/state-codes/#italy), [Japan](/docs/api/reference/state-codes/#japan), [Mexico](/docs/api/reference/state-codes/#mexico), [Thailand](/docs/api/reference/state-codes/#thailand), or [United States](/docs/api/reference/state-codes/#usa). Maximum length is 40 single-byte characters. | +| `country_code` | `str` | Required | The [two-character ISO 3166-1 code](/docs/integration/direct/rest/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.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | +| `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). | + +## Example (as JSON) + +```json +{ + "line1": "line14", + "line2": "line26", + "city": "city2", + "state": "state8", + "country_code": "country_code2", + "postal_code": "postal_code4" +} +``` + diff --git a/doc/models/store-information.md b/doc/models/store-information.md new file mode 100644 index 0000000..c6d417d --- /dev/null +++ b/doc/models/store-information.md @@ -0,0 +1,25 @@ + +# Store Information + +The store information. + +## Structure + +`StoreInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `store_id` | `str` | Optional | The ID of a store for a merchant in the system of record.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `terminal_id` | `str` | Optional | The terminal ID for the checkout stand in a merchant store.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9]*$` | + +## Example (as JSON) + +```json +{ + "store_id": "store_id6", + "terminal_id": "terminal_id0" +} +``` + diff --git a/doc/models/stored-payment-source.md b/doc/models/stored-payment-source.md index b5aa08d..53145be 100644 --- a/doc/models/stored-payment-source.md +++ b/doc/models/stored-payment-source.md @@ -14,7 +14,7 @@ Provides additional details to process a payment using a `payment_source` that h | `payment_initiator` | [`PaymentInitiator`](../../doc/models/payment-initiator.md) | Required | The person or party who initiated or triggered the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_type` | [`StoredPaymentSourcePaymentType`](../../doc/models/stored-payment-source-payment-type.md) | Required | Indicates the type of the stored payment_source payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `'DERIVED'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `previous_network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `previous_network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | ## Example (as JSON) @@ -26,7 +26,7 @@ Provides additional details to process a payment using a `payment_source` that h "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/subscriber-request.md b/doc/models/subscriber-request.md new file mode 100644 index 0000000..448b4dc --- /dev/null +++ b/doc/models/subscriber-request.md @@ -0,0 +1,67 @@ + +# Subscriber Request + +The subscriber request information . + +## Structure + +`SubscriberRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | +| `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `payment_source` | [`SubscriptionPaymentSource`](../../doc/models/subscription-payment-source.md) | Optional | The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions. | + +## Example (as JSON) + +```json +{ + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } + } +} +``` + diff --git a/doc/models/subscriber.md b/doc/models/subscriber.md new file mode 100644 index 0000000..889f6c9 --- /dev/null +++ b/doc/models/subscriber.md @@ -0,0 +1,66 @@ + +# Subscriber + +The subscriber response information. + +## Structure + +`Subscriber` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `payment_source` | [`SubscriptionPaymentSourceResponse`](../../doc/models/subscription-payment-source-response.md) | Optional | The payment source used to fund the payment. | + +## Example (as JSON) + +```json +{ + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry4", + "currency_code": "currency_code2" + } + } +} +``` + diff --git a/doc/models/subscription-amount-with-breakdown.md b/doc/models/subscription-amount-with-breakdown.md new file mode 100644 index 0000000..97902ef --- /dev/null +++ b/doc/models/subscription-amount-with-breakdown.md @@ -0,0 +1,51 @@ + +# Subscription Amount With Breakdown + +The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. + +## Structure + +`SubscriptionAmountWithBreakdown` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `gross_amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `total_item_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `fee_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `net_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } +} +``` + diff --git a/doc/models/subscription-application-context.md b/doc/models/subscription-application-context.md new file mode 100644 index 0000000..3858eda --- /dev/null +++ b/doc/models/subscription-application-context.md @@ -0,0 +1,37 @@ + +# Subscription Application Context + +The application context, which customizes the payer experience during the subscription approval process with PayPal. + +## Structure + +`SubscriptionApplicationContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `locale` | `str` | Optional | The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `user_action` | [`ApplicationContextUserAction`](../../doc/models/application-context-user-action.md) | Optional | Configures the label name to `Continue` or `Subscribe Now` for subscription consent experience.

**Default**: `'SUBSCRIBE_NOW'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_method` | [`PaymentMethod`](../../doc/models/payment-method.md) | Optional | The customer and merchant payment preferences. | +| `return_url` | `str` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | +| `cancel_url` | `str` | Required | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "user_action": "SUBSCRIBE_NOW", + "return_url": "return_url0", + "cancel_url": "cancel_url2", + "brand_name": "brand_name8", + "locale": "locale2", + "payment_method": { + "payee_preferred": "UNRESTRICTED" + } +} +``` + diff --git a/doc/models/subscription-billing-cycle.md b/doc/models/subscription-billing-cycle.md new file mode 100644 index 0000000..2d5a5b1 --- /dev/null +++ b/doc/models/subscription-billing-cycle.md @@ -0,0 +1,68 @@ + +# Subscription Billing Cycle + +The billing cycle details. + +## Structure + +`SubscriptionBillingCycle` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Optional | The pricing scheme details. | +| `frequency` | [`Frequency`](../../doc/models/frequency.md) | Required | The frequency of the billing cycle. | +| `tenure_type` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `sequence` | `int` | Required | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Constraints**: `>= 1`, `<= 99` | +| `total_cycles` | `int` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "frequency": { + "interval_unit": "DAY", + "interval_count": 1 + }, + "tenure_type": "REGULAR", + "sequence": 30, + "total_cycles": 1, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } +} +``` + diff --git a/doc/models/subscription-billing-information.md b/doc/models/subscription-billing-information.md new file mode 100644 index 0000000..d791568 --- /dev/null +++ b/doc/models/subscription-billing-information.md @@ -0,0 +1,69 @@ + +# Subscription Billing Information + +The billing details for the subscription. If the subscription was or is active, these fields are populated. + +## Structure + +`SubscriptionBillingInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `outstanding_balance` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `cycle_executions` | [`List[CycleExecution]`](../../doc/models/cycle-execution.md) | Optional | The trial and regular billing executions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `3` | +| `last_payment` | [`LastPaymentDetails`](../../doc/models/last-payment-details.md) | Optional | The details for the last payment. | +| `next_billing_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.

**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})$` | +| `final_payment_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.

**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})$` | +| `failed_payments_count` | `int` | Required | The number of consecutive payment failures. Resets to `0` after a successful payment. If this reaches the `payment_failure_threshold` value, the subscription updates to the `SUSPENDED` state.

**Constraints**: `>= 0`, `<= 999` | +| `last_failed_payment` | [`FailedPaymentDetails`](../../doc/models/failed-payment-details.md) | Optional | The details for the failed payment of the subscription. | + +## Example (as JSON) + +```json +{ + "outstanding_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "cycle_executions": [ + { + "tenure_type": "REGULAR", + "sequence": 64, + "cycles_completed": 110, + "cycles_remaining": 14, + "current_pricing_scheme_version": 99, + "total_cycles": 254 + }, + { + "tenure_type": "REGULAR", + "sequence": 64, + "cycles_completed": 110, + "cycles_remaining": 14, + "current_pricing_scheme_version": 99, + "total_cycles": 254 + } + ], + "last_payment": { + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time2" + }, + "next_billing_time": "next_billing_time0", + "final_payment_time": "final_payment_time4", + "failed_payments_count": 70, + "last_failed_payment": { + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time4", + "reason_code": "PAYER_CANNOT_PAY", + "next_payment_retry_time": "next_payment_retry_time6" + } +} +``` + diff --git a/doc/models/subscription-card-request.md b/doc/models/subscription-card-request.md new file mode 100644 index 0000000..2bd6121 --- /dev/null +++ b/doc/models/subscription-card-request.md @@ -0,0 +1,34 @@ + +# Subscription Card Request + +The payment card to use to fund a payment. Can be a credit or debit card. + +## Structure + +`SubscriptionCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.{1,300}$` | +| `number` | `str` | Optional | The primary account number (PAN) for the payment card.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | +| `expiry` | `str` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | +| `security_code` | `str` | Optional | The three- or four-digit security code of the card. Also known as the CVV, CVC, CVN, CVE, or CID. This parameter cannot be present in the request when `payment_initiator=MERCHANT`.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `4`, *Pattern*: `^[0-9]{3,4}$` | +| `mtype` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `brand` | [`SubscriptionsCardBrand`](../../doc/models/subscriptions-card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | +| `attributes` | [`SubscriptionsCardAttributes`](../../doc/models/subscriptions-card-attributes.md) | Optional | Additional attributes associated with the use of this card. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" +} +``` + diff --git a/doc/models/subscription-collection.md b/doc/models/subscription-collection.md new file mode 100644 index 0000000..c159a38 --- /dev/null +++ b/doc/models/subscription-collection.md @@ -0,0 +1,52 @@ + +# Subscription Collection + +The list of subscriptions. + +## Structure + +`SubscriptionCollection` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptions` | [`List[Subscription]`](../../doc/models/subscription.md) | Optional | An array of subscriptions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "subscriptions": [ + { + "id": "id6", + "plan_id": "plan_id8", + "start_time": "start_time0", + "quantity": "quantity2", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } + }, + { + "id": "id6", + "plan_id": "plan_id8", + "start_time": "start_time0", + "quantity": "quantity2", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/subscription-customer-information.md b/doc/models/subscription-customer-information.md new file mode 100644 index 0000000..4622645 --- /dev/null +++ b/doc/models/subscription-customer-information.md @@ -0,0 +1,32 @@ + +# Subscription Customer Information + +The details about a customer in PayPal's system of record. + +## Structure + +`SubscriptionCustomerInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "email_address": "email_address0", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + } +} +``` + diff --git a/doc/models/subscription-error-exception.md b/doc/models/subscription-error-exception.md new file mode 100644 index 0000000..cac8449 --- /dev/null +++ b/doc/models/subscription-error-exception.md @@ -0,0 +1,107 @@ + +# Subscription Error Exception + +The error details. + +## Structure + +`SubscriptionErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Required | The human-readable, unique name of the error. | +| `message` | `str` | Required | The message that describes the error. | +| `debug_id` | `str` | Required | The PayPal internal ID. Used for correlation purposes. | +| `information_link` | `str` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | +| `details` | [`List[ErrorDetails]`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "name": "name0", + "message": "message0", + "debug_id": "debug_id4", + "information_link": "information_link8", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + }, + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + }, + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/subscription-patch-application-context.md b/doc/models/subscription-patch-application-context.md new file mode 100644 index 0000000..15ae365 --- /dev/null +++ b/doc/models/subscription-patch-application-context.md @@ -0,0 +1,35 @@ + +# Subscription Patch Application Context + +The application context, which customizes the payer experience during the subscription approval process with PayPal. + +## Structure + +`SubscriptionPatchApplicationContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `locale` | `str` | Optional | The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_method` | [`PaymentMethod`](../../doc/models/payment-method.md) | Optional | The customer and merchant payment preferences. | +| `return_url` | `str` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | +| `cancel_url` | `str` | Required | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "return_url": "return_url4", + "cancel_url": "cancel_url8", + "brand_name": "brand_name4", + "locale": "locale8", + "payment_method": { + "payee_preferred": "UNRESTRICTED" + } +} +``` + diff --git a/doc/models/subscription-payer-name.md b/doc/models/subscription-payer-name.md new file mode 100644 index 0000000..d60cc61 --- /dev/null +++ b/doc/models/subscription-payer-name.md @@ -0,0 +1,32 @@ + +# Subscription Payer Name + +The name of the party. + +## Structure + +`SubscriptionPayerName` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefix` | `str` | Optional | The prefix, or title, to the party's name.

**Constraints**: *Maximum Length*: `140` | +| `given_name` | `str` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | +| `surname` | `str` | Optional | When the party is a person, the party's surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother's, surname.

**Constraints**: *Maximum Length*: `140` | +| `middle_name` | `str` | Optional | When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.

**Constraints**: *Maximum Length*: `140` | +| `suffix` | `str` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | +| `full_name` | `str` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | + +## Example (as JSON) + +```json +{ + "prefix": "prefix4", + "given_name": "given_name8", + "surname": "surname2", + "middle_name": "middle_name4", + "suffix": "suffix4" +} +``` + diff --git a/doc/models/subscription-payment-source-response.md b/doc/models/subscription-payment-source-response.md new file mode 100644 index 0000000..6c72045 --- /dev/null +++ b/doc/models/subscription-payment-source-response.md @@ -0,0 +1,35 @@ + +# Subscription Payment Source Response + +The payment source used to fund the payment. + +## Structure + +`SubscriptionPaymentSourceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `card` | [`CardResponseWithBillingAddress`](../../doc/models/card-response-with-billing-address.md) | Optional | The payment card used to fund the payment. Card can be a credit or debit card. | + +## Example (as JSON) + +```json +{ + "card": { + "name": "name6", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry4", + "currency_code": "currency_code2" + } +} +``` + diff --git a/doc/models/subscription-payment-source.md b/doc/models/subscription-payment-source.md new file mode 100644 index 0000000..7a8781c --- /dev/null +++ b/doc/models/subscription-payment-source.md @@ -0,0 +1,29 @@ + +# Subscription Payment Source + +The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions. + +## Structure + +`SubscriptionPaymentSource` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `card` | [`SubscriptionCardRequest`](../../doc/models/subscription-card-request.md) | Optional | The payment card to use to fund a payment. Can be a credit or debit card. | + +## Example (as JSON) + +```json +{ + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } +} +``` + diff --git a/doc/models/subscription-plan-status.md b/doc/models/subscription-plan-status.md new file mode 100644 index 0000000..2f4e757 --- /dev/null +++ b/doc/models/subscription-plan-status.md @@ -0,0 +1,17 @@ + +# Subscription Plan Status + +The plan status. + +## Enumeration + +`SubscriptionPlanStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `CREATED` | The plan was created. You cannot create subscriptions for a plan in this state. | +| `INACTIVE` | The plan is inactive. | +| `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | + diff --git a/doc/models/subscription-pricing-model.md b/doc/models/subscription-pricing-model.md new file mode 100644 index 0000000..a76c322 --- /dev/null +++ b/doc/models/subscription-pricing-model.md @@ -0,0 +1,16 @@ + +# Subscription Pricing Model + +The pricing model for tiered plan. The `tiers` parameter is required. + +## Enumeration + +`SubscriptionPricingModel` + +## Fields + +| Name | Description | +| --- | --- | +| `VOLUME` | A volume pricing model. | +| `TIERED` | A tiered pricing model. | + diff --git a/doc/models/subscription-pricing-scheme.md b/doc/models/subscription-pricing-scheme.md new file mode 100644 index 0000000..21beaab --- /dev/null +++ b/doc/models/subscription-pricing-scheme.md @@ -0,0 +1,60 @@ + +# Subscription Pricing Scheme + +The pricing scheme details. + +## Structure + +`SubscriptionPricingScheme` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `int` | Optional | The version of the pricing scheme.

**Constraints**: `>= 0`, `<= 999` | +| `fixed_price` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `pricing_model` | [`SubscriptionPricingModel`](../../doc/models/subscription-pricing-model.md) | Optional | The pricing model for tiered plan. The `tiers` parameter is required.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `tiers` | [`List[PricingTier]`](../../doc/models/pricing-tier.md) | Optional | An array of pricing tiers which are used for billing volume/tiered plans. pricing_model field has to be specified.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | +| `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.

**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.

**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) + +```json +{ + "version": 172, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time2" +} +``` + diff --git a/doc/models/subscription-transaction-details.md b/doc/models/subscription-transaction-details.md new file mode 100644 index 0000000..dc1f619 --- /dev/null +++ b/doc/models/subscription-transaction-details.md @@ -0,0 +1,64 @@ + +# Subscription Transaction Details + +The transaction details. + +## Structure + +`SubscriptionTransactionDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`CaptureStatus`](../../doc/models/capture-status.md) | Optional | The status of the captured payment. | +| `id` | `str` | Required | The PayPal-generated transaction ID.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | +| `amount_with_breakdown` | [`SubscriptionAmountWithBreakdown`](../../doc/models/subscription-amount-with-breakdown.md) | Required | The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. | +| `payer_name` | [`SubscriptionPayerName`](../../doc/models/subscription-payer-name.md) | Optional | The name of the party. | +| `payer_email` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | +| `time` | `str` | Required | 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.

**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) + +```json +{ + "status": "REFUNDED", + "id": "id4", + "amount_with_breakdown": { + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } + }, + "payer_name": { + "prefix": "prefix8", + "given_name": "given_name2", + "surname": "surname8", + "middle_name": "middle_name0", + "suffix": "suffix0" + }, + "payer_email": "payer_email2", + "time": "time4" +} +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md new file mode 100644 index 0000000..4ef5a92 --- /dev/null +++ b/doc/models/subscription.md @@ -0,0 +1,42 @@ + +# Subscription + +The subscription details. + +## Structure + +`Subscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | The PayPal-generated ID for the subscription.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | +| `plan_id` | `str` | Optional | The ID of the plan.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | +| `start_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.

**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})$` | +| `quantity` | `str` | Optional | The quantity of the product in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `subscriber` | [`Subscriber`](../../doc/models/subscriber.md) | Optional | The subscriber response information. | +| `billing_info` | [`SubscriptionBillingInformation`](../../doc/models/subscription-billing-information.md) | Optional | The billing details for the subscription. If the subscription was or is active, these fields are populated. | +| `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.

**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.

**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})$` | +| `custom_id` | `str` | Optional | The custom id for the subscription. Can be invoice id.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\x20-\x7E]+` | +| `plan_overridden` | `bool` | Optional | Indicates whether the subscription has overridden any plan attributes. | +| `plan` | [`PlanDetails`](../../doc/models/plan-details.md) | Optional | The plan details. | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "id": "id4", + "plan_id": "plan_id6", + "start_time": "start_time8", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } +} +``` + diff --git a/doc/models/subscriptions-card-attributes.md b/doc/models/subscriptions-card-attributes.md new file mode 100644 index 0000000..078ac81 --- /dev/null +++ b/doc/models/subscriptions-card-attributes.md @@ -0,0 +1,41 @@ + +# Subscriptions Card Attributes + +Additional attributes associated with the use of this card. + +## Structure + +`SubscriptionsCardAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customer` | [`CardCustomer`](../../doc/models/card-customer.md) | Optional | The details about a customer in PayPal's system of record. | +| `vault` | [`VaultInstructionBase`](../../doc/models/vault-instruction-base.md) | Optional | Basic vault instruction specification that can be extended by specific payment sources that supports vaulting. | +| `verification` | [`CardVerification`](../../doc/models/card-verification.md) | Optional | The API caller can opt in to verify the card through PayPal offered verification services (e.g. Smart Dollar Auth, 3DS). | + +## Example (as JSON) + +```json +{ + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "merchant_customer_id": "merchant_customer_id2" + }, + "vault": { + "store_in_vault": "ON_SUCCESS" + }, + "verification": { + "method": "3D_SECURE" + } +} +``` + diff --git a/doc/models/subscriptions-card-brand.md b/doc/models/subscriptions-card-brand.md new file mode 100644 index 0000000..2289cd9 --- /dev/null +++ b/doc/models/subscriptions-card-brand.md @@ -0,0 +1,39 @@ + +# Subscriptions Card Brand + +The card network or brand. Applies to credit, debit, gift, and payment cards. + +## Enumeration + +`SubscriptionsCardBrand` + +## Fields + +| Name | Description | +| --- | --- | +| `VISA` | Visa card. | +| `MASTERCARD` | Mastercard card. | +| `DISCOVER` | Discover card. | +| `AMEX` | American Express card. | +| `SOLO` | Solo debit card. | +| `JCB` | Japan Credit Bureau card. | +| `STAR` | Military Star card. | +| `DELTA` | Delta Airlines card. | +| `SWITCH` | Switch credit card. | +| `MAESTRO` | Maestro credit card. | +| `CB_NATIONALE` | Carte Bancaire (CB) credit card. | +| `CONFIGOGA` | Configoga credit card. | +| `CONFIDIS` | Confidis credit card. | +| `ELECTRON` | Visa Electron credit card. | +| `CETELEM` | Cetelem credit card. | +| `CHINA_UNION_PAY` | China union pay credit card. | +| `DINERS` | The Diners Club International banking and payment services capability network owned by Discover Financial Services (DFS), one of the most recognized brands in US financial services. | +| `ELO` | The Brazilian Elo card payment network. | +| `HIPER` | The Hiper - Ingenico ePayment network. | +| `HIPERCARD` | The Brazilian Hipercard payment network that's widely accepted in the retail market. | +| `RUPAY` | The RuPay payment network. | +| `GE` | The GE Credit Union 3Point card payment network. | +| `SYNCHRONY` | The Synchrony Financial (SYF) payment network. | +| `EFTPOS` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | +| `UNKNOWN` | UNKNOWN payment network. | + diff --git a/doc/models/supplementary-purchase-data.md b/doc/models/supplementary-purchase-data.md deleted file mode 100644 index 2afc201..0000000 --- a/doc/models/supplementary-purchase-data.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Supplementary Purchase Data - -The capture identification-related fields. Includes the invoice ID, custom ID, note to payer, and soft descriptor. - -## Structure - -`SupplementaryPurchaseData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `str` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.{1,127}$` | -| `note_to_payer` | `str` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^.{1,255}$` | - -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id8", - "note_to_payer": "note_to_payer0" -} -``` - diff --git a/doc/models/suspend-subscription.md b/doc/models/suspend-subscription.md new file mode 100644 index 0000000..24ca867 --- /dev/null +++ b/doc/models/suspend-subscription.md @@ -0,0 +1,23 @@ + +# Suspend Subscription + +The suspend subscription request details. + +## Structure + +`SuspendSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `str` | Required | The reason for suspension of the Subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "reason": "reason4" +} +``` + diff --git a/doc/models/tax-amount.md b/doc/models/tax-amount.md new file mode 100644 index 0000000..d6a7f82 --- /dev/null +++ b/doc/models/tax-amount.md @@ -0,0 +1,26 @@ + +# Tax Amount + +The tax levied by a government on the purchase of goods or services. + +## Structure + +`TaxAmount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + } +} +``` + diff --git a/doc/models/taxes-override.md b/doc/models/taxes-override.md new file mode 100644 index 0000000..4e72238 --- /dev/null +++ b/doc/models/taxes-override.md @@ -0,0 +1,25 @@ + +# Taxes Override + +The tax details. + +## Structure + +`TaxesOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `percentage` | `str` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `inclusive` | `bool` | Optional | Indicates whether the tax was already included in the billing amount. | + +## Example (as JSON) + +```json +{ + "percentage": "percentage8", + "inclusive": false +} +``` + diff --git a/doc/models/taxes.md b/doc/models/taxes.md new file mode 100644 index 0000000..2dd81c1 --- /dev/null +++ b/doc/models/taxes.md @@ -0,0 +1,25 @@ + +# Taxes + +The tax details. + +## Structure + +`Taxes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `percentage` | `str` | Required | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `inclusive` | `bool` | Optional | Indicates whether the tax was already included in the billing amount.

**Default**: `True` | + +## Example (as JSON) + +```json +{ + "percentage": "percentage6", + "inclusive": true +} +``` + diff --git a/doc/models/tenure-type.md b/doc/models/tenure-type.md index 7d57a94..4da9e8a 100644 --- a/doc/models/tenure-type.md +++ b/doc/models/tenure-type.md @@ -1,7 +1,7 @@ # Tenure Type -The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle. +The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle., The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan., The type of the billing cycle. ## Enumeration diff --git a/doc/models/transaction-details.md b/doc/models/transaction-details.md new file mode 100644 index 0000000..484e1ad --- /dev/null +++ b/doc/models/transaction-details.md @@ -0,0 +1,90 @@ + +# Transaction Details + +The transaction details. + +## Structure + +`TransactionDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transaction_info` | [`TransactionInformation`](../../doc/models/transaction-information.md) | Optional | The transaction information. | +| `payer_info` | [`PayerInformation`](../../doc/models/payer-information.md) | Optional | The payer information. | +| `shipping_info` | [`ShippingInformation`](../../doc/models/shipping-information.md) | Optional | The shipping information. | +| `cart_info` | [`CartInformation`](../../doc/models/cart-information.md) | Optional | The cart information. | +| `store_info` | [`StoreInformation`](../../doc/models/store-information.md) | Optional | The store information. | +| `auction_info` | [`AuctionInformation`](../../doc/models/auction-information.md) | Optional | The auction information. | +| `incentive_info` | [`IncentiveInformation`](../../doc/models/incentive-information.md) | Optional | The incentive details. | + +## Example (as JSON) + +```json +{ + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } +} +``` + diff --git a/doc/models/transaction-information.md b/doc/models/transaction-information.md new file mode 100644 index 0000000..1e7f85f --- /dev/null +++ b/doc/models/transaction-information.md @@ -0,0 +1,60 @@ + +# Transaction Information + +The transaction information. + +## Structure + +`TransactionInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paypal_account_id` | `str` | Optional | The ID of the PayPal account of the counterparty.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_id` | `str` | Optional | The PayPal-generated transaction ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `paypal_reference_id` | `str` | Optional | The PayPal-generated base ID. PayPal exclusive. Cannot be altered. Defined as a related, pre-existing transaction or event.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `paypal_reference_id_type` | [`PaypalReferenceIdType`](../../doc/models/paypal-reference-id-type.md) | Optional | The PayPal reference ID type.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_event_code` | `str` | Optional | A five-digit transaction event code that classifies the transaction type based on money movement and debit or credit. For example, T0001. See [Transaction event codes](/docs/integration/direct/transaction-search/transaction-event-codes/).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `5`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_initiation_date` | `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.

**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})$` | +| `transaction_updated_date` | `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.

**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})$` | +| `transaction_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `fee_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `insurance_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `sales_tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `other_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tip_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `transaction_status` | `str` | Optional | A code that indicates the transaction status. Value is: Status code Description D PayPal or merchant rules denied the transaction. P The transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S. S The transaction successfully completed without a denial and after any pending statuses. V A successful transaction was fully reversed and funds were refunded to the original sender.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_subject` | `str` | Optional | The subject of payment. The payer passes this value to the payee. The payer controls this data through the interface through which he or she sends the data.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `transaction_note` | `str` | Optional | A special note that the payer passes to the payee. Might contain special customer requests, such as shipping instructions.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `payment_tracking_id` | `str` | Optional | The payment tracking ID, which is a unique ID that partners specify to either get information about a payment or request a refund.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `bank_reference_id` | `str` | Optional | The bank reference ID. The bank provides this value for an ACH transaction.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `ending_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `available_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `invoice_id` | `str` | Optional | The invoice ID that is sent by the merchant with the transaction. Note: If an invoice ID was sent with the capture request, the value is reported. Otherwise, the invoice ID of the authorizing transaction is reported.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `custom_field` | `str` | Optional | The merchant-provided custom text. Note: Usually, this field includes the unique ID for payments made with MassPay type transaction.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `protection_eligibility` | `str` | Optional | Indicates whether the transaction is eligible for protection. Value is: 01. Eligible. 02. Not eligible 03. Partially eligible.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `credit_term` | `str` | Optional | The credit term. The time span covered by the installment payments as expressed in the term length plus the length time unit code.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z0-9.]*$` | +| `credit_transactional_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `credit_promotional_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `annual_percentage_rate` | `str` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `payment_method_type` | `str` | Optional | The payment method that was used for a transaction. Value is PUI, installment, or mEFT. Note: Appears only for pay upon invoice (PUI), installment, and mEFT transactions. Merchants and partners in the EMEA region can use this attribute to note transactions that attract turn-over tax.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[a-zA-Z0-9-]*$` | +| `instrument_type` | `str` | Optional | A high-level classification of the type of financial instrument that was used to fund a payment. The pattern is not provided because the value is defined by an external party. E.g. PAYPAL, CREDIT_CARD, DEBIT_CARD, APPLE_PAY, BANK , VENMO ,Pay Upon Invoice, Pay Later or Alternative Payment Methods (APM).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | +| `instrument_sub_type` | `str` | Optional | A finer-grained classification of the financial instrument that was used to fund a payment. For example, `Visa card` or a `Mastercard` for a credit card, BANKCARD ,DISCOVER etc. The pattern is not provided because the value is defined by an external party.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | + +## Example (as JSON) + +```json +{ + "paypal_account_id": "paypal_account_id6", + "transaction_id": "transaction_id2", + "paypal_reference_id": "paypal_reference_id4", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code8" +} +``` + diff --git a/doc/models/transaction-search-error-details.md b/doc/models/transaction-search-error-details.md new file mode 100644 index 0000000..d8f9db9 --- /dev/null +++ b/doc/models/transaction-search-error-details.md @@ -0,0 +1,31 @@ + +# Transaction Search Error Details + +The error details. Required for client-side `4XX` errors. + +## Structure + +`TransactionSearchErrorDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | `str` | Optional | The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors. | +| `value` | `str` | Optional | The value of the field that caused the error. | +| `location` | `str` | Optional | The location of the field that caused the error. Value is `body`, `path`, or `query`.

**Default**: `'body'` | +| `issue` | `str` | Required | The unique, fine-grained application-level error code. | +| `description` | `str` | Optional | The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value. | + +## Example (as JSON) + +```json +{ + "location": "body", + "issue": "issue2", + "field": "field0", + "value": "value8", + "description": "description6" +} +``` + diff --git a/doc/models/transactions-list.md b/doc/models/transactions-list.md new file mode 100644 index 0000000..7d70cdc --- /dev/null +++ b/doc/models/transactions-list.md @@ -0,0 +1,80 @@ + +# Transactions List + +The list transactions for a subscription request details. + +## Structure + +`TransactionsList` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transactions` | [`List[SubscriptionTransactionDetails]`](../../doc/models/subscription-transaction-details.md) | Optional | An array of transactions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | +| `total_items` | `int` | Optional | The total number of items.

**Constraints**: `>= 0`, `<= 500000000` | +| `total_pages` | `int` | Optional | The total number of pages.

**Constraints**: `>= 0`, `<= 100000000` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "transactions": [ + { + "status": "PARTIALLY_REFUNDED", + "id": "id8", + "amount_with_breakdown": { + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } + }, + "payer_name": { + "prefix": "prefix8", + "given_name": "given_name2", + "surname": "surname8", + "middle_name": "middle_name0", + "suffix": "suffix0" + }, + "payer_email": "payer_email6", + "time": "time8" + } + ], + "total_items": 254, + "total_pages": 34, + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/update-pricing-scheme.md b/doc/models/update-pricing-scheme.md new file mode 100644 index 0000000..e36d6a8 --- /dev/null +++ b/doc/models/update-pricing-scheme.md @@ -0,0 +1,59 @@ + +# Update Pricing Scheme + +The update pricing scheme request details. + +## Structure + +`UpdatePricingScheme` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `billing_cycle_sequence` | `int` | Required | The billing cycle sequence.

**Constraints**: `>= 1`, `<= 99` | +| `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Required | The pricing scheme details. | + +## Example (as JSON) + +```json +{ + "billing_cycle_sequence": 99, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } +} +``` + diff --git a/doc/models/update-pricing-schemes-request.md b/doc/models/update-pricing-schemes-request.md new file mode 100644 index 0000000..0c863d9 --- /dev/null +++ b/doc/models/update-pricing-schemes-request.md @@ -0,0 +1,62 @@ + +# Update Pricing Schemes Request + +The update pricing scheme request details. + +## Structure + +`UpdatePricingSchemesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricing_schemes` | [`List[UpdatePricingScheme]`](../../doc/models/update-pricing-scheme.md) | Required | An array of pricing schemes.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `99` | + +## Example (as JSON) + +```json +{ + "pricing_schemes": [ + { + "billing_cycle_sequence": 34, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } + } + ] +} +``` + diff --git a/doc/models/vault-apple-pay-request.md b/doc/models/vault-apple-pay-request.md new file mode 100644 index 0000000..61d9c11 --- /dev/null +++ b/doc/models/vault-apple-pay-request.md @@ -0,0 +1,36 @@ + +# Vault Apple Pay Request + +A resource representing a request to vault Apple Pay. + +## Structure + +`VaultApplePayRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `token` | `str` | Optional | Encrypted Apple Pay token, containing card information. This token would be base64 encoded.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | +| `card` | [`ApplePayRequestCard`](../../doc/models/apple-pay-request-card.md) | Optional | The payment card to be used to fund a payment. Can be a credit or debit card. | + +## Example (as JSON) + +```json +{ + "token": "token4", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } +} +``` + diff --git a/doc/models/setup-token-card-experience-context.md b/doc/models/vault-card-experience-context.md similarity index 65% rename from doc/models/setup-token-card-experience-context.md rename to doc/models/vault-card-experience-context.md index ebd7852..a5b99a1 100644 --- a/doc/models/setup-token-card-experience-context.md +++ b/doc/models/vault-card-experience-context.md @@ -1,31 +1,33 @@ -# Setup Token Card Experience Context +# Vault Card Experience Context -Customizes the Vault creation flow experience for your customers. +A resource representing an experience context of vault a card. ## Structure -`SetupTokenCardExperienceContext` +`VaultCardExperienceContext` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.*$` | +| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `str` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | | `return_url` | `str` | Optional | The URL where the customer is redirected after customer approves leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | | `cancel_url` | `str` | Optional | The URL where the customer is redirected after customer cancels or leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | -| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | Vault Instruction on action to be performed after a successful payer approval.

**Default**: `'ON_CREATE_PAYMENT_TOKENS'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `'CONTINUE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | ## Example (as JSON) ```json { - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", - "brand_name": "brand_name2", - "locale": "locale6", + "user_action": "CONTINUE", + "brand_name": "brand_name4", + "locale": "locale8", "return_url": "return_url4", - "cancel_url": "cancel_url6" + "cancel_url": "cancel_url8", + "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" } ``` diff --git a/doc/models/vault-experience-context.md b/doc/models/vault-experience-context.md index 7bac050..f901ff4 100644 --- a/doc/models/vault-experience-context.md +++ b/doc/models/vault-experience-context.md @@ -11,19 +11,21 @@ Customizes the Vault creation flow experience for your customers. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.*$` | +| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `str` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | | `return_url` | `str` | Optional | The URL where the customer is redirected after customer approves leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | | `cancel_url` | `str` | Optional | The URL where the customer is redirected after customer cancels or leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | -| `shipping_preference` | [`OrderApplicationContextShippingPreference`](../../doc/models/order-application-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | Vault Instruction on action to be performed after a successful payer approval.

**Default**: `'ON_CREATE_PAYMENT_TOKENS'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `app_switch_context` | [`AppSwitchContext`](../../doc/models/app-switch-context.md) | Optional | Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. | +| `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `'CONTINUE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | ## Example (as JSON) ```json { "shipping_preference": "GET_FROM_FILE", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", + "user_action": "CONTINUE", "brand_name": "brand_name0", "locale": "locale4", "return_url": "return_url2", diff --git a/doc/models/vault-paypal-wallet-request.md b/doc/models/vault-paypal-wallet-request.md index 9911763..8360cee 100644 --- a/doc/models/vault-paypal-wallet-request.md +++ b/doc/models/vault-paypal-wallet-request.md @@ -18,7 +18,7 @@ A resource representing a request to vault PayPal Wallet. | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `billing_plan` | [`Plan`](../../doc/models/plan.md) | Optional | The merchant level Recurring Billing plan metadata for the Billing Agreement. | -| `experience_context` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | +| `experience_context` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | A resource representing an experience context of vault PayPal Wallet. | ## Example (as JSON) @@ -31,6 +31,7 @@ A resource representing a request to vault PayPal Wallet. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vault-user-action.md b/doc/models/vault-user-action.md new file mode 100644 index 0000000..a7d5044 --- /dev/null +++ b/doc/models/vault-user-action.md @@ -0,0 +1,16 @@ + +# Vault User Action + +User Action on action to be performed after a successful payer approval. + +## Enumeration + +`VaultUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `SETUP_NOW` | After you redirect the customer to the PayPal payment page, a Setup Now button appears. Use this option when no additional inputs are needed from merchant site and to create the billing agreement immediately when the customer clicks Setup Now. | +| `CONTINUE` | After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when you want to redirect the customer from the completed payment page to the merchant site for additional inputs without immediately creating the billing agreement. | + diff --git a/doc/models/vault-venmo-experience-context.md b/doc/models/vault-venmo-experience-context.md deleted file mode 100644 index 6f3563e..0000000 --- a/doc/models/vault-venmo-experience-context.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Vault Venmo Experience Context - -Customizes the Vault creation flow experience for your customers. - -## Structure - -`VaultVenmoExperienceContext` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.*$` | -| `shipping_preference` | [`OrderApplicationContextShippingPreference`](../../doc/models/order-application-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | Vault Instruction on action to be performed after a successful payer approval.

**Default**: `'ON_CREATE_PAYMENT_TOKENS'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | - -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", - "brand_name": "brand_name0" -} -``` - diff --git a/doc/models/vault-venmo-request.md b/doc/models/vault-venmo-request.md index 132ae57..c7e63d5 100644 --- a/doc/models/vault-venmo-request.md +++ b/doc/models/vault-venmo-request.md @@ -1,6 +1,8 @@ # Vault Venmo Request +A resource representing a request to vault Venmo. + ## Structure `VaultVenmoRequest` @@ -15,7 +17,7 @@ | `permit_multiple_payment_tokens` | `bool` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `False` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `experience_context` | [`VaultVenmoExperienceContext`](../../doc/models/vault-venmo-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | +| `experience_context` | [`VenmoExperienceContext`](../../doc/models/venmo-experience-context.md) | Optional | A resource representing an experience context of vault a venmo account. | ## Example (as JSON) @@ -28,6 +30,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md index f8727f9..830ecfc 100644 --- a/doc/models/vaulted-digital-wallet-shipping-details.md +++ b/doc/models/vaulted-digital-wallet-shipping-details.md @@ -12,6 +12,7 @@ The shipping details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | +| `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | | `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `mtype` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | @@ -23,6 +24,7 @@ The shipping details. "name": { "full_name": "full_name6" }, + "email_address": "email_address6", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vaulted-digital-wallet.md b/doc/models/vaulted-digital-wallet.md index 67ca276..b8c4a9a 100644 --- a/doc/models/vaulted-digital-wallet.md +++ b/doc/models/vaulted-digital-wallet.md @@ -29,6 +29,7 @@ Resource consolidating common request and response attributes for vaulting a Dig "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/venmo-experience-context.md b/doc/models/venmo-experience-context.md new file mode 100644 index 0000000..93e20ea --- /dev/null +++ b/doc/models/venmo-experience-context.md @@ -0,0 +1,29 @@ + +# Venmo Experience Context + +A resource representing an experience context of vault a venmo account. + +## Structure + +`VenmoExperienceContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand_name` | `str` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `'CONTINUE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "user_action": "CONTINUE", + "brand_name": "brand_name0", + "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" +} +``` + diff --git a/doc/models/venmo-payment-token.md b/doc/models/venmo-payment-token.md index 4eed4fc..04b7bee 100644 --- a/doc/models/venmo-payment-token.md +++ b/doc/models/venmo-payment-token.md @@ -1,6 +1,8 @@ # Venmo Payment Token +Full representation of a Venmo Payment Token. + ## Structure `VenmoPaymentToken` @@ -15,7 +17,7 @@ | `permit_multiple_payment_tokens` | `bool` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `False` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `email_address` | `str` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `email_address` | `str` | Optional | The internationalized email address.
Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.


**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `payer_id` | `str` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | @@ -33,6 +35,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/venmo-vault-response-status.md b/doc/models/venmo-vault-response-status.md new file mode 100644 index 0000000..e5371c0 --- /dev/null +++ b/doc/models/venmo-vault-response-status.md @@ -0,0 +1,17 @@ + +# Venmo Vault Response Status + +The vault status. + +## Enumeration + +`VenmoVaultResponseStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `VAULTED` | The payment source has been saved in your customer's vault. This vault status reflects `/v3/vault` status. | +| `CREATED` | DEPRECATED. The payment source has been saved in your customer's vault. This status applies to deprecated integration patterns and will not be returned for v3/vault integrations. | +| `APPROVED` | Customer has approved the action of saving the specified payment_source into their vault. Use v3/vault/payment-tokens with given setup_token to save the payment source in the vault | + diff --git a/doc/models/venmo-vault-response.md b/doc/models/venmo-vault-response.md new file mode 100644 index 0000000..cd41eed --- /dev/null +++ b/doc/models/venmo-vault-response.md @@ -0,0 +1,58 @@ + +# Venmo Vault Response + +The details about a saved venmo payment source. + +## Structure + +`VenmoVaultResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | The PayPal-generated ID for the saved payment source.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `status` | [`VenmoVaultResponseStatus`](../../doc/models/venmo-vault-response-status.md) | Optional | The vault status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `customer` | [`CustomerInformation`](../../doc/models/customer-information.md) | Optional | This object represents a merchant’s customer, allowing them to store contact details, and track all payments associated with the same customer. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "status": "CREATED", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "name": { + "given_name": "given_name2", + "surname": "surname8" + } + } +} +``` + diff --git a/doc/models/venmo-wallet-attributes-response.md b/doc/models/venmo-wallet-attributes-response.md index 56c9a29..17faf29 100644 --- a/doc/models/venmo-wallet-attributes-response.md +++ b/doc/models/venmo-wallet-attributes-response.md @@ -11,7 +11,7 @@ Additional attributes associated with the use of a Venmo Wallet. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `vault` | [`VaultResponse`](../../doc/models/vault-response.md) | Optional | The details about a saved payment source. | +| `vault` | [`VenmoVaultResponse`](../../doc/models/venmo-vault-response.md) | Optional | The details about a saved venmo payment source. | ## Example (as JSON) @@ -20,20 +20,27 @@ Additional attributes associated with the use of a Venmo Wallet. "vault": { "id": "id6", "status": "APPROVED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, "links": [ { "href": "href6", "rel": "rel0", "method": "HEAD" } - ] + ], + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "name": { + "given_name": "given_name2", + "surname": "surname8" + } + } } } ``` diff --git a/doc/models/shipping-preference.md b/doc/models/venmo-wallet-experience-context-shipping-preference.md similarity index 83% rename from doc/models/shipping-preference.md rename to doc/models/venmo-wallet-experience-context-shipping-preference.md index c724a22..f1c53d2 100644 --- a/doc/models/shipping-preference.md +++ b/doc/models/venmo-wallet-experience-context-shipping-preference.md @@ -1,11 +1,11 @@ -# Shipping Preference +# Venmo Wallet Experience Context Shipping Preference The location from which the shipping address is derived. ## Enumeration -`ShippingPreference` +`VenmoWalletExperienceContextShippingPreference` ## Fields diff --git a/doc/models/venmo-wallet-experience-context-user-action.md b/doc/models/venmo-wallet-experience-context-user-action.md new file mode 100644 index 0000000..7f111b4 --- /dev/null +++ b/doc/models/venmo-wallet-experience-context-user-action.md @@ -0,0 +1,16 @@ + +# Venmo Wallet Experience Context User Action + +Configures a Continue or Pay Now checkout flow. + +## Enumeration + +`VenmoWalletExperienceContextUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CONTINUE` | After you redirect the customer to the Venmo payment page, a Continue button appears. Use this option when the final amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant page without processing the payment. | +| `PAY_NOW` | After you redirect the customer to the Venmo payment page, a Pay Now button appears. Use this option when the final amount is known when the checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. | + diff --git a/doc/models/venmo-wallet-experience-context.md b/doc/models/venmo-wallet-experience-context.md index 8ac6dd9..e061ca0 100644 --- a/doc/models/venmo-wallet-experience-context.md +++ b/doc/models/venmo-wallet-experience-context.md @@ -12,14 +12,16 @@ Customizes the buyer experience during the approval process for payment with Ven | Name | Type | Tags | Description | | --- | --- | --- | --- | | `brand_name` | `str` | Optional | The business name of the merchant. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | -| `shipping_preference` | [`ShippingPreference`](../../doc/models/shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`VenmoWalletExperienceContextShippingPreference`](../../doc/models/venmo-wallet-experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `'GET_FROM_FILE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `order_update_callback_config` | [`CallbackConfiguration`](../../doc/models/callback-configuration.md) | Optional | CallBack Configuration that the merchant can provide to PayPal/Venmo. | +| `user_action` | [`VenmoWalletExperienceContextUserAction`](../../doc/models/venmo-wallet-experience-context-user-action.md) | Optional | Configures a Continue or Pay Now checkout flow.

**Default**: `'CONTINUE'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | ## Example (as JSON) ```json { "shipping_preference": "GET_FROM_FILE", + "user_action": "CONTINUE", "brand_name": "brand_name6", "order_update_callback_config": { "callback_events": [ diff --git a/doc/models/venmo-wallet-request.md b/doc/models/venmo-wallet-request.md index b188627..566f857 100644 --- a/doc/models/venmo-wallet-request.md +++ b/doc/models/venmo-wallet-request.md @@ -32,7 +32,8 @@ Information needed to pay using Venmo. "SHIPPING_OPTIONS" ], "callback_url": "callback_url6" - } + }, + "user_action": "CONTINUE" }, "attributes": { "customer": { diff --git a/doc/models/venmo-wallet-response.md b/doc/models/venmo-wallet-response.md index 0689609..d1d3488 100644 --- a/doc/models/venmo-wallet-response.md +++ b/doc/models/venmo-wallet-response.md @@ -17,12 +17,14 @@ Venmo wallet response. | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `phone_number` | [`PhoneNumber`](../../doc/models/phone-number.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | +| `return_flow` | [`ReturnFlow`](../../doc/models/return-flow.md) | Optional | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App.

**Default**: `'AUTO'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | | `attributes` | [`VenmoWalletAttributesResponse`](../../doc/models/venmo-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a Venmo Wallet. | ## Example (as JSON) ```json { + "return_flow": "AUTO", "email_address": "email_address6", "account_id": "account_id8", "user_name": "user_name2", diff --git a/doc/proxy-settings.md b/doc/proxy-settings.md new file mode 100644 index 0000000..afdc4f1 --- /dev/null +++ b/doc/proxy-settings.md @@ -0,0 +1,30 @@ + +# ProxySettings + +Represents the proxy server configurations for API calls. + +## Properties + +| Name | Type | Tag | Description | +| --- | --- | --- | --- | +| address | `str` | required | The proxy server URL. | +| port | `int` | optional | The port to connect to the proxy server. | +| username | `str` | optional | Username for proxy authentication. | +| password | `str` | optional | Password for proxy authentication. | + +## Usage Example + +```python +from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient +from paypalserversdk.http.proxy_settings import ProxySettings + +client = PaypalServersdkClient( + proxy_settings=ProxySettings( + address='http://localhost', + port=8888, + username='user', + password='pass' + ) +) +``` + diff --git a/paypalserversdk/__init__.py b/paypalserversdk/__init__.py index e5ca627..7f3fc32 100644 --- a/paypalserversdk/__init__.py +++ b/paypalserversdk/__init__.py @@ -7,4 +7,5 @@ 'logging', 'models', 'paypal_serversdk_client', + 'utilities', ] diff --git a/paypalserversdk/configuration.py b/paypalserversdk/configuration.py index 108e909..1b051fa 100644 --- a/paypalserversdk/configuration.py +++ b/paypalserversdk/configuration.py @@ -40,7 +40,7 @@ def client_credentials_auth_credentials(self): def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, timeout=60, max_retries=0, backoff_factor=2, - retry_statuses=None, retry_methods=None, + retry_statuses=None, retry_methods=None, proxy_settings=None, logging_configuration=None, environment=Environment.SANDBOX, client_credentials_auth_credentials=None): if retry_methods is None: @@ -49,10 +49,15 @@ def __init__(self, http_client_instance=None, if retry_statuses is None: retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] - super().__init__(http_client_instance, - override_http_client_configuration, http_call_back, - timeout, max_retries, backoff_factor, retry_statuses, - retry_methods, logging_configuration) + super().__init__( + http_client_instance=http_client_instance, + override_http_client_configuration=override_http_client_configuration, + http_call_back=http_call_back, timeout=timeout, + max_retries=max_retries, backoff_factor=backoff_factor, + retry_statuses=retry_statuses, retry_methods=retry_methods, + proxy_settings=proxy_settings, + logging_configuration=logging_configuration + ) # Current API environment self._environment = environment @@ -65,7 +70,7 @@ def __init__(self, http_client_instance=None, def clone_with(self, http_client_instance=None, override_http_client_configuration=None, http_call_back=None, timeout=None, max_retries=None, backoff_factor=None, - retry_statuses=None, retry_methods=None, + retry_statuses=None, retry_methods=None, proxy_settings=None, logging_configuration=None, environment=None, client_credentials_auth_credentials=None): http_client_instance = http_client_instance or self.http_client_instance @@ -76,6 +81,7 @@ def clone_with(self, http_client_instance=None, backoff_factor = backoff_factor or self.backoff_factor retry_statuses = retry_statuses or self.retry_statuses retry_methods = retry_methods or self.retry_methods + proxy_settings = proxy_settings or self.proxy_settings logging_configuration = logging_configuration or self.logging_configuration environment = environment or self.environment client_credentials_auth_credentials = client_credentials_auth_credentials or self.client_credentials_auth_credentials @@ -84,7 +90,7 @@ def clone_with(self, http_client_instance=None, override_http_client_configuration=override_http_client_configuration, http_call_back=http_call_back, timeout=timeout, max_retries=max_retries, backoff_factor=backoff_factor, retry_statuses=retry_statuses, - retry_methods=retry_methods, + retry_methods=retry_methods, proxy_settings=proxy_settings, logging_configuration=logging_configuration, environment=environment, client_credentials_auth_credentials=client_credentials_auth_credentials ) @@ -96,7 +102,8 @@ def create_http_client(self): retry_methods=self.retry_methods, http_client_instance=self.http_client_instance, override_http_client_configuration=self.override_http_client_configuration, - response_factory=self.http_response_factory + response_factory=self.http_response_factory, + proxies=self.proxy_settings.to_proxies() if self.proxy_settings else None ) # All the environments the SDK can run in diff --git a/paypalserversdk/controllers/__init__.py b/paypalserversdk/controllers/__init__.py index a377d23..f543263 100644 --- a/paypalserversdk/controllers/__init__.py +++ b/paypalserversdk/controllers/__init__.py @@ -3,5 +3,7 @@ 'orders_controller', 'payments_controller', 'vault_controller', + 'transaction_search_controller', + 'subscriptions_controller', 'o_auth_authorization_controller', ] diff --git a/paypalserversdk/controllers/base_controller.py b/paypalserversdk/controllers/base_controller.py index b28240c..ac32c76 100644 --- a/paypalserversdk/controllers/base_controller.py +++ b/paypalserversdk/controllers/base_controller.py @@ -30,7 +30,7 @@ class BaseController(object): @staticmethod def user_agent(): - return 'PayPal REST API Python SDK, Version: 1.1.0, on OS {os-info}' + return 'PayPal REST API Python SDK, Version: 2.0.0, on OS {os-info}' @staticmethod def user_agent_parameters(): diff --git a/paypalserversdk/controllers/orders_controller.py b/paypalserversdk/controllers/orders_controller.py index 1764b31..fef902a 100644 --- a/paypalserversdk/controllers/orders_controller.py +++ b/paypalserversdk/controllers/orders_controller.py @@ -16,8 +16,8 @@ from apimatic_core.types.parameter import Parameter from paypalserversdk.http.http_method_enum import HttpMethodEnum from apimatic_core.authentication.multiple.single_auth import Single -from paypalserversdk.models.order_authorize_response import OrderAuthorizeResponse from paypalserversdk.models.order import Order +from paypalserversdk.models.order_authorize_response import OrderAuthorizeResponse from paypalserversdk.exceptions.error_exception import ErrorException @@ -27,71 +27,15 @@ class OrdersController(BaseController): def __init__(self, config): super(OrdersController, self).__init__(config) - def patch_order(self, - options=dict()): - """Does a PATCH request to /v2/checkout/orders/{id}. + def create_order(self, + options=dict()): + """Does a POST request to /v2/checkout/orders. - Updates an order with a `CREATED` or `APPROVED` status. You cannot - update an order with the `COMPLETED` status.

To make an - update, you must provide a `reference_id`. If you omit this value with - an order that contains only one purchase unit, PayPal sets the value - to `default` which enables you to use the path: - \"/purchase_units/@reference_id=='default'/{attribute-or-object}\ - ". Merchants and partners can add Level 2 and 3 data to + Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more - information about processing payments, see - checkout or multiparty checkout.
Note: - For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes - or - objects:

-
AttributeOpNotes< - /th>
intentreplace -
payerreplace, - addUsing replace op for payer will replace the - whole payer object with the value sent in - request.
purchase_unitsreplace, - add
purchase_units[].custom_idreplace, add, - remove
purchase_units[].descriptionreplace, add, - remove
purchase_units[].payee.emailreplace
purchase_units[].sh - ipping.namereplace, - add
purchase_units[].shipping.email_add - ressreplace, - add
purchase_units[].shipping.phone_num - berreplace, - add
purchase_units[].shipping.optionsreplace, - add
purchase_units[].shipping.addressreplace, - add
purchase_units[].shipping.typereplace, - add
purchase_units[].soft_descriptorreplace, - remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, - remove
purchase_units[].invoice_idreplace, add, - remove
purchase_units[].payment_instruc - tionreplace
purchase_un - its[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is - INSTANT.
purchase_units[].payment_i - nstruction.payee_receivable_fx_rate_idreplace, add, - remove
purchase_units[].payment_instruc - tion.platform_feesreplace, add, - remove
purchase_units[].supplementary_d - ata.airlinereplace, add, - remove
purchase_units[].supplementary_d - ata.cardreplace, add, - remove
application_context.client_confi - gurationreplace, add
+ information about processing payments, see checkout or multiparty + checkout. Note: For error handling and troubleshooting, see Orders v2 + errors. Args: options (dict, optional): Key-value pairs for any of the @@ -100,22 +44,41 @@ def patch_order(self, being the key and their desired values being the value. A list of parameters that can be used are:: - id -- str -- The ID of the order to update. + body -- OrderRequest -- The request body parameter. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. + paypal_request_id -- str -- The server stores keys for 6 + hours. The API callers can request the times to up to + 72 hours by speaking to their Account Manager. It is + mandatory for all single-step create order calls (E.g. + Create Order Request with payment source information + like Card, PayPal.vault_id, + PayPal.billing_agreement_id, etc). + paypal_partner_attribution_id -- str -- The request header + parameter. + paypal_client_metadata_id -- str -- The request header + parameter. + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, status + and HATEOAS links. return=representation. The server + returns a complete resource representation, including + the current state of the resource. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. - body -- List[Patch] -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A - successful request returns the HTTP `204 No Content` status - code with an empty object in the JSON response body. + successful response to an idempotent request returns the HTTP + `200 OK` status code with a JSON response body that shows + order details. Raises: ApiException: When an error occurs while fetching the data from @@ -127,45 +90,53 @@ def patch_order(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders/{id}') - .http_method(HttpMethodEnum.PATCH) - .template_param(Parameter() - .key('id') - .value(options.get('id', None)) - .should_encode(True)) + .path('/v2/checkout/orders') + .http_method(HttpMethodEnum.POST) .header_param(Parameter() .key('Content-Type') .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .header_param(Parameter() + .key('PayPal-Partner-Attribution-Id') + .value(options.get('paypal_partner_attribution_id', None))) + .header_param(Parameter() + .key('PayPal-Client-Metadata-Id') + .value(options.get('paypal_client_metadata_id', None))) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) - .body_param(Parameter() - .value(options.get('body', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(Order.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) - .local_error('404', 'The specified resource does not exist.', ErrorException) .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('default', 'The error response.', ErrorException) ).execute() - def authorize_order(self, - options=dict()): - """Does a POST request to /v2/checkout/orders/{id}/authorize. + def get_order(self, + options=dict()): + """Does a GET request to /v2/checkout/orders/{id}. - Authorizes payment for an order. To successfully authorize payment for - an order, the buyer must first approve the order or a valid - payment_source must be provided in the request. A buyer can approve - the order upon being redirected to the rel:approve URL that was - returned in the HATEOAS links in the create order response. Note: For - error handling and troubleshooting, see Orders v2 errors. + Shows details for an order, by ID. Note: For error handling and + troubleshooting, see Orders v2 errors. Args: options (dict, optional): Key-value pairs for any of the @@ -174,41 +145,24 @@ def authorize_order(self, being the key and their desired values being the value. A list of parameters that can be used are:: - id -- str -- The ID of the order for which to authorize. + id -- str -- The ID of the order for which to show details. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. - paypal_request_id -- str -- The server stores keys for 6 - hours. The API callers can request the times to up to - 72 hours by speaking to their Account Manager. It is - mandatory for all single-step create order calls (E.g. - Create Order Request with payment source information - like Card, PayPal.vault_id, - PayPal.billing_agreement_id, etc). - prefer -- str -- The preferred server response upon - successful completion of the request. Value is: - return=minimal. The server returns a minimal response - to optimize communication between the API caller and - the server. A minimal response includes the id, status - and HATEOAS links. return=representation. The server - returns a complete resource representation, including - the current state of the resource. - paypal_client_metadata_id -- str -- The request header - parameter. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. - body -- OrderAuthorizeRequest -- The request body - parameter. + fields -- str -- A comma-separated list of fields that + should be returned for the order. Valid filter field + is `payment_source`. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A - successful response to an idempotent request returns the HTTP - `200 OK` status code with a JSON response body that shows - authorized payment details. + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows order details. Raises: ApiException: When an error occurs while fetching the data from @@ -220,60 +174,100 @@ def authorize_order(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders/{id}/authorize') - .http_method(HttpMethodEnum.POST) + .path('/v2/checkout/orders/{id}') + .http_method(HttpMethodEnum.GET) .template_param(Parameter() .key('id') .value(options.get('id', None)) .should_encode(True)) - .header_param(Parameter() - .key('Content-Type') - .value('application/json')) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) - .header_param(Parameter() - .key('PayPal-Request-Id') - .value(options.get('paypal_request_id', None))) - .header_param(Parameter() - .key('Prefer') - .value(options.get('prefer', None))) - .header_param(Parameter() - .key('PayPal-Client-Metadata-Id') - .value(options.get('paypal_client_metadata_id', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) - .body_param(Parameter() - .value(options.get('body', None))) + .query_param(Parameter() + .key('fields') + .value(options.get('fields', None))) .header_param(Parameter() .key('accept') .value('application/json')) - .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(OrderAuthorizeResponse.from_dictionary) + .deserialize_into(Order.from_dictionary) .is_api_response(True) - .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) - .local_error('403', 'The authorized payment failed due to insufficient permissions.', ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) - .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) - .local_error('500', 'An internal server error has occurred.', ErrorException) .local_error('default', 'The error response.', ErrorException) ).execute() - def update_order_tracking(self, - options=dict()): - """Does a PATCH request to /v2/checkout/orders/{id}/trackers/{tracker_id}. + def patch_order(self, + options=dict()): + """Does a PATCH request to /v2/checkout/orders/{id}. - Updates or cancels the tracking information for a PayPal order, by ID. - Updatable attributes or objects: Attribute Op Notes items replace - Using replace op for items will replace the entire items object with - the value sent in request. notify_payer replace, add status replace - Only patching status to CANCELLED is currently supported. + Updates an order with a `CREATED` or `APPROVED` status. You cannot + update an order with the `COMPLETED` status.

To make an + update, you must provide a `reference_id`. If you omit this value with + an order that contains only one purchase unit, PayPal sets the value + to `default` which enables you to use the path: + \"/purchase_units/@reference_id=='default'/{attribute-or-object}\ + ". Merchants and partners can add Level 2 and 3 data to + payments to reduce risk and payment processing costs. For more + information about processing payments, see + checkout or multiparty checkout.
Note: + For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes + or + objects:

+
AttributeOpNotes< + /th>
intentreplace +
payerreplace, + addUsing replace op for payer will replace the + whole payer object with the value sent in + request.
purchase_unitsreplace, + add
purchase_units[].custom_idreplace, add, + remove
purchase_units[].descriptionreplace, add, + remove
purchase_units[].payee.emailreplace
purchase_units[].sh + ipping.namereplace, + add
purchase_units[].shipping.email_add + ressreplace, + add
purchase_units[].shipping.phone_num + berreplace, + add
purchase_units[].shipping.optionsreplace, + add
purchase_units[].shipping.addressreplace, + add
purchase_units[].shipping.typereplace, + add
purchase_units[].soft_descriptorreplace, + remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, + remove
purchase_units[].invoice_idreplace, add, + remove
purchase_units[].payment_instruc + tionreplace
purchase_un + its[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is + INSTANT.
purchase_units[].payment_i + nstruction.payee_receivable_fx_rate_idreplace, add, + remove
purchase_units[].payment_instruc + tion.platform_feesreplace, add, + remove
purchase_units[].supplementary_d + ata.airlinereplace, add, + remove
purchase_units[].supplementary_d + ata.cardreplace, add, + remove
application_context.client_confi + gurationreplace, add
Args: options (dict, optional): Key-value pairs for any of the @@ -282,9 +276,12 @@ def update_order_tracking(self, being the key and their desired values being the value. A list of parameters that can be used are:: - id -- str -- The ID of the order that the tracking - information is associated with. - tracker_id -- str -- The order tracking ID. + id -- str -- The ID of the order to update. + paypal_mock_response -- str -- PayPal's REST API uses a + request header to invoke negative testing in the + sandbox. This header configures the sandbox into a + negative testing state for transactions that include + the merchant. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. @@ -306,19 +303,18 @@ def update_order_tracking(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders/{id}/trackers/{tracker_id}') + .path('/v2/checkout/orders/{id}') .http_method(HttpMethodEnum.PATCH) .template_param(Parameter() .key('id') .value(options.get('id', None)) .should_encode(True)) - .template_param(Parameter() - .key('tracker_id') - .value(options.get('tracker_id', None)) - .should_encode(True)) .header_param(Parameter() .key('Content-Type') .value('application/json')) + .header_param(Parameter() + .key('PayPal-Mock-Response') + .value(options.get('paypal_mock_response', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) @@ -330,18 +326,18 @@ def update_order_tracking(self, ResponseHandler() .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) - .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) - .local_error('500', 'An internal server error has occurred.', ErrorException) .local_error('default', 'The error response.', ErrorException) ).execute() - def create_order_tracking(self, - options=dict()): - """Does a POST request to /v2/checkout/orders/{id}/track. + def confirm_order(self, + options=dict()): + """Does a POST request to /v2/checkout/orders/{id}/confirm-payment-source. - Adds tracking information for an Order. + Payer confirms their intent to pay for the the Order with the given + payment source. Args: options (dict, optional): Key-value pairs for any of the @@ -350,19 +346,29 @@ def create_order_tracking(self, being the key and their desired values being the value. A list of parameters that can be used are:: - id -- str -- The ID of the order that the tracking - information is associated with. - body -- OrderTrackerRequest -- The request body parameter. + id -- str -- The ID of the order for which the payer + confirms their intent to pay. + paypal_client_metadata_id -- str -- The request header + parameter. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, status + and HATEOAS links. return=representation. The server + returns a complete resource representation, including + the current state of the resource. + body -- ConfirmOrderRequest -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A - successful response to an idempotent request returns the HTTP - `200 OK` status code with a JSON response body that shows - tracker details. + successful request indicates that the payment source was added + to the Order. A successful request returns the HTTP `200 OK` + status code with a JSON response body that shows order details. Raises: ApiException: When an error occurs while fetching the data from @@ -374,7 +380,7 @@ def create_order_tracking(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders/{id}/track') + .path('/v2/checkout/orders/{id}/confirm-payment-source') .http_method(HttpMethodEnum.POST) .template_param(Parameter() .key('id') @@ -383,11 +389,17 @@ def create_order_tracking(self, .header_param(Parameter() .key('Content-Type') .value('application/json')) - .body_param(Parameter() - .value(options.get('body', None))) + .header_param(Parameter() + .key('PayPal-Client-Metadata-Id') + .value(options.get('paypal_client_metadata_id', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) + .body_param(Parameter() + .value(options.get('body', None))) .header_param(Parameter() .key('accept') .value('application/json')) @@ -400,21 +412,21 @@ def create_order_tracking(self, .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('404', 'The specified resource does not exist.', ErrorException) .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException) .local_error('default', 'The error response.', ErrorException) ).execute() - def create_order(self, - options=dict()): - """Does a POST request to /v2/checkout/orders. + def authorize_order(self, + options=dict()): + """Does a POST request to /v2/checkout/orders/{id}/authorize. - Creates an order. Merchants and partners can add Level 2 and 3 data to - payments to reduce risk and payment processing costs. For more - information about processing payments, see checkout or multiparty - checkout. Note: For error handling and troubleshooting, see Orders v2 - errors. + Authorizes payment for an order. To successfully authorize payment for + an order, the buyer must first approve the order or a valid + payment_source must be provided in the request. A buyer can approve + the order upon being redirected to the rel:approve URL that was + returned in the HATEOAS links in the create order response. Note: For + error handling and troubleshooting, see Orders v2 errors. Args: options (dict, optional): Key-value pairs for any of the @@ -423,7 +435,7 @@ def create_order(self, being the key and their desired values being the value. A list of parameters that can be used are:: - body -- OrderRequest -- The request body parameter. + id -- str -- The ID of the order for which to authorize. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a @@ -436,10 +448,6 @@ def create_order(self, Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc). - paypal_partner_attribution_id -- str -- The request header - parameter. - paypal_client_metadata_id -- str -- The request header - parameter. prefer -- str -- The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response @@ -448,16 +456,20 @@ def create_order(self, and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource. + paypal_client_metadata_id -- str -- The request header + parameter. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. + body -- OrderAuthorizeRequest -- The request body + parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A successful response to an idempotent request returns the HTTP `200 OK` status code with a JSON response body that shows - order details. + authorized payment details. Raises: ApiException: When an error occurs while fetching the data from @@ -469,13 +481,15 @@ def create_order(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders') + .path('/v2/checkout/orders/{id}/authorize') .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) .header_param(Parameter() .key('Content-Type') .value('application/json')) - .body_param(Parameter() - .value(options.get('body', None))) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) @@ -483,17 +497,16 @@ def create_order(self, .key('PayPal-Request-Id') .value(options.get('paypal_request_id', None))) .header_param(Parameter() - .key('PayPal-Partner-Attribution-Id') - .value(options.get('paypal_partner_attribution_id', None))) + .key('Prefer') + .value(options.get('prefer', None))) .header_param(Parameter() .key('PayPal-Client-Metadata-Id') .value(options.get('paypal_client_metadata_id', None))) - .header_param(Parameter() - .key('Prefer') - .value(options.get('prefer', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) + .body_param(Parameter() + .value(options.get('body', None))) .header_param(Parameter() .key('accept') .value('application/json')) @@ -502,11 +515,14 @@ def create_order(self, ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(Order.from_dictionary) + .deserialize_into(OrderAuthorizeResponse.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) + .local_error('403', 'The authorized payment failed due to insufficient permissions.', ErrorException) + .local_error('404', 'The specified resource does not exist.', ErrorException) .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) + .local_error('500', 'An internal server error has occurred.', ErrorException) .local_error('default', 'The error response.', ErrorException) ).execute() @@ -619,12 +635,11 @@ def capture_order(self, .local_error('default', 'The error response.', ErrorException) ).execute() - def get_order(self, - options=dict()): - """Does a GET request to /v2/checkout/orders/{id}. + def create_order_tracking(self, + options=dict()): + """Does a POST request to /v2/checkout/orders/{id}/track. - Shows details for an order, by ID. Note: For error handling and - troubleshooting, see Orders v2 errors. + Adds tracking information for an Order. Args: options (dict, optional): Key-value pairs for any of the @@ -633,24 +648,19 @@ def get_order(self, being the key and their desired values being the value. A list of parameters that can be used are:: - id -- str -- The ID of the order for which to show details. - paypal_mock_response -- str -- PayPal's REST API uses a - request header to invoke negative testing in the - sandbox. This header configures the sandbox into a - negative testing state for transactions that include - the merchant. + id -- str -- The ID of the order that the tracking + information is associated with. + body -- OrderTrackerRequest -- The request body parameter. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. - fields -- str -- A comma-separated list of fields that - should be returned for the order. Valid filter field - is `payment_source`. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A - successful request returns the HTTP `200 OK` status code and a - JSON response body that shows order details. + successful response to an idempotent request returns the HTTP + `200 OK` status code with a JSON response body that shows + tracker details. Raises: ApiException: When an error occurs while fetching the data from @@ -662,41 +672,47 @@ def get_order(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders/{id}') - .http_method(HttpMethodEnum.GET) + .path('/v2/checkout/orders/{id}/track') + .http_method(HttpMethodEnum.POST) .template_param(Parameter() .key('id') .value(options.get('id', None)) .should_encode(True)) .header_param(Parameter() - .key('PayPal-Mock-Response') - .value(options.get('paypal_mock_response', None))) + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) - .query_param(Parameter() - .key('fields') - .value(options.get('fields', None))) .header_param(Parameter() .key('accept') .value('application/json')) + .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Order.from_dictionary) .is_api_response(True) - .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) + .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) + .local_error('500', 'An internal server error has occurred.', ErrorException) .local_error('default', 'The error response.', ErrorException) ).execute() - def confirm_order(self, - options=dict()): - """Does a POST request to /v2/checkout/orders/{id}/confirm-payment-source. + def update_order_tracking(self, + options=dict()): + """Does a PATCH request to /v2/checkout/orders/{id}/trackers/{tracker_id}. - Payer confirms their intent to pay for the the Order with the given - payment source. + Updates or cancels the tracking information for a PayPal order, by ID. + Updatable attributes or objects: Attribute Op Notes items replace + Using replace op for items will replace the entire items object with + the value sent in request. notify_payer replace, add status replace + Only patching status to CANCELLED is currently supported. Args: options (dict, optional): Key-value pairs for any of the @@ -705,29 +721,19 @@ def confirm_order(self, being the key and their desired values being the value. A list of parameters that can be used are:: - id -- str -- The ID of the order for which the payer - confirms their intent to pay. - paypal_client_metadata_id -- str -- The request header - parameter. + id -- str -- The ID of the order that the tracking + information is associated with. + tracker_id -- str -- The order tracking ID. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. - prefer -- str -- The preferred server response upon - successful completion of the request. Value is: - return=minimal. The server returns a minimal response - to optimize communication between the API caller and - the server. A minimal response includes the id, status - and HATEOAS links. return=representation. The server - returns a complete resource representation, including - the current state of the resource. - body -- ConfirmOrderRequest -- The request body parameter. + body -- List[Patch] -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A - successful request indicates that the payment source was added - to the Order. A successful request returns the HTTP `200 OK` - status code with a JSON response body that shows order details. + successful request returns the HTTP `204 No Content` status + code with an empty object in the JSON response body. Raises: ApiException: When an error occurs while fetching the data from @@ -739,38 +745,32 @@ def confirm_order(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/checkout/orders/{id}/confirm-payment-source') - .http_method(HttpMethodEnum.POST) + .path('/v2/checkout/orders/{id}/trackers/{tracker_id}') + .http_method(HttpMethodEnum.PATCH) .template_param(Parameter() .key('id') .value(options.get('id', None)) .should_encode(True)) + .template_param(Parameter() + .key('tracker_id') + .value(options.get('tracker_id', None)) + .should_encode(True)) .header_param(Parameter() .key('Content-Type') .value('application/json')) - .header_param(Parameter() - .key('PayPal-Client-Metadata-Id') - .value(options.get('paypal_client_metadata_id', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) - .header_param(Parameter() - .key('Prefer') - .value(options.get('prefer', None))) .body_param(Parameter() .value(options.get('body', None))) - .header_param(Parameter() - .key('accept') - .value('application/json')) .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(Order.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('404', 'The specified resource does not exist.', ErrorException) .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException) .local_error('default', 'The error response.', ErrorException) diff --git a/paypalserversdk/controllers/payments_controller.py b/paypalserversdk/controllers/payments_controller.py index e453fb2..f505680 100644 --- a/paypalserversdk/controllers/payments_controller.py +++ b/paypalserversdk/controllers/payments_controller.py @@ -16,8 +16,8 @@ from apimatic_core.types.parameter import Parameter from paypalserversdk.http.http_method_enum import HttpMethodEnum from apimatic_core.authentication.multiple.single_auth import Single -from paypalserversdk.models.captured_payment import CapturedPayment from paypalserversdk.models.payment_authorization import PaymentAuthorization +from paypalserversdk.models.captured_payment import CapturedPayment from paypalserversdk.models.refund import Refund from paypalserversdk.exceptions.error_exception import ErrorException from paypalserversdk.exceptions.api_exception import ApiException @@ -29,11 +29,11 @@ class PaymentsController(BaseController): def __init__(self, config): super(PaymentsController, self).__init__(config) - def capture_authorized_payment(self, - options=dict()): - """Does a POST request to /v2/payments/authorizations/{authorization_id}/capture. + def get_authorized_payment(self, + options=dict()): + """Does a GET request to /v2/payments/authorizations/{authorization_id}. - Captures an authorized payment, by ID. + Shows details for an authorized payment, by ID. Args: options (dict, optional): Key-value pairs for any of the @@ -42,23 +42,13 @@ def capture_authorized_payment(self, being the key and their desired values being the value. A list of parameters that can be used are:: - authorization_id -- str -- The PayPal-generated ID for the - authorized payment to capture. + authorization_id -- str -- The ID of the authorized + payment for which to show details. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. - paypal_request_id -- str -- The server stores keys for 45 - days. - prefer -- str -- The preferred server response upon - successful completion of the request. Value is: - return=minimal. The server returns a minimal response - to optimize communication between the API caller and - the server. A minimal response includes the id, status - and HATEOAS links. return=representation. The server - returns a complete resource representation, including - the current state of the resource. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see @@ -69,13 +59,12 @@ def capture_authorized_payment(self, identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. - body -- CaptureRequest -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A successful request returns the HTTP 200 OK status code and a - JSON response body that shows captured payment details. + JSON response body that shows authorization details. Raises: ApiException: When an error occurs while fetching the data from @@ -87,54 +76,39 @@ def capture_authorized_payment(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/payments/authorizations/{authorization_id}/capture') - .http_method(HttpMethodEnum.POST) + .path('/v2/payments/authorizations/{authorization_id}') + .http_method(HttpMethodEnum.GET) .template_param(Parameter() .key('authorization_id') .value(options.get('authorization_id', None)) .should_encode(True)) - .header_param(Parameter() - .key('Content-Type') - .value('application/json')) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) - .header_param(Parameter() - .key('PayPal-Request-Id') - .value(options.get('paypal_request_id', None))) - .header_param(Parameter() - .key('Prefer') - .value(options.get('prefer', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) - .body_param(Parameter() - .value(options.get('body', None))) .header_param(Parameter() .key('accept') .value('application/json')) - .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CapturedPayment.from_dictionary) + .deserialize_into(PaymentAuthorization.from_dictionary) .is_api_response(True) - .local_error('400', 'The request failed because it is not well-formed or is syntactically incorrect or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) .local_error('403', 'The request failed because the caller has insufficient permissions.', ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) - .local_error('409', 'The server has detected a conflict while processing this request.', ErrorException) - .local_error('422', 'The request failed because it is semantically incorrect or failed business validation.', ErrorException) .local_error('500', 'The request failed because an internal server error occurred.', ApiException) .local_error('default', 'The error response.', ErrorException) ).execute() - def get_captured_payment(self, - options=dict()): - """Does a GET request to /v2/payments/captures/{capture_id}. + def capture_authorized_payment(self, + options=dict()): + """Does a POST request to /v2/payments/authorizations/{authorization_id}/capture. - Shows details for a captured payment, by ID. + Captures an authorized payment, by ID. Args: options (dict, optional): Key-value pairs for any of the @@ -143,13 +117,34 @@ def get_captured_payment(self, being the key and their desired values being the value. A list of parameters that can be used are:: - capture_id -- str -- The PayPal-generated ID for the - captured payment for which to show details. + authorization_id -- str -- The PayPal-generated ID for the + authorized payment to capture. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. + paypal_request_id -- str -- The server stores keys for 45 + days. + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, status + and HATEOAS links. return=representation. The server + returns a complete resource representation, including + the current state of the resource. + paypal_auth_assertion -- str -- An API-caller-provided + JSON Web Token (JWT) assertion that identifies the + merchant. For details, see + [PayPal-Auth-Assertion](/docs/api/reference/api-request + s/#paypal-auth-assertion). Note:For three party + transactions in which a partner is managing the API + calls on behalf of a merchant, the partner must + identify the merchant using either a + PayPal-Auth-Assertion header or an access token with + target_subject. + body -- CaptureRequest -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other @@ -167,27 +162,45 @@ def get_captured_payment(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/payments/captures/{capture_id}') - .http_method(HttpMethodEnum.GET) + .path('/v2/payments/authorizations/{authorization_id}/capture') + .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('capture_id') - .value(options.get('capture_id', None)) + .key('authorization_id') + .value(options.get('authorization_id', None)) .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) + .header_param(Parameter() + .key('PayPal-Auth-Assertion') + .value(options.get('paypal_auth_assertion', None))) + .body_param(Parameter() + .value(options.get('body', None))) .header_param(Parameter() .key('accept') .value('application/json')) + .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CapturedPayment.from_dictionary) .is_api_response(True) + .local_error('400', 'The request failed because it is not well-formed or is syntactically incorrect or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) .local_error('403', 'The request failed because the caller has insufficient permissions.', ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) + .local_error('409', 'The server has detected a conflict while processing this request.', ErrorException) + .local_error('422', 'The request failed because it is semantically incorrect or failed business validation.', ErrorException) .local_error('500', 'The request failed because an internal server error occurred.', ApiException) .local_error('default', 'The error response.', ErrorException) ).execute() @@ -208,8 +221,7 @@ def reauthorize_payment(self, 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only - the `amount` request parameter. Note: This request is currently not - supported for Partner use cases. + the `amount` request parameter. Args: options (dict, optional): Key-value pairs for any of the @@ -290,6 +302,7 @@ def reauthorize_payment(self, .is_api_response(True) .local_error('400', 'The request failed because it is not well-formed or is syntactically incorrect or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) + .local_error('403', 'The request failed because the caller has insufficient permissions.', ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) .local_error('422', 'The request failed because it either is semantically incorrect or failed business validation.', ErrorException) .local_error('500', 'The request failed because an internal server error occurred.', ApiException) @@ -392,13 +405,11 @@ def void_payment(self, .local_error('default', 'The error response.', ErrorException) ).execute() - def refund_captured_payment(self, - options=dict()): - """Does a POST request to /v2/payments/captures/{capture_id}/refund. + def get_captured_payment(self, + options=dict()): + """Does a GET request to /v2/payments/captures/{capture_id}. - Refunds a captured payment, by ID. For a full refund, include an empty - payload in the JSON request body. For a partial refund, include an - amount object in the JSON request body. + Shows details for a captured payment, by ID. Args: options (dict, optional): Key-value pairs for any of the @@ -408,39 +419,18 @@ def refund_captured_payment(self, of parameters that can be used are:: capture_id -- str -- The PayPal-generated ID for the - captured payment to refund. + captured payment for which to show details. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. - paypal_request_id -- str -- The server stores keys for 45 - days. - prefer -- str -- The preferred server response upon - successful completion of the request. Value is: - return=minimal. The server returns a minimal response - to optimize communication between the API caller and - the server. A minimal response includes the id, status - and HATEOAS links. return=representation. The server - returns a complete resource representation, including - the current state of the resource. - paypal_auth_assertion -- str -- An API-caller-provided - JSON Web Token (JWT) assertion that identifies the - merchant. For details, see - [PayPal-Auth-Assertion](/docs/api/reference/api-request - s/#paypal-auth-assertion). Note:For three party - transactions in which a partner is managing the API - calls on behalf of a merchant, the partner must - identify the merchant using either a - PayPal-Auth-Assertion header or an access token with - target_subject. - body -- RefundRequest -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A successful request returns the HTTP 200 OK status code and a - JSON response body that shows refund details. + JSON response body that shows captured payment details. Raises: ApiException: When an error occurs while fetching the data from @@ -452,54 +442,38 @@ def refund_captured_payment(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/payments/captures/{capture_id}/refund') - .http_method(HttpMethodEnum.POST) + .path('/v2/payments/captures/{capture_id}') + .http_method(HttpMethodEnum.GET) .template_param(Parameter() .key('capture_id') .value(options.get('capture_id', None)) .should_encode(True)) - .header_param(Parameter() - .key('Content-Type') - .value('application/json')) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) - .header_param(Parameter() - .key('PayPal-Request-Id') - .value(options.get('paypal_request_id', None))) - .header_param(Parameter() - .key('Prefer') - .value(options.get('prefer', None))) - .header_param(Parameter() - .key('PayPal-Auth-Assertion') - .value(options.get('paypal_auth_assertion', None))) - .body_param(Parameter() - .value(options.get('body', None))) .header_param(Parameter() .key('accept') .value('application/json')) - .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(Refund.from_dictionary) + .deserialize_into(CapturedPayment.from_dictionary) .is_api_response(True) - .local_error('400', 'The request failed because it is not well-formed or is syntactically incorrect or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) .local_error('403', 'The request failed because the caller has insufficient permissions.', ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) - .local_error('409', 'The request failed because a previous call for the given resource is in progress.', ErrorException) - .local_error('422', 'The request failed because it either is semantically incorrect or failed business validation.', ErrorException) .local_error('500', 'The request failed because an internal server error occurred.', ApiException) .local_error('default', 'The error response.', ErrorException) ).execute() - def get_authorized_payment(self, - options=dict()): - """Does a GET request to /v2/payments/authorizations/{authorization_id}. + def refund_captured_payment(self, + options=dict()): + """Does a POST request to /v2/payments/captures/{capture_id}/refund. - Shows details for an authorized payment, by ID. + Refunds a captured payment, by ID. For a full refund, include an empty + payload in the JSON request body. For a partial refund, include an + amount object in the JSON request body. Args: options (dict, optional): Key-value pairs for any of the @@ -508,13 +482,23 @@ def get_authorized_payment(self, being the key and their desired values being the value. A list of parameters that can be used are:: - authorization_id -- str -- The ID of the authorized - payment for which to show details. + capture_id -- str -- The PayPal-generated ID for the + captured payment to refund. paypal_mock_response -- str -- PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. + paypal_request_id -- str -- The server stores keys for 45 + days. + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, status + and HATEOAS links. return=representation. The server + returns a complete resource representation, including + the current state of the resource. paypal_auth_assertion -- str -- An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see @@ -525,12 +509,13 @@ def get_authorized_payment(self, identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. + body -- RefundRequest -- The request body parameter. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. A successful request returns the HTTP 200 OK status code and a - JSON response body that shows authorization details. + JSON response body that shows refund details. Raises: ApiException: When an error occurs while fetching the data from @@ -542,29 +527,45 @@ def get_authorized_payment(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v2/payments/authorizations/{authorization_id}') - .http_method(HttpMethodEnum.GET) + .path('/v2/payments/captures/{capture_id}/refund') + .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('authorization_id') - .value(options.get('authorization_id', None)) + .key('capture_id') + .value(options.get('capture_id', None)) .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) .header_param(Parameter() .key('PayPal-Mock-Response') .value(options.get('paypal_mock_response', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) .header_param(Parameter() .key('PayPal-Auth-Assertion') .value(options.get('paypal_auth_assertion', None))) + .body_param(Parameter() + .value(options.get('body', None))) .header_param(Parameter() .key('accept') .value('application/json')) + .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(PaymentAuthorization.from_dictionary) + .deserialize_into(Refund.from_dictionary) .is_api_response(True) + .local_error('400', 'The request failed because it is not well-formed or is syntactically incorrect or violates schema.', ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', ErrorException) + .local_error('403', 'The request failed because the caller has insufficient permissions.', ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) + .local_error('409', 'The request failed because a previous call for the given resource is in progress.', ErrorException) + .local_error('422', 'The request failed because it either is semantically incorrect or failed business validation.', ErrorException) .local_error('500', 'The request failed because an internal server error occurred.', ApiException) .local_error('default', 'The error response.', ErrorException) ).execute() diff --git a/paypalserversdk/controllers/subscriptions_controller.py b/paypalserversdk/controllers/subscriptions_controller.py new file mode 100644 index 0000000..fc82dd0 --- /dev/null +++ b/paypalserversdk/controllers/subscriptions_controller.py @@ -0,0 +1,1139 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.configuration import Server +from paypalserversdk.http.api_response import ApiResponse +from paypalserversdk.controllers.base_controller import BaseController +from apimatic_core.request_builder import RequestBuilder +from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.parameter import Parameter +from paypalserversdk.http.http_method_enum import HttpMethodEnum +from apimatic_core.authentication.multiple.single_auth import Single +from paypalserversdk.models.billing_plan import BillingPlan +from paypalserversdk.models.plan_collection import PlanCollection +from paypalserversdk.models.subscription import Subscription +from paypalserversdk.models.subscription_collection import SubscriptionCollection +from paypalserversdk.models.modify_subscription_response import ModifySubscriptionResponse +from paypalserversdk.models.subscription_transaction_details import SubscriptionTransactionDetails +from paypalserversdk.models.transactions_list import TransactionsList +from paypalserversdk.exceptions.subscription_error_exception import SubscriptionErrorException + + +class SubscriptionsController(BaseController): + + """A Controller to access Endpoints in the paypalserversdk API.""" + def __init__(self, config): + super(SubscriptionsController, self).__init__(config) + + def create_billing_plan(self, + options=dict()): + """Does a POST request to /v1/billing/plans. + + Creates a plan that defines pricing and billing cycle details for + subscriptions. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, status + and HATEOAS links. return=representation. The server + returns a complete resource representation, including + the current state of the resource. + paypal_request_id -- str -- The server stores keys for 72 + hours. + body -- PlanRequest -- The request body parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows billing plan details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans') + .http_method(HttpMethodEnum.POST) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .body_param(Parameter() + .value(options.get('body', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(BillingPlan.from_dictionary) + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def list_billing_plans(self, + options=dict()): + """Does a GET request to /v1/billing/plans. + + Lists billing plans. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, name, + description and HATEOAS links. return=representation. + The server returns a complete resource representation, + including the current state of the resource. + product_id -- str -- Filters the response by a Product ID. + page_size -- int -- The number of items to return in the + response. + page -- int -- A non-zero integer which is the start index + of the entire list of items to return in the response. + The combination of `page=1` and `page_size=20` returns + the first 20 items. The combination of `page=2` and + `page_size=20` returns the next 20 items. + total_required -- bool -- Indicates whether to show the + total count in the response. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that lists billing plans. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans') + .http_method(HttpMethodEnum.GET) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) + .query_param(Parameter() + .key('product_id') + .value(options.get('product_id', None))) + .query_param(Parameter() + .key('page_size') + .value(options.get('page_size', None))) + .query_param(Parameter() + .key('page') + .value(options.get('page', None))) + .query_param(Parameter() + .key('total_required') + .value(options.get('total_required', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(PlanCollection.from_dictionary) + .is_api_response(True) + .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def get_billing_plan(self, + id): + """Does a GET request to /v1/billing/plans/{id}. + + Shows details for a plan, by ID. + + Args: + id (str): The ID of the plan. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows plan details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans/{id}') + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key('id') + .value(id) + .should_encode(True)) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(BillingPlan.from_dictionary) + .is_api_response(True) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def patch_billing_plan(self, + options=dict()): + """Does a PATCH request to /v1/billing/plans/{id}. + + Updates a plan with the `CREATED` or `ACTIVE` status. For an + `INACTIVE` plan, you can make only status updates. You can patch these + attributes and objects: Attribute or object Operations description + replace payment_preferences.auto_bill_outstanding replace + taxes.percentage replace payment_preferences.payment_failure_threshold + replace payment_preferences.setup_fee replace + payment_preferences.setup_fee_failure_action replace name replace + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the plan. + body -- List[Patch] -- The request body parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans/{id}') + .http_method(HttpMethodEnum.PATCH) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def activate_billing_plan(self, + id): + """Does a POST request to /v1/billing/plans/{id}/activate. + + Activates a plan, by ID. + + Args: + id (str): The ID of the plan. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans/{id}/activate') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(id) + .should_encode(True)) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def deactivate_billing_plan(self, + id): + """Does a POST request to /v1/billing/plans/{id}/deactivate. + + Deactivates a plan, by ID. + + Args: + id (str): The ID of the plan. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans/{id}/deactivate') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(id) + .should_encode(True)) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def update_billing_plan_pricing_schemes(self, + options=dict()): + """Does a POST request to /v1/billing/plans/{id}/update-pricing-schemes. + + Updates pricing for a plan. For example, you can update a regular + billing cycle from $5 per month to $7 per month. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID for the plan. + body -- UpdatePricingSchemesRequest -- The request body + parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/plans/{id}/update-pricing-schemes') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def create_subscription(self, + options=dict()): + """Does a POST request to /v1/billing/subscriptions. + + Creates a subscription. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + prefer -- str -- The preferred server response upon + successful completion of the request. Value is: + return=minimal. The server returns a minimal response + to optimize communication between the API caller and + the server. A minimal response includes the id, status + and HATEOAS links. return=representation. The server + returns a complete resource representation, including + the current state of the resource. + paypal_request_id -- str -- The server stores keys for 72 + hours. + paypal_client_metadata_id -- str -- The PayPal Client + Metadata Id(CMID) is used to provide device-specific + information to PayPal's risk engine. This is crucial + for transactions that require device-specific risk + assessments. Merchants typically use the Paypal SDK + that automatically submits the CMID or they use tools + like Fraudnet JS for web or Magnes JS for mobile to + generate the CMID on the frontend and then pass it to + the API as part of the request headers. + body -- CreateSubscriptionRequest -- The request body + parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows subscription details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions') + .http_method(HttpMethodEnum.POST) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .header_param(Parameter() + .key('Prefer') + .value(options.get('prefer', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .header_param(Parameter() + .key('PayPal-Client-Metadata-Id') + .value(options.get('paypal_client_metadata_id', None))) + .body_param(Parameter() + .value(options.get('body', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(Subscription.from_dictionary) + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def list_subscriptions(self, + options=dict()): + """Does a GET request to /v1/billing/subscriptions. + + List all subscriptions for merchant account. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + plan_ids -- str -- Filters the response by list of plan + IDs. Filter supports upto 70 plan IDs. URLs should not + exceed a length of 2000 characters. + statuses -- str -- Filters the response by list of + subscription statuses. + created_after -- str -- Filters the response by + subscription creation start time for a range of + subscriptions. + created_before -- str -- Filters the response by + subscription creation end time for a range of + subscriptions. + status_updated_before -- str -- Filters the response by + status update start time for a range of subscriptions. + status_updated_after -- str -- Filters the response by + status update end time for a range of subscriptions. + filter -- str -- Filter the response using complex + expressions that could use comparison operators like + ge, gt, le, lt and logical operators such as 'and' and + 'or'. + page_size -- int -- The number of items to return in the + response. + page -- int -- A non-zero integer which is the start index + of the entire list of items to return in the response. + The combination of `page=1` and `page_size=20` returns + the first 20 items. The combination of `page=2` and + `page_size=20` returns the next 20 items. + customer_ids -- List[str] -- Filters the response by comma + separated vault customer IDs (FSS subscriptions only). + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that lists the subscriptions. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions') + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key('plan_ids') + .value(options.get('plan_ids', None))) + .query_param(Parameter() + .key('statuses') + .value(options.get('statuses', None))) + .query_param(Parameter() + .key('created_after') + .value(options.get('created_after', None))) + .query_param(Parameter() + .key('created_before') + .value(options.get('created_before', None))) + .query_param(Parameter() + .key('status_updated_before') + .value(options.get('status_updated_before', None))) + .query_param(Parameter() + .key('status_updated_after') + .value(options.get('status_updated_after', None))) + .query_param(Parameter() + .key('filter') + .value(options.get('filter', None))) + .query_param(Parameter() + .key('page_size') + .value(options.get('page_size', None))) + .query_param(Parameter() + .key('page') + .value(options.get('page', None))) + .query_param(Parameter() + .key('customer_ids') + .value(options.get('customer_ids', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(SubscriptionCollection.from_dictionary) + .is_api_response(True) + .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def get_subscription(self, + options=dict()): + """Does a GET request to /v1/billing/subscriptions/{id}. + + Shows details for a subscription, by ID. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + fields -- str -- List of fields that are to be returned in + the response. Possible value for fields are + last_failed_payment and plan. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows subscription details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}') + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .query_param(Parameter() + .key('fields') + .value(options.get('fields', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(Subscription.from_dictionary) + .is_api_response(True) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def patch_subscription(self, + options=dict()): + """Does a PATCH request to /v1/billing/subscriptions/{id}. + + Updates a subscription which could be in ACTIVE or SUSPENDED status. + You can override plan level default attributes by providing customised + values for plan path in the patch request. You cannot update + attributes that have already completed (Example - trial cycles can’t + be updated if completed). Once overridden, changes to plan resource + will not impact subscription. Any price update will not impact billing + cycles within next 10 days (Applicable only for subscriptions funded + by PayPal account). Following are the fields eligible for patch. + Attribute or object Operations billing_info.outstanding_balance + replace custom_id add,replace plan.billing_cycles[@sequence==n]. + pricing_scheme.fixed_price add,replace + plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace + plan.billing_cycles[@sequence==n]. total_cycles replace + plan.payment_preferences. auto_bill_outstanding replace + plan.payment_preferences. payment_failure_threshold replace + plan.taxes.inclusive add,replace plan.taxes.percentage add,replace + shipping_amount add,replace start_time replace + subscriber.shipping_address add,replace subscriber.payment_source (for + subscriptions funded by card payments) replace + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID for the subscription. + body -- List[Patch] -- The request body parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}') + .http_method(HttpMethodEnum.PATCH) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def revise_subscription(self, + options=dict()): + """Does a POST request to /v1/billing/subscriptions/{id}/revise. + + Updates the quantity of the product or service in a subscription. You + can also use this method to switch the plan and update the + `shipping_amount`, `shipping_address` values for the subscription. + This type of update requires the buyer's consent. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + body -- ModifySubscriptionRequest -- The request body + parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows subscription details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}/revise') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ModifySubscriptionResponse.from_dictionary) + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def suspend_subscription(self, + options=dict()): + """Does a POST request to /v1/billing/subscriptions/{id}/suspend. + + Suspends the subscription. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + body -- SuspendSubscription -- The request body parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}/suspend') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def cancel_subscription(self, + options=dict()): + """Does a POST request to /v1/billing/subscriptions/{id}/cancel. + + Cancels the subscription. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + body -- CancelSubscriptionRequest -- The request body + parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}/cancel') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def activate_subscription(self, + options=dict()): + """Does a POST request to /v1/billing/subscriptions/{id}/activate. + + Activates the subscription. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + body -- ActivateSubscriptionRequest -- The request body + parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `204 No Content` status + code with no JSON response body. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}/activate') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def capture_subscription(self, + options=dict()): + """Does a POST request to /v1/billing/subscriptions/{id}/capture. + + Captures an authorized payment from the subscriber on the subscription. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + paypal_request_id -- str -- The server stores keys for 72 + hours. + body -- CaptureSubscriptionRequest -- The request body + parameter. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows subscription details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}/capture') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .body_param(Parameter() + .value(options.get('body', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(SubscriptionTransactionDetails.from_dictionary) + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() + + def list_subscription_transactions(self, + options=dict()): + """Does a GET request to /v1/billing/subscriptions/{id}/transactions. + + Lists transactions for a subscription. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + id -- str -- The ID of the subscription. + start_time -- str -- The start time of the range of + transactions to list. + end_time -- str -- The end time of the range of + transactions to list. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that shows subscription details. + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/billing/subscriptions/{id}/transactions') + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key('id') + .value(options.get('id', None)) + .should_encode(True)) + .query_param(Parameter() + .key('start_time') + .value(options.get('start_time', None))) + .query_param(Parameter() + .key('end_time') + .value(options.get('end_time', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(TransactionsList.from_dictionary) + .is_api_response(True) + .local_error('400', 'Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.', SubscriptionErrorException) + .local_error('401', 'Authentication failed due to missing authorization header, or invalid authentication credentials.', SubscriptionErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', SubscriptionErrorException) + .local_error('404', 'The specified resource does not exist.', SubscriptionErrorException) + .local_error('500', 'An internal server error has occurred.', SubscriptionErrorException) + .local_error('default', 'The error response.', SubscriptionErrorException) + ).execute() diff --git a/paypalserversdk/controllers/transaction_search_controller.py b/paypalserversdk/controllers/transaction_search_controller.py new file mode 100644 index 0000000..b064786 --- /dev/null +++ b/paypalserversdk/controllers/transaction_search_controller.py @@ -0,0 +1,295 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.configuration import Server +from paypalserversdk.http.api_response import ApiResponse +from paypalserversdk.controllers.base_controller import BaseController +from apimatic_core.request_builder import RequestBuilder +from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.parameter import Parameter +from paypalserversdk.http.http_method_enum import HttpMethodEnum +from apimatic_core.authentication.multiple.single_auth import Single +from paypalserversdk.models.search_response import SearchResponse +from paypalserversdk.models.balances_response import BalancesResponse +from paypalserversdk.exceptions.search_error_exception import SearchErrorException +from paypalserversdk.exceptions.default_error_exception import DefaultErrorException + + +class TransactionSearchController(BaseController): + + """A Controller to access Endpoints in the paypalserversdk API.""" + def __init__(self, config): + super(TransactionSearchController, self).__init__(config) + + def search_transactions(self, + options=dict()): + """Does a GET request to /v1/reporting/transactions. + + Lists transactions. Specify one or more query parameters to filter the + transaction that appear in the response. Notes: If you specify one or + more optional query parameters, the ending_balance response field is + empty. It takes a maximum of three hours for executed transactions to + appear in the list transactions call. This call lists transaction for + the previous three years. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + start_date -- str -- Filters the transactions in the + response by a start date and time, in [Internet date + and time + format](https://tools.ietf.org/html/rfc3339#section-5.6 + ). Seconds are required. Fractional seconds are + optional. + end_date -- str -- Filters the transactions in the + response by an end date and time, in [Internet date + and time + format](https://tools.ietf.org/html/rfc3339#section-5.6 + ). Seconds are required. Fractional seconds are + optional. The maximum supported range is 31 days. + transaction_id -- str -- Filters the transactions in the + response by a PayPal transaction ID. A valid + transaction ID is 17 characters long, except for an + order ID, which is 19 characters long. Note: A + transaction ID is not unique in the reporting system. + The response can list two transactions with the same + ID. One transaction can be balance affecting while the + other is non-balance affecting. + transaction_type -- str -- Filters the transactions in the + response by a PayPal transaction event code. See + [Transaction event + codes](/docs/integration/direct/transaction-search/tran + saction-event-codes/). + transaction_status -- str -- Filters the transactions in + the response by a PayPal transaction status code. + Value is: Status code Description D PayPal or merchant + rules denied the transaction. P The transaction is + pending. The transaction was created but waits for + another payment process to complete, such as an ACH + transaction, before the status changes to S. S The + transaction successfully completed without a denial + and after any pending statuses. V A successful + transaction was reversed and funds were refunded to + the original sender. + transaction_amount -- str -- Filters the transactions in + the response by a gross transaction amount range. + Specify the range as ` TO `, where ` ` is the lower + limit of the gross PayPal transaction amount and ` ` + is the upper limit of the gross transaction amount. + Specify the amounts in lower denominations. For + example, to search for transactions from $5.00 to + $10.05, specify `[500 TO 1005]`. Note:The values must + be URL encoded. + transaction_currency -- str -- Filters the transactions in + the response by a [three-character ISO-4217 currency + code](/api/rest/reference/currency-codes/) for the + PayPal transaction currency. + payment_instrument_type -- str -- Filters the transactions + in the response by a payment instrument type. Value is + either: CREDITCARD. Returns a direct credit card + transaction with a corresponding value. DEBITCARD. + Returns a debit card transaction with a corresponding + value. If you omit this parameter, the API does not + apply this filter. + store_id -- str -- Filters the transactions in the + response by a store ID. + terminal_id -- str -- Filters the transactions in the + response by a terminal ID. + fields -- str -- Indicates which fields appear in the + response. Value is a single field or a comma-separated + list of fields. The transaction_info value returns + only the transaction details in the response. To + include all fields in the response, specify + fields=all. Valid fields are: transaction_info. The + transaction information. Includes the ID of the PayPal + account of the payee, the PayPal-generated transaction + ID, the PayPal-generated base ID, the PayPal reference + ID type, the transaction event code, the date and time + when the transaction was initiated and was last + updated, the transaction amounts including the PayPal + fee, any discounts, insurance, the transaction status, + and other information about the transaction. + payer_info. The payer information. Includes the PayPal + customer account ID and the payer's email address, + primary phone number, name, country code, address, and + whether the payer is verified or unverified. + shipping_info. The shipping information. Includes the + recipient's name, the shipping method for this order, + the shipping address for this order, and the secondary + address associated with this order. auction_info. The + auction information. Includes the name of the auction + site, the auction site URL, the ID of the customer who + makes the purchase in the auction, and the date and + time when the auction closes. cart_info. The cart + information. Includes an array of item details, + whether the item amount or the shipping amount already + includes tax, and the ID of the invoice for + PayPal-generated invoices. incentive_info. An array of + incentive detail objects. Each object includes the + incentive, such as a special offer or coupon, the + incentive amount, and the incentive program code that + identifies a merchant loyalty or incentive program. + store_info. The store information. Includes the ID of + the merchant store and the terminal ID for the + checkout stand in the merchant store. + balance_affecting_records_only -- str -- Indicates whether + the response includes only balance-impacting + transactions or all transactions. Value is either: Y. + The default. The response includes only balance + transactions. N. The response includes all + transactions. + page_size -- int -- The number of items to return in the + response. So, the combination of `page=1` and + `page_size=20` returns the first 20 items. The + combination of `page=2` and `page_size=20` returns the + next 20 items. + page -- int -- The zero-relative start index of the entire + list of items that are returned in the response. So, + the combination of `page=1` and `page_size=20` returns + the first 20 items. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that lists transactions . + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/reporting/transactions') + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key('start_date') + .value(options.get('start_date', None))) + .query_param(Parameter() + .key('end_date') + .value(options.get('end_date', None))) + .query_param(Parameter() + .key('transaction_id') + .value(options.get('transaction_id', None))) + .query_param(Parameter() + .key('transaction_type') + .value(options.get('transaction_type', None))) + .query_param(Parameter() + .key('transaction_status') + .value(options.get('transaction_status', None))) + .query_param(Parameter() + .key('transaction_amount') + .value(options.get('transaction_amount', None))) + .query_param(Parameter() + .key('transaction_currency') + .value(options.get('transaction_currency', None))) + .query_param(Parameter() + .key('payment_instrument_type') + .value(options.get('payment_instrument_type', None))) + .query_param(Parameter() + .key('store_id') + .value(options.get('store_id', None))) + .query_param(Parameter() + .key('terminal_id') + .value(options.get('terminal_id', None))) + .query_param(Parameter() + .key('fields') + .value(options.get('fields', None))) + .query_param(Parameter() + .key('balance_affecting_records_only') + .value(options.get('balance_affecting_records_only', None))) + .query_param(Parameter() + .key('page_size') + .value(options.get('page_size', None))) + .query_param(Parameter() + .key('page') + .value(options.get('page', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(SearchResponse.from_dictionary) + .is_api_response(True) + .local_error('default', 'The error response.', SearchErrorException) + ).execute() + + def search_balances(self, + options=dict()): + """Does a GET request to /v1/reporting/balances. + + List all balances. Specify date time to list balances for that time + that appear in the response. Notes: It takes a maximum of three hours + for balances to appear in the list balances call. This call lists + balances upto the previous three years. + + Args: + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + as_of_time -- str -- List balances in the response at the + date time provided, will return the last refreshed + balance in the system when not provided. + currency_code -- str -- Filters the transactions in the + response by a [three-character ISO-4217 currency + code](/api/rest/reference/currency-codes/) for the + PayPal transaction currency. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. A + successful request returns the HTTP `200 OK` status code and a + JSON response body that lists balances . + + Raises: + ApiException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server(Server.DEFAULT) + .path('/v1/reporting/balances') + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key('as_of_time') + .value(options.get('as_of_time', None))) + .query_param(Parameter() + .key('currency_code') + .value(options.get('currency_code', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('Oauth2')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(BalancesResponse.from_dictionary) + .is_api_response(True) + .local_error('400', 'The request is not well-formed, is syntactically incorrect, or violates schema.', DefaultErrorException) + .local_error('403', 'Authorization failed due to insufficient permissions.', DefaultErrorException) + .local_error('500', 'An internal server error occurred.', DefaultErrorException) + .local_error('default', 'The error response.', DefaultErrorException) + ).execute() diff --git a/paypalserversdk/controllers/vault_controller.py b/paypalserversdk/controllers/vault_controller.py index b848131..9e36d26 100644 --- a/paypalserversdk/controllers/vault_controller.py +++ b/paypalserversdk/controllers/vault_controller.py @@ -16,9 +16,9 @@ from apimatic_core.types.parameter import Parameter from paypalserversdk.http.http_method_enum import HttpMethodEnum from apimatic_core.authentication.multiple.single_auth import Single -from paypalserversdk.models.setup_token_response import SetupTokenResponse from paypalserversdk.models.payment_token_response import PaymentTokenResponse from paypalserversdk.models.customer_vault_payment_tokens_response import CustomerVaultPaymentTokensResponse +from paypalserversdk.models.setup_token_response import SetupTokenResponse from paypalserversdk.exceptions.error_exception import ErrorException @@ -28,20 +28,29 @@ class VaultController(BaseController): def __init__(self, config): super(VaultController, self).__init__(config) - def delete_payment_token(self, - id): - """Does a DELETE request to /v3/vault/payment-tokens/{id}. + def create_payment_token(self, + options=dict()): + """Does a POST request to /v3/vault/payment-tokens. - Delete the payment token associated with the payment token id. + Creates a Payment Token from the given payment source and adds it to + the Vault of the associated customer. Args: - id (str): ID of the payment token. + options (dict, optional): Key-value pairs for any of the + parameters to this API Endpoint. All parameters to the + endpoint are supplied through the dictionary with their names + being the key and their desired values being the value. A list + of parameters that can be used are:: + + body -- PaymentTokenRequest -- Payment Token creation with + a financial instrument and an optional customer_id. + paypal_request_id -- str -- The server stores keys for 3 + hours. Returns: ApiResponse: An object with the response value as well as other - useful information such as status codes and headers. The - server has successfully executed the method, but there is no - entity body to return. + useful information such as status codes and headers. + Idempotent response for a successful creation of payment token. Raises: ApiException: When an error occurs while fetching the data from @@ -53,27 +62,38 @@ def delete_payment_token(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v3/vault/payment-tokens/{id}') - .http_method(HttpMethodEnum.DELETE) - .template_param(Parameter() - .key('id') - .value(id) - .should_encode(True)) + .path('/v3/vault/payment-tokens') + .http_method(HttpMethodEnum.POST) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(PaymentTokenResponse.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('404', 'Request contains reference to resources that do not exist.', ErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException) ).execute() - def create_setup_token(self, - options=dict()): - """Does a POST request to /v3/vault/setup-tokens. + def list_customer_payment_tokens(self, + options=dict()): + """Does a GET request to /v3/vault/payment-tokens. - Creates a Setup Token from the given payment source and adds it to the - Vault of the associated customer. + Returns all payment tokens for a customer. Args: options (dict, optional): Key-value pairs for any of the @@ -82,16 +102,22 @@ def create_setup_token(self, being the key and their desired values being the value. A list of parameters that can be used are:: - body -- SetupTokenRequest -- Setup Token creation with a - instrument type optional financial instrument details - and customer_id. - paypal_request_id -- str -- The server stores keys for 3 - hours. + customer_id -- str -- A unique identifier representing a + specific customer in merchant's/partner's system or + records. + page_size -- int -- A non-negative, non-zero integer + indicating the maximum number of results to return at + one time. + page -- int -- A non-negative, non-zero integer + representing the page of the results. + total_required -- bool -- A boolean indicating total + number of items (total_items) and pages (total_pages) + are expected to be returned in the response. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. - Idempotent response for a successful creation of setup token. + Successful execution. Raises: ApiException: When an error occurs while fetching the data from @@ -103,47 +129,48 @@ def create_setup_token(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v3/vault/setup-tokens') - .http_method(HttpMethodEnum.POST) - .header_param(Parameter() - .key('Content-Type') - .value('application/json')) - .body_param(Parameter() - .value(options.get('body', None))) - .header_param(Parameter() - .key('PayPal-Request-Id') - .value(options.get('paypal_request_id', None))) + .path('/v3/vault/payment-tokens') + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key('customer_id') + .value(options.get('customer_id', None))) + .query_param(Parameter() + .key('page_size') + .value(options.get('page_size', None))) + .query_param(Parameter() + .key('page') + .value(options.get('page', None))) + .query_param(Parameter() + .key('total_required') + .value(options.get('total_required', None))) .header_param(Parameter() .key('accept') .value('application/json')) - .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SetupTokenResponse.from_dictionary) + .deserialize_into(CustomerVaultPaymentTokensResponse.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException) ).execute() - def get_setup_token(self, - id): - """Does a GET request to /v3/vault/setup-tokens/{id}. + def get_payment_token(self, + id): + """Does a GET request to /v3/vault/payment-tokens/{id}. - Returns a readable representation of temporarily vaulted payment - source associated with the setup token id. + Returns a readable representation of vaulted payment source associated + with the payment token id. Args: - id (str): ID of the setup token. + id (str): ID of the payment token. Returns: ApiResponse: An object with the response value as well as other - useful information such as status codes and headers. Found - requested setup-token, returned a payment method associated - with the token. + useful information such as status codes and headers. + Successful execution. Raises: ApiException: When an error occurs while fetching the data from @@ -155,7 +182,7 @@ def get_setup_token(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v3/vault/setup-tokens/{id}') + .path('/v3/vault/payment-tokens/{id}') .http_method(HttpMethodEnum.GET) .template_param(Parameter() .key('id') @@ -168,7 +195,7 @@ def get_setup_token(self, ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SetupTokenResponse.from_dictionary) + .deserialize_into(PaymentTokenResponse.from_dictionary) .is_api_response(True) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) @@ -176,29 +203,20 @@ def get_setup_token(self, .local_error('500', 'An internal server error has occurred.', ErrorException) ).execute() - def create_payment_token(self, - options=dict()): - """Does a POST request to /v3/vault/payment-tokens. + def delete_payment_token(self, + id): + """Does a DELETE request to /v3/vault/payment-tokens/{id}. - Creates a Payment Token from the given payment source and adds it to - the Vault of the associated customer. + Delete the payment token associated with the payment token id. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - body -- PaymentTokenRequest -- Payment Token creation with - a financial instrument and an optional customer_id. - paypal_request_id -- str -- The server stores keys for 3 - hours. + id (str): ID of the payment token. Returns: ApiResponse: An object with the response value as well as other - useful information such as status codes and headers. - Idempotent response for a successful creation of payment token. + useful information such as status codes and headers. The + server has successfully executed the method, but there is no + entity body to return. Raises: ApiException: When an error occurs while fetching the data from @@ -210,38 +228,27 @@ def create_payment_token(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v3/vault/payment-tokens') - .http_method(HttpMethodEnum.POST) - .header_param(Parameter() - .key('Content-Type') - .value('application/json')) - .body_param(Parameter() - .value(options.get('body', None))) - .header_param(Parameter() - .key('PayPal-Request-Id') - .value(options.get('paypal_request_id', None))) - .header_param(Parameter() - .key('accept') - .value('application/json')) - .body_serializer(APIHelper.json_serialize) + .path('/v3/vault/payment-tokens/{id}') + .http_method(HttpMethodEnum.DELETE) + .template_param(Parameter() + .key('id') + .value(id) + .should_encode(True)) .auth(Single('Oauth2')) ).response( ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(PaymentTokenResponse.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('404', 'Request contains reference to resources that do not exist.', ErrorException) - .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException) ).execute() - def list_customer_payment_tokens(self, - options=dict()): - """Does a GET request to /v3/vault/payment-tokens. + def create_setup_token(self, + options=dict()): + """Does a POST request to /v3/vault/setup-tokens. - Returns all payment tokens for a customer. + Creates a Setup Token from the given payment source and adds it to the + Vault of the associated customer. Args: options (dict, optional): Key-value pairs for any of the @@ -250,22 +257,16 @@ def list_customer_payment_tokens(self, being the key and their desired values being the value. A list of parameters that can be used are:: - customer_id -- str -- A unique identifier representing a - specific customer in merchant's/partner's system or - records. - page_size -- int -- A non-negative, non-zero integer - indicating the maximum number of results to return at - one time. - page -- int -- A non-negative, non-zero integer - representing the page of the results. - total_required -- bool -- A boolean indicating total - number of items (total_items) and pages (total_pages) - are expected to be returned in the response. + body -- SetupTokenRequest -- Setup Token creation with a + instrument type optional financial instrument details + and customer_id. + paypal_request_id -- str -- The server stores keys for 3 + hours. Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. - Successful execution. + Idempotent response for a successful creation of setup token. Raises: ApiException: When an error occurs while fetching the data from @@ -277,48 +278,47 @@ def list_customer_payment_tokens(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v3/vault/payment-tokens') - .http_method(HttpMethodEnum.GET) - .query_param(Parameter() - .key('customer_id') - .value(options.get('customer_id', None))) - .query_param(Parameter() - .key('page_size') - .value(options.get('page_size', None))) - .query_param(Parameter() - .key('page') - .value(options.get('page', None))) - .query_param(Parameter() - .key('total_required') - .value(options.get('total_required', None))) + .path('/v3/vault/setup-tokens') + .http_method(HttpMethodEnum.POST) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(options.get('body', None))) + .header_param(Parameter() + .key('PayPal-Request-Id') + .value(options.get('paypal_request_id', None))) .header_param(Parameter() .key('accept') .value('application/json')) + .body_serializer(APIHelper.json_serialize) .auth(Single('Oauth2')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CustomerVaultPaymentTokensResponse.from_dictionary) + .deserialize_into(SetupTokenResponse.from_dictionary) .is_api_response(True) .local_error('400', 'Request is not well-formed, syntactically incorrect, or violates schema.', ErrorException) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('422', 'The requested action could not be performed, semantically incorrect, or failed business validation.', ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException) ).execute() - def get_payment_token(self, - id): - """Does a GET request to /v3/vault/payment-tokens/{id}. + def get_setup_token(self, + id): + """Does a GET request to /v3/vault/setup-tokens/{id}. - Returns a readable representation of vaulted payment source associated - with the payment token id. + Returns a readable representation of temporarily vaulted payment + source associated with the setup token id. Args: - id (str): ID of the payment token. + id (str): ID of the setup token. Returns: ApiResponse: An object with the response value as well as other - useful information such as status codes and headers. - Successful execution. + useful information such as status codes and headers. Found + requested setup-token, returned a payment method associated + with the token. Raises: ApiException: When an error occurs while fetching the data from @@ -330,7 +330,7 @@ def get_payment_token(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.DEFAULT) - .path('/v3/vault/payment-tokens/{id}') + .path('/v3/vault/setup-tokens/{id}') .http_method(HttpMethodEnum.GET) .template_param(Parameter() .key('id') @@ -343,7 +343,7 @@ def get_payment_token(self, ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(PaymentTokenResponse.from_dictionary) + .deserialize_into(SetupTokenResponse.from_dictionary) .is_api_response(True) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) diff --git a/paypalserversdk/exceptions/__init__.py b/paypalserversdk/exceptions/__init__.py index 8ae2c94..0d2dccf 100644 --- a/paypalserversdk/exceptions/__init__.py +++ b/paypalserversdk/exceptions/__init__.py @@ -1,5 +1,8 @@ __all__ = [ 'api_exception', 'error_exception', + 'default_error_exception', + 'search_error_exception', + 'subscription_error_exception', 'o_auth_provider_exception', ] diff --git a/paypalserversdk/exceptions/default_error_exception.py b/paypalserversdk/exceptions/default_error_exception.py new file mode 100644 index 0000000..206ad65 --- /dev/null +++ b/paypalserversdk/exceptions/default_error_exception.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.exceptions.api_exception import ApiException +from paypalserversdk.models.transaction_search_error_details import TransactionSearchErrorDetails +from paypalserversdk.models.link_description import LinkDescription + + +class DefaultErrorException(ApiException): + def __init__(self, reason, response): + """Constructor for the DefaultErrorException class + + Args: + reason (string): The reason (or error message) for the Exception + to be raised. + response (HttpResponse): The HttpResponse of the API call. + + """ + super(DefaultErrorException, self).__init__(reason, response) + dictionary = APIHelper.json_deserialize(self.response.text) + if isinstance(dictionary, dict): + self.unbox(dictionary) + + def unbox(self, dictionary): + """Populates the properties of this object by extracting them from a dictionary. + + Args: + dictionary (dictionary): A dictionary representation of the object as + obtained from the deserialization of the server's response. The keys + MUST match property names in the API description. + + """ + self.name = dictionary.get("name") if dictionary.get("name") else None + self.message = dictionary.get("message") if dictionary.get("message") else None + self.debug_id = dictionary.get("debug_id") if dictionary.get("debug_id") else None + self.information_link = dictionary.get("information_link") if dictionary.get("information_link") else None + self.details = None + if dictionary.get('details') is not None: + self.details = [TransactionSearchErrorDetails.from_dictionary(x) for x in dictionary.get('details')] + else: + self.details = None + self.links = None + if dictionary.get('links') is not None: + self.links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + self.links = None + + def __str__(self): + base_str = super().__str__() + return (f'{self.__class__.__name__}(' + f'{base_str[base_str.find("(") + 1:-1]}, ' + f'name={self.name!s}, ' + f'message={self.message!s}, ' + f'debug_id={self.debug_id!s}, ' + f'information_link={(self.information_link if hasattr(self, "information_link") else None)!s}, ' + f'details={(self.details if hasattr(self, "details") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/exceptions/search_error_exception.py b/paypalserversdk/exceptions/search_error_exception.py new file mode 100644 index 0000000..8d4ae6f --- /dev/null +++ b/paypalserversdk/exceptions/search_error_exception.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.exceptions.api_exception import ApiException +from paypalserversdk.models.transaction_search_error_details import TransactionSearchErrorDetails +from paypalserversdk.models.link_description import LinkDescription + + +class SearchErrorException(ApiException): + def __init__(self, reason, response): + """Constructor for the SearchErrorException class + + Args: + reason (string): The reason (or error message) for the Exception + to be raised. + response (HttpResponse): The HttpResponse of the API call. + + """ + super(SearchErrorException, self).__init__(reason, response) + dictionary = APIHelper.json_deserialize(self.response.text) + if isinstance(dictionary, dict): + self.unbox(dictionary) + + def unbox(self, dictionary): + """Populates the properties of this object by extracting them from a dictionary. + + Args: + dictionary (dictionary): A dictionary representation of the object as + obtained from the deserialization of the server's response. The keys + MUST match property names in the API description. + + """ + self.name = dictionary.get("name") if dictionary.get("name") else None + self.message = dictionary.get("message") if dictionary.get("message") else None + self.debug_id = dictionary.get("debug_id") if dictionary.get("debug_id") else None + self.information_link = dictionary.get("information_link") if dictionary.get("information_link") else None + self.details = None + if dictionary.get('details') is not None: + self.details = [TransactionSearchErrorDetails.from_dictionary(x) for x in dictionary.get('details')] + else: + self.details = None + self.links = None + if dictionary.get('links') is not None: + self.links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + self.links = None + self.total_items = dictionary.get("total_items") if dictionary.get("total_items") else None + self.maximum_items = dictionary.get("maximum_items") if dictionary.get("maximum_items") else None + + def __str__(self): + base_str = super().__str__() + return (f'{self.__class__.__name__}(' + f'{base_str[base_str.find("(") + 1:-1]}, ' + f'name={self.name!s}, ' + f'message={self.message!s}, ' + f'debug_id={self.debug_id!s}, ' + f'information_link={(self.information_link if hasattr(self, "information_link") else None)!s}, ' + f'details={(self.details if hasattr(self, "details") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!s}, ' + f'maximum_items={(self.maximum_items if hasattr(self, "maximum_items") else None)!s})') diff --git a/paypalserversdk/exceptions/subscription_error_exception.py b/paypalserversdk/exceptions/subscription_error_exception.py new file mode 100644 index 0000000..927247c --- /dev/null +++ b/paypalserversdk/exceptions/subscription_error_exception.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.exceptions.api_exception import ApiException +from paypalserversdk.models.error_details import ErrorDetails +from paypalserversdk.models.link_description import LinkDescription + + +class SubscriptionErrorException(ApiException): + def __init__(self, reason, response): + """Constructor for the SubscriptionErrorException class + + Args: + reason (string): The reason (or error message) for the Exception + to be raised. + response (HttpResponse): The HttpResponse of the API call. + + """ + super(SubscriptionErrorException, self).__init__(reason, response) + dictionary = APIHelper.json_deserialize(self.response.text) + if isinstance(dictionary, dict): + self.unbox(dictionary) + + def unbox(self, dictionary): + """Populates the properties of this object by extracting them from a dictionary. + + Args: + dictionary (dictionary): A dictionary representation of the object as + obtained from the deserialization of the server's response. The keys + MUST match property names in the API description. + + """ + self.name = dictionary.get("name") if dictionary.get("name") else None + self.message = dictionary.get("message") if dictionary.get("message") else None + self.debug_id = dictionary.get("debug_id") if dictionary.get("debug_id") else None + self.information_link = dictionary.get("information_link") if dictionary.get("information_link") else None + self.details = None + if dictionary.get('details') is not None: + self.details = [ErrorDetails.from_dictionary(x) for x in dictionary.get('details')] + else: + self.details = None + self.links = None + if dictionary.get('links') is not None: + self.links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + self.links = None + + def __str__(self): + base_str = super().__str__() + return (f'{self.__class__.__name__}(' + f'{base_str[base_str.find("(") + 1:-1]}, ' + f'name={self.name!s}, ' + f'message={self.message!s}, ' + f'debug_id={self.debug_id!s}, ' + f'information_link={(self.information_link if hasattr(self, "information_link") else None)!s}, ' + f'details={(self.details if hasattr(self, "details") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/http/__init__.py b/paypalserversdk/http/__init__.py index b489ef8..45fcc04 100644 --- a/paypalserversdk/http/__init__.py +++ b/paypalserversdk/http/__init__.py @@ -4,4 +4,6 @@ 'http_request', 'http_response', 'http_call_back', + 'proxy_settings', + 'http_client_provider', ] diff --git a/paypalserversdk/http/http_client_provider.py b/paypalserversdk/http/http_client_provider.py new file mode 100644 index 0000000..32bdab3 --- /dev/null +++ b/paypalserversdk/http/http_client_provider.py @@ -0,0 +1,26 @@ +""" + paypalserversdk + + This file was automatically generated by APIMATIC v3.0 ( +https://www.apimatic.io ). +""" + +from abc import ABC + +from apimatic_core_interfaces.client.http_client_provider import ( + HttpClientProvider as CoreHttpClientProvider +) + +class HttpClientProvider(CoreHttpClientProvider, ABC): + """ + Defines a contract for providing HTTP client configuration. + + Classes implementing this interface are expected to supply a configured + HTTP session and timeout value that will be used by the SDK's internal + HTTP layer when making network requests. + + This allows developers to inject their own custom HTTP clients while + maintaining compatibility with the SDK's request/response handling. + """ + + pass diff --git a/paypalserversdk/http/proxy_settings.py b/paypalserversdk/http/proxy_settings.py new file mode 100644 index 0000000..6dbf5ea --- /dev/null +++ b/paypalserversdk/http/proxy_settings.py @@ -0,0 +1,14 @@ + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from apimatic_core.http.configurations.proxy_settings import ProxySettings as CoreProxySettings + +class ProxySettings(CoreProxySettings): + """ + A simple data model for configuring HTTP(S) proxy settings. + """ diff --git a/paypalserversdk/models/__init__.py b/paypalserversdk/models/__init__.py index 15e47a5..335b2ae 100644 --- a/paypalserversdk/models/__init__.py +++ b/paypalserversdk/models/__init__.py @@ -1,280 +1,363 @@ __all__ = [ - 'apple_pay_card_response', 'activity_timestamps', - 'amount_with_breakdown', - 'apple_pay_experience_context', - 'authentication_response', - 'authorization_with_additional_data', - 'billing_cycle', - 'blik_one_click_payment_object', - 'card_customer_information', - 'card_response', - 'confirm_order_request', - 'customer_information', 'amount_breakdown', + 'amount_with_breakdown', + 'app_switch_context', 'apple_pay_payment_object', 'apple_pay_attributes', 'apple_pay_attributes_response', + 'apple_pay_card_response', + 'apple_pay_decrypted_token_data', + 'apple_pay_experience_context', 'apple_pay_payment_data', + 'apple_pay_request', 'assurance_details', + 'authentication_response', 'authorization', + 'link_description', + 'authorization_status_with_details', 'authorization_status_details', + 'authorization_with_additional_data', 'bancontact_payment_object', + 'bancontact_payment_request', + 'billing_cycle', 'bin_details', 'blik_payment_object', - 'blik_level_0_payment_object', - 'orders_capture', - 'capture_status_details', - 'card_stored_credential', - 'card_supplementary_data', - 'card_verification', - 'authorization_status_with_details', 'blik_experience_context', 'blik_one_click_payment_request', + 'blik_one_click_payment_object', 'blik_payment_request', + 'blik_level_0_payment_object', 'callback_configuration', + 'orders_capture', 'capture_status_with_details', - 'card_request', - 'cobranded_card', - 'apple_pay_decrypted_token_data', - 'apple_pay_request', - 'link_description', - 'bancontact_payment_request', + 'capture_status_details', 'card_attributes', 'card_attributes_response', + 'card_customer_information', 'card_experience_context', 'card_from_request', + 'card_request', + 'card_response', + 'card_stored_credential', + 'card_supplementary_data', 'card_vault_response', + 'card_verification', + 'cobranded_card', + 'confirm_order_request', + 'customer_information', 'platform_fee', - 'purchase_unit_request', - 'shipping_option', - 'google_pay_wallet_response', + 'money', 'eps_payment_object', 'eps_payment_request', + 'error_details', + 'exchange_rate', + 'experience_context', 'giropay_payment_object', + 'giropay_payment_request', + 'google_pay_wallet_response', + 'google_pay_card_response', + 'google_pay_decrypted_token_data', 'google_pay_experience_context', - 'order_application_context', - 'order_billing_plan', 'google_pay_request', - 'order_tracker_request', - 'p_24_payment_request', 'ideal_payment_object', + 'ideal_payment_request', 'item', + 'item_request', + 'level_2_card_processing_data', 'level_3_card_processing_data', - 'payment_method_preference', - 'paypal_wallet', - 'money', + 'line_item', + 'mobile_web_context', 'mybank_payment_object', - 'paypal_wallet_attributes', - 'network_token', - 'order_authorize_request', - 'order_request', - 'order_update_callback_error_response', - 'order_update_callback_request', - 'order_update_callback_response', - 'payer_base', - 'payment_source_response', - 'experience_context', - 'giropay_payment_request', - 'google_pay_card_response', - 'google_pay_decrypted_token_data', - 'level_2_card_processing_data', 'mybank_payment_request', - 'order', - 'order_capture_request', - 'payer', - 'payment_collection', - 'paypal_wallet_customer', - 'error_details', - 'exchange_rate', - 'ideal_payment_request', - 'line_item', + 'native_app_context', 'net_amount_breakdown_item', - 'network_transaction_reference', + 'network_token', + 'network_transaction', + 'order', + 'order_application_context', + 'order_authorize_request', 'order_authorize_response', + 'order_billing_plan', + 'order_capture_request', 'order_confirm_application_context', - 'order_update_callback_error_response_details', + 'order_request', + 'order_tracker_request', 'p_24_payment_object', + 'p_24_payment_request', 'participant_metadata', 'patch', 'payee_base', + 'payer', + 'payment_collection', 'payment_instruction', + 'payment_method_preference', 'payment_source', + 'payment_source_response', + 'paypal_wallet', + 'paypal_wallet_attributes', 'paypal_wallet_attributes_response', + 'paypal_wallet_customer', + 'paypal_wallet_experience_context', 'paypal_wallet_response', - 'phone_number', - 'processor_response', + 'paypal_wallet_stored_credential', 'paypal_wallet_vault_response', - 'pricing_scheme', - 'paypal_wallet_experience_context', + 'phone_number', 'phone_with_type', - 'paypal_wallet_stored_credential', + 'pricing_scheme', + 'processor_response', + 'purchase_unit', + 'purchase_unit_request', 'refund', 'refund_status_with_details', 'refund_status_details', 'risk_supplementary_data', 'seller_payable_breakdown', 'seller_protection', - 'purchase_unit', 'seller_receivable_breakdown', 'shipping_details', - 'shipping_options_purchase_unit', - 'token', - 'order_tracker_item', - 'universal_product_code', - 'venmo_wallet_additional_attributes', - 'google_pay_request_card', - 'order_capture_request_payment_source', + 'shipping_option', + 'sofort_payment_object', 'sofort_payment_request', - 'three_d_secure_authentication_response', - 'vault_instruction', - 'vault_response', - 'venmo_wallet_response', - 'address', - 'shipping_with_tracking_details', 'stored_payment_source', - 'vault_instruction_base', - 'venmo_wallet_vault_attributes', - 'venmo_wallet_attributes_response', - 'venmo_wallet_request', - 'name', - 'order_authorize_response_payment_source', - 'order_update_callback_shipping_address', - 'sofort_payment_object', 'supplementary_data', 'tax_info', + 'three_d_secure_authentication_response', + 'token', 'order_tracker_response', + 'order_tracker_item', 'trustly_payment_object', 'trustly_payment_request', + 'universal_product_code', + 'vault_instruction', + 'vault_instruction_base', + 'vault_response', + 'venmo_wallet_vault_attributes', + 'venmo_vault_response', + 'venmo_wallet_additional_attributes', + 'venmo_wallet_attributes_response', 'venmo_wallet_experience_context', + 'venmo_wallet_request', + 'venmo_wallet_response', + 'payer_base', + 'address', 'apple_pay_tokenized_card', 'google_pay_card', + 'google_pay_request_card', + 'name', 'order_authorize_request_payment_source', - 'order_update_callback_shipping_option', - 'refund_platform_fee', - 'payments_capture', - 'apple_pay_payment_token', + 'order_authorize_response_payment_source', + 'order_capture_request_payment_source', + 'paypal_wallet_customer_request', + 'paypal_wallet_vault_instruction', 'phone_number_with_country_code', + 'phone_number_with_optional_country_code', 'shipping_name', + 'shipping_with_tracking_details', + 'vault_customer', 'venmo_wallet_customer_information', + 'payment_authorization', + 'payments_capture', + 'captured_payment', 'capture_request', + 'refund_platform_fee', 'refund_payment_instruction', - 'payments_processor_response', 'reauthorize_request', - 'related_identifiers', - 'paypal_wallet_customer_request', - 'paypal_wallet_vault_instruction', - 'vault_customer', - 'payment_authorization', - 'captured_payment', 'refund_request', + 'related_identifiers', 'payment_supplementary_data', - 'supplementary_purchase_data', 'capture_payment_instruction', + 'apple_pay_payment_token', + 'vault_apple_pay_request', + 'bank_request', + 'vault_card_experience_context', 'card_payment_token_entity', - 'payment_token_response_payment_source', - 'phone', - 'vaulted_digital_wallet', - 'setup_token_request_card', - 'vault_venmo_experience_context', + 'card_verification_details', 'customer', - 'setup_token_request', + 'customer_vault_payment_tokens_response', 'payment_token_request_payment_source', + 'vault_experience_context', + 'network_transaction_reference_entity', + 'one_time_charge', + 'payment_token_response_payment_source', + 'payment_token_request', + 'payment_token_response', 'vault_paypal_wallet_request', 'paypal_payment_token', - 'vault_token_request', - 'card_authentication_response', - 'card_verification_processor_response', + 'phone', + 'plan', + 'sepa_debit_experience_context', + 'sepa_debit_request', + 'setup_token_request', 'setup_token_response', 'three_d_secure_card_authentication_response', + 'vault_token_request', + 'venmo_experience_context', 'vault_venmo_request', 'venmo_payment_token', + 'vaulted_digital_wallet', 'apple_pay_card', - 'payment_token_request_card', - 'setup_token_response_card', - 'vault_response_customer', - 'vaulted_digital_wallet_shipping_details', - 'card_verification_details', - 'customer_vault_payment_tokens_response', - 'vault_experience_context', - 'network_transaction_reference_entity', - 'one_time_charge', - 'payment_token_request', - 'payment_token_response', - 'plan', + 'apple_pay_request_card', + 'card_authentication_response', 'card_response_address', + 'card_verification_processor_response', 'customer_response', - 'setup_token_card_experience_context', + 'payment_token_request_card', + 'setup_token_request_card', 'setup_token_request_payment_source', + 'setup_token_response_card', 'setup_token_response_payment_source', + 'vault_response_customer', + 'vaulted_digital_wallet_shipping_details', + 'simple_postal_address_coarse_grained', + 'auction_information', + 'balance_information', + 'balances_response', + 'cart_information', + 'checkout_option', + 'transaction_search_error_details', + 'incentive_details', + 'incentive_information', + 'item_details', + 'tax_amount', + 'payer_name', + 'payer_information', + 'search_response', + 'shipping_information', + 'store_information', + 'transaction_details', + 'transaction_information', + 'subscription_amount_with_breakdown', + 'subscription_application_context', + 'subscription_billing_cycle', + 'billing_cycle_override', + 'subscriptions_card_attributes', + 'card_customer', + 'subscription_card_request', + 'card_response_with_billing_address', + 'subscription_customer_information', + 'cycle_execution', + 'failed_payment_details', + 'frequency', + 'merchant_preferences', + 'subscription_payer_name', + 'payment_preferences', + 'payment_preferences_override', + 'subscription_payment_source', + 'subscription_payment_source_response', + 'billing_plan', + 'plan_collection', + 'plan_override', + 'plan_request', + 'subscription_pricing_scheme', + 'pricing_tier', + 'subscriber', + 'subscriber_request', + 'subscription', + 'activate_subscription_request', + 'subscription_billing_information', + 'cancel_subscription_request', + 'capture_subscription_request', + 'subscription_collection', + 'create_subscription_request', + 'modify_subscription_request', + 'modify_subscription_response', + 'suspend_subscription', + 'taxes', + 'taxes_override', + 'subscription_transaction_details', + 'transactions_list', + 'update_pricing_scheme', + 'update_pricing_schemes_request', + 'last_payment_details', + 'payment_method', + 'plan_details', + 'subscription_patch_application_context', 'o_auth_token', - 'disbursement_mode', 'callback_events', + 'card_brand', 'card_type', + 'usage_pattern', 'checkout_payment_intent', + 'disbursement_mode', 'dispute_category', 'eci_flag', - 'card_brand', - 'usage_pattern', 'enrollment_status', - 'pa_res_status', - 'payment_initiator', 'liability_shift_indicator', 'order_status', + 'pa_res_status', 'payee_payment_method_preference', + 'payment_initiator', 'phone_type', 'shipment_carrier', - 'stored_payment_source_usage_type', - 'capture_incomplete_reason', - 'link_http_method', - 'order_application_context_landing_page', - 'orders_card_verification_method', - 'paypal_experience_landing_page', + 'shipping_type', + 'store_in_vault_instruction', 'stored_payment_source_payment_type', + 'stored_payment_source_usage_type', 'order_tracker_status', - 'authorization_status', - 'cvv_code', - 'item_category', - 'paypal_payment_token_customer_type', - 'shipping_type', + 'apple_pay_payment_data_type', 'authorization_incomplete_reason', + 'authorization_status', 'avs_code', + 'capture_incomplete_reason', + 'capture_status', + 'cvv_code', + 'experience_context_shipping_preference', + 'experience_status', 'fulfillment_type', + 'google_pay_authentication_method', 'google_pay_payment_method', + 'item_category', + 'link_http_method', + 'mobile_return_flow', + 'order_application_context_landing_page', 'order_application_context_shipping_preference', 'order_application_context_user_action', + 'orders_card_verification_method', + 'os_type', 'patch_op', 'payment_advice_code', + 'paypal_experience_landing_page', 'paypal_experience_user_action', - 'store_in_vault_instruction', - 'apple_pay_payment_data_type', - 'capture_status', - 'google_pay_authentication_method', - 'pricing_model', + 'paypal_payment_token_customer_type', 'paypal_payment_token_usage_type', + 'paypal_wallet_account_verification_status', + 'paypal_wallet_contact_preference', + 'paypal_wallet_context_shipping_preference', + 'paypal_wallet_vault_status', + 'pricing_model', 'processor_response_code', 'refund_incomplete_reason', 'refund_status', + 'return_flow', 'seller_protection_status', - 'shipping_preference', 'standard_entry_class_code', - 'vault_status', - 'venmo_payment_token_usage_pattern', - 'venmo_payment_token_usage_type', - 'payments_payment_advice_code', - 'paypal_wallet_account_verification_status', + 'tax_id_type', 'tenure_type', 'token_type', - 'paypal_wallet_contact_preference', - 'paypal_wallet_context_shipping_preference', - 'paypal_wallet_vault_status', - 'tax_id_type', 'upc_type', + 'vault_status', 'venmo_payment_token_customer_type', + 'venmo_payment_token_usage_pattern', + 'venmo_payment_token_usage_type', + 'venmo_vault_response_status', + 'venmo_wallet_experience_context_shipping_preference', + 'venmo_wallet_experience_context_user_action', 'vault_card_verification_method', 'card_verification_status', 'payment_token_status', + 'vault_user_action', 'vault_instruction_action', 'vault_token_request_type', + 'paypal_reference_id_type', + 'subscriptions_card_brand', + 'application_context_user_action', + 'capture_type', + 'interval_unit', + 'plan_request_status', + 'reason_code', + 'setup_fee_failure_action', + 'subscription_plan_status', + 'subscription_pricing_model', 'o_auth_provider_error', ] diff --git a/paypalserversdk/models/activate_subscription_request.py b/paypalserversdk/models/activate_subscription_request.py new file mode 100644 index 0000000..1529394 --- /dev/null +++ b/paypalserversdk/models/activate_subscription_request.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class ActivateSubscriptionRequest(object): + + """Implementation of the 'Activate Subscription Request' model. + + The activate subscription request details. + + Attributes: + reason (str): The reason for activation of a subscription. Required to + reactivate the subscription. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "reason": 'reason' + } + + _optionals = [ + 'reason', + ] + + def __init__(self, + reason=APIHelper.SKIP): + """Constructor for the ActivateSubscriptionRequest class""" + + # Initialize members of the class + if reason is not APIHelper.SKIP: + self.reason = reason + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + reason = dictionary.get("reason") if dictionary.get("reason") else APIHelper.SKIP + # Return an object of this model + return cls(reason) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'reason={(self.reason if hasattr(self, "reason") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'reason={(self.reason if hasattr(self, "reason") else None)!s})') diff --git a/paypalserversdk/models/amount_breakdown.py b/paypalserversdk/models/amount_breakdown.py index dc52fbf..f0acd90 100644 --- a/paypalserversdk/models/amount_breakdown.py +++ b/paypalserversdk/models/amount_breakdown.py @@ -31,8 +31,9 @@ class AmountBreakdown(object): transaction, such as a balance or payment due. shipping_discount (Money): The currency and amount for a financial transaction, such as a balance or payment due. - discount (Money): The currency and amount for a financial transaction, - such as a balance or payment due. + discount (Money): The discount amount and currency code. For list of + supported currencies and decimal precision, see the PayPal REST + APIs Currency Codes. """ diff --git a/paypalserversdk/models/app_switch_context.py b/paypalserversdk/models/app_switch_context.py new file mode 100644 index 0000000..29bc0ec --- /dev/null +++ b/paypalserversdk/models/app_switch_context.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.mobile_web_context import MobileWebContext +from paypalserversdk.models.native_app_context import NativeAppContext + + +class AppSwitchContext(object): + + """Implementation of the 'App Switch Context' model. + + Merchant provided details of the native app or mobile web browser to + facilitate buyer's app switch to the PayPal consumer app. + + Attributes: + native_app (NativeAppContext): Merchant provided, buyer's native app + preferences to app switch to the PayPal consumer app. + mobile_web (MobileWebContext): Buyer's mobile web browser context to + app switch to the PayPal consumer app. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "native_app": 'native_app', + "mobile_web": 'mobile_web' + } + + _optionals = [ + 'native_app', + 'mobile_web', + ] + + def __init__(self, + native_app=APIHelper.SKIP, + mobile_web=APIHelper.SKIP): + """Constructor for the AppSwitchContext class""" + + # Initialize members of the class + if native_app is not APIHelper.SKIP: + self.native_app = native_app + if mobile_web is not APIHelper.SKIP: + self.mobile_web = mobile_web + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + native_app = NativeAppContext.from_dictionary(dictionary.get('native_app')) if 'native_app' in dictionary.keys() else APIHelper.SKIP + mobile_web = MobileWebContext.from_dictionary(dictionary.get('mobile_web')) if 'mobile_web' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(native_app, + mobile_web) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'native_app={(self.native_app if hasattr(self, "native_app") else None)!r}, ' + f'mobile_web={(self.mobile_web if hasattr(self, "mobile_web") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'native_app={(self.native_app if hasattr(self, "native_app") else None)!s}, ' + f'mobile_web={(self.mobile_web if hasattr(self, "mobile_web") else None)!s})') diff --git a/paypalserversdk/models/apple_pay_request_card.py b/paypalserversdk/models/apple_pay_request_card.py new file mode 100644 index 0000000..40d44c8 --- /dev/null +++ b/paypalserversdk/models/apple_pay_request_card.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.address import Address + + +class ApplePayRequestCard(object): + + """Implementation of the 'Apple Pay Request Card' model. + + The payment card to be used to fund a payment. Can be a credit or debit + card. + + Attributes: + mtype (CardType): Type of card. i.e Credit, Debit and so on. + brand (CardBrand): The card network or brand. Applies to credit, + debit, gift, and payment cards. + billing_address (Address): The portable international postal address. + Maps to + [AddressValidationMetadata](https://github.com/googlei18n/libaddres + sinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling + form controls: the autocomplete + attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling- + form-controls-the-autocomplete-attribute). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "mtype": 'type', + "brand": 'brand', + "billing_address": 'billing_address' + } + + _optionals = [ + 'mtype', + 'brand', + 'billing_address', + ] + + def __init__(self, + mtype=APIHelper.SKIP, + brand=APIHelper.SKIP, + billing_address=APIHelper.SKIP): + """Constructor for the ApplePayRequestCard class""" + + # Initialize members of the class + if mtype is not APIHelper.SKIP: + self.mtype = mtype + if brand is not APIHelper.SKIP: + self.brand = brand + if billing_address is not APIHelper.SKIP: + self.billing_address = billing_address + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP + brand = dictionary.get("brand") if dictionary.get("brand") else APIHelper.SKIP + billing_address = Address.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(mtype, + brand, + billing_address) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' + f'brand={(self.brand if hasattr(self, "brand") else None)!r}, ' + f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' + f'brand={(self.brand if hasattr(self, "brand") else None)!s}, ' + f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s})') diff --git a/paypalserversdk/models/apple_pay_tokenized_card.py b/paypalserversdk/models/apple_pay_tokenized_card.py index b0a6547..c4e69d9 100644 --- a/paypalserversdk/models/apple_pay_tokenized_card.py +++ b/paypalserversdk/models/apple_pay_tokenized_card.py @@ -22,8 +22,8 @@ class ApplePayTokenizedCard(object): expiry (str): The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). - card_type (CardBrand): The card network or brand. Applies to credit, - debit, gift, and payment cards. + card_type (CardBrand): The card brand or network. Typically used in + the response. mtype (CardType): Type of card. i.e Credit, Debit and so on. brand (CardBrand): The card network or brand. Applies to credit, debit, gift, and payment cards. diff --git a/paypalserversdk/models/application_context_user_action.py b/paypalserversdk/models/application_context_user_action.py new file mode 100644 index 0000000..8ca245b --- /dev/null +++ b/paypalserversdk/models/application_context_user_action.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class ApplicationContextUserAction(object): + + """Implementation of the 'Application Context User Action' enum. + + Configures the label name to `Continue` or `Subscribe Now` for + subscription consent experience. + + Attributes: + CONTINUE: After you redirect the customer to the PayPal subscription + consent page, a Continue button appears. Use this option when you + want to control the activation of the subscription and do not want + PayPal to activate the subscription. + SUBSCRIBE_NOW: After you redirect the customer to the PayPal + subscription consent page, a Subscribe Now button appears. Use + this option when you want PayPal to activate the subscription. + + """ + CONTINUE = 'CONTINUE' + + SUBSCRIBE_NOW = 'SUBSCRIBE_NOW' + diff --git a/paypalserversdk/models/auction_information.py b/paypalserversdk/models/auction_information.py new file mode 100644 index 0000000..2a13109 --- /dev/null +++ b/paypalserversdk/models/auction_information.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class AuctionInformation(object): + + """Implementation of the 'Auction Information' model. + + The auction information. + + Attributes: + auction_site (str): The name of the auction site. + auction_item_site (str): The auction site URL. + auction_buyer_id (str): The ID of the buyer who makes the purchase in + the auction. This ID might be different from the payer ID provided + for the payment. + auction_closing_date (str): 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. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "auction_site": 'auction_site', + "auction_item_site": 'auction_item_site', + "auction_buyer_id": 'auction_buyer_id', + "auction_closing_date": 'auction_closing_date' + } + + _optionals = [ + 'auction_site', + 'auction_item_site', + 'auction_buyer_id', + 'auction_closing_date', + ] + + def __init__(self, + auction_site=APIHelper.SKIP, + auction_item_site=APIHelper.SKIP, + auction_buyer_id=APIHelper.SKIP, + auction_closing_date=APIHelper.SKIP): + """Constructor for the AuctionInformation class""" + + # Initialize members of the class + if auction_site is not APIHelper.SKIP: + self.auction_site = auction_site + if auction_item_site is not APIHelper.SKIP: + self.auction_item_site = auction_item_site + if auction_buyer_id is not APIHelper.SKIP: + self.auction_buyer_id = auction_buyer_id + if auction_closing_date is not APIHelper.SKIP: + self.auction_closing_date = auction_closing_date + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + auction_site = dictionary.get("auction_site") if dictionary.get("auction_site") else APIHelper.SKIP + auction_item_site = dictionary.get("auction_item_site") if dictionary.get("auction_item_site") else APIHelper.SKIP + auction_buyer_id = dictionary.get("auction_buyer_id") if dictionary.get("auction_buyer_id") else APIHelper.SKIP + auction_closing_date = dictionary.get("auction_closing_date") if dictionary.get("auction_closing_date") else APIHelper.SKIP + # Return an object of this model + return cls(auction_site, + auction_item_site, + auction_buyer_id, + auction_closing_date) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'auction_site={(self.auction_site if hasattr(self, "auction_site") else None)!r}, ' + f'auction_item_site={(self.auction_item_site if hasattr(self, "auction_item_site") else None)!r}, ' + f'auction_buyer_id={(self.auction_buyer_id if hasattr(self, "auction_buyer_id") else None)!r}, ' + f'auction_closing_date={(self.auction_closing_date if hasattr(self, "auction_closing_date") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'auction_site={(self.auction_site if hasattr(self, "auction_site") else None)!s}, ' + f'auction_item_site={(self.auction_item_site if hasattr(self, "auction_item_site") else None)!s}, ' + f'auction_buyer_id={(self.auction_buyer_id if hasattr(self, "auction_buyer_id") else None)!s}, ' + f'auction_closing_date={(self.auction_closing_date if hasattr(self, "auction_closing_date") else None)!s})') diff --git a/paypalserversdk/models/authorization.py b/paypalserversdk/models/authorization.py index 956c1bb..5ee6e3f 100644 --- a/paypalserversdk/models/authorization.py +++ b/paypalserversdk/models/authorization.py @@ -10,7 +10,7 @@ from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails from paypalserversdk.models.link_description import LinkDescription from paypalserversdk.models.money import Money -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction from paypalserversdk.models.seller_protection import SellerProtection @@ -33,8 +33,8 @@ class Authorization(object): custom_id (str): The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. - network_transaction_reference (NetworkTransactionReference): Reference - values used by the card network to identify a transaction. + network_transaction_reference (NetworkTransaction): Reference values + used by the card network to identify a transaction. seller_protection (SellerProtection): The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-pr @@ -156,7 +156,7 @@ def from_dictionary(cls, amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP - network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP seller_protection = SellerProtection.from_dictionary(dictionary.get('seller_protection')) if 'seller_protection' in dictionary.keys() else APIHelper.SKIP expiration_time = dictionary.get("expiration_time") if dictionary.get("expiration_time") else APIHelper.SKIP links = None diff --git a/paypalserversdk/models/authorization_with_additional_data.py b/paypalserversdk/models/authorization_with_additional_data.py index 30dd584..de3c500 100644 --- a/paypalserversdk/models/authorization_with_additional_data.py +++ b/paypalserversdk/models/authorization_with_additional_data.py @@ -10,7 +10,7 @@ from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails from paypalserversdk.models.link_description import LinkDescription from paypalserversdk.models.money import Money -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction from paypalserversdk.models.processor_response import ProcessorResponse from paypalserversdk.models.seller_protection import SellerProtection @@ -36,8 +36,8 @@ class AuthorizationWithAdditionalData(object): custom_id (str): The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. - network_transaction_reference (NetworkTransactionReference): Reference - values used by the card network to identify a transaction. + network_transaction_reference (NetworkTransaction): Reference values + used by the card network to identify a transaction. seller_protection (SellerProtection): The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-pr @@ -167,7 +167,7 @@ def from_dictionary(cls, amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP - network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP seller_protection = SellerProtection.from_dictionary(dictionary.get('seller_protection')) if 'seller_protection' in dictionary.keys() else APIHelper.SKIP expiration_time = dictionary.get("expiration_time") if dictionary.get("expiration_time") else APIHelper.SKIP links = None diff --git a/paypalserversdk/models/balance_information.py b/paypalserversdk/models/balance_information.py new file mode 100644 index 0000000..4a1b097 --- /dev/null +++ b/paypalserversdk/models/balance_information.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class BalanceInformation(object): + + """Implementation of the 'Balance Information' model. + + The Balance information. + + Attributes: + currency (str): The [three-character ISO-4217 currency + code](/docs/integration/direct/rest/currency-codes/) that + identifies the currency. + primary (bool): Optional field representing if the currency is primary + currency or not. + total_balance (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + available_balance (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + withheld_balance (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "currency": 'currency', + "total_balance": 'total_balance', + "primary": 'primary', + "available_balance": 'available_balance', + "withheld_balance": 'withheld_balance' + } + + _optionals = [ + 'primary', + 'available_balance', + 'withheld_balance', + ] + + def __init__(self, + currency=None, + total_balance=None, + primary=APIHelper.SKIP, + available_balance=APIHelper.SKIP, + withheld_balance=APIHelper.SKIP): + """Constructor for the BalanceInformation class""" + + # Initialize members of the class + self.currency = currency + if primary is not APIHelper.SKIP: + self.primary = primary + self.total_balance = total_balance + if available_balance is not APIHelper.SKIP: + self.available_balance = available_balance + if withheld_balance is not APIHelper.SKIP: + self.withheld_balance = withheld_balance + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + currency = dictionary.get("currency") if dictionary.get("currency") else None + total_balance = Money.from_dictionary(dictionary.get('total_balance')) if dictionary.get('total_balance') else None + primary = dictionary.get("primary") if "primary" in dictionary.keys() else APIHelper.SKIP + available_balance = Money.from_dictionary(dictionary.get('available_balance')) if 'available_balance' in dictionary.keys() else APIHelper.SKIP + withheld_balance = Money.from_dictionary(dictionary.get('withheld_balance')) if 'withheld_balance' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(currency, + total_balance, + primary, + available_balance, + withheld_balance) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'currency={self.currency!r}, ' + f'primary={(self.primary if hasattr(self, "primary") else None)!r}, ' + f'total_balance={self.total_balance!r}, ' + f'available_balance={(self.available_balance if hasattr(self, "available_balance") else None)!r}, ' + f'withheld_balance={(self.withheld_balance if hasattr(self, "withheld_balance") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'currency={self.currency!s}, ' + f'primary={(self.primary if hasattr(self, "primary") else None)!s}, ' + f'total_balance={self.total_balance!s}, ' + f'available_balance={(self.available_balance if hasattr(self, "available_balance") else None)!s}, ' + f'withheld_balance={(self.withheld_balance if hasattr(self, "withheld_balance") else None)!s})') diff --git a/paypalserversdk/models/balances_response.py b/paypalserversdk/models/balances_response.py new file mode 100644 index 0000000..76d01d6 --- /dev/null +++ b/paypalserversdk/models/balances_response.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.balance_information import BalanceInformation + + +class BalancesResponse(object): + + """Implementation of the 'Balances Response' model. + + The balances response information. + + Attributes: + balances (List[BalanceInformation]): An array of balance detail + objects. + account_id (str): The PayPal payer ID, which is a masked version of + the PayPal account number intended for use with third parties. The + account number is reversibly encrypted and a proprietary variant + of Base32 is used to encode the result. + as_of_time (str): 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. + last_refresh_time (str): 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. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "balances": 'balances', + "account_id": 'account_id', + "as_of_time": 'as_of_time', + "last_refresh_time": 'last_refresh_time' + } + + _optionals = [ + 'balances', + 'account_id', + 'as_of_time', + 'last_refresh_time', + ] + + def __init__(self, + balances=APIHelper.SKIP, + account_id=APIHelper.SKIP, + as_of_time=APIHelper.SKIP, + last_refresh_time=APIHelper.SKIP): + """Constructor for the BalancesResponse class""" + + # Initialize members of the class + if balances is not APIHelper.SKIP: + self.balances = balances + if account_id is not APIHelper.SKIP: + self.account_id = account_id + if as_of_time is not APIHelper.SKIP: + self.as_of_time = as_of_time + if last_refresh_time is not APIHelper.SKIP: + self.last_refresh_time = last_refresh_time + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + balances = None + if dictionary.get('balances') is not None: + balances = [BalanceInformation.from_dictionary(x) for x in dictionary.get('balances')] + else: + balances = APIHelper.SKIP + account_id = dictionary.get("account_id") if dictionary.get("account_id") else APIHelper.SKIP + as_of_time = dictionary.get("as_of_time") if dictionary.get("as_of_time") else APIHelper.SKIP + last_refresh_time = dictionary.get("last_refresh_time") if dictionary.get("last_refresh_time") else APIHelper.SKIP + # Return an object of this model + return cls(balances, + account_id, + as_of_time, + last_refresh_time) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'balances={(self.balances if hasattr(self, "balances") else None)!r}, ' + f'account_id={(self.account_id if hasattr(self, "account_id") else None)!r}, ' + f'as_of_time={(self.as_of_time if hasattr(self, "as_of_time") else None)!r}, ' + f'last_refresh_time={(self.last_refresh_time if hasattr(self, "last_refresh_time") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'balances={(self.balances if hasattr(self, "balances") else None)!s}, ' + f'account_id={(self.account_id if hasattr(self, "account_id") else None)!s}, ' + f'as_of_time={(self.as_of_time if hasattr(self, "as_of_time") else None)!s}, ' + f'last_refresh_time={(self.last_refresh_time if hasattr(self, "last_refresh_time") else None)!s})') diff --git a/paypalserversdk/models/bank_request.py b/paypalserversdk/models/bank_request.py new file mode 100644 index 0000000..16e30a2 --- /dev/null +++ b/paypalserversdk/models/bank_request.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.sepa_debit_request import SepaDebitRequest + + +class BankRequest(object): + + """Implementation of the 'Bank Request' model. + + A Resource representing a request to vault a Bank used for ACH Debit. + + Attributes: + ach_debit (Any): A Resource representing a request to vault a ACH + Debit. + sepa_debit (SepaDebitRequest): An API resource denoting a request to + securely store a SEPA Debit. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "ach_debit": 'ach_debit', + "sepa_debit": 'sepa_debit' + } + + _optionals = [ + 'ach_debit', + 'sepa_debit', + ] + + def __init__(self, + ach_debit=APIHelper.SKIP, + sepa_debit=APIHelper.SKIP): + """Constructor for the BankRequest class""" + + # Initialize members of the class + if ach_debit is not APIHelper.SKIP: + self.ach_debit = ach_debit + if sepa_debit is not APIHelper.SKIP: + self.sepa_debit = sepa_debit + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + ach_debit = dictionary.get("ach_debit") if dictionary.get("ach_debit") else APIHelper.SKIP + sepa_debit = SepaDebitRequest.from_dictionary(dictionary.get('sepa_debit')) if 'sepa_debit' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(ach_debit, + sepa_debit) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'ach_debit={(self.ach_debit if hasattr(self, "ach_debit") else None)!r}, ' + f'sepa_debit={(self.sepa_debit if hasattr(self, "sepa_debit") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'ach_debit={(self.ach_debit if hasattr(self, "ach_debit") else None)!s}, ' + f'sepa_debit={(self.sepa_debit if hasattr(self, "sepa_debit") else None)!s})') diff --git a/paypalserversdk/models/billing_cycle.py b/paypalserversdk/models/billing_cycle.py index 0ffd3c8..aa91954 100644 --- a/paypalserversdk/models/billing_cycle.py +++ b/paypalserversdk/models/billing_cycle.py @@ -25,7 +25,6 @@ class BillingCycle(object): identifies if the billing cycle is a trial(free or discounted) or regular billing cycle. pricing_scheme (PricingScheme): The pricing scheme details. - frequency (Any): The frequency details for this billing cycle. total_cycles (int): The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). @@ -50,7 +49,6 @@ class BillingCycle(object): _names = { "tenure_type": 'tenure_type', "pricing_scheme": 'pricing_scheme', - "frequency": 'frequency', "total_cycles": 'total_cycles', "sequence": 'sequence', "start_date": 'start_date' @@ -58,7 +56,6 @@ class BillingCycle(object): _optionals = [ 'pricing_scheme', - 'frequency', 'total_cycles', 'sequence', 'start_date', @@ -67,7 +64,6 @@ class BillingCycle(object): def __init__(self, tenure_type=None, pricing_scheme=APIHelper.SKIP, - frequency=APIHelper.SKIP, total_cycles=1, sequence=1, start_date=APIHelper.SKIP): @@ -77,8 +73,6 @@ def __init__(self, self.tenure_type = tenure_type if pricing_scheme is not APIHelper.SKIP: self.pricing_scheme = pricing_scheme - if frequency is not APIHelper.SKIP: - self.frequency = frequency self.total_cycles = total_cycles self.sequence = sequence if start_date is not APIHelper.SKIP: @@ -105,14 +99,12 @@ def from_dictionary(cls, # Extract variables from the dictionary tenure_type = dictionary.get("tenure_type") if dictionary.get("tenure_type") else None pricing_scheme = PricingScheme.from_dictionary(dictionary.get('pricing_scheme')) if 'pricing_scheme' in dictionary.keys() else APIHelper.SKIP - frequency = dictionary.get("frequency") if dictionary.get("frequency") else APIHelper.SKIP total_cycles = dictionary.get("total_cycles") if dictionary.get("total_cycles") else 1 sequence = dictionary.get("sequence") if dictionary.get("sequence") else 1 start_date = dictionary.get("start_date") if dictionary.get("start_date") else APIHelper.SKIP # Return an object of this model return cls(tenure_type, pricing_scheme, - frequency, total_cycles, sequence, start_date) @@ -121,7 +113,6 @@ def __repr__(self): return (f'{self.__class__.__name__}(' f'tenure_type={self.tenure_type!r}, ' f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'frequency={(self.frequency if hasattr(self, "frequency") else None)!r}, ' f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!r}, ' f'sequence={(self.sequence if hasattr(self, "sequence") else None)!r}, ' f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r})') @@ -130,7 +121,6 @@ def __str__(self): return (f'{self.__class__.__name__}(' f'tenure_type={self.tenure_type!s}, ' f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'frequency={(self.frequency if hasattr(self, "frequency") else None)!s}, ' f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!s}, ' f'sequence={(self.sequence if hasattr(self, "sequence") else None)!s}, ' f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s})') diff --git a/paypalserversdk/models/billing_cycle_override.py b/paypalserversdk/models/billing_cycle_override.py new file mode 100644 index 0000000..cffd173 --- /dev/null +++ b/paypalserversdk/models/billing_cycle_override.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme + + +class BillingCycleOverride(object): + + """Implementation of the 'Billing Cycle Override' model. + + The billing cycle details to override at subscription level. The + subscription billing cycle definition has to adhere to the plan billing + cycle definition. + + Attributes: + pricing_scheme (SubscriptionPricingScheme): The pricing scheme details. + sequence (int): The order in which this cycle is to run among other + billing cycles. For example, a trial billing cycle has a + `sequence` of `1` while a regular billing cycle has a `sequence` + of `2`, so that trial cycle runs before the regular cycle. + total_cycles (int): The number of times this billing cycle gets + executed. Trial billing cycles can only be executed a finite + number of times (value between 1 and 999 for total_cycles). + Regular billing cycles can be executed infinite times (value of 0 + for total_cycles) or a finite number of times (value between 1 and + 999 for total_cycles). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "sequence": 'sequence', + "pricing_scheme": 'pricing_scheme', + "total_cycles": 'total_cycles' + } + + _optionals = [ + 'pricing_scheme', + 'total_cycles', + ] + + def __init__(self, + sequence=None, + pricing_scheme=APIHelper.SKIP, + total_cycles=APIHelper.SKIP): + """Constructor for the BillingCycleOverride class""" + + # Initialize members of the class + if pricing_scheme is not APIHelper.SKIP: + self.pricing_scheme = pricing_scheme + self.sequence = sequence + if total_cycles is not APIHelper.SKIP: + self.total_cycles = total_cycles + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + sequence = dictionary.get("sequence") if dictionary.get("sequence") else None + pricing_scheme = SubscriptionPricingScheme.from_dictionary(dictionary.get('pricing_scheme')) if 'pricing_scheme' in dictionary.keys() else APIHelper.SKIP + total_cycles = dictionary.get("total_cycles") if dictionary.get("total_cycles") else APIHelper.SKIP + # Return an object of this model + return cls(sequence, + pricing_scheme, + total_cycles) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' + f'sequence={self.sequence!r}, ' + f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' + f'sequence={self.sequence!s}, ' + f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!s})') diff --git a/paypalserversdk/models/billing_plan.py b/paypalserversdk/models/billing_plan.py new file mode 100644 index 0000000..12434a3 --- /dev/null +++ b/paypalserversdk/models/billing_plan.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.merchant_preferences import MerchantPreferences +from paypalserversdk.models.payment_preferences import PaymentPreferences +from paypalserversdk.models.subscription_billing_cycle import SubscriptionBillingCycle +from paypalserversdk.models.taxes import Taxes + + +class BillingPlan(object): + + """Implementation of the 'Billing Plan' model. + + The plan details. + + Attributes: + id (str): The unique PayPal-generated ID for the plan. + product_id (str): The ID for the product. + name (str): The plan name. + status (SubscriptionPlanStatus): The plan status. + description (str): The detailed description of the plan. + billing_cycles (List[SubscriptionBillingCycle]): An array of billing + cycles for trial billing and regular billing. A plan can have at + most two trial cycles and only one regular cycle. + payment_preferences (PaymentPreferences): The payment preferences for + a subscription. + merchant_preferences (MerchantPreferences): The merchant preferences + for a subscription. + taxes (Taxes): The tax details. + quantity_supported (bool): Indicates whether you can subscribe to this + plan by providing a quantity for the goods or service. + create_time (str): 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. + update_time (str): 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. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/docs/api/reference/api-responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": 'id', + "product_id": 'product_id', + "name": 'name', + "status": 'status', + "description": 'description', + "billing_cycles": 'billing_cycles', + "payment_preferences": 'payment_preferences', + "merchant_preferences": 'merchant_preferences', + "taxes": 'taxes', + "quantity_supported": 'quantity_supported', + "create_time": 'create_time', + "update_time": 'update_time', + "links": 'links' + } + + _optionals = [ + 'id', + 'product_id', + 'name', + 'status', + 'description', + 'billing_cycles', + 'payment_preferences', + 'merchant_preferences', + 'taxes', + 'quantity_supported', + 'create_time', + 'update_time', + 'links', + ] + + def __init__(self, + id=APIHelper.SKIP, + product_id=APIHelper.SKIP, + name=APIHelper.SKIP, + status=APIHelper.SKIP, + description=APIHelper.SKIP, + billing_cycles=APIHelper.SKIP, + payment_preferences=APIHelper.SKIP, + merchant_preferences=APIHelper.SKIP, + taxes=APIHelper.SKIP, + quantity_supported=False, + create_time=APIHelper.SKIP, + update_time=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the BillingPlan class""" + + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if product_id is not APIHelper.SKIP: + self.product_id = product_id + if name is not APIHelper.SKIP: + self.name = name + if status is not APIHelper.SKIP: + self.status = status + if description is not APIHelper.SKIP: + self.description = description + if billing_cycles is not APIHelper.SKIP: + self.billing_cycles = billing_cycles + if payment_preferences is not APIHelper.SKIP: + self.payment_preferences = payment_preferences + if merchant_preferences is not APIHelper.SKIP: + self.merchant_preferences = merchant_preferences + if taxes is not APIHelper.SKIP: + self.taxes = taxes + self.quantity_supported = quantity_supported + if create_time is not APIHelper.SKIP: + self.create_time = create_time + if update_time is not APIHelper.SKIP: + self.update_time = update_time + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP + product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP + name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP + status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP + description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP + billing_cycles = None + if dictionary.get('billing_cycles') is not None: + billing_cycles = [SubscriptionBillingCycle.from_dictionary(x) for x in dictionary.get('billing_cycles')] + else: + billing_cycles = APIHelper.SKIP + payment_preferences = PaymentPreferences.from_dictionary(dictionary.get('payment_preferences')) if 'payment_preferences' in dictionary.keys() else APIHelper.SKIP + merchant_preferences = MerchantPreferences.from_dictionary(dictionary.get('merchant_preferences')) if 'merchant_preferences' in dictionary.keys() else APIHelper.SKIP + taxes = Taxes.from_dictionary(dictionary.get('taxes')) if 'taxes' in dictionary.keys() else APIHelper.SKIP + quantity_supported = dictionary.get("quantity_supported") if dictionary.get("quantity_supported") else False + create_time = dictionary.get("create_time") if dictionary.get("create_time") else APIHelper.SKIP + update_time = dictionary.get("update_time") if dictionary.get("update_time") else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(id, + product_id, + name, + status, + description, + billing_cycles, + payment_preferences, + merchant_preferences, + taxes, + quantity_supported, + create_time, + update_time, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!r}, ' + f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'status={(self.status if hasattr(self, "status") else None)!r}, ' + f'description={(self.description if hasattr(self, "description") else None)!r}, ' + f'billing_cycles={(self.billing_cycles if hasattr(self, "billing_cycles") else None)!r}, ' + f'payment_preferences={(self.payment_preferences if hasattr(self, "payment_preferences") else None)!r}, ' + f'merchant_preferences={(self.merchant_preferences if hasattr(self, "merchant_preferences") else None)!r}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' + f'quantity_supported={(self.quantity_supported if hasattr(self, "quantity_supported") else None)!r}, ' + f'create_time={(self.create_time if hasattr(self, "create_time") else None)!r}, ' + f'update_time={(self.update_time if hasattr(self, "update_time") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!s}, ' + f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'status={(self.status if hasattr(self, "status") else None)!s}, ' + f'description={(self.description if hasattr(self, "description") else None)!s}, ' + f'billing_cycles={(self.billing_cycles if hasattr(self, "billing_cycles") else None)!s}, ' + f'payment_preferences={(self.payment_preferences if hasattr(self, "payment_preferences") else None)!s}, ' + f'merchant_preferences={(self.merchant_preferences if hasattr(self, "merchant_preferences") else None)!s}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' + f'quantity_supported={(self.quantity_supported if hasattr(self, "quantity_supported") else None)!s}, ' + f'create_time={(self.create_time if hasattr(self, "create_time") else None)!s}, ' + f'update_time={(self.update_time if hasattr(self, "update_time") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/blik_experience_context.py b/paypalserversdk/models/blik_experience_context.py index 7021c29..d34627d 100644 --- a/paypalserversdk/models/blik_experience_context.py +++ b/paypalserversdk/models/blik_experience_context.py @@ -31,8 +31,8 @@ class BlikExperienceContext(object): [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/). - shipping_preference (ShippingPreference): The location from which the - shipping address is derived. + shipping_preference (ExperienceContextShippingPreference): The + location from which the shipping address is derived. return_url (str): Describes the URL. cancel_url (str): Describes the URL. consumer_ip (str): An Internet Protocol address (IP address). This diff --git a/paypalserversdk/models/cancel_subscription_request.py b/paypalserversdk/models/cancel_subscription_request.py new file mode 100644 index 0000000..f773775 --- /dev/null +++ b/paypalserversdk/models/cancel_subscription_request.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class CancelSubscriptionRequest(object): + + """Implementation of the 'Cancel Subscription Request' model. + + The cancel subscription request details. + + Attributes: + reason (str): The reason for the cancellation of a subscription. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "reason": 'reason' + } + + def __init__(self, + reason=None): + """Constructor for the CancelSubscriptionRequest class""" + + # Initialize members of the class + self.reason = reason + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + reason = dictionary.get("reason") if dictionary.get("reason") else None + # Return an object of this model + return cls(reason) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'reason={self.reason!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'reason={self.reason!s})') diff --git a/paypalserversdk/models/capture_request.py b/paypalserversdk/models/capture_request.py index 96a7011..700e83d 100644 --- a/paypalserversdk/models/capture_request.py +++ b/paypalserversdk/models/capture_request.py @@ -15,15 +15,15 @@ class CaptureRequest(object): """Implementation of the 'Capture Request' model. + Captures either a portion or the full authorized amount of an authorized + payment. + Attributes: + amount (Money): The currency and amount for a financial transaction, + such as a balance or payment due. invoice_id (str): The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. - note_to_payer (str): An informational note about this settlement. - Appears in both the payer's transaction history and the emails - that the payer receives. - amount (Money): The currency and amount for a financial transaction, - such as a balance or payment due. final_capture (bool): Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the @@ -33,6 +33,9 @@ class CaptureRequest(object): payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. + note_to_payer (str): An informational note about this settlement. + Appears in both the payer's transaction history and the emails + that the payer receives. soft_descriptor (str): The payment descriptor on the payer's account statement. @@ -40,42 +43,42 @@ class CaptureRequest(object): # Create a mapping from Model property names to API property names _names = { - "invoice_id": 'invoice_id', - "note_to_payer": 'note_to_payer', "amount": 'amount', + "invoice_id": 'invoice_id', "final_capture": 'final_capture', "payment_instruction": 'payment_instruction', + "note_to_payer": 'note_to_payer', "soft_descriptor": 'soft_descriptor' } _optionals = [ - 'invoice_id', - 'note_to_payer', 'amount', + 'invoice_id', 'final_capture', 'payment_instruction', + 'note_to_payer', 'soft_descriptor', ] def __init__(self, - invoice_id=APIHelper.SKIP, - note_to_payer=APIHelper.SKIP, amount=APIHelper.SKIP, + invoice_id=APIHelper.SKIP, final_capture=False, payment_instruction=APIHelper.SKIP, + note_to_payer=APIHelper.SKIP, soft_descriptor=APIHelper.SKIP): """Constructor for the CaptureRequest class""" # Initialize members of the class - if invoice_id is not APIHelper.SKIP: - self.invoice_id = invoice_id - if note_to_payer is not APIHelper.SKIP: - self.note_to_payer = note_to_payer if amount is not APIHelper.SKIP: self.amount = amount + if invoice_id is not APIHelper.SKIP: + self.invoice_id = invoice_id self.final_capture = final_capture if payment_instruction is not APIHelper.SKIP: self.payment_instruction = payment_instruction + if note_to_payer is not APIHelper.SKIP: + self.note_to_payer = note_to_payer if soft_descriptor is not APIHelper.SKIP: self.soft_descriptor = soft_descriptor @@ -98,34 +101,34 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP - note_to_payer = dictionary.get("note_to_payer") if dictionary.get("note_to_payer") else APIHelper.SKIP amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP + invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP final_capture = dictionary.get("final_capture") if dictionary.get("final_capture") else False payment_instruction = CapturePaymentInstruction.from_dictionary(dictionary.get('payment_instruction')) if 'payment_instruction' in dictionary.keys() else APIHelper.SKIP + note_to_payer = dictionary.get("note_to_payer") if dictionary.get("note_to_payer") else APIHelper.SKIP soft_descriptor = dictionary.get("soft_descriptor") if dictionary.get("soft_descriptor") else APIHelper.SKIP # Return an object of this model - return cls(invoice_id, - note_to_payer, - amount, + return cls(amount, + invoice_id, final_capture, payment_instruction, + note_to_payer, soft_descriptor) def __repr__(self): return (f'{self.__class__.__name__}(' - f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!r}, ' - f'note_to_payer={(self.note_to_payer if hasattr(self, "note_to_payer") else None)!r}, ' f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' + f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!r}, ' f'final_capture={(self.final_capture if hasattr(self, "final_capture") else None)!r}, ' f'payment_instruction={(self.payment_instruction if hasattr(self, "payment_instruction") else None)!r}, ' + f'note_to_payer={(self.note_to_payer if hasattr(self, "note_to_payer") else None)!r}, ' f'soft_descriptor={(self.soft_descriptor if hasattr(self, "soft_descriptor") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' - f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!s}, ' - f'note_to_payer={(self.note_to_payer if hasattr(self, "note_to_payer") else None)!s}, ' f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' + f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!s}, ' f'final_capture={(self.final_capture if hasattr(self, "final_capture") else None)!s}, ' f'payment_instruction={(self.payment_instruction if hasattr(self, "payment_instruction") else None)!s}, ' + f'note_to_payer={(self.note_to_payer if hasattr(self, "note_to_payer") else None)!s}, ' f'soft_descriptor={(self.soft_descriptor if hasattr(self, "soft_descriptor") else None)!s})') diff --git a/paypalserversdk/models/capture_subscription_request.py b/paypalserversdk/models/capture_subscription_request.py new file mode 100644 index 0000000..ed1cf40 --- /dev/null +++ b/paypalserversdk/models/capture_subscription_request.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.models.money import Money + + +class CaptureSubscriptionRequest(object): + + """Implementation of the 'Capture Subscription Request' model. + + The charge amount from the subscriber. + + Attributes: + note (str): The reason or note for the subscription charge. + capture_type (CaptureType): The type of capture. + amount (Money): The currency and amount for a financial transaction, + such as a balance or payment due. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "note": 'note', + "capture_type": 'capture_type', + "amount": 'amount' + } + + def __init__(self, + note=None, + capture_type=None, + amount=None): + """Constructor for the CaptureSubscriptionRequest class""" + + # Initialize members of the class + self.note = note + self.capture_type = capture_type + self.amount = amount + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + note = dictionary.get("note") if dictionary.get("note") else None + capture_type = dictionary.get("capture_type") if dictionary.get("capture_type") else None + amount = Money.from_dictionary(dictionary.get('amount')) if dictionary.get('amount') else None + # Return an object of this model + return cls(note, + capture_type, + amount) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'note={self.note!r}, ' + f'capture_type={self.capture_type!r}, ' + f'amount={self.amount!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'note={self.note!s}, ' + f'capture_type={self.capture_type!s}, ' + f'amount={self.amount!s})') diff --git a/paypalserversdk/models/capture_type.py b/paypalserversdk/models/capture_type.py new file mode 100644 index 0000000..aed0766 --- /dev/null +++ b/paypalserversdk/models/capture_type.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class CaptureType(object): + + """Implementation of the 'Capture Type' enum. + + The type of capture. + + Attributes: + OUTSTANDING_BALANCE: The outstanding balance that the subscriber must + clear. + + """ + OUTSTANDING_BALANCE = 'OUTSTANDING_BALANCE' + diff --git a/paypalserversdk/models/captured_payment.py b/paypalserversdk/models/captured_payment.py index 9a141fe..b7d2477 100644 --- a/paypalserversdk/models/captured_payment.py +++ b/paypalserversdk/models/captured_payment.py @@ -10,10 +10,10 @@ from paypalserversdk.models.capture_status_details import CaptureStatusDetails from paypalserversdk.models.link_description import LinkDescription from paypalserversdk.models.money import Money -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction from paypalserversdk.models.payee_base import PayeeBase from paypalserversdk.models.payment_supplementary_data import PaymentSupplementaryData -from paypalserversdk.models.payments_processor_response import PaymentsProcessorResponse +from paypalserversdk.models.processor_response import ProcessorResponse from paypalserversdk.models.seller_protection import SellerProtection from paypalserversdk.models.seller_receivable_breakdown import SellerReceivableBreakdown @@ -37,8 +37,8 @@ class CapturedPayment(object): custom_id (str): The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. - network_transaction_reference (NetworkTransactionReference): Reference - values used by the card network to identify a transaction. + network_transaction_reference (NetworkTransaction): Reference values + used by the card network to identify a transaction. seller_protection (SellerProtection): The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-pr @@ -55,7 +55,7 @@ class CapturedPayment(object): behalf of the merchant. links (List[LinkDescription]): An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). - processor_response (PaymentsProcessorResponse): The processor response + processor_response (ProcessorResponse): The processor response information for payment requests, such as direct credit card transactions. create_time (str): The date and time, in [Internet date and time @@ -194,7 +194,7 @@ def from_dictionary(cls, amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP - network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP seller_protection = SellerProtection.from_dictionary(dictionary.get('seller_protection')) if 'seller_protection' in dictionary.keys() else APIHelper.SKIP final_capture = dictionary.get("final_capture") if dictionary.get("final_capture") else False seller_receivable_breakdown = SellerReceivableBreakdown.from_dictionary(dictionary.get('seller_receivable_breakdown')) if 'seller_receivable_breakdown' in dictionary.keys() else APIHelper.SKIP @@ -204,7 +204,7 @@ def from_dictionary(cls, links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] else: links = APIHelper.SKIP - processor_response = PaymentsProcessorResponse.from_dictionary(dictionary.get('processor_response')) if 'processor_response' in dictionary.keys() else APIHelper.SKIP + processor_response = ProcessorResponse.from_dictionary(dictionary.get('processor_response')) if 'processor_response' in dictionary.keys() else APIHelper.SKIP create_time = dictionary.get("create_time") if dictionary.get("create_time") else APIHelper.SKIP update_time = dictionary.get("update_time") if dictionary.get("update_time") else APIHelper.SKIP supplementary_data = PaymentSupplementaryData.from_dictionary(dictionary.get('supplementary_data')) if 'supplementary_data' in dictionary.keys() else APIHelper.SKIP diff --git a/paypalserversdk/models/card_brand.py b/paypalserversdk/models/card_brand.py index a9faa76..0aad9aa 100644 --- a/paypalserversdk/models/card_brand.py +++ b/paypalserversdk/models/card_brand.py @@ -44,6 +44,11 @@ class CardBrand(object): SYNCHRONY: The Synchrony Financial (SYF) payment network. EFTPOS: The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. + CARTE_BANCAIRE: The Carte Bancaire payment network. + STAR_ACCESS: The Star Access payment network. + PULSE: The Pulse payment network. + NYCE: The NYCE payment network. + ACCEL: The Accel payment network. UNKNOWN: UNKNOWN payment network. """ @@ -95,5 +100,15 @@ class CardBrand(object): EFTPOS = 'EFTPOS' + CARTE_BANCAIRE = 'CARTE_BANCAIRE' + + STAR_ACCESS = 'STAR_ACCESS' + + PULSE = 'PULSE' + + NYCE = 'NYCE' + + ACCEL = 'ACCEL' + UNKNOWN = 'UNKNOWN' diff --git a/paypalserversdk/models/card_customer.py b/paypalserversdk/models/card_customer.py new file mode 100644 index 0000000..cf3c075 --- /dev/null +++ b/paypalserversdk/models/card_customer.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.phone_with_type import PhoneWithType + + +class CardCustomer(object): + + """Implementation of the 'Card Customer' model. + + The details about a customer in PayPal's system of record. + + Attributes: + id (str): The unique ID for a customer generated by PayPal. + email_address (str): The internationalized email address. Note: Up to + 64 characters are allowed before and 255 characters are allowed + after the @ sign. However, the generally accepted maximum length + for an email address is 254 characters. The pattern verifies that + an unquoted @ sign exists. + phone (PhoneWithType): The phone information. + merchant_customer_id (str): Merchants and partners may already have a + data-store where their customer information is persisted. Use + merchant_customer_id to associate the PayPal-generated customer.id + to your representation of a customer. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": 'id', + "email_address": 'email_address', + "phone": 'phone', + "merchant_customer_id": 'merchant_customer_id' + } + + _optionals = [ + 'id', + 'email_address', + 'phone', + 'merchant_customer_id', + ] + + def __init__(self, + id=APIHelper.SKIP, + email_address=APIHelper.SKIP, + phone=APIHelper.SKIP, + merchant_customer_id=APIHelper.SKIP): + """Constructor for the CardCustomer class""" + + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if email_address is not APIHelper.SKIP: + self.email_address = email_address + if phone is not APIHelper.SKIP: + self.phone = phone + if merchant_customer_id is not APIHelper.SKIP: + self.merchant_customer_id = merchant_customer_id + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP + email_address = dictionary.get("email_address") if dictionary.get("email_address") else APIHelper.SKIP + phone = PhoneWithType.from_dictionary(dictionary.get('phone')) if 'phone' in dictionary.keys() else APIHelper.SKIP + merchant_customer_id = dictionary.get("merchant_customer_id") if dictionary.get("merchant_customer_id") else APIHelper.SKIP + # Return an object of this model + return cls(id, + email_address, + phone, + merchant_customer_id) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!r}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!r}, ' + f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' + f'merchant_customer_id={(self.merchant_customer_id if hasattr(self, "merchant_customer_id") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!s}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!s}, ' + f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' + f'merchant_customer_id={(self.merchant_customer_id if hasattr(self, "merchant_customer_id") else None)!s})') diff --git a/paypalserversdk/models/card_response_with_billing_address.py b/paypalserversdk/models/card_response_with_billing_address.py new file mode 100644 index 0000000..77245f0 --- /dev/null +++ b/paypalserversdk/models/card_response_with_billing_address.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.address import Address + + +class CardResponseWithBillingAddress(object): + + """Implementation of the 'Card Response with Billing Address' model. + + The payment card used to fund the payment. Card can be a credit or debit + card. + + Attributes: + name (str): The card holder's name as it appears on the card. + billing_address (Address): The portable international postal address. + Maps to + [AddressValidationMetadata](https://github.com/googlei18n/libaddres + sinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling + form controls: the autocomplete + attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling- + form-controls-the-autocomplete-attribute). + expiry (str): The year and month, in ISO-8601 `YYYY-MM` date format. + See [Internet date and time + format](https://tools.ietf.org/html/rfc3339#section-5.6). + currency_code (str): The [three-character ISO-4217 currency + code](/api/rest/reference/currency-codes/) that identifies the + currency. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": 'name', + "billing_address": 'billing_address', + "expiry": 'expiry', + "currency_code": 'currency_code' + } + + _optionals = [ + 'name', + 'billing_address', + 'expiry', + 'currency_code', + ] + + def __init__(self, + name=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + expiry=APIHelper.SKIP, + currency_code=APIHelper.SKIP): + """Constructor for the CardResponseWithBillingAddress class""" + + # Initialize members of the class + if name is not APIHelper.SKIP: + self.name = name + if billing_address is not APIHelper.SKIP: + self.billing_address = billing_address + if expiry is not APIHelper.SKIP: + self.expiry = expiry + if currency_code is not APIHelper.SKIP: + self.currency_code = currency_code + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP + billing_address = Address.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP + expiry = dictionary.get("expiry") if dictionary.get("expiry") else APIHelper.SKIP + currency_code = dictionary.get("currency_code") if dictionary.get("currency_code") else APIHelper.SKIP + # Return an object of this model + return cls(name, + billing_address, + expiry, + currency_code) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' + f'expiry={(self.expiry if hasattr(self, "expiry") else None)!r}, ' + f'currency_code={(self.currency_code if hasattr(self, "currency_code") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' + f'expiry={(self.expiry if hasattr(self, "expiry") else None)!s}, ' + f'currency_code={(self.currency_code if hasattr(self, "currency_code") else None)!s})') diff --git a/paypalserversdk/models/card_stored_credential.py b/paypalserversdk/models/card_stored_credential.py index cf53a55..ea21366 100644 --- a/paypalserversdk/models/card_stored_credential.py +++ b/paypalserversdk/models/card_stored_credential.py @@ -7,7 +7,7 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction class CardStoredCredential(object): @@ -33,9 +33,8 @@ class CardStoredCredential(object): usage (StoredPaymentSourceUsageType): Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file). - previous_network_transaction_reference (NetworkTransactionReference): - Reference values used by the card network to identify a - transaction. + previous_network_transaction_reference (NetworkTransaction): Reference + values used by the card network to identify a transaction. """ @@ -88,7 +87,7 @@ def from_dictionary(cls, payment_initiator = dictionary.get("payment_initiator") if dictionary.get("payment_initiator") else None payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else None usage = dictionary.get("usage") if dictionary.get("usage") else 'DERIVED' - previous_network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('previous_network_transaction_reference')) if 'previous_network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + previous_network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('previous_network_transaction_reference')) if 'previous_network_transaction_reference' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(payment_initiator, payment_type, diff --git a/paypalserversdk/models/card_verification_details.py b/paypalserversdk/models/card_verification_details.py index 637a9ee..97e3201 100644 --- a/paypalserversdk/models/card_verification_details.py +++ b/paypalserversdk/models/card_verification_details.py @@ -26,13 +26,13 @@ class CardVerificationDetails(object): date (str): DEPRECATED. This field is DEPRECATED. Please find the date data in the 'date' field under the 'network_transaction_reference' object instead of the 'verification' object. - network (CardBrand): The card network or brand. Applies to credit, - debit, gift, and payment cards. - time (str): 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. + network (CardBrand): DEPRECATED. This field is DEPRECATED. Please find + the network data in the 'network' field under the + 'network_transaction_reference' object instead of the + 'verification' object. + time (str): DEPRECATED. This field is DEPRECATED. Please find the time + data in the 'time' field under the 'network_transaction_reference' + object instead of the 'verification' object. amount (Money): The currency and amount for a financial transaction, such as a balance or payment due. processor_response (CardVerificationProcessorResponse): The processor diff --git a/paypalserversdk/models/cart_information.py b/paypalserversdk/models/cart_information.py new file mode 100644 index 0000000..17f598d --- /dev/null +++ b/paypalserversdk/models/cart_information.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.item_details import ItemDetails + + +class CartInformation(object): + + """Implementation of the 'Cart Information' model. + + The cart information. + + Attributes: + item_details (List[ItemDetails]): An array of item details. + tax_inclusive (bool): Indicates whether the item amount or the + shipping amount already includes tax. + paypal_invoice_id (str): The ID of the invoice. Appears for only + PayPal-generated invoices. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "item_details": 'item_details', + "tax_inclusive": 'tax_inclusive', + "paypal_invoice_id": 'paypal_invoice_id' + } + + _optionals = [ + 'item_details', + 'tax_inclusive', + 'paypal_invoice_id', + ] + + def __init__(self, + item_details=APIHelper.SKIP, + tax_inclusive=False, + paypal_invoice_id=APIHelper.SKIP): + """Constructor for the CartInformation class""" + + # Initialize members of the class + if item_details is not APIHelper.SKIP: + self.item_details = item_details + self.tax_inclusive = tax_inclusive + if paypal_invoice_id is not APIHelper.SKIP: + self.paypal_invoice_id = paypal_invoice_id + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + item_details = None + if dictionary.get('item_details') is not None: + item_details = [ItemDetails.from_dictionary(x) for x in dictionary.get('item_details')] + else: + item_details = APIHelper.SKIP + tax_inclusive = dictionary.get("tax_inclusive") if dictionary.get("tax_inclusive") else False + paypal_invoice_id = dictionary.get("paypal_invoice_id") if dictionary.get("paypal_invoice_id") else APIHelper.SKIP + # Return an object of this model + return cls(item_details, + tax_inclusive, + paypal_invoice_id) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'item_details={(self.item_details if hasattr(self, "item_details") else None)!r}, ' + f'tax_inclusive={(self.tax_inclusive if hasattr(self, "tax_inclusive") else None)!r}, ' + f'paypal_invoice_id={(self.paypal_invoice_id if hasattr(self, "paypal_invoice_id") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'item_details={(self.item_details if hasattr(self, "item_details") else None)!s}, ' + f'tax_inclusive={(self.tax_inclusive if hasattr(self, "tax_inclusive") else None)!s}, ' + f'paypal_invoice_id={(self.paypal_invoice_id if hasattr(self, "paypal_invoice_id") else None)!s})') diff --git a/paypalserversdk/models/checkout_option.py b/paypalserversdk/models/checkout_option.py new file mode 100644 index 0000000..0210b4c --- /dev/null +++ b/paypalserversdk/models/checkout_option.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class CheckoutOption(object): + + """Implementation of the 'Checkout Option' model. + + A checkout option as a name-and-value pair. + + Attributes: + checkout_option_name (str): The checkout option name, such as `color` + or `texture`. + checkout_option_value (str): The checkout option value. For example, + the checkout option `color` might be `blue` or `red` while the + checkout option `texture` might be `smooth` or `rippled`. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "checkout_option_name": 'checkout_option_name', + "checkout_option_value": 'checkout_option_value' + } + + _optionals = [ + 'checkout_option_name', + 'checkout_option_value', + ] + + def __init__(self, + checkout_option_name=APIHelper.SKIP, + checkout_option_value=APIHelper.SKIP): + """Constructor for the CheckoutOption class""" + + # Initialize members of the class + if checkout_option_name is not APIHelper.SKIP: + self.checkout_option_name = checkout_option_name + if checkout_option_value is not APIHelper.SKIP: + self.checkout_option_value = checkout_option_value + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + checkout_option_name = dictionary.get("checkout_option_name") if dictionary.get("checkout_option_name") else APIHelper.SKIP + checkout_option_value = dictionary.get("checkout_option_value") if dictionary.get("checkout_option_value") else APIHelper.SKIP + # Return an object of this model + return cls(checkout_option_name, + checkout_option_value) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'checkout_option_name={(self.checkout_option_name if hasattr(self, "checkout_option_name") else None)!r}, ' + f'checkout_option_value={(self.checkout_option_value if hasattr(self, "checkout_option_value") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'checkout_option_name={(self.checkout_option_name if hasattr(self, "checkout_option_name") else None)!s}, ' + f'checkout_option_value={(self.checkout_option_value if hasattr(self, "checkout_option_value") else None)!s})') diff --git a/paypalserversdk/models/create_subscription_request.py b/paypalserversdk/models/create_subscription_request.py new file mode 100644 index 0000000..379a603 --- /dev/null +++ b/paypalserversdk/models/create_subscription_request.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money +from paypalserversdk.models.plan_override import PlanOverride +from paypalserversdk.models.subscriber_request import SubscriberRequest +from paypalserversdk.models.subscription_application_context import SubscriptionApplicationContext + + +class CreateSubscriptionRequest(object): + + """Implementation of the 'Create Subscription Request' model. + + The create subscription request details. + + Attributes: + plan_id (str): The ID of the plan. + start_time (str): 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. + quantity (str): The quantity of the product in the subscription. + shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + subscriber (SubscriberRequest): The subscriber request information . + auto_renewal (bool): DEPRECATED. Indicates whether the subscription + auto-renews after the billing cycles complete. + application_context (SubscriptionApplicationContext): DEPRECATED. The + application context, which customizes the payer experience during + the subscription approval process with PayPal. + custom_id (str): The custom id for the subscription. Can be invoice id. + plan (PlanOverride): An inline plan object to customise the + subscription. You can override plan level default attributes by + providing customised values for the subscription in this object. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "plan_id": 'plan_id', + "start_time": 'start_time', + "quantity": 'quantity', + "shipping_amount": 'shipping_amount', + "subscriber": 'subscriber', + "auto_renewal": 'auto_renewal', + "application_context": 'application_context', + "custom_id": 'custom_id', + "plan": 'plan' + } + + _optionals = [ + 'start_time', + 'quantity', + 'shipping_amount', + 'subscriber', + 'auto_renewal', + 'application_context', + 'custom_id', + 'plan', + ] + + def __init__(self, + plan_id=None, + start_time=APIHelper.SKIP, + quantity=APIHelper.SKIP, + shipping_amount=APIHelper.SKIP, + subscriber=APIHelper.SKIP, + auto_renewal=False, + application_context=APIHelper.SKIP, + custom_id=APIHelper.SKIP, + plan=APIHelper.SKIP): + """Constructor for the CreateSubscriptionRequest class""" + + # Initialize members of the class + self.plan_id = plan_id + if start_time is not APIHelper.SKIP: + self.start_time = start_time + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if shipping_amount is not APIHelper.SKIP: + self.shipping_amount = shipping_amount + if subscriber is not APIHelper.SKIP: + self.subscriber = subscriber + self.auto_renewal = auto_renewal + if application_context is not APIHelper.SKIP: + self.application_context = application_context + if custom_id is not APIHelper.SKIP: + self.custom_id = custom_id + if plan is not APIHelper.SKIP: + self.plan = plan + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + plan_id = dictionary.get("plan_id") if dictionary.get("plan_id") else None + start_time = dictionary.get("start_time") if dictionary.get("start_time") else APIHelper.SKIP + quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP + shipping_amount = Money.from_dictionary(dictionary.get('shipping_amount')) if 'shipping_amount' in dictionary.keys() else APIHelper.SKIP + subscriber = SubscriberRequest.from_dictionary(dictionary.get('subscriber')) if 'subscriber' in dictionary.keys() else APIHelper.SKIP + auto_renewal = dictionary.get("auto_renewal") if dictionary.get("auto_renewal") else False + application_context = SubscriptionApplicationContext.from_dictionary(dictionary.get('application_context')) if 'application_context' in dictionary.keys() else APIHelper.SKIP + custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP + plan = PlanOverride.from_dictionary(dictionary.get('plan')) if 'plan' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(plan_id, + start_time, + quantity, + shipping_amount, + subscriber, + auto_renewal, + application_context, + custom_id, + plan) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'plan_id={self.plan_id!r}, ' + f'start_time={(self.start_time if hasattr(self, "start_time") else None)!r}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!r}, ' + f'subscriber={(self.subscriber if hasattr(self, "subscriber") else None)!r}, ' + f'auto_renewal={(self.auto_renewal if hasattr(self, "auto_renewal") else None)!r}, ' + f'application_context={(self.application_context if hasattr(self, "application_context") else None)!r}, ' + f'custom_id={(self.custom_id if hasattr(self, "custom_id") else None)!r}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'plan_id={self.plan_id!s}, ' + f'start_time={(self.start_time if hasattr(self, "start_time") else None)!s}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!s}, ' + f'subscriber={(self.subscriber if hasattr(self, "subscriber") else None)!s}, ' + f'auto_renewal={(self.auto_renewal if hasattr(self, "auto_renewal") else None)!s}, ' + f'application_context={(self.application_context if hasattr(self, "application_context") else None)!s}, ' + f'custom_id={(self.custom_id if hasattr(self, "custom_id") else None)!s}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!s})') diff --git a/paypalserversdk/models/cycle_execution.py b/paypalserversdk/models/cycle_execution.py new file mode 100644 index 0000000..6f46234 --- /dev/null +++ b/paypalserversdk/models/cycle_execution.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class CycleExecution(object): + + """Implementation of the 'Cycle Execution' model. + + The regular and trial execution details for a billing cycle. + + Attributes: + tenure_type (TenureType): The type of the billing cycle. + sequence (int): The order in which to run this cycle among other + billing cycles. + cycles_completed (int): The number of billing cycles that have + completed. + cycles_remaining (int): For a finite billing cycle, cycles_remaining + is the number of remaining cycles. For an infinite billing cycle, + cycles_remaining is set as 0. + current_pricing_scheme_version (int): The active pricing scheme + version for the billing cycle. + total_cycles (int): The number of times this billing cycle gets + executed. Trial billing cycles can only be executed a finite + number of times (value between 1 and 999 for total_cycles). + Regular billing cycles can be executed infinite times (value of 0 + for total_cycles) or a finite number of times (value between 1 and + 999 for total_cycles). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "tenure_type": 'tenure_type', + "sequence": 'sequence', + "cycles_completed": 'cycles_completed', + "cycles_remaining": 'cycles_remaining', + "current_pricing_scheme_version": 'current_pricing_scheme_version', + "total_cycles": 'total_cycles' + } + + _optionals = [ + 'cycles_remaining', + 'current_pricing_scheme_version', + 'total_cycles', + ] + + def __init__(self, + tenure_type=None, + sequence=None, + cycles_completed=None, + cycles_remaining=APIHelper.SKIP, + current_pricing_scheme_version=APIHelper.SKIP, + total_cycles=APIHelper.SKIP): + """Constructor for the CycleExecution class""" + + # Initialize members of the class + self.tenure_type = tenure_type + self.sequence = sequence + self.cycles_completed = cycles_completed + if cycles_remaining is not APIHelper.SKIP: + self.cycles_remaining = cycles_remaining + if current_pricing_scheme_version is not APIHelper.SKIP: + self.current_pricing_scheme_version = current_pricing_scheme_version + if total_cycles is not APIHelper.SKIP: + self.total_cycles = total_cycles + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + tenure_type = dictionary.get("tenure_type") if dictionary.get("tenure_type") else None + sequence = dictionary.get("sequence") if dictionary.get("sequence") else None + cycles_completed = dictionary.get("cycles_completed") if dictionary.get("cycles_completed") else None + cycles_remaining = dictionary.get("cycles_remaining") if dictionary.get("cycles_remaining") else APIHelper.SKIP + current_pricing_scheme_version = dictionary.get("current_pricing_scheme_version") if dictionary.get("current_pricing_scheme_version") else APIHelper.SKIP + total_cycles = dictionary.get("total_cycles") if dictionary.get("total_cycles") else APIHelper.SKIP + # Return an object of this model + return cls(tenure_type, + sequence, + cycles_completed, + cycles_remaining, + current_pricing_scheme_version, + total_cycles) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'tenure_type={self.tenure_type!r}, ' + f'sequence={self.sequence!r}, ' + f'cycles_completed={self.cycles_completed!r}, ' + f'cycles_remaining={(self.cycles_remaining if hasattr(self, "cycles_remaining") else None)!r}, ' + f'current_pricing_scheme_version={(self.current_pricing_scheme_version if hasattr(self, "current_pricing_scheme_version") else None)!r}, ' + f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'tenure_type={self.tenure_type!s}, ' + f'sequence={self.sequence!s}, ' + f'cycles_completed={self.cycles_completed!s}, ' + f'cycles_remaining={(self.cycles_remaining if hasattr(self, "cycles_remaining") else None)!s}, ' + f'current_pricing_scheme_version={(self.current_pricing_scheme_version if hasattr(self, "current_pricing_scheme_version") else None)!s}, ' + f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!s})') diff --git a/paypalserversdk/models/experience_context.py b/paypalserversdk/models/experience_context.py index c678edc..0cb53b8 100644 --- a/paypalserversdk/models/experience_context.py +++ b/paypalserversdk/models/experience_context.py @@ -31,8 +31,8 @@ class ExperienceContext(object): [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/). - shipping_preference (ShippingPreference): The location from which the - shipping address is derived. + shipping_preference (ExperienceContextShippingPreference): The + location from which the shipping address is derived. return_url (str): Describes the URL. cancel_url (str): Describes the URL. diff --git a/paypalserversdk/models/experience_context_shipping_preference.py b/paypalserversdk/models/experience_context_shipping_preference.py new file mode 100644 index 0000000..8e60af4 --- /dev/null +++ b/paypalserversdk/models/experience_context_shipping_preference.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class ExperienceContextShippingPreference(object): + + """Implementation of the 'Experience Context Shipping Preference' enum. + + The location from which the shipping address is derived., The shipping + preference. This only applies to PayPal payment source., The shipping + preference. This only applies to PayPal payment source., The location from + which the shipping address is derived. + + Attributes: + GET_FROM_FILE: Get the customer-provided shipping address on the + PayPal site. + NO_SHIPPING: Redacts the shipping address from the PayPal site. + Recommended for digital goods. + SET_PROVIDED_ADDRESS: Merchant sends the shipping address using + purchase_units.shipping.address. The customer cannot change this + address on the PayPal site. + + """ + GET_FROM_FILE = 'GET_FROM_FILE' + + NO_SHIPPING = 'NO_SHIPPING' + + SET_PROVIDED_ADDRESS = 'SET_PROVIDED_ADDRESS' + diff --git a/paypalserversdk/models/experience_status.py b/paypalserversdk/models/experience_status.py new file mode 100644 index 0000000..758ca5b --- /dev/null +++ b/paypalserversdk/models/experience_status.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class ExperienceStatus(object): + + """Implementation of the 'Experience Status' enum. + + This field indicates the status of PayPal's Checkout experience throughout + the order lifecycle. The values reflect the current stage of the checkout + process. + + Attributes: + NOT_STARTED: PayPal checkout process has not yet begun. + IN_PROGRESS: PayPal checkout initiated. User is on the checkout page + for order review before approval. + CANCELED: PayPal checkout is canceled (by closing the checkout window + or clicking cancel) before the order approval. + APPROVED: Order is approved. User has completed the checkout process. + + """ + NOT_STARTED = 'NOT_STARTED' + + IN_PROGRESS = 'IN_PROGRESS' + + CANCELED = 'CANCELED' + + APPROVED = 'APPROVED' + diff --git a/paypalserversdk/models/failed_payment_details.py b/paypalserversdk/models/failed_payment_details.py new file mode 100644 index 0000000..584390f --- /dev/null +++ b/paypalserversdk/models/failed_payment_details.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class FailedPaymentDetails(object): + + """Implementation of the 'Failed Payment Details' model. + + The details for the failed payment of the subscription. + + Attributes: + amount (Money): The currency and amount for a financial transaction, + such as a balance or payment due. + time (str): 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. + reason_code (ReasonCode): The reason code for the payment failure. + next_payment_retry_time (str): 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. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "amount": 'amount', + "time": 'time', + "reason_code": 'reason_code', + "next_payment_retry_time": 'next_payment_retry_time' + } + + _optionals = [ + 'reason_code', + 'next_payment_retry_time', + ] + + def __init__(self, + amount=None, + time=None, + reason_code=APIHelper.SKIP, + next_payment_retry_time=APIHelper.SKIP): + """Constructor for the FailedPaymentDetails class""" + + # Initialize members of the class + self.amount = amount + self.time = time + if reason_code is not APIHelper.SKIP: + self.reason_code = reason_code + if next_payment_retry_time is not APIHelper.SKIP: + self.next_payment_retry_time = next_payment_retry_time + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + amount = Money.from_dictionary(dictionary.get('amount')) if dictionary.get('amount') else None + time = dictionary.get("time") if dictionary.get("time") else None + reason_code = dictionary.get("reason_code") if dictionary.get("reason_code") else APIHelper.SKIP + next_payment_retry_time = dictionary.get("next_payment_retry_time") if dictionary.get("next_payment_retry_time") else APIHelper.SKIP + # Return an object of this model + return cls(amount, + time, + reason_code, + next_payment_retry_time) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'amount={self.amount!r}, ' + f'time={self.time!r}, ' + f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!r}, ' + f'next_payment_retry_time={(self.next_payment_retry_time if hasattr(self, "next_payment_retry_time") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'amount={self.amount!s}, ' + f'time={self.time!s}, ' + f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!s}, ' + f'next_payment_retry_time={(self.next_payment_retry_time if hasattr(self, "next_payment_retry_time") else None)!s})') diff --git a/paypalserversdk/models/frequency.py b/paypalserversdk/models/frequency.py new file mode 100644 index 0000000..513798f --- /dev/null +++ b/paypalserversdk/models/frequency.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class Frequency(object): + + """Implementation of the 'Frequency' model. + + The frequency of the billing cycle. + + Attributes: + interval_unit (IntervalUnit): The interval at which the subscription + is charged or billed. + interval_count (int): The number of intervals after which a subscriber + is billed. For example, if the `interval_unit` is `DAY` with an + `interval_count` of `2`, the subscription is billed once every + two days. The following table lists the maximum allowed values for + the `interval_count` for each `interval_unit`: Interval unit + Maximum interval count DAY 365 WEEK 52 MONTH 12 YEAR 1 + + """ + + # Create a mapping from Model property names to API property names + _names = { + "interval_unit": 'interval_unit', + "interval_count": 'interval_count' + } + + _optionals = [ + 'interval_count', + ] + + def __init__(self, + interval_unit=None, + interval_count=1): + """Constructor for the Frequency class""" + + # Initialize members of the class + self.interval_unit = interval_unit + self.interval_count = interval_count + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else None + interval_count = dictionary.get("interval_count") if dictionary.get("interval_count") else 1 + # Return an object of this model + return cls(interval_unit, + interval_count) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'interval_unit={self.interval_unit!r}, ' + f'interval_count={(self.interval_count if hasattr(self, "interval_count") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'interval_unit={self.interval_unit!s}, ' + f'interval_count={(self.interval_count if hasattr(self, "interval_count") else None)!s})') diff --git a/paypalserversdk/models/incentive_details.py b/paypalserversdk/models/incentive_details.py new file mode 100644 index 0000000..08e4783 --- /dev/null +++ b/paypalserversdk/models/incentive_details.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class IncentiveDetails(object): + + """Implementation of the 'Incentive Details' model. + + The incentive details. + + Attributes: + incentive_type (str): The type of incentive, such as a special offer + or coupon. + incentive_code (str): The code that identifies an incentive, such as a + coupon. + incentive_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + incentive_program_code (str): The incentive program code that + identifies a merchant loyalty or incentive program. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "incentive_type": 'incentive_type', + "incentive_code": 'incentive_code', + "incentive_amount": 'incentive_amount', + "incentive_program_code": 'incentive_program_code' + } + + _optionals = [ + 'incentive_type', + 'incentive_code', + 'incentive_amount', + 'incentive_program_code', + ] + + def __init__(self, + incentive_type=APIHelper.SKIP, + incentive_code=APIHelper.SKIP, + incentive_amount=APIHelper.SKIP, + incentive_program_code=APIHelper.SKIP): + """Constructor for the IncentiveDetails class""" + + # Initialize members of the class + if incentive_type is not APIHelper.SKIP: + self.incentive_type = incentive_type + if incentive_code is not APIHelper.SKIP: + self.incentive_code = incentive_code + if incentive_amount is not APIHelper.SKIP: + self.incentive_amount = incentive_amount + if incentive_program_code is not APIHelper.SKIP: + self.incentive_program_code = incentive_program_code + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + incentive_type = dictionary.get("incentive_type") if dictionary.get("incentive_type") else APIHelper.SKIP + incentive_code = dictionary.get("incentive_code") if dictionary.get("incentive_code") else APIHelper.SKIP + incentive_amount = Money.from_dictionary(dictionary.get('incentive_amount')) if 'incentive_amount' in dictionary.keys() else APIHelper.SKIP + incentive_program_code = dictionary.get("incentive_program_code") if dictionary.get("incentive_program_code") else APIHelper.SKIP + # Return an object of this model + return cls(incentive_type, + incentive_code, + incentive_amount, + incentive_program_code) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'incentive_type={(self.incentive_type if hasattr(self, "incentive_type") else None)!r}, ' + f'incentive_code={(self.incentive_code if hasattr(self, "incentive_code") else None)!r}, ' + f'incentive_amount={(self.incentive_amount if hasattr(self, "incentive_amount") else None)!r}, ' + f'incentive_program_code={(self.incentive_program_code if hasattr(self, "incentive_program_code") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'incentive_type={(self.incentive_type if hasattr(self, "incentive_type") else None)!s}, ' + f'incentive_code={(self.incentive_code if hasattr(self, "incentive_code") else None)!s}, ' + f'incentive_amount={(self.incentive_amount if hasattr(self, "incentive_amount") else None)!s}, ' + f'incentive_program_code={(self.incentive_program_code if hasattr(self, "incentive_program_code") else None)!s})') diff --git a/paypalserversdk/models/incentive_information.py b/paypalserversdk/models/incentive_information.py new file mode 100644 index 0000000..ff22cb8 --- /dev/null +++ b/paypalserversdk/models/incentive_information.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.incentive_details import IncentiveDetails + + +class IncentiveInformation(object): + + """Implementation of the 'Incentive Information' model. + + The incentive details. + + Attributes: + incentive_details (List[IncentiveDetails]): An array of incentive + details. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "incentive_details": 'incentive_details' + } + + _optionals = [ + 'incentive_details', + ] + + def __init__(self, + incentive_details=APIHelper.SKIP): + """Constructor for the IncentiveInformation class""" + + # Initialize members of the class + if incentive_details is not APIHelper.SKIP: + self.incentive_details = incentive_details + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + incentive_details = None + if dictionary.get('incentive_details') is not None: + incentive_details = [IncentiveDetails.from_dictionary(x) for x in dictionary.get('incentive_details')] + else: + incentive_details = APIHelper.SKIP + # Return an object of this model + return cls(incentive_details) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'incentive_details={(self.incentive_details if hasattr(self, "incentive_details") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'incentive_details={(self.incentive_details if hasattr(self, "incentive_details") else None)!s})') diff --git a/paypalserversdk/models/interval_unit.py b/paypalserversdk/models/interval_unit.py new file mode 100644 index 0000000..7b8d621 --- /dev/null +++ b/paypalserversdk/models/interval_unit.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class IntervalUnit(object): + + """Implementation of the 'Interval Unit' enum. + + The interval at which the subscription is charged or billed. + + Attributes: + DAY: A daily billing cycle. + WEEK: A weekly billing cycle. + MONTH: A monthly billing cycle. + YEAR: A yearly billing cycle. + + """ + DAY = 'DAY' + + WEEK = 'WEEK' + + MONTH = 'MONTH' + + YEAR = 'YEAR' + diff --git a/paypalserversdk/models/item_details.py b/paypalserversdk/models/item_details.py new file mode 100644 index 0000000..82a0700 --- /dev/null +++ b/paypalserversdk/models/item_details.py @@ -0,0 +1,277 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.checkout_option import CheckoutOption +from paypalserversdk.models.money import Money +from paypalserversdk.models.tax_amount import TaxAmount + + +class ItemDetails(object): + + """Implementation of the 'Item Details' model. + + The item details. + + Attributes: + item_code (str): An item code that identifies a merchant's goods or + service. + item_name (str): The item name. + item_description (str): The item description. + item_options (str): The item options. Describes option choices on the + purchase of the item in some detail. + item_quantity (str): The number of purchased units of goods or a + service. + item_unit_price (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + item_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + discount_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + adjustment_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + gift_wrap_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + tax_percentage (str): The percentage, as a fixed-point, signed decimal + number. For example, define a 19.99% interest rate as `19.99`. + tax_amounts (List[TaxAmount]): An array of tax amounts levied by a + government on the purchase of goods or services. + basic_shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + extra_shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + handling_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + insurance_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + total_item_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + invoice_number (str): The invoice number. An alphanumeric string that + identifies a billing for a merchant. + checkout_options (List[CheckoutOption]): An array of checkout options. + Each option has a name and value. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "item_code": 'item_code', + "item_name": 'item_name', + "item_description": 'item_description', + "item_options": 'item_options', + "item_quantity": 'item_quantity', + "item_unit_price": 'item_unit_price', + "item_amount": 'item_amount', + "discount_amount": 'discount_amount', + "adjustment_amount": 'adjustment_amount', + "gift_wrap_amount": 'gift_wrap_amount', + "tax_percentage": 'tax_percentage', + "tax_amounts": 'tax_amounts', + "basic_shipping_amount": 'basic_shipping_amount', + "extra_shipping_amount": 'extra_shipping_amount', + "handling_amount": 'handling_amount', + "insurance_amount": 'insurance_amount', + "total_item_amount": 'total_item_amount', + "invoice_number": 'invoice_number', + "checkout_options": 'checkout_options' + } + + _optionals = [ + 'item_code', + 'item_name', + 'item_description', + 'item_options', + 'item_quantity', + 'item_unit_price', + 'item_amount', + 'discount_amount', + 'adjustment_amount', + 'gift_wrap_amount', + 'tax_percentage', + 'tax_amounts', + 'basic_shipping_amount', + 'extra_shipping_amount', + 'handling_amount', + 'insurance_amount', + 'total_item_amount', + 'invoice_number', + 'checkout_options', + ] + + def __init__(self, + item_code=APIHelper.SKIP, + item_name=APIHelper.SKIP, + item_description=APIHelper.SKIP, + item_options=APIHelper.SKIP, + item_quantity=APIHelper.SKIP, + item_unit_price=APIHelper.SKIP, + item_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + adjustment_amount=APIHelper.SKIP, + gift_wrap_amount=APIHelper.SKIP, + tax_percentage=APIHelper.SKIP, + tax_amounts=APIHelper.SKIP, + basic_shipping_amount=APIHelper.SKIP, + extra_shipping_amount=APIHelper.SKIP, + handling_amount=APIHelper.SKIP, + insurance_amount=APIHelper.SKIP, + total_item_amount=APIHelper.SKIP, + invoice_number=APIHelper.SKIP, + checkout_options=APIHelper.SKIP): + """Constructor for the ItemDetails class""" + + # Initialize members of the class + if item_code is not APIHelper.SKIP: + self.item_code = item_code + if item_name is not APIHelper.SKIP: + self.item_name = item_name + if item_description is not APIHelper.SKIP: + self.item_description = item_description + if item_options is not APIHelper.SKIP: + self.item_options = item_options + if item_quantity is not APIHelper.SKIP: + self.item_quantity = item_quantity + if item_unit_price is not APIHelper.SKIP: + self.item_unit_price = item_unit_price + if item_amount is not APIHelper.SKIP: + self.item_amount = item_amount + if discount_amount is not APIHelper.SKIP: + self.discount_amount = discount_amount + if adjustment_amount is not APIHelper.SKIP: + self.adjustment_amount = adjustment_amount + if gift_wrap_amount is not APIHelper.SKIP: + self.gift_wrap_amount = gift_wrap_amount + if tax_percentage is not APIHelper.SKIP: + self.tax_percentage = tax_percentage + if tax_amounts is not APIHelper.SKIP: + self.tax_amounts = tax_amounts + if basic_shipping_amount is not APIHelper.SKIP: + self.basic_shipping_amount = basic_shipping_amount + if extra_shipping_amount is not APIHelper.SKIP: + self.extra_shipping_amount = extra_shipping_amount + if handling_amount is not APIHelper.SKIP: + self.handling_amount = handling_amount + if insurance_amount is not APIHelper.SKIP: + self.insurance_amount = insurance_amount + if total_item_amount is not APIHelper.SKIP: + self.total_item_amount = total_item_amount + if invoice_number is not APIHelper.SKIP: + self.invoice_number = invoice_number + if checkout_options is not APIHelper.SKIP: + self.checkout_options = checkout_options + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + item_code = dictionary.get("item_code") if dictionary.get("item_code") else APIHelper.SKIP + item_name = dictionary.get("item_name") if dictionary.get("item_name") else APIHelper.SKIP + item_description = dictionary.get("item_description") if dictionary.get("item_description") else APIHelper.SKIP + item_options = dictionary.get("item_options") if dictionary.get("item_options") else APIHelper.SKIP + item_quantity = dictionary.get("item_quantity") if dictionary.get("item_quantity") else APIHelper.SKIP + item_unit_price = Money.from_dictionary(dictionary.get('item_unit_price')) if 'item_unit_price' in dictionary.keys() else APIHelper.SKIP + item_amount = Money.from_dictionary(dictionary.get('item_amount')) if 'item_amount' in dictionary.keys() else APIHelper.SKIP + discount_amount = Money.from_dictionary(dictionary.get('discount_amount')) if 'discount_amount' in dictionary.keys() else APIHelper.SKIP + adjustment_amount = Money.from_dictionary(dictionary.get('adjustment_amount')) if 'adjustment_amount' in dictionary.keys() else APIHelper.SKIP + gift_wrap_amount = Money.from_dictionary(dictionary.get('gift_wrap_amount')) if 'gift_wrap_amount' in dictionary.keys() else APIHelper.SKIP + tax_percentage = dictionary.get("tax_percentage") if dictionary.get("tax_percentage") else APIHelper.SKIP + tax_amounts = None + if dictionary.get('tax_amounts') is not None: + tax_amounts = [TaxAmount.from_dictionary(x) for x in dictionary.get('tax_amounts')] + else: + tax_amounts = APIHelper.SKIP + basic_shipping_amount = Money.from_dictionary(dictionary.get('basic_shipping_amount')) if 'basic_shipping_amount' in dictionary.keys() else APIHelper.SKIP + extra_shipping_amount = Money.from_dictionary(dictionary.get('extra_shipping_amount')) if 'extra_shipping_amount' in dictionary.keys() else APIHelper.SKIP + handling_amount = Money.from_dictionary(dictionary.get('handling_amount')) if 'handling_amount' in dictionary.keys() else APIHelper.SKIP + insurance_amount = Money.from_dictionary(dictionary.get('insurance_amount')) if 'insurance_amount' in dictionary.keys() else APIHelper.SKIP + total_item_amount = Money.from_dictionary(dictionary.get('total_item_amount')) if 'total_item_amount' in dictionary.keys() else APIHelper.SKIP + invoice_number = dictionary.get("invoice_number") if dictionary.get("invoice_number") else APIHelper.SKIP + checkout_options = None + if dictionary.get('checkout_options') is not None: + checkout_options = [CheckoutOption.from_dictionary(x) for x in dictionary.get('checkout_options')] + else: + checkout_options = APIHelper.SKIP + # Return an object of this model + return cls(item_code, + item_name, + item_description, + item_options, + item_quantity, + item_unit_price, + item_amount, + discount_amount, + adjustment_amount, + gift_wrap_amount, + tax_percentage, + tax_amounts, + basic_shipping_amount, + extra_shipping_amount, + handling_amount, + insurance_amount, + total_item_amount, + invoice_number, + checkout_options) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'item_code={(self.item_code if hasattr(self, "item_code") else None)!r}, ' + f'item_name={(self.item_name if hasattr(self, "item_name") else None)!r}, ' + f'item_description={(self.item_description if hasattr(self, "item_description") else None)!r}, ' + f'item_options={(self.item_options if hasattr(self, "item_options") else None)!r}, ' + f'item_quantity={(self.item_quantity if hasattr(self, "item_quantity") else None)!r}, ' + f'item_unit_price={(self.item_unit_price if hasattr(self, "item_unit_price") else None)!r}, ' + f'item_amount={(self.item_amount if hasattr(self, "item_amount") else None)!r}, ' + f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' + f'adjustment_amount={(self.adjustment_amount if hasattr(self, "adjustment_amount") else None)!r}, ' + f'gift_wrap_amount={(self.gift_wrap_amount if hasattr(self, "gift_wrap_amount") else None)!r}, ' + f'tax_percentage={(self.tax_percentage if hasattr(self, "tax_percentage") else None)!r}, ' + f'tax_amounts={(self.tax_amounts if hasattr(self, "tax_amounts") else None)!r}, ' + f'basic_shipping_amount={(self.basic_shipping_amount if hasattr(self, "basic_shipping_amount") else None)!r}, ' + f'extra_shipping_amount={(self.extra_shipping_amount if hasattr(self, "extra_shipping_amount") else None)!r}, ' + f'handling_amount={(self.handling_amount if hasattr(self, "handling_amount") else None)!r}, ' + f'insurance_amount={(self.insurance_amount if hasattr(self, "insurance_amount") else None)!r}, ' + f'total_item_amount={(self.total_item_amount if hasattr(self, "total_item_amount") else None)!r}, ' + f'invoice_number={(self.invoice_number if hasattr(self, "invoice_number") else None)!r}, ' + f'checkout_options={(self.checkout_options if hasattr(self, "checkout_options") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'item_code={(self.item_code if hasattr(self, "item_code") else None)!s}, ' + f'item_name={(self.item_name if hasattr(self, "item_name") else None)!s}, ' + f'item_description={(self.item_description if hasattr(self, "item_description") else None)!s}, ' + f'item_options={(self.item_options if hasattr(self, "item_options") else None)!s}, ' + f'item_quantity={(self.item_quantity if hasattr(self, "item_quantity") else None)!s}, ' + f'item_unit_price={(self.item_unit_price if hasattr(self, "item_unit_price") else None)!s}, ' + f'item_amount={(self.item_amount if hasattr(self, "item_amount") else None)!s}, ' + f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' + f'adjustment_amount={(self.adjustment_amount if hasattr(self, "adjustment_amount") else None)!s}, ' + f'gift_wrap_amount={(self.gift_wrap_amount if hasattr(self, "gift_wrap_amount") else None)!s}, ' + f'tax_percentage={(self.tax_percentage if hasattr(self, "tax_percentage") else None)!s}, ' + f'tax_amounts={(self.tax_amounts if hasattr(self, "tax_amounts") else None)!s}, ' + f'basic_shipping_amount={(self.basic_shipping_amount if hasattr(self, "basic_shipping_amount") else None)!s}, ' + f'extra_shipping_amount={(self.extra_shipping_amount if hasattr(self, "extra_shipping_amount") else None)!s}, ' + f'handling_amount={(self.handling_amount if hasattr(self, "handling_amount") else None)!s}, ' + f'insurance_amount={(self.insurance_amount if hasattr(self, "insurance_amount") else None)!s}, ' + f'total_item_amount={(self.total_item_amount if hasattr(self, "total_item_amount") else None)!s}, ' + f'invoice_number={(self.invoice_number if hasattr(self, "invoice_number") else None)!s}, ' + f'checkout_options={(self.checkout_options if hasattr(self, "checkout_options") else None)!s})') diff --git a/paypalserversdk/models/item_request.py b/paypalserversdk/models/item_request.py new file mode 100644 index 0000000..fdef54c --- /dev/null +++ b/paypalserversdk/models/item_request.py @@ -0,0 +1,176 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money +from paypalserversdk.models.order_billing_plan import OrderBillingPlan +from paypalserversdk.models.universal_product_code import UniversalProductCode + + +class ItemRequest(object): + + """Implementation of the 'Item Request' model. + + The details for the items to be purchased. + + Attributes: + name (str): The item name or title. + unit_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + tax (Money): The currency and amount for a financial transaction, such + as a balance or payment due. + quantity (str): The item quantity. Must be a whole number. + description (str): This field supports up to 4000 characters, but any + content beyond 2048 characters (including spaces) will be + truncated. The 2048 character limit is reflected in the response + representation of this field. + sku (str): The stock keeping unit (SKU) for the item. + url (str): The URL to the item being purchased. Visible to buyer and + used in buyer experiences. + category (ItemCategory): The item category type. + image_url (str): The URL of the item's image. File type and size + restrictions apply. An image that violates these restrictions will + not be honored. + upc (UniversalProductCode): The Universal Product Code of the item. + billing_plan (OrderBillingPlan): Metadata for merchant-managed + recurring billing plans. Valid only during the saved payment + method token or billing agreement creation. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": 'name', + "unit_amount": 'unit_amount', + "quantity": 'quantity', + "tax": 'tax', + "description": 'description', + "sku": 'sku', + "url": 'url', + "category": 'category', + "image_url": 'image_url', + "upc": 'upc', + "billing_plan": 'billing_plan' + } + + _optionals = [ + 'tax', + 'description', + 'sku', + 'url', + 'category', + 'image_url', + 'upc', + 'billing_plan', + ] + + def __init__(self, + name=None, + unit_amount=None, + quantity=None, + tax=APIHelper.SKIP, + description=APIHelper.SKIP, + sku=APIHelper.SKIP, + url=APIHelper.SKIP, + category=APIHelper.SKIP, + image_url=APIHelper.SKIP, + upc=APIHelper.SKIP, + billing_plan=APIHelper.SKIP): + """Constructor for the ItemRequest class""" + + # Initialize members of the class + self.name = name + self.unit_amount = unit_amount + if tax is not APIHelper.SKIP: + self.tax = tax + self.quantity = quantity + if description is not APIHelper.SKIP: + self.description = description + if sku is not APIHelper.SKIP: + self.sku = sku + if url is not APIHelper.SKIP: + self.url = url + if category is not APIHelper.SKIP: + self.category = category + if image_url is not APIHelper.SKIP: + self.image_url = image_url + if upc is not APIHelper.SKIP: + self.upc = upc + if billing_plan is not APIHelper.SKIP: + self.billing_plan = billing_plan + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name = dictionary.get("name") if dictionary.get("name") else None + unit_amount = Money.from_dictionary(dictionary.get('unit_amount')) if dictionary.get('unit_amount') else None + quantity = dictionary.get("quantity") if dictionary.get("quantity") else None + tax = Money.from_dictionary(dictionary.get('tax')) if 'tax' in dictionary.keys() else APIHelper.SKIP + description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP + sku = dictionary.get("sku") if dictionary.get("sku") else APIHelper.SKIP + url = dictionary.get("url") if dictionary.get("url") else APIHelper.SKIP + category = dictionary.get("category") if dictionary.get("category") else APIHelper.SKIP + image_url = dictionary.get("image_url") if dictionary.get("image_url") else APIHelper.SKIP + upc = UniversalProductCode.from_dictionary(dictionary.get('upc')) if 'upc' in dictionary.keys() else APIHelper.SKIP + billing_plan = OrderBillingPlan.from_dictionary(dictionary.get('billing_plan')) if 'billing_plan' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(name, + unit_amount, + quantity, + tax, + description, + sku, + url, + category, + image_url, + upc, + billing_plan) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'name={self.name!r}, ' + f'unit_amount={self.unit_amount!r}, ' + f'tax={(self.tax if hasattr(self, "tax") else None)!r}, ' + f'quantity={self.quantity!r}, ' + f'description={(self.description if hasattr(self, "description") else None)!r}, ' + f'sku={(self.sku if hasattr(self, "sku") else None)!r}, ' + f'url={(self.url if hasattr(self, "url") else None)!r}, ' + f'category={(self.category if hasattr(self, "category") else None)!r}, ' + f'image_url={(self.image_url if hasattr(self, "image_url") else None)!r}, ' + f'upc={(self.upc if hasattr(self, "upc") else None)!r}, ' + f'billing_plan={(self.billing_plan if hasattr(self, "billing_plan") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'name={self.name!s}, ' + f'unit_amount={self.unit_amount!s}, ' + f'tax={(self.tax if hasattr(self, "tax") else None)!s}, ' + f'quantity={self.quantity!s}, ' + f'description={(self.description if hasattr(self, "description") else None)!s}, ' + f'sku={(self.sku if hasattr(self, "sku") else None)!s}, ' + f'url={(self.url if hasattr(self, "url") else None)!s}, ' + f'category={(self.category if hasattr(self, "category") else None)!s}, ' + f'image_url={(self.image_url if hasattr(self, "image_url") else None)!s}, ' + f'upc={(self.upc if hasattr(self, "upc") else None)!s}, ' + f'billing_plan={(self.billing_plan if hasattr(self, "billing_plan") else None)!s})') diff --git a/paypalserversdk/models/last_payment_details.py b/paypalserversdk/models/last_payment_details.py new file mode 100644 index 0000000..586cb5f --- /dev/null +++ b/paypalserversdk/models/last_payment_details.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class LastPaymentDetails(object): + + """Implementation of the 'Last Payment Details' model. + + Attributes: + amount (Money): The currency and amount for a financial transaction, + such as a balance or payment due. + time (str): 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. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "amount": 'amount', + "time": 'time' + } + + _optionals = [ + 'amount', + 'time', + ] + + def __init__(self, + amount=APIHelper.SKIP, + time=APIHelper.SKIP): + """Constructor for the LastPaymentDetails class""" + + # Initialize members of the class + if amount is not APIHelper.SKIP: + self.amount = amount + if time is not APIHelper.SKIP: + self.time = time + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP + time = dictionary.get("time") if dictionary.get("time") else APIHelper.SKIP + # Return an object of this model + return cls(amount, + time) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' + f'time={(self.time if hasattr(self, "time") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' + f'time={(self.time if hasattr(self, "time") else None)!s})') diff --git a/paypalserversdk/models/link_http_method.py b/paypalserversdk/models/link_http_method.py index 683b5bb..52a5c0d 100644 --- a/paypalserversdk/models/link_http_method.py +++ b/paypalserversdk/models/link_http_method.py @@ -15,14 +15,14 @@ class LinkHttpMethod(object): The HTTP method required to make the related call. Attributes: - GET: The enum member of type str. - POST: The enum member of type str. - PUT: The enum member of type str. - DELETE: The enum member of type str. - HEAD: The enum member of type str. - CONNECT: The enum member of type str. - OPTIONS: The enum member of type str. - PATCH: The enum member of type str. + GET: The HTTP GET method. + POST: The HTTP POST method. + PUT: The HTTP PUT method. + DELETE: The HTTP DELETE method. + HEAD: The HTTP HEAD method. + CONNECT: The HTTP CONNECT method. + OPTIONS: The HTTP OPTIONS method. + PATCH: The HTTP PATCH method. """ GET = 'GET' diff --git a/paypalserversdk/models/merchant_preferences.py b/paypalserversdk/models/merchant_preferences.py new file mode 100644 index 0000000..ed5607a --- /dev/null +++ b/paypalserversdk/models/merchant_preferences.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class MerchantPreferences(object): + + """Implementation of the 'Merchant Preferences' model. + + The merchant preferences for a subscription. + + Attributes: + return_url (str): The URL where the customer is redirected after the + customer approves the payment. + cancel_url (str): The URL where the customer is redirected after the + customer cancels the payment. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "return_url": 'return_url', + "cancel_url": 'cancel_url' + } + + _optionals = [ + 'return_url', + 'cancel_url', + ] + + def __init__(self, + return_url=APIHelper.SKIP, + cancel_url=APIHelper.SKIP): + """Constructor for the MerchantPreferences class""" + + # Initialize members of the class + if return_url is not APIHelper.SKIP: + self.return_url = return_url + if cancel_url is not APIHelper.SKIP: + self.cancel_url = cancel_url + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + return_url = dictionary.get("return_url") if dictionary.get("return_url") else APIHelper.SKIP + cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else APIHelper.SKIP + # Return an object of this model + return cls(return_url, + cancel_url) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'return_url={(self.return_url if hasattr(self, "return_url") else None)!r}, ' + f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'return_url={(self.return_url if hasattr(self, "return_url") else None)!s}, ' + f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!s})') diff --git a/paypalserversdk/models/mobile_return_flow.py b/paypalserversdk/models/mobile_return_flow.py new file mode 100644 index 0000000..566a5f2 --- /dev/null +++ b/paypalserversdk/models/mobile_return_flow.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class MobileReturnFlow(object): + + """Implementation of the 'Mobile Return Flow' enum. + + Merchant preference on how the buyer can navigate back to merchant website + post approving the transaction on the PayPal App. + + Attributes: + AUTO: After payment approval in the PayPal App, buyer will + automatically be redirected to the merchant website. + MANUAL: After payment approval in the PayPal App, buyer will be asked + to manually navigate back to the merchant website where they + started the transaction from. The buyer is shown a message like + 'Return to Merchant' to return to the source where the transaction + actually started. + + """ + AUTO = 'AUTO' + + MANUAL = 'MANUAL' + diff --git a/paypalserversdk/models/mobile_web_context.py b/paypalserversdk/models/mobile_web_context.py new file mode 100644 index 0000000..e912ec2 --- /dev/null +++ b/paypalserversdk/models/mobile_web_context.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class MobileWebContext(object): + + """Implementation of the 'Mobile Web Context' model. + + Buyer's mobile web browser context to app switch to the PayPal consumer + app. + + Attributes: + return_flow (MobileReturnFlow): Merchant preference on how the buyer + can navigate back to merchant website post approving the + transaction on the PayPal App. + buyer_user_agent (str): User agent from the request originating from + the buyer's device. This will be used to identify the buyer's + operating system and browser versions. NOTE: Merchants must not + alter or modify the buyer's device user agent. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "return_flow": 'return_flow', + "buyer_user_agent": 'buyer_user_agent' + } + + _optionals = [ + 'return_flow', + 'buyer_user_agent', + ] + + def __init__(self, + return_flow='AUTO', + buyer_user_agent=APIHelper.SKIP): + """Constructor for the MobileWebContext class""" + + # Initialize members of the class + self.return_flow = return_flow + if buyer_user_agent is not APIHelper.SKIP: + self.buyer_user_agent = buyer_user_agent + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + return_flow = dictionary.get("return_flow") if dictionary.get("return_flow") else 'AUTO' + buyer_user_agent = dictionary.get("buyer_user_agent") if dictionary.get("buyer_user_agent") else APIHelper.SKIP + # Return an object of this model + return cls(return_flow, + buyer_user_agent) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'return_flow={(self.return_flow if hasattr(self, "return_flow") else None)!r}, ' + f'buyer_user_agent={(self.buyer_user_agent if hasattr(self, "buyer_user_agent") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'return_flow={(self.return_flow if hasattr(self, "return_flow") else None)!s}, ' + f'buyer_user_agent={(self.buyer_user_agent if hasattr(self, "buyer_user_agent") else None)!s})') diff --git a/paypalserversdk/models/modify_subscription_request.py b/paypalserversdk/models/modify_subscription_request.py new file mode 100644 index 0000000..30538cc --- /dev/null +++ b/paypalserversdk/models/modify_subscription_request.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money +from paypalserversdk.models.plan_override import PlanOverride +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.subscription_patch_application_context import SubscriptionPatchApplicationContext + + +class ModifySubscriptionRequest(object): + + """Implementation of the 'Modify Subscription Request' model. + + The request to update the quantity of the product or service in a + subscription. You can also use this method to switch the plan and update + the `shipping_amount` and `shipping_address` values for the subscription. + This type of update requires the buyer's consent. + + Attributes: + plan_id (str): The unique PayPal-generated ID for the plan. + quantity (str): The quantity of the product or service in the + subscription. + shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + shipping_address (ShippingDetails): The shipping details. + application_context (SubscriptionPatchApplicationContext): The + application context, which customizes the payer experience during + the subscription approval process with PayPal. + plan (PlanOverride): An inline plan object to customise the + subscription. You can override plan level default attributes by + providing customised values for the subscription in this object. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "plan_id": 'plan_id', + "quantity": 'quantity', + "shipping_amount": 'shipping_amount', + "shipping_address": 'shipping_address', + "application_context": 'application_context', + "plan": 'plan' + } + + _optionals = [ + 'plan_id', + 'quantity', + 'shipping_amount', + 'shipping_address', + 'application_context', + 'plan', + ] + + def __init__(self, + plan_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + shipping_amount=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + application_context=APIHelper.SKIP, + plan=APIHelper.SKIP): + """Constructor for the ModifySubscriptionRequest class""" + + # Initialize members of the class + if plan_id is not APIHelper.SKIP: + self.plan_id = plan_id + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if shipping_amount is not APIHelper.SKIP: + self.shipping_amount = shipping_amount + if shipping_address is not APIHelper.SKIP: + self.shipping_address = shipping_address + if application_context is not APIHelper.SKIP: + self.application_context = application_context + if plan is not APIHelper.SKIP: + self.plan = plan + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + plan_id = dictionary.get("plan_id") if dictionary.get("plan_id") else APIHelper.SKIP + quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP + shipping_amount = Money.from_dictionary(dictionary.get('shipping_amount')) if 'shipping_amount' in dictionary.keys() else APIHelper.SKIP + shipping_address = ShippingDetails.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP + application_context = SubscriptionPatchApplicationContext.from_dictionary(dictionary.get('application_context')) if 'application_context' in dictionary.keys() else APIHelper.SKIP + plan = PlanOverride.from_dictionary(dictionary.get('plan')) if 'plan' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(plan_id, + quantity, + shipping_amount, + shipping_address, + application_context, + plan) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'plan_id={(self.plan_id if hasattr(self, "plan_id") else None)!r}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!r}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' + f'application_context={(self.application_context if hasattr(self, "application_context") else None)!r}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'plan_id={(self.plan_id if hasattr(self, "plan_id") else None)!s}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!s}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' + f'application_context={(self.application_context if hasattr(self, "application_context") else None)!s}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!s})') diff --git a/paypalserversdk/models/modify_subscription_response.py b/paypalserversdk/models/modify_subscription_response.py new file mode 100644 index 0000000..5d4e661 --- /dev/null +++ b/paypalserversdk/models/modify_subscription_response.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.money import Money +from paypalserversdk.models.plan_override import PlanOverride +from paypalserversdk.models.shipping_details import ShippingDetails + + +class ModifySubscriptionResponse(object): + + """Implementation of the 'Modify Subscription Response' model. + + The response to a request to update the quantity of the product or service + in a subscription. You can also use this method to switch the plan and + update the `shipping_amount` and `shipping_address` values for the + subscription. This type of update requires the buyer's consent. + + Attributes: + plan_id (str): The unique PayPal-generated ID for the plan. + quantity (str): The quantity of the product or service in the + subscription. + shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + shipping_address (ShippingDetails): The shipping details. + plan (PlanOverride): An inline plan object to customise the + subscription. You can override plan level default attributes by + providing customised values for the subscription in this object. + plan_overridden (bool): Indicates whether the subscription has + overridden any plan attributes. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/docs/api/reference/api-responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "plan_id": 'plan_id', + "quantity": 'quantity', + "shipping_amount": 'shipping_amount', + "shipping_address": 'shipping_address', + "plan": 'plan', + "plan_overridden": 'plan_overridden', + "links": 'links' + } + + _optionals = [ + 'plan_id', + 'quantity', + 'shipping_amount', + 'shipping_address', + 'plan', + 'plan_overridden', + 'links', + ] + + def __init__(self, + plan_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + shipping_amount=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + plan=APIHelper.SKIP, + plan_overridden=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the ModifySubscriptionResponse class""" + + # Initialize members of the class + if plan_id is not APIHelper.SKIP: + self.plan_id = plan_id + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if shipping_amount is not APIHelper.SKIP: + self.shipping_amount = shipping_amount + if shipping_address is not APIHelper.SKIP: + self.shipping_address = shipping_address + if plan is not APIHelper.SKIP: + self.plan = plan + if plan_overridden is not APIHelper.SKIP: + self.plan_overridden = plan_overridden + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + plan_id = dictionary.get("plan_id") if dictionary.get("plan_id") else APIHelper.SKIP + quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP + shipping_amount = Money.from_dictionary(dictionary.get('shipping_amount')) if 'shipping_amount' in dictionary.keys() else APIHelper.SKIP + shipping_address = ShippingDetails.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP + plan = PlanOverride.from_dictionary(dictionary.get('plan')) if 'plan' in dictionary.keys() else APIHelper.SKIP + plan_overridden = dictionary.get("plan_overridden") if "plan_overridden" in dictionary.keys() else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(plan_id, + quantity, + shipping_amount, + shipping_address, + plan, + plan_overridden, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'plan_id={(self.plan_id if hasattr(self, "plan_id") else None)!r}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!r}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!r}, ' + f'plan_overridden={(self.plan_overridden if hasattr(self, "plan_overridden") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'plan_id={(self.plan_id if hasattr(self, "plan_id") else None)!s}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!s}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!s}, ' + f'plan_overridden={(self.plan_overridden if hasattr(self, "plan_overridden") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/native_app_context.py b/paypalserversdk/models/native_app_context.py new file mode 100644 index 0000000..1c1db03 --- /dev/null +++ b/paypalserversdk/models/native_app_context.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class NativeAppContext(object): + + """Implementation of the 'Native App Context' model. + + Merchant provided, buyer's native app preferences to app switch to the + PayPal consumer app. + + Attributes: + os_type (OsType): Operating System type of the device that the buyer + is using. + os_version (str): Operating System version of the device that the + buyer is using. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "os_type": 'os_type', + "os_version": 'os_version' + } + + _optionals = [ + 'os_type', + 'os_version', + ] + + def __init__(self, + os_type=APIHelper.SKIP, + os_version=APIHelper.SKIP): + """Constructor for the NativeAppContext class""" + + # Initialize members of the class + if os_type is not APIHelper.SKIP: + self.os_type = os_type + if os_version is not APIHelper.SKIP: + self.os_version = os_version + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + os_type = dictionary.get("os_type") if dictionary.get("os_type") else APIHelper.SKIP + os_version = dictionary.get("os_version") if dictionary.get("os_version") else APIHelper.SKIP + # Return an object of this model + return cls(os_type, + os_version) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'os_type={(self.os_type if hasattr(self, "os_type") else None)!r}, ' + f'os_version={(self.os_version if hasattr(self, "os_version") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'os_type={(self.os_type if hasattr(self, "os_type") else None)!s}, ' + f'os_version={(self.os_version if hasattr(self, "os_version") else None)!s})') diff --git a/paypalserversdk/models/network_transaction_reference.py b/paypalserversdk/models/network_transaction.py similarity index 85% rename from paypalserversdk/models/network_transaction_reference.py rename to paypalserversdk/models/network_transaction.py index e4ac077..5d8f64c 100644 --- a/paypalserversdk/models/network_transaction_reference.py +++ b/paypalserversdk/models/network_transaction.py @@ -9,9 +9,9 @@ from paypalserversdk.api_helper import APIHelper -class NetworkTransactionReference(object): +class NetworkTransaction(object): - """Implementation of the 'Network Transaction Reference' model. + """Implementation of the 'Network Transaction' model. Reference values used by the card network to identify a transaction. @@ -25,7 +25,10 @@ class NetworkTransactionReference(object): special character -. date (str): The date that the transaction was authorized by the scheme. This field may not be returned for all networks. - MasterCard refers to this field as "BankNet reference date. + MasterCard refers to this field as "BankNet reference date". For + some specific networks, such as MasterCard and Discover, this date + field is mandatory when the + `previous_network_transaction_reference_id` is passed. network (CardBrand): The card network or brand. Applies to credit, debit, gift, and payment cards. acquirer_reference_number (str): Reference ID issued for the card @@ -43,20 +46,22 @@ class NetworkTransactionReference(object): } _optionals = [ + 'id', 'date', 'network', 'acquirer_reference_number', ] def __init__(self, - id=None, + id=APIHelper.SKIP, date=APIHelper.SKIP, network=APIHelper.SKIP, acquirer_reference_number=APIHelper.SKIP): - """Constructor for the NetworkTransactionReference class""" + """Constructor for the NetworkTransaction class""" # Initialize members of the class - self.id = id + if id is not APIHelper.SKIP: + self.id = id if date is not APIHelper.SKIP: self.date = date if network is not APIHelper.SKIP: @@ -83,7 +88,7 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None + id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP date = dictionary.get("date") if dictionary.get("date") else APIHelper.SKIP network = dictionary.get("network") if dictionary.get("network") else APIHelper.SKIP acquirer_reference_number = dictionary.get("acquirer_reference_number") if dictionary.get("acquirer_reference_number") else APIHelper.SKIP @@ -95,14 +100,14 @@ def from_dictionary(cls, def __repr__(self): return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' + f'id={(self.id if hasattr(self, "id") else None)!r}, ' f'date={(self.date if hasattr(self, "date") else None)!r}, ' f'network={(self.network if hasattr(self, "network") else None)!r}, ' f'acquirer_reference_number={(self.acquirer_reference_number if hasattr(self, "acquirer_reference_number") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' + f'id={(self.id if hasattr(self, "id") else None)!s}, ' f'date={(self.date if hasattr(self, "date") else None)!s}, ' f'network={(self.network if hasattr(self, "network") else None)!s}, ' f'acquirer_reference_number={(self.acquirer_reference_number if hasattr(self, "acquirer_reference_number") else None)!s})') diff --git a/paypalserversdk/models/order.py b/paypalserversdk/models/order.py index 619145f..c02c9b6 100644 --- a/paypalserversdk/models/order.py +++ b/paypalserversdk/models/order.py @@ -36,7 +36,11 @@ class Order(object): intent (CheckoutPaymentIntent): The intent to either capture payment immediately or authorize a payment for an order after order creation. - payer (Payer): The model property of type Payer. + payer (Payer): DEPRECATED. The customer is also known as the payer. + The Payer object was intended to only be used with the + `payment_source.paypal` object. In order to make this design more + clear, the details in the `payer` object are now available under + `payment_source.paypal`. Please use `payment_source.paypal`. purchase_units (List[PurchaseUnit]): An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial diff --git a/paypalserversdk/models/order_application_context.py b/paypalserversdk/models/order_application_context.py index 1611222..7c4de35 100644 --- a/paypalserversdk/models/order_application_context.py +++ b/paypalserversdk/models/order_application_context.py @@ -29,17 +29,16 @@ class OrderApplicationContext(object): `payment_source.paypal.experience_context.brand_name`). Please specify this field in the `experience_context` object instead of the `application_context` object. - locale (str): The [language - tag](https://tools.ietf.org/html/bcp47#section-2) for the language - in which to localize the error-related strings, such as messages, - issues, and suggested actions. The tag is made up of the [ISO - 639-2 language - code](https://www.loc.gov/standards/iso639-2/php/code_list.php), - the optional [ISO-15924 script - tag](https://www.unicode.org/iso15924/codelists.html), and the - [ISO-3166 alpha-2 country - code](/api/rest/reference/country-codes/) or [M49 region - code](https://unstats.un.org/unsd/methodology/m49/). + locale (str): DEPRECATED. The BCP 47-formatted locale of pages that + the PayPal payment experience shows. PayPal supports a + five-character code. For example, `da-DK`, `he-IL`, `id-ID`, + `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, + `zh-HK`, or `zh-TW`. The fields in `application_context` are now + available in the `experience_context` object under the + `payment_source` which supports them (eg. + `payment_source.paypal.experience_context.locale`). Please specify + this field in the `experience_context` object instead of the + `application_context` object. landing_page (OrderApplicationContextLandingPage): DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for customer checkout. The fields in `application_context` are @@ -67,8 +66,13 @@ class OrderApplicationContext(object): `payment_source.paypal.experience_context.user_action`). Please specify this field in the `experience_context` object instead of the `application_context` object. - payment_method (PaymentMethodPreference): The customer and merchant - payment preferences. + payment_method (PaymentMethodPreference): DEPRECATED. The customer and + merchant payment preferences. The fields in `application_context` + are now available in the `experience_context` object under the + `payment_source` which supports them (eg. + `payment_source.paypal.experience_context.payment_method_selected`) + . Please specify this field in the `experience_context` object + instead of the `application_context` object.. return_url (str): DEPRECATED. The URL where the customer is redirected after the customer approves the payment. The fields in `application_context` are now available in the @@ -85,10 +89,10 @@ class OrderApplicationContext(object): `payment_source.paypal.experience_context.cancel_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. - stored_payment_source (StoredPaymentSource): Provides additional - details to process a payment using a `payment_source` that has - been stored or is intended to be stored (also referred to as - stored_credential or card-on-file). Parameter compatibility: + stored_payment_source (StoredPaymentSource): DEPRECATED. Provides + additional details to process a payment using a `payment_source` + that has been stored or is intended to be stored (also referred to + as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. @@ -97,7 +101,12 @@ class OrderApplicationContext(object): `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the - request. + request. . The fields in `stored_payment_source` are now + available in the `stored_credential` object under the + `payment_source` which supports them (eg. + `payment_source.card.stored_credential.payment_initiator`). Please + specify this field in the `payment_source` object instead of the + `application_context` object. """ diff --git a/paypalserversdk/models/order_application_context_shipping_preference.py b/paypalserversdk/models/order_application_context_shipping_preference.py index 4e8853f..52950d8 100644 --- a/paypalserversdk/models/order_application_context_shipping_preference.py +++ b/paypalserversdk/models/order_application_context_shipping_preference.py @@ -20,9 +20,7 @@ class OrderApplicationContextShippingPreference(object): which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the - `application_context` object., The shipping preference. This only applies - to PayPal payment source., The shipping preference. This only applies to - PayPal payment source. + `application_context` object. Attributes: GET_FROM_FILE: Use the customer-provided shipping address on the diff --git a/paypalserversdk/models/order_authorize_response.py b/paypalserversdk/models/order_authorize_response.py index 268708b..63387f8 100644 --- a/paypalserversdk/models/order_authorize_response.py +++ b/paypalserversdk/models/order_authorize_response.py @@ -17,6 +17,8 @@ class OrderAuthorizeResponse(object): """Implementation of the 'Order Authorize Response' model. + The order authorize response. + Attributes: create_time (str): The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds @@ -34,16 +36,25 @@ class OrderAuthorizeResponse(object): intent (CheckoutPaymentIntent): The intent to either capture payment immediately or authorize a payment for an order after order creation. - payer (Payer): The model property of type Payer. + payer (Payer): The customer who approves and pays for the order. The + customer is also known as the payer. purchase_units (List[PurchaseUnit]): An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant. status (OrderStatus): The order status. - links (List[LinkDescription]): An array of request-related [HATEOAS - links](/api/rest/responses/#hateoas-links) that are either - relevant to the issue by providing additional information or - offering potential resolutions. + links (List[LinkDescription]): An array of request-related HATEOAS + links. To complete payer approval, use the `approve` link to + redirect the payer. The API caller has 6 hours (default setting, + this which can be changed by your account manager to 24/48/72 + hours to accommodate your use case) from the time the order is + created, to redirect your payer. Once redirected, the API caller + has 6 hours for the payer to approve the order and either + authorize or capture the order. If you are not using the PayPal + JavaScript SDK to initiate PayPal Checkout (in context) ensure + that you include `application_context.return_url` is specified or + you will get "We're sorry, Things don't appear to be working at + the moment" after the payer approves the payment. """ diff --git a/paypalserversdk/models/order_request.py b/paypalserversdk/models/order_request.py index 8da750c..72017df 100644 --- a/paypalserversdk/models/order_request.py +++ b/paypalserversdk/models/order_request.py @@ -23,7 +23,11 @@ class OrderRequest(object): intent (CheckoutPaymentIntent): The intent to either capture payment immediately or authorize a payment for an order after order creation. - payer (Payer): The model property of type Payer. + payer (Payer): DEPRECATED. The customer is also known as the payer. + The Payer object was intended to only be used with the + `payment_source.paypal` object. In order to make this design more + clear, the details in the `payer` object are now available under + `payment_source.paypal`. Please use `payment_source.paypal`. purchase_units (List[PurchaseUnitRequest]): An array of purchase units. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or diff --git a/paypalserversdk/models/order_update_callback_error_response.py b/paypalserversdk/models/order_update_callback_error_response.py deleted file mode 100644 index 606d484..0000000 --- a/paypalserversdk/models/order_update_callback_error_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.order_update_callback_error_response_details import OrderUpdateCallbackErrorResponseDetails - - -class OrderUpdateCallbackErrorResponse(object): - - """Implementation of the 'Order Update Callback Error Response' model. - - The error details. - - Attributes: - name (str): The human-readable, unique name of the error. - message (str): The message that describes the error. - details (List[OrderUpdateCallbackErrorResponseDetails]): An array of - additional details about the error. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "name": 'name', - "message": 'message', - "details": 'details' - } - - _optionals = [ - 'message', - 'details', - ] - - def __init__(self, - name=None, - message=APIHelper.SKIP, - details=APIHelper.SKIP): - """Constructor for the OrderUpdateCallbackErrorResponse class""" - - # Initialize members of the class - self.name = name - if message is not APIHelper.SKIP: - self.message = message - if details is not APIHelper.SKIP: - self.details = details - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP - details = None - if dictionary.get('details') is not None: - details = [OrderUpdateCallbackErrorResponseDetails.from_dictionary(x) for x in dictionary.get('details')] - else: - details = APIHelper.SKIP - # Return an object of this model - return cls(name, - message, - details) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'message={(self.message if hasattr(self, "message") else None)!r}, ' - f'details={(self.details if hasattr(self, "details") else None)!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'message={(self.message if hasattr(self, "message") else None)!s}, ' - f'details={(self.details if hasattr(self, "details") else None)!s})') diff --git a/paypalserversdk/models/order_update_callback_request.py b/paypalserversdk/models/order_update_callback_request.py deleted file mode 100644 index 303969d..0000000 --- a/paypalserversdk/models/order_update_callback_request.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.order_update_callback_shipping_address import OrderUpdateCallbackShippingAddress -from paypalserversdk.models.order_update_callback_shipping_option import OrderUpdateCallbackShippingOption -from paypalserversdk.models.purchase_unit_request import PurchaseUnitRequest - - -class OrderUpdateCallbackRequest(object): - - """Implementation of the 'Order Update Callback Request' model. - - Shipping Options Callback request. This will be implemented by the - merchants. - - Attributes: - id (str): The ID of the order. - shipping_address (OrderUpdateCallbackShippingAddress): The portable - international postal address. Maps to - [AddressValidationMetadata](https://github.com/googlei18n/libaddres - sinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling - form controls: the autocomplete - attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling- - form-controls-the-autocomplete-attribute). - shipping_option (OrderUpdateCallbackShippingOption): The options that - the payee or merchant offers to the payer to ship or pick up their - items. - purchase_units (List[PurchaseUnitRequest]): An array of purchase - units. At present only 1 purchase_unit is supported. Each purchase - unit establishes a contract between a payer and the payee. Each - purchase unit represents either a full or partial order that the - payer intends to purchase from the payee. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "shipping_address": 'shipping_address', - "purchase_units": 'purchase_units', - "id": 'id', - "shipping_option": 'shipping_option' - } - - _optionals = [ - 'id', - 'shipping_option', - ] - - def __init__(self, - shipping_address=None, - purchase_units=None, - id=APIHelper.SKIP, - shipping_option=APIHelper.SKIP): - """Constructor for the OrderUpdateCallbackRequest class""" - - # Initialize members of the class - if id is not APIHelper.SKIP: - self.id = id - self.shipping_address = shipping_address - if shipping_option is not APIHelper.SKIP: - self.shipping_option = shipping_option - self.purchase_units = purchase_units - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - shipping_address = OrderUpdateCallbackShippingAddress.from_dictionary(dictionary.get('shipping_address')) if dictionary.get('shipping_address') else None - purchase_units = None - if dictionary.get('purchase_units') is not None: - purchase_units = [PurchaseUnitRequest.from_dictionary(x) for x in dictionary.get('purchase_units')] - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - shipping_option = OrderUpdateCallbackShippingOption.from_dictionary(dictionary.get('shipping_option')) if 'shipping_option' in dictionary.keys() else APIHelper.SKIP - # Return an object of this model - return cls(shipping_address, - purchase_units, - id, - shipping_option) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'shipping_address={self.shipping_address!r}, ' - f'shipping_option={(self.shipping_option if hasattr(self, "shipping_option") else None)!r}, ' - f'purchase_units={self.purchase_units!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'shipping_address={self.shipping_address!s}, ' - f'shipping_option={(self.shipping_option if hasattr(self, "shipping_option") else None)!s}, ' - f'purchase_units={self.purchase_units!s})') diff --git a/paypalserversdk/models/order_update_callback_response.py b/paypalserversdk/models/order_update_callback_response.py deleted file mode 100644 index c240b19..0000000 --- a/paypalserversdk/models/order_update_callback_response.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.shipping_options_purchase_unit import ShippingOptionsPurchaseUnit - - -class OrderUpdateCallbackResponse(object): - - """Implementation of the 'Order Update Callback Response' model. - - Returns the updated shipping options for an order. - - Attributes: - id (str): The ID of the order. - purchase_units (ShippingOptionsPurchaseUnit): This would contain - shipping option and amount data at purchase unit level. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "id": 'id', - "purchase_units": 'purchase_units' - } - - _optionals = [ - 'id', - 'purchase_units', - ] - - def __init__(self, - id=APIHelper.SKIP, - purchase_units=APIHelper.SKIP): - """Constructor for the OrderUpdateCallbackResponse class""" - - # Initialize members of the class - if id is not APIHelper.SKIP: - self.id = id - if purchase_units is not APIHelper.SKIP: - self.purchase_units = purchase_units - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - purchase_units = ShippingOptionsPurchaseUnit.from_dictionary(dictionary.get('purchase_units')) if 'purchase_units' in dictionary.keys() else APIHelper.SKIP - # Return an object of this model - return cls(id, - purchase_units) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'purchase_units={(self.purchase_units if hasattr(self, "purchase_units") else None)!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'purchase_units={(self.purchase_units if hasattr(self, "purchase_units") else None)!s})') diff --git a/paypalserversdk/models/order_update_callback_shipping_address.py b/paypalserversdk/models/order_update_callback_shipping_address.py deleted file mode 100644 index fb1138f..0000000 --- a/paypalserversdk/models/order_update_callback_shipping_address.py +++ /dev/null @@ -1,116 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper - - -class OrderUpdateCallbackShippingAddress(object): - - """Implementation of the 'Order Update Callback Shipping Address' model. - - The portable international postal address. Maps to - [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/w - iki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: - the autocomplete - attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-con - trols-the-autocomplete-attribute). - - Attributes: - admin_area_2 (str): A city, town, or village. Smaller than - `admin_area_level_1`. - admin_area_1 (str): The highest-level sub-division in a country, which - is usually a province, state, or ISO-3166-2 subdivision. This data - is formatted for postal delivery, for example, `CA` and not - `California`. Value, by country, is: UK. A county. US. A state. - Canada. A province. Japan. A prefecture. Switzerland. A *kanton*. - postal_code (str): 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). - country_code (str): The [2-character ISO 3166-1 - code](/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. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "country_code": 'country_code', - "admin_area_2": 'admin_area_2', - "admin_area_1": 'admin_area_1', - "postal_code": 'postal_code' - } - - _optionals = [ - 'admin_area_2', - 'admin_area_1', - 'postal_code', - ] - - def __init__(self, - country_code=None, - admin_area_2=APIHelper.SKIP, - admin_area_1=APIHelper.SKIP, - postal_code=APIHelper.SKIP): - """Constructor for the OrderUpdateCallbackShippingAddress class""" - - # Initialize members of the class - if admin_area_2 is not APIHelper.SKIP: - self.admin_area_2 = admin_area_2 - if admin_area_1 is not APIHelper.SKIP: - self.admin_area_1 = admin_area_1 - if postal_code is not APIHelper.SKIP: - self.postal_code = postal_code - self.country_code = country_code - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - country_code = dictionary.get("country_code") if dictionary.get("country_code") else None - admin_area_2 = dictionary.get("admin_area_2") if dictionary.get("admin_area_2") else APIHelper.SKIP - admin_area_1 = dictionary.get("admin_area_1") if dictionary.get("admin_area_1") else APIHelper.SKIP - postal_code = dictionary.get("postal_code") if dictionary.get("postal_code") else APIHelper.SKIP - # Return an object of this model - return cls(country_code, - admin_area_2, - admin_area_1, - postal_code) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'admin_area_2={(self.admin_area_2 if hasattr(self, "admin_area_2") else None)!r}, ' - f'admin_area_1={(self.admin_area_1 if hasattr(self, "admin_area_1") else None)!r}, ' - f'postal_code={(self.postal_code if hasattr(self, "postal_code") else None)!r}, ' - f'country_code={self.country_code!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'admin_area_2={(self.admin_area_2 if hasattr(self, "admin_area_2") else None)!s}, ' - f'admin_area_1={(self.admin_area_1 if hasattr(self, "admin_area_1") else None)!s}, ' - f'postal_code={(self.postal_code if hasattr(self, "postal_code") else None)!s}, ' - f'country_code={self.country_code!s})') diff --git a/paypalserversdk/models/order_update_callback_shipping_option.py b/paypalserversdk/models/order_update_callback_shipping_option.py deleted file mode 100644 index e9987b0..0000000 --- a/paypalserversdk/models/order_update_callback_shipping_option.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.money import Money - - -class OrderUpdateCallbackShippingOption(object): - - """Implementation of the 'Order Update Callback Shipping Option' model. - - The options that the payee or merchant offers to the payer to ship or pick - up their items. - - Attributes: - id (str): A unique ID that identifies a payer-selected shipping option. - label (str): A description that the payer sees, which helps them - choose an appropriate shipping option. For example, `Free - Shipping`, `USPS Priority Shipping`, `Expédition prioritaire - USPS`, or `USPS yōuxiān fā huò`. Localize this description to the - payer's locale. - mtype (ShippingType): A classification for the method of purchase - fulfillment. - amount (Money): The currency and amount for a financial transaction, - such as a balance or payment due. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "id": 'id', - "label": 'label', - "mtype": 'type', - "amount": 'amount' - } - - _optionals = [ - 'mtype', - 'amount', - ] - - def __init__(self, - id=None, - label=None, - mtype=APIHelper.SKIP, - amount=APIHelper.SKIP): - """Constructor for the OrderUpdateCallbackShippingOption class""" - - # Initialize members of the class - self.id = id - self.label = label - if mtype is not APIHelper.SKIP: - self.mtype = mtype - if amount is not APIHelper.SKIP: - self.amount = amount - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - label = dictionary.get("label") if dictionary.get("label") else None - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP - amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP - # Return an object of this model - return cls(id, - label, - mtype, - amount) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'label={self.label!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'label={self.label!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s})') diff --git a/paypalserversdk/models/orders_capture.py b/paypalserversdk/models/orders_capture.py index e5aaad6..33890e7 100644 --- a/paypalserversdk/models/orders_capture.py +++ b/paypalserversdk/models/orders_capture.py @@ -10,7 +10,7 @@ from paypalserversdk.models.capture_status_details import CaptureStatusDetails from paypalserversdk.models.link_description import LinkDescription from paypalserversdk.models.money import Money -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction from paypalserversdk.models.processor_response import ProcessorResponse from paypalserversdk.models.seller_protection import SellerProtection from paypalserversdk.models.seller_receivable_breakdown import SellerReceivableBreakdown @@ -35,8 +35,8 @@ class OrdersCapture(object): custom_id (str): The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. - network_transaction_reference (NetworkTransactionReference): Reference - values used by the card network to identify a transaction. + network_transaction_reference (NetworkTransaction): Reference values + used by the card network to identify a transaction. seller_protection (SellerProtection): The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-pr @@ -179,7 +179,7 @@ def from_dictionary(cls, amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP - network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP seller_protection = SellerProtection.from_dictionary(dictionary.get('seller_protection')) if 'seller_protection' in dictionary.keys() else APIHelper.SKIP final_capture = dictionary.get("final_capture") if dictionary.get("final_capture") else False seller_receivable_breakdown = SellerReceivableBreakdown.from_dictionary(dictionary.get('seller_receivable_breakdown')) if 'seller_receivable_breakdown' in dictionary.keys() else APIHelper.SKIP diff --git a/paypalserversdk/models/os_type.py b/paypalserversdk/models/os_type.py new file mode 100644 index 0000000..41bc35c --- /dev/null +++ b/paypalserversdk/models/os_type.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class OsType(object): + + """Implementation of the 'OS Type' enum. + + Operating System type of the device that the buyer is using. + + Attributes: + ANDROID: Google Android OS. + IOS: Apple OS typically found in Apple mobile devices. + OTHER: Any other OS type. + + """ + ANDROID = 'ANDROID' + + IOS = 'IOS' + + OTHER = 'OTHER' + diff --git a/paypalserversdk/models/payer.py b/paypalserversdk/models/payer.py index 7f30c5f..e34c111 100644 --- a/paypalserversdk/models/payer.py +++ b/paypalserversdk/models/payer.py @@ -17,6 +17,9 @@ class Payer(object): """Implementation of the 'Payer' model. + The customer who approves and pays for the order. The customer is also + known as the payer. + Attributes: email_address (str): The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed diff --git a/paypalserversdk/models/payer_information.py b/paypalserversdk/models/payer_information.py new file mode 100644 index 0000000..ee6acee --- /dev/null +++ b/paypalserversdk/models/payer_information.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.payer_name import PayerName +from paypalserversdk.models.phone import Phone +from paypalserversdk.models.simple_postal_address_coarse_grained import SimplePostalAddressCoarseGrained + + +class PayerInformation(object): + + """Implementation of the 'Payer Information' model. + + The payer information. + + Attributes: + account_id (str): The PayPal` customer account ID. + email_address (str): The internationalized email address. Note: Up to + 64 characters are allowed before and 255 characters are allowed + after the @ sign. However, the generally accepted maximum length + for an email address is 254 characters. The pattern verifies that + an unquoted @ sign exists. + phone_number (Phone): The phone number, in its canonical international + [E.164 numbering plan + format](https://www.itu.int/rec/T-REC-E.164/en). + address_status (str): The address status of the payer. Value is + either: Y. Verified. N. Not verified. + payer_status (str): The status of the payer. Value is `Y` or `N`. + payer_name (PayerName): The name of the party. + country_code (str): The [two-character ISO 3166-1 + code](/docs/integration/direct/rest/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. + address (SimplePostalAddressCoarseGrained): A simple postal address + with coarse-grained fields. Do not use for an international + address. Use for backward compatibility only. Does not contain + phone. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "account_id": 'account_id', + "email_address": 'email_address', + "phone_number": 'phone_number', + "address_status": 'address_status', + "payer_status": 'payer_status', + "payer_name": 'payer_name', + "country_code": 'country_code', + "address": 'address' + } + + _optionals = [ + 'account_id', + 'email_address', + 'phone_number', + 'address_status', + 'payer_status', + 'payer_name', + 'country_code', + 'address', + ] + + def __init__(self, + account_id=APIHelper.SKIP, + email_address=APIHelper.SKIP, + phone_number=APIHelper.SKIP, + address_status=APIHelper.SKIP, + payer_status=APIHelper.SKIP, + payer_name=APIHelper.SKIP, + country_code=APIHelper.SKIP, + address=APIHelper.SKIP): + """Constructor for the PayerInformation class""" + + # Initialize members of the class + if account_id is not APIHelper.SKIP: + self.account_id = account_id + if email_address is not APIHelper.SKIP: + self.email_address = email_address + if phone_number is not APIHelper.SKIP: + self.phone_number = phone_number + if address_status is not APIHelper.SKIP: + self.address_status = address_status + if payer_status is not APIHelper.SKIP: + self.payer_status = payer_status + if payer_name is not APIHelper.SKIP: + self.payer_name = payer_name + if country_code is not APIHelper.SKIP: + self.country_code = country_code + if address is not APIHelper.SKIP: + self.address = address + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + account_id = dictionary.get("account_id") if dictionary.get("account_id") else APIHelper.SKIP + email_address = dictionary.get("email_address") if dictionary.get("email_address") else APIHelper.SKIP + phone_number = Phone.from_dictionary(dictionary.get('phone_number')) if 'phone_number' in dictionary.keys() else APIHelper.SKIP + address_status = dictionary.get("address_status") if dictionary.get("address_status") else APIHelper.SKIP + payer_status = dictionary.get("payer_status") if dictionary.get("payer_status") else APIHelper.SKIP + payer_name = PayerName.from_dictionary(dictionary.get('payer_name')) if 'payer_name' in dictionary.keys() else APIHelper.SKIP + country_code = dictionary.get("country_code") if dictionary.get("country_code") else APIHelper.SKIP + address = SimplePostalAddressCoarseGrained.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(account_id, + email_address, + phone_number, + address_status, + payer_status, + payer_name, + country_code, + address) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'account_id={(self.account_id if hasattr(self, "account_id") else None)!r}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!r}, ' + f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!r}, ' + f'address_status={(self.address_status if hasattr(self, "address_status") else None)!r}, ' + f'payer_status={(self.payer_status if hasattr(self, "payer_status") else None)!r}, ' + f'payer_name={(self.payer_name if hasattr(self, "payer_name") else None)!r}, ' + f'country_code={(self.country_code if hasattr(self, "country_code") else None)!r}, ' + f'address={(self.address if hasattr(self, "address") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'account_id={(self.account_id if hasattr(self, "account_id") else None)!s}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!s}, ' + f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!s}, ' + f'address_status={(self.address_status if hasattr(self, "address_status") else None)!s}, ' + f'payer_status={(self.payer_status if hasattr(self, "payer_status") else None)!s}, ' + f'payer_name={(self.payer_name if hasattr(self, "payer_name") else None)!s}, ' + f'country_code={(self.country_code if hasattr(self, "country_code") else None)!s}, ' + f'address={(self.address if hasattr(self, "address") else None)!s})') diff --git a/paypalserversdk/models/payer_name.py b/paypalserversdk/models/payer_name.py new file mode 100644 index 0000000..58537c4 --- /dev/null +++ b/paypalserversdk/models/payer_name.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class PayerName(object): + + """Implementation of the 'Payer Name' model. + + The name of the party. + + Attributes: + prefix (str): The prefix, or title, to the party's name. + given_name (str): When the party is a person, the party's given, or + first, name. + surname (str): When the party is a person, the party's surname or + family name. Also known as the last name. Required when the party + is a person. Use also to store multiple surnames including the + matronymic, or mother's, surname. + middle_name (str): When the party is a person, the party's middle + name. Use also to store multiple middle names including the + patronymic, or father's, middle name. + suffix (str): The suffix for the party's name. + alternate_full_name (str): DEPRECATED. The party's alternate name. Can + be a business name, nickname, or any other name that cannot be + split into first, last name. Required when the party is a business. + full_name (str): When the party is a person, the party's full name. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "prefix": 'prefix', + "given_name": 'given_name', + "surname": 'surname', + "middle_name": 'middle_name', + "suffix": 'suffix', + "alternate_full_name": 'alternate_full_name', + "full_name": 'full_name' + } + + _optionals = [ + 'prefix', + 'given_name', + 'surname', + 'middle_name', + 'suffix', + 'alternate_full_name', + 'full_name', + ] + + def __init__(self, + prefix=APIHelper.SKIP, + given_name=APIHelper.SKIP, + surname=APIHelper.SKIP, + middle_name=APIHelper.SKIP, + suffix=APIHelper.SKIP, + alternate_full_name=APIHelper.SKIP, + full_name=APIHelper.SKIP): + """Constructor for the PayerName class""" + + # Initialize members of the class + if prefix is not APIHelper.SKIP: + self.prefix = prefix + if given_name is not APIHelper.SKIP: + self.given_name = given_name + if surname is not APIHelper.SKIP: + self.surname = surname + if middle_name is not APIHelper.SKIP: + self.middle_name = middle_name + if suffix is not APIHelper.SKIP: + self.suffix = suffix + if alternate_full_name is not APIHelper.SKIP: + self.alternate_full_name = alternate_full_name + if full_name is not APIHelper.SKIP: + self.full_name = full_name + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + prefix = dictionary.get("prefix") if dictionary.get("prefix") else APIHelper.SKIP + given_name = dictionary.get("given_name") if dictionary.get("given_name") else APIHelper.SKIP + surname = dictionary.get("surname") if dictionary.get("surname") else APIHelper.SKIP + middle_name = dictionary.get("middle_name") if dictionary.get("middle_name") else APIHelper.SKIP + suffix = dictionary.get("suffix") if dictionary.get("suffix") else APIHelper.SKIP + alternate_full_name = dictionary.get("alternate_full_name") if dictionary.get("alternate_full_name") else APIHelper.SKIP + full_name = dictionary.get("full_name") if dictionary.get("full_name") else APIHelper.SKIP + # Return an object of this model + return cls(prefix, + given_name, + surname, + middle_name, + suffix, + alternate_full_name, + full_name) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'prefix={(self.prefix if hasattr(self, "prefix") else None)!r}, ' + f'given_name={(self.given_name if hasattr(self, "given_name") else None)!r}, ' + f'surname={(self.surname if hasattr(self, "surname") else None)!r}, ' + f'middle_name={(self.middle_name if hasattr(self, "middle_name") else None)!r}, ' + f'suffix={(self.suffix if hasattr(self, "suffix") else None)!r}, ' + f'alternate_full_name={(self.alternate_full_name if hasattr(self, "alternate_full_name") else None)!r}, ' + f'full_name={(self.full_name if hasattr(self, "full_name") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'prefix={(self.prefix if hasattr(self, "prefix") else None)!s}, ' + f'given_name={(self.given_name if hasattr(self, "given_name") else None)!s}, ' + f'surname={(self.surname if hasattr(self, "surname") else None)!s}, ' + f'middle_name={(self.middle_name if hasattr(self, "middle_name") else None)!s}, ' + f'suffix={(self.suffix if hasattr(self, "suffix") else None)!s}, ' + f'alternate_full_name={(self.alternate_full_name if hasattr(self, "alternate_full_name") else None)!s}, ' + f'full_name={(self.full_name if hasattr(self, "full_name") else None)!s})') diff --git a/paypalserversdk/models/payment_authorization.py b/paypalserversdk/models/payment_authorization.py index f9c9d92..c12301a 100644 --- a/paypalserversdk/models/payment_authorization.py +++ b/paypalserversdk/models/payment_authorization.py @@ -10,7 +10,7 @@ from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails from paypalserversdk.models.link_description import LinkDescription from paypalserversdk.models.money import Money -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction from paypalserversdk.models.payee_base import PayeeBase from paypalserversdk.models.payment_supplementary_data import PaymentSupplementaryData from paypalserversdk.models.seller_protection import SellerProtection @@ -35,8 +35,8 @@ class PaymentAuthorization(object): custom_id (str): The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. - network_transaction_reference (NetworkTransactionReference): Reference - values used by the card network to identify a transaction. + network_transaction_reference (NetworkTransaction): Reference values + used by the card network to identify a transaction. seller_protection (SellerProtection): The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-pr @@ -171,7 +171,7 @@ def from_dictionary(cls, amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP - network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP seller_protection = SellerProtection.from_dictionary(dictionary.get('seller_protection')) if 'seller_protection' in dictionary.keys() else APIHelper.SKIP expiration_time = dictionary.get("expiration_time") if dictionary.get("expiration_time") else APIHelper.SKIP links = None diff --git a/paypalserversdk/models/payment_method.py b/paypalserversdk/models/payment_method.py new file mode 100644 index 0000000..122a556 --- /dev/null +++ b/paypalserversdk/models/payment_method.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class PaymentMethod(object): + + """Implementation of the 'Payment Method' model. + + The customer and merchant payment preferences. + + Attributes: + payee_preferred (PayeePaymentMethodPreference): The merchant-preferred + payment methods. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "payee_preferred": 'payee_preferred' + } + + _optionals = [ + 'payee_preferred', + ] + + def __init__(self, + payee_preferred='UNRESTRICTED'): + """Constructor for the PaymentMethod class""" + + # Initialize members of the class + self.payee_preferred = payee_preferred + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + payee_preferred = dictionary.get("payee_preferred") if dictionary.get("payee_preferred") else 'UNRESTRICTED' + # Return an object of this model + return cls(payee_preferred) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'payee_preferred={(self.payee_preferred if hasattr(self, "payee_preferred") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'payee_preferred={(self.payee_preferred if hasattr(self, "payee_preferred") else None)!s})') diff --git a/paypalserversdk/models/payment_preferences.py b/paypalserversdk/models/payment_preferences.py new file mode 100644 index 0000000..3c1d529 --- /dev/null +++ b/paypalserversdk/models/payment_preferences.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class PaymentPreferences(object): + + """Implementation of the 'Payment Preferences' model. + + The payment preferences for a subscription. + + Attributes: + auto_bill_outstanding (bool): Indicates whether to automatically bill + the outstanding amount in the next billing cycle. + setup_fee (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + setup_fee_failure_action (SetupFeeFailureAction): The action to take + on the subscription if the initial payment for the setup fails. + payment_failure_threshold (int): The maximum number of payment + failures before a subscription is suspended. For example, if + `payment_failure_threshold` is `2`, the subscription automatically + updates to the `SUSPEND` state if two consecutive payments fail. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "auto_bill_outstanding": 'auto_bill_outstanding', + "setup_fee": 'setup_fee', + "setup_fee_failure_action": 'setup_fee_failure_action', + "payment_failure_threshold": 'payment_failure_threshold' + } + + _optionals = [ + 'auto_bill_outstanding', + 'setup_fee', + 'setup_fee_failure_action', + 'payment_failure_threshold', + ] + + def __init__(self, + auto_bill_outstanding=True, + setup_fee=APIHelper.SKIP, + setup_fee_failure_action='CANCEL', + payment_failure_threshold=0): + """Constructor for the PaymentPreferences class""" + + # Initialize members of the class + self.auto_bill_outstanding = auto_bill_outstanding + if setup_fee is not APIHelper.SKIP: + self.setup_fee = setup_fee + self.setup_fee_failure_action = setup_fee_failure_action + self.payment_failure_threshold = payment_failure_threshold + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + auto_bill_outstanding = dictionary.get("auto_bill_outstanding") if dictionary.get("auto_bill_outstanding") else True + setup_fee = Money.from_dictionary(dictionary.get('setup_fee')) if 'setup_fee' in dictionary.keys() else APIHelper.SKIP + setup_fee_failure_action = dictionary.get("setup_fee_failure_action") if dictionary.get("setup_fee_failure_action") else 'CANCEL' + payment_failure_threshold = dictionary.get("payment_failure_threshold") if dictionary.get("payment_failure_threshold") else 0 + # Return an object of this model + return cls(auto_bill_outstanding, + setup_fee, + setup_fee_failure_action, + payment_failure_threshold) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'auto_bill_outstanding={(self.auto_bill_outstanding if hasattr(self, "auto_bill_outstanding") else None)!r}, ' + f'setup_fee={(self.setup_fee if hasattr(self, "setup_fee") else None)!r}, ' + f'setup_fee_failure_action={(self.setup_fee_failure_action if hasattr(self, "setup_fee_failure_action") else None)!r}, ' + f'payment_failure_threshold={(self.payment_failure_threshold if hasattr(self, "payment_failure_threshold") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'auto_bill_outstanding={(self.auto_bill_outstanding if hasattr(self, "auto_bill_outstanding") else None)!s}, ' + f'setup_fee={(self.setup_fee if hasattr(self, "setup_fee") else None)!s}, ' + f'setup_fee_failure_action={(self.setup_fee_failure_action if hasattr(self, "setup_fee_failure_action") else None)!s}, ' + f'payment_failure_threshold={(self.payment_failure_threshold if hasattr(self, "payment_failure_threshold") else None)!s})') diff --git a/paypalserversdk/models/payment_preferences_override.py b/paypalserversdk/models/payment_preferences_override.py new file mode 100644 index 0000000..8331610 --- /dev/null +++ b/paypalserversdk/models/payment_preferences_override.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class PaymentPreferencesOverride(object): + + """Implementation of the 'Payment Preferences Override' model. + + The payment preferences to override at subscription level. + + Attributes: + auto_bill_outstanding (bool): Indicates whether to automatically bill + the outstanding amount in the next billing cycle. + setup_fee (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + setup_fee_failure_action (SetupFeeFailureAction): The action to take + on the subscription if the initial payment for the setup fails. + payment_failure_threshold (int): The maximum number of payment + failures before a subscription is suspended. For example, if + `payment_failure_threshold` is `2`, the subscription automatically + updates to the `SUSPEND` state if two consecutive payments fail. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "auto_bill_outstanding": 'auto_bill_outstanding', + "setup_fee": 'setup_fee', + "setup_fee_failure_action": 'setup_fee_failure_action', + "payment_failure_threshold": 'payment_failure_threshold' + } + + _optionals = [ + 'auto_bill_outstanding', + 'setup_fee', + 'setup_fee_failure_action', + 'payment_failure_threshold', + ] + + def __init__(self, + auto_bill_outstanding=APIHelper.SKIP, + setup_fee=APIHelper.SKIP, + setup_fee_failure_action=APIHelper.SKIP, + payment_failure_threshold=APIHelper.SKIP): + """Constructor for the PaymentPreferencesOverride class""" + + # Initialize members of the class + if auto_bill_outstanding is not APIHelper.SKIP: + self.auto_bill_outstanding = auto_bill_outstanding + if setup_fee is not APIHelper.SKIP: + self.setup_fee = setup_fee + if setup_fee_failure_action is not APIHelper.SKIP: + self.setup_fee_failure_action = setup_fee_failure_action + if payment_failure_threshold is not APIHelper.SKIP: + self.payment_failure_threshold = payment_failure_threshold + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + auto_bill_outstanding = dictionary.get("auto_bill_outstanding") if "auto_bill_outstanding" in dictionary.keys() else APIHelper.SKIP + setup_fee = Money.from_dictionary(dictionary.get('setup_fee')) if 'setup_fee' in dictionary.keys() else APIHelper.SKIP + setup_fee_failure_action = dictionary.get("setup_fee_failure_action") if dictionary.get("setup_fee_failure_action") else APIHelper.SKIP + payment_failure_threshold = dictionary.get("payment_failure_threshold") if dictionary.get("payment_failure_threshold") else APIHelper.SKIP + # Return an object of this model + return cls(auto_bill_outstanding, + setup_fee, + setup_fee_failure_action, + payment_failure_threshold) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'auto_bill_outstanding={(self.auto_bill_outstanding if hasattr(self, "auto_bill_outstanding") else None)!r}, ' + f'setup_fee={(self.setup_fee if hasattr(self, "setup_fee") else None)!r}, ' + f'setup_fee_failure_action={(self.setup_fee_failure_action if hasattr(self, "setup_fee_failure_action") else None)!r}, ' + f'payment_failure_threshold={(self.payment_failure_threshold if hasattr(self, "payment_failure_threshold") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'auto_bill_outstanding={(self.auto_bill_outstanding if hasattr(self, "auto_bill_outstanding") else None)!s}, ' + f'setup_fee={(self.setup_fee if hasattr(self, "setup_fee") else None)!s}, ' + f'setup_fee_failure_action={(self.setup_fee_failure_action if hasattr(self, "setup_fee_failure_action") else None)!s}, ' + f'payment_failure_threshold={(self.payment_failure_threshold if hasattr(self, "payment_failure_threshold") else None)!s})') diff --git a/paypalserversdk/models/payment_token_response.py b/paypalserversdk/models/payment_token_response.py index d76816c..74c2ff0 100644 --- a/paypalserversdk/models/payment_token_response.py +++ b/paypalserversdk/models/payment_token_response.py @@ -19,7 +19,9 @@ class PaymentTokenResponse(object): Full representation of a saved payment token. Attributes: - id (str): The PayPal-generated ID for the vault token. + id (str): The PayPal-generated ID for the vaulted payment source. This + ID should be stored on the merchant's server so the saved payment + source can be used for future transactions. customer (CustomerResponse): Customer in merchant's or partner's system of records. payment_source (PaymentTokenResponsePaymentSource): The vaulted diff --git a/paypalserversdk/models/payment_token_response_payment_source.py b/paypalserversdk/models/payment_token_response_payment_source.py index 20a762c..6575893 100644 --- a/paypalserversdk/models/payment_token_response_payment_source.py +++ b/paypalserversdk/models/payment_token_response_payment_source.py @@ -22,10 +22,10 @@ class PaymentTokenResponsePaymentSource(object): Attributes: card (CardPaymentTokenEntity): Full representation of a Card Payment Token including network token. - paypal (PaypalPaymentToken): The model property of type - PaypalPaymentToken. - venmo (VenmoPaymentToken): The model property of type - VenmoPaymentToken. + paypal (PaypalPaymentToken): Full representation of a PayPal Payment + Token. + venmo (VenmoPaymentToken): Full representation of a Venmo Payment + Token. apple_pay (ApplePayPaymentToken): A resource representing a response for Apple Pay. diff --git a/paypalserversdk/models/payment_token_status.py b/paypalserversdk/models/payment_token_status.py index 8c95973..6b7ebe7 100644 --- a/paypalserversdk/models/payment_token_status.py +++ b/paypalserversdk/models/payment_token_status.py @@ -17,7 +17,7 @@ class PaymentTokenStatus(object): Attributes: CREATED: A setup token is initialized with minimal information, more data must be added to the setup-token to be vaulted - PAYER_ACTION_REQUIRED: A contingecy on payer approval is required + PAYER_ACTION_REQUIRED: A contingency on payer approval is required before the payment method can be saved. APPROVED: Setup token is ready to be vaulted. If a buyer approval contigency was returned, it is has been approved. diff --git a/paypalserversdk/models/payments_capture.py b/paypalserversdk/models/payments_capture.py index 436dc07..c04b73f 100644 --- a/paypalserversdk/models/payments_capture.py +++ b/paypalserversdk/models/payments_capture.py @@ -10,8 +10,8 @@ from paypalserversdk.models.capture_status_details import CaptureStatusDetails from paypalserversdk.models.link_description import LinkDescription from paypalserversdk.models.money import Money -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference -from paypalserversdk.models.payments_processor_response import PaymentsProcessorResponse +from paypalserversdk.models.network_transaction import NetworkTransaction +from paypalserversdk.models.processor_response import ProcessorResponse from paypalserversdk.models.seller_protection import SellerProtection from paypalserversdk.models.seller_receivable_breakdown import SellerReceivableBreakdown @@ -35,8 +35,8 @@ class PaymentsCapture(object): custom_id (str): The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. - network_transaction_reference (NetworkTransactionReference): Reference - values used by the card network to identify a transaction. + network_transaction_reference (NetworkTransaction): Reference values + used by the card network to identify a transaction. seller_protection (SellerProtection): The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-pr @@ -53,7 +53,7 @@ class PaymentsCapture(object): behalf of the merchant. links (List[LinkDescription]): An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). - processor_response (PaymentsProcessorResponse): The processor response + processor_response (ProcessorResponse): The processor response information for payment requests, such as direct credit card transactions. create_time (str): The date and time, in [Internet date and time @@ -179,7 +179,7 @@ def from_dictionary(cls, amount = Money.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP - network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('network_transaction_reference')) if 'network_transaction_reference' in dictionary.keys() else APIHelper.SKIP seller_protection = SellerProtection.from_dictionary(dictionary.get('seller_protection')) if 'seller_protection' in dictionary.keys() else APIHelper.SKIP final_capture = dictionary.get("final_capture") if dictionary.get("final_capture") else False seller_receivable_breakdown = SellerReceivableBreakdown.from_dictionary(dictionary.get('seller_receivable_breakdown')) if 'seller_receivable_breakdown' in dictionary.keys() else APIHelper.SKIP @@ -189,7 +189,7 @@ def from_dictionary(cls, links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] else: links = APIHelper.SKIP - processor_response = PaymentsProcessorResponse.from_dictionary(dictionary.get('processor_response')) if 'processor_response' in dictionary.keys() else APIHelper.SKIP + processor_response = ProcessorResponse.from_dictionary(dictionary.get('processor_response')) if 'processor_response' in dictionary.keys() else APIHelper.SKIP create_time = dictionary.get("create_time") if dictionary.get("create_time") else APIHelper.SKIP update_time = dictionary.get("update_time") if dictionary.get("update_time") else APIHelper.SKIP # Return an object of this model diff --git a/paypalserversdk/models/payments_payment_advice_code.py b/paypalserversdk/models/payments_payment_advice_code.py deleted file mode 100644 index 8350088..0000000 --- a/paypalserversdk/models/payments_payment_advice_code.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" - - -class PaymentsPaymentAdviceCode(object): - - """Implementation of the 'Payments Payment Advice Code' enum. - - The declined payment transactions might have payment advice codes. The - card networks, like Visa and Mastercard, return payment advice codes. - - Attributes: - PAYMENTADVICE_01: For Mastercard, expired card account upgrade or - portfolio sale conversion. Obtain new account information before - next billing cycle. - PAYMENTADVICE_02: For Mastercard, over credit limit or insufficient - funds. Retry the transaction 72 hours later. For Visa, the card - holder wants to stop only one specific payment in the recurring - payment relationship. The merchant must NOT resubmit the same - transaction. The merchant can continue the billing process in the - subsequent billing period. - PAYMENTADVICE_03: For Mastercard, account closed as fraudulent. Obtain - another type of payment from customer due to account being closed - or fraud. Possible reason: Account closed as fraudulent. For Visa, - the card holder wants to stop all recurring payment transactions - for a specific merchant. Stop recurring payment requests. - PAYMENTADVICE_21: For Mastercard, the card holder has been - unsuccessful at canceling recurring payment through merchant. Stop - recurring payment requests. For Visa, all recurring payments were - canceled for the card number requested. Stop recurring payment - requests. - - """ - PAYMENTADVICE_01 = '01' - - PAYMENTADVICE_02 = '02' - - PAYMENTADVICE_03 = '03' - - PAYMENTADVICE_21 = '21' - diff --git a/paypalserversdk/models/payments_processor_response.py b/paypalserversdk/models/payments_processor_response.py deleted file mode 100644 index 3722071..0000000 --- a/paypalserversdk/models/payments_processor_response.py +++ /dev/null @@ -1,105 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper - - -class PaymentsProcessorResponse(object): - - """Implementation of the 'Payments Processor Response' model. - - The processor response information for payment requests, such as direct - credit card transactions. - - Attributes: - avs_code (AvsCode): The address verification code for Visa, Discover, - Mastercard, or American Express transactions. - cvv_code (CvvCode): The card verification value code for for Visa, - Discover, Mastercard, or American Express. - response_code (ProcessorResponseCode): Processor response code for the - non-PayPal payment processor errors. - payment_advice_code (PaymentsPaymentAdviceCode): The declined payment - transactions might have payment advice codes. The card networks, - like Visa and Mastercard, return payment advice codes. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "avs_code": 'avs_code', - "cvv_code": 'cvv_code', - "response_code": 'response_code', - "payment_advice_code": 'payment_advice_code' - } - - _optionals = [ - 'avs_code', - 'cvv_code', - 'response_code', - 'payment_advice_code', - ] - - def __init__(self, - avs_code=APIHelper.SKIP, - cvv_code=APIHelper.SKIP, - response_code=APIHelper.SKIP, - payment_advice_code=APIHelper.SKIP): - """Constructor for the PaymentsProcessorResponse class""" - - # Initialize members of the class - if avs_code is not APIHelper.SKIP: - self.avs_code = avs_code - if cvv_code is not APIHelper.SKIP: - self.cvv_code = cvv_code - if response_code is not APIHelper.SKIP: - self.response_code = response_code - if payment_advice_code is not APIHelper.SKIP: - self.payment_advice_code = payment_advice_code - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - avs_code = dictionary.get("avs_code") if dictionary.get("avs_code") else APIHelper.SKIP - cvv_code = dictionary.get("cvv_code") if dictionary.get("cvv_code") else APIHelper.SKIP - response_code = dictionary.get("response_code") if dictionary.get("response_code") else APIHelper.SKIP - payment_advice_code = dictionary.get("payment_advice_code") if dictionary.get("payment_advice_code") else APIHelper.SKIP - # Return an object of this model - return cls(avs_code, - cvv_code, - response_code, - payment_advice_code) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'avs_code={(self.avs_code if hasattr(self, "avs_code") else None)!r}, ' - f'cvv_code={(self.cvv_code if hasattr(self, "cvv_code") else None)!r}, ' - f'response_code={(self.response_code if hasattr(self, "response_code") else None)!r}, ' - f'payment_advice_code={(self.payment_advice_code if hasattr(self, "payment_advice_code") else None)!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'avs_code={(self.avs_code if hasattr(self, "avs_code") else None)!s}, ' - f'cvv_code={(self.cvv_code if hasattr(self, "cvv_code") else None)!s}, ' - f'response_code={(self.response_code if hasattr(self, "response_code") else None)!s}, ' - f'payment_advice_code={(self.payment_advice_code if hasattr(self, "payment_advice_code") else None)!s})') diff --git a/paypalserversdk/models/paypal_experience_landing_page.py b/paypalserversdk/models/paypal_experience_landing_page.py index a7bb243..6076977 100644 --- a/paypalserversdk/models/paypal_experience_landing_page.py +++ b/paypalserversdk/models/paypal_experience_landing_page.py @@ -26,6 +26,11 @@ class PaypalExperienceLandingPage(object): payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase, depending on their previous interaction with PayPal. + BILLING: DEPRECATED - please use GUEST_CHECKOUT. All implementations + of 'BILLING' will be routed to 'GUEST_CHECKOUT'. When the customer + clicks PayPal Checkout, the customer is redirected to a page to + enter credit or debit card and other relevant billing information + required to complete the purchase. """ LOGIN = 'LOGIN' @@ -34,3 +39,5 @@ class PaypalExperienceLandingPage(object): NO_PREFERENCE = 'NO_PREFERENCE' + BILLING = 'BILLING' + diff --git a/paypalserversdk/models/paypal_payment_token.py b/paypalserversdk/models/paypal_payment_token.py index 4f82965..9f5dcc9 100644 --- a/paypalserversdk/models/paypal_payment_token.py +++ b/paypalserversdk/models/paypal_payment_token.py @@ -18,6 +18,8 @@ class PaypalPaymentToken(object): """Implementation of the 'PayPal Payment Token' model. + Full representation of a PayPal Payment Token. + Attributes: description (str): The description displayed to the consumer on the approval flow for a digital wallet, as well as on the merchant @@ -40,11 +42,12 @@ class PaypalPaymentToken(object): associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer. - email_address (str): The internationalized email address. Note: Up to - 64 characters are allowed before and 255 characters are allowed - after the @ sign. However, the generally accepted maximum length - for an email address is 254 characters. The pattern verifies that - an unquoted @ sign exists. + email_address (str): The internationalized email + address.
Note: Up to 64 characters are + allowed before and 255 characters are allowed after the + @ sign. However, the generally accepted maximum + length for an email address is 254 characters. The pattern + verifies that an unquoted @ sign exists.
payer_id (str): The account identifier for a PayPal account. name (Name): The name of the party. phone (PhoneWithType): The phone information. diff --git a/paypalserversdk/models/paypal_reference_id_type.py b/paypalserversdk/models/paypal_reference_id_type.py new file mode 100644 index 0000000..0564c6f --- /dev/null +++ b/paypalserversdk/models/paypal_reference_id_type.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class PaypalReferenceIdType(object): + + """Implementation of the 'PayPal Reference Id Type' enum. + + The PayPal reference ID type. + + Attributes: + ODR: An order ID. + TXN: A transaction ID. + SUB: A subscription ID. + PAP: A pre-approved payment ID. + + """ + ODR = 'ODR' + + TXN = 'TXN' + + SUB = 'SUB' + + PAP = 'PAP' + diff --git a/paypalserversdk/models/paypal_wallet_attributes.py b/paypalserversdk/models/paypal_wallet_attributes.py index 6bd6508..c831312 100644 --- a/paypalserversdk/models/paypal_wallet_attributes.py +++ b/paypalserversdk/models/paypal_wallet_attributes.py @@ -20,8 +20,8 @@ class PaypalWalletAttributes(object): Attributes: customer (PaypalWalletCustomerRequest): The model property of type PaypalWalletCustomerRequest. - vault (PaypalWalletVaultInstruction): The model property of type - PaypalWalletVaultInstruction. + vault (PaypalWalletVaultInstruction): Resource consolidating common + request and response attributes for vaulting PayPal Wallet. """ diff --git a/paypalserversdk/models/paypal_wallet_experience_context.py b/paypalserversdk/models/paypal_wallet_experience_context.py index 9eb5e9f..4fceff4 100644 --- a/paypalserversdk/models/paypal_wallet_experience_context.py +++ b/paypalserversdk/models/paypal_wallet_experience_context.py @@ -7,6 +7,7 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.app_switch_context import AppSwitchContext from paypalserversdk.models.callback_configuration import CallbackConfiguration @@ -41,6 +42,9 @@ class PaypalWalletExperienceContext(object): number) on PayPal's checkout for easy merchant-buyer communication. return_url (str): Describes the URL. cancel_url (str): Describes the URL. + app_switch_context (AppSwitchContext): Merchant provided details of + the native app or mobile web browser to facilitate buyer's app + switch to the PayPal consumer app. landing_page (PaypalExperienceLandingPage): The type of landing page to show on the PayPal site for customer checkout. user_action (PaypalExperienceUserAction): Configures a Continue or Pay @@ -60,6 +64,7 @@ class PaypalWalletExperienceContext(object): "contact_preference": 'contact_preference', "return_url": 'return_url', "cancel_url": 'cancel_url', + "app_switch_context": 'app_switch_context', "landing_page": 'landing_page', "user_action": 'user_action', "payment_method_preference": 'payment_method_preference', @@ -73,6 +78,7 @@ class PaypalWalletExperienceContext(object): 'contact_preference', 'return_url', 'cancel_url', + 'app_switch_context', 'landing_page', 'user_action', 'payment_method_preference', @@ -86,6 +92,7 @@ def __init__(self, contact_preference='NO_CONTACT_INFO', return_url=APIHelper.SKIP, cancel_url=APIHelper.SKIP, + app_switch_context=APIHelper.SKIP, landing_page='NO_PREFERENCE', user_action='CONTINUE', payment_method_preference='UNRESTRICTED', @@ -103,6 +110,8 @@ def __init__(self, self.return_url = return_url if cancel_url is not APIHelper.SKIP: self.cancel_url = cancel_url + if app_switch_context is not APIHelper.SKIP: + self.app_switch_context = app_switch_context self.landing_page = landing_page self.user_action = user_action self.payment_method_preference = payment_method_preference @@ -134,6 +143,7 @@ def from_dictionary(cls, contact_preference = dictionary.get("contact_preference") if dictionary.get("contact_preference") else 'NO_CONTACT_INFO' return_url = dictionary.get("return_url") if dictionary.get("return_url") else APIHelper.SKIP cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else APIHelper.SKIP + app_switch_context = AppSwitchContext.from_dictionary(dictionary.get('app_switch_context')) if 'app_switch_context' in dictionary.keys() else APIHelper.SKIP landing_page = dictionary.get("landing_page") if dictionary.get("landing_page") else 'NO_PREFERENCE' user_action = dictionary.get("user_action") if dictionary.get("user_action") else 'CONTINUE' payment_method_preference = dictionary.get("payment_method_preference") if dictionary.get("payment_method_preference") else 'UNRESTRICTED' @@ -145,6 +155,7 @@ def from_dictionary(cls, contact_preference, return_url, cancel_url, + app_switch_context, landing_page, user_action, payment_method_preference, @@ -158,6 +169,7 @@ def __repr__(self): f'contact_preference={(self.contact_preference if hasattr(self, "contact_preference") else None)!r}, ' f'return_url={(self.return_url if hasattr(self, "return_url") else None)!r}, ' f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!r}, ' + f'app_switch_context={(self.app_switch_context if hasattr(self, "app_switch_context") else None)!r}, ' f'landing_page={(self.landing_page if hasattr(self, "landing_page") else None)!r}, ' f'user_action={(self.user_action if hasattr(self, "user_action") else None)!r}, ' f'payment_method_preference={(self.payment_method_preference if hasattr(self, "payment_method_preference") else None)!r}, ' @@ -171,6 +183,7 @@ def __str__(self): f'contact_preference={(self.contact_preference if hasattr(self, "contact_preference") else None)!s}, ' f'return_url={(self.return_url if hasattr(self, "return_url") else None)!s}, ' f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!s}, ' + f'app_switch_context={(self.app_switch_context if hasattr(self, "app_switch_context") else None)!s}, ' f'landing_page={(self.landing_page if hasattr(self, "landing_page") else None)!s}, ' f'user_action={(self.user_action if hasattr(self, "user_action") else None)!s}, ' f'payment_method_preference={(self.payment_method_preference if hasattr(self, "payment_method_preference") else None)!s}, ' diff --git a/paypalserversdk/models/paypal_wallet_response.py b/paypalserversdk/models/paypal_wallet_response.py index 7b0a477..81c097d 100644 --- a/paypalserversdk/models/paypal_wallet_response.py +++ b/paypalserversdk/models/paypal_wallet_response.py @@ -62,6 +62,9 @@ class PaypalWalletResponse(object): details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored. + experience_status (ExperienceStatus): This field indicates the status + of PayPal's Checkout experience throughout the order lifecycle. + The values reflect the current stage of the checkout process. """ @@ -78,7 +81,8 @@ class PaypalWalletResponse(object): "tax_info": 'tax_info', "address": 'address', "attributes": 'attributes', - "stored_credential": 'stored_credential' + "stored_credential": 'stored_credential', + "experience_status": 'experience_status' } _optionals = [ @@ -94,6 +98,7 @@ class PaypalWalletResponse(object): 'address', 'attributes', 'stored_credential', + 'experience_status', ] def __init__(self, @@ -108,7 +113,8 @@ def __init__(self, tax_info=APIHelper.SKIP, address=APIHelper.SKIP, attributes=APIHelper.SKIP, - stored_credential=APIHelper.SKIP): + stored_credential=APIHelper.SKIP, + experience_status=APIHelper.SKIP): """Constructor for the PaypalWalletResponse class""" # Initialize members of the class @@ -136,6 +142,8 @@ def __init__(self, self.attributes = attributes if stored_credential is not APIHelper.SKIP: self.stored_credential = stored_credential + if experience_status is not APIHelper.SKIP: + self.experience_status = experience_status @classmethod def from_dictionary(cls, @@ -168,6 +176,7 @@ def from_dictionary(cls, address = Address.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP attributes = PaypalWalletAttributesResponse.from_dictionary(dictionary.get('attributes')) if 'attributes' in dictionary.keys() else APIHelper.SKIP stored_credential = PaypalWalletStoredCredential.from_dictionary(dictionary.get('stored_credential')) if 'stored_credential' in dictionary.keys() else APIHelper.SKIP + experience_status = dictionary.get("experience_status") if dictionary.get("experience_status") else APIHelper.SKIP # Return an object of this model return cls(email_address, account_id, @@ -180,7 +189,8 @@ def from_dictionary(cls, tax_info, address, attributes, - stored_credential) + stored_credential, + experience_status) def __repr__(self): return (f'{self.__class__.__name__}(' @@ -195,7 +205,8 @@ def __repr__(self): f'tax_info={(self.tax_info if hasattr(self, "tax_info") else None)!r}, ' f'address={(self.address if hasattr(self, "address") else None)!r}, ' f'attributes={(self.attributes if hasattr(self, "attributes") else None)!r}, ' - f'stored_credential={(self.stored_credential if hasattr(self, "stored_credential") else None)!r})') + f'stored_credential={(self.stored_credential if hasattr(self, "stored_credential") else None)!r}, ' + f'experience_status={(self.experience_status if hasattr(self, "experience_status") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' @@ -210,4 +221,5 @@ def __str__(self): f'tax_info={(self.tax_info if hasattr(self, "tax_info") else None)!s}, ' f'address={(self.address if hasattr(self, "address") else None)!s}, ' f'attributes={(self.attributes if hasattr(self, "attributes") else None)!s}, ' - f'stored_credential={(self.stored_credential if hasattr(self, "stored_credential") else None)!s})') + f'stored_credential={(self.stored_credential if hasattr(self, "stored_credential") else None)!s}, ' + f'experience_status={(self.experience_status if hasattr(self, "experience_status") else None)!s})') diff --git a/paypalserversdk/models/paypal_wallet_stored_credential.py b/paypalserversdk/models/paypal_wallet_stored_credential.py index 452b0c0..2aaab54 100644 --- a/paypalserversdk/models/paypal_wallet_stored_credential.py +++ b/paypalserversdk/models/paypal_wallet_stored_credential.py @@ -20,8 +20,8 @@ class PaypalWalletStoredCredential(object): Attributes: payment_initiator (PaymentInitiator): The person or party who initiated or triggered the payment. - charge_pattern (UsagePattern): Expected business/pricing model for the - billing agreement. + charge_pattern (UsagePattern): DEPRECATED. Expected business/pricing + model for the billing agreement, Please use usage_pattern instead. usage_pattern (UsagePattern): Expected business/pricing model for the billing agreement. usage (StoredPaymentSourceUsageType): Indicates if this is a `first` diff --git a/paypalserversdk/models/paypal_wallet_vault_instruction.py b/paypalserversdk/models/paypal_wallet_vault_instruction.py index 2473e86..651fe01 100644 --- a/paypalserversdk/models/paypal_wallet_vault_instruction.py +++ b/paypalserversdk/models/paypal_wallet_vault_instruction.py @@ -13,9 +13,10 @@ class PaypalWalletVaultInstruction(object): """Implementation of the 'PayPal Wallet Vault Instruction' model. + Resource consolidating common request and response attributes for vaulting + PayPal Wallet. + Attributes: - store_in_vault (StoreInVaultInstruction): Defines how and when the - payment source gets vaulted. description (str): The description displayed to PayPal consumer on the approval flow for PayPal, as well as on the PayPal payment token management experience on PayPal.com. @@ -42,7 +43,6 @@ class PaypalWalletVaultInstruction(object): # Create a mapping from Model property names to API property names _names = { "usage_type": 'usage_type', - "store_in_vault": 'store_in_vault', "description": 'description', "usage_pattern": 'usage_pattern', "customer_type": 'customer_type', @@ -50,7 +50,6 @@ class PaypalWalletVaultInstruction(object): } _optionals = [ - 'store_in_vault', 'description', 'usage_pattern', 'customer_type', @@ -59,7 +58,6 @@ class PaypalWalletVaultInstruction(object): def __init__(self, usage_type=None, - store_in_vault=APIHelper.SKIP, description=APIHelper.SKIP, usage_pattern=APIHelper.SKIP, customer_type='CONSUMER', @@ -67,8 +65,6 @@ def __init__(self, """Constructor for the PaypalWalletVaultInstruction class""" # Initialize members of the class - if store_in_vault is not APIHelper.SKIP: - self.store_in_vault = store_in_vault if description is not APIHelper.SKIP: self.description = description if usage_pattern is not APIHelper.SKIP: @@ -97,14 +93,12 @@ def from_dictionary(cls, # Extract variables from the dictionary usage_type = dictionary.get("usage_type") if dictionary.get("usage_type") else None - store_in_vault = dictionary.get("store_in_vault") if dictionary.get("store_in_vault") else APIHelper.SKIP description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP usage_pattern = dictionary.get("usage_pattern") if dictionary.get("usage_pattern") else APIHelper.SKIP customer_type = dictionary.get("customer_type") if dictionary.get("customer_type") else 'CONSUMER' permit_multiple_payment_tokens = dictionary.get("permit_multiple_payment_tokens") if dictionary.get("permit_multiple_payment_tokens") else False # Return an object of this model return cls(usage_type, - store_in_vault, description, usage_pattern, customer_type, @@ -112,7 +106,6 @@ def from_dictionary(cls, def __repr__(self): return (f'{self.__class__.__name__}(' - f'store_in_vault={(self.store_in_vault if hasattr(self, "store_in_vault") else None)!r}, ' f'description={(self.description if hasattr(self, "description") else None)!r}, ' f'usage_pattern={(self.usage_pattern if hasattr(self, "usage_pattern") else None)!r}, ' f'usage_type={self.usage_type!r}, ' @@ -121,7 +114,6 @@ def __repr__(self): def __str__(self): return (f'{self.__class__.__name__}(' - f'store_in_vault={(self.store_in_vault if hasattr(self, "store_in_vault") else None)!s}, ' f'description={(self.description if hasattr(self, "description") else None)!s}, ' f'usage_pattern={(self.usage_pattern if hasattr(self, "usage_pattern") else None)!s}, ' f'usage_type={self.usage_type!s}, ' diff --git a/paypalserversdk/models/phone_number.py b/paypalserversdk/models/phone_number.py index b705da7..a9cfa1d 100644 --- a/paypalserversdk/models/phone_number.py +++ b/paypalserversdk/models/phone_number.py @@ -13,6 +13,8 @@ class PhoneNumber(object): """Implementation of the 'Phone Number' model. The phone number in its canonical international [E.164 numbering plan + format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its + canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). Attributes: diff --git a/paypalserversdk/models/phone_number_with_country_code.py b/paypalserversdk/models/phone_number_with_country_code.py index 4cac5a5..23fe16e 100644 --- a/paypalserversdk/models/phone_number_with_country_code.py +++ b/paypalserversdk/models/phone_number_with_country_code.py @@ -15,6 +15,8 @@ class PhoneNumberWithCountryCode(object): The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan + format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its + canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). Attributes: diff --git a/paypalserversdk/models/phone_number_with_optional_country_code.py b/paypalserversdk/models/phone_number_with_optional_country_code.py new file mode 100644 index 0000000..6188f03 --- /dev/null +++ b/paypalserversdk/models/phone_number_with_optional_country_code.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class PhoneNumberWithOptionalCountryCode(object): + + """Implementation of the 'Phone Number With Optional Country Code' model. + + The phone number in its canonical international [E.164 numbering plan + format](https://www.itu.int/rec/T-REC-E.164/en). + + Attributes: + country_code (str): The country calling code (CC), in its canonical + international [E.164 numbering plan + format](https://www.itu.int/rec/T-REC-E.164/en). The combined + length of the CC and the national number must not be greater than + 15 digits. The national number consists of a national destination + code (NDC) and subscriber number (SN). + national_number (str): The national number, in its canonical + international [E.164 numbering plan + format](https://www.itu.int/rec/T-REC-E.164/en). The combined + length of the country calling code (CC) and the national number + must not be greater than 15 digits. The national number consists + of a national destination code (NDC) and subscriber number (SN). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "national_number": 'national_number', + "country_code": 'country_code' + } + + _optionals = [ + 'country_code', + ] + + def __init__(self, + national_number=None, + country_code=APIHelper.SKIP): + """Constructor for the PhoneNumberWithOptionalCountryCode class""" + + # Initialize members of the class + if country_code is not APIHelper.SKIP: + self.country_code = country_code + self.national_number = national_number + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + national_number = dictionary.get("national_number") if dictionary.get("national_number") else None + country_code = dictionary.get("country_code") if dictionary.get("country_code") else APIHelper.SKIP + # Return an object of this model + return cls(national_number, + country_code) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'country_code={(self.country_code if hasattr(self, "country_code") else None)!r}, ' + f'national_number={self.national_number!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'country_code={(self.country_code if hasattr(self, "country_code") else None)!s}, ' + f'national_number={self.national_number!s})') diff --git a/paypalserversdk/models/phone_type.py b/paypalserversdk/models/phone_type.py index 7b19b4b..b6b9833 100644 --- a/paypalserversdk/models/phone_type.py +++ b/paypalserversdk/models/phone_type.py @@ -15,11 +15,11 @@ class PhoneType(object): The phone type. Attributes: - FAX: The enum member of type str. - HOME: The enum member of type str. - MOBILE: The enum member of type str. - OTHER: The enum member of type str. - PAGER: The enum member of type str. + FAX: Fax number. + HOME: Home phone number. + MOBILE: Mobile phone number. + OTHER: Other phone number. + PAGER: Pager number. """ FAX = 'FAX' diff --git a/paypalserversdk/models/plan.py b/paypalserversdk/models/plan.py index 615938f..b493eac 100644 --- a/paypalserversdk/models/plan.py +++ b/paypalserversdk/models/plan.py @@ -22,8 +22,6 @@ class Plan(object): billing_cycles (List[BillingCycle]): An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle. - product (Any): Product details associated with any one-time product - purchase. one_time_charges (OneTimeCharge): The one-time charge info at the time of checkout. name (str): Name of the recurring plan. @@ -34,26 +32,21 @@ class Plan(object): _names = { "billing_cycles": 'billing_cycles', "one_time_charges": 'one_time_charges', - "product": 'product', "name": 'name' } _optionals = [ - 'product', 'name', ] def __init__(self, billing_cycles=None, one_time_charges=None, - product=APIHelper.SKIP, name=APIHelper.SKIP): """Constructor for the Plan class""" # Initialize members of the class self.billing_cycles = billing_cycles - if product is not APIHelper.SKIP: - self.product = product self.one_time_charges = one_time_charges if name is not APIHelper.SKIP: self.name = name @@ -81,24 +74,20 @@ def from_dictionary(cls, if dictionary.get('billing_cycles') is not None: billing_cycles = [BillingCycle.from_dictionary(x) for x in dictionary.get('billing_cycles')] one_time_charges = OneTimeCharge.from_dictionary(dictionary.get('one_time_charges')) if dictionary.get('one_time_charges') else None - product = dictionary.get("product") if dictionary.get("product") else APIHelper.SKIP name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP # Return an object of this model return cls(billing_cycles, one_time_charges, - product, name) def __repr__(self): return (f'{self.__class__.__name__}(' f'billing_cycles={self.billing_cycles!r}, ' - f'product={(self.product if hasattr(self, "product") else None)!r}, ' f'one_time_charges={self.one_time_charges!r}, ' f'name={(self.name if hasattr(self, "name") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' f'billing_cycles={self.billing_cycles!s}, ' - f'product={(self.product if hasattr(self, "product") else None)!s}, ' f'one_time_charges={self.one_time_charges!s}, ' f'name={(self.name if hasattr(self, "name") else None)!s})') diff --git a/paypalserversdk/models/plan_collection.py b/paypalserversdk/models/plan_collection.py new file mode 100644 index 0000000..f4850b6 --- /dev/null +++ b/paypalserversdk/models/plan_collection.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.billing_plan import BillingPlan +from paypalserversdk.models.link_description import LinkDescription + + +class PlanCollection(object): + + """Implementation of the 'Plan Collection' model. + + The list of plans with details. + + Attributes: + plans (List[BillingPlan]): An array of plans. + total_items (int): The total number of items. + total_pages (int): The total number of pages. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/docs/api/reference/api-responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "plans": 'plans', + "total_items": 'total_items', + "total_pages": 'total_pages', + "links": 'links' + } + + _optionals = [ + 'plans', + 'total_items', + 'total_pages', + 'links', + ] + + def __init__(self, + plans=APIHelper.SKIP, + total_items=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the PlanCollection class""" + + # Initialize members of the class + if plans is not APIHelper.SKIP: + self.plans = plans + if total_items is not APIHelper.SKIP: + self.total_items = total_items + if total_pages is not APIHelper.SKIP: + self.total_pages = total_pages + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + plans = None + if dictionary.get('plans') is not None: + plans = [BillingPlan.from_dictionary(x) for x in dictionary.get('plans')] + else: + plans = APIHelper.SKIP + total_items = dictionary.get("total_items") if dictionary.get("total_items") else APIHelper.SKIP + total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(plans, + total_items, + total_pages, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'plans={(self.plans if hasattr(self, "plans") else None)!r}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!r}, ' + f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'plans={(self.plans if hasattr(self, "plans") else None)!s}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!s}, ' + f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/plan_details.py b/paypalserversdk/models/plan_details.py new file mode 100644 index 0000000..873a7e5 --- /dev/null +++ b/paypalserversdk/models/plan_details.py @@ -0,0 +1,151 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.merchant_preferences import MerchantPreferences +from paypalserversdk.models.payment_preferences import PaymentPreferences +from paypalserversdk.models.subscription_billing_cycle import SubscriptionBillingCycle +from paypalserversdk.models.taxes import Taxes + + +class PlanDetails(object): + + """Implementation of the 'Plan Details' model. + + The plan details. + + Attributes: + product_id (str): The ID for the product. + name (str): The plan name. + description (str): The detailed description of the plan. + billing_cycles (List[SubscriptionBillingCycle]): An array of billing + cycles for trial billing and regular billing. A plan can have at + most two trial cycles and only one regular cycle. + payment_preferences (PaymentPreferences): The payment preferences for + a subscription. + merchant_preferences (MerchantPreferences): The merchant preferences + for a subscription. + taxes (Taxes): The tax details. + quantity_supported (bool): Indicates whether you can subscribe to this + plan by providing a quantity for the goods or service. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "product_id": 'product_id', + "name": 'name', + "description": 'description', + "billing_cycles": 'billing_cycles', + "payment_preferences": 'payment_preferences', + "merchant_preferences": 'merchant_preferences', + "taxes": 'taxes', + "quantity_supported": 'quantity_supported' + } + + _optionals = [ + 'product_id', + 'name', + 'description', + 'billing_cycles', + 'payment_preferences', + 'merchant_preferences', + 'taxes', + 'quantity_supported', + ] + + def __init__(self, + product_id=APIHelper.SKIP, + name=APIHelper.SKIP, + description=APIHelper.SKIP, + billing_cycles=APIHelper.SKIP, + payment_preferences=APIHelper.SKIP, + merchant_preferences=APIHelper.SKIP, + taxes=APIHelper.SKIP, + quantity_supported=False): + """Constructor for the PlanDetails class""" + + # Initialize members of the class + if product_id is not APIHelper.SKIP: + self.product_id = product_id + if name is not APIHelper.SKIP: + self.name = name + if description is not APIHelper.SKIP: + self.description = description + if billing_cycles is not APIHelper.SKIP: + self.billing_cycles = billing_cycles + if payment_preferences is not APIHelper.SKIP: + self.payment_preferences = payment_preferences + if merchant_preferences is not APIHelper.SKIP: + self.merchant_preferences = merchant_preferences + if taxes is not APIHelper.SKIP: + self.taxes = taxes + self.quantity_supported = quantity_supported + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP + name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP + description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP + billing_cycles = None + if dictionary.get('billing_cycles') is not None: + billing_cycles = [SubscriptionBillingCycle.from_dictionary(x) for x in dictionary.get('billing_cycles')] + else: + billing_cycles = APIHelper.SKIP + payment_preferences = PaymentPreferences.from_dictionary(dictionary.get('payment_preferences')) if 'payment_preferences' in dictionary.keys() else APIHelper.SKIP + merchant_preferences = MerchantPreferences.from_dictionary(dictionary.get('merchant_preferences')) if 'merchant_preferences' in dictionary.keys() else APIHelper.SKIP + taxes = Taxes.from_dictionary(dictionary.get('taxes')) if 'taxes' in dictionary.keys() else APIHelper.SKIP + quantity_supported = dictionary.get("quantity_supported") if dictionary.get("quantity_supported") else False + # Return an object of this model + return cls(product_id, + name, + description, + billing_cycles, + payment_preferences, + merchant_preferences, + taxes, + quantity_supported) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'description={(self.description if hasattr(self, "description") else None)!r}, ' + f'billing_cycles={(self.billing_cycles if hasattr(self, "billing_cycles") else None)!r}, ' + f'payment_preferences={(self.payment_preferences if hasattr(self, "payment_preferences") else None)!r}, ' + f'merchant_preferences={(self.merchant_preferences if hasattr(self, "merchant_preferences") else None)!r}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' + f'quantity_supported={(self.quantity_supported if hasattr(self, "quantity_supported") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'description={(self.description if hasattr(self, "description") else None)!s}, ' + f'billing_cycles={(self.billing_cycles if hasattr(self, "billing_cycles") else None)!s}, ' + f'payment_preferences={(self.payment_preferences if hasattr(self, "payment_preferences") else None)!s}, ' + f'merchant_preferences={(self.merchant_preferences if hasattr(self, "merchant_preferences") else None)!s}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' + f'quantity_supported={(self.quantity_supported if hasattr(self, "quantity_supported") else None)!s})') diff --git a/paypalserversdk/models/plan_override.py b/paypalserversdk/models/plan_override.py new file mode 100644 index 0000000..d27c0c5 --- /dev/null +++ b/paypalserversdk/models/plan_override.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.billing_cycle_override import BillingCycleOverride +from paypalserversdk.models.payment_preferences_override import PaymentPreferencesOverride +from paypalserversdk.models.taxes_override import TaxesOverride + + +class PlanOverride(object): + + """Implementation of the 'Plan Override' model. + + An inline plan object to customise the subscription. You can override plan + level default attributes by providing customised values for the + subscription in this object. + + Attributes: + billing_cycles (List[BillingCycleOverride]): An array of billing + cycles for trial billing and regular billing. The subscription + billing cycle definition has to adhere to the plan billing cycle + definition. + payment_preferences (PaymentPreferencesOverride): The payment + preferences to override at subscription level. + taxes (TaxesOverride): The tax details. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "billing_cycles": 'billing_cycles', + "payment_preferences": 'payment_preferences', + "taxes": 'taxes' + } + + _optionals = [ + 'billing_cycles', + 'payment_preferences', + 'taxes', + ] + + def __init__(self, + billing_cycles=APIHelper.SKIP, + payment_preferences=APIHelper.SKIP, + taxes=APIHelper.SKIP): + """Constructor for the PlanOverride class""" + + # Initialize members of the class + if billing_cycles is not APIHelper.SKIP: + self.billing_cycles = billing_cycles + if payment_preferences is not APIHelper.SKIP: + self.payment_preferences = payment_preferences + if taxes is not APIHelper.SKIP: + self.taxes = taxes + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + billing_cycles = None + if dictionary.get('billing_cycles') is not None: + billing_cycles = [BillingCycleOverride.from_dictionary(x) for x in dictionary.get('billing_cycles')] + else: + billing_cycles = APIHelper.SKIP + payment_preferences = PaymentPreferencesOverride.from_dictionary(dictionary.get('payment_preferences')) if 'payment_preferences' in dictionary.keys() else APIHelper.SKIP + taxes = TaxesOverride.from_dictionary(dictionary.get('taxes')) if 'taxes' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(billing_cycles, + payment_preferences, + taxes) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'billing_cycles={(self.billing_cycles if hasattr(self, "billing_cycles") else None)!r}, ' + f'payment_preferences={(self.payment_preferences if hasattr(self, "payment_preferences") else None)!r}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'billing_cycles={(self.billing_cycles if hasattr(self, "billing_cycles") else None)!s}, ' + f'payment_preferences={(self.payment_preferences if hasattr(self, "payment_preferences") else None)!s}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s})') diff --git a/paypalserversdk/models/plan_request.py b/paypalserversdk/models/plan_request.py new file mode 100644 index 0000000..e75ecdc --- /dev/null +++ b/paypalserversdk/models/plan_request.py @@ -0,0 +1,152 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.merchant_preferences import MerchantPreferences +from paypalserversdk.models.payment_preferences import PaymentPreferences +from paypalserversdk.models.subscription_billing_cycle import SubscriptionBillingCycle +from paypalserversdk.models.taxes import Taxes + + +class PlanRequest(object): + + """Implementation of the 'Plan Request' model. + + The create plan request details. + + Attributes: + product_id (str): The ID of the product created through Catalog + Products API. + name (str): The plan name. + status (PlanRequestStatus): The initial state of the plan. Allowed + input values are CREATED and ACTIVE. + description (str): The detailed description of the plan. + billing_cycles (List[SubscriptionBillingCycle]): An array of billing + cycles for trial billing and regular billing. A plan can have at + most two trial cycles and only one regular cycle. + payment_preferences (PaymentPreferences): The payment preferences for + a subscription. + merchant_preferences (MerchantPreferences): The merchant preferences + for a subscription. + taxes (Taxes): The tax details. + quantity_supported (bool): Indicates whether you can subscribe to this + plan by providing a quantity for the goods or service. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "product_id": 'product_id', + "name": 'name', + "billing_cycles": 'billing_cycles', + "payment_preferences": 'payment_preferences', + "status": 'status', + "description": 'description', + "merchant_preferences": 'merchant_preferences', + "taxes": 'taxes', + "quantity_supported": 'quantity_supported' + } + + _optionals = [ + 'status', + 'description', + 'merchant_preferences', + 'taxes', + 'quantity_supported', + ] + + def __init__(self, + product_id=None, + name=None, + billing_cycles=None, + payment_preferences=None, + status='ACTIVE', + description=APIHelper.SKIP, + merchant_preferences=APIHelper.SKIP, + taxes=APIHelper.SKIP, + quantity_supported=False): + """Constructor for the PlanRequest class""" + + # Initialize members of the class + self.product_id = product_id + self.name = name + self.status = status + if description is not APIHelper.SKIP: + self.description = description + self.billing_cycles = billing_cycles + self.payment_preferences = payment_preferences + if merchant_preferences is not APIHelper.SKIP: + self.merchant_preferences = merchant_preferences + if taxes is not APIHelper.SKIP: + self.taxes = taxes + self.quantity_supported = quantity_supported + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + product_id = dictionary.get("product_id") if dictionary.get("product_id") else None + name = dictionary.get("name") if dictionary.get("name") else None + billing_cycles = None + if dictionary.get('billing_cycles') is not None: + billing_cycles = [SubscriptionBillingCycle.from_dictionary(x) for x in dictionary.get('billing_cycles')] + payment_preferences = PaymentPreferences.from_dictionary(dictionary.get('payment_preferences')) if dictionary.get('payment_preferences') else None + status = dictionary.get("status") if dictionary.get("status") else 'ACTIVE' + description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP + merchant_preferences = MerchantPreferences.from_dictionary(dictionary.get('merchant_preferences')) if 'merchant_preferences' in dictionary.keys() else APIHelper.SKIP + taxes = Taxes.from_dictionary(dictionary.get('taxes')) if 'taxes' in dictionary.keys() else APIHelper.SKIP + quantity_supported = dictionary.get("quantity_supported") if dictionary.get("quantity_supported") else False + # Return an object of this model + return cls(product_id, + name, + billing_cycles, + payment_preferences, + status, + description, + merchant_preferences, + taxes, + quantity_supported) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'product_id={self.product_id!r}, ' + f'name={self.name!r}, ' + f'status={(self.status if hasattr(self, "status") else None)!r}, ' + f'description={(self.description if hasattr(self, "description") else None)!r}, ' + f'billing_cycles={self.billing_cycles!r}, ' + f'payment_preferences={self.payment_preferences!r}, ' + f'merchant_preferences={(self.merchant_preferences if hasattr(self, "merchant_preferences") else None)!r}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' + f'quantity_supported={(self.quantity_supported if hasattr(self, "quantity_supported") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'product_id={self.product_id!s}, ' + f'name={self.name!s}, ' + f'status={(self.status if hasattr(self, "status") else None)!s}, ' + f'description={(self.description if hasattr(self, "description") else None)!s}, ' + f'billing_cycles={self.billing_cycles!s}, ' + f'payment_preferences={self.payment_preferences!s}, ' + f'merchant_preferences={(self.merchant_preferences if hasattr(self, "merchant_preferences") else None)!s}, ' + f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' + f'quantity_supported={(self.quantity_supported if hasattr(self, "quantity_supported") else None)!s})') diff --git a/paypalserversdk/models/plan_request_status.py b/paypalserversdk/models/plan_request_status.py new file mode 100644 index 0000000..1ad21f6 --- /dev/null +++ b/paypalserversdk/models/plan_request_status.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class PlanRequestStatus(object): + + """Implementation of the 'Plan Request Status' enum. + + The initial state of the plan. Allowed input values are CREATED and ACTIVE. + + Attributes: + CREATED: The plan was created. You cannot create subscriptions for a + plan in this state. + INACTIVE: The plan is inactive. + ACTIVE: The plan is active. You can only create subscriptions for a + plan in this state. + + """ + CREATED = 'CREATED' + + INACTIVE = 'INACTIVE' + + ACTIVE = 'ACTIVE' + diff --git a/paypalserversdk/models/pricing_tier.py b/paypalserversdk/models/pricing_tier.py new file mode 100644 index 0000000..9f91779 --- /dev/null +++ b/paypalserversdk/models/pricing_tier.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class PricingTier(object): + + """Implementation of the 'Pricing Tier' model. + + The pricing tier details. + + Attributes: + starting_quantity (str): The starting quantity for the tier. + ending_quantity (str): The ending quantity for the tier. Optional for + the last tier. + amount (Money): The currency and amount for a financial transaction, + such as a balance or payment due. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "starting_quantity": 'starting_quantity', + "amount": 'amount', + "ending_quantity": 'ending_quantity' + } + + _optionals = [ + 'ending_quantity', + ] + + def __init__(self, + starting_quantity=None, + amount=None, + ending_quantity=APIHelper.SKIP): + """Constructor for the PricingTier class""" + + # Initialize members of the class + self.starting_quantity = starting_quantity + if ending_quantity is not APIHelper.SKIP: + self.ending_quantity = ending_quantity + self.amount = amount + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else None + amount = Money.from_dictionary(dictionary.get('amount')) if dictionary.get('amount') else None + ending_quantity = dictionary.get("ending_quantity") if dictionary.get("ending_quantity") else APIHelper.SKIP + # Return an object of this model + return cls(starting_quantity, + amount, + ending_quantity) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'starting_quantity={self.starting_quantity!r}, ' + f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' + f'amount={self.amount!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'starting_quantity={self.starting_quantity!s}, ' + f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' + f'amount={self.amount!s})') diff --git a/paypalserversdk/models/purchase_unit_request.py b/paypalserversdk/models/purchase_unit_request.py index 40cc8a0..c4350c5 100644 --- a/paypalserversdk/models/purchase_unit_request.py +++ b/paypalserversdk/models/purchase_unit_request.py @@ -8,7 +8,7 @@ """ from paypalserversdk.api_helper import APIHelper from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown -from paypalserversdk.models.item import Item +from paypalserversdk.models.item_request import ItemRequest from paypalserversdk.models.payee_base import PayeeBase from paypalserversdk.models.payment_instruction import PaymentInstruction from paypalserversdk.models.shipping_details import ShippingDetails @@ -42,23 +42,35 @@ class PurchaseUnitRequest(object): instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. - description (str): The purchase description. The maximum length of the - character is dependent on the type of characters used. The - character length is specified assuming a US ASCII character. - Depending on type of character; (e.g. accented character, Japanese - characters) the number of characters that that can be specified as - input might not equal the permissible max length. + description (str): This field supports up to 3,000 characters, but any + content beyond 127 characters (including spaces) will be + truncated. The 127 character limit is reflected in the response + representation of this field. The purchase description. The + maximum length of the character is dependent on the type of + characters used. The character length is specified assuming a US + ASCII character. Depending on type of character; (e.g. accented + character, Japanese characters) the number of characters that that + can be specified as input might not equal the permissible max + length. custom_id (str): The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer. invoice_id (str): The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and - the emails that the payer receives. - soft_descriptor (str): The soft descriptor is the dynamic text used to - construct the statement descriptor that appears on a payer's card - statement. If an Order is paid using the "PayPal Wallet", the - statement descriptor will appear in following format on the - payer's card statement: + the emails that the payer receives. invoice_id values are required + to be unique within each merchant account by default. Although the + uniqueness validation is configurable, disabling this behavior + will remove the account's ability to use invoice_id in other APIs + as an identifier. It is highly recommended to keep a unique + invoice_id for each Order. + soft_descriptor (str): This field supports up to 127 characters, but + any content beyond 22 characters (including spaces) will be + truncated. The 22 character limit is reflected in the response + representation of this field. The soft descriptor is the dynamic + text used to construct the statement descriptor that appears on a + payer's card statement. If an Order is paid using the "PayPal + Wallet", the statement descriptor will appear in following format + on the payer's card statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant descriptor is the descriptor of the merchant’s payment receiving preferences which can be seen by logging into @@ -69,8 +81,8 @@ class PurchaseUnitRequest(object): prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. The soft descriptor is 800-123-1234. Then, the statement descriptor on the card is PAYPAL * Janes Gift 80. - items (List[Item]): An array of items that the customer purchases from - the merchant. + items (List[ItemRequest]): An array of items that the customer + purchases from the merchant. shipping (ShippingDetails): The shipping details. supplementary_data (SupplementaryData): Supplementary data about a payment. This object passes information that can be used to @@ -173,7 +185,7 @@ def from_dictionary(cls, soft_descriptor = dictionary.get("soft_descriptor") if dictionary.get("soft_descriptor") else APIHelper.SKIP items = None if dictionary.get('items') is not None: - items = [Item.from_dictionary(x) for x in dictionary.get('items')] + items = [ItemRequest.from_dictionary(x) for x in dictionary.get('items')] else: items = APIHelper.SKIP shipping = ShippingDetails.from_dictionary(dictionary.get('shipping')) if 'shipping' in dictionary.keys() else APIHelper.SKIP diff --git a/paypalserversdk/models/reason_code.py b/paypalserversdk/models/reason_code.py new file mode 100644 index 0000000..981baad --- /dev/null +++ b/paypalserversdk/models/reason_code.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class ReasonCode(object): + + """Implementation of the 'Reason Code' enum. + + The reason code for the payment failure. + + Attributes: + PAYMENT_DENIED: PayPal declined the payment due to one or more + customer issues. + INTERNAL_SERVER_ERROR: An internal server error has occurred. + PAYEE_ACCOUNT_RESTRICTED: The payee account is not in good standing + and cannot receive payments. + PAYER_ACCOUNT_RESTRICTED: The payer account is not in good standing + and cannot make payments. + PAYER_CANNOT_PAY: Payer cannot pay for this transaction. + SENDING_LIMIT_EXCEEDED: The transaction exceeds the payer's sending + limit. + TRANSACTION_RECEIVING_LIMIT_EXCEEDED: The transaction exceeds the + receiver's receiving limit. + CURRENCY_MISMATCH: The transaction is declined due to a currency + mismatch. + + """ + PAYMENT_DENIED = 'PAYMENT_DENIED' + + INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR' + + PAYEE_ACCOUNT_RESTRICTED = 'PAYEE_ACCOUNT_RESTRICTED' + + PAYER_ACCOUNT_RESTRICTED = 'PAYER_ACCOUNT_RESTRICTED' + + PAYER_CANNOT_PAY = 'PAYER_CANNOT_PAY' + + SENDING_LIMIT_EXCEEDED = 'SENDING_LIMIT_EXCEEDED' + + TRANSACTION_RECEIVING_LIMIT_EXCEEDED = 'TRANSACTION_RECEIVING_LIMIT_EXCEEDED' + + CURRENCY_MISMATCH = 'CURRENCY_MISMATCH' + diff --git a/paypalserversdk/models/reauthorize_request.py b/paypalserversdk/models/reauthorize_request.py index a8ef4a7..b424df1 100644 --- a/paypalserversdk/models/reauthorize_request.py +++ b/paypalserversdk/models/reauthorize_request.py @@ -24,8 +24,7 @@ class ReauthorizeRequest(object): authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` - request parameter. Note: This request is currently not supported for - Partner use cases. + request parameter. Attributes: amount (Money): The currency and amount for a financial transaction, diff --git a/paypalserversdk/models/return_flow.py b/paypalserversdk/models/return_flow.py new file mode 100644 index 0000000..fb5d781 --- /dev/null +++ b/paypalserversdk/models/return_flow.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class ReturnFlow(object): + + """Implementation of the 'Return Flow' enum. + + Merchant preference on how the buyer can navigate back to merchant website + post approving the transaction on the Venmo App. + + Attributes: + AUTO: After payment approval in the PayPal App, buyer will + automatically be redirected to the merchant website. + MANUAL: After payment approval in the PayPal App, buyer will be asked + to manually navigate back to the merchant website where they + started the transaction from. The buyer is shown a message like + 'Return to Merchant' to return to the source where the transaction + actually started. + + """ + AUTO = 'AUTO' + + MANUAL = 'MANUAL' + diff --git a/paypalserversdk/models/search_response.py b/paypalserversdk/models/search_response.py new file mode 100644 index 0000000..f792368 --- /dev/null +++ b/paypalserversdk/models/search_response.py @@ -0,0 +1,177 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.transaction_details import TransactionDetails + + +class SearchResponse(object): + + """Implementation of the 'Search Response' model. + + The search response information. + + Attributes: + transaction_details (List[TransactionDetails]): An array of + transaction detail objects. + account_number (str): The merchant account number. + start_date (str): 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. + end_date (str): 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. + last_refreshed_datetime (str): 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. + page (int): A zero-relative index of transactions. + total_items (int): The total number of transactions as an integer + beginning with the specified `page` in the full result and not + just in this response. + total_pages (int): The total number of pages, as an `integer`, when + the `total_items` is divided into pages of the specified + `page_size`. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/api/rest/responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "transaction_details": 'transaction_details', + "account_number": 'account_number', + "start_date": 'start_date', + "end_date": 'end_date', + "last_refreshed_datetime": 'last_refreshed_datetime', + "page": 'page', + "total_items": 'total_items', + "total_pages": 'total_pages', + "links": 'links' + } + + _optionals = [ + 'transaction_details', + 'account_number', + 'start_date', + 'end_date', + 'last_refreshed_datetime', + 'page', + 'total_items', + 'total_pages', + 'links', + ] + + def __init__(self, + transaction_details=APIHelper.SKIP, + account_number=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + last_refreshed_datetime=APIHelper.SKIP, + page=APIHelper.SKIP, + total_items=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the SearchResponse class""" + + # Initialize members of the class + if transaction_details is not APIHelper.SKIP: + self.transaction_details = transaction_details + if account_number is not APIHelper.SKIP: + self.account_number = account_number + if start_date is not APIHelper.SKIP: + self.start_date = start_date + if end_date is not APIHelper.SKIP: + self.end_date = end_date + if last_refreshed_datetime is not APIHelper.SKIP: + self.last_refreshed_datetime = last_refreshed_datetime + if page is not APIHelper.SKIP: + self.page = page + if total_items is not APIHelper.SKIP: + self.total_items = total_items + if total_pages is not APIHelper.SKIP: + self.total_pages = total_pages + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + transaction_details = None + if dictionary.get('transaction_details') is not None: + transaction_details = [TransactionDetails.from_dictionary(x) for x in dictionary.get('transaction_details')] + else: + transaction_details = APIHelper.SKIP + account_number = dictionary.get("account_number") if dictionary.get("account_number") else APIHelper.SKIP + start_date = dictionary.get("start_date") if dictionary.get("start_date") else APIHelper.SKIP + end_date = dictionary.get("end_date") if dictionary.get("end_date") else APIHelper.SKIP + last_refreshed_datetime = dictionary.get("last_refreshed_datetime") if dictionary.get("last_refreshed_datetime") else APIHelper.SKIP + page = dictionary.get("page") if dictionary.get("page") else APIHelper.SKIP + total_items = dictionary.get("total_items") if dictionary.get("total_items") else APIHelper.SKIP + total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(transaction_details, + account_number, + start_date, + end_date, + last_refreshed_datetime, + page, + total_items, + total_pages, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'transaction_details={(self.transaction_details if hasattr(self, "transaction_details") else None)!r}, ' + f'account_number={(self.account_number if hasattr(self, "account_number") else None)!r}, ' + f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' + f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' + f'last_refreshed_datetime={(self.last_refreshed_datetime if hasattr(self, "last_refreshed_datetime") else None)!r}, ' + f'page={(self.page if hasattr(self, "page") else None)!r}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!r}, ' + f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'transaction_details={(self.transaction_details if hasattr(self, "transaction_details") else None)!s}, ' + f'account_number={(self.account_number if hasattr(self, "account_number") else None)!s}, ' + f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' + f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' + f'last_refreshed_datetime={(self.last_refreshed_datetime if hasattr(self, "last_refreshed_datetime") else None)!s}, ' + f'page={(self.page if hasattr(self, "page") else None)!s}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!s}, ' + f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/sepa_debit_experience_context.py b/paypalserversdk/models/sepa_debit_experience_context.py new file mode 100644 index 0000000..411dc74 --- /dev/null +++ b/paypalserversdk/models/sepa_debit_experience_context.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class SepaDebitExperienceContext(object): + + """Implementation of the 'SEPA Debit Experience Context' model. + + Customizes the payer experience during the approval process for the SEPA + Debit payment. + + Attributes: + locale (str): The [language + tag](https://tools.ietf.org/html/bcp47#section-2) for the language + in which to localize the error-related strings, such as messages, + issues, and suggested actions. The tag is made up of the [ISO + 639-2 language + code](https://www.loc.gov/standards/iso639-2/php/code_list.php), + the optional [ISO-15924 script + tag](https://www.unicode.org/iso15924/codelists.html), and the + [ISO-3166 alpha-2 country + code](/api/rest/reference/country-codes/) or [M49 region + code](https://unstats.un.org/unsd/methodology/m49/). + return_url (str): Describes the URL. + cancel_url (str): Describes the URL. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "return_url": 'return_url', + "cancel_url": 'cancel_url', + "locale": 'locale' + } + + _optionals = [ + 'locale', + ] + + def __init__(self, + return_url=None, + cancel_url=None, + locale=APIHelper.SKIP): + """Constructor for the SepaDebitExperienceContext class""" + + # Initialize members of the class + if locale is not APIHelper.SKIP: + self.locale = locale + self.return_url = return_url + self.cancel_url = cancel_url + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + return_url = dictionary.get("return_url") if dictionary.get("return_url") else None + cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else None + locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP + # Return an object of this model + return cls(return_url, + cancel_url, + locale) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' + f'return_url={self.return_url!r}, ' + f'cancel_url={self.cancel_url!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' + f'return_url={self.return_url!s}, ' + f'cancel_url={self.cancel_url!s})') diff --git a/paypalserversdk/models/sepa_debit_request.py b/paypalserversdk/models/sepa_debit_request.py new file mode 100644 index 0000000..30defbe --- /dev/null +++ b/paypalserversdk/models/sepa_debit_request.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.sepa_debit_experience_context import SepaDebitExperienceContext + + +class SepaDebitRequest(object): + + """Implementation of the 'SEPA Debit Request' model. + + An API resource denoting a request to securely store a SEPA Debit. + + Attributes: + experience_context (SepaDebitExperienceContext): Customizes the payer + experience during the approval process for the SEPA Debit payment. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "experience_context": 'experience_context' + } + + _optionals = [ + 'experience_context', + ] + + def __init__(self, + experience_context=APIHelper.SKIP): + """Constructor for the SepaDebitRequest class""" + + # Initialize members of the class + if experience_context is not APIHelper.SKIP: + self.experience_context = experience_context + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + experience_context = SepaDebitExperienceContext.from_dictionary(dictionary.get('experience_context')) if 'experience_context' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(experience_context) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'experience_context={(self.experience_context if hasattr(self, "experience_context") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'experience_context={(self.experience_context if hasattr(self, "experience_context") else None)!s})') diff --git a/paypalserversdk/models/setup_fee_failure_action.py b/paypalserversdk/models/setup_fee_failure_action.py new file mode 100644 index 0000000..4a24d9c --- /dev/null +++ b/paypalserversdk/models/setup_fee_failure_action.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class SetupFeeFailureAction(object): + + """Implementation of the 'Setup Fee Failure Action' enum. + + The action to take on the subscription if the initial payment for the + setup fails. + + Attributes: + CONTINUE: Continues the subscription if the initial payment for the + setup fails. + CANCEL: Cancels the subscription if the initial payment for the setup + fails. + + """ + CONTINUE = 'CONTINUE' + + CANCEL = 'CANCEL' + diff --git a/paypalserversdk/models/setup_token_request_card.py b/paypalserversdk/models/setup_token_request_card.py index 7325bd9..e71ca9d 100644 --- a/paypalserversdk/models/setup_token_request_card.py +++ b/paypalserversdk/models/setup_token_request_card.py @@ -8,7 +8,7 @@ """ from paypalserversdk.api_helper import APIHelper from paypalserversdk.models.address import Address -from paypalserversdk.models.setup_token_card_experience_context import SetupTokenCardExperienceContext +from paypalserversdk.models.vault_card_experience_context import VaultCardExperienceContext class SetupTokenRequestCard(object): @@ -37,8 +37,8 @@ class SetupTokenRequestCard(object): form-controls-the-autocomplete-attribute). verification_method (VaultCardVerificationMethod): The verification method of the card. - experience_context (SetupTokenCardExperienceContext): Customizes the - Vault creation flow experience for your customers. + experience_context (VaultCardExperienceContext): A resource + representing an experience context of vault a card. """ @@ -120,7 +120,7 @@ def from_dictionary(cls, brand = dictionary.get("brand") if dictionary.get("brand") else APIHelper.SKIP billing_address = Address.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP verification_method = dictionary.get("verification_method") if dictionary.get("verification_method") else APIHelper.SKIP - experience_context = SetupTokenCardExperienceContext.from_dictionary(dictionary.get('experience_context')) if 'experience_context' in dictionary.keys() else APIHelper.SKIP + experience_context = VaultCardExperienceContext.from_dictionary(dictionary.get('experience_context')) if 'experience_context' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(name, number, diff --git a/paypalserversdk/models/setup_token_request_payment_source.py b/paypalserversdk/models/setup_token_request_payment_source.py index b76efe4..3b1ec5e 100644 --- a/paypalserversdk/models/setup_token_request_payment_source.py +++ b/paypalserversdk/models/setup_token_request_payment_source.py @@ -7,7 +7,9 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.bank_request import BankRequest from paypalserversdk.models.setup_token_request_card import SetupTokenRequestCard +from paypalserversdk.models.vault_apple_pay_request import VaultApplePayRequest from paypalserversdk.models.vault_paypal_wallet_request import VaultPaypalWalletRequest from paypalserversdk.models.vault_token_request import VaultTokenRequest from paypalserversdk.models.vault_venmo_request import VaultVenmoRequest @@ -24,10 +26,14 @@ class SetupTokenRequestPaymentSource(object): vault a Card. paypal (VaultPaypalWalletRequest): A resource representing a request to vault PayPal Wallet. - venmo (VaultVenmoRequest): The model property of type - VaultVenmoRequest. + venmo (VaultVenmoRequest): A resource representing a request to vault + Venmo. + apple_pay (VaultApplePayRequest): A resource representing a request to + vault Apple Pay. token (VaultTokenRequest): The Tokenized Payment Source representing a Request to Vault a Token. + bank (BankRequest): A Resource representing a request to vault a Bank + used for ACH Debit. """ @@ -36,21 +42,27 @@ class SetupTokenRequestPaymentSource(object): "card": 'card', "paypal": 'paypal', "venmo": 'venmo', - "token": 'token' + "apple_pay": 'apple_pay', + "token": 'token', + "bank": 'bank' } _optionals = [ 'card', 'paypal', 'venmo', + 'apple_pay', 'token', + 'bank', ] def __init__(self, card=APIHelper.SKIP, paypal=APIHelper.SKIP, venmo=APIHelper.SKIP, - token=APIHelper.SKIP): + apple_pay=APIHelper.SKIP, + token=APIHelper.SKIP, + bank=APIHelper.SKIP): """Constructor for the SetupTokenRequestPaymentSource class""" # Initialize members of the class @@ -60,8 +72,12 @@ def __init__(self, self.paypal = paypal if venmo is not APIHelper.SKIP: self.venmo = venmo + if apple_pay is not APIHelper.SKIP: + self.apple_pay = apple_pay if token is not APIHelper.SKIP: self.token = token + if bank is not APIHelper.SKIP: + self.bank = bank @classmethod def from_dictionary(cls, @@ -85,23 +101,31 @@ def from_dictionary(cls, card = SetupTokenRequestCard.from_dictionary(dictionary.get('card')) if 'card' in dictionary.keys() else APIHelper.SKIP paypal = VaultPaypalWalletRequest.from_dictionary(dictionary.get('paypal')) if 'paypal' in dictionary.keys() else APIHelper.SKIP venmo = VaultVenmoRequest.from_dictionary(dictionary.get('venmo')) if 'venmo' in dictionary.keys() else APIHelper.SKIP + apple_pay = VaultApplePayRequest.from_dictionary(dictionary.get('apple_pay')) if 'apple_pay' in dictionary.keys() else APIHelper.SKIP token = VaultTokenRequest.from_dictionary(dictionary.get('token')) if 'token' in dictionary.keys() else APIHelper.SKIP + bank = BankRequest.from_dictionary(dictionary.get('bank')) if 'bank' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(card, paypal, venmo, - token) + apple_pay, + token, + bank) def __repr__(self): return (f'{self.__class__.__name__}(' f'card={(self.card if hasattr(self, "card") else None)!r}, ' f'paypal={(self.paypal if hasattr(self, "paypal") else None)!r}, ' f'venmo={(self.venmo if hasattr(self, "venmo") else None)!r}, ' - f'token={(self.token if hasattr(self, "token") else None)!r})') + f'apple_pay={(self.apple_pay if hasattr(self, "apple_pay") else None)!r}, ' + f'token={(self.token if hasattr(self, "token") else None)!r}, ' + f'bank={(self.bank if hasattr(self, "bank") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' f'card={(self.card if hasattr(self, "card") else None)!s}, ' f'paypal={(self.paypal if hasattr(self, "paypal") else None)!s}, ' f'venmo={(self.venmo if hasattr(self, "venmo") else None)!s}, ' - f'token={(self.token if hasattr(self, "token") else None)!s})') + f'apple_pay={(self.apple_pay if hasattr(self, "apple_pay") else None)!s}, ' + f'token={(self.token if hasattr(self, "token") else None)!s}, ' + f'bank={(self.bank if hasattr(self, "bank") else None)!s})') diff --git a/paypalserversdk/models/setup_token_response.py b/paypalserversdk/models/setup_token_response.py index 2f26909..3ea7cf2 100644 --- a/paypalserversdk/models/setup_token_response.py +++ b/paypalserversdk/models/setup_token_response.py @@ -19,7 +19,9 @@ class SetupTokenResponse(object): Minimal representation of a cached setup token. Attributes: - id (str): The PayPal-generated ID for the vault token. + id (str): The PayPal-generated ID for the vaulted payment source. This + ID should be stored on the merchant's server so the saved payment + source can be used for future transactions. customer (Customer): This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. diff --git a/paypalserversdk/models/setup_token_response_payment_source.py b/paypalserversdk/models/setup_token_response_payment_source.py index 209742a..5bd531a 100644 --- a/paypalserversdk/models/setup_token_response_payment_source.py +++ b/paypalserversdk/models/setup_token_response_payment_source.py @@ -21,10 +21,10 @@ class SetupTokenResponsePaymentSource(object): Attributes: card (SetupTokenResponseCard): The model property of type SetupTokenResponseCard. - paypal (PaypalPaymentToken): The model property of type - PaypalPaymentToken. - venmo (VenmoPaymentToken): The model property of type - VenmoPaymentToken. + paypal (PaypalPaymentToken): Full representation of a PayPal Payment + Token. + venmo (VenmoPaymentToken): Full representation of a Venmo Payment + Token. """ diff --git a/paypalserversdk/models/shipment_carrier.py b/paypalserversdk/models/shipment_carrier.py index 8cd2cfb..ee18830 100644 --- a/paypalserversdk/models/shipment_carrier.py +++ b/paypalserversdk/models/shipment_carrier.py @@ -1398,6 +1398,42 @@ class ShipmentCarrier(object): UPS_CHECKER: ups-checker. WINESHIPPING: Wineshipping. SPEDISCI: Spedisci online. + FOURKITES: Fourkites. + ETONAS: Etonas. + FINMILE: Fin Mile. + UNIUNI: Uniuni. + RODONAVES: Rodonaves. + INPOST_IT: Inpost Italy. + TFORCE_FREIGHT: Tforce Freight. + RICHMOM: Rich Mom. + FRANCO: Corriere Franco. + ECPARCEL: Ecparcel. + FEDEX_CHINA: Fedex China. + GOFO_EXPRESS: Gofo Express. + SHIPBOB: Shipbob. + JERSEYPOST_ATLAS: Jersey Post Group. + CORETRAILS: Coretrails. + RHENUS_ITALY: Rhenus Logistics Italy. + JADLOG: Jadlog. + JITSU: Jitsu. + YANWEN_EXPRESS: Yanwen Express. + DASHLINK: Dashlink. + SEINO_SUPER_EXPRESS: Seino Super Express. + FLOSHIP: Floship. + METROSCG: Metro Supply Chain. + SENDPARCEL: Sendparcel. + P2P: P2p. + CN_EXPRESS: Cn Express. + CIRROTRACK: Cirro Track. + LAND_LOGISTICS: Land Logistics. + VEHO: Veho. + MEDLINE: Medline. + VDTRACK: Vdtrack. + SINO_SCM: Sino Scm. + ENUM_3PE_EXPRESS: 3pe Express. + SWIFTX: Swiftx. + SFYDEXPRESS: Sfyd Express. + TOPTRANS: Toptrans. """ DPD_RU = 'DPD_RU' @@ -4152,3 +4188,75 @@ class ShipmentCarrier(object): SPEDISCI = 'SPEDISCI' + FOURKITES = 'FOURKITES' + + ETONAS = 'ETONAS' + + FINMILE = 'FINMILE' + + UNIUNI = 'UNIUNI' + + RODONAVES = 'RODONAVES' + + INPOST_IT = 'INPOST_IT' + + TFORCE_FREIGHT = 'TFORCE_FREIGHT' + + RICHMOM = 'RICHMOM' + + FRANCO = 'FRANCO' + + ECPARCEL = 'ECPARCEL' + + FEDEX_CHINA = 'FEDEX_CHINA' + + GOFO_EXPRESS = 'GOFO_EXPRESS' + + SHIPBOB = 'SHIPBOB' + + JERSEYPOST_ATLAS = 'JERSEYPOST_ATLAS' + + CORETRAILS = 'CORETRAILS' + + RHENUS_ITALY = 'RHENUS_ITALY' + + JADLOG = 'JADLOG' + + JITSU = 'JITSU' + + YANWEN_EXPRESS = 'YANWEN_EXPRESS' + + DASHLINK = 'DASHLINK' + + SEINO_SUPER_EXPRESS = 'SEINO_SUPER_EXPRESS' + + FLOSHIP = 'FLOSHIP' + + METROSCG = 'METROSCG' + + SENDPARCEL = 'SENDPARCEL' + + P2P = 'P2P' + + CN_EXPRESS = 'CN_EXPRESS' + + CIRROTRACK = 'CIRROTRACK' + + LAND_LOGISTICS = 'LAND_LOGISTICS' + + VEHO = 'VEHO' + + MEDLINE = 'MEDLINE' + + VDTRACK = 'VDTRACK' + + SINO_SCM = 'SINO_SCM' + + ENUM_3PE_EXPRESS = '3PE_EXPRESS' + + SWIFTX = 'SWIFTX' + + SFYDEXPRESS = 'SFYDEXPRESS' + + TOPTRANS = 'TOPTRANS' + diff --git a/paypalserversdk/models/shipping_information.py b/paypalserversdk/models/shipping_information.py new file mode 100644 index 0000000..e5969eb --- /dev/null +++ b/paypalserversdk/models/shipping_information.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.simple_postal_address_coarse_grained import SimplePostalAddressCoarseGrained + + +class ShippingInformation(object): + + """Implementation of the 'Shipping Information' model. + + The shipping information. + + Attributes: + name (str): The recipient's name. + method (str): The shipping method that is associated with this order. + address (SimplePostalAddressCoarseGrained): A simple postal address + with coarse-grained fields. Do not use for an international + address. Use for backward compatibility only. Does not contain + phone. + secondary_shipping_address (SimplePostalAddressCoarseGrained): A + simple postal address with coarse-grained fields. Do not use for + an international address. Use for backward compatibility only. + Does not contain phone. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": 'name', + "method": 'method', + "address": 'address', + "secondary_shipping_address": 'secondary_shipping_address' + } + + _optionals = [ + 'name', + 'method', + 'address', + 'secondary_shipping_address', + ] + + def __init__(self, + name=APIHelper.SKIP, + method=APIHelper.SKIP, + address=APIHelper.SKIP, + secondary_shipping_address=APIHelper.SKIP): + """Constructor for the ShippingInformation class""" + + # Initialize members of the class + if name is not APIHelper.SKIP: + self.name = name + if method is not APIHelper.SKIP: + self.method = method + if address is not APIHelper.SKIP: + self.address = address + if secondary_shipping_address is not APIHelper.SKIP: + self.secondary_shipping_address = secondary_shipping_address + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP + method = dictionary.get("method") if dictionary.get("method") else APIHelper.SKIP + address = SimplePostalAddressCoarseGrained.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP + secondary_shipping_address = SimplePostalAddressCoarseGrained.from_dictionary(dictionary.get('secondary_shipping_address')) if 'secondary_shipping_address' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(name, + method, + address, + secondary_shipping_address) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'method={(self.method if hasattr(self, "method") else None)!r}, ' + f'address={(self.address if hasattr(self, "address") else None)!r}, ' + f'secondary_shipping_address={(self.secondary_shipping_address if hasattr(self, "secondary_shipping_address") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'method={(self.method if hasattr(self, "method") else None)!s}, ' + f'address={(self.address if hasattr(self, "address") else None)!s}, ' + f'secondary_shipping_address={(self.secondary_shipping_address if hasattr(self, "secondary_shipping_address") else None)!s})') diff --git a/paypalserversdk/models/shipping_options_purchase_unit.py b/paypalserversdk/models/shipping_options_purchase_unit.py deleted file mode 100644 index 4e2c05e..0000000 --- a/paypalserversdk/models/shipping_options_purchase_unit.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown -from paypalserversdk.models.item import Item -from paypalserversdk.models.shipping_option import ShippingOption - - -class ShippingOptionsPurchaseUnit(object): - - """Implementation of the 'Shipping Options Purchase Unit' model. - - This would contain shipping option and amount data at purchase unit level. - - Attributes: - reference_id (str): The API caller-provided external ID for the - purchase unit. Required for multiple purchase units when you must - update the order through `PATCH`. If you omit this value and the - order contains only one purchase unit, PayPal sets this value to - `default`. Note: If there are multiple purchase units, - reference_id is required for each purchase unit. - amount (AmountWithBreakdown): The total order amount with an optional - breakdown that provides details, such as the total item amount, - total tax amount, shipping, handling, insurance, and discounts, if - any. If you specify `amount.breakdown`, the amount equals - `item_total` plus `tax_total` plus `shipping` plus `handling` plus - `insurance` minus `shipping_discount` minus discount. The amount - must be a positive number. For listed of supported currencies and - decimal precision, see the PayPal REST APIs Currency Codes. - items (List[Item]): An array of items that the customer purchases from - the merchant. - shipping_options (List[ShippingOption]): An array of shipping options - that the payee or merchant offers to the payer to ship or pick up - their items. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "reference_id": 'reference_id', - "amount": 'amount', - "items": 'items', - "shipping_options": 'shipping_options' - } - - _optionals = [ - 'reference_id', - 'amount', - 'items', - 'shipping_options', - ] - - def __init__(self, - reference_id=APIHelper.SKIP, - amount=APIHelper.SKIP, - items=APIHelper.SKIP, - shipping_options=APIHelper.SKIP): - """Constructor for the ShippingOptionsPurchaseUnit class""" - - # Initialize members of the class - if reference_id is not APIHelper.SKIP: - self.reference_id = reference_id - if amount is not APIHelper.SKIP: - self.amount = amount - if items is not APIHelper.SKIP: - self.items = items - if shipping_options is not APIHelper.SKIP: - self.shipping_options = shipping_options - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - reference_id = dictionary.get("reference_id") if dictionary.get("reference_id") else APIHelper.SKIP - amount = AmountWithBreakdown.from_dictionary(dictionary.get('amount')) if 'amount' in dictionary.keys() else APIHelper.SKIP - items = None - if dictionary.get('items') is not None: - items = [Item.from_dictionary(x) for x in dictionary.get('items')] - else: - items = APIHelper.SKIP - shipping_options = None - if dictionary.get('shipping_options') is not None: - shipping_options = [ShippingOption.from_dictionary(x) for x in dictionary.get('shipping_options')] - else: - shipping_options = APIHelper.SKIP - # Return an object of this model - return cls(reference_id, - amount, - items, - shipping_options) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reference_id={(self.reference_id if hasattr(self, "reference_id") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'items={(self.items if hasattr(self, "items") else None)!r}, ' - f'shipping_options={(self.shipping_options if hasattr(self, "shipping_options") else None)!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'reference_id={(self.reference_id if hasattr(self, "reference_id") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'items={(self.items if hasattr(self, "items") else None)!s}, ' - f'shipping_options={(self.shipping_options if hasattr(self, "shipping_options") else None)!s})') diff --git a/paypalserversdk/models/shipping_with_tracking_details.py b/paypalserversdk/models/shipping_with_tracking_details.py index 10cfac0..900330f 100644 --- a/paypalserversdk/models/shipping_with_tracking_details.py +++ b/paypalserversdk/models/shipping_with_tracking_details.py @@ -9,7 +9,7 @@ from paypalserversdk.api_helper import APIHelper from paypalserversdk.models.address import Address from paypalserversdk.models.order_tracker_response import OrderTrackerResponse -from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_number_with_optional_country_code import PhoneNumberWithOptionalCountryCode from paypalserversdk.models.shipping_name import ShippingName from paypalserversdk.models.shipping_option import ShippingOption @@ -18,17 +18,17 @@ class ShippingWithTrackingDetails(object): """Implementation of the 'Shipping With Tracking Details' model. - The order shipping details. - Attributes: + trackers (List[OrderTrackerResponse]): An array of trackers for a + transaction. name (ShippingName): The name of the party. email_address (str): The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists. - phone_number (PhoneNumberWithCountryCode): The phone number in its - canonical international [E.164 numbering plan + phone_number (PhoneNumberWithOptionalCountryCode): The phone number in + its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). mtype (FulfillmentType): A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or @@ -42,43 +42,43 @@ class ShippingWithTrackingDetails(object): form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling- form-controls-the-autocomplete-attribute). - trackers (List[OrderTrackerResponse]): An array of trackers for a - transaction. """ # Create a mapping from Model property names to API property names _names = { + "trackers": 'trackers', "name": 'name', "email_address": 'email_address', "phone_number": 'phone_number', "mtype": 'type', "options": 'options', - "address": 'address', - "trackers": 'trackers' + "address": 'address' } _optionals = [ + 'trackers', 'name', 'email_address', 'phone_number', 'mtype', 'options', 'address', - 'trackers', ] def __init__(self, + trackers=APIHelper.SKIP, name=APIHelper.SKIP, email_address=APIHelper.SKIP, phone_number=APIHelper.SKIP, mtype=APIHelper.SKIP, options=APIHelper.SKIP, - address=APIHelper.SKIP, - trackers=APIHelper.SKIP): + address=APIHelper.SKIP): """Constructor for the ShippingWithTrackingDetails class""" # Initialize members of the class + if trackers is not APIHelper.SKIP: + self.trackers = trackers if name is not APIHelper.SKIP: self.name = name if email_address is not APIHelper.SKIP: @@ -91,8 +91,6 @@ def __init__(self, self.options = options if address is not APIHelper.SKIP: self.address = address - if trackers is not APIHelper.SKIP: - self.trackers = trackers @classmethod def from_dictionary(cls, @@ -113,9 +111,14 @@ def from_dictionary(cls, return None # Extract variables from the dictionary + trackers = None + if dictionary.get('trackers') is not None: + trackers = [OrderTrackerResponse.from_dictionary(x) for x in dictionary.get('trackers')] + else: + trackers = APIHelper.SKIP name = ShippingName.from_dictionary(dictionary.get('name')) if 'name' in dictionary.keys() else APIHelper.SKIP email_address = dictionary.get("email_address") if dictionary.get("email_address") else APIHelper.SKIP - phone_number = PhoneNumberWithCountryCode.from_dictionary(dictionary.get('phone_number')) if 'phone_number' in dictionary.keys() else APIHelper.SKIP + phone_number = PhoneNumberWithOptionalCountryCode.from_dictionary(dictionary.get('phone_number')) if 'phone_number' in dictionary.keys() else APIHelper.SKIP mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP options = None if dictionary.get('options') is not None: @@ -123,36 +126,31 @@ def from_dictionary(cls, else: options = APIHelper.SKIP address = Address.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP - trackers = None - if dictionary.get('trackers') is not None: - trackers = [OrderTrackerResponse.from_dictionary(x) for x in dictionary.get('trackers')] - else: - trackers = APIHelper.SKIP # Return an object of this model - return cls(name, + return cls(trackers, + name, email_address, phone_number, mtype, options, - address, - trackers) + address) def __repr__(self): return (f'{self.__class__.__name__}(' + f'trackers={(self.trackers if hasattr(self, "trackers") else None)!r}, ' f'name={(self.name if hasattr(self, "name") else None)!r}, ' f'email_address={(self.email_address if hasattr(self, "email_address") else None)!r}, ' f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!r}, ' f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' f'options={(self.options if hasattr(self, "options") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'trackers={(self.trackers if hasattr(self, "trackers") else None)!r})') + f'address={(self.address if hasattr(self, "address") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' + f'trackers={(self.trackers if hasattr(self, "trackers") else None)!s}, ' f'name={(self.name if hasattr(self, "name") else None)!s}, ' f'email_address={(self.email_address if hasattr(self, "email_address") else None)!s}, ' f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!s}, ' f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' f'options={(self.options if hasattr(self, "options") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'trackers={(self.trackers if hasattr(self, "trackers") else None)!s})') + f'address={(self.address if hasattr(self, "address") else None)!s})') diff --git a/paypalserversdk/models/simple_postal_address_coarse_grained.py b/paypalserversdk/models/simple_postal_address_coarse_grained.py new file mode 100644 index 0000000..74a7f44 --- /dev/null +++ b/paypalserversdk/models/simple_postal_address_coarse_grained.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class SimplePostalAddressCoarseGrained(object): + + """Implementation of the 'Simple Postal Address (Coarse-Grained)' model. + + A simple postal address with coarse-grained fields. Do not use for an + international address. Use for backward compatibility only. Does not + contain phone. + + Attributes: + line_1 (str): The first line of the address. For example, number or + street. + line_2 (str): The second line of the address. For example, suite or + apartment number. + city (str): The city name. + state (str): The [code](/docs/api/reference/state-codes/) for a US + state or the equivalent for other countries. Required for + transactions if the address is in one of these countries: + [Argentina](/docs/api/reference/state-codes/#argentina), + [Brazil](/docs/api/reference/state-codes/#brazil), + [Canada](/docs/api/reference/state-codes/#canada), + [China](/docs/api/reference/state-codes/#china), + [India](/docs/api/reference/state-codes/#india), + [Italy](/docs/api/reference/state-codes/#italy), + [Japan](/docs/api/reference/state-codes/#japan), + [Mexico](/docs/api/reference/state-codes/#mexico), + [Thailand](/docs/api/reference/state-codes/#thailand), or [United + States](/docs/api/reference/state-codes/#usa). Maximum length is + 40 single-byte characters. + country_code (str): The [two-character ISO 3166-1 + code](/docs/integration/direct/rest/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. + postal_code (str): 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). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "line_1": 'line1', + "city": 'city', + "country_code": 'country_code', + "line_2": 'line2', + "state": 'state', + "postal_code": 'postal_code' + } + + _optionals = [ + 'line_2', + 'state', + 'postal_code', + ] + + def __init__(self, + line_1=None, + city=None, + country_code=None, + line_2=APIHelper.SKIP, + state=APIHelper.SKIP, + postal_code=APIHelper.SKIP): + """Constructor for the SimplePostalAddressCoarseGrained class""" + + # Initialize members of the class + self.line_1 = line_1 + if line_2 is not APIHelper.SKIP: + self.line_2 = line_2 + self.city = city + if state is not APIHelper.SKIP: + self.state = state + self.country_code = country_code + if postal_code is not APIHelper.SKIP: + self.postal_code = postal_code + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + line_1 = dictionary.get("line1") if dictionary.get("line1") else None + city = dictionary.get("city") if dictionary.get("city") else None + country_code = dictionary.get("country_code") if dictionary.get("country_code") else None + line_2 = dictionary.get("line2") if dictionary.get("line2") else APIHelper.SKIP + state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP + postal_code = dictionary.get("postal_code") if dictionary.get("postal_code") else APIHelper.SKIP + # Return an object of this model + return cls(line_1, + city, + country_code, + line_2, + state, + postal_code) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'line_1={self.line_1!r}, ' + f'line_2={(self.line_2 if hasattr(self, "line_2") else None)!r}, ' + f'city={self.city!r}, ' + f'state={(self.state if hasattr(self, "state") else None)!r}, ' + f'country_code={self.country_code!r}, ' + f'postal_code={(self.postal_code if hasattr(self, "postal_code") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'line_1={self.line_1!s}, ' + f'line_2={(self.line_2 if hasattr(self, "line_2") else None)!s}, ' + f'city={self.city!s}, ' + f'state={(self.state if hasattr(self, "state") else None)!s}, ' + f'country_code={self.country_code!s}, ' + f'postal_code={(self.postal_code if hasattr(self, "postal_code") else None)!s})') diff --git a/paypalserversdk/models/store_information.py b/paypalserversdk/models/store_information.py new file mode 100644 index 0000000..b5573f3 --- /dev/null +++ b/paypalserversdk/models/store_information.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class StoreInformation(object): + + """Implementation of the 'Store Information' model. + + The store information. + + Attributes: + store_id (str): The ID of a store for a merchant in the system of + record. + terminal_id (str): The terminal ID for the checkout stand in a + merchant store. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "store_id": 'store_id', + "terminal_id": 'terminal_id' + } + + _optionals = [ + 'store_id', + 'terminal_id', + ] + + def __init__(self, + store_id=APIHelper.SKIP, + terminal_id=APIHelper.SKIP): + """Constructor for the StoreInformation class""" + + # Initialize members of the class + if store_id is not APIHelper.SKIP: + self.store_id = store_id + if terminal_id is not APIHelper.SKIP: + self.terminal_id = terminal_id + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + store_id = dictionary.get("store_id") if dictionary.get("store_id") else APIHelper.SKIP + terminal_id = dictionary.get("terminal_id") if dictionary.get("terminal_id") else APIHelper.SKIP + # Return an object of this model + return cls(store_id, + terminal_id) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'store_id={(self.store_id if hasattr(self, "store_id") else None)!r}, ' + f'terminal_id={(self.terminal_id if hasattr(self, "terminal_id") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'store_id={(self.store_id if hasattr(self, "store_id") else None)!s}, ' + f'terminal_id={(self.terminal_id if hasattr(self, "terminal_id") else None)!s})') diff --git a/paypalserversdk/models/stored_payment_source.py b/paypalserversdk/models/stored_payment_source.py index edd95b2..bffe4dd 100644 --- a/paypalserversdk/models/stored_payment_source.py +++ b/paypalserversdk/models/stored_payment_source.py @@ -7,7 +7,7 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.network_transaction_reference import NetworkTransactionReference +from paypalserversdk.models.network_transaction import NetworkTransaction class StoredPaymentSource(object): @@ -33,9 +33,8 @@ class StoredPaymentSource(object): usage (StoredPaymentSourceUsageType): Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file). - previous_network_transaction_reference (NetworkTransactionReference): - Reference values used by the card network to identify a - transaction. + previous_network_transaction_reference (NetworkTransaction): Reference + values used by the card network to identify a transaction. """ @@ -88,7 +87,7 @@ def from_dictionary(cls, payment_initiator = dictionary.get("payment_initiator") if dictionary.get("payment_initiator") else None payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else None usage = dictionary.get("usage") if dictionary.get("usage") else 'DERIVED' - previous_network_transaction_reference = NetworkTransactionReference.from_dictionary(dictionary.get('previous_network_transaction_reference')) if 'previous_network_transaction_reference' in dictionary.keys() else APIHelper.SKIP + previous_network_transaction_reference = NetworkTransaction.from_dictionary(dictionary.get('previous_network_transaction_reference')) if 'previous_network_transaction_reference' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(payment_initiator, payment_type, diff --git a/paypalserversdk/models/subscriber.py b/paypalserversdk/models/subscriber.py new file mode 100644 index 0000000..f4d85de --- /dev/null +++ b/paypalserversdk/models/subscriber.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.name import Name +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.subscription_payment_source_response import SubscriptionPaymentSourceResponse + + +class Subscriber(object): + + """Implementation of the 'Subscriber' model. + + The subscriber response information. + + Attributes: + name (Name): The name of the party. + shipping_address (ShippingDetails): The shipping details. + payment_source (SubscriptionPaymentSourceResponse): The payment source + used to fund the payment. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": 'name', + "shipping_address": 'shipping_address', + "payment_source": 'payment_source' + } + + _optionals = [ + 'name', + 'shipping_address', + 'payment_source', + ] + + def __init__(self, + name=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + payment_source=APIHelper.SKIP): + """Constructor for the Subscriber class""" + + # Initialize members of the class + if name is not APIHelper.SKIP: + self.name = name + if shipping_address is not APIHelper.SKIP: + self.shipping_address = shipping_address + if payment_source is not APIHelper.SKIP: + self.payment_source = payment_source + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name = Name.from_dictionary(dictionary.get('name')) if 'name' in dictionary.keys() else APIHelper.SKIP + shipping_address = ShippingDetails.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP + payment_source = SubscriptionPaymentSourceResponse.from_dictionary(dictionary.get('payment_source')) if 'payment_source' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(name, + shipping_address, + payment_source) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' + f'payment_source={(self.payment_source if hasattr(self, "payment_source") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' + f'payment_source={(self.payment_source if hasattr(self, "payment_source") else None)!s})') diff --git a/paypalserversdk/models/subscriber_request.py b/paypalserversdk/models/subscriber_request.py new file mode 100644 index 0000000..c575878 --- /dev/null +++ b/paypalserversdk/models/subscriber_request.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.subscription_payment_source import SubscriptionPaymentSource + + +class SubscriberRequest(object): + + """Implementation of the 'Subscriber Request' model. + + The subscriber request information . + + Attributes: + name (Name): The name of the party. + phone (PhoneWithType): The phone information. + shipping_address (ShippingDetails): The shipping details. + payment_source (SubscriptionPaymentSource): The payment source + definition. To be eligible to create subscription using debit or + credit card, you will need to sign up here + (https://www.paypal.com/bizsignup/entry/product/ppcp). Please + note, its available only for non-3DS cards and for merchants in US + and AU regions. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": 'name', + "phone": 'phone', + "shipping_address": 'shipping_address', + "payment_source": 'payment_source' + } + + _optionals = [ + 'name', + 'phone', + 'shipping_address', + 'payment_source', + ] + + def __init__(self, + name=APIHelper.SKIP, + phone=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + payment_source=APIHelper.SKIP): + """Constructor for the SubscriberRequest class""" + + # Initialize members of the class + if name is not APIHelper.SKIP: + self.name = name + if phone is not APIHelper.SKIP: + self.phone = phone + if shipping_address is not APIHelper.SKIP: + self.shipping_address = shipping_address + if payment_source is not APIHelper.SKIP: + self.payment_source = payment_source + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name = Name.from_dictionary(dictionary.get('name')) if 'name' in dictionary.keys() else APIHelper.SKIP + phone = PhoneWithType.from_dictionary(dictionary.get('phone')) if 'phone' in dictionary.keys() else APIHelper.SKIP + shipping_address = ShippingDetails.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP + payment_source = SubscriptionPaymentSource.from_dictionary(dictionary.get('payment_source')) if 'payment_source' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(name, + phone, + shipping_address, + payment_source) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' + f'payment_source={(self.payment_source if hasattr(self, "payment_source") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' + f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' + f'payment_source={(self.payment_source if hasattr(self, "payment_source") else None)!s})') diff --git a/paypalserversdk/models/subscription.py b/paypalserversdk/models/subscription.py new file mode 100644 index 0000000..9d09f45 --- /dev/null +++ b/paypalserversdk/models/subscription.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.money import Money +from paypalserversdk.models.plan_details import PlanDetails +from paypalserversdk.models.subscriber import Subscriber +from paypalserversdk.models.subscription_billing_information import SubscriptionBillingInformation + + +class Subscription(object): + + """Implementation of the 'Subscription' model. + + The subscription details. + + Attributes: + id (str): The PayPal-generated ID for the subscription. + plan_id (str): The ID of the plan. + start_time (str): 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. + quantity (str): The quantity of the product in the subscription. + shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + subscriber (Subscriber): The subscriber response information. + billing_info (SubscriptionBillingInformation): The billing details for + the subscription. If the subscription was or is active, these + fields are populated. + create_time (str): 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. + update_time (str): 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. + custom_id (str): The custom id for the subscription. Can be invoice id. + plan_overridden (bool): Indicates whether the subscription has + overridden any plan attributes. + plan (PlanDetails): The plan details. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/docs/api/reference/api-responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": 'id', + "plan_id": 'plan_id', + "start_time": 'start_time', + "quantity": 'quantity', + "shipping_amount": 'shipping_amount', + "subscriber": 'subscriber', + "billing_info": 'billing_info', + "create_time": 'create_time', + "update_time": 'update_time', + "custom_id": 'custom_id', + "plan_overridden": 'plan_overridden', + "plan": 'plan', + "links": 'links' + } + + _optionals = [ + 'id', + 'plan_id', + 'start_time', + 'quantity', + 'shipping_amount', + 'subscriber', + 'billing_info', + 'create_time', + 'update_time', + 'custom_id', + 'plan_overridden', + 'plan', + 'links', + ] + + def __init__(self, + id=APIHelper.SKIP, + plan_id=APIHelper.SKIP, + start_time=APIHelper.SKIP, + quantity=APIHelper.SKIP, + shipping_amount=APIHelper.SKIP, + subscriber=APIHelper.SKIP, + billing_info=APIHelper.SKIP, + create_time=APIHelper.SKIP, + update_time=APIHelper.SKIP, + custom_id=APIHelper.SKIP, + plan_overridden=APIHelper.SKIP, + plan=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the Subscription class""" + + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if plan_id is not APIHelper.SKIP: + self.plan_id = plan_id + if start_time is not APIHelper.SKIP: + self.start_time = start_time + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if shipping_amount is not APIHelper.SKIP: + self.shipping_amount = shipping_amount + if subscriber is not APIHelper.SKIP: + self.subscriber = subscriber + if billing_info is not APIHelper.SKIP: + self.billing_info = billing_info + if create_time is not APIHelper.SKIP: + self.create_time = create_time + if update_time is not APIHelper.SKIP: + self.update_time = update_time + if custom_id is not APIHelper.SKIP: + self.custom_id = custom_id + if plan_overridden is not APIHelper.SKIP: + self.plan_overridden = plan_overridden + if plan is not APIHelper.SKIP: + self.plan = plan + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP + plan_id = dictionary.get("plan_id") if dictionary.get("plan_id") else APIHelper.SKIP + start_time = dictionary.get("start_time") if dictionary.get("start_time") else APIHelper.SKIP + quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP + shipping_amount = Money.from_dictionary(dictionary.get('shipping_amount')) if 'shipping_amount' in dictionary.keys() else APIHelper.SKIP + subscriber = Subscriber.from_dictionary(dictionary.get('subscriber')) if 'subscriber' in dictionary.keys() else APIHelper.SKIP + billing_info = SubscriptionBillingInformation.from_dictionary(dictionary.get('billing_info')) if 'billing_info' in dictionary.keys() else APIHelper.SKIP + create_time = dictionary.get("create_time") if dictionary.get("create_time") else APIHelper.SKIP + update_time = dictionary.get("update_time") if dictionary.get("update_time") else APIHelper.SKIP + custom_id = dictionary.get("custom_id") if dictionary.get("custom_id") else APIHelper.SKIP + plan_overridden = dictionary.get("plan_overridden") if "plan_overridden" in dictionary.keys() else APIHelper.SKIP + plan = PlanDetails.from_dictionary(dictionary.get('plan')) if 'plan' in dictionary.keys() else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(id, + plan_id, + start_time, + quantity, + shipping_amount, + subscriber, + billing_info, + create_time, + update_time, + custom_id, + plan_overridden, + plan, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!r}, ' + f'plan_id={(self.plan_id if hasattr(self, "plan_id") else None)!r}, ' + f'start_time={(self.start_time if hasattr(self, "start_time") else None)!r}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!r}, ' + f'subscriber={(self.subscriber if hasattr(self, "subscriber") else None)!r}, ' + f'billing_info={(self.billing_info if hasattr(self, "billing_info") else None)!r}, ' + f'create_time={(self.create_time if hasattr(self, "create_time") else None)!r}, ' + f'update_time={(self.update_time if hasattr(self, "update_time") else None)!r}, ' + f'custom_id={(self.custom_id if hasattr(self, "custom_id") else None)!r}, ' + f'plan_overridden={(self.plan_overridden if hasattr(self, "plan_overridden") else None)!r}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!s}, ' + f'plan_id={(self.plan_id if hasattr(self, "plan_id") else None)!s}, ' + f'start_time={(self.start_time if hasattr(self, "start_time") else None)!s}, ' + f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!s}, ' + f'subscriber={(self.subscriber if hasattr(self, "subscriber") else None)!s}, ' + f'billing_info={(self.billing_info if hasattr(self, "billing_info") else None)!s}, ' + f'create_time={(self.create_time if hasattr(self, "create_time") else None)!s}, ' + f'update_time={(self.update_time if hasattr(self, "update_time") else None)!s}, ' + f'custom_id={(self.custom_id if hasattr(self, "custom_id") else None)!s}, ' + f'plan_overridden={(self.plan_overridden if hasattr(self, "plan_overridden") else None)!s}, ' + f'plan={(self.plan if hasattr(self, "plan") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/subscription_amount_with_breakdown.py b/paypalserversdk/models/subscription_amount_with_breakdown.py new file mode 100644 index 0000000..11dfd43 --- /dev/null +++ b/paypalserversdk/models/subscription_amount_with_breakdown.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class SubscriptionAmountWithBreakdown(object): + + """Implementation of the 'Subscription Amount with Breakdown' model. + + The breakdown details for the amount. Includes the gross, tax, fee, and + shipping amounts. + + Attributes: + gross_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + total_item_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + fee_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + tax_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + net_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "gross_amount": 'gross_amount', + "total_item_amount": 'total_item_amount', + "fee_amount": 'fee_amount', + "shipping_amount": 'shipping_amount', + "tax_amount": 'tax_amount', + "net_amount": 'net_amount' + } + + _optionals = [ + 'total_item_amount', + 'fee_amount', + 'shipping_amount', + 'tax_amount', + 'net_amount', + ] + + def __init__(self, + gross_amount=None, + total_item_amount=APIHelper.SKIP, + fee_amount=APIHelper.SKIP, + shipping_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + net_amount=APIHelper.SKIP): + """Constructor for the SubscriptionAmountWithBreakdown class""" + + # Initialize members of the class + self.gross_amount = gross_amount + if total_item_amount is not APIHelper.SKIP: + self.total_item_amount = total_item_amount + if fee_amount is not APIHelper.SKIP: + self.fee_amount = fee_amount + if shipping_amount is not APIHelper.SKIP: + self.shipping_amount = shipping_amount + if tax_amount is not APIHelper.SKIP: + self.tax_amount = tax_amount + if net_amount is not APIHelper.SKIP: + self.net_amount = net_amount + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + gross_amount = Money.from_dictionary(dictionary.get('gross_amount')) if dictionary.get('gross_amount') else None + total_item_amount = Money.from_dictionary(dictionary.get('total_item_amount')) if 'total_item_amount' in dictionary.keys() else APIHelper.SKIP + fee_amount = Money.from_dictionary(dictionary.get('fee_amount')) if 'fee_amount' in dictionary.keys() else APIHelper.SKIP + shipping_amount = Money.from_dictionary(dictionary.get('shipping_amount')) if 'shipping_amount' in dictionary.keys() else APIHelper.SKIP + tax_amount = Money.from_dictionary(dictionary.get('tax_amount')) if 'tax_amount' in dictionary.keys() else APIHelper.SKIP + net_amount = Money.from_dictionary(dictionary.get('net_amount')) if 'net_amount' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(gross_amount, + total_item_amount, + fee_amount, + shipping_amount, + tax_amount, + net_amount) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'gross_amount={self.gross_amount!r}, ' + f'total_item_amount={(self.total_item_amount if hasattr(self, "total_item_amount") else None)!r}, ' + f'fee_amount={(self.fee_amount if hasattr(self, "fee_amount") else None)!r}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!r}, ' + f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' + f'net_amount={(self.net_amount if hasattr(self, "net_amount") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'gross_amount={self.gross_amount!s}, ' + f'total_item_amount={(self.total_item_amount if hasattr(self, "total_item_amount") else None)!s}, ' + f'fee_amount={(self.fee_amount if hasattr(self, "fee_amount") else None)!s}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!s}, ' + f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' + f'net_amount={(self.net_amount if hasattr(self, "net_amount") else None)!s})') diff --git a/paypalserversdk/models/subscription_application_context.py b/paypalserversdk/models/subscription_application_context.py new file mode 100644 index 0000000..c37cd25 --- /dev/null +++ b/paypalserversdk/models/subscription_application_context.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.payment_method import PaymentMethod + + +class SubscriptionApplicationContext(object): + + """Implementation of the 'Subscription Application Context' model. + + The application context, which customizes the payer experience during the + subscription approval process with PayPal. + + Attributes: + brand_name (str): The label that overrides the business name in the + PayPal account on the PayPal site. + locale (str): The BCP 47-formatted locale of pages that the PayPal + payment experience shows. PayPal supports a five-character code. + For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, + `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. + shipping_preference (ExperienceContextShippingPreference): The + location from which the shipping address is derived. + user_action (ApplicationContextUserAction): Configures the label name + to `Continue` or `Subscribe Now` for subscription consent + experience. + payment_method (PaymentMethod): The customer and merchant payment + preferences. + return_url (str): The URL where the customer is redirected after the + customer approves the payment. + cancel_url (str): The URL where the customer is redirected after the + customer cancels the payment. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "return_url": 'return_url', + "cancel_url": 'cancel_url', + "brand_name": 'brand_name', + "locale": 'locale', + "shipping_preference": 'shipping_preference', + "user_action": 'user_action', + "payment_method": 'payment_method' + } + + _optionals = [ + 'brand_name', + 'locale', + 'shipping_preference', + 'user_action', + 'payment_method', + ] + + def __init__(self, + return_url=None, + cancel_url=None, + brand_name=APIHelper.SKIP, + locale=APIHelper.SKIP, + shipping_preference='GET_FROM_FILE', + user_action='SUBSCRIBE_NOW', + payment_method=APIHelper.SKIP): + """Constructor for the SubscriptionApplicationContext class""" + + # Initialize members of the class + if brand_name is not APIHelper.SKIP: + self.brand_name = brand_name + if locale is not APIHelper.SKIP: + self.locale = locale + self.shipping_preference = shipping_preference + self.user_action = user_action + if payment_method is not APIHelper.SKIP: + self.payment_method = payment_method + self.return_url = return_url + self.cancel_url = cancel_url + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + return_url = dictionary.get("return_url") if dictionary.get("return_url") else None + cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else None + brand_name = dictionary.get("brand_name") if dictionary.get("brand_name") else APIHelper.SKIP + locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP + shipping_preference = dictionary.get("shipping_preference") if dictionary.get("shipping_preference") else 'GET_FROM_FILE' + user_action = dictionary.get("user_action") if dictionary.get("user_action") else 'SUBSCRIBE_NOW' + payment_method = PaymentMethod.from_dictionary(dictionary.get('payment_method')) if 'payment_method' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(return_url, + cancel_url, + brand_name, + locale, + shipping_preference, + user_action, + payment_method) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!r}, ' + f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' + f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!r}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!r}, ' + f'payment_method={(self.payment_method if hasattr(self, "payment_method") else None)!r}, ' + f'return_url={self.return_url!r}, ' + f'cancel_url={self.cancel_url!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!s}, ' + f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' + f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!s}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!s}, ' + f'payment_method={(self.payment_method if hasattr(self, "payment_method") else None)!s}, ' + f'return_url={self.return_url!s}, ' + f'cancel_url={self.cancel_url!s})') diff --git a/paypalserversdk/models/subscription_billing_cycle.py b/paypalserversdk/models/subscription_billing_cycle.py new file mode 100644 index 0000000..7052215 --- /dev/null +++ b/paypalserversdk/models/subscription_billing_cycle.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.frequency import Frequency +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme + + +class SubscriptionBillingCycle(object): + + """Implementation of the 'Subscription Billing Cycle' model. + + The billing cycle details. + + Attributes: + pricing_scheme (SubscriptionPricingScheme): The pricing scheme details. + frequency (Frequency): The frequency of the billing cycle. + tenure_type (TenureType): The tenure type of the billing cycle. In + case of a plan having trial cycle, only 2 trial cycles are allowed + per plan. + sequence (int): The order in which this cycle is to run among other + billing cycles. For example, a trial billing cycle has a + `sequence` of `1` while a regular billing cycle has a `sequence` + of `2`, so that trial cycle runs before the regular cycle. + total_cycles (int): The number of times this billing cycle gets + executed. Trial billing cycles can only be executed a finite + number of times (value between 1 and 999 for total_cycles). + Regular billing cycles can be executed infinite times (value of 0 + for total_cycles) or a finite number of times (value between 1 and + 999 for total_cycles). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "frequency": 'frequency', + "tenure_type": 'tenure_type', + "sequence": 'sequence', + "pricing_scheme": 'pricing_scheme', + "total_cycles": 'total_cycles' + } + + _optionals = [ + 'pricing_scheme', + 'total_cycles', + ] + + def __init__(self, + frequency=None, + tenure_type=None, + sequence=None, + pricing_scheme=APIHelper.SKIP, + total_cycles=1): + """Constructor for the SubscriptionBillingCycle class""" + + # Initialize members of the class + if pricing_scheme is not APIHelper.SKIP: + self.pricing_scheme = pricing_scheme + self.frequency = frequency + self.tenure_type = tenure_type + self.sequence = sequence + self.total_cycles = total_cycles + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + frequency = Frequency.from_dictionary(dictionary.get('frequency')) if dictionary.get('frequency') else None + tenure_type = dictionary.get("tenure_type") if dictionary.get("tenure_type") else None + sequence = dictionary.get("sequence") if dictionary.get("sequence") else None + pricing_scheme = SubscriptionPricingScheme.from_dictionary(dictionary.get('pricing_scheme')) if 'pricing_scheme' in dictionary.keys() else APIHelper.SKIP + total_cycles = dictionary.get("total_cycles") if dictionary.get("total_cycles") else 1 + # Return an object of this model + return cls(frequency, + tenure_type, + sequence, + pricing_scheme, + total_cycles) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' + f'frequency={self.frequency!r}, ' + f'tenure_type={self.tenure_type!r}, ' + f'sequence={self.sequence!r}, ' + f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' + f'frequency={self.frequency!s}, ' + f'tenure_type={self.tenure_type!s}, ' + f'sequence={self.sequence!s}, ' + f'total_cycles={(self.total_cycles if hasattr(self, "total_cycles") else None)!s})') diff --git a/paypalserversdk/models/subscription_billing_information.py b/paypalserversdk/models/subscription_billing_information.py new file mode 100644 index 0000000..b22a6e6 --- /dev/null +++ b/paypalserversdk/models/subscription_billing_information.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.cycle_execution import CycleExecution +from paypalserversdk.models.failed_payment_details import FailedPaymentDetails +from paypalserversdk.models.last_payment_details import LastPaymentDetails +from paypalserversdk.models.money import Money + + +class SubscriptionBillingInformation(object): + + """Implementation of the 'Subscription Billing Information' model. + + The billing details for the subscription. If the subscription was or is + active, these fields are populated. + + Attributes: + outstanding_balance (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + cycle_executions (List[CycleExecution]): The trial and regular billing + executions. + last_payment (LastPaymentDetails): The details for the last payment. + next_billing_time (str): 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. + final_payment_time (str): 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. + failed_payments_count (int): The number of consecutive payment + failures. Resets to `0` after a successful payment. If this + reaches the `payment_failure_threshold` value, the subscription + updates to the `SUSPENDED` state. + last_failed_payment (FailedPaymentDetails): The details for the failed + payment of the subscription. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "outstanding_balance": 'outstanding_balance', + "failed_payments_count": 'failed_payments_count', + "cycle_executions": 'cycle_executions', + "last_payment": 'last_payment', + "next_billing_time": 'next_billing_time', + "final_payment_time": 'final_payment_time', + "last_failed_payment": 'last_failed_payment' + } + + _optionals = [ + 'cycle_executions', + 'last_payment', + 'next_billing_time', + 'final_payment_time', + 'last_failed_payment', + ] + + def __init__(self, + outstanding_balance=None, + failed_payments_count=None, + cycle_executions=APIHelper.SKIP, + last_payment=APIHelper.SKIP, + next_billing_time=APIHelper.SKIP, + final_payment_time=APIHelper.SKIP, + last_failed_payment=APIHelper.SKIP): + """Constructor for the SubscriptionBillingInformation class""" + + # Initialize members of the class + self.outstanding_balance = outstanding_balance + if cycle_executions is not APIHelper.SKIP: + self.cycle_executions = cycle_executions + if last_payment is not APIHelper.SKIP: + self.last_payment = last_payment + if next_billing_time is not APIHelper.SKIP: + self.next_billing_time = next_billing_time + if final_payment_time is not APIHelper.SKIP: + self.final_payment_time = final_payment_time + self.failed_payments_count = failed_payments_count + if last_failed_payment is not APIHelper.SKIP: + self.last_failed_payment = last_failed_payment + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + outstanding_balance = Money.from_dictionary(dictionary.get('outstanding_balance')) if dictionary.get('outstanding_balance') else None + failed_payments_count = dictionary.get("failed_payments_count") if dictionary.get("failed_payments_count") else None + cycle_executions = None + if dictionary.get('cycle_executions') is not None: + cycle_executions = [CycleExecution.from_dictionary(x) for x in dictionary.get('cycle_executions')] + else: + cycle_executions = APIHelper.SKIP + last_payment = LastPaymentDetails.from_dictionary(dictionary.get('last_payment')) if 'last_payment' in dictionary.keys() else APIHelper.SKIP + next_billing_time = dictionary.get("next_billing_time") if dictionary.get("next_billing_time") else APIHelper.SKIP + final_payment_time = dictionary.get("final_payment_time") if dictionary.get("final_payment_time") else APIHelper.SKIP + last_failed_payment = FailedPaymentDetails.from_dictionary(dictionary.get('last_failed_payment')) if 'last_failed_payment' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(outstanding_balance, + failed_payments_count, + cycle_executions, + last_payment, + next_billing_time, + final_payment_time, + last_failed_payment) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'outstanding_balance={self.outstanding_balance!r}, ' + f'cycle_executions={(self.cycle_executions if hasattr(self, "cycle_executions") else None)!r}, ' + f'last_payment={(self.last_payment if hasattr(self, "last_payment") else None)!r}, ' + f'next_billing_time={(self.next_billing_time if hasattr(self, "next_billing_time") else None)!r}, ' + f'final_payment_time={(self.final_payment_time if hasattr(self, "final_payment_time") else None)!r}, ' + f'failed_payments_count={self.failed_payments_count!r}, ' + f'last_failed_payment={(self.last_failed_payment if hasattr(self, "last_failed_payment") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'outstanding_balance={self.outstanding_balance!s}, ' + f'cycle_executions={(self.cycle_executions if hasattr(self, "cycle_executions") else None)!s}, ' + f'last_payment={(self.last_payment if hasattr(self, "last_payment") else None)!s}, ' + f'next_billing_time={(self.next_billing_time if hasattr(self, "next_billing_time") else None)!s}, ' + f'final_payment_time={(self.final_payment_time if hasattr(self, "final_payment_time") else None)!s}, ' + f'failed_payments_count={self.failed_payments_count!s}, ' + f'last_failed_payment={(self.last_failed_payment if hasattr(self, "last_failed_payment") else None)!s})') diff --git a/paypalserversdk/models/subscription_card_request.py b/paypalserversdk/models/subscription_card_request.py new file mode 100644 index 0000000..d8b832e --- /dev/null +++ b/paypalserversdk/models/subscription_card_request.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.address import Address +from paypalserversdk.models.subscriptions_card_attributes import SubscriptionsCardAttributes + + +class SubscriptionCardRequest(object): + + """Implementation of the 'Subscription Card Request' model. + + The payment card to use to fund a payment. Can be a credit or debit card. + + Attributes: + name (str): The card holder's name as it appears on the card. + number (str): The primary account number (PAN) for the payment card. + expiry (str): The year and month, in ISO-8601 `YYYY-MM` date format. + See [Internet date and time + format](https://tools.ietf.org/html/rfc3339#section-5.6). + security_code (str): The three- or four-digit security code of the + card. Also known as the CVV, CVC, CVN, CVE, or CID. This parameter + cannot be present in the request when `payment_initiator=MERCHANT`. + mtype (CardType): Type of card. i.e Credit, Debit and so on. + brand (SubscriptionsCardBrand): The card network or brand. Applies to + credit, debit, gift, and payment cards. + billing_address (Address): The portable international postal address. + Maps to + [AddressValidationMetadata](https://github.com/googlei18n/libaddres + sinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling + form controls: the autocomplete + attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling- + form-controls-the-autocomplete-attribute). + attributes (SubscriptionsCardAttributes): Additional attributes + associated with the use of this card. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": 'name', + "number": 'number', + "expiry": 'expiry', + "security_code": 'security_code', + "mtype": 'type', + "brand": 'brand', + "billing_address": 'billing_address', + "attributes": 'attributes' + } + + _optionals = [ + 'name', + 'number', + 'expiry', + 'security_code', + 'mtype', + 'brand', + 'billing_address', + 'attributes', + ] + + def __init__(self, + name=APIHelper.SKIP, + number=APIHelper.SKIP, + expiry=APIHelper.SKIP, + security_code=APIHelper.SKIP, + mtype=APIHelper.SKIP, + brand=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + attributes=APIHelper.SKIP): + """Constructor for the SubscriptionCardRequest class""" + + # Initialize members of the class + if name is not APIHelper.SKIP: + self.name = name + if number is not APIHelper.SKIP: + self.number = number + if expiry is not APIHelper.SKIP: + self.expiry = expiry + if security_code is not APIHelper.SKIP: + self.security_code = security_code + if mtype is not APIHelper.SKIP: + self.mtype = mtype + if brand is not APIHelper.SKIP: + self.brand = brand + if billing_address is not APIHelper.SKIP: + self.billing_address = billing_address + if attributes is not APIHelper.SKIP: + self.attributes = attributes + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP + number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP + expiry = dictionary.get("expiry") if dictionary.get("expiry") else APIHelper.SKIP + security_code = dictionary.get("security_code") if dictionary.get("security_code") else APIHelper.SKIP + mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP + brand = dictionary.get("brand") if dictionary.get("brand") else APIHelper.SKIP + billing_address = Address.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP + attributes = SubscriptionsCardAttributes.from_dictionary(dictionary.get('attributes')) if 'attributes' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(name, + number, + expiry, + security_code, + mtype, + brand, + billing_address, + attributes) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'number={(self.number if hasattr(self, "number") else None)!r}, ' + f'expiry={(self.expiry if hasattr(self, "expiry") else None)!r}, ' + f'security_code={(self.security_code if hasattr(self, "security_code") else None)!r}, ' + f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' + f'brand={(self.brand if hasattr(self, "brand") else None)!r}, ' + f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' + f'attributes={(self.attributes if hasattr(self, "attributes") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'number={(self.number if hasattr(self, "number") else None)!s}, ' + f'expiry={(self.expiry if hasattr(self, "expiry") else None)!s}, ' + f'security_code={(self.security_code if hasattr(self, "security_code") else None)!s}, ' + f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' + f'brand={(self.brand if hasattr(self, "brand") else None)!s}, ' + f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' + f'attributes={(self.attributes if hasattr(self, "attributes") else None)!s})') diff --git a/paypalserversdk/models/subscription_collection.py b/paypalserversdk/models/subscription_collection.py new file mode 100644 index 0000000..0a41961 --- /dev/null +++ b/paypalserversdk/models/subscription_collection.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.subscription import Subscription + + +class SubscriptionCollection(object): + + """Implementation of the 'Subscription Collection' model. + + The list of subscriptions. + + Attributes: + subscriptions (List[Subscription]): An array of subscriptions. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/docs/api/reference/api-responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "subscriptions": 'subscriptions', + "links": 'links' + } + + _optionals = [ + 'subscriptions', + 'links', + ] + + def __init__(self, + subscriptions=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the SubscriptionCollection class""" + + # Initialize members of the class + if subscriptions is not APIHelper.SKIP: + self.subscriptions = subscriptions + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + subscriptions = None + if dictionary.get('subscriptions') is not None: + subscriptions = [Subscription.from_dictionary(x) for x in dictionary.get('subscriptions')] + else: + subscriptions = APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(subscriptions, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/subscription_customer_information.py b/paypalserversdk/models/subscription_customer_information.py new file mode 100644 index 0000000..c96760e --- /dev/null +++ b/paypalserversdk/models/subscription_customer_information.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.phone_with_type import PhoneWithType + + +class SubscriptionCustomerInformation(object): + + """Implementation of the 'Subscription Customer Information' model. + + The details about a customer in PayPal's system of record. + + Attributes: + id (str): The unique ID for a customer generated by PayPal. + email_address (str): The internationalized email address. Note: Up to + 64 characters are allowed before and 255 characters are allowed + after the @ sign. However, the generally accepted maximum length + for an email address is 254 characters. The pattern verifies that + an unquoted @ sign exists. + phone (PhoneWithType): The phone information. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": 'id', + "email_address": 'email_address', + "phone": 'phone' + } + + _optionals = [ + 'id', + 'email_address', + 'phone', + ] + + def __init__(self, + id=APIHelper.SKIP, + email_address=APIHelper.SKIP, + phone=APIHelper.SKIP): + """Constructor for the SubscriptionCustomerInformation class""" + + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if email_address is not APIHelper.SKIP: + self.email_address = email_address + if phone is not APIHelper.SKIP: + self.phone = phone + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP + email_address = dictionary.get("email_address") if dictionary.get("email_address") else APIHelper.SKIP + phone = PhoneWithType.from_dictionary(dictionary.get('phone')) if 'phone' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(id, + email_address, + phone) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!r}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!r}, ' + f'phone={(self.phone if hasattr(self, "phone") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!s}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!s}, ' + f'phone={(self.phone if hasattr(self, "phone") else None)!s})') diff --git a/paypalserversdk/models/subscription_patch_application_context.py b/paypalserversdk/models/subscription_patch_application_context.py new file mode 100644 index 0000000..d4ef0e3 --- /dev/null +++ b/paypalserversdk/models/subscription_patch_application_context.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.payment_method import PaymentMethod + + +class SubscriptionPatchApplicationContext(object): + + """Implementation of the 'Subscription Patch Application Context' model. + + The application context, which customizes the payer experience during the + subscription approval process with PayPal. + + Attributes: + brand_name (str): The label that overrides the business name in the + PayPal account on the PayPal site. + locale (str): The BCP 47-formatted locale of pages that the PayPal + payment experience shows. PayPal supports a five-character code. + For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, + `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. + shipping_preference (ExperienceContextShippingPreference): The + location from which the shipping address is derived. + payment_method (PaymentMethod): The customer and merchant payment + preferences. + return_url (str): The URL where the customer is redirected after the + customer approves the payment. + cancel_url (str): The URL where the customer is redirected after the + customer cancels the payment. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "return_url": 'return_url', + "cancel_url": 'cancel_url', + "brand_name": 'brand_name', + "locale": 'locale', + "shipping_preference": 'shipping_preference', + "payment_method": 'payment_method' + } + + _optionals = [ + 'brand_name', + 'locale', + 'shipping_preference', + 'payment_method', + ] + + def __init__(self, + return_url=None, + cancel_url=None, + brand_name=APIHelper.SKIP, + locale=APIHelper.SKIP, + shipping_preference='GET_FROM_FILE', + payment_method=APIHelper.SKIP): + """Constructor for the SubscriptionPatchApplicationContext class""" + + # Initialize members of the class + if brand_name is not APIHelper.SKIP: + self.brand_name = brand_name + if locale is not APIHelper.SKIP: + self.locale = locale + self.shipping_preference = shipping_preference + if payment_method is not APIHelper.SKIP: + self.payment_method = payment_method + self.return_url = return_url + self.cancel_url = cancel_url + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + return_url = dictionary.get("return_url") if dictionary.get("return_url") else None + cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else None + brand_name = dictionary.get("brand_name") if dictionary.get("brand_name") else APIHelper.SKIP + locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP + shipping_preference = dictionary.get("shipping_preference") if dictionary.get("shipping_preference") else 'GET_FROM_FILE' + payment_method = PaymentMethod.from_dictionary(dictionary.get('payment_method')) if 'payment_method' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(return_url, + cancel_url, + brand_name, + locale, + shipping_preference, + payment_method) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!r}, ' + f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' + f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!r}, ' + f'payment_method={(self.payment_method if hasattr(self, "payment_method") else None)!r}, ' + f'return_url={self.return_url!r}, ' + f'cancel_url={self.cancel_url!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!s}, ' + f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' + f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!s}, ' + f'payment_method={(self.payment_method if hasattr(self, "payment_method") else None)!s}, ' + f'return_url={self.return_url!s}, ' + f'cancel_url={self.cancel_url!s})') diff --git a/paypalserversdk/models/subscription_payer_name.py b/paypalserversdk/models/subscription_payer_name.py new file mode 100644 index 0000000..3c39961 --- /dev/null +++ b/paypalserversdk/models/subscription_payer_name.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class SubscriptionPayerName(object): + + """Implementation of the 'Subscription Payer Name' model. + + The name of the party. + + Attributes: + prefix (str): The prefix, or title, to the party's name. + given_name (str): When the party is a person, the party's given, or + first, name. + surname (str): When the party is a person, the party's surname or + family name. Also known as the last name. Required when the party + is a person. Use also to store multiple surnames including the + matronymic, or mother's, surname. + middle_name (str): When the party is a person, the party's middle + name. Use also to store multiple middle names including the + patronymic, or father's, middle name. + suffix (str): The suffix for the party's name. + full_name (str): When the party is a person, the party's full name. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "prefix": 'prefix', + "given_name": 'given_name', + "surname": 'surname', + "middle_name": 'middle_name', + "suffix": 'suffix', + "full_name": 'full_name' + } + + _optionals = [ + 'prefix', + 'given_name', + 'surname', + 'middle_name', + 'suffix', + 'full_name', + ] + + def __init__(self, + prefix=APIHelper.SKIP, + given_name=APIHelper.SKIP, + surname=APIHelper.SKIP, + middle_name=APIHelper.SKIP, + suffix=APIHelper.SKIP, + full_name=APIHelper.SKIP): + """Constructor for the SubscriptionPayerName class""" + + # Initialize members of the class + if prefix is not APIHelper.SKIP: + self.prefix = prefix + if given_name is not APIHelper.SKIP: + self.given_name = given_name + if surname is not APIHelper.SKIP: + self.surname = surname + if middle_name is not APIHelper.SKIP: + self.middle_name = middle_name + if suffix is not APIHelper.SKIP: + self.suffix = suffix + if full_name is not APIHelper.SKIP: + self.full_name = full_name + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + prefix = dictionary.get("prefix") if dictionary.get("prefix") else APIHelper.SKIP + given_name = dictionary.get("given_name") if dictionary.get("given_name") else APIHelper.SKIP + surname = dictionary.get("surname") if dictionary.get("surname") else APIHelper.SKIP + middle_name = dictionary.get("middle_name") if dictionary.get("middle_name") else APIHelper.SKIP + suffix = dictionary.get("suffix") if dictionary.get("suffix") else APIHelper.SKIP + full_name = dictionary.get("full_name") if dictionary.get("full_name") else APIHelper.SKIP + # Return an object of this model + return cls(prefix, + given_name, + surname, + middle_name, + suffix, + full_name) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'prefix={(self.prefix if hasattr(self, "prefix") else None)!r}, ' + f'given_name={(self.given_name if hasattr(self, "given_name") else None)!r}, ' + f'surname={(self.surname if hasattr(self, "surname") else None)!r}, ' + f'middle_name={(self.middle_name if hasattr(self, "middle_name") else None)!r}, ' + f'suffix={(self.suffix if hasattr(self, "suffix") else None)!r}, ' + f'full_name={(self.full_name if hasattr(self, "full_name") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'prefix={(self.prefix if hasattr(self, "prefix") else None)!s}, ' + f'given_name={(self.given_name if hasattr(self, "given_name") else None)!s}, ' + f'surname={(self.surname if hasattr(self, "surname") else None)!s}, ' + f'middle_name={(self.middle_name if hasattr(self, "middle_name") else None)!s}, ' + f'suffix={(self.suffix if hasattr(self, "suffix") else None)!s}, ' + f'full_name={(self.full_name if hasattr(self, "full_name") else None)!s})') diff --git a/paypalserversdk/models/subscription_payment_source.py b/paypalserversdk/models/subscription_payment_source.py new file mode 100644 index 0000000..ad78fb2 --- /dev/null +++ b/paypalserversdk/models/subscription_payment_source.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.subscription_card_request import SubscriptionCardRequest + + +class SubscriptionPaymentSource(object): + + """Implementation of the 'Subscription Payment Source' model. + + The payment source definition. To be eligible to create subscription using + debit or credit card, you will need to sign up here + (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its + available only for non-3DS cards and for merchants in US and AU regions. + + Attributes: + card (SubscriptionCardRequest): The payment card to use to fund a + payment. Can be a credit or debit card. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "card": 'card' + } + + _optionals = [ + 'card', + ] + + def __init__(self, + card=APIHelper.SKIP): + """Constructor for the SubscriptionPaymentSource class""" + + # Initialize members of the class + if card is not APIHelper.SKIP: + self.card = card + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + card = SubscriptionCardRequest.from_dictionary(dictionary.get('card')) if 'card' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(card) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'card={(self.card if hasattr(self, "card") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'card={(self.card if hasattr(self, "card") else None)!s})') diff --git a/paypalserversdk/models/subscription_payment_source_response.py b/paypalserversdk/models/subscription_payment_source_response.py new file mode 100644 index 0000000..d057437 --- /dev/null +++ b/paypalserversdk/models/subscription_payment_source_response.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.card_response_with_billing_address import CardResponseWithBillingAddress + + +class SubscriptionPaymentSourceResponse(object): + + """Implementation of the 'Subscription Payment Source Response' model. + + The payment source used to fund the payment. + + Attributes: + card (CardResponseWithBillingAddress): The payment card used to fund + the payment. Card can be a credit or debit card. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "card": 'card' + } + + _optionals = [ + 'card', + ] + + def __init__(self, + card=APIHelper.SKIP): + """Constructor for the SubscriptionPaymentSourceResponse class""" + + # Initialize members of the class + if card is not APIHelper.SKIP: + self.card = card + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + card = CardResponseWithBillingAddress.from_dictionary(dictionary.get('card')) if 'card' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(card) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'card={(self.card if hasattr(self, "card") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'card={(self.card if hasattr(self, "card") else None)!s})') diff --git a/paypalserversdk/models/subscription_plan_status.py b/paypalserversdk/models/subscription_plan_status.py new file mode 100644 index 0000000..89629f7 --- /dev/null +++ b/paypalserversdk/models/subscription_plan_status.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class SubscriptionPlanStatus(object): + + """Implementation of the 'Subscription Plan Status' enum. + + The plan status. + + Attributes: + CREATED: The plan was created. You cannot create subscriptions for a + plan in this state. + INACTIVE: The plan is inactive. + ACTIVE: The plan is active. You can only create subscriptions for a + plan in this state. + + """ + CREATED = 'CREATED' + + INACTIVE = 'INACTIVE' + + ACTIVE = 'ACTIVE' + diff --git a/paypalserversdk/models/subscription_pricing_model.py b/paypalserversdk/models/subscription_pricing_model.py new file mode 100644 index 0000000..8c4a14f --- /dev/null +++ b/paypalserversdk/models/subscription_pricing_model.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class SubscriptionPricingModel(object): + + """Implementation of the 'Subscription Pricing Model' enum. + + The pricing model for tiered plan. The `tiers` parameter is required. + + Attributes: + VOLUME: A volume pricing model. + TIERED: A tiered pricing model. + + """ + VOLUME = 'VOLUME' + + TIERED = 'TIERED' + diff --git a/paypalserversdk/models/subscription_pricing_scheme.py b/paypalserversdk/models/subscription_pricing_scheme.py new file mode 100644 index 0000000..582a258 --- /dev/null +++ b/paypalserversdk/models/subscription_pricing_scheme.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier + + +class SubscriptionPricingScheme(object): + + """Implementation of the 'Subscription Pricing Scheme' model. + + The pricing scheme details. + + Attributes: + version (int): The version of the pricing scheme. + fixed_price (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + pricing_model (SubscriptionPricingModel): The pricing model for tiered + plan. The `tiers` parameter is required. + tiers (List[PricingTier]): An array of pricing tiers which are used + for billing volume/tiered plans. pricing_model field has to be + specified. + create_time (str): 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. + update_time (str): 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. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "version": 'version', + "fixed_price": 'fixed_price', + "pricing_model": 'pricing_model', + "tiers": 'tiers', + "create_time": 'create_time', + "update_time": 'update_time' + } + + _optionals = [ + 'version', + 'fixed_price', + 'pricing_model', + 'tiers', + 'create_time', + 'update_time', + ] + + def __init__(self, + version=APIHelper.SKIP, + fixed_price=APIHelper.SKIP, + pricing_model=APIHelper.SKIP, + tiers=APIHelper.SKIP, + create_time=APIHelper.SKIP, + update_time=APIHelper.SKIP): + """Constructor for the SubscriptionPricingScheme class""" + + # Initialize members of the class + if version is not APIHelper.SKIP: + self.version = version + if fixed_price is not APIHelper.SKIP: + self.fixed_price = fixed_price + if pricing_model is not APIHelper.SKIP: + self.pricing_model = pricing_model + if tiers is not APIHelper.SKIP: + self.tiers = tiers + if create_time is not APIHelper.SKIP: + self.create_time = create_time + if update_time is not APIHelper.SKIP: + self.update_time = update_time + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + version = dictionary.get("version") if dictionary.get("version") else APIHelper.SKIP + fixed_price = Money.from_dictionary(dictionary.get('fixed_price')) if 'fixed_price' in dictionary.keys() else APIHelper.SKIP + pricing_model = dictionary.get("pricing_model") if dictionary.get("pricing_model") else APIHelper.SKIP + tiers = None + if dictionary.get('tiers') is not None: + tiers = [PricingTier.from_dictionary(x) for x in dictionary.get('tiers')] + else: + tiers = APIHelper.SKIP + create_time = dictionary.get("create_time") if dictionary.get("create_time") else APIHelper.SKIP + update_time = dictionary.get("update_time") if dictionary.get("update_time") else APIHelper.SKIP + # Return an object of this model + return cls(version, + fixed_price, + pricing_model, + tiers, + create_time, + update_time) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'version={(self.version if hasattr(self, "version") else None)!r}, ' + f'fixed_price={(self.fixed_price if hasattr(self, "fixed_price") else None)!r}, ' + f'pricing_model={(self.pricing_model if hasattr(self, "pricing_model") else None)!r}, ' + f'tiers={(self.tiers if hasattr(self, "tiers") else None)!r}, ' + f'create_time={(self.create_time if hasattr(self, "create_time") else None)!r}, ' + f'update_time={(self.update_time if hasattr(self, "update_time") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'version={(self.version if hasattr(self, "version") else None)!s}, ' + f'fixed_price={(self.fixed_price if hasattr(self, "fixed_price") else None)!s}, ' + f'pricing_model={(self.pricing_model if hasattr(self, "pricing_model") else None)!s}, ' + f'tiers={(self.tiers if hasattr(self, "tiers") else None)!s}, ' + f'create_time={(self.create_time if hasattr(self, "create_time") else None)!s}, ' + f'update_time={(self.update_time if hasattr(self, "update_time") else None)!s})') diff --git a/paypalserversdk/models/subscription_transaction_details.py b/paypalserversdk/models/subscription_transaction_details.py new file mode 100644 index 0000000..c1c8e6c --- /dev/null +++ b/paypalserversdk/models/subscription_transaction_details.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.subscription_amount_with_breakdown import SubscriptionAmountWithBreakdown +from paypalserversdk.models.subscription_payer_name import SubscriptionPayerName + + +class SubscriptionTransactionDetails(object): + + """Implementation of the 'Subscription Transaction Details' model. + + The transaction details. + + Attributes: + status (CaptureStatus): The status of the captured payment. + id (str): The PayPal-generated transaction ID. + amount_with_breakdown (SubscriptionAmountWithBreakdown): The breakdown + details for the amount. Includes the gross, tax, fee, and shipping + amounts. + payer_name (SubscriptionPayerName): The name of the party. + payer_email (str): The internationalized email address. Note: Up to 64 + characters are allowed before and 255 characters are allowed after + the @ sign. However, the generally accepted maximum length for an + email address is 254 characters. The pattern verifies that an + unquoted @ sign exists. + time (str): 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. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": 'id', + "amount_with_breakdown": 'amount_with_breakdown', + "time": 'time', + "status": 'status', + "payer_name": 'payer_name', + "payer_email": 'payer_email' + } + + _optionals = [ + 'status', + 'payer_name', + 'payer_email', + ] + + def __init__(self, + id=None, + amount_with_breakdown=None, + time=None, + status=APIHelper.SKIP, + payer_name=APIHelper.SKIP, + payer_email=APIHelper.SKIP): + """Constructor for the SubscriptionTransactionDetails class""" + + # Initialize members of the class + if status is not APIHelper.SKIP: + self.status = status + self.id = id + self.amount_with_breakdown = amount_with_breakdown + if payer_name is not APIHelper.SKIP: + self.payer_name = payer_name + if payer_email is not APIHelper.SKIP: + self.payer_email = payer_email + self.time = time + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id = dictionary.get("id") if dictionary.get("id") else None + amount_with_breakdown = SubscriptionAmountWithBreakdown.from_dictionary(dictionary.get('amount_with_breakdown')) if dictionary.get('amount_with_breakdown') else None + time = dictionary.get("time") if dictionary.get("time") else None + status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP + payer_name = SubscriptionPayerName.from_dictionary(dictionary.get('payer_name')) if 'payer_name' in dictionary.keys() else APIHelper.SKIP + payer_email = dictionary.get("payer_email") if dictionary.get("payer_email") else APIHelper.SKIP + # Return an object of this model + return cls(id, + amount_with_breakdown, + time, + status, + payer_name, + payer_email) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'status={(self.status if hasattr(self, "status") else None)!r}, ' + f'id={self.id!r}, ' + f'amount_with_breakdown={self.amount_with_breakdown!r}, ' + f'payer_name={(self.payer_name if hasattr(self, "payer_name") else None)!r}, ' + f'payer_email={(self.payer_email if hasattr(self, "payer_email") else None)!r}, ' + f'time={self.time!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'status={(self.status if hasattr(self, "status") else None)!s}, ' + f'id={self.id!s}, ' + f'amount_with_breakdown={self.amount_with_breakdown!s}, ' + f'payer_name={(self.payer_name if hasattr(self, "payer_name") else None)!s}, ' + f'payer_email={(self.payer_email if hasattr(self, "payer_email") else None)!s}, ' + f'time={self.time!s})') diff --git a/paypalserversdk/models/subscriptions_card_attributes.py b/paypalserversdk/models/subscriptions_card_attributes.py new file mode 100644 index 0000000..e3e70fe --- /dev/null +++ b/paypalserversdk/models/subscriptions_card_attributes.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.card_customer import CardCustomer +from paypalserversdk.models.card_verification import CardVerification +from paypalserversdk.models.vault_instruction_base import VaultInstructionBase + + +class SubscriptionsCardAttributes(object): + + """Implementation of the 'Subscriptions Card Attributes' model. + + Additional attributes associated with the use of this card. + + Attributes: + customer (CardCustomer): The details about a customer in PayPal's + system of record. + vault (VaultInstructionBase): Basic vault instruction specification + that can be extended by specific payment sources that supports + vaulting. + verification (CardVerification): The API caller can opt in to verify + the card through PayPal offered verification services (e.g. Smart + Dollar Auth, 3DS). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "customer": 'customer', + "vault": 'vault', + "verification": 'verification' + } + + _optionals = [ + 'customer', + 'vault', + 'verification', + ] + + def __init__(self, + customer=APIHelper.SKIP, + vault=APIHelper.SKIP, + verification=APIHelper.SKIP): + """Constructor for the SubscriptionsCardAttributes class""" + + # Initialize members of the class + if customer is not APIHelper.SKIP: + self.customer = customer + if vault is not APIHelper.SKIP: + self.vault = vault + if verification is not APIHelper.SKIP: + self.verification = verification + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + customer = CardCustomer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP + vault = VaultInstructionBase.from_dictionary(dictionary.get('vault')) if 'vault' in dictionary.keys() else APIHelper.SKIP + verification = CardVerification.from_dictionary(dictionary.get('verification')) if 'verification' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(customer, + vault, + verification) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' + f'vault={(self.vault if hasattr(self, "vault") else None)!r}, ' + f'verification={(self.verification if hasattr(self, "verification") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' + f'vault={(self.vault if hasattr(self, "vault") else None)!s}, ' + f'verification={(self.verification if hasattr(self, "verification") else None)!s})') diff --git a/paypalserversdk/models/subscriptions_card_brand.py b/paypalserversdk/models/subscriptions_card_brand.py new file mode 100644 index 0000000..e5664c9 --- /dev/null +++ b/paypalserversdk/models/subscriptions_card_brand.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class SubscriptionsCardBrand(object): + + """Implementation of the 'Subscriptions Card Brand' enum. + + The card network or brand. Applies to credit, debit, gift, and payment + cards. + + Attributes: + VISA: Visa card. + MASTERCARD: Mastercard card. + DISCOVER: Discover card. + AMEX: American Express card. + SOLO: Solo debit card. + JCB: Japan Credit Bureau card. + STAR: Military Star card. + DELTA: Delta Airlines card. + SWITCH: Switch credit card. + MAESTRO: Maestro credit card. + CB_NATIONALE: Carte Bancaire (CB) credit card. + CONFIGOGA: Configoga credit card. + CONFIDIS: Confidis credit card. + ELECTRON: Visa Electron credit card. + CETELEM: Cetelem credit card. + CHINA_UNION_PAY: China union pay credit card. + DINERS: The Diners Club International banking and payment services + capability network owned by Discover Financial Services (DFS), one + of the most recognized brands in US financial services. + ELO: The Brazilian Elo card payment network. + HIPER: The Hiper - Ingenico ePayment network. + HIPERCARD: The Brazilian Hipercard payment network that's widely + accepted in the retail market. + RUPAY: The RuPay payment network. + GE: The GE Credit Union 3Point card payment network. + SYNCHRONY: The Synchrony Financial (SYF) payment network. + EFTPOS: The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit + card payment network. + UNKNOWN: UNKNOWN payment network. + + """ + VISA = 'VISA' + + MASTERCARD = 'MASTERCARD' + + DISCOVER = 'DISCOVER' + + AMEX = 'AMEX' + + SOLO = 'SOLO' + + JCB = 'JCB' + + STAR = 'STAR' + + DELTA = 'DELTA' + + SWITCH = 'SWITCH' + + MAESTRO = 'MAESTRO' + + CB_NATIONALE = 'CB_NATIONALE' + + CONFIGOGA = 'CONFIGOGA' + + CONFIDIS = 'CONFIDIS' + + ELECTRON = 'ELECTRON' + + CETELEM = 'CETELEM' + + CHINA_UNION_PAY = 'CHINA_UNION_PAY' + + DINERS = 'DINERS' + + ELO = 'ELO' + + HIPER = 'HIPER' + + HIPERCARD = 'HIPERCARD' + + RUPAY = 'RUPAY' + + GE = 'GE' + + SYNCHRONY = 'SYNCHRONY' + + EFTPOS = 'EFTPOS' + + UNKNOWN = 'UNKNOWN' + diff --git a/paypalserversdk/models/supplementary_purchase_data.py b/paypalserversdk/models/supplementary_purchase_data.py deleted file mode 100644 index 14ffb72..0000000 --- a/paypalserversdk/models/supplementary_purchase_data.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -paypalserversdk - -This file was automatically generated by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from paypalserversdk.api_helper import APIHelper - - -class SupplementaryPurchaseData(object): - - """Implementation of the 'Supplementary Purchase Data' model. - - The capture identification-related fields. Includes the invoice ID, custom - ID, note to payer, and soft descriptor. - - Attributes: - invoice_id (str): The API caller-provided external invoice number for - this order. Appears in both the payer's transaction history and - the emails that the payer receives. - note_to_payer (str): An informational note about this settlement. - Appears in both the payer's transaction history and the emails - that the payer receives. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "invoice_id": 'invoice_id', - "note_to_payer": 'note_to_payer' - } - - _optionals = [ - 'invoice_id', - 'note_to_payer', - ] - - def __init__(self, - invoice_id=APIHelper.SKIP, - note_to_payer=APIHelper.SKIP): - """Constructor for the SupplementaryPurchaseData class""" - - # Initialize members of the class - if invoice_id is not APIHelper.SKIP: - self.invoice_id = invoice_id - if note_to_payer is not APIHelper.SKIP: - self.note_to_payer = note_to_payer - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP - note_to_payer = dictionary.get("note_to_payer") if dictionary.get("note_to_payer") else APIHelper.SKIP - # Return an object of this model - return cls(invoice_id, - note_to_payer) - - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!r}, ' - f'note_to_payer={(self.note_to_payer if hasattr(self, "note_to_payer") else None)!r})') - - def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!s}, ' - f'note_to_payer={(self.note_to_payer if hasattr(self, "note_to_payer") else None)!s})') diff --git a/paypalserversdk/models/suspend_subscription.py b/paypalserversdk/models/suspend_subscription.py new file mode 100644 index 0000000..3362bbf --- /dev/null +++ b/paypalserversdk/models/suspend_subscription.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class SuspendSubscription(object): + + """Implementation of the 'Suspend Subscription' model. + + The suspend subscription request details. + + Attributes: + reason (str): The reason for suspension of the Subscription. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "reason": 'reason' + } + + def __init__(self, + reason=None): + """Constructor for the SuspendSubscription class""" + + # Initialize members of the class + self.reason = reason + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + reason = dictionary.get("reason") if dictionary.get("reason") else None + # Return an object of this model + return cls(reason) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'reason={self.reason!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'reason={self.reason!s})') diff --git a/paypalserversdk/models/tax_amount.py b/paypalserversdk/models/tax_amount.py new file mode 100644 index 0000000..1896bc0 --- /dev/null +++ b/paypalserversdk/models/tax_amount.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class TaxAmount(object): + + """Implementation of the 'Tax Amount' model. + + The tax levied by a government on the purchase of goods or services. + + Attributes: + tax_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "tax_amount": 'tax_amount' + } + + _optionals = [ + 'tax_amount', + ] + + def __init__(self, + tax_amount=APIHelper.SKIP): + """Constructor for the TaxAmount class""" + + # Initialize members of the class + if tax_amount is not APIHelper.SKIP: + self.tax_amount = tax_amount + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + tax_amount = Money.from_dictionary(dictionary.get('tax_amount')) if 'tax_amount' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(tax_amount) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s})') diff --git a/paypalserversdk/models/taxes.py b/paypalserversdk/models/taxes.py new file mode 100644 index 0000000..7fffa30 --- /dev/null +++ b/paypalserversdk/models/taxes.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class Taxes(object): + + """Implementation of the 'Taxes' model. + + The tax details. + + Attributes: + percentage (str): The percentage, as a fixed-point, signed decimal + number. For example, define a 19.99% interest rate as `19.99`. + inclusive (bool): Indicates whether the tax was already included in + the billing amount. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "percentage": 'percentage', + "inclusive": 'inclusive' + } + + _optionals = [ + 'inclusive', + ] + + def __init__(self, + percentage=None, + inclusive=True): + """Constructor for the Taxes class""" + + # Initialize members of the class + self.percentage = percentage + self.inclusive = inclusive + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + percentage = dictionary.get("percentage") if dictionary.get("percentage") else None + inclusive = dictionary.get("inclusive") if dictionary.get("inclusive") else True + # Return an object of this model + return cls(percentage, + inclusive) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'percentage={self.percentage!r}, ' + f'inclusive={(self.inclusive if hasattr(self, "inclusive") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'percentage={self.percentage!s}, ' + f'inclusive={(self.inclusive if hasattr(self, "inclusive") else None)!s})') diff --git a/paypalserversdk/models/taxes_override.py b/paypalserversdk/models/taxes_override.py new file mode 100644 index 0000000..68691cc --- /dev/null +++ b/paypalserversdk/models/taxes_override.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper + + +class TaxesOverride(object): + + """Implementation of the 'Taxes Override' model. + + The tax details. + + Attributes: + percentage (str): The percentage, as a fixed-point, signed decimal + number. For example, define a 19.99% interest rate as `19.99`. + inclusive (bool): Indicates whether the tax was already included in + the billing amount. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "percentage": 'percentage', + "inclusive": 'inclusive' + } + + _optionals = [ + 'percentage', + 'inclusive', + ] + + def __init__(self, + percentage=APIHelper.SKIP, + inclusive=APIHelper.SKIP): + """Constructor for the TaxesOverride class""" + + # Initialize members of the class + if percentage is not APIHelper.SKIP: + self.percentage = percentage + if inclusive is not APIHelper.SKIP: + self.inclusive = inclusive + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + percentage = dictionary.get("percentage") if dictionary.get("percentage") else APIHelper.SKIP + inclusive = dictionary.get("inclusive") if "inclusive" in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(percentage, + inclusive) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' + f'inclusive={(self.inclusive if hasattr(self, "inclusive") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' + f'inclusive={(self.inclusive if hasattr(self, "inclusive") else None)!s})') diff --git a/paypalserversdk/models/tenure_type.py b/paypalserversdk/models/tenure_type.py index 9684f3e..0c7e99f 100644 --- a/paypalserversdk/models/tenure_type.py +++ b/paypalserversdk/models/tenure_type.py @@ -13,7 +13,9 @@ class TenureType(object): """Implementation of the 'Tenure Type' enum. The tenure type of the billing cycle identifies if the billing cycle is a - trial(free or discounted) or regular billing cycle. + trial(free or discounted) or regular billing cycle., The tenure type of + the billing cycle. In case of a plan having trial cycle, only 2 trial + cycles are allowed per plan., The type of the billing cycle. Attributes: REGULAR: A regular billing cycle to identify recurring charges for the diff --git a/paypalserversdk/models/transaction_details.py b/paypalserversdk/models/transaction_details.py new file mode 100644 index 0000000..37a19c5 --- /dev/null +++ b/paypalserversdk/models/transaction_details.py @@ -0,0 +1,136 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.auction_information import AuctionInformation +from paypalserversdk.models.cart_information import CartInformation +from paypalserversdk.models.incentive_information import IncentiveInformation +from paypalserversdk.models.payer_information import PayerInformation +from paypalserversdk.models.shipping_information import ShippingInformation +from paypalserversdk.models.store_information import StoreInformation +from paypalserversdk.models.transaction_information import TransactionInformation + + +class TransactionDetails(object): + + """Implementation of the 'Transaction Details' model. + + The transaction details. + + Attributes: + transaction_info (TransactionInformation): The transaction information. + payer_info (PayerInformation): The payer information. + shipping_info (ShippingInformation): The shipping information. + cart_info (CartInformation): The cart information. + store_info (StoreInformation): The store information. + auction_info (AuctionInformation): The auction information. + incentive_info (IncentiveInformation): The incentive details. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "transaction_info": 'transaction_info', + "payer_info": 'payer_info', + "shipping_info": 'shipping_info', + "cart_info": 'cart_info', + "store_info": 'store_info', + "auction_info": 'auction_info', + "incentive_info": 'incentive_info' + } + + _optionals = [ + 'transaction_info', + 'payer_info', + 'shipping_info', + 'cart_info', + 'store_info', + 'auction_info', + 'incentive_info', + ] + + def __init__(self, + transaction_info=APIHelper.SKIP, + payer_info=APIHelper.SKIP, + shipping_info=APIHelper.SKIP, + cart_info=APIHelper.SKIP, + store_info=APIHelper.SKIP, + auction_info=APIHelper.SKIP, + incentive_info=APIHelper.SKIP): + """Constructor for the TransactionDetails class""" + + # Initialize members of the class + if transaction_info is not APIHelper.SKIP: + self.transaction_info = transaction_info + if payer_info is not APIHelper.SKIP: + self.payer_info = payer_info + if shipping_info is not APIHelper.SKIP: + self.shipping_info = shipping_info + if cart_info is not APIHelper.SKIP: + self.cart_info = cart_info + if store_info is not APIHelper.SKIP: + self.store_info = store_info + if auction_info is not APIHelper.SKIP: + self.auction_info = auction_info + if incentive_info is not APIHelper.SKIP: + self.incentive_info = incentive_info + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + transaction_info = TransactionInformation.from_dictionary(dictionary.get('transaction_info')) if 'transaction_info' in dictionary.keys() else APIHelper.SKIP + payer_info = PayerInformation.from_dictionary(dictionary.get('payer_info')) if 'payer_info' in dictionary.keys() else APIHelper.SKIP + shipping_info = ShippingInformation.from_dictionary(dictionary.get('shipping_info')) if 'shipping_info' in dictionary.keys() else APIHelper.SKIP + cart_info = CartInformation.from_dictionary(dictionary.get('cart_info')) if 'cart_info' in dictionary.keys() else APIHelper.SKIP + store_info = StoreInformation.from_dictionary(dictionary.get('store_info')) if 'store_info' in dictionary.keys() else APIHelper.SKIP + auction_info = AuctionInformation.from_dictionary(dictionary.get('auction_info')) if 'auction_info' in dictionary.keys() else APIHelper.SKIP + incentive_info = IncentiveInformation.from_dictionary(dictionary.get('incentive_info')) if 'incentive_info' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(transaction_info, + payer_info, + shipping_info, + cart_info, + store_info, + auction_info, + incentive_info) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'transaction_info={(self.transaction_info if hasattr(self, "transaction_info") else None)!r}, ' + f'payer_info={(self.payer_info if hasattr(self, "payer_info") else None)!r}, ' + f'shipping_info={(self.shipping_info if hasattr(self, "shipping_info") else None)!r}, ' + f'cart_info={(self.cart_info if hasattr(self, "cart_info") else None)!r}, ' + f'store_info={(self.store_info if hasattr(self, "store_info") else None)!r}, ' + f'auction_info={(self.auction_info if hasattr(self, "auction_info") else None)!r}, ' + f'incentive_info={(self.incentive_info if hasattr(self, "incentive_info") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'transaction_info={(self.transaction_info if hasattr(self, "transaction_info") else None)!s}, ' + f'payer_info={(self.payer_info if hasattr(self, "payer_info") else None)!s}, ' + f'shipping_info={(self.shipping_info if hasattr(self, "shipping_info") else None)!s}, ' + f'cart_info={(self.cart_info if hasattr(self, "cart_info") else None)!s}, ' + f'store_info={(self.store_info if hasattr(self, "store_info") else None)!s}, ' + f'auction_info={(self.auction_info if hasattr(self, "auction_info") else None)!s}, ' + f'incentive_info={(self.incentive_info if hasattr(self, "incentive_info") else None)!s})') diff --git a/paypalserversdk/models/transaction_information.py b/paypalserversdk/models/transaction_information.py new file mode 100644 index 0000000..2775524 --- /dev/null +++ b/paypalserversdk/models/transaction_information.py @@ -0,0 +1,468 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.money import Money + + +class TransactionInformation(object): + + """Implementation of the 'Transaction Information' model. + + The transaction information. + + Attributes: + paypal_account_id (str): The ID of the PayPal account of the + counterparty. + transaction_id (str): The PayPal-generated transaction ID. + paypal_reference_id (str): The PayPal-generated base ID. PayPal + exclusive. Cannot be altered. Defined as a related, pre-existing + transaction or event. + paypal_reference_id_type (PaypalReferenceIdType): The PayPal reference + ID type. + transaction_event_code (str): A five-digit transaction event code that + classifies the transaction type based on money movement and debit + or credit. For example, T0001. See [Transaction event + codes](/docs/integration/direct/transaction-search/transaction-even + t-codes/). + transaction_initiation_date (str): 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. + transaction_updated_date (str): 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. + transaction_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + fee_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + discount_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + insurance_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + sales_tax_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + shipping_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + shipping_discount_amount (Money): The currency and amount for a + financial transaction, such as a balance or payment due. + shipping_tax_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + other_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + tip_amount (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + transaction_status (str): A code that indicates the transaction + status. Value is: Status code Description D PayPal or merchant + rules denied the transaction. P The transaction is pending. The + transaction was created but waits for another payment process to + complete, such as an ACH transaction, before the status changes to + S. S The transaction successfully completed without a denial and + after any pending statuses. V A successful transaction was fully + reversed and funds were refunded to the original sender. + transaction_subject (str): The subject of payment. The payer passes + this value to the payee. The payer controls this data through the + interface through which he or she sends the data. + transaction_note (str): A special note that the payer passes to the + payee. Might contain special customer requests, such as shipping + instructions. + payment_tracking_id (str): The payment tracking ID, which is a unique + ID that partners specify to either get information about a payment + or request a refund. + bank_reference_id (str): The bank reference ID. The bank provides this + value for an ACH transaction. + ending_balance (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + available_balance (Money): The currency and amount for a financial + transaction, such as a balance or payment due. + invoice_id (str): The invoice ID that is sent by the merchant with the + transaction. Note: If an invoice ID was sent with the capture + request, the value is reported. Otherwise, the invoice ID of the + authorizing transaction is reported. + custom_field (str): The merchant-provided custom text. Note: Usually, + this field includes the unique ID for payments made with MassPay + type transaction. + protection_eligibility (str): Indicates whether the transaction is + eligible for protection. Value is: 01. Eligible. 02. Not eligible + 03. Partially eligible. + credit_term (str): The credit term. The time span covered by the + installment payments as expressed in the term length plus the + length time unit code. + credit_transactional_fee (Money): The currency and amount for a + financial transaction, such as a balance or payment due. + credit_promotional_fee (Money): The currency and amount for a + financial transaction, such as a balance or payment due. + annual_percentage_rate (str): The percentage, as a fixed-point, signed + decimal number. For example, define a 19.99% interest rate as + `19.99`. + payment_method_type (str): The payment method that was used for a + transaction. Value is PUI, installment, or mEFT. Note: Appears + only for pay upon invoice (PUI), installment, and mEFT + transactions. Merchants and partners in the EMEA region can use + this attribute to note transactions that attract turn-over tax. + instrument_type (str): A high-level classification of the type of + financial instrument that was used to fund a payment. The pattern + is not provided because the value is defined by an external party. + E.g. PAYPAL, CREDIT_CARD, DEBIT_CARD, APPLE_PAY, BANK , VENMO ,Pay + Upon Invoice, Pay Later or Alternative Payment Methods (APM). + instrument_sub_type (str): A finer-grained classification of the + financial instrument that was used to fund a payment. For example, + `Visa card` or a `Mastercard` for a credit card, BANKCARD + ,DISCOVER etc. The pattern is not provided because the value is + defined by an external party. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "paypal_account_id": 'paypal_account_id', + "transaction_id": 'transaction_id', + "paypal_reference_id": 'paypal_reference_id', + "paypal_reference_id_type": 'paypal_reference_id_type', + "transaction_event_code": 'transaction_event_code', + "transaction_initiation_date": 'transaction_initiation_date', + "transaction_updated_date": 'transaction_updated_date', + "transaction_amount": 'transaction_amount', + "fee_amount": 'fee_amount', + "discount_amount": 'discount_amount', + "insurance_amount": 'insurance_amount', + "sales_tax_amount": 'sales_tax_amount', + "shipping_amount": 'shipping_amount', + "shipping_discount_amount": 'shipping_discount_amount', + "shipping_tax_amount": 'shipping_tax_amount', + "other_amount": 'other_amount', + "tip_amount": 'tip_amount', + "transaction_status": 'transaction_status', + "transaction_subject": 'transaction_subject', + "transaction_note": 'transaction_note', + "payment_tracking_id": 'payment_tracking_id', + "bank_reference_id": 'bank_reference_id', + "ending_balance": 'ending_balance', + "available_balance": 'available_balance', + "invoice_id": 'invoice_id', + "custom_field": 'custom_field', + "protection_eligibility": 'protection_eligibility', + "credit_term": 'credit_term', + "credit_transactional_fee": 'credit_transactional_fee', + "credit_promotional_fee": 'credit_promotional_fee', + "annual_percentage_rate": 'annual_percentage_rate', + "payment_method_type": 'payment_method_type', + "instrument_type": 'instrument_type', + "instrument_sub_type": 'instrument_sub_type' + } + + _optionals = [ + 'paypal_account_id', + 'transaction_id', + 'paypal_reference_id', + 'paypal_reference_id_type', + 'transaction_event_code', + 'transaction_initiation_date', + 'transaction_updated_date', + 'transaction_amount', + 'fee_amount', + 'discount_amount', + 'insurance_amount', + 'sales_tax_amount', + 'shipping_amount', + 'shipping_discount_amount', + 'shipping_tax_amount', + 'other_amount', + 'tip_amount', + 'transaction_status', + 'transaction_subject', + 'transaction_note', + 'payment_tracking_id', + 'bank_reference_id', + 'ending_balance', + 'available_balance', + 'invoice_id', + 'custom_field', + 'protection_eligibility', + 'credit_term', + 'credit_transactional_fee', + 'credit_promotional_fee', + 'annual_percentage_rate', + 'payment_method_type', + 'instrument_type', + 'instrument_sub_type', + ] + + def __init__(self, + paypal_account_id=APIHelper.SKIP, + transaction_id=APIHelper.SKIP, + paypal_reference_id=APIHelper.SKIP, + paypal_reference_id_type=APIHelper.SKIP, + transaction_event_code=APIHelper.SKIP, + transaction_initiation_date=APIHelper.SKIP, + transaction_updated_date=APIHelper.SKIP, + transaction_amount=APIHelper.SKIP, + fee_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + insurance_amount=APIHelper.SKIP, + sales_tax_amount=APIHelper.SKIP, + shipping_amount=APIHelper.SKIP, + shipping_discount_amount=APIHelper.SKIP, + shipping_tax_amount=APIHelper.SKIP, + other_amount=APIHelper.SKIP, + tip_amount=APIHelper.SKIP, + transaction_status=APIHelper.SKIP, + transaction_subject=APIHelper.SKIP, + transaction_note=APIHelper.SKIP, + payment_tracking_id=APIHelper.SKIP, + bank_reference_id=APIHelper.SKIP, + ending_balance=APIHelper.SKIP, + available_balance=APIHelper.SKIP, + invoice_id=APIHelper.SKIP, + custom_field=APIHelper.SKIP, + protection_eligibility=APIHelper.SKIP, + credit_term=APIHelper.SKIP, + credit_transactional_fee=APIHelper.SKIP, + credit_promotional_fee=APIHelper.SKIP, + annual_percentage_rate=APIHelper.SKIP, + payment_method_type=APIHelper.SKIP, + instrument_type=APIHelper.SKIP, + instrument_sub_type=APIHelper.SKIP): + """Constructor for the TransactionInformation class""" + + # Initialize members of the class + if paypal_account_id is not APIHelper.SKIP: + self.paypal_account_id = paypal_account_id + if transaction_id is not APIHelper.SKIP: + self.transaction_id = transaction_id + if paypal_reference_id is not APIHelper.SKIP: + self.paypal_reference_id = paypal_reference_id + if paypal_reference_id_type is not APIHelper.SKIP: + self.paypal_reference_id_type = paypal_reference_id_type + if transaction_event_code is not APIHelper.SKIP: + self.transaction_event_code = transaction_event_code + if transaction_initiation_date is not APIHelper.SKIP: + self.transaction_initiation_date = transaction_initiation_date + if transaction_updated_date is not APIHelper.SKIP: + self.transaction_updated_date = transaction_updated_date + if transaction_amount is not APIHelper.SKIP: + self.transaction_amount = transaction_amount + if fee_amount is not APIHelper.SKIP: + self.fee_amount = fee_amount + if discount_amount is not APIHelper.SKIP: + self.discount_amount = discount_amount + if insurance_amount is not APIHelper.SKIP: + self.insurance_amount = insurance_amount + if sales_tax_amount is not APIHelper.SKIP: + self.sales_tax_amount = sales_tax_amount + if shipping_amount is not APIHelper.SKIP: + self.shipping_amount = shipping_amount + if shipping_discount_amount is not APIHelper.SKIP: + self.shipping_discount_amount = shipping_discount_amount + if shipping_tax_amount is not APIHelper.SKIP: + self.shipping_tax_amount = shipping_tax_amount + if other_amount is not APIHelper.SKIP: + self.other_amount = other_amount + if tip_amount is not APIHelper.SKIP: + self.tip_amount = tip_amount + if transaction_status is not APIHelper.SKIP: + self.transaction_status = transaction_status + if transaction_subject is not APIHelper.SKIP: + self.transaction_subject = transaction_subject + if transaction_note is not APIHelper.SKIP: + self.transaction_note = transaction_note + if payment_tracking_id is not APIHelper.SKIP: + self.payment_tracking_id = payment_tracking_id + if bank_reference_id is not APIHelper.SKIP: + self.bank_reference_id = bank_reference_id + if ending_balance is not APIHelper.SKIP: + self.ending_balance = ending_balance + if available_balance is not APIHelper.SKIP: + self.available_balance = available_balance + if invoice_id is not APIHelper.SKIP: + self.invoice_id = invoice_id + if custom_field is not APIHelper.SKIP: + self.custom_field = custom_field + if protection_eligibility is not APIHelper.SKIP: + self.protection_eligibility = protection_eligibility + if credit_term is not APIHelper.SKIP: + self.credit_term = credit_term + if credit_transactional_fee is not APIHelper.SKIP: + self.credit_transactional_fee = credit_transactional_fee + if credit_promotional_fee is not APIHelper.SKIP: + self.credit_promotional_fee = credit_promotional_fee + if annual_percentage_rate is not APIHelper.SKIP: + self.annual_percentage_rate = annual_percentage_rate + if payment_method_type is not APIHelper.SKIP: + self.payment_method_type = payment_method_type + if instrument_type is not APIHelper.SKIP: + self.instrument_type = instrument_type + if instrument_sub_type is not APIHelper.SKIP: + self.instrument_sub_type = instrument_sub_type + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + paypal_account_id = dictionary.get("paypal_account_id") if dictionary.get("paypal_account_id") else APIHelper.SKIP + transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP + paypal_reference_id = dictionary.get("paypal_reference_id") if dictionary.get("paypal_reference_id") else APIHelper.SKIP + paypal_reference_id_type = dictionary.get("paypal_reference_id_type") if dictionary.get("paypal_reference_id_type") else APIHelper.SKIP + transaction_event_code = dictionary.get("transaction_event_code") if dictionary.get("transaction_event_code") else APIHelper.SKIP + transaction_initiation_date = dictionary.get("transaction_initiation_date") if dictionary.get("transaction_initiation_date") else APIHelper.SKIP + transaction_updated_date = dictionary.get("transaction_updated_date") if dictionary.get("transaction_updated_date") else APIHelper.SKIP + transaction_amount = Money.from_dictionary(dictionary.get('transaction_amount')) if 'transaction_amount' in dictionary.keys() else APIHelper.SKIP + fee_amount = Money.from_dictionary(dictionary.get('fee_amount')) if 'fee_amount' in dictionary.keys() else APIHelper.SKIP + discount_amount = Money.from_dictionary(dictionary.get('discount_amount')) if 'discount_amount' in dictionary.keys() else APIHelper.SKIP + insurance_amount = Money.from_dictionary(dictionary.get('insurance_amount')) if 'insurance_amount' in dictionary.keys() else APIHelper.SKIP + sales_tax_amount = Money.from_dictionary(dictionary.get('sales_tax_amount')) if 'sales_tax_amount' in dictionary.keys() else APIHelper.SKIP + shipping_amount = Money.from_dictionary(dictionary.get('shipping_amount')) if 'shipping_amount' in dictionary.keys() else APIHelper.SKIP + shipping_discount_amount = Money.from_dictionary(dictionary.get('shipping_discount_amount')) if 'shipping_discount_amount' in dictionary.keys() else APIHelper.SKIP + shipping_tax_amount = Money.from_dictionary(dictionary.get('shipping_tax_amount')) if 'shipping_tax_amount' in dictionary.keys() else APIHelper.SKIP + other_amount = Money.from_dictionary(dictionary.get('other_amount')) if 'other_amount' in dictionary.keys() else APIHelper.SKIP + tip_amount = Money.from_dictionary(dictionary.get('tip_amount')) if 'tip_amount' in dictionary.keys() else APIHelper.SKIP + transaction_status = dictionary.get("transaction_status") if dictionary.get("transaction_status") else APIHelper.SKIP + transaction_subject = dictionary.get("transaction_subject") if dictionary.get("transaction_subject") else APIHelper.SKIP + transaction_note = dictionary.get("transaction_note") if dictionary.get("transaction_note") else APIHelper.SKIP + payment_tracking_id = dictionary.get("payment_tracking_id") if dictionary.get("payment_tracking_id") else APIHelper.SKIP + bank_reference_id = dictionary.get("bank_reference_id") if dictionary.get("bank_reference_id") else APIHelper.SKIP + ending_balance = Money.from_dictionary(dictionary.get('ending_balance')) if 'ending_balance' in dictionary.keys() else APIHelper.SKIP + available_balance = Money.from_dictionary(dictionary.get('available_balance')) if 'available_balance' in dictionary.keys() else APIHelper.SKIP + invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP + custom_field = dictionary.get("custom_field") if dictionary.get("custom_field") else APIHelper.SKIP + protection_eligibility = dictionary.get("protection_eligibility") if dictionary.get("protection_eligibility") else APIHelper.SKIP + credit_term = dictionary.get("credit_term") if dictionary.get("credit_term") else APIHelper.SKIP + credit_transactional_fee = Money.from_dictionary(dictionary.get('credit_transactional_fee')) if 'credit_transactional_fee' in dictionary.keys() else APIHelper.SKIP + credit_promotional_fee = Money.from_dictionary(dictionary.get('credit_promotional_fee')) if 'credit_promotional_fee' in dictionary.keys() else APIHelper.SKIP + annual_percentage_rate = dictionary.get("annual_percentage_rate") if dictionary.get("annual_percentage_rate") else APIHelper.SKIP + payment_method_type = dictionary.get("payment_method_type") if dictionary.get("payment_method_type") else APIHelper.SKIP + instrument_type = dictionary.get("instrument_type") if dictionary.get("instrument_type") else APIHelper.SKIP + instrument_sub_type = dictionary.get("instrument_sub_type") if dictionary.get("instrument_sub_type") else APIHelper.SKIP + # Return an object of this model + return cls(paypal_account_id, + transaction_id, + paypal_reference_id, + paypal_reference_id_type, + transaction_event_code, + transaction_initiation_date, + transaction_updated_date, + transaction_amount, + fee_amount, + discount_amount, + insurance_amount, + sales_tax_amount, + shipping_amount, + shipping_discount_amount, + shipping_tax_amount, + other_amount, + tip_amount, + transaction_status, + transaction_subject, + transaction_note, + payment_tracking_id, + bank_reference_id, + ending_balance, + available_balance, + invoice_id, + custom_field, + protection_eligibility, + credit_term, + credit_transactional_fee, + credit_promotional_fee, + annual_percentage_rate, + payment_method_type, + instrument_type, + instrument_sub_type) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'paypal_account_id={(self.paypal_account_id if hasattr(self, "paypal_account_id") else None)!r}, ' + f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' + f'paypal_reference_id={(self.paypal_reference_id if hasattr(self, "paypal_reference_id") else None)!r}, ' + f'paypal_reference_id_type={(self.paypal_reference_id_type if hasattr(self, "paypal_reference_id_type") else None)!r}, ' + f'transaction_event_code={(self.transaction_event_code if hasattr(self, "transaction_event_code") else None)!r}, ' + f'transaction_initiation_date={(self.transaction_initiation_date if hasattr(self, "transaction_initiation_date") else None)!r}, ' + f'transaction_updated_date={(self.transaction_updated_date if hasattr(self, "transaction_updated_date") else None)!r}, ' + f'transaction_amount={(self.transaction_amount if hasattr(self, "transaction_amount") else None)!r}, ' + f'fee_amount={(self.fee_amount if hasattr(self, "fee_amount") else None)!r}, ' + f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' + f'insurance_amount={(self.insurance_amount if hasattr(self, "insurance_amount") else None)!r}, ' + f'sales_tax_amount={(self.sales_tax_amount if hasattr(self, "sales_tax_amount") else None)!r}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!r}, ' + f'shipping_discount_amount={(self.shipping_discount_amount if hasattr(self, "shipping_discount_amount") else None)!r}, ' + f'shipping_tax_amount={(self.shipping_tax_amount if hasattr(self, "shipping_tax_amount") else None)!r}, ' + f'other_amount={(self.other_amount if hasattr(self, "other_amount") else None)!r}, ' + f'tip_amount={(self.tip_amount if hasattr(self, "tip_amount") else None)!r}, ' + f'transaction_status={(self.transaction_status if hasattr(self, "transaction_status") else None)!r}, ' + f'transaction_subject={(self.transaction_subject if hasattr(self, "transaction_subject") else None)!r}, ' + f'transaction_note={(self.transaction_note if hasattr(self, "transaction_note") else None)!r}, ' + f'payment_tracking_id={(self.payment_tracking_id if hasattr(self, "payment_tracking_id") else None)!r}, ' + f'bank_reference_id={(self.bank_reference_id if hasattr(self, "bank_reference_id") else None)!r}, ' + f'ending_balance={(self.ending_balance if hasattr(self, "ending_balance") else None)!r}, ' + f'available_balance={(self.available_balance if hasattr(self, "available_balance") else None)!r}, ' + f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!r}, ' + f'custom_field={(self.custom_field if hasattr(self, "custom_field") else None)!r}, ' + f'protection_eligibility={(self.protection_eligibility if hasattr(self, "protection_eligibility") else None)!r}, ' + f'credit_term={(self.credit_term if hasattr(self, "credit_term") else None)!r}, ' + f'credit_transactional_fee={(self.credit_transactional_fee if hasattr(self, "credit_transactional_fee") else None)!r}, ' + f'credit_promotional_fee={(self.credit_promotional_fee if hasattr(self, "credit_promotional_fee") else None)!r}, ' + f'annual_percentage_rate={(self.annual_percentage_rate if hasattr(self, "annual_percentage_rate") else None)!r}, ' + f'payment_method_type={(self.payment_method_type if hasattr(self, "payment_method_type") else None)!r}, ' + f'instrument_type={(self.instrument_type if hasattr(self, "instrument_type") else None)!r}, ' + f'instrument_sub_type={(self.instrument_sub_type if hasattr(self, "instrument_sub_type") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'paypal_account_id={(self.paypal_account_id if hasattr(self, "paypal_account_id") else None)!s}, ' + f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' + f'paypal_reference_id={(self.paypal_reference_id if hasattr(self, "paypal_reference_id") else None)!s}, ' + f'paypal_reference_id_type={(self.paypal_reference_id_type if hasattr(self, "paypal_reference_id_type") else None)!s}, ' + f'transaction_event_code={(self.transaction_event_code if hasattr(self, "transaction_event_code") else None)!s}, ' + f'transaction_initiation_date={(self.transaction_initiation_date if hasattr(self, "transaction_initiation_date") else None)!s}, ' + f'transaction_updated_date={(self.transaction_updated_date if hasattr(self, "transaction_updated_date") else None)!s}, ' + f'transaction_amount={(self.transaction_amount if hasattr(self, "transaction_amount") else None)!s}, ' + f'fee_amount={(self.fee_amount if hasattr(self, "fee_amount") else None)!s}, ' + f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' + f'insurance_amount={(self.insurance_amount if hasattr(self, "insurance_amount") else None)!s}, ' + f'sales_tax_amount={(self.sales_tax_amount if hasattr(self, "sales_tax_amount") else None)!s}, ' + f'shipping_amount={(self.shipping_amount if hasattr(self, "shipping_amount") else None)!s}, ' + f'shipping_discount_amount={(self.shipping_discount_amount if hasattr(self, "shipping_discount_amount") else None)!s}, ' + f'shipping_tax_amount={(self.shipping_tax_amount if hasattr(self, "shipping_tax_amount") else None)!s}, ' + f'other_amount={(self.other_amount if hasattr(self, "other_amount") else None)!s}, ' + f'tip_amount={(self.tip_amount if hasattr(self, "tip_amount") else None)!s}, ' + f'transaction_status={(self.transaction_status if hasattr(self, "transaction_status") else None)!s}, ' + f'transaction_subject={(self.transaction_subject if hasattr(self, "transaction_subject") else None)!s}, ' + f'transaction_note={(self.transaction_note if hasattr(self, "transaction_note") else None)!s}, ' + f'payment_tracking_id={(self.payment_tracking_id if hasattr(self, "payment_tracking_id") else None)!s}, ' + f'bank_reference_id={(self.bank_reference_id if hasattr(self, "bank_reference_id") else None)!s}, ' + f'ending_balance={(self.ending_balance if hasattr(self, "ending_balance") else None)!s}, ' + f'available_balance={(self.available_balance if hasattr(self, "available_balance") else None)!s}, ' + f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!s}, ' + f'custom_field={(self.custom_field if hasattr(self, "custom_field") else None)!s}, ' + f'protection_eligibility={(self.protection_eligibility if hasattr(self, "protection_eligibility") else None)!s}, ' + f'credit_term={(self.credit_term if hasattr(self, "credit_term") else None)!s}, ' + f'credit_transactional_fee={(self.credit_transactional_fee if hasattr(self, "credit_transactional_fee") else None)!s}, ' + f'credit_promotional_fee={(self.credit_promotional_fee if hasattr(self, "credit_promotional_fee") else None)!s}, ' + f'annual_percentage_rate={(self.annual_percentage_rate if hasattr(self, "annual_percentage_rate") else None)!s}, ' + f'payment_method_type={(self.payment_method_type if hasattr(self, "payment_method_type") else None)!s}, ' + f'instrument_type={(self.instrument_type if hasattr(self, "instrument_type") else None)!s}, ' + f'instrument_sub_type={(self.instrument_sub_type if hasattr(self, "instrument_sub_type") else None)!s})') diff --git a/paypalserversdk/models/order_update_callback_error_response_details.py b/paypalserversdk/models/transaction_search_error_details.py similarity index 61% rename from paypalserversdk/models/order_update_callback_error_response_details.py rename to paypalserversdk/models/transaction_search_error_details.py index fbf83c2..56b8964 100644 --- a/paypalserversdk/models/order_update_callback_error_response_details.py +++ b/paypalserversdk/models/transaction_search_error_details.py @@ -9,9 +9,9 @@ from paypalserversdk.api_helper import APIHelper -class OrderUpdateCallbackErrorResponseDetails(object): +class TransactionSearchErrorDetails(object): - """Implementation of the 'Order Update Callback Error Response Details' model. + """Implementation of the 'Transaction Search Error Details' model. The error details. Required for client-side `4XX` errors. @@ -20,7 +20,12 @@ class OrderUpdateCallbackErrorResponseDetails(object): body, set this value to the field's JSON pointer value. Required for client-side errors. value (str): The value of the field that caused the error. + location (str): The location of the field that caused the error. Value + is `body`, `path`, or `query`. issue (str): The unique, fine-grained application-level error code. + description (str): The human-readable description for an issue. The + description can change over the lifetime of an API, so clients + must not depend on this value. """ @@ -28,26 +33,35 @@ class OrderUpdateCallbackErrorResponseDetails(object): _names = { "issue": 'issue', "field": 'field', - "value": 'value' + "value": 'value', + "location": 'location', + "description": 'description' } _optionals = [ 'field', 'value', + 'location', + 'description', ] def __init__(self, issue=None, field=APIHelper.SKIP, - value=APIHelper.SKIP): - """Constructor for the OrderUpdateCallbackErrorResponseDetails class""" + value=APIHelper.SKIP, + location='body', + description=APIHelper.SKIP): + """Constructor for the TransactionSearchErrorDetails class""" # Initialize members of the class if field is not APIHelper.SKIP: self.field = field if value is not APIHelper.SKIP: self.value = value + self.location = location self.issue = issue + if description is not APIHelper.SKIP: + self.description = description @classmethod def from_dictionary(cls, @@ -71,19 +85,27 @@ def from_dictionary(cls, issue = dictionary.get("issue") if dictionary.get("issue") else None field = dictionary.get("field") if dictionary.get("field") else APIHelper.SKIP value = dictionary.get("value") if dictionary.get("value") else APIHelper.SKIP + location = dictionary.get("location") if dictionary.get("location") else 'body' + description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP # Return an object of this model return cls(issue, field, - value) + value, + location, + description) def __repr__(self): return (f'{self.__class__.__name__}(' f'field={(self.field if hasattr(self, "field") else None)!r}, ' f'value={(self.value if hasattr(self, "value") else None)!r}, ' - f'issue={self.issue!r})') + f'location={(self.location if hasattr(self, "location") else None)!r}, ' + f'issue={self.issue!r}, ' + f'description={(self.description if hasattr(self, "description") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' f'field={(self.field if hasattr(self, "field") else None)!s}, ' f'value={(self.value if hasattr(self, "value") else None)!s}, ' - f'issue={self.issue!s})') + f'location={(self.location if hasattr(self, "location") else None)!s}, ' + f'issue={self.issue!s}, ' + f'description={(self.description if hasattr(self, "description") else None)!s})') diff --git a/paypalserversdk/models/transactions_list.py b/paypalserversdk/models/transactions_list.py new file mode 100644 index 0000000..484ea0f --- /dev/null +++ b/paypalserversdk/models/transactions_list.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.subscription_transaction_details import SubscriptionTransactionDetails + + +class TransactionsList(object): + + """Implementation of the 'Transactions List' model. + + The list transactions for a subscription request details. + + Attributes: + transactions (List[SubscriptionTransactionDetails]): An array of + transactions. + total_items (int): The total number of items. + total_pages (int): The total number of pages. + links (List[LinkDescription]): An array of request-related [HATEOAS + links](/docs/api/reference/api-responses/#hateoas-links). + + """ + + # Create a mapping from Model property names to API property names + _names = { + "transactions": 'transactions', + "total_items": 'total_items', + "total_pages": 'total_pages', + "links": 'links' + } + + _optionals = [ + 'transactions', + 'total_items', + 'total_pages', + 'links', + ] + + def __init__(self, + transactions=APIHelper.SKIP, + total_items=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + links=APIHelper.SKIP): + """Constructor for the TransactionsList class""" + + # Initialize members of the class + if transactions is not APIHelper.SKIP: + self.transactions = transactions + if total_items is not APIHelper.SKIP: + self.total_items = total_items + if total_pages is not APIHelper.SKIP: + self.total_pages = total_pages + if links is not APIHelper.SKIP: + self.links = links + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + transactions = None + if dictionary.get('transactions') is not None: + transactions = [SubscriptionTransactionDetails.from_dictionary(x) for x in dictionary.get('transactions')] + else: + transactions = APIHelper.SKIP + total_items = dictionary.get("total_items") if dictionary.get("total_items") else APIHelper.SKIP + total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + # Return an object of this model + return cls(transactions, + total_items, + total_pages, + links) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'transactions={(self.transactions if hasattr(self, "transactions") else None)!r}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!r}, ' + f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'transactions={(self.transactions if hasattr(self, "transactions") else None)!s}, ' + f'total_items={(self.total_items if hasattr(self, "total_items") else None)!s}, ' + f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s})') diff --git a/paypalserversdk/models/update_pricing_scheme.py b/paypalserversdk/models/update_pricing_scheme.py new file mode 100644 index 0000000..6f1ec38 --- /dev/null +++ b/paypalserversdk/models/update_pricing_scheme.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme + + +class UpdatePricingScheme(object): + + """Implementation of the 'Update Pricing Scheme' model. + + The update pricing scheme request details. + + Attributes: + billing_cycle_sequence (int): The billing cycle sequence. + pricing_scheme (SubscriptionPricingScheme): The pricing scheme details. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "billing_cycle_sequence": 'billing_cycle_sequence', + "pricing_scheme": 'pricing_scheme' + } + + def __init__(self, + billing_cycle_sequence=None, + pricing_scheme=None): + """Constructor for the UpdatePricingScheme class""" + + # Initialize members of the class + self.billing_cycle_sequence = billing_cycle_sequence + self.pricing_scheme = pricing_scheme + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + billing_cycle_sequence = dictionary.get("billing_cycle_sequence") if dictionary.get("billing_cycle_sequence") else None + pricing_scheme = SubscriptionPricingScheme.from_dictionary(dictionary.get('pricing_scheme')) if dictionary.get('pricing_scheme') else None + # Return an object of this model + return cls(billing_cycle_sequence, + pricing_scheme) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'billing_cycle_sequence={self.billing_cycle_sequence!r}, ' + f'pricing_scheme={self.pricing_scheme!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'billing_cycle_sequence={self.billing_cycle_sequence!s}, ' + f'pricing_scheme={self.pricing_scheme!s})') diff --git a/paypalserversdk/models/update_pricing_schemes_request.py b/paypalserversdk/models/update_pricing_schemes_request.py new file mode 100644 index 0000000..a7ef4f3 --- /dev/null +++ b/paypalserversdk/models/update_pricing_schemes_request.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.models.update_pricing_scheme import UpdatePricingScheme + + +class UpdatePricingSchemesRequest(object): + + """Implementation of the 'Update Pricing Schemes Request' model. + + The update pricing scheme request details. + + Attributes: + pricing_schemes (List[UpdatePricingScheme]): An array of pricing + schemes. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "pricing_schemes": 'pricing_schemes' + } + + def __init__(self, + pricing_schemes=None): + """Constructor for the UpdatePricingSchemesRequest class""" + + # Initialize members of the class + self.pricing_schemes = pricing_schemes + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + pricing_schemes = None + if dictionary.get('pricing_schemes') is not None: + pricing_schemes = [UpdatePricingScheme.from_dictionary(x) for x in dictionary.get('pricing_schemes')] + # Return an object of this model + return cls(pricing_schemes) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'pricing_schemes={self.pricing_schemes!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'pricing_schemes={self.pricing_schemes!s})') diff --git a/paypalserversdk/models/vault_apple_pay_request.py b/paypalserversdk/models/vault_apple_pay_request.py new file mode 100644 index 0000000..5934692 --- /dev/null +++ b/paypalserversdk/models/vault_apple_pay_request.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.apple_pay_request_card import ApplePayRequestCard + + +class VaultApplePayRequest(object): + + """Implementation of the 'Vault Apple Pay Request' model. + + A resource representing a request to vault Apple Pay. + + Attributes: + token (str): Encrypted Apple Pay token, containing card information. + This token would be base64 encoded. + card (ApplePayRequestCard): The payment card to be used to fund a + payment. Can be a credit or debit card. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "token": 'token', + "card": 'card' + } + + _optionals = [ + 'token', + 'card', + ] + + def __init__(self, + token=APIHelper.SKIP, + card=APIHelper.SKIP): + """Constructor for the VaultApplePayRequest class""" + + # Initialize members of the class + if token is not APIHelper.SKIP: + self.token = token + if card is not APIHelper.SKIP: + self.card = card + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + token = dictionary.get("token") if dictionary.get("token") else APIHelper.SKIP + card = ApplePayRequestCard.from_dictionary(dictionary.get('card')) if 'card' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(token, + card) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'token={(self.token if hasattr(self, "token") else None)!r}, ' + f'card={(self.card if hasattr(self, "card") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'token={(self.token if hasattr(self, "token") else None)!s}, ' + f'card={(self.card if hasattr(self, "card") else None)!s})') diff --git a/paypalserversdk/models/setup_token_card_experience_context.py b/paypalserversdk/models/vault_card_experience_context.py similarity index 76% rename from paypalserversdk/models/setup_token_card_experience_context.py rename to paypalserversdk/models/vault_card_experience_context.py index e604938..b03ac88 100644 --- a/paypalserversdk/models/setup_token_card_experience_context.py +++ b/paypalserversdk/models/vault_card_experience_context.py @@ -9,11 +9,11 @@ from paypalserversdk.api_helper import APIHelper -class SetupTokenCardExperienceContext(object): +class VaultCardExperienceContext(object): - """Implementation of the 'Setup Token Card Experience Context' model. + """Implementation of the 'Vault Card Experience Context' model. - Customizes the Vault creation flow experience for your customers. + A resource representing an experience context of vault a card. Attributes: brand_name (str): The label that overrides the business name in the @@ -36,8 +36,11 @@ class SetupTokenCardExperienceContext(object): cancel_url (str): The URL where the customer is redirected after customer cancels or leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS. - vault_instruction (VaultInstructionAction): Vault Instruction on - action to be performed after a successful payer approval. + vault_instruction (VaultInstructionAction): DEPRECATED. Vault + Instruction on action to be performed after a successful payer + approval. + user_action (VaultUserAction): User Action on action to be performed + after a successful payer approval. """ @@ -47,7 +50,8 @@ class SetupTokenCardExperienceContext(object): "locale": 'locale', "return_url": 'return_url', "cancel_url": 'cancel_url', - "vault_instruction": 'vault_instruction' + "vault_instruction": 'vault_instruction', + "user_action": 'user_action' } _optionals = [ @@ -56,6 +60,7 @@ class SetupTokenCardExperienceContext(object): 'return_url', 'cancel_url', 'vault_instruction', + 'user_action', ] def __init__(self, @@ -63,8 +68,9 @@ def __init__(self, locale=APIHelper.SKIP, return_url=APIHelper.SKIP, cancel_url=APIHelper.SKIP, - vault_instruction='ON_CREATE_PAYMENT_TOKENS'): - """Constructor for the SetupTokenCardExperienceContext class""" + vault_instruction=APIHelper.SKIP, + user_action='CONTINUE'): + """Constructor for the VaultCardExperienceContext class""" # Initialize members of the class if brand_name is not APIHelper.SKIP: @@ -75,7 +81,9 @@ def __init__(self, self.return_url = return_url if cancel_url is not APIHelper.SKIP: self.cancel_url = cancel_url - self.vault_instruction = vault_instruction + if vault_instruction is not APIHelper.SKIP: + self.vault_instruction = vault_instruction + self.user_action = user_action @classmethod def from_dictionary(cls, @@ -100,13 +108,15 @@ def from_dictionary(cls, locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP return_url = dictionary.get("return_url") if dictionary.get("return_url") else APIHelper.SKIP cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else APIHelper.SKIP - vault_instruction = dictionary.get("vault_instruction") if dictionary.get("vault_instruction") else 'ON_CREATE_PAYMENT_TOKENS' + vault_instruction = dictionary.get("vault_instruction") if dictionary.get("vault_instruction") else APIHelper.SKIP + user_action = dictionary.get("user_action") if dictionary.get("user_action") else 'CONTINUE' # Return an object of this model return cls(brand_name, locale, return_url, cancel_url, - vault_instruction) + vault_instruction, + user_action) def __repr__(self): return (f'{self.__class__.__name__}(' @@ -114,7 +124,8 @@ def __repr__(self): f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' f'return_url={(self.return_url if hasattr(self, "return_url") else None)!r}, ' f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!r}, ' - f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!r})') + f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!r}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' @@ -122,4 +133,5 @@ def __str__(self): f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' f'return_url={(self.return_url if hasattr(self, "return_url") else None)!s}, ' f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!s}, ' - f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!s})') + f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!s}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!s})') diff --git a/paypalserversdk/models/vault_experience_context.py b/paypalserversdk/models/vault_experience_context.py index cec75a4..2646ada 100644 --- a/paypalserversdk/models/vault_experience_context.py +++ b/paypalserversdk/models/vault_experience_context.py @@ -7,6 +7,7 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.app_switch_context import AppSwitchContext class VaultExperienceContext(object): @@ -36,10 +37,16 @@ class VaultExperienceContext(object): cancel_url (str): The URL where the customer is redirected after customer cancels or leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS. - shipping_preference (OrderApplicationContextShippingPreference): The + shipping_preference (ExperienceContextShippingPreference): The shipping preference. This only applies to PayPal payment source. - vault_instruction (VaultInstructionAction): Vault Instruction on - action to be performed after a successful payer approval. + vault_instruction (VaultInstructionAction): DEPRECATED. Vault + Instruction on action to be performed after a successful payer + approval. + app_switch_context (AppSwitchContext): Merchant provided details of + the native app or mobile web browser to facilitate buyer's app + switch to the PayPal consumer app. + user_action (VaultUserAction): User Action on action to be performed + after a successful payer approval. """ @@ -50,7 +57,9 @@ class VaultExperienceContext(object): "return_url": 'return_url', "cancel_url": 'cancel_url', "shipping_preference": 'shipping_preference', - "vault_instruction": 'vault_instruction' + "vault_instruction": 'vault_instruction', + "app_switch_context": 'app_switch_context', + "user_action": 'user_action' } _optionals = [ @@ -60,6 +69,8 @@ class VaultExperienceContext(object): 'cancel_url', 'shipping_preference', 'vault_instruction', + 'app_switch_context', + 'user_action', ] def __init__(self, @@ -68,7 +79,9 @@ def __init__(self, return_url=APIHelper.SKIP, cancel_url=APIHelper.SKIP, shipping_preference='GET_FROM_FILE', - vault_instruction='ON_CREATE_PAYMENT_TOKENS'): + vault_instruction=APIHelper.SKIP, + app_switch_context=APIHelper.SKIP, + user_action='CONTINUE'): """Constructor for the VaultExperienceContext class""" # Initialize members of the class @@ -81,7 +94,11 @@ def __init__(self, if cancel_url is not APIHelper.SKIP: self.cancel_url = cancel_url self.shipping_preference = shipping_preference - self.vault_instruction = vault_instruction + if vault_instruction is not APIHelper.SKIP: + self.vault_instruction = vault_instruction + if app_switch_context is not APIHelper.SKIP: + self.app_switch_context = app_switch_context + self.user_action = user_action @classmethod def from_dictionary(cls, @@ -107,14 +124,18 @@ def from_dictionary(cls, return_url = dictionary.get("return_url") if dictionary.get("return_url") else APIHelper.SKIP cancel_url = dictionary.get("cancel_url") if dictionary.get("cancel_url") else APIHelper.SKIP shipping_preference = dictionary.get("shipping_preference") if dictionary.get("shipping_preference") else 'GET_FROM_FILE' - vault_instruction = dictionary.get("vault_instruction") if dictionary.get("vault_instruction") else 'ON_CREATE_PAYMENT_TOKENS' + vault_instruction = dictionary.get("vault_instruction") if dictionary.get("vault_instruction") else APIHelper.SKIP + app_switch_context = AppSwitchContext.from_dictionary(dictionary.get('app_switch_context')) if 'app_switch_context' in dictionary.keys() else APIHelper.SKIP + user_action = dictionary.get("user_action") if dictionary.get("user_action") else 'CONTINUE' # Return an object of this model return cls(brand_name, locale, return_url, cancel_url, shipping_preference, - vault_instruction) + vault_instruction, + app_switch_context, + user_action) def __repr__(self): return (f'{self.__class__.__name__}(' @@ -123,7 +144,9 @@ def __repr__(self): f'return_url={(self.return_url if hasattr(self, "return_url") else None)!r}, ' f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!r}, ' f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!r}, ' - f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!r})') + f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!r}, ' + f'app_switch_context={(self.app_switch_context if hasattr(self, "app_switch_context") else None)!r}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' @@ -132,4 +155,6 @@ def __str__(self): f'return_url={(self.return_url if hasattr(self, "return_url") else None)!s}, ' f'cancel_url={(self.cancel_url if hasattr(self, "cancel_url") else None)!s}, ' f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!s}, ' - f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!s})') + f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!s}, ' + f'app_switch_context={(self.app_switch_context if hasattr(self, "app_switch_context") else None)!s}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!s})') diff --git a/paypalserversdk/models/vault_paypal_wallet_request.py b/paypalserversdk/models/vault_paypal_wallet_request.py index ceefc1a..dbd46ed 100644 --- a/paypalserversdk/models/vault_paypal_wallet_request.py +++ b/paypalserversdk/models/vault_paypal_wallet_request.py @@ -42,8 +42,8 @@ class VaultPaypalWalletRequest(object): either a business or a consumer. billing_plan (Plan): The merchant level Recurring Billing plan metadata for the Billing Agreement. - experience_context (VaultExperienceContext): Customizes the Vault - creation flow experience for your customers. + experience_context (VaultExperienceContext): A resource representing + an experience context of vault PayPal Wallet. """ diff --git a/paypalserversdk/models/vault_user_action.py b/paypalserversdk/models/vault_user_action.py new file mode 100644 index 0000000..bf9095c --- /dev/null +++ b/paypalserversdk/models/vault_user_action.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class VaultUserAction(object): + + """Implementation of the 'Vault User Action' enum. + + User Action on action to be performed after a successful payer approval. + + Attributes: + SETUP_NOW: After you redirect the customer to the PayPal payment page, + a Setup Now button appears. Use this option when no additional + inputs are needed from merchant site and to create the billing + agreement immediately when the customer clicks Setup Now. + CONTINUE: After you redirect the customer to the PayPal payment page, + a Continue button appears. Use this option when you want to + redirect the customer from the completed payment page to the + merchant site for additional inputs without immediately creating + the billing agreement. + + """ + SETUP_NOW = 'SETUP_NOW' + + CONTINUE = 'CONTINUE' + diff --git a/paypalserversdk/models/vault_venmo_request.py b/paypalserversdk/models/vault_venmo_request.py index 4aa29f0..44b7ef1 100644 --- a/paypalserversdk/models/vault_venmo_request.py +++ b/paypalserversdk/models/vault_venmo_request.py @@ -7,14 +7,16 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.vault_venmo_experience_context import VaultVenmoExperienceContext from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails +from paypalserversdk.models.venmo_experience_context import VenmoExperienceContext class VaultVenmoRequest(object): """Implementation of the 'Vault Venmo Request' model. + A resource representing a request to vault Venmo. + Attributes: description (str): The description displayed to the consumer on the approval flow for a digital wallet, as well as on the merchant @@ -37,8 +39,8 @@ class VaultVenmoRequest(object): associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer. - experience_context (VaultVenmoExperienceContext): Customizes the Vault - creation flow experience for your customers. + experience_context (VenmoExperienceContext): A resource representing + an experience context of vault a venmo account. """ @@ -113,7 +115,7 @@ def from_dictionary(cls, permit_multiple_payment_tokens = dictionary.get("permit_multiple_payment_tokens") if dictionary.get("permit_multiple_payment_tokens") else False usage_type = dictionary.get("usage_type") if dictionary.get("usage_type") else APIHelper.SKIP customer_type = dictionary.get("customer_type") if dictionary.get("customer_type") else APIHelper.SKIP - experience_context = VaultVenmoExperienceContext.from_dictionary(dictionary.get('experience_context')) if 'experience_context' in dictionary.keys() else APIHelper.SKIP + experience_context = VenmoExperienceContext.from_dictionary(dictionary.get('experience_context')) if 'experience_context' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(description, usage_pattern, diff --git a/paypalserversdk/models/vaulted_digital_wallet_shipping_details.py b/paypalserversdk/models/vaulted_digital_wallet_shipping_details.py index 4db761d..eedefc5 100644 --- a/paypalserversdk/models/vaulted_digital_wallet_shipping_details.py +++ b/paypalserversdk/models/vaulted_digital_wallet_shipping_details.py @@ -20,6 +20,11 @@ class VaultedDigitalWalletShippingDetails(object): Attributes: name (ShippingName): The name of the party. + email_address (str): The internationalized email address. Note: Up to + 64 characters are allowed before and 255 characters are allowed + after the @ sign. However, the generally accepted maximum length + for an email address is 254 characters. The pattern verifies that + an unquoted @ sign exists. phone_number (PhoneNumberWithCountryCode): The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). @@ -38,6 +43,7 @@ class VaultedDigitalWalletShippingDetails(object): # Create a mapping from Model property names to API property names _names = { "name": 'name', + "email_address": 'email_address', "phone_number": 'phone_number', "mtype": 'type', "address": 'address' @@ -45,6 +51,7 @@ class VaultedDigitalWalletShippingDetails(object): _optionals = [ 'name', + 'email_address', 'phone_number', 'mtype', 'address', @@ -52,6 +59,7 @@ class VaultedDigitalWalletShippingDetails(object): def __init__(self, name=APIHelper.SKIP, + email_address=APIHelper.SKIP, phone_number=APIHelper.SKIP, mtype=APIHelper.SKIP, address=APIHelper.SKIP): @@ -60,6 +68,8 @@ def __init__(self, # Initialize members of the class if name is not APIHelper.SKIP: self.name = name + if email_address is not APIHelper.SKIP: + self.email_address = email_address if phone_number is not APIHelper.SKIP: self.phone_number = phone_number if mtype is not APIHelper.SKIP: @@ -87,11 +97,13 @@ def from_dictionary(cls, # Extract variables from the dictionary name = ShippingName.from_dictionary(dictionary.get('name')) if 'name' in dictionary.keys() else APIHelper.SKIP + email_address = dictionary.get("email_address") if dictionary.get("email_address") else APIHelper.SKIP phone_number = PhoneNumberWithCountryCode.from_dictionary(dictionary.get('phone_number')) if 'phone_number' in dictionary.keys() else APIHelper.SKIP mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP address = Address.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(name, + email_address, phone_number, mtype, address) @@ -99,6 +111,7 @@ def from_dictionary(cls, def __repr__(self): return (f'{self.__class__.__name__}(' f'name={(self.name if hasattr(self, "name") else None)!r}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!r}, ' f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!r}, ' f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' f'address={(self.address if hasattr(self, "address") else None)!r})') @@ -106,6 +119,7 @@ def __repr__(self): def __str__(self): return (f'{self.__class__.__name__}(' f'name={(self.name if hasattr(self, "name") else None)!s}, ' + f'email_address={(self.email_address if hasattr(self, "email_address") else None)!s}, ' f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!s}, ' f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' f'address={(self.address if hasattr(self, "address") else None)!s})') diff --git a/paypalserversdk/models/vault_venmo_experience_context.py b/paypalserversdk/models/venmo_experience_context.py similarity index 65% rename from paypalserversdk/models/vault_venmo_experience_context.py rename to paypalserversdk/models/venmo_experience_context.py index 9272b31..cef8bad 100644 --- a/paypalserversdk/models/vault_venmo_experience_context.py +++ b/paypalserversdk/models/venmo_experience_context.py @@ -9,20 +9,23 @@ from paypalserversdk.api_helper import APIHelper -class VaultVenmoExperienceContext(object): +class VenmoExperienceContext(object): - """Implementation of the 'Vault Venmo Experience Context' model. + """Implementation of the 'Venmo Experience Context' model. - Customizes the Vault creation flow experience for your customers. + A resource representing an experience context of vault a venmo account. Attributes: brand_name (str): The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode. - shipping_preference (OrderApplicationContextShippingPreference): The + shipping_preference (ExperienceContextShippingPreference): The shipping preference. This only applies to PayPal payment source. - vault_instruction (VaultInstructionAction): Vault Instruction on - action to be performed after a successful payer approval. + vault_instruction (VaultInstructionAction): DEPRECATED. Vault + Instruction on action to be performed after a successful payer + approval. + user_action (VaultUserAction): User Action on action to be performed + after a successful payer approval. """ @@ -30,26 +33,31 @@ class VaultVenmoExperienceContext(object): _names = { "brand_name": 'brand_name', "shipping_preference": 'shipping_preference', - "vault_instruction": 'vault_instruction' + "vault_instruction": 'vault_instruction', + "user_action": 'user_action' } _optionals = [ 'brand_name', 'shipping_preference', 'vault_instruction', + 'user_action', ] def __init__(self, brand_name=APIHelper.SKIP, shipping_preference='GET_FROM_FILE', - vault_instruction='ON_CREATE_PAYMENT_TOKENS'): - """Constructor for the VaultVenmoExperienceContext class""" + vault_instruction=APIHelper.SKIP, + user_action='CONTINUE'): + """Constructor for the VenmoExperienceContext class""" # Initialize members of the class if brand_name is not APIHelper.SKIP: self.brand_name = brand_name self.shipping_preference = shipping_preference - self.vault_instruction = vault_instruction + if vault_instruction is not APIHelper.SKIP: + self.vault_instruction = vault_instruction + self.user_action = user_action @classmethod def from_dictionary(cls, @@ -72,20 +80,24 @@ def from_dictionary(cls, # Extract variables from the dictionary brand_name = dictionary.get("brand_name") if dictionary.get("brand_name") else APIHelper.SKIP shipping_preference = dictionary.get("shipping_preference") if dictionary.get("shipping_preference") else 'GET_FROM_FILE' - vault_instruction = dictionary.get("vault_instruction") if dictionary.get("vault_instruction") else 'ON_CREATE_PAYMENT_TOKENS' + vault_instruction = dictionary.get("vault_instruction") if dictionary.get("vault_instruction") else APIHelper.SKIP + user_action = dictionary.get("user_action") if dictionary.get("user_action") else 'CONTINUE' # Return an object of this model return cls(brand_name, shipping_preference, - vault_instruction) + vault_instruction, + user_action) def __repr__(self): return (f'{self.__class__.__name__}(' f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!r}, ' f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!r}, ' - f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!r})') + f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!r}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!s}, ' f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!s}, ' - f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!s})') + f'vault_instruction={(self.vault_instruction if hasattr(self, "vault_instruction") else None)!s}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!s})') diff --git a/paypalserversdk/models/venmo_payment_token.py b/paypalserversdk/models/venmo_payment_token.py index f9f552a..7c056dc 100644 --- a/paypalserversdk/models/venmo_payment_token.py +++ b/paypalserversdk/models/venmo_payment_token.py @@ -17,6 +17,8 @@ class VenmoPaymentToken(object): """Implementation of the 'Venmo Payment Token' model. + Full representation of a Venmo Payment Token. + Attributes: description (str): The description displayed to the consumer on the approval flow for a digital wallet, as well as on the merchant @@ -39,11 +41,12 @@ class VenmoPaymentToken(object): associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer. - email_address (str): The internationalized email address. Note: Up to - 64 characters are allowed before and 255 characters are allowed - after the @ sign. However, the generally accepted maximum length - for an email address is 254 characters. The pattern verifies that - an unquoted @ sign exists. + email_address (str): The internationalized email + address.
Note: Up to 64 characters are + allowed before and 255 characters are allowed after the + @ sign. However, the generally accepted maximum + length for an email address is 254 characters. The pattern + verifies that an unquoted @ sign exists.
payer_id (str): The account identifier for a PayPal account. name (Name): The name of the party. phone (PhoneWithType): The phone information. diff --git a/paypalserversdk/models/venmo_vault_response.py b/paypalserversdk/models/venmo_vault_response.py new file mode 100644 index 0000000..21661b8 --- /dev/null +++ b/paypalserversdk/models/venmo_vault_response.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.customer_information import CustomerInformation +from paypalserversdk.models.link_description import LinkDescription + + +class VenmoVaultResponse(object): + + """Implementation of the 'Venmo Vault Response' model. + + The details about a saved venmo payment source. + + Attributes: + id (str): The PayPal-generated ID for the saved payment source. + status (VenmoVaultResponseStatus): The vault status. + links (List[LinkDescription]): An array of request-related HATEOAS + links. + customer (CustomerInformation): This object represents a merchant’s + customer, allowing them to store contact details, and track all + payments associated with the same customer. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": 'id', + "status": 'status', + "links": 'links', + "customer": 'customer' + } + + _optionals = [ + 'id', + 'status', + 'links', + 'customer', + ] + + def __init__(self, + id=APIHelper.SKIP, + status=APIHelper.SKIP, + links=APIHelper.SKIP, + customer=APIHelper.SKIP): + """Constructor for the VenmoVaultResponse class""" + + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if status is not APIHelper.SKIP: + self.status = status + if links is not APIHelper.SKIP: + self.links = links + if customer is not APIHelper.SKIP: + self.customer = customer + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP + status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP + links = None + if dictionary.get('links') is not None: + links = [LinkDescription.from_dictionary(x) for x in dictionary.get('links')] + else: + links = APIHelper.SKIP + customer = CustomerInformation.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP + # Return an object of this model + return cls(id, + status, + links, + customer) + + def __repr__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!r}, ' + f'status={(self.status if hasattr(self, "status") else None)!r}, ' + f'links={(self.links if hasattr(self, "links") else None)!r}, ' + f'customer={(self.customer if hasattr(self, "customer") else None)!r})') + + def __str__(self): + return (f'{self.__class__.__name__}(' + f'id={(self.id if hasattr(self, "id") else None)!s}, ' + f'status={(self.status if hasattr(self, "status") else None)!s}, ' + f'links={(self.links if hasattr(self, "links") else None)!s}, ' + f'customer={(self.customer if hasattr(self, "customer") else None)!s})') diff --git a/paypalserversdk/models/venmo_vault_response_status.py b/paypalserversdk/models/venmo_vault_response_status.py new file mode 100644 index 0000000..91ec1c6 --- /dev/null +++ b/paypalserversdk/models/venmo_vault_response_status.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class VenmoVaultResponseStatus(object): + + """Implementation of the 'Venmo Vault Response Status' enum. + + The vault status. + + Attributes: + VAULTED: The payment source has been saved in your customer's vault. + This vault status reflects `/v3/vault` status. + CREATED: DEPRECATED. The payment source has been saved in your + customer's vault. This status applies to deprecated integration + patterns and will not be returned for v3/vault integrations. + APPROVED: Customer has approved the action of saving the specified + payment_source into their vault. Use v3/vault/payment-tokens with + given setup_token to save the payment source in the vault + + """ + VAULTED = 'VAULTED' + + CREATED = 'CREATED' + + APPROVED = 'APPROVED' + diff --git a/paypalserversdk/models/venmo_wallet_attributes_response.py b/paypalserversdk/models/venmo_wallet_attributes_response.py index a6d6dca..efafc93 100644 --- a/paypalserversdk/models/venmo_wallet_attributes_response.py +++ b/paypalserversdk/models/venmo_wallet_attributes_response.py @@ -7,7 +7,7 @@ https://www.apimatic.io ). """ from paypalserversdk.api_helper import APIHelper -from paypalserversdk.models.vault_response import VaultResponse +from paypalserversdk.models.venmo_vault_response import VenmoVaultResponse class VenmoWalletAttributesResponse(object): @@ -17,7 +17,8 @@ class VenmoWalletAttributesResponse(object): Additional attributes associated with the use of a Venmo Wallet. Attributes: - vault (VaultResponse): The details about a saved payment source. + vault (VenmoVaultResponse): The details about a saved venmo payment + source. """ @@ -57,7 +58,7 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - vault = VaultResponse.from_dictionary(dictionary.get('vault')) if 'vault' in dictionary.keys() else APIHelper.SKIP + vault = VenmoVaultResponse.from_dictionary(dictionary.get('vault')) if 'vault' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(vault) diff --git a/paypalserversdk/models/venmo_wallet_experience_context.py b/paypalserversdk/models/venmo_wallet_experience_context.py index 136cf7a..8f9b5e8 100644 --- a/paypalserversdk/models/venmo_wallet_experience_context.py +++ b/paypalserversdk/models/venmo_wallet_experience_context.py @@ -22,10 +22,12 @@ class VenmoWalletExperienceContext(object): Attributes: brand_name (str): The business name of the merchant. The pattern is defined by an external party and supports Unicode. - shipping_preference (ShippingPreference): The location from which the - shipping address is derived. + shipping_preference (VenmoWalletExperienceContextShippingPreference): + The location from which the shipping address is derived. order_update_callback_config (CallbackConfiguration): CallBack Configuration that the merchant can provide to PayPal/Venmo. + user_action (VenmoWalletExperienceContextUserAction): Configures a + Continue or Pay Now checkout flow. """ @@ -33,19 +35,22 @@ class VenmoWalletExperienceContext(object): _names = { "brand_name": 'brand_name', "shipping_preference": 'shipping_preference', - "order_update_callback_config": 'order_update_callback_config' + "order_update_callback_config": 'order_update_callback_config', + "user_action": 'user_action' } _optionals = [ 'brand_name', 'shipping_preference', 'order_update_callback_config', + 'user_action', ] def __init__(self, brand_name=APIHelper.SKIP, shipping_preference='GET_FROM_FILE', - order_update_callback_config=APIHelper.SKIP): + order_update_callback_config=APIHelper.SKIP, + user_action='CONTINUE'): """Constructor for the VenmoWalletExperienceContext class""" # Initialize members of the class @@ -54,6 +59,7 @@ def __init__(self, self.shipping_preference = shipping_preference if order_update_callback_config is not APIHelper.SKIP: self.order_update_callback_config = order_update_callback_config + self.user_action = user_action @classmethod def from_dictionary(cls, @@ -77,19 +83,23 @@ def from_dictionary(cls, brand_name = dictionary.get("brand_name") if dictionary.get("brand_name") else APIHelper.SKIP shipping_preference = dictionary.get("shipping_preference") if dictionary.get("shipping_preference") else 'GET_FROM_FILE' order_update_callback_config = CallbackConfiguration.from_dictionary(dictionary.get('order_update_callback_config')) if 'order_update_callback_config' in dictionary.keys() else APIHelper.SKIP + user_action = dictionary.get("user_action") if dictionary.get("user_action") else 'CONTINUE' # Return an object of this model return cls(brand_name, shipping_preference, - order_update_callback_config) + order_update_callback_config, + user_action) def __repr__(self): return (f'{self.__class__.__name__}(' f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!r}, ' f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!r}, ' - f'order_update_callback_config={(self.order_update_callback_config if hasattr(self, "order_update_callback_config") else None)!r})') + f'order_update_callback_config={(self.order_update_callback_config if hasattr(self, "order_update_callback_config") else None)!r}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!r})') def __str__(self): return (f'{self.__class__.__name__}(' f'brand_name={(self.brand_name if hasattr(self, "brand_name") else None)!s}, ' f'shipping_preference={(self.shipping_preference if hasattr(self, "shipping_preference") else None)!s}, ' - f'order_update_callback_config={(self.order_update_callback_config if hasattr(self, "order_update_callback_config") else None)!s})') + f'order_update_callback_config={(self.order_update_callback_config if hasattr(self, "order_update_callback_config") else None)!s}, ' + f'user_action={(self.user_action if hasattr(self, "user_action") else None)!s})') diff --git a/paypalserversdk/models/shipping_preference.py b/paypalserversdk/models/venmo_wallet_experience_context_shipping_preference.py similarity index 84% rename from paypalserversdk/models/shipping_preference.py rename to paypalserversdk/models/venmo_wallet_experience_context_shipping_preference.py index 897fa15..5f8e5ad 100644 --- a/paypalserversdk/models/shipping_preference.py +++ b/paypalserversdk/models/venmo_wallet_experience_context_shipping_preference.py @@ -8,9 +8,9 @@ """ -class ShippingPreference(object): +class VenmoWalletExperienceContextShippingPreference(object): - """Implementation of the 'Shipping Preference' enum. + """Implementation of the 'Venmo Wallet Experience Context Shipping Preference' enum. The location from which the shipping address is derived. diff --git a/paypalserversdk/models/venmo_wallet_experience_context_user_action.py b/paypalserversdk/models/venmo_wallet_experience_context_user_action.py new file mode 100644 index 0000000..15991c0 --- /dev/null +++ b/paypalserversdk/models/venmo_wallet_experience_context_user_action.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +""" +paypalserversdk + +This file was automatically generated by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class VenmoWalletExperienceContextUserAction(object): + + """Implementation of the 'Venmo Wallet Experience Context User Action' enum. + + Configures a Continue or Pay Now checkout flow. + + Attributes: + CONTINUE: After you redirect the customer to the Venmo payment page, a + Continue button appears. Use this option when the final amount is + not known when the checkout flow is initiated and you want to + redirect the customer to the merchant page without processing the + payment. + PAY_NOW: After you redirect the customer to the Venmo payment page, a + Pay Now button appears. Use this option when the final amount is + known when the checkout is initiated and you want to process the + payment immediately when the customer clicks Pay Now. + + """ + CONTINUE = 'CONTINUE' + + PAY_NOW = 'PAY_NOW' + diff --git a/paypalserversdk/models/venmo_wallet_response.py b/paypalserversdk/models/venmo_wallet_response.py index bf07fad..76963ff 100644 --- a/paypalserversdk/models/venmo_wallet_response.py +++ b/paypalserversdk/models/venmo_wallet_response.py @@ -41,6 +41,9 @@ class VenmoWalletResponse(object): form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling- form-controls-the-autocomplete-attribute). + return_flow (ReturnFlow): Merchant preference on how the buyer can + navigate back to merchant website post approving the transaction + on the Venmo App. attributes (VenmoWalletAttributesResponse): Additional attributes associated with the use of a Venmo Wallet. @@ -54,6 +57,7 @@ class VenmoWalletResponse(object): "name": 'name', "phone_number": 'phone_number', "address": 'address', + "return_flow": 'return_flow', "attributes": 'attributes' } @@ -64,6 +68,7 @@ class VenmoWalletResponse(object): 'name', 'phone_number', 'address', + 'return_flow', 'attributes', ] @@ -74,6 +79,7 @@ def __init__(self, name=APIHelper.SKIP, phone_number=APIHelper.SKIP, address=APIHelper.SKIP, + return_flow='AUTO', attributes=APIHelper.SKIP): """Constructor for the VenmoWalletResponse class""" @@ -90,6 +96,7 @@ def __init__(self, self.phone_number = phone_number if address is not APIHelper.SKIP: self.address = address + self.return_flow = return_flow if attributes is not APIHelper.SKIP: self.attributes = attributes @@ -118,6 +125,7 @@ def from_dictionary(cls, name = Name.from_dictionary(dictionary.get('name')) if 'name' in dictionary.keys() else APIHelper.SKIP phone_number = PhoneNumber.from_dictionary(dictionary.get('phone_number')) if 'phone_number' in dictionary.keys() else APIHelper.SKIP address = Address.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP + return_flow = dictionary.get("return_flow") if dictionary.get("return_flow") else 'AUTO' attributes = VenmoWalletAttributesResponse.from_dictionary(dictionary.get('attributes')) if 'attributes' in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(email_address, @@ -126,6 +134,7 @@ def from_dictionary(cls, name, phone_number, address, + return_flow, attributes) def __repr__(self): @@ -136,6 +145,7 @@ def __repr__(self): f'name={(self.name if hasattr(self, "name") else None)!r}, ' f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!r}, ' f'address={(self.address if hasattr(self, "address") else None)!r}, ' + f'return_flow={(self.return_flow if hasattr(self, "return_flow") else None)!r}, ' f'attributes={(self.attributes if hasattr(self, "attributes") else None)!r})') def __str__(self): @@ -146,4 +156,5 @@ def __str__(self): f'name={(self.name if hasattr(self, "name") else None)!s}, ' f'phone_number={(self.phone_number if hasattr(self, "phone_number") else None)!s}, ' f'address={(self.address if hasattr(self, "address") else None)!s}, ' + f'return_flow={(self.return_flow if hasattr(self, "return_flow") else None)!s}, ' f'attributes={(self.attributes if hasattr(self, "attributes") else None)!s})') diff --git a/paypalserversdk/paypal_serversdk_client.py b/paypalserversdk/paypal_serversdk_client.py index 6eb9514..b7ed603 100644 --- a/paypalserversdk/paypal_serversdk_client.py +++ b/paypalserversdk/paypal_serversdk_client.py @@ -16,6 +16,10 @@ from paypalserversdk.controllers.orders_controller import OrdersController from paypalserversdk.controllers.payments_controller import PaymentsController from paypalserversdk.controllers.vault_controller import VaultController +from paypalserversdk.controllers.transaction_search_controller\ + import TransactionSearchController +from paypalserversdk.controllers.subscriptions_controller\ + import SubscriptionsController from paypalserversdk.controllers.o_auth_authorization_controller\ import OAuthAuthorizationController @@ -33,6 +37,14 @@ def payments(self): def vault(self): return VaultController(self.global_configuration) + @LazyProperty + def transaction_search(self): + return TransactionSearchController(self.global_configuration) + + @LazyProperty + def subscriptions(self): + return SubscriptionsController(self.global_configuration) + @LazyProperty def o_auth_authorization(self): return OAuthAuthorizationController(self.global_configuration) @@ -44,7 +56,7 @@ def oauth_2(self): def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, timeout=60, max_retries=0, backoff_factor=2, - retry_statuses=None, retry_methods=None, + retry_statuses=None, retry_methods=None, proxy_settings=None, logging_configuration=None, environment=Environment.SANDBOX, client_credentials_auth_credentials=None, config=None): self.config = config or Configuration( @@ -53,6 +65,7 @@ def __init__(self, http_client_instance=None, http_call_back=http_call_back, timeout=timeout, max_retries=max_retries, backoff_factor=backoff_factor, retry_statuses=retry_statuses, retry_methods=retry_methods, + proxy_settings=proxy_settings, logging_configuration=logging_configuration, environment=environment, client_credentials_auth_credentials=client_credentials_auth_credentials) diff --git a/paypalserversdk/utilities/__init__.py b/paypalserversdk/utilities/__init__.py index 28ebe4a..3ab66eb 100644 --- a/paypalserversdk/utilities/__init__.py +++ b/paypalserversdk/utilities/__init__.py @@ -1,3 +1,4 @@ __all__ = [ + 'pagination', 'file_wrapper', ] diff --git a/pyproject.toml b/pyproject.toml index 7d2de8c..ece5abc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,21 @@ [build-system] -build-backend = "setuptools.build_meta" requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" [project] name = "paypal-server-sdk" description = "PayPal's SDK for interacting with the REST APIs" -version = "1.1.0" +version = "2.0.0" readme = "README.md" -requires-python = ">=3.7" keywords = [] authors = [] -urls = {Homepage = "https://github.com/paypal/PayPal-Python-Server-SDK"} -dependencies = ["apimatic-core~=0.2.0, >= 0.2.17", "apimatic-core-interfaces~=0.1.0, >= 0.1.5", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.6"] +dependencies = ["apimatic-core~=0.2.0, >= 0.2.23", "apimatic-core-interfaces~=0.1.0, >= 0.1.8", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.9"] classifiers = [] +requires-python = ">=3.7" +[project.urls] [project.optional-dependencies] testutils = ["pytest>=7.2.2"] +[tool] +[tool.setuptools] +[tool.setuptools.packages] [tool.setuptools.packages.find] exclude = ["tests", "tests.*"] diff --git a/requirements.txt b/requirements.txt index 381727f..bc49b7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -apimatic-core~=0.2.0, >= 0.2.17 -apimatic-core-interfaces~=0.1.0, >= 0.1.5 -apimatic-requests-client-adapter~=0.1.0, >= 0.1.6 +apimatic-core~=0.2.0, >= 0.2.23 +apimatic-core-interfaces~=0.1.0, >= 0.1.8 +apimatic-requests-client-adapter~=0.1.0, >= 0.1.9 diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index dce0f1a..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pytest>=7.2.2