From aa84adbd3defd833edbd6f7ce70589adfdeb504c Mon Sep 17 00:00:00 2001 From: PayPalServerSDKs Date: Wed, 19 Aug 2026 22:18:42 +0000 Subject: [PATCH] Automated commit message --- README.md | 54 +-- doc/models/activate-subscription-request.md | 12 +- doc/models/activity-timestamps.md | 14 +- doc/models/address.md | 24 +- doc/models/amount-breakdown.md | 53 +-- doc/models/amount-with-breakdown.md | 62 +-- doc/models/app-switch-context.md | 26 +- doc/models/apple-pay-attributes-response.md | 45 ++- doc/models/apple-pay-attributes.md | 53 +-- doc/models/apple-pay-card-response.md | 24 +- doc/models/apple-pay-card.md | 38 +- doc/models/apple-pay-decrypted-token-data.md | 54 +-- doc/models/apple-pay-experience-context.md | 14 +- doc/models/apple-pay-payment-data-type.md | 8 + doc/models/apple-pay-payment-data.md | 20 +- doc/models/apple-pay-payment-object.md | 27 +- doc/models/apple-pay-payment-token.md | 43 +- doc/models/apple-pay-request-card.md | 35 +- doc/models/apple-pay-request.md | 72 ++-- doc/models/apple-pay-tokenized-card.md | 22 +- doc/models/application-context-user-action.md | 8 + doc/models/assurance-details.md | 14 +- doc/models/auction-information.md | 20 +- doc/models/authentication-response.md | 26 +- doc/models/authorization-incomplete-reason.md | 8 + doc/models/authorization-status-details.md | 13 +- .../authorization-status-with-details.md | 21 +- doc/models/authorization-status.md | 8 + .../authorization-with-additional-data.md | 32 +- doc/models/authorization.md | 32 +- doc/models/avs-code.md | 8 + doc/models/balance-information.md | 41 +- doc/models/balances-response.md | 102 +++-- doc/models/bancontact-payment-object.md | 22 +- doc/models/bancontact-payment-request.md | 32 +- doc/models/bank-request.md | 35 +- doc/models/billing-cycle-override.md | 89 +++-- doc/models/billing-cycle.md | 55 ++- doc/models/billing-plan.md | 24 +- doc/models/bin-details.md | 26 +- doc/models/blik-experience-context.md | 23 +- doc/models/blik-level-0-payment-object.md | 12 +- doc/models/blik-one-click-payment-object.md | 12 +- doc/models/blik-one-click-payment-request.md | 20 +- doc/models/blik-payment-object.md | 25 +- doc/models/blik-payment-request.md | 54 +-- doc/models/callback-configuration.md | 25 +- doc/models/callback-events.md | 8 + doc/models/cancel-subscription-request.md | 12 +- doc/models/capture-incomplete-reason.md | 8 + doc/models/capture-payment-instruction.md | 74 ++-- doc/models/capture-request.md | 101 ++--- doc/models/capture-status-details.md | 13 +- doc/models/capture-status-with-details.md | 21 +- doc/models/capture-status.md | 8 + doc/models/capture-subscription-request.md | 26 +- doc/models/capture-type.md | 8 + doc/models/captured-payment.md | 37 +- doc/models/card-attributes-response.md | 64 +-- doc/models/card-attributes.md | 63 +-- doc/models/card-authentication-response.md | 25 +- doc/models/card-brand.md | 8 + doc/models/card-customer-information.md | 42 +- doc/models/card-customer.md | 33 +- doc/models/card-experience-context.md | 14 +- doc/models/card-from-request.md | 13 +- doc/models/card-payment-token-entity.md | 37 +- doc/models/card-request.md | 37 +- doc/models/card-response-address.md | 24 +- .../card-response-with-billing-address.md | 35 +- doc/models/card-response.md | 26 +- doc/models/card-stored-credential.md | 35 +- doc/models/card-supplementary-data.md | 76 ++-- doc/models/card-type.md | 8 + doc/models/card-vault-response.md | 64 ++- doc/models/card-verification-details.md | 29 +- .../card-verification-processor-response.md | 11 +- doc/models/card-verification-status.md | 8 + doc/models/card-verification.md | 13 +- doc/models/cart-information.md | 49 ++- doc/models/checkout-option.md | 14 +- doc/models/checkout-payment-intent.md | 8 + doc/models/cobranded-card.md | 39 +- doc/models/confirm-order-request.md | 205 +++++----- doc/models/create-subscription-request.md | 118 +++--- doc/models/customer-information.md | 40 +- doc/models/customer-response.md | 14 +- .../customer-vault-payment-tokens-response.md | 333 +++++----------- doc/models/customer.md | 14 +- doc/models/cvv-code.md | 8 + doc/models/cycle-execution.md | 22 +- doc/models/cycle-frequency.md | 28 ++ doc/models/default-error-exception.md | 34 +- doc/models/disbursement-mode.md | 8 + doc/models/dispute-category.md | 8 + doc/models/eci-flag.md | 8 + doc/models/enrollment-status.md | 8 + doc/models/eps-payment-object.md | 18 +- doc/models/eps-payment-request.md | 32 +- doc/models/error-details.md | 34 +- doc/models/error-exception.md | 69 +--- doc/models/exchange-rate.md | 18 +- .../experience-context-shipping-preference.md | 8 + doc/models/experience-context.md | 23 +- doc/models/experience-status.md | 8 + doc/models/failed-payment-details.md | 26 +- doc/models/frequency-interval-unit.md | 27 ++ doc/models/frequency.md | 15 +- doc/models/fulfillment-type.md | 8 + doc/models/giropay-payment-object.md | 18 +- doc/models/giropay-payment-request.md | 32 +- .../google-pay-authentication-method.md | 8 + doc/models/google-pay-card-response.md | 38 +- doc/models/google-pay-card.md | 22 +- doc/models/google-pay-decrypted-token-data.md | 41 +- doc/models/google-pay-experience-context.md | 14 +- doc/models/google-pay-payment-method.md | 8 + doc/models/google-pay-request-card.md | 37 +- doc/models/google-pay-request.md | 88 +++-- doc/models/google-pay-wallet-response.md | 56 +-- doc/models/ideal-payment-object.md | 20 +- doc/models/ideal-payment-request.md | 34 +- doc/models/incentive-details.md | 27 +- doc/models/incentive-information.md | 72 ++-- doc/models/interval-unit.md | 8 + doc/models/item-category.md | 8 + doc/models/item-details.md | 22 +- doc/models/item-request.md | 42 +- doc/models/item.md | 42 +- doc/models/last-payment-details.md | 23 +- doc/models/level-2-card-processing-data.md | 23 +- doc/models/level-3-card-processing-data.md | 56 +-- doc/models/liability-shift-indicator.md | 8 + doc/models/line-item.md | 34 +- doc/models/link-description.md | 19 +- doc/models/link-http-method.md | 8 + doc/models/merchant-preferences.md | 14 +- doc/models/mobile-return-flow.md | 8 + doc/models/mobile-web-context.md | 15 +- doc/models/modify-subscription-request.md | 99 +++-- doc/models/modify-subscription-response.md | 271 +++++++------ doc/models/money.md | 14 +- doc/models/mybank-payment-object.md | 20 +- doc/models/mybank-payment-request.md | 32 +- doc/models/name.md | 14 +- doc/models/native-app-context.md | 11 +- doc/models/net-amount-breakdown-item.md | 34 +- doc/models/network-token.md | 23 +- .../network-transaction-reference-entity.md | 21 +- doc/models/network-transaction.md | 21 +- doc/models/o-auth-provider-error.md | 8 + doc/models/o-auth-provider-exception.md | 17 +- doc/models/o-auth-token.md | 26 +- doc/models/one-time-charge.md | 61 +-- .../order-application-context-landing-page.md | 8 + ...application-context-shipping-preference.md | 8 + .../order-application-context-user-action.md | 8 + doc/models/order-application-context.md | 25 +- .../order-authorize-request-payment-source.md | 228 ++++++----- doc/models/order-authorize-request.md | 233 ++++++----- ...order-authorize-response-payment-source.md | 141 +++---- doc/models/order-authorize-response.md | 154 ++++---- doc/models/order-billing-plan.md | 71 ++-- .../order-capture-request-payment-source.md | 228 ++++++----- doc/models/order-capture-request.md | 233 ++++++----- .../order-confirm-application-context.md | 48 ++- doc/models/order-request.md | 372 ++++++++++-------- doc/models/order-status.md | 8 + doc/models/order-tracker-item.md | 22 +- doc/models/order-tracker-request.md | 49 ++- doc/models/order-tracker-response.md | 68 ++-- doc/models/order-tracker-status.md | 8 + doc/models/order.md | 106 ++--- doc/models/orders-capture.md | 37 +- doc/models/orders-card-verification-method.md | 8 + doc/models/os-type.md | 8 + doc/models/p24-payment-object.md | 22 +- doc/models/p24-payment-request.md | 34 +- doc/models/pa-res-status.md | 8 + doc/models/participant-metadata.md | 12 +- doc/models/patch-op.md | 8 + doc/models/patch.md | 26 +- doc/models/payee-base.md | 14 +- doc/models/payee-payment-method-preference.md | 8 + doc/models/payer-base.md | 14 +- doc/models/payer-information.md | 31 +- doc/models/payer-name.md | 22 +- doc/models/payer.md | 42 +- doc/models/payment-advice-code.md | 8 + doc/models/payment-authorization.md | 32 +- doc/models/payment-collection.md | 179 ++++----- doc/models/payment-initiator.md | 8 + doc/models/payment-instruction.md | 66 +++- doc/models/payment-method-preference.md | 16 +- doc/models/payment-method.md | 13 +- doc/models/payment-preferences-override.md | 28 +- doc/models/payment-preferences.md | 28 +- doc/models/payment-source-response.md | 93 +++-- doc/models/payment-source.md | 156 ++++---- doc/models/payment-supplementary-data.md | 23 +- doc/models/payment-token-request-card.md | 23 +- .../payment-token-request-payment-source.md | 38 +- doc/models/payment-token-request.md | 52 +-- .../payment-token-response-payment-source.md | 127 ++---- doc/models/payment-token-response.md | 153 +++---- doc/models/payment-token-status.md | 8 + doc/models/payments-capture.md | 37 +- doc/models/paypal-experience-landing-page.md | 8 + doc/models/paypal-experience-user-action.md | 8 + .../paypal-payment-token-customer-type.md | 8 + doc/models/paypal-payment-token-usage-type.md | 8 + doc/models/paypal-payment-token.md | 65 +-- doc/models/paypal-reference-id-type.md | 8 + ...ypal-wallet-account-verification-status.md | 8 + .../paypal-wallet-attributes-response.md | 125 +++--- doc/models/paypal-wallet-attributes.md | 68 ++-- .../paypal-wallet-contact-preference.md | 8 + ...ypal-wallet-context-shipping-preference.md | 8 + doc/models/paypal-wallet-customer-request.md | 42 +- doc/models/paypal-wallet-customer.md | 42 +- .../paypal-wallet-experience-context.md | 33 +- doc/models/paypal-wallet-response.md | 29 +- doc/models/paypal-wallet-stored-credential.md | 23 +- doc/models/paypal-wallet-vault-base.md | 28 +- doc/models/paypal-wallet-vault-instruction.md | 28 +- doc/models/paypal-wallet-vault-response.md | 59 +-- doc/models/paypal-wallet-vault-status.md | 8 + doc/models/paypal-wallet.md | 42 +- doc/models/phone-number-with-country-code.md | 14 +- ...phone-number-with-optional-country-code.md | 14 +- doc/models/phone-number.md | 12 +- doc/models/phone-type.md | 8 + doc/models/phone-with-type.md | 22 +- doc/models/phone.md | 18 +- doc/models/plan-collection.md | 58 ++- doc/models/plan-details.md | 268 ++++++------- doc/models/plan-override.md | 203 ++++------ doc/models/plan-request-status.md | 8 + doc/models/plan-request.md | 158 ++++---- doc/models/plan.md | 114 +++--- doc/models/platform-fee.md | 30 +- doc/models/pricing-model.md | 8 + doc/models/pricing-scheme.md | 32 +- doc/models/pricing-tier.md | 25 +- doc/models/processing-instruction.md | 8 + doc/models/processor-response-code.md | 8 + doc/models/processor-response.md | 15 +- doc/models/purchase-unit-request.md | 157 ++++---- doc/models/purchase-unit.md | 155 ++++---- doc/models/reason-code.md | 8 + doc/models/reauthorize-request.md | 21 +- doc/models/refund-incomplete-reason.md | 8 + doc/models/refund-payment-instruction.md | 48 ++- doc/models/refund-platform-fee.md | 21 +- doc/models/refund-request.md | 73 ++-- doc/models/refund-status-details.md | 13 +- doc/models/refund-status-with-details.md | 21 +- doc/models/refund-status.md | 8 + doc/models/refund.md | 32 +- doc/models/related-identifiers.md | 18 +- doc/models/return-flow.md | 8 + doc/models/risk-supplementary-data.md | 19 +- doc/models/search-error-exception.md | 36 +- doc/models/search-response.md | 287 ++++---------- doc/models/seller-payable-breakdown.md | 53 +-- doc/models/seller-protection-status.md | 8 + doc/models/seller-protection.md | 15 +- doc/models/seller-receivable-breakdown.md | 58 ++- doc/models/sepa-debit-experience-context.md | 18 +- doc/models/sepa-debit-request.md | 23 +- doc/models/setup-fee-failure-action.md | 8 + doc/models/setup-token-request-card.md | 23 +- .../setup-token-request-payment-source.md | 178 +++++---- doc/models/setup-token-request.md | 192 +++++---- doc/models/setup-token-response-card.md | 37 +- .../setup-token-response-payment-source.md | 92 ++--- doc/models/setup-token-response.md | 118 ++---- doc/models/shipment-carrier.md | 8 + doc/models/shipping-details.md | 80 ++-- doc/models/shipping-information.md | 49 +-- doc/models/shipping-name.md | 12 +- doc/models/shipping-option.md | 30 +- doc/models/shipping-type.md | 8 + doc/models/shipping-with-tracking-details.md | 129 +++--- .../simple-postal-address-coarse-grained.md | 24 +- doc/models/sofort-payment-object.md | 20 +- doc/models/sofort-payment-request.md | 32 +- doc/models/standard-entry-class-code.md | 8 + doc/models/store-in-vault-instruction.md | 8 + doc/models/store-information.md | 14 +- .../stored-payment-source-payment-type.md | 8 + .../stored-payment-source-usage-type.md | 8 + doc/models/stored-payment-source.md | 35 +- doc/models/subscriber-request.md | 97 +++-- doc/models/subscriber.md | 109 ++--- .../subscription-amount-with-breakdown.md | 61 +-- .../subscription-application-context.md | 34 +- doc/models/subscription-billing-cycle.md | 100 ++--- .../subscription-billing-information.md | 78 ++-- doc/models/subscription-card-request.md | 23 +- doc/models/subscription-collection.md | 54 +-- .../subscription-customer-information.md | 31 +- doc/models/subscription-error-exception.md | 94 +---- .../subscription-patch-application-context.md | 31 +- doc/models/subscription-payer-name.md | 22 +- doc/models/subscription-payer.md | 25 +- .../subscription-payment-source-response.md | 40 +- doc/models/subscription-payment-source.md | 28 +- doc/models/subscription-plan-status.md | 8 + doc/models/subscription-pricing-model.md | 8 + doc/models/subscription-pricing-scheme.md | 80 ++-- doc/models/subscription-status.md | 28 ++ .../subscription-transaction-details.md | 86 ++-- doc/models/subscription.md | 33 +- doc/models/subscriptions-card-attributes.md | 54 +-- doc/models/subscriptions-card-brand.md | 8 + doc/models/supplementary-data.md | 93 +++-- doc/models/suspend-subscription.md | 12 +- doc/models/tax-amount.md | 21 +- doc/models/tax-id-type.md | 8 + doc/models/tax-info.md | 15 +- doc/models/taxes-override.md | 14 +- doc/models/taxes.md | 14 +- doc/models/tenure-type.md | 8 + .../three-d-secure-authentication-response.md | 16 +- ...e-d-secure-card-authentication-response.md | 20 +- doc/models/token-type.md | 8 + doc/models/token.md | 15 +- doc/models/transaction-details.md | 142 +++---- doc/models/transaction-information.md | 22 +- .../transaction-search-error-details.md | 22 +- doc/models/transactions-list.md | 149 ++++--- doc/models/trustly-payment-object.md | 22 +- doc/models/trustly-payment-request.md | 34 +- doc/models/universal-product-code.md | 15 +- doc/models/upc-type.md | 8 + doc/models/update-pricing-scheme.md | 87 ++-- doc/models/update-pricing-schemes-request.md | 96 ++--- doc/models/usage-pattern.md | 8 + doc/models/usage-type.md | 8 + doc/models/vault-apple-pay-request.md | 42 +- doc/models/vault-card-experience-context.md | 26 +- doc/models/vault-card-verification-method.md | 8 + doc/models/vault-customer.md | 23 +- doc/models/vault-experience-context.md | 26 +- doc/models/vault-instruction-action.md | 8 + doc/models/vault-instruction-base.md | 13 +- doc/models/vault-instruction.md | 13 +- doc/models/vault-paypal-wallet-request.md | 65 +-- doc/models/vault-response-customer.md | 26 +- doc/models/vault-response.md | 40 +- doc/models/vault-status.md | 8 + doc/models/vault-token-request-type.md | 8 + doc/models/vault-token-request.md | 15 +- doc/models/vault-user-action.md | 8 + doc/models/vault-venmo-request.md | 65 +-- ...vaulted-digital-wallet-shipping-details.md | 50 +-- doc/models/vaulted-digital-wallet.md | 65 +-- doc/models/venmo-experience-context.md | 23 +- .../venmo-payment-token-customer-type.md | 8 + .../venmo-payment-token-usage-pattern.md | 8 + doc/models/venmo-payment-token-usage-type.md | 8 + doc/models/venmo-payment-token.md | 65 +-- doc/models/venmo-vault-response-status.md | 8 + doc/models/venmo-vault-response.md | 67 ++-- .../venmo-wallet-additional-attributes.md | 66 ++-- .../venmo-wallet-attributes-response.md | 62 +-- .../venmo-wallet-customer-information.md | 40 +- ...-experience-context-shipping-preference.md | 8 + ...o-wallet-experience-context-user-action.md | 8 + doc/models/venmo-wallet-experience-context.md | 38 +- doc/models/venmo-wallet-request.md | 104 +++-- doc/models/venmo-wallet-response.md | 37 +- doc/models/venmo-wallet-vault-attributes.md | 28 +- .../controllers/base_controller.py | 2 +- paypalserversdk/models/__init__.py | 3 + paypalserversdk/models/billing_cycle.py | 31 +- paypalserversdk/models/cvv_code.py | 2 +- paypalserversdk/models/cycle_frequency.py | 98 +++++ .../models/frequency_interval_unit.py | 54 +++ paypalserversdk/models/subscription.py | 77 +++- paypalserversdk/models/subscription_status.py | 58 +++ pyproject.toml | 2 +- 383 files changed, 8764 insertions(+), 7176 deletions(-) create mode 100644 doc/models/cycle-frequency.md create mode 100644 doc/models/frequency-interval-unit.md create mode 100644 doc/models/subscription-status.md create mode 100644 paypalserversdk/models/cycle_frequency.py create mode 100644 paypalserversdk/models/frequency_interval_unit.py create mode 100644 paypalserversdk/models/subscription_status.py diff --git a/README.md b/README.md index 195b390..2f8999e 100644 --- a/README.md +++ b/README.md @@ -23,21 +23,21 @@ The package is compatible with Python versions `3.7+`. Install the package from PyPi using the following pip command: ```bash -pip install paypal-server-sdk==2.3.0 +pip install paypal-server-sdk==2.4.0 ``` You can also view the package at: -https://pypi.python.org/pypi/paypal-server-sdk/2.3.0 +https://pypi.python.org/pypi/paypal-server-sdk/2.4.0 ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| environment | [`Environment`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/README.md#environments) | The API environment.
**Default: `Environment.SANDBOX`** | +| environment | [`Environment`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/README.md#environments) | The API environment.
**Default: `Environment.SANDBOX`** | | http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests | | override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user | | http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint | @@ -46,9 +46,9 @@ The following parameters are configurable for the API Client: | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**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`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | -| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | -| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | +| proxy_settings | [`ProxySettings`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | +| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | The API client can be initialized as follows: @@ -91,7 +91,7 @@ from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient client = PaypalServersdkClient.from_environment(dotenv_path='/path/to/.env') ``` -See the [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/environment-based-client-initialization.md) section for details. +See the [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -108,37 +108,37 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/auth/oauth-2-client-credentials-grant.md) +* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/auth/oauth-2-client-credentials-grant.md) ## List of APIs -* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/orders.md) -* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/payments.md) -* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/vault.md) -* [Transaction Search](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/transaction-search.md) -* [Subscriptions](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/controllers/subscriptions.md) +* [Orders](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/orders.md) +* [Payments](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/payments.md) +* [Vault](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/vault.md) +* [Transaction Search](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/transaction-search.md) +* [Subscriptions](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/controllers/subscriptions.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/environment-based-client-initialization.md) -* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/abstract-logger.md) -* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/logging-configuration.md) -* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/request-logging-configuration.md) -* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/response-logging-configuration.md) +* [ProxySettings](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/environment-based-client-initialization.md) +* [AbstractLogger](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/abstract-logger.md) +* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/logging-configuration.md) +* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/request-logging-configuration.md) +* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/response-logging-configuration.md) ### HTTP -* [HttpResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/http-request.md) ### Utilities -* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/api-response.md) -* [ApiHelper](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/api-helper.md) -* [HttpDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/http-date-time.md) -* [RFC3339DateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/rfc3339-date-time.md) -* [UnixDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.3.0/doc/unix-date-time.md) +* [ApiResponse](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/api-response.md) +* [ApiHelper](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/api-helper.md) +* [HttpDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/http-date-time.md) +* [RFC3339DateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/rfc3339-date-time.md) +* [UnixDateTime](https://www.github.com/paypal/PayPal-Python-Server-SDK/tree/2.4.0/doc/unix-date-time.md) diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index f26d728..7693e70 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -13,11 +13,13 @@ The activate subscription request details. | --- | --- | --- | --- | | `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) +## Example -```json -{ - "reason": "reason4" -} +```python +from paypalserversdk.models.activate_subscription_request import ActivateSubscriptionRequest + +activate_subscription_request = ActivateSubscriptionRequest( + reason='reason4' +) ``` diff --git a/doc/models/activity-timestamps.md b/doc/models/activity-timestamps.md index e4461b1..3150eb1 100644 --- a/doc/models/activity-timestamps.md +++ b/doc/models/activity-timestamps.md @@ -14,12 +14,14 @@ The date and time stamps that are common to authorized payment, captured payment | `create_time` | `str` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**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) +## Example -```json -{ - "create_time": "create_time2", - "update_time": "update_time2" -} +```python +from paypalserversdk.models.activity_timestamps import ActivityTimestamps + +activity_timestamps = ActivityTimestamps( + create_time='create_time8', + update_time='update_time4' +) ``` diff --git a/doc/models/address.md b/doc/models/address.md index c3954f4..a1cfc76 100644 --- a/doc/models/address.md +++ b/doc/models/address.md @@ -18,16 +18,18 @@ The portable international postal address. Maps to [AddressValidationMetadata](h | `postal_code` | `str` | Optional | The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).

**Constraints**: *Maximum Length*: `60` | | `country_code` | `str` | Required | The [2-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | -## Example (as JSON) - -```json -{ - "address_line_1": "address_line_18", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_22", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" -} +## Example + +```python +from paypalserversdk.models.address import Address + +address = Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' +) ``` diff --git a/doc/models/amount-breakdown.md b/doc/models/amount-breakdown.md index ceae3b3..e20afcd 100644 --- a/doc/models/amount-breakdown.md +++ b/doc/models/amount-breakdown.md @@ -19,30 +19,33 @@ The breakdown of the amount. Breakdown provides details such as total item amoun | `shipping_discount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `discount` | [`Money`](../../doc/models/money.md) | Optional | The discount amount and currency code. For list of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. | -## Example (as JSON) - -```json -{ - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } -} +## Example + +```python +from paypalserversdk.models.amount_breakdown import AmountBreakdown +from paypalserversdk.models.money import Money + +amount_breakdown = AmountBreakdown( + item_total=Money( + currency_code='currency_code0', + value='value6' + ), + shipping=Money( + currency_code='currency_code0', + value='value6' + ), + handling=Money( + currency_code='currency_code2', + value='value8' + ), + tax_total=Money( + currency_code='currency_code4', + value='value0' + ), + insurance=Money( + currency_code='currency_code2', + value='value8' + ) +) ``` diff --git a/doc/models/amount-with-breakdown.md b/doc/models/amount-with-breakdown.md index 80acee6..1c4bed1 100644 --- a/doc/models/amount-with-breakdown.md +++ b/doc/models/amount-with-breakdown.md @@ -15,34 +15,38 @@ The total order amount with an optional breakdown that provides details, such as | `value` | `str` | Required | The value, which might be: An integer for currencies like `JPY` that are not typically fractional. A decimal fraction for currencies like `TND` that are subdivided into thousandths. For the required number of decimal places for a currency code, see [Currency Codes](https://developer.paypal.com/api/rest/reference/currency-codes/).

**Constraints**: *Maximum Length*: `32`, *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | | `breakdown` | [`AmountBreakdown`](../../doc/models/amount-breakdown.md) | Optional | The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. | -## Example (as JSON) - -```json -{ - "currency_code": "currency_code4", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } -} +## Example + +```python +from paypalserversdk.models.amount_breakdown import AmountBreakdown +from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown +from paypalserversdk.models.money import Money + +amount_with_breakdown = AmountWithBreakdown( + currency_code='currency_code0', + value='value6', + breakdown=AmountBreakdown( + item_total=Money( + currency_code='currency_code0', + value='value6' + ), + shipping=Money( + currency_code='currency_code0', + value='value6' + ), + handling=Money( + currency_code='currency_code2', + value='value8' + ), + tax_total=Money( + currency_code='currency_code4', + value='value0' + ), + insurance=Money( + currency_code='currency_code2', + value='value8' + ) + ) +) ``` diff --git a/doc/models/app-switch-context.md b/doc/models/app-switch-context.md index 6d273d6..b187df6 100644 --- a/doc/models/app-switch-context.md +++ b/doc/models/app-switch-context.md @@ -14,18 +14,18 @@ Merchant provided details of the native app or mobile web browser to facilitate | `native_app` | [`NativeAppContext`](../../doc/models/native-app-context.md) | Optional | Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. | | `mobile_web` | [`MobileWebContext`](../../doc/models/mobile-web-context.md) | Optional | Buyer's mobile web browser context to app switch to the PayPal consumer app. | -## Example (as JSON) - -```json -{ - "native_app": { - "os_type": "IOS", - "os_version": "os_version0" - }, - "mobile_web": { - "return_flow": "AUTO", - "buyer_user_agent": "buyer_user_agent8" - } -} +## Example + +```python +from paypalserversdk.models.app_switch_context import AppSwitchContext +from paypalserversdk.models.mobile_web_context import MobileWebContext +from paypalserversdk.models.native_app_context import NativeAppContext + +app_switch_context = AppSwitchContext( + native_app=NativeAppContext(), + mobile_web=MobileWebContext( + buyer_user_agent='buyer_user_agent8' + ) +) ``` diff --git a/doc/models/apple-pay-attributes-response.md b/doc/models/apple-pay-attributes-response.md index f0f3930..b98dbd8 100644 --- a/doc/models/apple-pay-attributes-response.md +++ b/doc/models/apple-pay-attributes-response.md @@ -13,28 +13,27 @@ Additional attributes associated with the use of Apple Pay. | --- | --- | --- | --- | | `vault` | [`VaultResponse`](../../doc/models/vault-response.md) | Optional | The details about a saved payment source. | -## Example (as JSON) - -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] - } -} +## Example + +```python +from paypalserversdk.models.apple_pay_attributes_response import ApplePayAttributesResponse +from paypalserversdk.models.name import Name +from paypalserversdk.models.vault_customer import VaultCustomer +from paypalserversdk.models.vault_response import VaultResponse +from paypalserversdk.models.vault_status import VaultStatus + +apple_pay_attributes_response = ApplePayAttributesResponse( + vault=VaultResponse( + id='id6', + status=VaultStatus.APPROVED, + customer=VaultCustomer( + id='id0', + name=Name( + given_name='given_name2', + surname='surname8' + ) + ) + ) +) ``` diff --git a/doc/models/apple-pay-attributes.md b/doc/models/apple-pay-attributes.md index 796357d..072f287 100644 --- a/doc/models/apple-pay-attributes.md +++ b/doc/models/apple-pay-attributes.md @@ -14,27 +14,36 @@ Additional attributes associated with apple pay. | `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. | | `vault` | [`VaultInstruction`](../../doc/models/vault-instruction.md) | Optional | Base vaulting specification. The object can be extended for specific use cases within each payment_source that supports vaulting. | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "vault": { - "store_in_vault": "ON_SUCCESS" - } -} +## Example + +```python +from paypalserversdk.models.apple_pay_attributes import ApplePayAttributes +from paypalserversdk.models.customer_information import CustomerInformation +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.vault_instruction import VaultInstruction + +apple_pay_attributes = ApplePayAttributes( + customer=CustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) + ), + vault=VaultInstruction( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS + ) +) ``` diff --git a/doc/models/apple-pay-card-response.md b/doc/models/apple-pay-card-response.md index aafdd66..b6ebbb6 100644 --- a/doc/models/apple-pay-card-response.md +++ b/doc/models/apple-pay-card-response.md @@ -25,17 +25,17 @@ The Card from Apple Pay Wallet used to fund the payment. | `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). | | `country_code` | `str` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | -## Example (as JSON) - -```json -{ - "name": "name4", - "last_digits": "last_digits8", - "brand": "ACCEL", - "available_networks": [ - "STAR_ACCESS" - ], - "type": "DEBIT" -} +## Example + +```python +from paypalserversdk.models.apple_pay_card_response import ApplePayCardResponse +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType + +apple_pay_card_response = ApplePayCardResponse( + name='name0', + brand=CardBrand.CARTE_BANCAIRE, + mtype=CardType.CREDIT +) ``` diff --git a/doc/models/apple-pay-card.md b/doc/models/apple-pay-card.md index d368593..ccd2bb4 100644 --- a/doc/models/apple-pay-card.md +++ b/doc/models/apple-pay-card.md @@ -17,22 +17,26 @@ The payment card to be used to fund a payment. Can be a credit or debit 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). | -## Example (as JSON) - -```json -{ - "name": "name4", - "last_digits": "last_digits8", - "type": "UNKNOWN", - "brand": "SWITCH", - "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" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_card import ApplePayCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType + +apple_pay_card = ApplePayCard( + name='name6', + mtype=CardType.DEBIT, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/apple-pay-decrypted-token-data.md b/doc/models/apple-pay-decrypted-token-data.md index c79e1d2..6ff4ac3 100644 --- a/doc/models/apple-pay-decrypted-token-data.md +++ b/doc/models/apple-pay-decrypted-token-data.md @@ -17,29 +17,35 @@ Information about the Payment data obtained by decrypting Apple Pay token. | `payment_data_type` | [`ApplePayPaymentDataType`](../../doc/models/apple-pay-payment-data-type.md) | Optional | Indicates the type of payment data passed, in case of Non China the payment data is 3DSECURE and for China it is EMV.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_data` | [`ApplePayPaymentData`](../../doc/models/apple-pay-payment-data.md) | Optional | Information about the decrypted apple pay payment data for the token like cryptogram, eci indicator. | -## Example (as JSON) - -```json -{ - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id2", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } -} +## Example + +```python +from paypalserversdk.models.apple_pay_decrypted_token_data import ApplePayDecryptedTokenData +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.money import Money + +apple_pay_decrypted_token_data = ApplePayDecryptedTokenData( + tokenized_card=ApplePayTokenizedCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.UNKNOWN + ), + transaction_amount=Money( + currency_code='currency_code6', + value='value2' + ), + device_manufacturer_id='device_manufacturer_id4', + payment_data_type=ApplePayPaymentDataType.ENUM_3DSECURE, + payment_data=ApplePayPaymentData( + cryptogram='cryptogram6', + eci_indicator='eci_indicator0', + emv_data='emv_data0', + pin='pin4' + ) +) ``` diff --git a/doc/models/apple-pay-experience-context.md b/doc/models/apple-pay-experience-context.md index f54c42d..7d19090 100644 --- a/doc/models/apple-pay-experience-context.md +++ b/doc/models/apple-pay-experience-context.md @@ -14,12 +14,14 @@ Customizes the payer experience during the approval process for the payment. | `return_url` | `str` | Required | Describes the URL. | | `cancel_url` | `str` | Required | Describes the URL. | -## Example (as JSON) +## Example -```json -{ - "return_url": "return_url6", - "cancel_url": "cancel_url8" -} +```python +from paypalserversdk.models.apple_pay_experience_context import ApplePayExperienceContext + +apple_pay_experience_context = ApplePayExperienceContext( + return_url='return_url4', + cancel_url='cancel_url6' +) ``` diff --git a/doc/models/apple-pay-payment-data-type.md b/doc/models/apple-pay-payment-data-type.md index bcef554..c104b49 100644 --- a/doc/models/apple-pay-payment-data-type.md +++ b/doc/models/apple-pay-payment-data-type.md @@ -14,3 +14,11 @@ Indicates the type of payment data passed, in case of Non China the payment data | `ENUM_3DSECURE` | The card was authenticated using 3D Secure (3DS) authentication scheme. While using this value make sure to populate cryptogram and eci_indicator as part of payment data.. | | `EMV` | The card was authenticated using EMV method, which is applicable for China. While using this value make sure to pass emv_data and pin as part of payment data. | +## Example + +```python +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType + +apple_pay_payment_data_type = ApplePayPaymentDataType.ENUM_3DSECURE +``` + diff --git a/doc/models/apple-pay-payment-data.md b/doc/models/apple-pay-payment-data.md index a11890f..89b4b4a 100644 --- a/doc/models/apple-pay-payment-data.md +++ b/doc/models/apple-pay-payment-data.md @@ -16,14 +16,16 @@ Information about the decrypted apple pay payment data for the token like crypto | `emv_data` | `str` | Optional | Encoded Apple Pay EMV Payment Structure used for payments in China. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000`, *Pattern*: `^.*$` | | `pin` | `str` | Optional | Bank Key encrypted Apple Pay PIN. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" -} +## Example + +```python +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData + +apple_pay_payment_data = ApplePayPaymentData( + cryptogram='cryptogram2', + eci_indicator='eci_indicator6', + emv_data='emv_data6', + pin='pin0' +) ``` diff --git a/doc/models/apple-pay-payment-object.md b/doc/models/apple-pay-payment-object.md index effdaf0..e94c85d 100644 --- a/doc/models/apple-pay-payment-object.md +++ b/doc/models/apple-pay-payment-object.md @@ -20,17 +20,20 @@ Information needed to pay using ApplePay. | `attributes` | [`ApplePayAttributesResponse`](../../doc/models/apple-pay-attributes-response.md) | Optional | Additional attributes associated with the use of Apple Pay. | | `stored_credential` | [`CardStoredCredential`](../../doc/models/card-stored-credential.md) | Optional | Provides additional details to process a payment using a `card` 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. | -## Example (as JSON) - -```json -{ - "id": "id6", - "token": "token0", - "name": "name6", - "email_address": "email_address4", - "phone_number": { - "national_number": "national_number6" - } -} +## Example + +```python +from paypalserversdk.models.apple_pay_payment_object import ApplePayPaymentObject +from paypalserversdk.models.phone_number import PhoneNumber + +apple_pay_payment_object = ApplePayPaymentObject( + id='id0', + token='token6', + name='name0', + email_address='email_address2', + phone_number=PhoneNumber( + national_number='national_number6' + ) +) ``` diff --git a/doc/models/apple-pay-payment-token.md b/doc/models/apple-pay-payment-token.md index 6acc8bc..ac41fc2 100644 --- a/doc/models/apple-pay-payment-token.md +++ b/doc/models/apple-pay-payment-token.md @@ -13,24 +13,29 @@ A resource representing a response for Apple Pay. | --- | --- | --- | --- | | `card` | [`ApplePayCard`](../../doc/models/apple-pay-card.md) | Optional | The payment card to be used to fund a payment. Can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_card import ApplePayCard +from paypalserversdk.models.apple_pay_payment_token import ApplePayPaymentToken +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType + +apple_pay_payment_token = ApplePayPaymentToken( + card=ApplePayCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) +) ``` diff --git a/doc/models/apple-pay-request-card.md b/doc/models/apple-pay-request-card.md index 50b1af9..e2be854 100644 --- a/doc/models/apple-pay-request-card.md +++ b/doc/models/apple-pay-request-card.md @@ -15,20 +15,25 @@ The payment card to be used to fund a payment. Can be a credit or debit 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). | -## 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" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_request_card import ApplePayRequestCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType + +apple_pay_request_card = ApplePayRequestCard( + mtype=CardType.DEBIT, + brand=CardBrand.SWITCH, + billing_address=Address( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/apple-pay-request.md b/doc/models/apple-pay-request.md index dff5e3d..f3d3916 100644 --- a/doc/models/apple-pay-request.md +++ b/doc/models/apple-pay-request.md @@ -21,37 +21,45 @@ Information needed to pay using ApplePay. | `attributes` | [`ApplePayAttributes`](../../doc/models/apple-pay-attributes.md) | Optional | Additional attributes associated with apple pay. | | `experience_context` | [`ApplePayExperienceContext`](../../doc/models/apple-pay-experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "id": "id6", - "name": "name6", - "email_address": "email_address4", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } -} +## Example + +```python +from paypalserversdk.models.apple_pay_decrypted_token_data import ApplePayDecryptedTokenData +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType +from paypalserversdk.models.apple_pay_request import ApplePayRequest +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.money import Money +from paypalserversdk.models.phone_number import PhoneNumber + +apple_pay_request = ApplePayRequest( + id='id0', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ), + decrypted_token=ApplePayDecryptedTokenData( + tokenized_card=ApplePayTokenizedCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.UNKNOWN + ), + transaction_amount=Money( + currency_code='currency_code6', + value='value2' + ), + device_manufacturer_id='device_manufacturer_id6', + payment_data_type=ApplePayPaymentDataType.ENUM_3DSECURE, + payment_data=ApplePayPaymentData( + cryptogram='cryptogram6', + eci_indicator='eci_indicator0', + emv_data='emv_data0', + pin='pin4' + ) + ) +) ``` diff --git a/doc/models/apple-pay-tokenized-card.md b/doc/models/apple-pay-tokenized-card.md index a4fb2c5..b27acc9 100644 --- a/doc/models/apple-pay-tokenized-card.md +++ b/doc/models/apple-pay-tokenized-card.md @@ -19,15 +19,17 @@ The payment card to use to fund a payment. Can be a credit or debit 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). | -## Example (as JSON) - -```json -{ - "name": "name8", - "number": "number6", - "expiry": "expiry6", - "card_type": "SOLO", - "type": "STORE" -} +## Example + +```python +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_type import CardType + +apple_pay_tokenized_card = ApplePayTokenizedCard( + name='name2', + number='number0', + expiry='expiry0', + mtype=CardType.STORE +) ``` diff --git a/doc/models/application-context-user-action.md b/doc/models/application-context-user-action.md index f6595f7..1d1a831 100644 --- a/doc/models/application-context-user-action.md +++ b/doc/models/application-context-user-action.md @@ -14,3 +14,11 @@ Configures the label name to `Continue` or `Subscribe Now` for subscription cons | `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. | +## Example + +```python +from paypalserversdk.models.application_context_user_action import ApplicationContextUserAction + +application_context_user_action = ApplicationContextUserAction.CONTINUE +``` + diff --git a/doc/models/assurance-details.md b/doc/models/assurance-details.md index b60439b..af50cc8 100644 --- a/doc/models/assurance-details.md +++ b/doc/models/assurance-details.md @@ -14,12 +14,14 @@ Information about cardholder possession validation and cardholder identification | `account_verified` | `bool` | Optional | If true, indicates that Cardholder possession validation has been performed on returned payment credential.

**Default**: `False` | | `card_holder_authenticated` | `bool` | Optional | If true, indicates that identification and verifications (ID&V) was performed on the returned payment credential.If false, the same risk-based authentication can be performed as you would for card transactions. This risk-based authentication can include, but not limited to, step-up with 3D Secure protocol if applicable.

**Default**: `False` | -## Example (as JSON) +## Example -```json -{ - "account_verified": false, - "card_holder_authenticated": false -} +```python +from paypalserversdk.models.assurance_details import AssuranceDetails + +assurance_details = AssuranceDetails( + account_verified=False, + card_holder_authenticated=False +) ``` diff --git a/doc/models/auction-information.md b/doc/models/auction-information.md index ec5f96f..5620bb2 100644 --- a/doc/models/auction-information.md +++ b/doc/models/auction-information.md @@ -16,14 +16,16 @@ The auction information. | `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" -} +## Example + +```python +from paypalserversdk.models.auction_information import AuctionInformation + +auction_information = AuctionInformation( + auction_site='auction_site0', + auction_item_site='auction_item_site2', + auction_buyer_id='auction_buyer_id4', + auction_closing_date='auction_closing_date6' +) ``` diff --git a/doc/models/authentication-response.md b/doc/models/authentication-response.md index 97ba9d9..a815769 100644 --- a/doc/models/authentication-response.md +++ b/doc/models/authentication-response.md @@ -14,15 +14,21 @@ Results of Authentication such as 3D Secure. | `liability_shift` | [`LiabilityShiftIndicator`](../../doc/models/liability-shift-indicator.md) | Optional | Liability shift indicator. The outcome of the issuer's authentication.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `three_d_secure` | [`ThreeDSecureAuthenticationResponse`](../../doc/models/three-d-secure-authentication-response.md) | Optional | Results of 3D Secure Authentication. | -## Example (as JSON) - -```json -{ - "liability_shift": "POSSIBLE", - "three_d_secure": { - "authentication_status": "C", - "enrollment_status": "Y" - } -} +## Example + +```python +from paypalserversdk.models.authentication_response import AuthenticationResponse +from paypalserversdk.models.enrollment_status import EnrollmentStatus +from paypalserversdk.models.liability_shift_indicator import LiabilityShiftIndicator +from paypalserversdk.models.pa_res_status import PaResStatus +from paypalserversdk.models.three_d_secure_authentication_response import ThreeDSecureAuthenticationResponse + +authentication_response = AuthenticationResponse( + liability_shift=LiabilityShiftIndicator.UNKNOWN, + three_d_secure=ThreeDSecureAuthenticationResponse( + authentication_status=PaResStatus.CHALLENGEREQUIRED, + enrollment_status=EnrollmentStatus.ENROLLED + ) +) ``` diff --git a/doc/models/authorization-incomplete-reason.md b/doc/models/authorization-incomplete-reason.md index ff84601..76c6d1b 100644 --- a/doc/models/authorization-incomplete-reason.md +++ b/doc/models/authorization-incomplete-reason.md @@ -14,3 +14,11 @@ The reason why the authorized status is `PENDING`. | `PENDING_REVIEW` | Authorization is pending manual review. | | `DECLINED_BY_RISK_FRAUD_FILTERS` | Risk Filter set by the payee failed for the transaction. | +## Example + +```python +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason + +authorization_incomplete_reason = AuthorizationIncompleteReason.PENDING_REVIEW +``` + diff --git a/doc/models/authorization-status-details.md b/doc/models/authorization-status-details.md index ff15576..63e1dda 100644 --- a/doc/models/authorization-status-details.md +++ b/doc/models/authorization-status-details.md @@ -13,11 +13,14 @@ The details of the authorized payment status. | --- | --- | --- | --- | | `reason` | [`AuthorizationIncompleteReason`](../../doc/models/authorization-incomplete-reason.md) | Optional | The reason why the authorized status is `PENDING`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "reason": "PENDING_REVIEW" -} +```python +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason +from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails + +authorization_status_details = AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW +) ``` diff --git a/doc/models/authorization-status-with-details.md b/doc/models/authorization-status-with-details.md index 4d43b9d..85c02ed 100644 --- a/doc/models/authorization-status-with-details.md +++ b/doc/models/authorization-status-with-details.md @@ -14,14 +14,17 @@ The status fields and status details for an authorized payment. | `status` | [`AuthorizationStatus`](../../doc/models/authorization-status.md) | Optional, Read-only | The status for the authorized payment. | | `status_details` | [`AuthorizationStatusDetails`](../../doc/models/authorization-status-details.md) | Optional | The details of the authorized payment status. | -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "status_details": { - "reason": "PENDING_REVIEW" - } -} +## Example + +```python +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason +from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails +from paypalserversdk.models.authorization_status_with_details import AuthorizationStatusWithDetails + +authorization_status_with_details = AuthorizationStatusWithDetails( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ) +) ``` diff --git a/doc/models/authorization-status.md b/doc/models/authorization-status.md index 3f9fe70..19f685a 100644 --- a/doc/models/authorization-status.md +++ b/doc/models/authorization-status.md @@ -18,3 +18,11 @@ The status for the authorized payment. | `VOIDED` | The authorized payment was voided. No more captured payments can be made against this authorized payment. | | `PENDING` | The created authorization is in pending state. For more information, see status.details. | +## Example + +```python +from paypalserversdk.models.authorization_status import AuthorizationStatus + +authorization_status = AuthorizationStatus.VOIDED +``` + diff --git a/doc/models/authorization-with-additional-data.md b/doc/models/authorization-with-additional-data.md index f0c28f2..bdbabf4 100644 --- a/doc/models/authorization-with-additional-data.md +++ b/doc/models/authorization-with-additional-data.md @@ -25,20 +25,22 @@ The authorization with additional payment details, such as risk assessment and p | `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})$` | | `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id6" -} +## Example + +```python +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason +from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails +from paypalserversdk.models.authorization_with_additional_data import AuthorizationWithAdditionalData +from paypalserversdk.models.money import Money + +authorization_with_additional_data = AuthorizationWithAdditionalData( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/authorization.md b/doc/models/authorization.md index c3fab43..d3eb46c 100644 --- a/doc/models/authorization.md +++ b/doc/models/authorization.md @@ -24,20 +24,22 @@ The authorized payment transaction. | `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 -{ - "status": "CREATED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id8", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id8" -} +## Example + +```python +from paypalserversdk.models.authorization import Authorization +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason +from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails +from paypalserversdk.models.money import Money + +authorization = Authorization( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/avs-code.md b/doc/models/avs-code.md index b2d176c..912952e 100644 --- a/doc/models/avs-code.md +++ b/doc/models/avs-code.md @@ -36,3 +36,11 @@ The address verification code for Visa, Discover, Mastercard, or American Expres | `AVS_3` | For Maestro, the merchant did not provide AVS information. It was not processed. | | `AVS_4` | For Maestro, the address was not checked or the acquirer had no response. The service is not available. | +## Example + +```python +from paypalserversdk.models.avs_code import AvsCode + +avs_code = AvsCode.AVS_W +``` + diff --git a/doc/models/balance-information.md b/doc/models/balance-information.md index 526c33a..ed96cbf 100644 --- a/doc/models/balance-information.md +++ b/doc/models/balance-information.md @@ -17,24 +17,27 @@ The Balance information. | `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" - } -} +## Example + +```python +from paypalserversdk.models.balance_information import BalanceInformation +from paypalserversdk.models.money import Money + +balance_information = BalanceInformation( + currency='currency8', + total_balance=Money( + currency_code='currency_code6', + value='value2' + ), + primary=False, + available_balance=Money( + currency_code='currency_code8', + value='value4' + ), + withheld_balance=Money( + currency_code='currency_code2', + value='value8' + ) +) ``` diff --git a/doc/models/balances-response.md b/doc/models/balances-response.md index efdedfc..0593ffc 100644 --- a/doc/models/balances-response.md +++ b/doc/models/balances-response.md @@ -16,63 +16,51 @@ The balances response information. | `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) +## Example -```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" -} +```python +from paypalserversdk.models.balance_information import BalanceInformation +from paypalserversdk.models.balances_response import BalancesResponse +from paypalserversdk.models.money import Money + +balances_response = BalancesResponse( + balances=[ + BalanceInformation( + currency='currency0', + total_balance=Money( + currency_code='currency_code6', + value='value2' + ), + primary=False, + available_balance=Money( + currency_code='currency_code8', + value='value4' + ), + withheld_balance=Money( + currency_code='currency_code2', + value='value8' + ) + ), + BalanceInformation( + currency='currency0', + total_balance=Money( + currency_code='currency_code6', + value='value2' + ), + primary=False, + available_balance=Money( + currency_code='currency_code8', + value='value4' + ), + withheld_balance=Money( + currency_code='currency_code2', + value='value8' + ) + ) + ], + account_id='account_id2', + as_of_time='as_of_time0', + last_refresh_time='last_refresh_time2' +) ``` diff --git a/doc/models/bancontact-payment-object.md b/doc/models/bancontact-payment-object.md index d786777..8ef6008 100644 --- a/doc/models/bancontact-payment-object.md +++ b/doc/models/bancontact-payment-object.md @@ -17,15 +17,17 @@ Information used to pay Bancontact. | `iban_last_chars` | `str` | Optional | The last characters of the IBAN used to pay.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `34`, *Pattern*: `[a-zA-Z0-9]{4}` | | `card_last_digits` | `str` | Optional | The last digits of the card used to fund the Bancontact payment.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `[0-9]{4}` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code6", - "bic": "bic8", - "iban_last_chars": "iban_last_chars4", - "card_last_digits": "card_last_digits0" -} +## Example + +```python +from paypalserversdk.models.bancontact_payment_object import BancontactPaymentObject + +bancontact_payment_object = BancontactPaymentObject( + name='name8', + country_code='country_code8', + bic='bic0', + iban_last_chars='iban_last_chars6', + card_last_digits='card_last_digits2' +) ``` diff --git a/doc/models/bancontact-payment-request.md b/doc/models/bancontact-payment-request.md index 35ab2fe..c5ae00f 100644 --- a/doc/models/bancontact-payment-request.md +++ b/doc/models/bancontact-payment-request.md @@ -15,19 +15,23 @@ Information needed to pay using Bancontact. | `country_code` | `str` | Required | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.bancontact_payment_request import BancontactPaymentRequest +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference + +bancontact_payment_request = BancontactPaymentRequest( + name='name6', + country_code='country_code6', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/bank-request.md b/doc/models/bank-request.md index 8ce3f2f..1a76d83 100644 --- a/doc/models/bank-request.md +++ b/doc/models/bank-request.md @@ -14,21 +14,24 @@ A Resource representing a request to vault a Bank used for ACH Debit. | `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" - } - } -} +## Example + +```python +import jsonpickle + +from paypalserversdk.models.bank_request import BankRequest +from paypalserversdk.models.sepa_debit_experience_context import SepaDebitExperienceContext +from paypalserversdk.models.sepa_debit_request import SepaDebitRequest + +bank_request = BankRequest( + ach_debit=jsonpickle.decode('{"key1":"val1","key2":"val2"}'), + sepa_debit=SepaDebitRequest( + experience_context=SepaDebitExperienceContext( + return_url='return_url4', + cancel_url='cancel_url6', + locale='locale6' + ) + ) +) ``` diff --git a/doc/models/billing-cycle-override.md b/doc/models/billing-cycle-override.md index b68dd01..f50947c 100644 --- a/doc/models/billing-cycle-override.md +++ b/doc/models/billing-cycle-override.md @@ -15,47 +15,52 @@ The billing cycle details to override at subscription level. The subscription bi | `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 -} +## Example + +```python +from paypalserversdk.models.billing_cycle_override import BillingCycleOverride +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme + +billing_cycle_override = BillingCycleOverride( + sequence=99, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=118 +) ``` diff --git a/doc/models/billing-cycle.md b/doc/models/billing-cycle.md index 4a54d44..240c615 100644 --- a/doc/models/billing-cycle.md +++ b/doc/models/billing-cycle.md @@ -16,26 +16,39 @@ The billing cycle providing details of the billing frequency, amount, duration a | `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])$` | - -## Example (as JSON) - -```json -{ - "tenure_type": "REGULAR", - "total_cycles": 1, - "sequence": 1, - "pricing_scheme": { - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "AUTO_RELOAD", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - "start_date": "start_date0" -} +| `frequency` | [`CycleFrequency`](../../doc/models/cycle-frequency.md) | Optional | The frequency of the terms reset cycle. | + +## Example + +```python +from paypalserversdk.models.billing_cycle import BillingCycle +from paypalserversdk.models.cycle_frequency import CycleFrequency +from paypalserversdk.models.frequency_interval_unit import FrequencyIntervalUnit +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_model import PricingModel +from paypalserversdk.models.pricing_scheme import PricingScheme +from paypalserversdk.models.tenure_type import TenureType + +billing_cycle = BillingCycle( + tenure_type=TenureType.REGULAR, + pricing_scheme=PricingScheme( + pricing_model=PricingModel.AUTO_RELOAD, + price=Money( + currency_code='currency_code8', + value='value4' + ), + reload_threshold_amount=Money( + currency_code='currency_code0', + value='value6' + ) + ), + total_cycles=1, + sequence=1, + start_date='start_date2', + frequency=CycleFrequency( + interval_unit=FrequencyIntervalUnit.LIFETIME, + interval_count=94 + ) +) ``` diff --git a/doc/models/billing-plan.md b/doc/models/billing-plan.md index ec49cc8..42bdf68 100644 --- a/doc/models/billing-plan.md +++ b/doc/models/billing-plan.md @@ -25,16 +25,18 @@ The plan details. | `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, Read-only | 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" -} +## Example + +```python +from paypalserversdk.models.billing_plan import BillingPlan +from paypalserversdk.models.subscription_plan_status import SubscriptionPlanStatus + +billing_plan = BillingPlan( + product_id='product_id4', + name='name8', + status=SubscriptionPlanStatus.CREATED, + description='description8', + quantity_supported=False +) ``` diff --git a/doc/models/bin-details.md b/doc/models/bin-details.md index 6d6e2dc..5adaaf5 100644 --- a/doc/models/bin-details.md +++ b/doc/models/bin-details.md @@ -16,18 +16,18 @@ Bank Identification Number (BIN) details used to fund a payment. | `bin_country_code` | `str` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `products` | `List[str]` | Optional | The type of card product assigned to the BIN by the issuer. These values are defined by the issuer and may change over time. Some examples include: PREPAID_GIFT, CONSUMER, CORPORATE.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255` | -## Example (as JSON) - -```json -{ - "bin": "bin0", - "issuing_bank": "issuing_bank0", - "bin_country_code": "bin_country_code4", - "products": [ - "products8", - "products9", - "products0" - ] -} +## Example + +```python +from paypalserversdk.models.bin_details import BinDetails + +bin_details = BinDetails( + bin='bin4', + issuing_bank='issuing_bank4', + bin_country_code='bin_country_code8', + products=[ + 'products2' + ] +) ``` diff --git a/doc/models/blik-experience-context.md b/doc/models/blik-experience-context.md index af02460..35c364a 100644 --- a/doc/models/blik-experience-context.md +++ b/doc/models/blik-experience-context.md @@ -19,15 +19,18 @@ Customizes the payer experience during the approval process for the BLIK payment | `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*$` | | `consumer_user_agent` | `str` | Optional | The payer's User Agent. For example, Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "brand_name": "brand_name0", - "locale": "locale4", - "return_url": "return_url2", - "cancel_url": "cancel_url4" -} +## Example + +```python +from paypalserversdk.models.blik_experience_context import BlikExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference + +blik_experience_context = BlikExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.GET_FROM_FILE, + return_url='return_url4', + cancel_url='cancel_url6' +) ``` diff --git a/doc/models/blik-level-0-payment-object.md b/doc/models/blik-level-0-payment-object.md index c3055f6..ef72633 100644 --- a/doc/models/blik-level-0-payment-object.md +++ b/doc/models/blik-level-0-payment-object.md @@ -13,11 +13,13 @@ Information used to pay using BLIK level_0 flow. | --- | --- | --- | --- | | `auth_code` | `str` | Required | The 6-digit code used to authenticate a consumer within BLIK.

**Constraints**: *Minimum Length*: `6`, *Maximum Length*: `6`, *Pattern*: `^[0-9]{6}$` | -## Example (as JSON) +## Example -```json -{ - "auth_code": "auth_code6" -} +```python +from paypalserversdk.models.blik_level_0_payment_object import BlikLevel0PaymentObject + +blik_level_0_payment_object = BlikLevel0PaymentObject( + auth_code='auth_code8' +) ``` diff --git a/doc/models/blik-one-click-payment-object.md b/doc/models/blik-one-click-payment-object.md index 1c66c9d..5bfa0fd 100644 --- a/doc/models/blik-one-click-payment-object.md +++ b/doc/models/blik-one-click-payment-object.md @@ -13,11 +13,13 @@ Information used to pay using BLIK one-click flow. | --- | --- | --- | --- | | `consumer_reference` | `str` | Optional | The merchant generated, unique reference serving as a primary identifier for accounts connected between Blik and a merchant.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `64`, *Pattern*: `^[ -~]{3,64}$` | -## Example (as JSON) +## Example -```json -{ - "consumer_reference": "consumer_reference0" -} +```python +from paypalserversdk.models.blik_one_click_payment_object import BlikOneClickPaymentObject + +blik_one_click_payment_object = BlikOneClickPaymentObject( + consumer_reference='consumer_reference2' +) ``` diff --git a/doc/models/blik-one-click-payment-request.md b/doc/models/blik-one-click-payment-request.md index 90807e0..296d11c 100644 --- a/doc/models/blik-one-click-payment-request.md +++ b/doc/models/blik-one-click-payment-request.md @@ -16,14 +16,16 @@ Information used to pay using BLIK one-click flow. | `alias_label` | `str` | Optional | A bank defined identifier used as a display name to allow the payer to differentiate between multiple registered bank accounts.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `35`, *Pattern*: `^[ -~]{8,35}$` | | `alias_key` | `str` | Optional | A Blik-defined identifier for a specific Blik-enabled bank account that is associated with a given merchant. Used only in conjunction with a Consumer Reference.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `19`, *Pattern*: `^[0-9]+$` | -## Example (as JSON) - -```json -{ - "auth_code": "auth_code8", - "consumer_reference": "consumer_reference6", - "alias_label": "alias_label2", - "alias_key": "alias_key6" -} +## Example + +```python +from paypalserversdk.models.blik_one_click_payment_request import BlikOneClickPaymentRequest + +blik_one_click_payment_request = BlikOneClickPaymentRequest( + consumer_reference='consumer_reference6', + auth_code='auth_code8', + alias_label='alias_label2', + alias_key='alias_key6' +) ``` diff --git a/doc/models/blik-payment-object.md b/doc/models/blik-payment-object.md index 448059e..fdd924e 100644 --- a/doc/models/blik-payment-object.md +++ b/doc/models/blik-payment-object.md @@ -16,16 +16,19 @@ Information used to pay using BLIK. | `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])+)\])$`` | | `one_click` | [`BlikOneClickPaymentObject`](../../doc/models/blik-one-click-payment-object.md) | Optional | Information used to pay using BLIK one-click flow. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "email": "email8", - "one_click": { - "consumer_reference": "consumer_reference2" - } -} +## Example + +```python +from paypalserversdk.models.blik_one_click_payment_object import BlikOneClickPaymentObject +from paypalserversdk.models.blik_payment_object import BlikPaymentObject + +blik_payment_object = BlikPaymentObject( + name='name2', + country_code='country_code2', + email='email4', + one_click=BlikOneClickPaymentObject( + consumer_reference='consumer_reference2' + ) +) ``` diff --git a/doc/models/blik-payment-request.md b/doc/models/blik-payment-request.md index e8cd71e..24e74bd 100644 --- a/doc/models/blik-payment-request.md +++ b/doc/models/blik-payment-request.md @@ -18,29 +18,35 @@ Information needed to pay using BLIK. | `level_0` | [`BlikLevel0PaymentObject`](../../doc/models/blik-level-0-payment-object.md) | Optional | Information used to pay using BLIK level_0 flow. | | `one_click` | [`BlikOneClickPaymentRequest`](../../doc/models/blik-one-click-payment-request.md) | Optional | Information used to pay using BLIK one-click flow. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "email": "email8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } -} +## Example + +```python +from paypalserversdk.models.blik_experience_context import BlikExperienceContext +from paypalserversdk.models.blik_level_0_payment_object import BlikLevel0PaymentObject +from paypalserversdk.models.blik_one_click_payment_request import BlikOneClickPaymentRequest +from paypalserversdk.models.blik_payment_request import BlikPaymentRequest +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference + +blik_payment_request = BlikPaymentRequest( + name='name2', + country_code='country_code2', + email='email4', + experience_context=BlikExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ), + level_0=BlikLevel0PaymentObject( + auth_code='auth_code8' + ), + one_click=BlikOneClickPaymentRequest( + consumer_reference='consumer_reference2', + auth_code='auth_code0', + alias_label='alias_label6', + alias_key='alias_key4' + ) +) ``` diff --git a/doc/models/callback-configuration.md b/doc/models/callback-configuration.md index 3272682..3b1ed5b 100644 --- a/doc/models/callback-configuration.md +++ b/doc/models/callback-configuration.md @@ -14,16 +14,19 @@ CallBack Configuration that the merchant can provide to PayPal/Venmo. | `callback_events` | [`List[CallbackEvents]`](../../doc/models/callback-events.md) | Required | An array of callback events merchant can subscribe to for the corresponding callback url.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `5`, *Unique Items Required*, *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^[0-9A-Z_]+$` | | `callback_url` | `str` | Required | Merchant provided CallBack url.PayPal/Venmo will use this url to call the merchant back when the events occur .PayPal/Venmo expects a secured url usually in the https format.merchant can append the cart id or other params part of the url as query or path params.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `2040`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "callback_events": [ - "SHIPPING_OPTIONS", - "SHIPPING_ADDRESS", - "SHIPPING_OPTIONS" - ], - "callback_url": "callback_url2" -} +## Example + +```python +from paypalserversdk.models.callback_configuration import CallbackConfiguration +from paypalserversdk.models.callback_events import CallbackEvents + +callback_configuration = CallbackConfiguration( + callback_events=[ + CallbackEvents.SHIPPING_OPTIONS, + CallbackEvents.SHIPPING_ADDRESS, + CallbackEvents.SHIPPING_OPTIONS + ], + callback_url='callback_url4' +) ``` diff --git a/doc/models/callback-events.md b/doc/models/callback-events.md index 0daa373..71407e3 100644 --- a/doc/models/callback-events.md +++ b/doc/models/callback-events.md @@ -14,3 +14,11 @@ CallBack event. | `SHIPPING_ADDRESS` | When Buyer changes or selects the shipping address on the PayPal/Venmo buyer approval flow , PayPal/Venmo will call merchant with the callback URL to update order totals. | | `SHIPPING_OPTIONS` | When Buyer changes or selects the shipping options on the PayPal/Venmo buyer approval flow , PayPal/Venmo will call merchant with the callback URL to update order totals. | +## Example + +```python +from paypalserversdk.models.callback_events import CallbackEvents + +callback_events = CallbackEvents.SHIPPING_ADDRESS +``` + diff --git a/doc/models/cancel-subscription-request.md b/doc/models/cancel-subscription-request.md index d808a21..fe10ebf 100644 --- a/doc/models/cancel-subscription-request.md +++ b/doc/models/cancel-subscription-request.md @@ -13,11 +13,13 @@ The cancel subscription request details. | --- | --- | --- | --- | | `reason` | `str` | Required | The reason for the cancellation of a subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason8" -} +```python +from paypalserversdk.models.cancel_subscription_request import CancelSubscriptionRequest + +cancel_subscription_request = CancelSubscriptionRequest( + reason='reason8' +) ``` diff --git a/doc/models/capture-incomplete-reason.md b/doc/models/capture-incomplete-reason.md index bd464ed..c93610b 100644 --- a/doc/models/capture-incomplete-reason.md +++ b/doc/models/capture-incomplete-reason.md @@ -24,3 +24,11 @@ The reason why the captured payment status is `PENDING` or `DENIED`. | `VERIFICATION_REQUIRED` | The payee's PayPal account is not verified. | | `DECLINED_BY_RISK_FRAUD_FILTERS` | Risk Filter set by the payee failed for the transaction. | +## Example + +```python +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason + +capture_incomplete_reason = CaptureIncompleteReason.VERIFICATION_REQUIRED +``` + diff --git a/doc/models/capture-payment-instruction.md b/doc/models/capture-payment-instruction.md index 87a3353..7595194 100644 --- a/doc/models/capture-payment-instruction.md +++ b/doc/models/capture-payment-instruction.md @@ -15,34 +15,50 @@ Any additional payment instructions to be consider during payment processing. Th | `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_]+$` | | `payee_receivable_fx_rate_id` | `str` | Optional | FX identifier generated returned by PayPal to be used for payment processing in order to honor FX rate (for eligible integrations) to be used when amount is settled/received into the payee account.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "disbursement_mode": "INSTANT", - "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" - } - } - ], - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id8" -} +## Example + +```python +from paypalserversdk.models.capture_payment_instruction import CapturePaymentInstruction +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.platform_fee import PlatformFee + +capture_payment_instruction = CapturePaymentInstruction( + platform_fees=[ + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ) + ], + disbursement_mode=DisbursementMode.INSTANT, + payee_receivable_fx_rate_id='payee_receivable_fx_rate_id8' +) ``` diff --git a/doc/models/capture-request.md b/doc/models/capture-request.md index 480da1e..27dde41 100644 --- a/doc/models/capture-request.md +++ b/doc/models/capture-request.md @@ -18,53 +18,60 @@ Captures either a portion or the full authorized amount of an authorized payment | `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) +## Example -```json -{ - "final_capture": false, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4", - "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_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - }, - "note_to_payer": "note_to_payer6" -} +```python +from paypalserversdk.models.capture_payment_instruction import CapturePaymentInstruction +from paypalserversdk.models.capture_request import CaptureRequest +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.platform_fee import PlatformFee + +capture_request = CaptureRequest( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + invoice_id='invoice_id6', + final_capture=False, + payment_instruction=CapturePaymentInstruction( + platform_fees=[ + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ) + ], + disbursement_mode=DisbursementMode.INSTANT, + payee_receivable_fx_rate_id='payee_receivable_fx_rate_id0' + ), + note_to_payer='note_to_payer8' +) ``` diff --git a/doc/models/capture-status-details.md b/doc/models/capture-status-details.md index ae3a21d..675745f 100644 --- a/doc/models/capture-status-details.md +++ b/doc/models/capture-status-details.md @@ -13,11 +13,14 @@ The details of the captured payment status. | --- | --- | --- | --- | | `reason` | [`CaptureIncompleteReason`](../../doc/models/capture-incomplete-reason.md) | Optional | The reason why the captured payment status is `PENDING` or `DENIED`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "reason": "BUYER_COMPLAINT" -} +```python +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason +from paypalserversdk.models.capture_status_details import CaptureStatusDetails + +capture_status_details = CaptureStatusDetails( + reason=CaptureIncompleteReason.OTHER +) ``` diff --git a/doc/models/capture-status-with-details.md b/doc/models/capture-status-with-details.md index d7b2e65..9b0b153 100644 --- a/doc/models/capture-status-with-details.md +++ b/doc/models/capture-status-with-details.md @@ -14,14 +14,17 @@ The status and status details of a captured payment. | `status` | [`CaptureStatus`](../../doc/models/capture-status.md) | Optional, Read-only | The status of the captured payment. | | `status_details` | [`CaptureStatusDetails`](../../doc/models/capture-status-details.md) | Optional | The details of the captured payment status. | -## Example (as JSON) - -```json -{ - "status": "COMPLETED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - } -} +## Example + +```python +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason +from paypalserversdk.models.capture_status_details import CaptureStatusDetails +from paypalserversdk.models.capture_status_with_details import CaptureStatusWithDetails + +capture_status_with_details = CaptureStatusWithDetails( + status_details=CaptureStatusDetails( + reason=CaptureIncompleteReason.VERIFICATION_REQUIRED + ) +) ``` diff --git a/doc/models/capture-status.md b/doc/models/capture-status.md index d5f1886..3468373 100644 --- a/doc/models/capture-status.md +++ b/doc/models/capture-status.md @@ -18,3 +18,11 @@ The status of the captured payment. | `REFUNDED` | An amount greater than or equal to this captured payment's amount was refunded to the payer. | | `FAILED` | There was an error while capturing payment. | +## Example + +```python +from paypalserversdk.models.capture_status import CaptureStatus + +capture_status = CaptureStatus.COMPLETED +``` + diff --git a/doc/models/capture-subscription-request.md b/doc/models/capture-subscription-request.md index 10cc2ad..c7706a9 100644 --- a/doc/models/capture-subscription-request.md +++ b/doc/models/capture-subscription-request.md @@ -15,16 +15,20 @@ The charge amount from the subscriber. | `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" - } -} +## Example + +```python +from paypalserversdk.models.capture_subscription_request import CaptureSubscriptionRequest +from paypalserversdk.models.capture_type import CaptureType +from paypalserversdk.models.money import Money + +capture_subscription_request = CaptureSubscriptionRequest( + note='note8', + capture_type=CaptureType.OUTSTANDING_BALANCE, + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/capture-type.md b/doc/models/capture-type.md index 4739ebd..50e4d62 100644 --- a/doc/models/capture-type.md +++ b/doc/models/capture-type.md @@ -13,3 +13,11 @@ The type of capture. | --- | --- | | `OUTSTANDING_BALANCE` | The outstanding balance that the subscriber must clear. | +## Example + +```python +from paypalserversdk.models.capture_type import CaptureType + +capture_type = CaptureType.OUTSTANDING_BALANCE +``` + diff --git a/doc/models/captured-payment.md b/doc/models/captured-payment.md index b3fd0b1..c955cca 100644 --- a/doc/models/captured-payment.md +++ b/doc/models/captured-payment.md @@ -29,22 +29,25 @@ A captured payment. | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -## Example (as JSON) - -```json -{ - "final_capture": false, - "disbursement_mode": "INSTANT", - "status": "PARTIALLY_REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4" -} +## Example + +```python +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason +from paypalserversdk.models.capture_status_details import CaptureStatusDetails +from paypalserversdk.models.captured_payment import CapturedPayment +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money + +captured_payment = CapturedPayment( + status_details=CaptureStatusDetails( + reason=CaptureIncompleteReason.VERIFICATION_REQUIRED + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ), + final_capture=False, + disbursement_mode=DisbursementMode.INSTANT +) ``` diff --git a/doc/models/card-attributes-response.md b/doc/models/card-attributes-response.md index 428f00a..7a9d8f5 100644 --- a/doc/models/card-attributes-response.md +++ b/doc/models/card-attributes-response.md @@ -13,36 +13,38 @@ Additional attributes associated with the use of this card. | --- | --- | --- | --- | | `vault` | [`CardVaultResponse`](../../doc/models/card-vault-response.md) | Optional | The details about a saved Card payment source. | -## Example (as JSON) - -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "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" - }, - "merchant_customer_id": "merchant_customer_id2" - } - } -} +## Example + +```python +from paypalserversdk.models.card_attributes_response import CardAttributesResponse +from paypalserversdk.models.card_customer_information import CardCustomerInformation +from paypalserversdk.models.card_vault_response import CardVaultResponse +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.vault_status import VaultStatus + +card_attributes_response = CardAttributesResponse( + vault=CardVaultResponse( + id='id6', + status=VaultStatus.APPROVED, + customer=CardCustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id2' + ) + ) +) ``` diff --git a/doc/models/card-attributes.md b/doc/models/card-attributes.md index 051e9bd..dbf95dd 100644 --- a/doc/models/card-attributes.md +++ b/doc/models/card-attributes.md @@ -15,31 +15,42 @@ Additional attributes associated with the use of this card. | `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" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - }, - "vault": { - "store_in_vault": "ON_SUCCESS" - }, - "verification": { - "method": "3D_SECURE" - } -} +## Example + +```python +from paypalserversdk.models.card_attributes import CardAttributes +from paypalserversdk.models.card_customer_information import CardCustomerInformation +from paypalserversdk.models.card_verification import CardVerification +from paypalserversdk.models.name import Name +from paypalserversdk.models.orders_card_verification_method import OrdersCardVerificationMethod +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.vault_instruction_base import VaultInstructionBase + +card_attributes = CardAttributes( + customer=CardCustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id2' + ), + vault=VaultInstructionBase( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS + ), + verification=CardVerification( + method=OrdersCardVerificationMethod.ENUM_3D_SECURE + ) +) ``` diff --git a/doc/models/card-authentication-response.md b/doc/models/card-authentication-response.md index a21b2d1..da2bb34 100644 --- a/doc/models/card-authentication-response.md +++ b/doc/models/card-authentication-response.md @@ -13,15 +13,20 @@ Results of Authentication such as 3D Secure. | --- | --- | --- | --- | | `three_d_secure` | [`ThreeDSecureCardAuthenticationResponse`](../../doc/models/three-d-secure-card-authentication-response.md) | Optional | Results of 3D Secure Authentication. | -## Example (as JSON) - -```json -{ - "three_d_secure": { - "authentication_status": "C", - "enrollment_status": "Y", - "authentication_id": "authentication_id6" - } -} +## Example + +```python +from paypalserversdk.models.card_authentication_response import CardAuthenticationResponse +from paypalserversdk.models.enrollment_status import EnrollmentStatus +from paypalserversdk.models.pa_res_status import PaResStatus +from paypalserversdk.models.three_d_secure_card_authentication_response import ThreeDSecureCardAuthenticationResponse + +card_authentication_response = CardAuthenticationResponse( + three_d_secure=ThreeDSecureCardAuthenticationResponse( + authentication_status=PaResStatus.CHALLENGEREQUIRED, + enrollment_status=EnrollmentStatus.ENROLLED, + authentication_id='authentication_id6' + ) +) ``` diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md index d02e168..35859cb 100644 --- a/doc/models/card-brand.md +++ b/doc/models/card-brand.md @@ -42,3 +42,11 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `ACCEL` | The Accel payment network. | | `UNKNOWN` | UNKNOWN payment network. | +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand + +card_brand = CardBrand.STAR +``` + diff --git a/doc/models/card-customer-information.md b/doc/models/card-customer-information.md index f40affc..2968071 100644 --- a/doc/models/card-customer-information.md +++ b/doc/models/card-customer-information.md @@ -17,23 +17,29 @@ The details about a customer in PayPal's system of record. | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `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": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" -} +## Example + +```python +from paypalserversdk.models.card_customer_information import CardCustomerInformation +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +card_customer_information = CardCustomerInformation( + id='id6', + email_address='email_address6', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id8' +) ``` diff --git a/doc/models/card-customer.md b/doc/models/card-customer.md index 2c34991..3accc34 100644 --- a/doc/models/card-customer.md +++ b/doc/models/card-customer.md @@ -16,19 +16,24 @@ The details about a customer in PayPal's system of record. | `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" -} +## Example + +```python +from paypalserversdk.models.card_customer import CardCustomer +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +card_customer = CardCustomer( + id='id2', + email_address='email_address0', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + merchant_customer_id='merchant_customer_id4' +) ``` diff --git a/doc/models/card-experience-context.md b/doc/models/card-experience-context.md index 6fe3077..c2e7788 100644 --- a/doc/models/card-experience-context.md +++ b/doc/models/card-experience-context.md @@ -14,12 +14,14 @@ Customizes the payer experience during the 3DS Approval for payment. | `return_url` | `str` | Optional | Describes the URL. | | `cancel_url` | `str` | Optional | Describes the URL. | -## Example (as JSON) +## Example -```json -{ - "return_url": "return_url2", - "cancel_url": "cancel_url0" -} +```python +from paypalserversdk.models.card_experience_context import CardExperienceContext + +card_experience_context = CardExperienceContext( + return_url='return_url2', + cancel_url='cancel_url4' +) ``` diff --git a/doc/models/card-from-request.md b/doc/models/card-from-request.md index 63e1e55..4c3db23 100644 --- a/doc/models/card-from-request.md +++ b/doc/models/card-from-request.md @@ -14,12 +14,13 @@ Representation of card details as received in the request. | `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])$` | | `last_digits` | `str` | Optional, Read-only | The last digits of the payment card.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `4`, *Pattern*: `[0-9]{2,}` | -## Example (as JSON) +## Example -```json -{ - "expiry": "expiry6", - "last_digits": "last_digits2" -} +```python +from paypalserversdk.models.card_from_request import CardFromRequest + +card_from_request = CardFromRequest( + expiry='expiry4' +) ``` diff --git a/doc/models/card-payment-token-entity.md b/doc/models/card-payment-token-entity.md index ff145be..7cf9540 100644 --- a/doc/models/card-payment-token-entity.md +++ b/doc/models/card-payment-token-entity.md @@ -23,22 +23,25 @@ Full representation of a Card Payment Token. | `bin_details` | [`BinDetails`](../../doc/models/bin-details.md) | Optional | Bank Identification Number (BIN) details used to fund a payment. | | `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_]+$` | -## Example (as JSON) - -```json -{ - "name": "name6", - "last_digits": "last_digits0", - "brand": "VISA", - "expiry": "expiry4", - "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" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_payment_token_entity import CardPaymentTokenEntity +from paypalserversdk.models.card_response_address import CardResponseAddress + +card_payment_token_entity = CardPaymentTokenEntity( + name='name6', + brand=CardBrand.VISA, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/card-request.md b/doc/models/card-request.md index 4fac9c4..2f67ac5 100644 --- a/doc/models/card-request.md +++ b/doc/models/card-request.md @@ -23,22 +23,25 @@ The payment card to use to fund a payment. Can be a credit or debit card. Note: | `network_token` | [`NetworkToken`](../../doc/models/network-token.md) | Optional | The Third Party Network token used to fund a payment. | | `experience_context` | [`CardExperienceContext`](../../doc/models/card-experience-context.md) | Optional | Customizes the payer experience during the 3DS Approval for payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "number": "number4", - "expiry": "expiry6", - "security_code": "security_code0", - "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" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_request import CardRequest + +card_request = CardRequest( + name='name4', + number='number2', + expiry='expiry2', + security_code='security_code6', + billing_address=Address( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/card-response-address.md b/doc/models/card-response-address.md index 18fb74d..7c1c2bc 100644 --- a/doc/models/card-response-address.md +++ b/doc/models/card-response-address.md @@ -19,16 +19,18 @@ Address request details. | `country_code` | `str` | Required | The [2-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `id` | `str` | Optional | The resource ID of the address.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Za-z-_]+$` | -## Example (as JSON) - -```json -{ - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "admin_area_2": "admin_area_26", - "admin_area_1": "admin_area_18", - "postal_code": "postal_code4", - "country_code": "country_code2" -} +## Example + +```python +from paypalserversdk.models.card_response_address import CardResponseAddress + +card_response_address = CardResponseAddress( + country_code='country_code2', + address_line_1='address_line_18', + address_line_2='address_line_22', + admin_area_2='admin_area_26', + admin_area_1='admin_area_18', + postal_code='postal_code4' +) ``` diff --git a/doc/models/card-response-with-billing-address.md b/doc/models/card-response-with-billing-address.md index 8a0b24a..5b69295 100644 --- a/doc/models/card-response-with-billing-address.md +++ b/doc/models/card-response-with-billing-address.md @@ -16,21 +16,24 @@ The payment card used to fund the payment. Card can be a credit or debit card. | `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](https://developer.paypal.com/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" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_response_with_billing_address import CardResponseWithBillingAddress + +card_response_with_billing_address = CardResponseWithBillingAddress( + name='name8', + billing_address=Address( + country_code='country_code8', + 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' + ), + expiry='expiry6', + currency_code='currency_code4' +) ``` diff --git a/doc/models/card-response.md b/doc/models/card-response.md index 3b95cd0..88c2246 100644 --- a/doc/models/card-response.md +++ b/doc/models/card-response.md @@ -23,19 +23,17 @@ The payment card to use to fund a payment. Card can be a credit or debit card. | `bin_details` | [`BinDetails`](../../doc/models/bin-details.md) | Optional | Bank Identification Number (BIN) details used to fund a payment. | | `stored_credential` | [`CardStoredCredential`](../../doc/models/card-stored-credential.md) | Optional | Provides additional details to process a payment using a `card` 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. | -## Example (as JSON) - -```json -{ - "name": "name0", - "last_digits": "last_digits4", - "brand": "CARTE_BANCAIRE", - "available_networks": [ - "ELO", - "DINERS", - "CHINA_UNION_PAY" - ], - "type": "CREDIT" -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response import CardResponse +from paypalserversdk.models.card_type import CardType + +card_response = CardResponse( + name='name6', + brand=CardBrand.RUPAY, + mtype=CardType.UNKNOWN +) ``` diff --git a/doc/models/card-stored-credential.md b/doc/models/card-stored-credential.md index e52d850..ca6a0d4 100644 --- a/doc/models/card-stored-credential.md +++ b/doc/models/card-stored-credential.md @@ -16,19 +16,26 @@ Provides additional details to process a payment using a `card` that has been st | `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` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | -## Example (as JSON) - -```json -{ - "payment_initiator": "CUSTOMER", - "payment_type": "ONE_TIME", - "usage": "DERIVED", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_stored_credential import CardStoredCredential +from paypalserversdk.models.network_transaction import NetworkTransaction +from paypalserversdk.models.payment_initiator import PaymentInitiator +from paypalserversdk.models.stored_payment_source_payment_type import StoredPaymentSourcePaymentType +from paypalserversdk.models.stored_payment_source_usage_type import StoredPaymentSourceUsageType + +card_stored_credential = CardStoredCredential( + payment_initiator=PaymentInitiator.CUSTOMER, + payment_type=StoredPaymentSourcePaymentType.ONE_TIME, + usage=StoredPaymentSourceUsageType.DERIVED, + previous_network_transaction_reference=NetworkTransaction( + id='id6', + date='date2', + network=CardBrand.CONFIDIS, + acquirer_reference_number='acquirer_reference_number8' + ) +) ``` diff --git a/doc/models/card-supplementary-data.md b/doc/models/card-supplementary-data.md index 0df3f95..45f6946 100644 --- a/doc/models/card-supplementary-data.md +++ b/doc/models/card-supplementary-data.md @@ -14,40 +14,46 @@ Merchants and partners can add Level 2 and 3 data to payments to reduce risk and | `level_2` | [`Level2CardProcessingData`](../../doc/models/level-2-card-processing-data.md) | Optional | The level 2 card processing data collections. If your merchant account has been configured for Level 2 processing this field will be passed to the processor on your behalf. Please contact your PayPal Technical Account Manager to define level 2 data for your business. | | `level_3` | [`Level3CardProcessingData`](../../doc/models/level-3-card-processing-data.md) | Optional | The level 3 card processing data collections, If your merchant account has been configured for Level 3 processing this field will be passed to the processor on your behalf. Please contact your PayPal Technical Account Manager to define level 3 data for your business. | -## Example (as JSON) - -```json -{ - "level_2": { - "invoice_id": "invoice_id4", - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - } - }, - "level_3": { - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "duty_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "discount_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "shipping_address": { - "address_line_1": "address_line_10", - "address_line_2": "address_line_20", - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "ships_from_postal_code": "ships_from_postal_code4" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_supplementary_data import CardSupplementaryData +from paypalserversdk.models.level_2_card_processing_data import Level2CardProcessingData +from paypalserversdk.models.level_3_card_processing_data import Level3CardProcessingData +from paypalserversdk.models.money import Money + +card_supplementary_data = CardSupplementaryData( + level_2=Level2CardProcessingData( + invoice_id='invoice_id4', + tax_total=Money( + currency_code='currency_code4', + value='value0' + ) + ), + level_3=Level3CardProcessingData( + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + duty_amount=Money( + currency_code='currency_code6', + value='value2' + ), + discount_amount=Money( + currency_code='currency_code2', + value='value8' + ), + shipping_address=Address( + country_code='country_code0', + address_line_1='address_line_10', + address_line_2='address_line_20', + admin_area_2='admin_area_24', + admin_area_1='admin_area_16', + postal_code='postal_code2' + ), + ships_from_postal_code='ships_from_postal_code4' + ) +) ``` diff --git a/doc/models/card-type.md b/doc/models/card-type.md index e347e60..aa2911f 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -17,3 +17,11 @@ Type of card. i.e Credit, Debit and so on. | `STORE` | A store card. | | `UNKNOWN` | Card type cannot be determined. | +## Example + +```python +from paypalserversdk.models.card_type import CardType + +card_type = CardType.UNKNOWN +``` + diff --git a/doc/models/card-vault-response.md b/doc/models/card-vault-response.md index a73c9e4..209e1cf 100644 --- a/doc/models/card-vault-response.md +++ b/doc/models/card-vault-response.md @@ -16,39 +16,35 @@ The details about a saved Card payment source. | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`CardCustomerInformation`](../../doc/models/card-customer-information.md) | Optional | The details about a customer in PayPal's system of record. | -## Example (as JSON) - -```json -{ - "id": "id6", - "status": "VAULTED", - "links": [ - { - "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" - }, - "merchant_customer_id": "merchant_customer_id2" - } -} +## Example + +```python +from paypalserversdk.models.card_customer_information import CardCustomerInformation +from paypalserversdk.models.card_vault_response import CardVaultResponse +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.vault_status import VaultStatus + +card_vault_response = CardVaultResponse( + id='id0', + status=VaultStatus.APPROVED, + customer=CardCustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id2' + ) +) ``` diff --git a/doc/models/card-verification-details.md b/doc/models/card-verification-details.md index 39a7728..f6e9fc4 100644 --- a/doc/models/card-verification-details.md +++ b/doc/models/card-verification-details.md @@ -19,18 +19,21 @@ Card Verification details including the authorization details and 3D SECURE deta | `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. | -## Example (as JSON) - -```json -{ - "network_transaction_id": "network_transaction_id4", - "date": "date8", - "network": "ACCEL", - "time": "time2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_verification_details import CardVerificationDetails +from paypalserversdk.models.money import Money + +card_verification_details = CardVerificationDetails( + network_transaction_id='network_transaction_id4', + date='date8', + network=CardBrand.ACCEL, + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/card-verification-processor-response.md b/doc/models/card-verification-processor-response.md index 6a9104d..83ba96f 100644 --- a/doc/models/card-verification-processor-response.md +++ b/doc/models/card-verification-processor-response.md @@ -14,12 +14,11 @@ The processor response information for payment requests, such as direct credit c | `avs_code` | [`AvsCode`](../../doc/models/avs-code.md) | Optional, Read-only | The address verification code for Visa, Discover, Mastercard, or American Express transactions. | | `cvv_code` | [`CvvCode`](../../doc/models/cvv-code.md) | Optional, Read-only | The card verification value code for for Visa, Discover, Mastercard, or American Express. | -## Example (as JSON) +## Example -```json -{ - "avs_code": "E", - "cvv_code": "All others" -} +```python +from paypalserversdk.models.card_verification_processor_response import CardVerificationProcessorResponse + +card_verification_processor_response = CardVerificationProcessorResponse() ``` diff --git a/doc/models/card-verification-status.md b/doc/models/card-verification-status.md index 3069681..37c641d 100644 --- a/doc/models/card-verification-status.md +++ b/doc/models/card-verification-status.md @@ -14,3 +14,11 @@ Verification status of Card. | `VERIFIED` | Card has been verified | | `FAILED` | Card verification has failed | +## Example + +```python +from paypalserversdk.models.card_verification_status import CardVerificationStatus + +card_verification_status = CardVerificationStatus.VERIFIED +``` + diff --git a/doc/models/card-verification.md b/doc/models/card-verification.md index ce5de66..d4410f1 100644 --- a/doc/models/card-verification.md +++ b/doc/models/card-verification.md @@ -13,11 +13,14 @@ The API caller can opt in to verify the card through PayPal offered verification | --- | --- | --- | --- | | `method` | [`OrdersCardVerificationMethod`](../../doc/models/orders-card-verification-method.md) | Optional | The method used for card verification.

**Default**: `"SCA_WHEN_REQUIRED"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "method": "SCA_WHEN_REQUIRED" -} +```python +from paypalserversdk.models.card_verification import CardVerification +from paypalserversdk.models.orders_card_verification_method import OrdersCardVerificationMethod + +card_verification = CardVerification( + method=OrdersCardVerificationMethod.SCA_WHEN_REQUIRED +) ``` diff --git a/doc/models/cart-information.md b/doc/models/cart-information.md index c65e976..aa469db 100644 --- a/doc/models/cart-information.md +++ b/doc/models/cart-information.md @@ -15,21 +15,38 @@ The cart information. | `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" -} +## Example + +```python +from paypalserversdk.models.cart_information import CartInformation +from paypalserversdk.models.item_details import ItemDetails + +cart_information = CartInformation( + item_details=[ + ItemDetails( + item_code='item_code0', + item_name='item_name8', + item_description='item_description4', + item_options='item_options2', + item_quantity='item_quantity2' + ), + ItemDetails( + item_code='item_code0', + item_name='item_name8', + item_description='item_description4', + item_options='item_options2', + item_quantity='item_quantity2' + ), + ItemDetails( + 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_id4' +) ``` diff --git a/doc/models/checkout-option.md b/doc/models/checkout-option.md index 06dccc7..6829732 100644 --- a/doc/models/checkout-option.md +++ b/doc/models/checkout-option.md @@ -14,12 +14,14 @@ A checkout option as a name-and-value pair. | `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) +## Example -```json -{ - "checkout_option_name": "checkout_option_name6", - "checkout_option_value": "checkout_option_value0" -} +```python +from paypalserversdk.models.checkout_option import CheckoutOption + +checkout_option = CheckoutOption( + checkout_option_name='checkout_option_name6', + checkout_option_value='checkout_option_value2' +) ``` diff --git a/doc/models/checkout-payment-intent.md b/doc/models/checkout-payment-intent.md index 313c7bf..bc92cf3 100644 --- a/doc/models/checkout-payment-intent.md +++ b/doc/models/checkout-payment-intent.md @@ -14,3 +14,11 @@ The intent to either capture payment immediately or authorize a payment for an o | `CAPTURE` | The merchant intends to capture payment immediately after the customer makes a payment. | | `AUTHORIZE` | The merchant intends to authorize a payment and place funds on hold after the customer makes a payment. Authorized payments are best captured within three days of authorization but are available to capture for up to 29 days. After the three-day honor period, the original authorized payment expires and you must re-authorize the payment. You must make a separate request to capture payments on demand. This intent is not supported when you have more than one `purchase_unit` within your order. | +## Example + +```python +from paypalserversdk.models.checkout_payment_intent import CheckoutPaymentIntent + +checkout_payment_intent = CheckoutPaymentIntent.CAPTURE +``` + diff --git a/doc/models/cobranded-card.md b/doc/models/cobranded-card.md index d58a713..92fd49e 100644 --- a/doc/models/cobranded-card.md +++ b/doc/models/cobranded-card.md @@ -15,22 +15,27 @@ Details about the merchant cobranded card used for order purchase. | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | | `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 -{ - "labels": [ - "labels2", - "labels3" - ], - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```python +from paypalserversdk.models.cobranded_card import CobrandedCard +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase + +cobranded_card = CobrandedCard( + labels=[ + 'labels0', + 'labels1', + 'labels2' + ], + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md index 7440f73..69345f4 100644 --- a/doc/models/confirm-order-request.md +++ b/doc/models/confirm-order-request.md @@ -15,95 +15,122 @@ Payer confirms the intent to pay for the Order using the provided payment source | `processing_instruction` | [`ProcessingInstruction`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order. | | `application_context` | [`OrderConfirmApplicationContext`](../../doc/models/order-confirm-application-context.md) | Optional | Customizes the payer confirmation experience. | -## Example (as JSON) +## Example -```json -{ - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } - } - }, - "processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL", - "application_context": { - "brand_name": "brand_name8", - "locale": "locale2", - "return_url": "return_url0", - "cancel_url": "cancel_url2", - "stored_payment_source": { - "payment_initiator": "CUSTOMER", - "payment_type": "RECURRING", - "usage": "FIRST", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.bancontact_payment_request import BancontactPaymentRequest +from paypalserversdk.models.blik_experience_context import BlikExperienceContext +from paypalserversdk.models.blik_level_0_payment_object import BlikLevel0PaymentObject +from paypalserversdk.models.blik_one_click_payment_request import BlikOneClickPaymentRequest +from paypalserversdk.models.blik_payment_request import BlikPaymentRequest +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.confirm_order_request import ConfirmOrderRequest +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.name import Name +from paypalserversdk.models.network_transaction import NetworkTransaction +from paypalserversdk.models.order_confirm_application_context import OrderConfirmApplicationContext +from paypalserversdk.models.payment_initiator import PaymentInitiator +from paypalserversdk.models.payment_source import PaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.processing_instruction import ProcessingInstruction +from paypalserversdk.models.stored_payment_source import StoredPaymentSource +from paypalserversdk.models.stored_payment_source_payment_type import StoredPaymentSourcePaymentType +from paypalserversdk.models.stored_payment_source_usage_type import StoredPaymentSourceUsageType +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +confirm_order_request = ConfirmOrderRequest( + payment_source=PaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + bancontact=BancontactPaymentRequest( + name='name0', + country_code='country_code0', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) + ), + blik=BlikPaymentRequest( + name='name2', + country_code='country_code2', + email='email4', + experience_context=BlikExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ), + level_0=BlikLevel0PaymentObject( + auth_code='auth_code8' + ), + one_click=BlikOneClickPaymentRequest( + consumer_reference='consumer_reference2', + auth_code='auth_code0', + alias_label='alias_label6', + alias_key='alias_key4' + ) + ) + ), + processing_instruction=ProcessingInstruction.ORDER_COMPLETE_ON_PAYMENT_APPROVAL, + application_context=OrderConfirmApplicationContext( + brand_name='brand_name8', + locale='locale2', + return_url='return_url0', + cancel_url='cancel_url2', + stored_payment_source=StoredPaymentSource( + payment_initiator=PaymentInitiator.CUSTOMER, + payment_type=StoredPaymentSourcePaymentType.RECURRING, + usage=StoredPaymentSourceUsageType.FIRST, + previous_network_transaction_reference=NetworkTransaction( + id='id6', + date='date2', + network=CardBrand.CONFIDIS, + acquirer_reference_number='acquirer_reference_number8' + ) + ) + ) +) ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 706c38e..a6d216d 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -21,58 +21,72 @@ The create subscription request details. | `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) +## Example -```json -{ - "plan_id": "plan_id8", - "auto_renewal": false, - "start_time": "start_time0", - "quantity": "quantity2", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "subscriber": { - "email_address": "email_address8", - "payer_id": "payer_id8", - "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", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "type": "UNKNOWN" - } - } - } -} +```python +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.create_subscription_request import CreateSubscriptionRequest +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType +from paypalserversdk.models.subscriber_request import SubscriberRequest +from paypalserversdk.models.subscription_card_request import SubscriptionCardRequest +from paypalserversdk.models.subscription_payment_source import SubscriptionPaymentSource + +create_subscription_request = CreateSubscriptionRequest( + plan_id='plan_id6', + start_time='start_time8', + quantity='quantity0', + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + subscriber=SubscriberRequest( + email_address='email_address8', + payer_id='payer_id8', + name=Name( + given_name='given_name2', + surname='surname8' + ), + shipping_address=ShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address8', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.PICKUP_IN_STORE, + options=[ + ShippingOption( + id='id2', + label='label2', + selected=False, + mtype=ShippingType.SHIPPING, + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ), + payment_source=SubscriptionPaymentSource( + card=SubscriptionCardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + mtype=CardType.UNKNOWN + ) + ) + ), + auto_renewal=False +) ``` diff --git a/doc/models/customer-information.md b/doc/models/customer-information.md index c0c3c55..5e89a37 100644 --- a/doc/models/customer-information.md +++ b/doc/models/customer-information.md @@ -16,22 +16,28 @@ This object represents a merchant’s customer, allowing them to store contact d | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "id": "id6", - "email_address": "email_address4", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```python +from paypalserversdk.models.customer_information import CustomerInformation +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +customer_information = CustomerInformation( + id='id8', + email_address='email_address6', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) +) ``` diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 186ce0e..0eaef82 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -14,12 +14,14 @@ Customer in merchant's or partner's system of records. | `id` | `str` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `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) +## Example -```json -{ - "id": "id4", - "merchant_customer_id": "merchant_customer_id6" -} +```python +from paypalserversdk.models.customer_response import CustomerResponse + +customer_response = CustomerResponse( + id='id0', + merchant_customer_id='merchant_customer_id2' +) ``` diff --git a/doc/models/customer-vault-payment-tokens-response.md b/doc/models/customer-vault-payment-tokens-response.md index 3b1d46b..b7ef321 100644 --- a/doc/models/customer-vault-payment-tokens-response.md +++ b/doc/models/customer-vault-payment-tokens-response.md @@ -17,242 +17,105 @@ Collection of payment tokens saved for a given customer. | `payment_tokens` | [`List[PaymentTokenResponse]`](../../doc/models/payment-token-response.md) | Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `64` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | -## Example (as JSON) +## Example -```json -{ - "total_items": 50, - "total_pages": 10, - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2", - "links": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_card import ApplePayCard +from paypalserversdk.models.apple_pay_payment_token import ApplePayPaymentToken +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_payment_token_entity import CardPaymentTokenEntity +from paypalserversdk.models.card_response_address import CardResponseAddress +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.customer_response import CustomerResponse +from paypalserversdk.models.customer_vault_payment_tokens_response import CustomerVaultPaymentTokensResponse +from paypalserversdk.models.payment_token_response import PaymentTokenResponse +from paypalserversdk.models.payment_token_response_payment_source import PaymentTokenResponsePaymentSource +from paypalserversdk.models.vault_response_customer import VaultResponseCustomer + +customer_vault_payment_tokens_response = CustomerVaultPaymentTokensResponse( + total_items=42, + total_pages=10, + customer=VaultResponseCustomer( + id='id0', + merchant_customer_id='merchant_customer_id2' + ), + payment_tokens=[ + PaymentTokenResponse( + id='id4', + customer=CustomerResponse( + id='id0', + merchant_customer_id='merchant_customer_id2' + ), + payment_source=PaymentTokenResponsePaymentSource( + card=CardPaymentTokenEntity( + name='name6', + brand=CardBrand.CB_NATIONALE, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) + ), + apple_pay=ApplePayPaymentToken( + card=ApplePayCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ) + ) + ), + PaymentTokenResponse( + id='id4', + customer=CustomerResponse( + id='id0', + merchant_customer_id='merchant_customer_id2' + ), + payment_source=PaymentTokenResponsePaymentSource( + card=CardPaymentTokenEntity( + name='name6', + brand=CardBrand.CB_NATIONALE, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) + ), + apple_pay=ApplePayPaymentToken( + card=ApplePayCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ) + ) + ) ] - }, - "payment_tokens": [ - { - "id": "id4", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "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" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] - }, - { - "id": "id4", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "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" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +) ``` diff --git a/doc/models/customer.md b/doc/models/customer.md index 1e7a6e1..56b9923 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -14,12 +14,14 @@ This object defines a customer in your system. Use it to manage customer profile | `id` | `str` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `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) +## Example -```json -{ - "id": "id8", - "merchant_customer_id": "merchant_customer_id0" -} +```python +from paypalserversdk.models.customer import Customer + +customer = Customer( + id='id0', + merchant_customer_id='merchant_customer_id2' +) ``` diff --git a/doc/models/cvv-code.md b/doc/models/cvv-code.md index 1eff57c..1ebe2a6 100644 --- a/doc/models/cvv-code.md +++ b/doc/models/cvv-code.md @@ -26,3 +26,11 @@ The card verification value code for for Visa, Discover, Mastercard, or American | `CVV_3` | For Maestro, the merchant has indicated that CVV2 is not present on card. | | `CVV_4` | For Maestro, the service is not available. | +## Example + +```python +from paypalserversdk.models.cvv_code import CvvCode + +cvv_code = CvvCode.ENUM_ALL_OTHERS +``` + diff --git a/doc/models/cycle-execution.md b/doc/models/cycle-execution.md index 24f921f..2bfc67a 100644 --- a/doc/models/cycle-execution.md +++ b/doc/models/cycle-execution.md @@ -18,16 +18,16 @@ The regular and trial execution details for a billing cycle. | `current_pricing_scheme_version` | `int` | Optional, Read-only | The active pricing scheme version for the billing cycle.

**Constraints**: `>= 1`, `<= 99` | | `total_cycles` | `int` | Optional, Read-only | 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 -} +## Example + +```python +from paypalserversdk.models.cycle_execution import CycleExecution +from paypalserversdk.models.tenure_type import TenureType + +cycle_execution = CycleExecution( + tenure_type=envrr, + sequence=99, + cycles_completed=None +) ``` diff --git a/doc/models/cycle-frequency.md b/doc/models/cycle-frequency.md new file mode 100644 index 0000000..fd5c5ad --- /dev/null +++ b/doc/models/cycle-frequency.md @@ -0,0 +1,28 @@ + +# Cycle Frequency + +The frequency of the terms reset cycle. + +## Structure + +`CycleFrequency` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `interval_unit` | [`FrequencyIntervalUnit`](../../doc/models/frequency-interval-unit.md) | Required | The interval unit at which the the usage limits will be reset.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `interval_count` | `int` | Optional | The interval count at which the terms will be reset, this is ignored if the unit is LIFETIME.

**Default**: `1`

**Constraints**: `>= 1`, `<= 365` | + +## Example + +```python +from paypalserversdk.models.cycle_frequency import CycleFrequency +from paypalserversdk.models.frequency_interval_unit import FrequencyIntervalUnit + +cycle_frequency = CycleFrequency( + interval_unit=FrequencyIntervalUnit.MONTH, + interval_count=1 +) +``` + diff --git a/doc/models/default-error-exception.md b/doc/models/default-error-exception.md index 25d4e98..0c608a0 100644 --- a/doc/models/default-error-exception.md +++ b/doc/models/default-error-exception.md @@ -18,30 +18,14 @@ The error details. | `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, Read-only | 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" - } - ] -} +## Example + +```python +try: + # make the API call +except DefaultErrorException as e: + print(e) +except ApiException as e: + print(e) ``` diff --git a/doc/models/disbursement-mode.md b/doc/models/disbursement-mode.md index 3334301..46e8f32 100644 --- a/doc/models/disbursement-mode.md +++ b/doc/models/disbursement-mode.md @@ -14,3 +14,11 @@ The funds that are held on behalf of the merchant. | `INSTANT` | The funds are released to the merchant immediately. | | `DELAYED` | The funds are held for a finite number of days. The actual duration depends on the region and type of integration. You can release the funds through a referenced payout. Otherwise, the funds disbursed automatically after the specified duration. | +## Example + +```python +from paypalserversdk.models.disbursement_mode import DisbursementMode + +disbursement_mode = DisbursementMode.INSTANT +``` + diff --git a/doc/models/dispute-category.md b/doc/models/dispute-category.md index e718cb0..1c76dae 100644 --- a/doc/models/dispute-category.md +++ b/doc/models/dispute-category.md @@ -14,3 +14,11 @@ The condition that is covered for the transaction. | `ITEM_NOT_RECEIVED` | The payer paid for an item that they did not receive. | | `UNAUTHORIZED_TRANSACTION` | The payer did not authorize the payment. | +## Example + +```python +from paypalserversdk.models.dispute_category import DisputeCategory + +dispute_category = DisputeCategory.ITEM_NOT_RECEIVED +``` + diff --git a/doc/models/eci-flag.md b/doc/models/eci-flag.md index acfe45a..d8748f1 100644 --- a/doc/models/eci-flag.md +++ b/doc/models/eci-flag.md @@ -18,3 +18,11 @@ Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data element | `ATTEMPTED_AUTHENTICATION_TRANSACTION` | VISA, AMEX, JCB, DINERS CLUB attempted authentication transaction. | | `NON_3D_SECURE_TRANSACTION` | VISA, AMEX, JCB, DINERS CLUB non-3-D Secure transaction. | +## Example + +```python +from paypalserversdk.models.eci_flag import EciFlag + +eci_flag = EciFlag.ATTEMPTED_AUTHENTICATION_TRANSACTION +``` + diff --git a/doc/models/enrollment-status.md b/doc/models/enrollment-status.md index d85271d..3fbffdc 100644 --- a/doc/models/enrollment-status.md +++ b/doc/models/enrollment-status.md @@ -16,3 +16,11 @@ Status of Authentication eligibility. | `UNAVAILABLE` | Unavailable. The DS or ACS is not available for authentication at the time of the request. | | `BYPASS` | Bypass. The merchant authentication rule is triggered to bypass authentication. | +## Example + +```python +from paypalserversdk.models.enrollment_status import EnrollmentStatus + +enrollment_status = EnrollmentStatus.ENROLLED +``` + diff --git a/doc/models/eps-payment-object.md b/doc/models/eps-payment-object.md index 617a6ff..db22290 100644 --- a/doc/models/eps-payment-object.md +++ b/doc/models/eps-payment-object.md @@ -15,13 +15,15 @@ Information used to pay using eps. | `country_code` | `str` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code6", - "bic": "bic8" -} +## Example + +```python +from paypalserversdk.models.eps_payment_object import EpsPaymentObject + +eps_payment_object = EpsPaymentObject( + name='name0', + country_code='country_code0', + bic='bic2' +) ``` diff --git a/doc/models/eps-payment-request.md b/doc/models/eps-payment-request.md index 3eff9de..f1b5c63 100644 --- a/doc/models/eps-payment-request.md +++ b/doc/models/eps-payment-request.md @@ -15,19 +15,23 @@ Information needed to pay using eps. | `country_code` | `str` | Required | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code2", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.eps_payment_request import EpsPaymentRequest +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference + +eps_payment_request = EpsPaymentRequest( + name='name6', + country_code='country_code6', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/error-details.md b/doc/models/error-details.md index 711306f..74b8929 100644 --- a/doc/models/error-details.md +++ b/doc/models/error-details.md @@ -18,27 +18,17 @@ The error details. Required for client-side `4XX` errors. | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/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` | | `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": "issue8", - "field": "field0", - "value": "value8", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description4" -} +## Example + +```python +from paypalserversdk.models.error_details import ErrorDetails + +error_details = ErrorDetails( + issue='issue0', + field='field8', + value='value6', + location='body', + description='description4' +) ``` diff --git a/doc/models/error-exception.md b/doc/models/error-exception.md index cb0e514..0acf23c 100644 --- a/doc/models/error-exception.md +++ b/doc/models/error-exception.md @@ -17,65 +17,14 @@ The error details. | `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, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas-links). | -## Example (as JSON) - -```json -{ - "name": "name4", - "message": "message4", - "debug_id": "debug_id0", - "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" - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```python +try: + # make the API call +except ErrorException as e: + print(e) +except ApiException as e: + print(e) ``` diff --git a/doc/models/exchange-rate.md b/doc/models/exchange-rate.md index 403d134..de75479 100644 --- a/doc/models/exchange-rate.md +++ b/doc/models/exchange-rate.md @@ -15,13 +15,15 @@ The exchange rate that determines the amount to convert from one currency to ano | `target_currency` | `str` | Optional | The [three-character ISO-4217 currency code](https://developer.paypal.com/api/rest/reference/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | | `value` | `str` | Optional | The target currency amount. Equivalent to one unit of the source currency. Formatted as integer or decimal value with one to 15 digits to the right of the decimal point. | -## Example (as JSON) - -```json -{ - "source_currency": "source_currency0", - "target_currency": "target_currency2", - "value": "value2" -} +## Example + +```python +from paypalserversdk.models.exchange_rate import ExchangeRate + +exchange_rate = ExchangeRate( + source_currency='source_currency4', + target_currency='target_currency6', + value='value6' +) ``` diff --git a/doc/models/experience-context-shipping-preference.md b/doc/models/experience-context-shipping-preference.md index 7faad7c..3d74974 100644 --- a/doc/models/experience-context-shipping-preference.md +++ b/doc/models/experience-context-shipping-preference.md @@ -15,3 +15,11 @@ The location from which the shipping address is derived., The shipping preferenc | `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. | +## Example + +```python +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference + +experience_context_shipping_preference = ExperienceContextShippingPreference.NO_SHIPPING +``` + diff --git a/doc/models/experience-context.md b/doc/models/experience-context.md index 2245525..bce82b5 100644 --- a/doc/models/experience-context.md +++ b/doc/models/experience-context.md @@ -17,15 +17,18 @@ Customizes the payer experience during the approval process for the payment. | `return_url` | `str` | Optional | Describes the URL. | | `cancel_url` | `str` | Optional | Describes the URL. | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "brand_name": "brand_name0", - "locale": "locale4", - "return_url": "return_url2", - "cancel_url": "cancel_url4" -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference + +experience_context = ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.GET_FROM_FILE, + return_url='return_url4', + cancel_url='cancel_url6' +) ``` diff --git a/doc/models/experience-status.md b/doc/models/experience-status.md index 65f589a..ee2f512 100644 --- a/doc/models/experience-status.md +++ b/doc/models/experience-status.md @@ -16,3 +16,11 @@ This field indicates the status of PayPal's Checkout experience throughout the o | `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. | +## Example + +```python +from paypalserversdk.models.experience_status import ExperienceStatus + +experience_status = ExperienceStatus.CANCELED +``` + diff --git a/doc/models/failed-payment-details.md b/doc/models/failed-payment-details.md index 83b98b1..3982b6a 100644 --- a/doc/models/failed-payment-details.md +++ b/doc/models/failed-payment-details.md @@ -16,17 +16,19 @@ The details for the failed payment of the subscription. | `reason_code` | [`ReasonCode`](../../doc/models/reason-code.md) | Optional, Read-only | 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" -} +## Example + +```python +from paypalserversdk.models.failed_payment_details import FailedPaymentDetails +from paypalserversdk.models.money import Money + +failed_payment_details = FailedPaymentDetails( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + time='time2', + next_payment_retry_time='next_payment_retry_time2' +) ``` diff --git a/doc/models/frequency-interval-unit.md b/doc/models/frequency-interval-unit.md new file mode 100644 index 0000000..7d22372 --- /dev/null +++ b/doc/models/frequency-interval-unit.md @@ -0,0 +1,27 @@ + +# Frequency Interval Unit + +The interval unit at which the the usage limits will be reset. + +## Enumeration + +`FrequencyIntervalUnit` + +## Fields + +| Name | Description | +| --- | --- | +| `DAY` | A daily cycle. | +| `WEEK` | A weekly cycle. | +| `MONTH` | A monthly cycle. | +| `YEAR` | A yearly cycle. | +| `LIFETIME` | The lifetime of the BA translates to 1 cycle | + +## Example + +```python +from paypalserversdk.models.frequency_interval_unit import FrequencyIntervalUnit + +frequency_interval_unit = FrequencyIntervalUnit.WEEK +``` + diff --git a/doc/models/frequency.md b/doc/models/frequency.md index f5c3a80..a8858fd 100644 --- a/doc/models/frequency.md +++ b/doc/models/frequency.md @@ -14,12 +14,15 @@ The frequency of the billing cycle. | `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) +## Example -```json -{ - "interval_unit": "DAY", - "interval_count": 1 -} +```python +from paypalserversdk.models.frequency import Frequency +from paypalserversdk.models.interval_unit import IntervalUnit + +frequency = Frequency( + interval_unit=IntervalUnit.DAY, + interval_count=1 +) ``` diff --git a/doc/models/fulfillment-type.md b/doc/models/fulfillment-type.md index b4430b7..a63ef5e 100644 --- a/doc/models/fulfillment-type.md +++ b/doc/models/fulfillment-type.md @@ -16,3 +16,11 @@ A classification for the method of purchase fulfillment (e.g shipping, in-store | `PICKUP_IN_STORE` | The payer intends to pick up the item(s) from the payee's physical store. Also termed as BOPIS, "Buy Online, Pick-up in Store". Seller protection is provided with this option. | | `PICKUP_FROM_PERSON` | The payer intends to pick up the item(s) from the payee in person. Also termed as BOPIP, "Buy Online, Pick-up in Person". Seller protection is not available, since the payer is receiving the item from the payee in person, and can validate the item prior to payment. | +## Example + +```python +from paypalserversdk.models.fulfillment_type import FulfillmentType + +fulfillment_type = FulfillmentType.SHIPPING +``` + diff --git a/doc/models/giropay-payment-object.md b/doc/models/giropay-payment-object.md index 07e59e7..30ca786 100644 --- a/doc/models/giropay-payment-object.md +++ b/doc/models/giropay-payment-object.md @@ -15,13 +15,15 @@ Information needed to pay using giropay. | `country_code` | `str` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code6", - "bic": "bic8" -} +## Example + +```python +from paypalserversdk.models.giropay_payment_object import GiropayPaymentObject + +giropay_payment_object = GiropayPaymentObject( + name='name8', + country_code='country_code8', + bic='bic0' +) ``` diff --git a/doc/models/giropay-payment-request.md b/doc/models/giropay-payment-request.md index 8de839a..3ecf0da 100644 --- a/doc/models/giropay-payment-request.md +++ b/doc/models/giropay-payment-request.md @@ -15,19 +15,23 @@ Information needed to pay using giropay. | `country_code` | `str` | Required | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.giropay_payment_request import GiropayPaymentRequest + +giropay_payment_request = GiropayPaymentRequest( + name='name0', + country_code='country_code0', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/google-pay-authentication-method.md b/doc/models/google-pay-authentication-method.md index afdf2e5..c68c3d1 100644 --- a/doc/models/google-pay-authentication-method.md +++ b/doc/models/google-pay-authentication-method.md @@ -14,3 +14,11 @@ Authentication Method which is used for the card transaction. | `PAN_ONLY` | This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes primary account number (PAN) with the expiration month and the expiration year. | | `CRYPTOGRAM_3DS` | Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device. -> If authentication_method=CRYPTOGRAM, it is required that 'cryptogram' parameter in the request has a valid 3-D Secure (3DS) cryptogram generated on the device. | +## Example + +```python +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod + +google_pay_authentication_method = GooglePayAuthenticationMethod.PAN_ONLY +``` + diff --git a/doc/models/google-pay-card-response.md b/doc/models/google-pay-card-response.md index 0b3878a..4094649 100644 --- a/doc/models/google-pay-card-response.md +++ b/doc/models/google-pay-card-response.md @@ -18,22 +18,26 @@ The payment card to use to fund a Google Pay payment response. Can be a credit o | `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). | | `authentication_result` | [`AuthenticationResponse`](../../doc/models/authentication-response.md) | Optional | Results of Authentication such as 3D Secure. | -## Example (as JSON) - -```json -{ - "name": "name4", - "last_digits": "last_digits8", - "type": "DEBIT", - "brand": "ACCEL", - "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" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_card_response import GooglePayCardResponse + +google_pay_card_response = GooglePayCardResponse( + name='name0', + mtype=CardType.CREDIT, + brand=CardBrand.CETELEM, + billing_address=Address( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/google-pay-card.md b/doc/models/google-pay-card.md index ff36697..a82b087 100644 --- a/doc/models/google-pay-card.md +++ b/doc/models/google-pay-card.md @@ -19,15 +19,17 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car | `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 -{ - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "last_digits": "last_digits8", - "type": "DEBIT" -} +## Example + +```python +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_card import GooglePayCard + +google_pay_card = GooglePayCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.DEBIT +) ``` diff --git a/doc/models/google-pay-decrypted-token-data.md b/doc/models/google-pay-decrypted-token-data.md index 2119208..f64f98b 100644 --- a/doc/models/google-pay-decrypted-token-data.md +++ b/doc/models/google-pay-decrypted-token-data.md @@ -19,23 +19,28 @@ Details shared by Google for the merchant to be shared with PayPal. This is requ | `cryptogram` | `str` | Optional | Base-64 cryptographic identifier used by card schemes to validate the token verification result. This is a conditionally required field if authentication_method is CRYPTOGRAM_3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | | `eci_indicator` | `str` | Optional | Electronic Commerce Indicator may not always be present. It is only returned for tokens on the Visa card network. This value is passed through in the payment authorization request.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "message_id": "message_id4", - "message_expiration": "message_expiration8", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram0", - "eci_indicator": "eci_indicator4" -} +## Example + +```python +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod +from paypalserversdk.models.google_pay_card import GooglePayCard +from paypalserversdk.models.google_pay_decrypted_token_data import GooglePayDecryptedTokenData +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod + +google_pay_decrypted_token_data = GooglePayDecryptedTokenData( + payment_method=GooglePayPaymentMethod.CARD, + card=GooglePayCard( + name='name6', + number='number6', + expiry='expiry4', + mtype=CardType.UNKNOWN + ), + authentication_method=GooglePayAuthenticationMethod.PAN_ONLY, + message_id='message_id2', + message_expiration='message_expiration0', + cryptogram='cryptogram8', + eci_indicator='eci_indicator2' +) ``` diff --git a/doc/models/google-pay-experience-context.md b/doc/models/google-pay-experience-context.md index f3bfabc..4200704 100644 --- a/doc/models/google-pay-experience-context.md +++ b/doc/models/google-pay-experience-context.md @@ -14,12 +14,14 @@ Customizes the payer experience during the approval process for the payment. | `return_url` | `str` | Required | Describes the URL. | | `cancel_url` | `str` | Required | Describes the URL. | -## Example (as JSON) +## Example -```json -{ - "return_url": "return_url6", - "cancel_url": "cancel_url8" -} +```python +from paypalserversdk.models.google_pay_experience_context import GooglePayExperienceContext + +google_pay_experience_context = GooglePayExperienceContext( + return_url='return_url0', + cancel_url='cancel_url2' +) ``` diff --git a/doc/models/google-pay-payment-method.md b/doc/models/google-pay-payment-method.md index 435e7ee..6911fcc 100644 --- a/doc/models/google-pay-payment-method.md +++ b/doc/models/google-pay-payment-method.md @@ -13,3 +13,11 @@ The type of the payment credential. Currently, only CARD is supported. | --- | --- | | `CARD` | CARD is the only value that Google Pay accepts. | +## Example + +```python +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod + +google_pay_payment_method = GooglePayPaymentMethod.CARD +``` + diff --git a/doc/models/google-pay-request-card.md b/doc/models/google-pay-request-card.md index 937d4d5..6ab8a57 100644 --- a/doc/models/google-pay-request-card.md +++ b/doc/models/google-pay-request-card.md @@ -16,21 +16,26 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car | `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 -{ - "name": "name8", - "type": "STORE", - "brand": "CONFIDIS", - "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" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_request_card import GooglePayRequestCard + +google_pay_request_card = GooglePayRequestCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.VISA, + billing_address=Address( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md index b239433..70d7ae6 100644 --- a/doc/models/google-pay-request.md +++ b/doc/models/google-pay-request.md @@ -19,44 +19,54 @@ Information needed to pay using Google Pay. | `assurance_details` | [`AssuranceDetails`](../../doc/models/assurance-details.md) | Optional | Information about cardholder possession validation and cardholder identification and verifications (ID&V). | | `experience_context` | [`GooglePayExperienceContext`](../../doc/models/google-pay-experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name4", - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "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" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod +from paypalserversdk.models.google_pay_card import GooglePayCard +from paypalserversdk.models.google_pay_decrypted_token_data import GooglePayDecryptedTokenData +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod +from paypalserversdk.models.google_pay_request import GooglePayRequest +from paypalserversdk.models.google_pay_request_card import GooglePayRequestCard +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode + +google_pay_request = GooglePayRequest( + name='name6', + email_address='email_address4', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayRequestCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + decrypted_token=GooglePayDecryptedTokenData( + payment_method=GooglePayPaymentMethod.CARD, + card=GooglePayCard( + name='name6', + number='number6', + expiry='expiry4', + mtype=CardType.UNKNOWN + ), + authentication_method=GooglePayAuthenticationMethod.PAN_ONLY, + message_id='message_id0', + message_expiration='message_expiration2', + cryptogram='cryptogram6', + eci_indicator='eci_indicator0' + ) +) ``` diff --git a/doc/models/google-pay-wallet-response.md b/doc/models/google-pay-wallet-response.md index 631f521..d6274a3 100644 --- a/doc/models/google-pay-wallet-response.md +++ b/doc/models/google-pay-wallet-response.md @@ -16,30 +16,36 @@ Google Pay Wallet payment data. | `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). | | `card` | [`GooglePayCardResponse`](../../doc/models/google-pay-card-response.md) | Optional | The payment card to use to fund a Google Pay payment response. Can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "name": "name0", - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_card_response import GooglePayCardResponse +from paypalserversdk.models.google_pay_wallet_response import GooglePayWalletResponse +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode + +google_pay_wallet_response = GooglePayWalletResponse( + name='name6', + email_address='email_address4', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayCardResponse( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) +) ``` diff --git a/doc/models/ideal-payment-object.md b/doc/models/ideal-payment-object.md index 5e451da..83ffdaf 100644 --- a/doc/models/ideal-payment-object.md +++ b/doc/models/ideal-payment-object.md @@ -16,14 +16,16 @@ Information used to pay using iDEAL. | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | | `iban_last_chars` | `str` | Optional | The last characters of the IBAN used to pay.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `34`, *Pattern*: `[a-zA-Z0-9]{4}` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code4", - "bic": "bic8", - "iban_last_chars": "iban_last_chars4" -} +## Example + +```python +from paypalserversdk.models.ideal_payment_object import IdealPaymentObject + +ideal_payment_object = IdealPaymentObject( + name='name2', + country_code='country_code2', + bic='bic4', + iban_last_chars='iban_last_chars0' +) ``` diff --git a/doc/models/ideal-payment-request.md b/doc/models/ideal-payment-request.md index 37fefd0..ae2e943 100644 --- a/doc/models/ideal-payment-request.md +++ b/doc/models/ideal-payment-request.md @@ -16,20 +16,24 @@ Information needed to pay using iDEAL. | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code4", - "bic": "bic8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.ideal_payment_request import IdealPaymentRequest + +ideal_payment_request = IdealPaymentRequest( + name='name0', + country_code='country_code0', + bic='bic2', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/incentive-details.md b/doc/models/incentive-details.md index d7179a7..6bc2354 100644 --- a/doc/models/incentive-details.md +++ b/doc/models/incentive-details.md @@ -16,17 +16,20 @@ The incentive details. | `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" -} +## Example + +```python +from paypalserversdk.models.incentive_details import IncentiveDetails +from paypalserversdk.models.money import Money + +incentive_details = IncentiveDetails( + incentive_type='incentive_type4', + incentive_code='incentive_code0', + incentive_amount=Money( + 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 index 507a04b..69b8d8d 100644 --- a/doc/models/incentive-information.md +++ b/doc/models/incentive-information.md @@ -13,39 +13,43 @@ The incentive details. | --- | --- | --- | --- | | `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" - } - ] -} +## Example + +```python +from paypalserversdk.models.incentive_details import IncentiveDetails +from paypalserversdk.models.incentive_information import IncentiveInformation +from paypalserversdk.models.money import Money + +incentive_information = IncentiveInformation( + incentive_details=[ + IncentiveDetails( + incentive_type='incentive_type4', + incentive_code='incentive_code0', + incentive_amount=Money( + currency_code='currency_code4', + value='value0' + ), + incentive_program_code='incentive_program_code4' + ), + IncentiveDetails( + incentive_type='incentive_type4', + incentive_code='incentive_code0', + incentive_amount=Money( + currency_code='currency_code4', + value='value0' + ), + incentive_program_code='incentive_program_code4' + ), + IncentiveDetails( + incentive_type='incentive_type4', + incentive_code='incentive_code0', + incentive_amount=Money( + 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 index df7ce04..5fe3c8a 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -16,3 +16,11 @@ The interval at which the subscription is charged or billed. | `MONTH` | A monthly billing cycle. | | `YEAR` | A yearly billing cycle. | +## Example + +```python +from paypalserversdk.models.interval_unit import IntervalUnit + +interval_unit = IntervalUnit.DAY +``` + diff --git a/doc/models/item-category.md b/doc/models/item-category.md index abe258c..703e731 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -15,3 +15,11 @@ The item category type. | `PHYSICAL_GOODS` | A tangible item that can be shipped with proof of delivery. | | `DONATION` | A contribution or gift for which no good or service is exchanged, usually to a not for profit organization. | +## Example + +```python +from paypalserversdk.models.item_category import ItemCategory + +item_category = ItemCategory.PHYSICAL_GOODS +``` + diff --git a/doc/models/item-details.md b/doc/models/item-details.md index 9a4b34b..92b863d 100644 --- a/doc/models/item-details.md +++ b/doc/models/item-details.md @@ -31,15 +31,17 @@ The item details. | `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" -} +## Example + +```python +from paypalserversdk.models.item_details import ItemDetails + +item_details = ItemDetails( + item_code='item_code0', + item_name='item_name8', + item_description='item_description4', + item_options='item_options2', + item_quantity='item_quantity2' +) ``` diff --git a/doc/models/item-request.md b/doc/models/item-request.md index e5a3ab5..8a0d6f8 100644 --- a/doc/models/item-request.md +++ b/doc/models/item-request.md @@ -23,24 +23,28 @@ The details for the items to be purchased. | `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" -} +## Example + +```python +from paypalserversdk.models.item_category import ItemCategory +from paypalserversdk.models.item_request import ItemRequest +from paypalserversdk.models.money import Money + +item_request = ItemRequest( + name='name6', + unit_amount=Money( + currency_code='currency_code2', + value='value8' + ), + quantity='quantity2', + tax=Money( + currency_code='currency_code0', + value='value6' + ), + description='description6', + sku='sku2', + url='url0', + category=ItemCategory.PHYSICAL_GOODS +) ``` diff --git a/doc/models/item.md b/doc/models/item.md index 6a6fbbf..f0c9203 100644 --- a/doc/models/item.md +++ b/doc/models/item.md @@ -23,24 +23,28 @@ The details for the items to be purchased. | `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": "name2", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity8", - "description": "description2", - "sku": "sku8", - "url": "url6", - "category": "DIGITAL_GOODS" -} +## Example + +```python +from paypalserversdk.models.item import Item +from paypalserversdk.models.item_category import ItemCategory +from paypalserversdk.models.money import Money + +item = Item( + name='name2', + unit_amount=Money( + currency_code='currency_code2', + value='value8' + ), + quantity='quantity8', + tax=Money( + currency_code='currency_code0', + value='value6' + ), + description='description2', + sku='sku8', + url='url6', + category=ItemCategory.DONATION +) ``` diff --git a/doc/models/last-payment-details.md b/doc/models/last-payment-details.md index 9dcb39d..5012abe 100644 --- a/doc/models/last-payment-details.md +++ b/doc/models/last-payment-details.md @@ -12,15 +12,18 @@ | `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" -} +## Example + +```python +from paypalserversdk.models.last_payment_details import LastPaymentDetails +from paypalserversdk.models.money import Money + +last_payment_details = LastPaymentDetails( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + time='time6' +) ``` diff --git a/doc/models/level-2-card-processing-data.md b/doc/models/level-2-card-processing-data.md index d1f4ab8..2099810 100644 --- a/doc/models/level-2-card-processing-data.md +++ b/doc/models/level-2-card-processing-data.md @@ -14,15 +14,18 @@ The level 2 card processing data collections. If your merchant account has been | `invoice_id` | `str` | Optional | Use this field to pass a purchase identification value of up to 127 ASCII characters. The length of this field will be adjusted to meet network specifications (25chars for Visa and Mastercard, 17chars for Amex), and the original invoice ID will still be displayed in your existing reports.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\w‘\-.,":;\!?]*$` | | `tax_total` | [`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 -{ - "invoice_id": "invoice_id8", - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - } -} +## Example + +```python +from paypalserversdk.models.level_2_card_processing_data import Level2CardProcessingData +from paypalserversdk.models.money import Money + +level_2_card_processing_data = Level2CardProcessingData( + invoice_id='invoice_id2', + tax_total=Money( + currency_code='currency_code4', + value='value0' + ) +) ``` diff --git a/doc/models/level-3-card-processing-data.md b/doc/models/level-3-card-processing-data.md index 1dd6a51..c71d61f 100644 --- a/doc/models/level-3-card-processing-data.md +++ b/doc/models/level-3-card-processing-data.md @@ -18,31 +18,35 @@ The level 3 card processing data collections, If your merchant account has been | `ships_from_postal_code` | `str` | Optional | Use this field to specify the postal code of the shipping location.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9_'.-]*$` | | `line_items` | [`List[LineItem]`](../../doc/models/line-item.md) | Optional | A list of the items that were purchased with this payment. If your merchant account has been configured for Level 3 processing this field will be passed to the processor on your behalf.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `100` | -## Example (as JSON) - -```json -{ - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "duty_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "discount_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "shipping_address": { - "address_line_1": "address_line_10", - "address_line_2": "address_line_20", - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "ships_from_postal_code": "ships_from_postal_code6" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.level_3_card_processing_data import Level3CardProcessingData +from paypalserversdk.models.money import Money + +level_3_card_processing_data = Level3CardProcessingData( + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + duty_amount=Money( + currency_code='currency_code6', + value='value2' + ), + discount_amount=Money( + currency_code='currency_code2', + value='value8' + ), + shipping_address=Address( + country_code='country_code0', + address_line_1='address_line_10', + address_line_2='address_line_20', + admin_area_2='admin_area_24', + admin_area_1='admin_area_16', + postal_code='postal_code2' + ), + ships_from_postal_code='ships_from_postal_code6' +) ``` diff --git a/doc/models/liability-shift-indicator.md b/doc/models/liability-shift-indicator.md index 059e3d5..493a8d3 100644 --- a/doc/models/liability-shift-indicator.md +++ b/doc/models/liability-shift-indicator.md @@ -15,3 +15,11 @@ Liability shift indicator. The outcome of the issuer's authentication. | `POSSIBLE` | Liability may shift to the card issuer. | | `UNKNOWN` | The authentication system is not available. | +## Example + +```python +from paypalserversdk.models.liability_shift_indicator import LiabilityShiftIndicator + +liability_shift_indicator = LiabilityShiftIndicator.POSSIBLE +``` + diff --git a/doc/models/line-item.md b/doc/models/line-item.md index 6a397c3..a0213b4 100644 --- a/doc/models/line-item.md +++ b/doc/models/line-item.md @@ -26,20 +26,24 @@ The line items for this purchase. If your merchant account has been configured f | `total_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `unit_of_measure` | `str` | Optional | Unit of measure is a standard used to express the magnitude of a quantity in international trade. Most commonly used (but not limited to) examples are: Acre (ACR), Ampere (AMP), Centigram (CGM), Centimetre (CMT), Cubic inch (INQ), Cubic metre (MTQ), Fluid ounce (OZA), Foot (FOT), Hour (HUR), Item (ITM), Kilogram (KGM), Kilometre (KMT), Kilowatt (KWT), Liquid gallon (GLL), Liter (LTR), Pounds (LBS), Square foot (FTK).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12`, *Pattern*: `^[a-zA-Z0-9_'.-]*$` | -## Example (as JSON) - -```json -{ - "name": "name8", - "quantity": "quantity4", - "description": "description8", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4", - "upc": { - "type": "UPC-B", - "code": "code0" - } -} +## Example + +```python +from paypalserversdk.models.line_item import LineItem +from paypalserversdk.models.universal_product_code import UniversalProductCode +from paypalserversdk.models.upc_type import UpcType + +line_item = LineItem( + name='name6', + quantity='quantity2', + description='description6', + sku='sku2', + url='url0', + image_url='image_url2', + upc=UniversalProductCode( + mtype=UpcType.UPC_B, + code='code0' + ) +) ``` diff --git a/doc/models/link-description.md b/doc/models/link-description.md index 618a515..dbbc67e 100644 --- a/doc/models/link-description.md +++ b/doc/models/link-description.md @@ -15,13 +15,16 @@ The request-related [HATEOAS link](https://developer.paypal.com/api/rest/respons | `rel` | `str` | Required | The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml). | | `method` | [`LinkHttpMethod`](../../doc/models/link-http-method.md) | Optional | The HTTP method required to make the related call. | -## Example (as JSON) - -```json -{ - "href": "href2", - "rel": "rel6", - "method": "PUT" -} +## Example + +```python +from paypalserversdk.models.link_description import LinkDescription +from paypalserversdk.models.link_http_method import LinkHttpMethod + +link_description = LinkDescription( + href='href4', + rel='rel8', + method=LinkHttpMethod.HEAD +) ``` diff --git a/doc/models/link-http-method.md b/doc/models/link-http-method.md index 4e22f23..e7574d0 100644 --- a/doc/models/link-http-method.md +++ b/doc/models/link-http-method.md @@ -20,3 +20,11 @@ The HTTP method required to make the related call. | `OPTIONS` | The HTTP OPTIONS method. | | `PATCH` | The HTTP PATCH method. | +## Example + +```python +from paypalserversdk.models.link_http_method import LinkHttpMethod + +link_http_method = LinkHttpMethod.HEAD +``` + diff --git a/doc/models/merchant-preferences.md b/doc/models/merchant-preferences.md index c98536c..4632c3b 100644 --- a/doc/models/merchant-preferences.md +++ b/doc/models/merchant-preferences.md @@ -14,12 +14,14 @@ The merchant preferences for a subscription. | `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) +## Example -```json -{ - "return_url": "return_url8", - "cancel_url": "cancel_url0" -} +```python +from paypalserversdk.models.merchant_preferences import MerchantPreferences + +merchant_preferences = MerchantPreferences( + return_url='return_url4', + cancel_url='cancel_url6' +) ``` diff --git a/doc/models/mobile-return-flow.md b/doc/models/mobile-return-flow.md index 4236a9b..2d6ed7c 100644 --- a/doc/models/mobile-return-flow.md +++ b/doc/models/mobile-return-flow.md @@ -14,3 +14,11 @@ Merchant preference on how the buyer can navigate back to merchant website post | `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. | +## Example + +```python +from paypalserversdk.models.mobile_return_flow import MobileReturnFlow + +mobile_return_flow = MobileReturnFlow.AUTO +``` + diff --git a/doc/models/mobile-web-context.md b/doc/models/mobile-web-context.md index ee262fa..314b972 100644 --- a/doc/models/mobile-web-context.md +++ b/doc/models/mobile-web-context.md @@ -14,12 +14,15 @@ Buyer's mobile web browser context to app switch to the PayPal consumer app. | `return_flow` | [`MobileReturnFlow`](../../doc/models/mobile-return-flow.md) | Optional, Read-only | 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) +## Example -```json -{ - "return_flow": "AUTO", - "buyer_user_agent": "buyer_user_agent8" -} +```python +from paypalserversdk.models.mobile_return_flow import MobileReturnFlow +from paypalserversdk.models.mobile_web_context import MobileWebContext + +mobile_web_context = MobileWebContext( + return_flow=MobileReturnFlow.AUTO, + buyer_user_agent='buyer_user_agent4' +) ``` diff --git a/doc/models/modify-subscription-request.md b/doc/models/modify-subscription-request.md index 97bc9b4..0b109a9 100644 --- a/doc/models/modify-subscription-request.md +++ b/doc/models/modify-subscription-request.md @@ -18,49 +18,62 @@ The request to update the quantity of the product or service in a subscription. | `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) +## Example -```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" - } -} +```python +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.modify_subscription_request import ModifySubscriptionRequest +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference +from paypalserversdk.models.payment_method import PaymentMethod +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType +from paypalserversdk.models.subscription_patch_application_context import SubscriptionPatchApplicationContext + +modify_subscription_request = ModifySubscriptionRequest( + plan_id='plan_id8', + quantity='quantity2', + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + shipping_address=ShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address8', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.PICKUP_IN_STORE, + options=[ + ShippingOption( + id='id2', + label='label2', + selected=False, + mtype=ShippingType.SHIPPING, + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ), + application_context=SubscriptionPatchApplicationContext( + return_url='return_url0', + cancel_url='cancel_url2', + brand_name='brand_name8', + locale='locale2', + shipping_preference=ExperienceContextShippingPreference.SET_PROVIDED_ADDRESS, + payment_method=PaymentMethod( + payee_preferred=PayeePaymentMethodPreference.UNRESTRICTED + ) + ) +) ``` diff --git a/doc/models/modify-subscription-response.md b/doc/models/modify-subscription-response.md index efa284b..b6b162d 100644 --- a/doc/models/modify-subscription-response.md +++ b/doc/models/modify-subscription-response.md @@ -19,134 +19,149 @@ The response to a request to update the quantity of the product or service in a | `plan_overridden` | `bool` | Optional, Read-only | Indicates whether the subscription has overridden any plan attributes. | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -## Example (as JSON) +## Example -```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 - } - } -} +```python +from paypalserversdk.models.billing_cycle_override import BillingCycleOverride +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.modify_subscription_response import ModifySubscriptionResponse +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_preferences_override import PaymentPreferencesOverride +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.plan_override import PlanOverride +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.taxes_override import TaxesOverride + +modify_subscription_response = ModifySubscriptionResponse( + plan_id='plan_id8', + quantity='quantity2', + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + shipping_address=ShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address8', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.PICKUP_IN_STORE, + options=[ + ShippingOption( + id='id2', + label='label2', + selected=False, + mtype=ShippingType.SHIPPING, + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ), + plan=PlanOverride( + billing_cycles=[ + BillingCycleOverride( + sequence=8, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=198 + ), + BillingCycleOverride( + sequence=8, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=198 + ) + ], + payment_preferences=PaymentPreferencesOverride( + auto_bill_outstanding=False, + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + setup_fee_failure_action=SetupFeeFailureAction.CONTINUE, + payment_failure_threshold=104 + ), + taxes=TaxesOverride( + percentage='percentage8', + inclusive=False + ) + ) +) ``` diff --git a/doc/models/money.md b/doc/models/money.md index 5a69f67..e377a93 100644 --- a/doc/models/money.md +++ b/doc/models/money.md @@ -14,12 +14,14 @@ The currency and amount for a financial transaction, such as a balance or paymen | `currency_code` | `str` | Required | The [three-character ISO-4217 currency code](https://developer.paypal.com/api/rest/reference/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | | `value` | `str` | Required | The value, which might be: An integer for currencies like `JPY` that are not typically fractional. A decimal fraction for currencies like `TND` that are subdivided into thousandths. For the required number of decimal places for a currency code, see [Currency Codes](https://developer.paypal.com/api/rest/reference/currency-codes/).

**Constraints**: *Maximum Length*: `32`, *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | -## Example (as JSON) +## Example -```json -{ - "currency_code": "currency_code6", - "value": "value2" -} +```python +from paypalserversdk.models.money import Money + +money = Money( + currency_code='currency_code4', + value='value0' +) ``` diff --git a/doc/models/mybank-payment-object.md b/doc/models/mybank-payment-object.md index 398e329..913159e 100644 --- a/doc/models/mybank-payment-object.md +++ b/doc/models/mybank-payment-object.md @@ -16,14 +16,16 @@ Information used to pay using MyBank. | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | | `iban_last_chars` | `str` | Optional | The last characters of the IBAN used to pay.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `34`, *Pattern*: `[a-zA-Z0-9]{4}` | -## Example (as JSON) - -```json -{ - "name": "name4", - "country_code": "country_code4", - "bic": "bic6", - "iban_last_chars": "iban_last_chars2" -} +## Example + +```python +from paypalserversdk.models.mybank_payment_object import MybankPaymentObject + +mybank_payment_object = MybankPaymentObject( + name='name2', + country_code='country_code2', + bic='bic4', + iban_last_chars='iban_last_chars0' +) ``` diff --git a/doc/models/mybank-payment-request.md b/doc/models/mybank-payment-request.md index 889234c..1fac9c2 100644 --- a/doc/models/mybank-payment-request.md +++ b/doc/models/mybank-payment-request.md @@ -15,19 +15,23 @@ Information needed to pay using MyBank. | `country_code` | `str` | Required | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.mybank_payment_request import MybankPaymentRequest + +mybank_payment_request = MybankPaymentRequest( + name='name2', + country_code='country_code2', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/name.md b/doc/models/name.md index 8b35bc1..946db6e 100644 --- a/doc/models/name.md +++ b/doc/models/name.md @@ -14,12 +14,14 @@ The name of the party. | `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` | -## Example (as JSON) +## Example -```json -{ - "given_name": "given_name2", - "surname": "surname8" -} +```python +from paypalserversdk.models.name import Name + +name = Name( + given_name='given_name2', + surname='surname8' +) ``` diff --git a/doc/models/native-app-context.md b/doc/models/native-app-context.md index 6111b90..91f6127 100644 --- a/doc/models/native-app-context.md +++ b/doc/models/native-app-context.md @@ -14,12 +14,11 @@ Merchant provided, buyer's native app preferences to app switch to the PayPal co | `os_type` | [`OsType`](../../doc/models/os-type.md) | Optional, Read-only | 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, Read-only | Operating System version of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "os_type": "ANDROID", - "os_version": "os_version0" -} +```python +from paypalserversdk.models.native_app_context import NativeAppContext + +native_app_context = NativeAppContext() ``` diff --git a/doc/models/net-amount-breakdown-item.md b/doc/models/net-amount-breakdown-item.md index fcdd64a..45a3d42 100644 --- a/doc/models/net-amount-breakdown-item.md +++ b/doc/models/net-amount-breakdown-item.md @@ -15,23 +15,21 @@ The net amount. Returned when the currency of the refund is different from the c | `converted_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `exchange_rate` | [`ExchangeRate`](../../doc/models/exchange-rate.md) | Optional, Read-only | The exchange rate that determines the amount to convert from one currency to another currency. | -## Example (as JSON) - -```json -{ - "payable_amount": { - "currency_code": "currency_code8", - "value": "value4" - }, - "converted_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "exchange_rate": { - "source_currency": "source_currency4", - "target_currency": "target_currency6", - "value": "value6" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.net_amount_breakdown_item import NetAmountBreakdownItem + +net_amount_breakdown_item = NetAmountBreakdownItem( + payable_amount=Money( + currency_code='currency_code8', + value='value4' + ), + converted_amount=Money( + currency_code='currency_code0', + value='value6' + ) +) ``` diff --git a/doc/models/network-token.md b/doc/models/network-token.md index b40e785..ff7bffe 100644 --- a/doc/models/network-token.md +++ b/doc/models/network-token.md @@ -17,15 +17,18 @@ The Third Party Network token used to fund a payment. | `eci_flag` | [`EciFlag`](../../doc/models/eci-flag.md) | Optional | Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data elements that indicate the transaction was processed electronically. This should be passed on the authorization transaction to the Gateway/Processor.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `token_requestor_id` | `str` | Optional | A TRID, or a Token Requestor ID, is an identifier used by merchants to request network tokens from card networks. A TRID is a precursor to obtaining a network token for a credit card primary account number (PAN), and will aid in enabling secure card on file (COF) payments and reducing fraud.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `11`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) - -```json -{ - "number": "number0", - "expiry": "expiry0", - "cryptogram": "cryptogram2", - "eci_flag": "ATTEMPTED_AUTHENTICATION_TRANSACTION", - "token_requestor_id": "token_requestor_id8" -} +## Example + +```python +from paypalserversdk.models.eci_flag import EciFlag +from paypalserversdk.models.network_token import NetworkToken + +network_token = NetworkToken( + number='number0', + expiry='expiry0', + cryptogram='cryptogram2', + eci_flag=EciFlag.MASTERCARD_NON_3D_SECURE_TRANSACTION, + token_requestor_id='token_requestor_id8' +) ``` diff --git a/doc/models/network-transaction-reference-entity.md b/doc/models/network-transaction-reference-entity.md index 41d51b9..a58dfbe 100644 --- a/doc/models/network-transaction-reference-entity.md +++ b/doc/models/network-transaction-reference-entity.md @@ -16,14 +16,17 @@ Previous network transaction reference including id and network. | `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})$` | -## Example (as JSON) - -```json -{ - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "time": "time6" -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.network_transaction_reference_entity import NetworkTransactionReferenceEntity + +network_transaction_reference_entity = NetworkTransactionReferenceEntity( + id='id2', + date='date2', + network=CardBrand.HIPER, + time='time8' +) ``` diff --git a/doc/models/network-transaction.md b/doc/models/network-transaction.md index cf97852..9afcbb6 100644 --- a/doc/models/network-transaction.md +++ b/doc/models/network-transaction.md @@ -16,14 +16,17 @@ Reference values used by the card network to identify a transaction. | `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]+$` | -## Example (as JSON) - -```json -{ - "id": "id0", - "date": "date4", - "network": "CETELEM", - "acquirer_reference_number": "acquirer_reference_number8" -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.network_transaction import NetworkTransaction + +network_transaction = NetworkTransaction( + id='id6', + date='date2', + network=CardBrand.CONFIDIS, + acquirer_reference_number='acquirer_reference_number2' +) ``` diff --git a/doc/models/o-auth-provider-error.md b/doc/models/o-auth-provider-error.md index ab73f72..a28f402 100644 --- a/doc/models/o-auth-provider-error.md +++ b/doc/models/o-auth-provider-error.md @@ -18,3 +18,11 @@ OAuth 2 Authorization error codes | `UNSUPPORTED_GRANT_TYPE` | The authorization grant type is not supported by the authorization server. | | `INVALID_SCOPE` | The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner. | +## Example + +```python +from paypalserversdk.models.o_auth_provider_error import OAuthProviderError + +o_auth_provider_error = OAuthProviderError.INVALID_REQUEST +``` + diff --git a/doc/models/o-auth-provider-exception.md b/doc/models/o-auth-provider-exception.md index 9d5edbe..d8bcc11 100644 --- a/doc/models/o-auth-provider-exception.md +++ b/doc/models/o-auth-provider-exception.md @@ -15,13 +15,14 @@ OAuth 2 Authorization endpoint exception. | `error_description` | `str` | Optional | Gets or sets human-readable text providing additional information on error.
Used to assist the client developer in understanding the error that occurred. | | `error_uri` | `str` | Optional | Gets or sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. | -## Example (as JSON) - -```json -{ - "error": "unsupported_grant_type", - "error_description": "error_description8", - "error_uri": "error_uri8" -} +## Example + +```python +try: + # make the API call +except OAuthProviderException as e: + print(e) +except ApiException as e: + print(e) ``` diff --git a/doc/models/o-auth-token.md b/doc/models/o-auth-token.md index d9e9414..4166591 100644 --- a/doc/models/o-auth-token.md +++ b/doc/models/o-auth-token.md @@ -19,17 +19,19 @@ OAuth 2 Authorization endpoint response | `refresh_token` | `str` | Optional | Refresh token
Used to get a new access token when it expires. | | `id_token` | `str` | Optional | An ID token response type is of JSON Web Token (JWT) that contains claims about the identity of the authenticated user. | -## Example (as JSON) - -```json -{ - "access_token": "access_token4", - "token_type": "token_type6", - "expires_in": 74, - "scope": "scope6", - "expiry": 88, - "refresh_token": "refresh_token6", - "id_token": "id_token6" -} +## Example + +```python +from paypalserversdk.models.o_auth_token import OAuthToken + +o_auth_token = OAuthToken( + access_token='access_token4', + token_type='token_type4', + expires_in=80, + scope='scope4', + expiry=242, + refresh_token='refresh_token6', + id_token='id_token4' +) ``` diff --git a/doc/models/one-time-charge.md b/doc/models/one-time-charge.md index 8687f14..2b7cc71 100644 --- a/doc/models/one-time-charge.md +++ b/doc/models/one-time-charge.md @@ -18,34 +18,37 @@ The one-time charge info at the time of checkout. | `subtotal` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `total_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 -{ - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "taxes": { - "currency_code": "currency_code6", - "value": "value2" - }, - "product_price": { - "currency_code": "currency_code6", - "value": "value2" - }, - "subtotal": { - "currency_code": "currency_code2", - "value": "value8" - }, - "total_amount": { - "currency_code": "currency_code2", - "value": "value8" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.one_time_charge import OneTimeCharge + +one_time_charge = OneTimeCharge( + total_amount=Money( + currency_code='currency_code2', + value='value8' + ), + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + taxes=Money( + currency_code='currency_code6', + value='value2' + ), + product_price=Money( + currency_code='currency_code6', + value='value2' + ), + subtotal=Money( + currency_code='currency_code2', + value='value8' + ) +) ``` diff --git a/doc/models/order-application-context-landing-page.md b/doc/models/order-application-context-landing-page.md index 8b90ce5..3883878 100644 --- a/doc/models/order-application-context-landing-page.md +++ b/doc/models/order-application-context-landing-page.md @@ -15,3 +15,11 @@ DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for | `BILLING` | 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. | | `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. | +## Example + +```python +from paypalserversdk.models.order_application_context_landing_page import OrderApplicationContextLandingPage + +order_application_context_landing_page = OrderApplicationContextLandingPage.LOGIN +``` + diff --git a/doc/models/order-application-context-shipping-preference.md b/doc/models/order-application-context-shipping-preference.md index 407668d..f9ade35 100644 --- a/doc/models/order-application-context-shipping-preference.md +++ b/doc/models/order-application-context-shipping-preference.md @@ -15,3 +15,11 @@ DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address t | `NO_SHIPPING` | Redact the shipping address from the PayPal site. Recommended for digital goods. | | `SET_PROVIDED_ADDRESS` | Use the merchant-provided address. The customer cannot change this address on the PayPal site. | +## Example + +```python +from paypalserversdk.models.order_application_context_shipping_preference import OrderApplicationContextShippingPreference + +order_application_context_shipping_preference = OrderApplicationContextShippingPreference.GET_FROM_FILE +``` + diff --git a/doc/models/order-application-context-user-action.md b/doc/models/order-application-context-user-action.md index 79b8008..a0eb5b3 100644 --- a/doc/models/order-application-context-user-action.md +++ b/doc/models/order-application-context-user-action.md @@ -14,3 +14,11 @@ DEPRECATED. Configures a Continue or Pay Now checkout flow. The fields in `appl | `CONTINUE` | After you redirect the customer to the PayPal 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 PayPal 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. | +## Example + +```python +from paypalserversdk.models.order_application_context_user_action import OrderApplicationContextUserAction + +order_application_context_user_action = OrderApplicationContextUserAction.CONTINUE +``` + diff --git a/doc/models/order-application-context.md b/doc/models/order-application-context.md index 12b6c53..dbfdcc3 100644 --- a/doc/models/order-application-context.md +++ b/doc/models/order-application-context.md @@ -21,15 +21,20 @@ Customizes the payer experience during the approval process for the payment with | `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 | 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) - -```json -{ - "landing_page": "NO_PREFERENCE", - "shipping_preference": "GET_FROM_FILE", - "user_action": "CONTINUE", - "brand_name": "brand_name2", - "locale": "locale6" -} +## Example + +```python +from paypalserversdk.models.order_application_context import OrderApplicationContext +from paypalserversdk.models.order_application_context_landing_page import OrderApplicationContextLandingPage +from paypalserversdk.models.order_application_context_shipping_preference import OrderApplicationContextShippingPreference +from paypalserversdk.models.order_application_context_user_action import OrderApplicationContextUserAction + +order_application_context = OrderApplicationContext( + brand_name='brand_name2', + locale='locale6', + landing_page=OrderApplicationContextLandingPage.NO_PREFERENCE, + shipping_preference=OrderApplicationContextShippingPreference.GET_FROM_FILE, + user_action=OrderApplicationContextUserAction.CONTINUE +) ``` diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md index 3834c7b..8d8edf0 100644 --- a/doc/models/order-authorize-request-payment-source.md +++ b/doc/models/order-authorize-request-payment-source.md @@ -18,108 +18,132 @@ The payment source definition. | `google_pay` | [`GooglePayRequest`](../../doc/models/google-pay-request.md) | Optional | Information needed to pay using Google Pay. | | `venmo` | [`VenmoWalletRequest`](../../doc/models/venmo-wallet-request.md) | Optional | Information needed to pay using Venmo. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "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" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_decrypted_token_data import ApplePayDecryptedTokenData +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType +from paypalserversdk.models.apple_pay_request import ApplePayRequest +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod +from paypalserversdk.models.google_pay_card import GooglePayCard +from paypalserversdk.models.google_pay_decrypted_token_data import GooglePayDecryptedTokenData +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod +from paypalserversdk.models.google_pay_request import GooglePayRequest +from paypalserversdk.models.google_pay_request_card import GooglePayRequestCard +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_authorize_request_payment_source import OrderAuthorizeRequestPaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +order_authorize_request_payment_source = OrderAuthorizeRequestPaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + apple_pay=ApplePayRequest( + id='id0', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ), + decrypted_token=ApplePayDecryptedTokenData( + tokenized_card=ApplePayTokenizedCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.UNKNOWN + ), + transaction_amount=Money( + currency_code='currency_code6', + value='value2' + ), + device_manufacturer_id='device_manufacturer_id6', + payment_data_type=ApplePayPaymentDataType.ENUM_3DSECURE, + payment_data=ApplePayPaymentData( + cryptogram='cryptogram6', + eci_indicator='eci_indicator0', + emv_data='emv_data0', + pin='pin4' + ) + ) + ), + google_pay=GooglePayRequest( + name='name8', + email_address='email_address6', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayRequestCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + decrypted_token=GooglePayDecryptedTokenData( + payment_method=GooglePayPaymentMethod.CARD, + card=GooglePayCard( + name='name6', + number='number6', + expiry='expiry4', + mtype=CardType.UNKNOWN + ), + authentication_method=GooglePayAuthenticationMethod.PAN_ONLY, + message_id='message_id0', + message_expiration='message_expiration2', + cryptogram='cryptogram6', + eci_indicator='eci_indicator0' + ) + ) +) ``` diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md index 331a5ca..82e4577 100644 --- a/doc/models/order-authorize-request.md +++ b/doc/models/order-authorize-request.md @@ -13,110 +13,135 @@ The authorization of an order request. | --- | --- | --- | --- | | `payment_source` | [`OrderAuthorizeRequestPaymentSource`](../../doc/models/order-authorize-request-payment-source.md) | Optional | The payment source definition. | -## Example (as JSON) +## Example -```json -{ - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "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" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_decrypted_token_data import ApplePayDecryptedTokenData +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType +from paypalserversdk.models.apple_pay_request import ApplePayRequest +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod +from paypalserversdk.models.google_pay_card import GooglePayCard +from paypalserversdk.models.google_pay_decrypted_token_data import GooglePayDecryptedTokenData +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod +from paypalserversdk.models.google_pay_request import GooglePayRequest +from paypalserversdk.models.google_pay_request_card import GooglePayRequestCard +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_authorize_request import OrderAuthorizeRequest +from paypalserversdk.models.order_authorize_request_payment_source import OrderAuthorizeRequestPaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +order_authorize_request = OrderAuthorizeRequest( + payment_source=OrderAuthorizeRequestPaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + apple_pay=ApplePayRequest( + id='id0', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ), + decrypted_token=ApplePayDecryptedTokenData( + tokenized_card=ApplePayTokenizedCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.UNKNOWN + ), + transaction_amount=Money( + currency_code='currency_code6', + value='value2' + ), + device_manufacturer_id='device_manufacturer_id6', + payment_data_type=ApplePayPaymentDataType.ENUM_3DSECURE, + payment_data=ApplePayPaymentData( + cryptogram='cryptogram6', + eci_indicator='eci_indicator0', + emv_data='emv_data0', + pin='pin4' + ) + ) + ), + google_pay=GooglePayRequest( + name='name8', + email_address='email_address6', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayRequestCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + decrypted_token=GooglePayDecryptedTokenData( + payment_method=GooglePayPaymentMethod.CARD, + card=GooglePayCard( + name='name6', + number='number6', + expiry='expiry4', + mtype=CardType.UNKNOWN + ), + authentication_method=GooglePayAuthenticationMethod.PAN_ONLY, + message_id='message_id0', + message_expiration='message_expiration2', + cryptogram='cryptogram6', + eci_indicator='eci_indicator0' + ) + ) + ) +) ``` diff --git a/doc/models/order-authorize-response-payment-source.md b/doc/models/order-authorize-response-payment-source.md index 94a9e35..35b7830 100644 --- a/doc/models/order-authorize-response-payment-source.md +++ b/doc/models/order-authorize-response-payment-source.md @@ -17,72 +17,81 @@ The payment source used to fund the payment. | `google_pay` | [`GooglePayWalletResponse`](../../doc/models/google-pay-wallet-response.md) | Optional | Google Pay Wallet payment data. | | `venmo` | [`VenmoWalletResponse`](../../doc/models/venmo-wallet-response.md) | Optional | Venmo wallet response. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "apple_pay": { - "id": "id0", - "token": "token6", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } - }, - "venmo": { - "email_address": "email_address4", - "account_id": "account_id8", - "user_name": "user_name2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_number": { - "national_number": "national_number6" - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_payment_object import ApplePayPaymentObject +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response import CardResponse +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_card_response import GooglePayCardResponse +from paypalserversdk.models.google_pay_wallet_response import GooglePayWalletResponse +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_authorize_response_payment_source import OrderAuthorizeResponsePaymentSource +from paypalserversdk.models.paypal_wallet_response import PaypalWalletResponse +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.venmo_wallet_response import VenmoWalletResponse + +order_authorize_response_payment_source = OrderAuthorizeResponsePaymentSource( + card=CardResponse( + name='name6', + brand=CardBrand.CB_NATIONALE, + mtype=CardType.UNKNOWN + ), + paypal=PaypalWalletResponse( + email_address='email_address0', + account_id='account_id4', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_type=PhoneType.FAX + ), + apple_pay=ApplePayPaymentObject( + id='id0', + token='token6', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ) + ), + google_pay=GooglePayWalletResponse( + name='name8', + email_address='email_address6', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayCardResponse( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ), + venmo=VenmoWalletResponse( + email_address='email_address4', + account_id='account_id8', + user_name='user_name2', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_number=PhoneNumber( + national_number='national_number6' + ) + ) +) ``` diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md index ef38d74..6343ba0 100644 --- a/doc/models/order-authorize-response.md +++ b/doc/models/order-authorize-response.md @@ -22,78 +22,88 @@ The order authorize response. | `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, Read-only | 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) +## Example -```json -{ - "create_time": "create_time0", - "update_time": "update_time4", - "id": "id4", - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "apple_pay": { - "id": "id0", - "token": "token6", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } - }, - "venmo": { - "email_address": "email_address4", - "account_id": "account_id8", - "user_name": "user_name2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_number": { - "national_number": "national_number6" - } - } - }, - "intent": "CAPTURE" -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_payment_object import ApplePayPaymentObject +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response import CardResponse +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.checkout_payment_intent import CheckoutPaymentIntent +from paypalserversdk.models.google_pay_card_response import GooglePayCardResponse +from paypalserversdk.models.google_pay_wallet_response import GooglePayWalletResponse +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_authorize_response import OrderAuthorizeResponse +from paypalserversdk.models.order_authorize_response_payment_source import OrderAuthorizeResponsePaymentSource +from paypalserversdk.models.paypal_wallet_response import PaypalWalletResponse +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.venmo_wallet_response import VenmoWalletResponse + +order_authorize_response = OrderAuthorizeResponse( + create_time='create_time6', + update_time='update_time2', + payment_source=OrderAuthorizeResponsePaymentSource( + card=CardResponse( + name='name6', + brand=CardBrand.CB_NATIONALE, + mtype=CardType.UNKNOWN + ), + paypal=PaypalWalletResponse( + email_address='email_address0', + account_id='account_id4', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_type=PhoneType.FAX + ), + apple_pay=ApplePayPaymentObject( + id='id0', + token='token6', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ) + ), + google_pay=GooglePayWalletResponse( + name='name8', + email_address='email_address6', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayCardResponse( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ), + venmo=VenmoWalletResponse( + email_address='email_address4', + account_id='account_id8', + user_name='user_name2', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_number=PhoneNumber( + national_number='national_number6' + ) + ) + ), + intent=CheckoutPaymentIntent.CAPTURE +) ``` diff --git a/doc/models/order-billing-plan.md b/doc/models/order-billing-plan.md index cfab070..9ae94ce 100644 --- a/doc/models/order-billing-plan.md +++ b/doc/models/order-billing-plan.md @@ -15,34 +15,47 @@ Metadata for merchant-managed recurring billing plans. Valid only during the sav | `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `name` | `str` | Optional | Name of the recurring plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[A-Za-z0-9() +',.:-]+$` | -## Example (as JSON) - -```json -{ - "billing_cycles": [ - { - "tenure_type": "REGULAR", - "total_cycles": 1, - "sequence": 1, - "pricing_scheme": { - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "AUTO_RELOAD", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - "start_date": "start_date6" - } - ], - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "name": "name4" -} +## Example + +```python +from paypalserversdk.models.billing_cycle import BillingCycle +from paypalserversdk.models.cycle_frequency import CycleFrequency +from paypalserversdk.models.frequency_interval_unit import FrequencyIntervalUnit +from paypalserversdk.models.money import Money +from paypalserversdk.models.order_billing_plan import OrderBillingPlan +from paypalserversdk.models.pricing_model import PricingModel +from paypalserversdk.models.pricing_scheme import PricingScheme +from paypalserversdk.models.tenure_type import TenureType + +order_billing_plan = OrderBillingPlan( + billing_cycles=[ + BillingCycle( + tenure_type=TenureType.REGULAR, + pricing_scheme=PricingScheme( + pricing_model=PricingModel.AUTO_RELOAD, + price=Money( + currency_code='currency_code8', + value='value4' + ), + reload_threshold_amount=Money( + currency_code='currency_code0', + value='value6' + ) + ), + total_cycles=1, + sequence=1, + start_date='start_date6', + frequency=CycleFrequency( + interval_unit=FrequencyIntervalUnit.LIFETIME, + interval_count=94 + ) + ) + ], + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + name='name4' +) ``` diff --git a/doc/models/order-capture-request-payment-source.md b/doc/models/order-capture-request-payment-source.md index 4fde855..058876c 100644 --- a/doc/models/order-capture-request-payment-source.md +++ b/doc/models/order-capture-request-payment-source.md @@ -18,108 +18,132 @@ The payment source definition. | `google_pay` | [`GooglePayRequest`](../../doc/models/google-pay-request.md) | Optional | Information needed to pay using Google Pay. | | `venmo` | [`VenmoWalletRequest`](../../doc/models/venmo-wallet-request.md) | Optional | Information needed to pay using Venmo. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "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" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_decrypted_token_data import ApplePayDecryptedTokenData +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType +from paypalserversdk.models.apple_pay_request import ApplePayRequest +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod +from paypalserversdk.models.google_pay_card import GooglePayCard +from paypalserversdk.models.google_pay_decrypted_token_data import GooglePayDecryptedTokenData +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod +from paypalserversdk.models.google_pay_request import GooglePayRequest +from paypalserversdk.models.google_pay_request_card import GooglePayRequestCard +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_capture_request_payment_source import OrderCaptureRequestPaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +order_capture_request_payment_source = OrderCaptureRequestPaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + apple_pay=ApplePayRequest( + id='id0', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ), + decrypted_token=ApplePayDecryptedTokenData( + tokenized_card=ApplePayTokenizedCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.UNKNOWN + ), + transaction_amount=Money( + currency_code='currency_code6', + value='value2' + ), + device_manufacturer_id='device_manufacturer_id6', + payment_data_type=ApplePayPaymentDataType.ENUM_3DSECURE, + payment_data=ApplePayPaymentData( + cryptogram='cryptogram6', + eci_indicator='eci_indicator0', + emv_data='emv_data0', + pin='pin4' + ) + ) + ), + google_pay=GooglePayRequest( + name='name8', + email_address='email_address6', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayRequestCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + decrypted_token=GooglePayDecryptedTokenData( + payment_method=GooglePayPaymentMethod.CARD, + card=GooglePayCard( + name='name6', + number='number6', + expiry='expiry4', + mtype=CardType.UNKNOWN + ), + authentication_method=GooglePayAuthenticationMethod.PAN_ONLY, + message_id='message_id0', + message_expiration='message_expiration2', + cryptogram='cryptogram6', + eci_indicator='eci_indicator0' + ) + ) +) ``` diff --git a/doc/models/order-capture-request.md b/doc/models/order-capture-request.md index 0c73415..95ac79c 100644 --- a/doc/models/order-capture-request.md +++ b/doc/models/order-capture-request.md @@ -13,110 +13,135 @@ Completes an capture payment for an order. | --- | --- | --- | --- | | `payment_source` | [`OrderCaptureRequestPaymentSource`](../../doc/models/order-capture-request-payment-source.md) | Optional | The payment source definition. | -## Example (as JSON) +## Example -```json -{ - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "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" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_decrypted_token_data import ApplePayDecryptedTokenData +from paypalserversdk.models.apple_pay_payment_data import ApplePayPaymentData +from paypalserversdk.models.apple_pay_payment_data_type import ApplePayPaymentDataType +from paypalserversdk.models.apple_pay_request import ApplePayRequest +from paypalserversdk.models.apple_pay_tokenized_card import ApplePayTokenizedCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.google_pay_authentication_method import GooglePayAuthenticationMethod +from paypalserversdk.models.google_pay_card import GooglePayCard +from paypalserversdk.models.google_pay_decrypted_token_data import GooglePayDecryptedTokenData +from paypalserversdk.models.google_pay_payment_method import GooglePayPaymentMethod +from paypalserversdk.models.google_pay_request import GooglePayRequest +from paypalserversdk.models.google_pay_request_card import GooglePayRequestCard +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_capture_request import OrderCaptureRequest +from paypalserversdk.models.order_capture_request_payment_source import OrderCaptureRequestPaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +order_capture_request = OrderCaptureRequest( + payment_source=OrderCaptureRequestPaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + apple_pay=ApplePayRequest( + id='id0', + name='name0', + email_address='email_address8', + phone_number=PhoneNumber( + national_number='national_number6' + ), + decrypted_token=ApplePayDecryptedTokenData( + tokenized_card=ApplePayTokenizedCard( + name='name4', + number='number2', + expiry='expiry2', + mtype=CardType.UNKNOWN + ), + transaction_amount=Money( + currency_code='currency_code6', + value='value2' + ), + device_manufacturer_id='device_manufacturer_id6', + payment_data_type=ApplePayPaymentDataType.ENUM_3DSECURE, + payment_data=ApplePayPaymentData( + cryptogram='cryptogram6', + eci_indicator='eci_indicator0', + emv_data='emv_data0', + pin='pin4' + ) + ) + ), + google_pay=GooglePayRequest( + name='name8', + email_address='email_address6', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + card=GooglePayRequestCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + decrypted_token=GooglePayDecryptedTokenData( + payment_method=GooglePayPaymentMethod.CARD, + card=GooglePayCard( + name='name6', + number='number6', + expiry='expiry4', + mtype=CardType.UNKNOWN + ), + authentication_method=GooglePayAuthenticationMethod.PAN_ONLY, + message_id='message_id0', + message_expiration='message_expiration2', + cryptogram='cryptogram6', + eci_indicator='eci_indicator0' + ) + ) + ) +) ``` diff --git a/doc/models/order-confirm-application-context.md b/doc/models/order-confirm-application-context.md index df5302a..b427b1f 100644 --- a/doc/models/order-confirm-application-context.md +++ b/doc/models/order-confirm-application-context.md @@ -17,25 +17,33 @@ Customizes the payer confirmation experience. | `cancel_url` | `str` | Optional | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | | `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. | -## Example (as JSON) - -```json -{ - "brand_name": "brand_name6", - "locale": "locale0", - "return_url": "return_url8", - "cancel_url": "cancel_url0", - "stored_payment_source": { - "payment_initiator": "CUSTOMER", - "payment_type": "RECURRING", - "usage": "FIRST", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.network_transaction import NetworkTransaction +from paypalserversdk.models.order_confirm_application_context import OrderConfirmApplicationContext +from paypalserversdk.models.payment_initiator import PaymentInitiator +from paypalserversdk.models.stored_payment_source import StoredPaymentSource +from paypalserversdk.models.stored_payment_source_payment_type import StoredPaymentSourcePaymentType +from paypalserversdk.models.stored_payment_source_usage_type import StoredPaymentSourceUsageType + +order_confirm_application_context = OrderConfirmApplicationContext( + brand_name='brand_name2', + locale='locale2', + return_url='return_url0', + cancel_url='cancel_url2', + stored_payment_source=StoredPaymentSource( + payment_initiator=PaymentInitiator.CUSTOMER, + payment_type=StoredPaymentSourcePaymentType.RECURRING, + usage=StoredPaymentSourceUsageType.FIRST, + previous_network_transaction_reference=NetworkTransaction( + id='id6', + date='date2', + network=CardBrand.CONFIDIS, + acquirer_reference_number='acquirer_reference_number8' + ) + ) +) ``` diff --git a/doc/models/order-request.md b/doc/models/order-request.md index 6c63293..ba07e6d 100644 --- a/doc/models/order-request.md +++ b/doc/models/order-request.md @@ -18,175 +18,209 @@ The order request details. | `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. | -## Example (as JSON) +## Example -```json -{ - "intent": "CAPTURE", - "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" - } - ], - "processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL", - "payer": { - "email_address": "email_address6", - "payer_id": "payer_id6", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date4" - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } - } - }, - "application_context": { - "brand_name": "brand_name8", - "locale": "locale2", - "landing_page": "BILLING", - "shipping_preference": "SET_PROVIDED_ADDRESS", - "user_action": "CONTINUE" - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.amount_breakdown import AmountBreakdown +from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown +from paypalserversdk.models.bancontact_payment_request import BancontactPaymentRequest +from paypalserversdk.models.blik_experience_context import BlikExperienceContext +from paypalserversdk.models.blik_level_0_payment_object import BlikLevel0PaymentObject +from paypalserversdk.models.blik_one_click_payment_request import BlikOneClickPaymentRequest +from paypalserversdk.models.blik_payment_request import BlikPaymentRequest +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.checkout_payment_intent import CheckoutPaymentIntent +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.order_application_context import OrderApplicationContext +from paypalserversdk.models.order_application_context_landing_page import OrderApplicationContextLandingPage +from paypalserversdk.models.order_application_context_shipping_preference import OrderApplicationContextShippingPreference +from paypalserversdk.models.order_application_context_user_action import OrderApplicationContextUserAction +from paypalserversdk.models.order_request import OrderRequest +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.payer import Payer +from paypalserversdk.models.payment_instruction import PaymentInstruction +from paypalserversdk.models.payment_source import PaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.platform_fee import PlatformFee +from paypalserversdk.models.processing_instruction import ProcessingInstruction +from paypalserversdk.models.purchase_unit_request import PurchaseUnitRequest +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +order_request = OrderRequest( + intent=CheckoutPaymentIntent.CAPTURE, + purchase_units=[ + PurchaseUnitRequest( + amount=AmountWithBreakdown( + currency_code='currency_code6', + value='value0', + breakdown=AmountBreakdown( + item_total=Money( + currency_code='currency_code0', + value='value6' + ), + shipping=Money( + currency_code='currency_code0', + value='value6' + ), + handling=Money( + currency_code='currency_code2', + value='value8' + ), + tax_total=Money( + currency_code='currency_code4', + value='value0' + ), + insurance=Money( + currency_code='currency_code2', + value='value8' + ) + ) + ), + reference_id='reference_id4', + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ), + payment_instruction=PaymentInstruction( + platform_fees=[ + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ) + ], + disbursement_mode=DisbursementMode.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' + ) + ], + processing_instruction=ProcessingInstruction.ORDER_COMPLETE_ON_PAYMENT_APPROVAL, + payer=Payer( + email_address='email_address6', + payer_id='payer_id6', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date4' + ), + payment_source=PaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + bancontact=BancontactPaymentRequest( + name='name0', + country_code='country_code0', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) + ), + blik=BlikPaymentRequest( + name='name2', + country_code='country_code2', + email='email4', + experience_context=BlikExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ), + level_0=BlikLevel0PaymentObject( + auth_code='auth_code8' + ), + one_click=BlikOneClickPaymentRequest( + consumer_reference='consumer_reference2', + auth_code='auth_code0', + alias_label='alias_label6', + alias_key='alias_key4' + ) + ) + ), + application_context=OrderApplicationContext( + brand_name='brand_name8', + locale='locale2', + landing_page=OrderApplicationContextLandingPage.BILLING, + shipping_preference=OrderApplicationContextShippingPreference.SET_PROVIDED_ADDRESS, + user_action=OrderApplicationContextUserAction.CONTINUE + ) +) ``` diff --git a/doc/models/order-status.md b/doc/models/order-status.md index e2f2a0e..637c1ba 100644 --- a/doc/models/order-status.md +++ b/doc/models/order-status.md @@ -18,3 +18,11 @@ The order status. | `COMPLETED` | The intent of the order was completed and a `payments` resource was created. Important: Check the payment status in `purchase_units[].payments.captures[].status` before fulfilling the order. A completed order can indicate a payment was authorized, an authorized payment was captured, or a payment was declined. | | `PAYER_ACTION_REQUIRED` | The order requires an action from the payer (e.g. 3DS authentication). Redirect the payer to the "rel":"payer-action" HATEOAS link returned as part of the response prior to authorizing or capturing the order. Some payment sources may not return a payer-action HATEOAS link (eg. MB WAY). For these payment sources the payer-action is managed by the scheme itself (eg. through SMS, email, in-app notification, etc). | +## Example + +```python +from paypalserversdk.models.order_status import OrderStatus + +order_status = OrderStatus.COMPLETED +``` + diff --git a/doc/models/order-tracker-item.md b/doc/models/order-tracker-item.md index d12ab79..25f755f 100644 --- a/doc/models/order-tracker-item.md +++ b/doc/models/order-tracker-item.md @@ -18,15 +18,17 @@ The details of the items in the shipment. | `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. | -## Example (as JSON) - -```json -{ - "name": "name6", - "quantity": "quantity2", - "sku": "sku2", - "url": "url0", - "image_url": "image_url2" -} +## Example + +```python +from paypalserversdk.models.order_tracker_item import OrderTrackerItem + +order_tracker_item = OrderTrackerItem( + name='name2', + quantity='quantity8', + sku='sku8', + url='url6', + image_url='image_url8' +) ``` diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md index 05266d8..19d9406 100644 --- a/doc/models/order-tracker-request.md +++ b/doc/models/order-tracker-request.md @@ -18,31 +18,28 @@ The tracking details of an order. | `notify_payer` | `bool` | Optional | If true, PayPal will send an email notification to the payer of the PayPal transaction. The email contains the tracking details provided through the Orders tracking API request. Independent of any value passed for `notify_payer`, the payer may receive tracking notifications within the PayPal app, based on the user's notification preferences.

**Default**: `False` | | `items` | [`List[OrderTrackerItem]`](../../doc/models/order-tracker-item.md) | Optional | An array of details of items in the shipment. | -## Example (as JSON) - -```json -{ - "capture_id": "capture_id0", - "notify_payer": false, - "tracking_number": "tracking_number6", - "carrier": "ACS_GR", - "carrier_name_other": "carrier_name_other0", - "items": [ - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - }, - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - } - ] -} +## Example + +```python +from paypalserversdk.models.order_tracker_item import OrderTrackerItem +from paypalserversdk.models.order_tracker_request import OrderTrackerRequest +from paypalserversdk.models.shipment_carrier import ShipmentCarrier + +order_tracker_request = OrderTrackerRequest( + capture_id='capture_id8', + tracking_number='tracking_number4', + carrier=ShipmentCarrier.IBVENTURE_WEBHOOK, + carrier_name_other='carrier_name_other8', + notify_payer=False, + items=[ + OrderTrackerItem( + name='name8', + quantity='quantity4', + sku='sku6', + url='url2', + image_url='image_url4' + ) + ] +) ``` diff --git a/doc/models/order-tracker-response.md b/doc/models/order-tracker-response.md index ea0a94b..6b256b1 100644 --- a/doc/models/order-tracker-response.md +++ b/doc/models/order-tracker-response.md @@ -18,46 +18,32 @@ The tracking response on creation of tracker. | `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 -{ - "id": "id2", - "status": "CANCELLED", - "items": [ - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - }, - { - "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" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "create_time": "create_time8" -} +## Example + +```python +from paypalserversdk.models.order_tracker_item import OrderTrackerItem +from paypalserversdk.models.order_tracker_response import OrderTrackerResponse +from paypalserversdk.models.order_tracker_status import OrderTrackerStatus + +order_tracker_response = OrderTrackerResponse( + status=OrderTrackerStatus.CANCELLED, + items=[ + OrderTrackerItem( + name='name8', + quantity='quantity4', + sku='sku6', + url='url2', + image_url='image_url4' + ), + OrderTrackerItem( + name='name8', + quantity='quantity4', + sku='sku6', + url='url2', + image_url='image_url4' + ) + ], + create_time='create_time0' +) ``` diff --git a/doc/models/order-tracker-status.md b/doc/models/order-tracker-status.md index 57a4c73..2b412da 100644 --- a/doc/models/order-tracker-status.md +++ b/doc/models/order-tracker-status.md @@ -14,3 +14,11 @@ The status of the item shipment. | `CANCELLED` | The shipment was cancelled and the tracking number no longer applies. | | `SHIPPED` | The merchant has assigned a tracking number to the items being shipped from the Order. This does not correspond to the carrier's actual status for the shipment. The latest status of the parcel must be retrieved from the carrier. | +## Example + +```python +from paypalserversdk.models.order_tracker_status import OrderTrackerStatus + +order_tracker_status = OrderTrackerStatus.CANCELLED +``` + diff --git a/doc/models/order.md b/doc/models/order.md index 8933bc0..a5887f6 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -22,55 +22,63 @@ The order details. | `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, Read-only | 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) +## Example -```json -{ - "create_time": "create_time8", - "update_time": "update_time4", - "id": "id2", - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "bic": "bic2", - "iban_last_chars": "iban_last_chars8", - "card_last_digits": "card_last_digits4" - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "one_click": { - "consumer_reference": "consumer_reference2" - } - }, - "eps": { - "name": "name6", - "country_code": "country_code6", - "bic": "bic8" - } - }, - "intent": "CAPTURE" -} +```python +from paypalserversdk.models.bancontact_payment_object import BancontactPaymentObject +from paypalserversdk.models.blik_one_click_payment_object import BlikOneClickPaymentObject +from paypalserversdk.models.blik_payment_object import BlikPaymentObject +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response import CardResponse +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.checkout_payment_intent import CheckoutPaymentIntent +from paypalserversdk.models.eps_payment_object import EpsPaymentObject +from paypalserversdk.models.name import Name +from paypalserversdk.models.order import Order +from paypalserversdk.models.payment_source_response import PaymentSourceResponse +from paypalserversdk.models.paypal_wallet_response import PaypalWalletResponse +from paypalserversdk.models.phone_type import PhoneType + +order = Order( + create_time='create_time2', + update_time='update_time8', + payment_source=PaymentSourceResponse( + card=CardResponse( + name='name6', + brand=CardBrand.CB_NATIONALE, + mtype=CardType.UNKNOWN + ), + paypal=PaypalWalletResponse( + email_address='email_address0', + account_id='account_id4', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_type=PhoneType.FAX + ), + bancontact=BancontactPaymentObject( + name='name0', + country_code='country_code0', + bic='bic2', + iban_last_chars='iban_last_chars8', + card_last_digits='card_last_digits4' + ), + blik=BlikPaymentObject( + name='name2', + country_code='country_code2', + email='email4', + one_click=BlikOneClickPaymentObject( + consumer_reference='consumer_reference2' + ) + ), + eps=EpsPaymentObject( + name='name6', + country_code='country_code6', + bic='bic8' + ) + ), + intent=CheckoutPaymentIntent.CAPTURE +) ``` diff --git a/doc/models/orders-capture.md b/doc/models/orders-capture.md index 4cee011..61bf2ac 100644 --- a/doc/models/orders-capture.md +++ b/doc/models/orders-capture.md @@ -27,22 +27,25 @@ A captured payment. | `create_time` | `str` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**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 -{ - "final_capture": false, - "disbursement_mode": "INSTANT", - "status": "REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" -} +## Example + +```python +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason +from paypalserversdk.models.capture_status_details import CaptureStatusDetails +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.orders_capture import OrdersCapture + +orders_capture = OrdersCapture( + status_details=CaptureStatusDetails( + reason=CaptureIncompleteReason.VERIFICATION_REQUIRED + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ), + final_capture=False, + disbursement_mode=DisbursementMode.INSTANT +) ``` diff --git a/doc/models/orders-card-verification-method.md b/doc/models/orders-card-verification-method.md index 6e03873..d866498 100644 --- a/doc/models/orders-card-verification-method.md +++ b/doc/models/orders-card-verification-method.md @@ -16,3 +16,11 @@ The method used for card verification. | `ENUM_3D_SECURE` | The contingency surfaced as an additional security layer that helps prevent unauthorized card-not-present transactions and protects the merchant from exposure to fraud. | | `AVS_CVV` | Places a temporary hold on the card to ensure its validity. This process protects the merchant from exposure to fraud. This verification method will confirm that the address information or CVV included matches what the issuing bank has on file for the associated card, ensuring that only authorized card users are able to make purchases from you. | +## Example + +```python +from paypalserversdk.models.orders_card_verification_method import OrdersCardVerificationMethod + +orders_card_verification_method = OrdersCardVerificationMethod.ENUM_3D_SECURE +``` + diff --git a/doc/models/os-type.md b/doc/models/os-type.md index 75d9fb7..63a0c60 100644 --- a/doc/models/os-type.md +++ b/doc/models/os-type.md @@ -15,3 +15,11 @@ Operating System type of the device that the buyer is using. | `IOS` | Apple OS typically found in Apple mobile devices. | | `OTHER` | Any other OS type. | +## Example + +```python +from paypalserversdk.models.os_type import OsType + +os_type = OsType.IOS +``` + diff --git a/doc/models/p24-payment-object.md b/doc/models/p24-payment-object.md index f5945de..9f19b19 100644 --- a/doc/models/p24-payment-object.md +++ b/doc/models/p24-payment-object.md @@ -18,15 +18,17 @@ Information used to pay using P24(Przelewy24). | `method_id` | `str` | Optional | Numeric identifier of the payment scheme or bank used for the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300` | | `method_description` | `str` | Optional | Friendly name of the payment scheme or bank used for the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | -## Example (as JSON) - -```json -{ - "name": "name4", - "email": "email2", - "country_code": "country_code4", - "payment_descriptor": "payment_descriptor8", - "method_id": "method_id8" -} +## Example + +```python +from paypalserversdk.models.p_24_payment_object import P24PaymentObject + +p_24_payment_object = P24PaymentObject( + name='name0', + email='email6', + country_code='country_code0', + payment_descriptor='payment_descriptor4', + method_id='method_id4' +) ``` diff --git a/doc/models/p24-payment-request.md b/doc/models/p24-payment-request.md index 6a7844f..8b33e0c 100644 --- a/doc/models/p24-payment-request.md +++ b/doc/models/p24-payment-request.md @@ -16,20 +16,24 @@ Information needed to pay using P24 (Przelewy24). | `country_code` | `str` | Required | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name6", - "email": "email0", - "country_code": "country_code6", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.p_24_payment_request import P24PaymentRequest + +p_24_payment_request = P24PaymentRequest( + name='name8', + email='email8', + country_code='country_code8', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/pa-res-status.md b/doc/models/pa-res-status.md index 5f5de32..a18687b 100644 --- a/doc/models/pa-res-status.md +++ b/doc/models/pa-res-status.md @@ -20,3 +20,11 @@ Transactions status result identifier. The outcome of the issuer's authenticatio | `DECOUPLEDAUTHENTICATION` | Challenge required; decoupled authentication confirmed. | | `INFORMATIONALONLY` | Informational only; 3DS requestor challenge preference acknowledged. | +## Example + +```python +from paypalserversdk.models.pa_res_status import PaResStatus + +pa_res_status = PaResStatus.DECOUPLEDAUTHENTICATION +``` + diff --git a/doc/models/participant-metadata.md b/doc/models/participant-metadata.md index 5710368..a6b3870 100644 --- a/doc/models/participant-metadata.md +++ b/doc/models/participant-metadata.md @@ -13,11 +13,13 @@ Profile information of the sender or receiver. | --- | --- | --- | --- | | `ip_address` | `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*$` | -## Example (as JSON) +## Example -```json -{ - "ip_address": "ip_address2" -} +```python +from paypalserversdk.models.participant_metadata import ParticipantMetadata + +participant_metadata = ParticipantMetadata( + ip_address='ip_address4' +) ``` diff --git a/doc/models/patch-op.md b/doc/models/patch-op.md index 2aded25..6f78df9 100644 --- a/doc/models/patch-op.md +++ b/doc/models/patch-op.md @@ -18,3 +18,11 @@ The operation. | `COPY` | Copies the value at a specified location to the target location. The operation object must contain a from parameter, which is a string that contains a JSON pointer value that references the location in the target document from which to copy the value. For the operation to succeed, the from location must exist. For more information, see 4.5. copy. | | `TEST` | Tests that a value at the target location is equal to a specified value. The operation object must contain a value parameter that defines the value to compare to the target location's value. For the operation to succeed, the target location must be equal to the value value. For test, equal indicates that the value at the target location and the value that value defines are of the same JSON type. The data type of the value determines how equality is defined: Type Considered equal if both values strings Contain the same number of Unicode characters and their code points are byte-by-byte equal. numbers Are numerically equal. arrays Contain the same number of values, and each value is equal to the value at the corresponding position in the other array, by using these type-specific rules. objects Contain the same number of parameters, and each parameter is equal to a parameter in the other object, by comparing their keys (as strings) and their values (by using these type-specific rules). literals (false, true, and null) Are the same. The comparison is a logical comparison. For example, whitespace between the parameter values of an array is not significant. Also, ordering of the serialization of object parameters is not significant. For more information, see 4.6. test. | +## Example + +```python +from paypalserversdk.models.patch_op import PatchOp + +patch_op = PatchOp.ADD +``` + diff --git a/doc/models/patch.md b/doc/models/patch.md index 244972f..3768709 100644 --- a/doc/models/patch.md +++ b/doc/models/patch.md @@ -16,17 +16,19 @@ The JSON patch object to apply partial updates to resources. | `value` | `Any` | Optional | The value to apply. The remove, copy, and move operations do not require a value. Since JSON Patch allows any type for value, the type property is not specified. | | `mfrom` | `str` | Optional | The JSON Pointer to the target document location from which to move the value. Required for the move operation. | -## Example (as JSON) - -```json -{ - "op": "add", - "path": "path6", - "value": { - "key1": "val1", - "key2": "val2" - }, - "from": "from0" -} +## Example + +```python +import jsonpickle + +from paypalserversdk.models.patch import Patch +from paypalserversdk.models.patch_op import PatchOp + +patch = Patch( + op=PatchOp.COPY, + path='path4', + value=jsonpickle.decode('{"key1":"val1","key2":"val2"}'), + mfrom='from2' +) ``` diff --git a/doc/models/payee-base.md b/doc/models/payee-base.md index e333ac6..a5c9977 100644 --- a/doc/models/payee-base.md +++ b/doc/models/payee-base.md @@ -14,12 +14,14 @@ The details for the merchant who receives the funds and fulfills the order. The | `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])+)\])`` | | `merchant_id` | `str` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address0", - "merchant_id": "merchant_id2" -} +```python +from paypalserversdk.models.payee_base import PayeeBase + +payee_base = PayeeBase( + email_address='email_address6', + merchant_id='merchant_id8' +) ``` diff --git a/doc/models/payee-payment-method-preference.md b/doc/models/payee-payment-method-preference.md index 526c1ed..44caa31 100644 --- a/doc/models/payee-payment-method-preference.md +++ b/doc/models/payee-payment-method-preference.md @@ -14,3 +14,11 @@ The merchant-preferred payment methods. | `UNRESTRICTED` | Accepts any type of payment from the customer. | | `IMMEDIATE_PAYMENT_REQUIRED` | Accepts only immediate payment from the customer. For example, credit card, PayPal balance, or instant ACH. Ensures that at the time of capture, the payment does not have the `pending` status. | +## Example + +```python +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference + +payee_payment_method_preference = PayeePaymentMethodPreference.UNRESTRICTED +``` + diff --git a/doc/models/payer-base.md b/doc/models/payer-base.md index 1a723a9..c1a9580 100644 --- a/doc/models/payer-base.md +++ b/doc/models/payer-base.md @@ -14,12 +14,14 @@ The customer who approves and pays for the order. The customer is also known as | `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}$` | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address2", - "payer_id": "payer_id2" -} +```python +from paypalserversdk.models.payer_base import PayerBase + +payer_base = PayerBase( + email_address='email_address8', + payer_id='payer_id8' +) ``` diff --git a/doc/models/payer-information.md b/doc/models/payer-information.md index 2612ee3..3f26dfd 100644 --- a/doc/models/payer-information.md +++ b/doc/models/payer-information.md @@ -20,19 +20,22 @@ The payer information. | `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" -} +## Example + +```python +from paypalserversdk.models.payer_information import PayerInformation +from paypalserversdk.models.phone import Phone + +payer_information = PayerInformation( + account_id='account_id2', + email_address='email_address8', + phone_number=Phone( + country_code='country_code2', + national_number='national_number6', + extension_number='extension_number8' + ), + address_status='address_status8', + payer_status='payer_status2' +) ``` diff --git a/doc/models/payer-name.md b/doc/models/payer-name.md index bfeb5ce..b156052 100644 --- a/doc/models/payer-name.md +++ b/doc/models/payer-name.md @@ -19,15 +19,17 @@ The name of the party. | `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" -} +## Example + +```python +from paypalserversdk.models.payer_name import PayerName + +payer_name = PayerName( + prefix='prefix8', + given_name='given_name2', + surname='surname8', + middle_name='middle_name0', + suffix='suffix0' +) ``` diff --git a/doc/models/payer.md b/doc/models/payer.md index 6ed31b9..49fad79 100644 --- a/doc/models/payer.md +++ b/doc/models/payer.md @@ -19,23 +19,29 @@ The customer who approves and pays for the order. The customer is also known as | `tax_info` | [`TaxInfo`](../../doc/models/tax-info.md) | Optional | The tax ID of the customer. The customer is also known as the payer. Both `tax_id` and `tax_id_type` are required. | | `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 -{ - "email_address": "email_address8", - "payer_id": "payer_id8", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date6" -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.payer import Payer +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +payer = Payer( + email_address='email_address6', + payer_id='payer_id6', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date4' +) ``` diff --git a/doc/models/payment-advice-code.md b/doc/models/payment-advice-code.md index 8f087ed..002fd30 100644 --- a/doc/models/payment-advice-code.md +++ b/doc/models/payment-advice-code.md @@ -27,3 +27,11 @@ The declined payment transactions might have payment advice codes. The card netw | `PAYMENTADVICE_40` | For Mastercard, consumer non-reloadable prepaid card. | | `PAYMENTADVICE_43` | For Mastercard, consumer multi-use virtual card number. | +## Example + +```python +from paypalserversdk.models.payment_advice_code import PaymentAdviceCode + +payment_advice_code = PaymentAdviceCode.PAYMENTADVICE_43 +``` + diff --git a/doc/models/payment-authorization.md b/doc/models/payment-authorization.md index b96c0bc..b6febea 100644 --- a/doc/models/payment-authorization.md +++ b/doc/models/payment-authorization.md @@ -26,20 +26,22 @@ The authorized payment transaction. | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id0", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id0" -} +## Example + +```python +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason +from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_authorization import PaymentAuthorization + +payment_authorization = PaymentAuthorization( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/payment-collection.md b/doc/models/payment-collection.md index 5363084..e5d7423 100644 --- a/doc/models/payment-collection.md +++ b/doc/models/payment-collection.md @@ -15,100 +15,91 @@ The collection of payments, or transactions, for a purchase unit in an order. Fo | `captures` | [`List[OrdersCapture]`](../../doc/models/orders-capture.md) | Optional | An array of captured payments for a purchase unit. A purchase unit can have zero or more captured payments. | | `refunds` | [`List[Refund]`](../../doc/models/refund.md) | Optional | An array of refunds for a purchase unit. A purchase unit can have zero or more refunds. | -## Example (as JSON) +## Example -```json -{ - "authorizations": [ - { - "status": "DENIED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" - }, - { - "status": "DENIED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" - }, - { - "status": "DENIED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" - } - ], - "captures": [ - { - "status": "REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4" - }, - { - "status": "REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4" - } - ], - "refunds": [ - { - "status": "CANCELLED", - "status_details": { - "reason": "ECHECK" - }, - "id": "id8", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id8" - }, - { - "status": "CANCELLED", - "status_details": { - "reason": "ECHECK" - }, - "id": "id8", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id8" - } - ] -} +```python +from paypalserversdk.models.authorization_incomplete_reason import AuthorizationIncompleteReason +from paypalserversdk.models.authorization_status_details import AuthorizationStatusDetails +from paypalserversdk.models.authorization_with_additional_data import AuthorizationWithAdditionalData +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason +from paypalserversdk.models.capture_status_details import CaptureStatusDetails +from paypalserversdk.models.money import Money +from paypalserversdk.models.orders_capture import OrdersCapture +from paypalserversdk.models.payment_collection import PaymentCollection +from paypalserversdk.models.refund import Refund +from paypalserversdk.models.refund_incomplete_reason import RefundIncompleteReason +from paypalserversdk.models.refund_status_details import RefundStatusDetails + +payment_collection = PaymentCollection( + authorizations=[ + AuthorizationWithAdditionalData( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + AuthorizationWithAdditionalData( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + AuthorizationWithAdditionalData( + status_details=AuthorizationStatusDetails( + reason=AuthorizationIncompleteReason.PENDING_REVIEW + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ], + captures=[ + OrdersCapture( + status_details=CaptureStatusDetails( + reason=CaptureIncompleteReason.VERIFICATION_REQUIRED + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + OrdersCapture( + status_details=CaptureStatusDetails( + reason=CaptureIncompleteReason.VERIFICATION_REQUIRED + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ], + refunds=[ + Refund( + status_details=RefundStatusDetails( + reason=RefundIncompleteReason.ECHECK + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + Refund( + status_details=RefundStatusDetails( + reason=RefundIncompleteReason.ECHECK + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] +) ``` diff --git a/doc/models/payment-initiator.md b/doc/models/payment-initiator.md index 034bc3b..bebfcdd 100644 --- a/doc/models/payment-initiator.md +++ b/doc/models/payment-initiator.md @@ -14,3 +14,11 @@ The person or party who initiated or triggered the payment. | `CUSTOMER` | Payment is initiated with the active engagement of the customer. e.g. a customer checking out on a merchant website. | | `MERCHANT` | Payment is initiated by merchant on behalf of the customer without the active engagement of customer. e.g. a merchant charging the monthly payment of a subscription to the customer. | +## Example + +```python +from paypalserversdk.models.payment_initiator import PaymentInitiator + +payment_initiator = PaymentInitiator.CUSTOMER +``` + diff --git a/doc/models/payment-instruction.md b/doc/models/payment-instruction.md index 3d58b93..8d1b78a 100644 --- a/doc/models/payment-instruction.md +++ b/doc/models/payment-instruction.md @@ -16,25 +16,51 @@ Any additional payment instructions to be consider during payment processing. Th | `payee_pricing_tier_id` | `str` | Optional | This field is only enabled for selected merchants/partners to use and provides the ability to trigger a specific pricing rate/plan for a payment transaction. The list of eligible 'payee_pricing_tier_id' would be provided to you by your Account Manager. Specifying values other than the one provided to you by your account manager would result in an error.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^.*$` | | `payee_receivable_fx_rate_id` | `str` | Optional | FX identifier generated returned by PayPal to be used for payment processing in order to honor FX rate (for eligible integrations) to be used when amount is settled/received into the payee account.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "disbursement_mode": "INSTANT", - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } - ], - "payee_pricing_tier_id": "payee_pricing_tier_id6", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id4" -} +## Example + +```python +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.payment_instruction import PaymentInstruction +from paypalserversdk.models.platform_fee import PlatformFee + +payment_instruction = PaymentInstruction( + platform_fees=[ + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ) + ], + disbursement_mode=DisbursementMode.INSTANT, + payee_pricing_tier_id='payee_pricing_tier_id2', + payee_receivable_fx_rate_id='payee_receivable_fx_rate_id0' +) ``` diff --git a/doc/models/payment-method-preference.md b/doc/models/payment-method-preference.md index 6550597..263bf40 100644 --- a/doc/models/payment-method-preference.md +++ b/doc/models/payment-method-preference.md @@ -14,12 +14,16 @@ The customer and merchant payment preferences. | `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_]+$` | | `standard_entry_class_code` | [`StandardEntryClassCode`](../../doc/models/standard-entry-class-code.md) | Optional | NACHA (the regulatory body governing the ACH network) requires that API callers (merchants, partners) obtain the consumer’s explicit authorization before initiating a transaction. To stay compliant, you’ll need to make sure that you retain a compliant authorization for each transaction that you originate to the ACH Network using this API. ACH transactions are categorized (using SEC codes) by how you capture authorization from the Receiver (the person whose bank account is being debited or credited). PayPal supports the following SEC codes.

**Default**: `"WEB"`

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `255` | -## Example (as JSON) +## Example -```json -{ - "payee_preferred": "UNRESTRICTED", - "standard_entry_class_code": "WEB" -} +```python +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference +from paypalserversdk.models.payment_method_preference import PaymentMethodPreference +from paypalserversdk.models.standard_entry_class_code import StandardEntryClassCode + +payment_method_preference = PaymentMethodPreference( + payee_preferred=PayeePaymentMethodPreference.UNRESTRICTED, + standard_entry_class_code=StandardEntryClassCode.WEB +) ``` diff --git a/doc/models/payment-method.md b/doc/models/payment-method.md index 12ef557..8089934 100644 --- a/doc/models/payment-method.md +++ b/doc/models/payment-method.md @@ -13,11 +13,14 @@ The customer and merchant payment preferences. | --- | --- | --- | --- | | `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) +## Example -```json -{ - "payee_preferred": "UNRESTRICTED" -} +```python +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference +from paypalserversdk.models.payment_method import PaymentMethod + +payment_method = PaymentMethod( + payee_preferred=PayeePaymentMethodPreference.UNRESTRICTED +) ``` diff --git a/doc/models/payment-preferences-override.md b/doc/models/payment-preferences-override.md index fb1acd0..429b72e 100644 --- a/doc/models/payment-preferences-override.md +++ b/doc/models/payment-preferences-override.md @@ -16,17 +16,21 @@ The payment preferences to override at subscription level. | `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 -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_preferences_override import PaymentPreferencesOverride +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction + +payment_preferences_override = PaymentPreferencesOverride( + auto_bill_outstanding=False, + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + setup_fee_failure_action=SetupFeeFailureAction.CONTINUE, + payment_failure_threshold=78 +) ``` diff --git a/doc/models/payment-preferences.md b/doc/models/payment-preferences.md index 4c59915..0c11140 100644 --- a/doc/models/payment-preferences.md +++ b/doc/models/payment-preferences.md @@ -16,17 +16,21 @@ The payment preferences for a subscription. | `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" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_preferences import PaymentPreferences +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction + +payment_preferences = PaymentPreferences( + auto_bill_outstanding=True, + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + setup_fee_failure_action=SetupFeeFailureAction.CANCEL, + payment_failure_threshold=0 +) ``` diff --git a/doc/models/payment-source-response.md b/doc/models/payment-source-response.md index e413435..079f387 100644 --- a/doc/models/payment-source-response.md +++ b/doc/models/payment-source-response.md @@ -26,49 +26,56 @@ The payment source used to fund the payment. | `google_pay` | [`GooglePayWalletResponse`](../../doc/models/google-pay-wallet-response.md) | Optional | Google Pay Wallet payment data. | | `venmo` | [`VenmoWalletResponse`](../../doc/models/venmo-wallet-response.md) | Optional | Venmo wallet response. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "bic": "bic2", - "iban_last_chars": "iban_last_chars8", - "card_last_digits": "card_last_digits4" - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "one_click": { - "consumer_reference": "consumer_reference2" - } - }, - "eps": { - "name": "name6", - "country_code": "country_code6", - "bic": "bic8" - } -} +```python +from paypalserversdk.models.bancontact_payment_object import BancontactPaymentObject +from paypalserversdk.models.blik_one_click_payment_object import BlikOneClickPaymentObject +from paypalserversdk.models.blik_payment_object import BlikPaymentObject +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response import CardResponse +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.eps_payment_object import EpsPaymentObject +from paypalserversdk.models.name import Name +from paypalserversdk.models.payment_source_response import PaymentSourceResponse +from paypalserversdk.models.paypal_wallet_response import PaypalWalletResponse +from paypalserversdk.models.phone_type import PhoneType + +payment_source_response = PaymentSourceResponse( + card=CardResponse( + name='name6', + brand=CardBrand.CB_NATIONALE, + mtype=CardType.UNKNOWN + ), + paypal=PaypalWalletResponse( + email_address='email_address0', + account_id='account_id4', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_type=PhoneType.FAX + ), + bancontact=BancontactPaymentObject( + name='name0', + country_code='country_code0', + bic='bic2', + iban_last_chars='iban_last_chars8', + card_last_digits='card_last_digits4' + ), + blik=BlikPaymentObject( + name='name2', + country_code='country_code2', + email='email4', + one_click=BlikOneClickPaymentObject( + consumer_reference='consumer_reference2' + ) + ), + eps=EpsPaymentObject( + name='name6', + country_code='country_code6', + bic='bic8' + ) +) ``` diff --git a/doc/models/payment-source.md b/doc/models/payment-source.md index 46b63b8..6a4df7a 100644 --- a/doc/models/payment-source.md +++ b/doc/models/payment-source.md @@ -27,75 +27,93 @@ The payment source definition. | `google_pay` | [`GooglePayRequest`](../../doc/models/google-pay-request.md) | Optional | Information needed to pay using Google Pay. | | `venmo` | [`VenmoWalletRequest`](../../doc/models/venmo-wallet-request.md) | Optional | Information needed to pay using Venmo. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "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": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.bancontact_payment_request import BancontactPaymentRequest +from paypalserversdk.models.blik_experience_context import BlikExperienceContext +from paypalserversdk.models.blik_level_0_payment_object import BlikLevel0PaymentObject +from paypalserversdk.models.blik_one_click_payment_request import BlikOneClickPaymentRequest +from paypalserversdk.models.blik_payment_request import BlikPaymentRequest +from paypalserversdk.models.card_request import CardRequest +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.name import Name +from paypalserversdk.models.payment_source import PaymentSource +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +payment_source = PaymentSource( + card=CardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + billing_address=Address( + country_code='country_code8', + 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' + ) + ), + token=Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT + ), + paypal=PaypalWallet( + vault_id='vault_id0', + email_address='email_address0', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date8' + ), + bancontact=BancontactPaymentRequest( + name='name0', + country_code='country_code0', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) + ), + blik=BlikPaymentRequest( + name='name2', + country_code='country_code2', + email='email4', + experience_context=BlikExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ), + level_0=BlikLevel0PaymentObject( + auth_code='auth_code8' + ), + one_click=BlikOneClickPaymentRequest( + consumer_reference='consumer_reference2', + auth_code='auth_code0', + alias_label='alias_label6', + alias_key='alias_key4' + ) + ) +) ``` diff --git a/doc/models/payment-supplementary-data.md b/doc/models/payment-supplementary-data.md index 7889100..f65a43f 100644 --- a/doc/models/payment-supplementary-data.md +++ b/doc/models/payment-supplementary-data.md @@ -13,15 +13,18 @@ The supplementary data. | --- | --- | --- | --- | | `related_ids` | [`RelatedIdentifiers`](../../doc/models/related-identifiers.md) | Optional | Identifiers related to a specific resource. | -## Example (as JSON) - -```json -{ - "related_ids": { - "order_id": "order_id2", - "authorization_id": "authorization_id0", - "capture_id": "capture_id0" - } -} +## Example + +```python +from paypalserversdk.models.payment_supplementary_data import PaymentSupplementaryData +from paypalserversdk.models.related_identifiers import RelatedIdentifiers + +payment_supplementary_data = PaymentSupplementaryData( + related_ids=RelatedIdentifiers( + order_id='order_id2', + authorization_id='authorization_id0', + capture_id='capture_id0' + ) +) ``` diff --git a/doc/models/payment-token-request-card.md b/doc/models/payment-token-request-card.md index 66015ce..fa5a58a 100644 --- a/doc/models/payment-token-request-card.md +++ b/doc/models/payment-token-request-card.md @@ -18,15 +18,18 @@ 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). | -## Example (as JSON) - -```json -{ - "name": "name4", - "number": "number8", - "expiry": "expiry2", - "security_code": "security_code6", - "brand": "HIPER" -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.payment_token_request_card import PaymentTokenRequestCard + +payment_token_request_card = PaymentTokenRequestCard( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + brand=CardBrand.RUPAY +) ``` diff --git a/doc/models/payment-token-request-payment-source.md b/doc/models/payment-token-request-payment-source.md index b7d8b30..518e3c4 100644 --- a/doc/models/payment-token-request-payment-source.md +++ b/doc/models/payment-token-request-payment-source.md @@ -14,21 +14,27 @@ The payment method to vault with the instrument details. | `card` | [`PaymentTokenRequestCard`](../../doc/models/payment-token-request-card.md) | Optional | A Resource representing a request to vault a Card. | | `token` | [`VaultTokenRequest`](../../doc/models/vault-token-request.md) | Optional | The Tokenized Payment Source representing a Request to Vault a Token. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "token": { - "id": "id6", - "type": "SETUP_TOKEN" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.payment_token_request_card import PaymentTokenRequestCard +from paypalserversdk.models.payment_token_request_payment_source import PaymentTokenRequestPaymentSource +from paypalserversdk.models.vault_token_request import VaultTokenRequest +from paypalserversdk.models.vault_token_request_type import VaultTokenRequestType + +payment_token_request_payment_source = PaymentTokenRequestPaymentSource( + card=PaymentTokenRequestCard( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + brand=CardBrand.CB_NATIONALE + ), + token=VaultTokenRequest( + id='id6', + mtype=VaultTokenRequestType.SETUP_TOKEN + ) +) ``` diff --git a/doc/models/payment-token-request.md b/doc/models/payment-token-request.md index 6354de7..961ab44 100644 --- a/doc/models/payment-token-request.md +++ b/doc/models/payment-token-request.md @@ -14,27 +14,35 @@ Payment Token Request where the `source` defines the type of instrument to be st | `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. | | `payment_source` | [`PaymentTokenRequestPaymentSource`](../../doc/models/payment-token-request-payment-source.md) | Required | The payment method to vault with the instrument details. | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "token": { - "id": "id6", - "type": "SETUP_TOKEN" - } - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.customer import Customer +from paypalserversdk.models.payment_token_request import PaymentTokenRequest +from paypalserversdk.models.payment_token_request_card import PaymentTokenRequestCard +from paypalserversdk.models.payment_token_request_payment_source import PaymentTokenRequestPaymentSource +from paypalserversdk.models.vault_token_request import VaultTokenRequest +from paypalserversdk.models.vault_token_request_type import VaultTokenRequestType + +payment_token_request = PaymentTokenRequest( + payment_source=PaymentTokenRequestPaymentSource( + card=PaymentTokenRequestCard( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + brand=CardBrand.CB_NATIONALE + ), + token=VaultTokenRequest( + id='id6', + mtype=VaultTokenRequestType.SETUP_TOKEN + ) + ), + customer=Customer( + id='id0', + merchant_customer_id='merchant_customer_id2' + ) +) ``` diff --git a/doc/models/payment-token-response-payment-source.md b/doc/models/payment-token-response-payment-source.md index 2880cf6..ec8dd4d 100644 --- a/doc/models/payment-token-response-payment-source.md +++ b/doc/models/payment-token-response-payment-source.md @@ -16,90 +16,47 @@ The vaulted payment method details. | `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional, Read-only | 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) - -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "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" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_card import ApplePayCard +from paypalserversdk.models.apple_pay_payment_token import ApplePayPaymentToken +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_payment_token_entity import CardPaymentTokenEntity +from paypalserversdk.models.card_response_address import CardResponseAddress +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.payment_token_response_payment_source import PaymentTokenResponsePaymentSource + +payment_token_response_payment_source = PaymentTokenResponsePaymentSource( + card=CardPaymentTokenEntity( + name='name6', + brand=CardBrand.CB_NATIONALE, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) + ), + apple_pay=ApplePayPaymentToken( + card=ApplePayCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ) +) ``` diff --git a/doc/models/payment-token-response.md b/doc/models/payment-token-response.md index 5d4ee35..2b89e6d 100644 --- a/doc/models/payment-token-response.md +++ b/doc/models/payment-token-response.md @@ -16,109 +16,56 @@ Full representation of a saved payment token. | `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, Read-only | An array of related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | -## Example (as JSON) +## Example -```json -{ - "id": "id0", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "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" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "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" - } - } - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_card import ApplePayCard +from paypalserversdk.models.apple_pay_payment_token import ApplePayPaymentToken +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_payment_token_entity import CardPaymentTokenEntity +from paypalserversdk.models.card_response_address import CardResponseAddress +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.customer_response import CustomerResponse +from paypalserversdk.models.payment_token_response import PaymentTokenResponse +from paypalserversdk.models.payment_token_response_payment_source import PaymentTokenResponsePaymentSource + +payment_token_response = PaymentTokenResponse( + id='id6', + customer=CustomerResponse( + id='id0', + merchant_customer_id='merchant_customer_id2' + ), + payment_source=PaymentTokenResponsePaymentSource( + card=CardPaymentTokenEntity( + name='name6', + brand=CardBrand.CB_NATIONALE, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) + ), + apple_pay=ApplePayPaymentToken( + card=ApplePayCard( + name='name6', + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ) + ) +) ``` diff --git a/doc/models/payment-token-status.md b/doc/models/payment-token-status.md index 6b70b87..d361b33 100644 --- a/doc/models/payment-token-status.md +++ b/doc/models/payment-token-status.md @@ -17,3 +17,11 @@ The status of the payment token. | `VAULTED` | The payment token has been vaulted. | | `TOKENIZED` | A vaulted payment method token has been tokenized for short term (one time) use. | +## Example + +```python +from paypalserversdk.models.payment_token_status import PaymentTokenStatus + +payment_token_status = PaymentTokenStatus.PAYER_ACTION_REQUIRED +``` + diff --git a/doc/models/payments-capture.md b/doc/models/payments-capture.md index b4e46a7..d2b63bc 100644 --- a/doc/models/payments-capture.md +++ b/doc/models/payments-capture.md @@ -27,22 +27,25 @@ A captured payment. | `create_time` | `str` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**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 -{ - "final_capture": false, - "disbursement_mode": "INSTANT", - "status": "COMPLETED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id0", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id0" -} +## Example + +```python +from paypalserversdk.models.capture_incomplete_reason import CaptureIncompleteReason +from paypalserversdk.models.capture_status_details import CaptureStatusDetails +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.payments_capture import PaymentsCapture + +payments_capture = PaymentsCapture( + status_details=CaptureStatusDetails( + reason=CaptureIncompleteReason.VERIFICATION_REQUIRED + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ), + final_capture=False, + disbursement_mode=DisbursementMode.INSTANT +) ``` diff --git a/doc/models/paypal-experience-landing-page.md b/doc/models/paypal-experience-landing-page.md index 1936c28..c62fd36 100644 --- a/doc/models/paypal-experience-landing-page.md +++ b/doc/models/paypal-experience-landing-page.md @@ -16,3 +16,11 @@ The type of landing page to show on the PayPal site for customer checkout. | `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. | +## Example + +```python +from paypalserversdk.models.paypal_experience_landing_page import PaypalExperienceLandingPage + +paypal_experience_landing_page = PaypalExperienceLandingPage.NO_PREFERENCE +``` + diff --git a/doc/models/paypal-experience-user-action.md b/doc/models/paypal-experience-user-action.md index 1923b1f..879179c 100644 --- a/doc/models/paypal-experience-user-action.md +++ b/doc/models/paypal-experience-user-action.md @@ -14,3 +14,11 @@ Configures a Continue or Pay Now checkout flow. | `CONTINUE` | After you redirect the customer to the PayPal 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 PayPal 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. | +## Example + +```python +from paypalserversdk.models.paypal_experience_user_action import PaypalExperienceUserAction + +paypal_experience_user_action = PaypalExperienceUserAction.CONTINUE +``` + diff --git a/doc/models/paypal-payment-token-customer-type.md b/doc/models/paypal-payment-token-customer-type.md index 81e62b3..dba77c2 100644 --- a/doc/models/paypal-payment-token-customer-type.md +++ b/doc/models/paypal-payment-token-customer-type.md @@ -14,3 +14,11 @@ The customer type associated with the PayPal payment token. This is to indicate | `CONSUMER` | The customer vaulting the PayPal payment token is a consumer on the merchant / platform. | | `BUSINESS` | The customer vaulting the PayPal payment token is a business on merchant / platform. | +## Example + +```python +from paypalserversdk.models.paypal_payment_token_customer_type import PaypalPaymentTokenCustomerType + +paypal_payment_token_customer_type = PaypalPaymentTokenCustomerType.CONSUMER +``` + diff --git a/doc/models/paypal-payment-token-usage-type.md b/doc/models/paypal-payment-token-usage-type.md index 0430527..7b77370 100644 --- a/doc/models/paypal-payment-token-usage-type.md +++ b/doc/models/paypal-payment-token-usage-type.md @@ -14,3 +14,11 @@ The usage type associated with the PayPal payment token., The usage type associa | `MERCHANT` | The PayPal Payment Token will be used for future transaction directly with a merchant. | | `PLATFORM` | The PayPal Payment Token will be used for future transaction on a platform. A platform is typically a marketplace or a channel that a payer can purchase goods and services from multiple merchants. | +## Example + +```python +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType + +paypal_payment_token_usage_type = PaypalPaymentTokenUsageType.MERCHANT +``` + diff --git a/doc/models/paypal-payment-token.md b/doc/models/paypal-payment-token.md index 3796819..0f4ce7d 100644 --- a/doc/models/paypal-payment-token.md +++ b/doc/models/paypal-payment-token.md @@ -25,33 +25,42 @@ Full representation of a PayPal Payment Token. | `account_id` | `str` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `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). | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description6", - "usage_pattern": "RECURRING_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token import PaypalPaymentToken +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +paypal_payment_token = PaypalPaymentToken( + description='description0', + usage_pattern=UsagePattern.RECURRING_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT +) ``` diff --git a/doc/models/paypal-reference-id-type.md b/doc/models/paypal-reference-id-type.md index dacdea4..c03ef05 100644 --- a/doc/models/paypal-reference-id-type.md +++ b/doc/models/paypal-reference-id-type.md @@ -16,3 +16,11 @@ The PayPal reference ID type. | `SUB` | A subscription ID. | | `PAP` | A pre-approved payment ID. | +## Example + +```python +from paypalserversdk.models.paypal_reference_id_type import PaypalReferenceIdType + +paypal_reference_id_type = PaypalReferenceIdType.ODR +``` + diff --git a/doc/models/paypal-wallet-account-verification-status.md b/doc/models/paypal-wallet-account-verification-status.md index fd04006..73c8b84 100644 --- a/doc/models/paypal-wallet-account-verification-status.md +++ b/doc/models/paypal-wallet-account-verification-status.md @@ -14,3 +14,11 @@ The account status indicates whether the buyer has verified the financial detail | `VERIFIED` | The buyer has completed the verification of the financial details associated with this PayPal account. For example: confirming their bank account. | | `UNVERIFIED` | The buyer has not completed the verification of the financial details associated with this PayPal account. For example: confirming their bank account. | +## Example + +```python +from paypalserversdk.models.paypal_wallet_account_verification_status import PaypalWalletAccountVerificationStatus + +paypal_wallet_account_verification_status = PaypalWalletAccountVerificationStatus.VERIFIED +``` + diff --git a/doc/models/paypal-wallet-attributes-response.md b/doc/models/paypal-wallet-attributes-response.md index 811da79..ee53d80 100644 --- a/doc/models/paypal-wallet-attributes-response.md +++ b/doc/models/paypal-wallet-attributes-response.md @@ -14,66 +14,71 @@ Additional attributes associated with the use of a PayPal Wallet. | `vault` | [`PaypalWalletVaultResponse`](../../doc/models/paypal-wallet-vault-response.md) | Optional | The details about a saved PayPal Wallet payment source. | | `cobranded_cards` | [`List[CobrandedCard]`](../../doc/models/cobranded-card.md) | Optional | An array of merchant cobranded cards used by buyer to complete an order. This array will be present if a merchant has onboarded their cobranded card with PayPal and provided corresponding label(s).

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `25` | -## Example (as JSON) +## Example -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "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" - }, - "merchant_customer_id": "merchant_customer_id2" - } - }, - "cobranded_cards": [ - { - "labels": [ - "labels4", - "labels3" - ], - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "labels": [ - "labels4", - "labels3" - ], - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } - ] -} +```python +from paypalserversdk.models.cobranded_card import CobrandedCard +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.paypal_wallet_attributes_response import PaypalWalletAttributesResponse +from paypalserversdk.models.paypal_wallet_customer import PaypalWalletCustomer +from paypalserversdk.models.paypal_wallet_vault_response import PaypalWalletVaultResponse +from paypalserversdk.models.paypal_wallet_vault_status import PaypalWalletVaultStatus +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +paypal_wallet_attributes_response = PaypalWalletAttributesResponse( + vault=PaypalWalletVaultResponse( + id='id6', + status=PaypalWalletVaultStatus.APPROVED, + customer=PaypalWalletCustomer( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id2' + ) + ), + cobranded_cards=[ + CobrandedCard( + labels=[ + 'labels4', + 'labels3' + ], + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + CobrandedCard( + labels=[ + 'labels4', + 'labels3' + ], + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] +) ``` diff --git a/doc/models/paypal-wallet-attributes.md b/doc/models/paypal-wallet-attributes.md index b9270f5..f85b9af 100644 --- a/doc/models/paypal-wallet-attributes.md +++ b/doc/models/paypal-wallet-attributes.md @@ -14,33 +14,45 @@ Additional attributes associated with the use of this PayPal Wallet. | `customer` | [`PaypalWalletCustomerRequest`](../../doc/models/paypal-wallet-customer-request.md) | Optional | - | | `vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | - | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - }, - "vault": { - "store_in_vault": "ON_SUCCESS", - "description": "description6", - "usage_pattern": "THRESHOLD_PREPAID", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.paypal_payment_token_customer_type import PaypalPaymentTokenCustomerType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.paypal_wallet_attributes import PaypalWalletAttributes +from paypalserversdk.models.paypal_wallet_customer_request import PaypalWalletCustomerRequest +from paypalserversdk.models.paypal_wallet_vault_instruction import PaypalWalletVaultInstruction +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.usage_pattern import UsagePattern + +paypal_wallet_attributes = PaypalWalletAttributes( + customer=PaypalWalletCustomerRequest( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id2' + ), + vault=PaypalWalletVaultInstruction( + usage_type=PaypalPaymentTokenUsageType.MERCHANT, + store_in_vault=StoreInVaultInstruction.ON_SUCCESS, + description='description6', + usage_pattern=UsagePattern.THRESHOLD_PREPAID, + customer_type=PaypalPaymentTokenCustomerType.CONSUMER, + permit_multiple_payment_tokens=False + ) +) ``` diff --git a/doc/models/paypal-wallet-contact-preference.md b/doc/models/paypal-wallet-contact-preference.md index 7d508a6..13d69fb 100644 --- a/doc/models/paypal-wallet-contact-preference.md +++ b/doc/models/paypal-wallet-contact-preference.md @@ -15,3 +15,11 @@ The preference to display the contact information (buyer’s shipping email & ph | `UPDATE_CONTACT_INFO` | The merchant allows buyer to add or update shipping contact information on the PayPal checkout. Please ensure to use this updated information returned in shipping.email_address and shipping.phone_number to contact your buyers. | | `RETAIN_CONTACT_INFO` | The buyer can only see but can not override merchant passed contact information (shipping.email_address and shipping.phone_number) on PayPal checkout. NOTE: If you don't pass the contact information, the behavior is the same as NO_CONTACT_INFO preference. | +## Example + +```python +from paypalserversdk.models.paypal_wallet_contact_preference import PaypalWalletContactPreference + +paypal_wallet_contact_preference = PaypalWalletContactPreference.NO_CONTACT_INFO +``` + diff --git a/doc/models/paypal-wallet-context-shipping-preference.md b/doc/models/paypal-wallet-context-shipping-preference.md index ef424af..89600ff 100644 --- a/doc/models/paypal-wallet-context-shipping-preference.md +++ b/doc/models/paypal-wallet-context-shipping-preference.md @@ -15,3 +15,11 @@ The location from which the shipping address is derived. | `NO_SHIPPING` | Removes the shipping address information from the API response and the Paypal site. However, the shipping.phone_number and shipping.email_address fields will still be returned to allow for digital goods delivery. | | `SET_PROVIDED_ADDRESS` | Get the merchant-provided address. The customer cannot change this address on the PayPal site. If merchant does not pass an address, customer can choose the address on PayPal pages. | +## Example + +```python +from paypalserversdk.models.paypal_wallet_context_shipping_preference import PaypalWalletContextShippingPreference + +paypal_wallet_context_shipping_preference = PaypalWalletContextShippingPreference.GET_FROM_FILE +``` + diff --git a/doc/models/paypal-wallet-customer-request.md b/doc/models/paypal-wallet-customer-request.md index b47fd6e..9d20ebd 100644 --- a/doc/models/paypal-wallet-customer-request.md +++ b/doc/models/paypal-wallet-customer-request.md @@ -15,23 +15,29 @@ | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `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" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id4" -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.paypal_wallet_customer_request import PaypalWalletCustomerRequest +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +paypal_wallet_customer_request = PaypalWalletCustomerRequest( + id='id8', + email_address='email_address6', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id0' +) ``` diff --git a/doc/models/paypal-wallet-customer.md b/doc/models/paypal-wallet-customer.md index 05558cd..5dd94f5 100644 --- a/doc/models/paypal-wallet-customer.md +++ b/doc/models/paypal-wallet-customer.md @@ -17,23 +17,29 @@ The details about a customer in PayPal's system of record. | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `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": "id8", - "email_address": "email_address4", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id0" -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.paypal_wallet_customer import PaypalWalletCustomer +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +paypal_wallet_customer = PaypalWalletCustomer( + id='id6', + email_address='email_address4', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id8' +) ``` diff --git a/doc/models/paypal-wallet-experience-context.md b/doc/models/paypal-wallet-experience-context.md index 256534a..1036809 100644 --- a/doc/models/paypal-wallet-experience-context.md +++ b/doc/models/paypal-wallet-experience-context.md @@ -23,18 +23,25 @@ Customizes the payer experience during the approval process for payment with Pay | `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_]+$` | | `order_update_callback_config` | [`CallbackConfiguration`](../../doc/models/callback-configuration.md) | Optional | CallBack Configuration that the merchant can provide to PayPal/Venmo. | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "contact_preference": "NO_CONTACT_INFO", - "landing_page": "NO_PREFERENCE", - "user_action": "CONTINUE", - "payment_method_preference": "UNRESTRICTED", - "brand_name": "brand_name6", - "locale": "locale0", - "return_url": "return_url8" -} +## Example + +```python +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference +from paypalserversdk.models.paypal_experience_landing_page import PaypalExperienceLandingPage +from paypalserversdk.models.paypal_experience_user_action import PaypalExperienceUserAction +from paypalserversdk.models.paypal_wallet_contact_preference import PaypalWalletContactPreference +from paypalserversdk.models.paypal_wallet_context_shipping_preference import PaypalWalletContextShippingPreference +from paypalserversdk.models.paypal_wallet_experience_context import PaypalWalletExperienceContext + +paypal_wallet_experience_context = PaypalWalletExperienceContext( + brand_name='brand_name0', + locale='locale4', + shipping_preference=PaypalWalletContextShippingPreference.GET_FROM_FILE, + contact_preference=PaypalWalletContactPreference.NO_CONTACT_INFO, + return_url='return_url2', + landing_page=PaypalExperienceLandingPage.NO_PREFERENCE, + user_action=PaypalExperienceUserAction.CONTINUE, + payment_method_preference=PayeePaymentMethodPreference.UNRESTRICTED +) ``` diff --git a/doc/models/paypal-wallet-response.md b/doc/models/paypal-wallet-response.md index 06bc055..6705c29 100644 --- a/doc/models/paypal-wallet-response.md +++ b/doc/models/paypal-wallet-response.md @@ -25,18 +25,21 @@ The PayPal Wallet response. | `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, Read-only | 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) - -```json -{ - "email_address": "email_address8", - "account_id": "account_id2", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "OTHER" -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.paypal_wallet_response import PaypalWalletResponse +from paypalserversdk.models.phone_type import PhoneType + +paypal_wallet_response = PaypalWalletResponse( + email_address='email_address2', + account_id='account_id6', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_type=PhoneType.MOBILE +) ``` diff --git a/doc/models/paypal-wallet-stored-credential.md b/doc/models/paypal-wallet-stored-credential.md index 8ab1306..e3178d9 100644 --- a/doc/models/paypal-wallet-stored-credential.md +++ b/doc/models/paypal-wallet-stored-credential.md @@ -16,14 +16,19 @@ Provides additional details to process a payment using the PayPal wallet billing | `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_]+$` | -## Example (as JSON) - -```json -{ - "payment_initiator": "CUSTOMER", - "usage": "DERIVED", - "charge_pattern": "IMMEDIATE", - "usage_pattern": "IMMEDIATE" -} +## Example + +```python +from paypalserversdk.models.payment_initiator import PaymentInitiator +from paypalserversdk.models.paypal_wallet_stored_credential import PaypalWalletStoredCredential +from paypalserversdk.models.stored_payment_source_usage_type import StoredPaymentSourceUsageType +from paypalserversdk.models.usage_pattern import UsagePattern + +paypal_wallet_stored_credential = PaypalWalletStoredCredential( + payment_initiator=PaymentInitiator.CUSTOMER, + charge_pattern=UsagePattern.UNSCHEDULED_PREPAID, + usage_pattern=UsagePattern.UNSCHEDULED_PREPAID, + usage=StoredPaymentSourceUsageType.DERIVED +) ``` diff --git a/doc/models/paypal-wallet-vault-base.md b/doc/models/paypal-wallet-vault-base.md index 1e27d86..b2ee89f 100644 --- a/doc/models/paypal-wallet-vault-base.md +++ b/doc/models/paypal-wallet-vault-base.md @@ -18,16 +18,22 @@ Resource consolidating common request and response attributes for vaulting PayPa | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with the PayPal payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Default**: `"CONSUMER"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `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` | -## Example (as JSON) - -```json -{ - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", - "description": "description0", - "usage_pattern": "RECURRING_PREPAID", - "usage_type": "MERCHANT" -} +## Example + +```python +from paypalserversdk.models.paypal_payment_token_customer_type import PaypalPaymentTokenCustomerType +from paypalserversdk.models.paypal_wallet_vault_base import PaypalWalletVaultBase +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.usage_pattern import UsagePattern +from paypalserversdk.models.usage_type import UsageType + +paypal_wallet_vault_base = PaypalWalletVaultBase( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS, + description='description2', + usage_pattern=UsagePattern.SUBSCRIPTION_PREPAID, + usage_type=UsageType.MERCHANT, + customer_type=PaypalPaymentTokenCustomerType.CONSUMER, + permit_multiple_payment_tokens=False +) ``` diff --git a/doc/models/paypal-wallet-vault-instruction.md b/doc/models/paypal-wallet-vault-instruction.md index c1e5e7c..f0265ff 100644 --- a/doc/models/paypal-wallet-vault-instruction.md +++ b/doc/models/paypal-wallet-vault-instruction.md @@ -16,16 +16,22 @@ | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with the PayPal payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Default**: `"CONSUMER"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `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` | -## Example (as JSON) - -```json -{ - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", - "description": "description4", - "usage_pattern": "UNSCHEDULED_PREPAID" -} +## Example + +```python +from paypalserversdk.models.paypal_payment_token_customer_type import PaypalPaymentTokenCustomerType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.paypal_wallet_vault_instruction import PaypalWalletVaultInstruction +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.usage_pattern import UsagePattern + +paypal_wallet_vault_instruction = PaypalWalletVaultInstruction( + usage_type=PaypalPaymentTokenUsageType.MERCHANT, + store_in_vault=StoreInVaultInstruction.ON_SUCCESS, + description='description4', + usage_pattern=UsagePattern.IMMEDIATE, + customer_type=PaypalPaymentTokenCustomerType.CONSUMER, + permit_multiple_payment_tokens=False +) ``` diff --git a/doc/models/paypal-wallet-vault-response.md b/doc/models/paypal-wallet-vault-response.md index 45a8410..60641bd 100644 --- a/doc/models/paypal-wallet-vault-response.md +++ b/doc/models/paypal-wallet-vault-response.md @@ -16,34 +16,35 @@ The details about a saved PayPal Wallet payment source. | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`PaypalWalletCustomer`](../../doc/models/paypal-wallet-customer.md) | Optional | The details about a customer in PayPal's system of record. | -## Example (as JSON) - -```json -{ - "id": "id0", - "status": "CREATED", - "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" - }, - "merchant_customer_id": "merchant_customer_id2" - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.paypal_wallet_customer import PaypalWalletCustomer +from paypalserversdk.models.paypal_wallet_vault_response import PaypalWalletVaultResponse +from paypalserversdk.models.paypal_wallet_vault_status import PaypalWalletVaultStatus +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +paypal_wallet_vault_response = PaypalWalletVaultResponse( + id='id6', + status=PaypalWalletVaultStatus.CREATED, + customer=PaypalWalletCustomer( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ), + merchant_customer_id='merchant_customer_id2' + ) +) ``` diff --git a/doc/models/paypal-wallet-vault-status.md b/doc/models/paypal-wallet-vault-status.md index a9aa363..959645b 100644 --- a/doc/models/paypal-wallet-vault-status.md +++ b/doc/models/paypal-wallet-vault-status.md @@ -15,3 +15,11 @@ The 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 | +## Example + +```python +from paypalserversdk.models.paypal_wallet_vault_status import PaypalWalletVaultStatus + +paypal_wallet_vault_status = PaypalWalletVaultStatus.APPROVED +``` + diff --git a/doc/models/paypal-wallet.md b/doc/models/paypal-wallet.md index 0575c4f..f02f8f0 100644 --- a/doc/models/paypal-wallet.md +++ b/doc/models/paypal-wallet.md @@ -23,23 +23,29 @@ A resource that identifies a PayPal Wallet is used for payment. | `billing_agreement_id` | `str` | Optional | The PayPal billing agreement ID. References an approved recurring payment for goods or services.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `128`, *Pattern*: `^[a-zA-Z0-9-]+$` | | `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. | -## Example (as JSON) - -```json -{ - "vault_id": "vault_id8", - "email_address": "email_address8", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date4" -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.paypal_wallet import PaypalWallet +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +paypal_wallet = PaypalWallet( + vault_id='vault_id6', + email_address='email_address6', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + birth_date='birth_date6' +) ``` diff --git a/doc/models/phone-number-with-country-code.md b/doc/models/phone-number-with-country-code.md index e11597d..defd2cc 100644 --- a/doc/models/phone-number-with-country-code.md +++ b/doc/models/phone-number-with-country-code.md @@ -14,12 +14,14 @@ The phone number in its canonical international [E.164 numbering plan format](ht | `country_code` | `str` | Required | 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) +## Example -```json -{ - "country_code": "country_code4", - "national_number": "national_number8" -} +```python +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode + +phone_number_with_country_code = PhoneNumberWithCountryCode( + country_code='country_code0', + national_number='national_number4' +) ``` diff --git a/doc/models/phone-number-with-optional-country-code.md b/doc/models/phone-number-with-optional-country-code.md index f6ea5fa..6c13f96 100644 --- a/doc/models/phone-number-with-optional-country-code.md +++ b/doc/models/phone-number-with-optional-country-code.md @@ -14,12 +14,14 @@ The phone number in its canonical international [E.164 numbering plan format](ht | `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) +## Example -```json -{ - "country_code": "country_code6", - "national_number": "national_number0" -} +```python +from paypalserversdk.models.phone_number_with_optional_country_code import PhoneNumberWithOptionalCountryCode + +phone_number_with_optional_country_code = PhoneNumberWithOptionalCountryCode( + national_number='national_number2', + country_code='country_code8' +) ``` diff --git a/doc/models/phone-number.md b/doc/models/phone-number.md index 1215e7b..36083f8 100644 --- a/doc/models/phone-number.md +++ b/doc/models/phone-number.md @@ -13,11 +13,13 @@ The phone number in its canonical international [E.164 numbering plan format](ht | --- | --- | --- | --- | | `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) +## Example -```json -{ - "national_number": "national_number8" -} +```python +from paypalserversdk.models.phone_number import PhoneNumber + +phone_number = PhoneNumber( + national_number='national_number6' +) ``` diff --git a/doc/models/phone-type.md b/doc/models/phone-type.md index a289eb6..7ea60f7 100644 --- a/doc/models/phone-type.md +++ b/doc/models/phone-type.md @@ -17,3 +17,11 @@ The phone type. | `OTHER` | Other phone number. | | `PAGER` | Pager number. | +## Example + +```python +from paypalserversdk.models.phone_type import PhoneType + +phone_type = PhoneType.OTHER +``` + diff --git a/doc/models/phone-with-type.md b/doc/models/phone-with-type.md index 881261e..5c593ec 100644 --- a/doc/models/phone-with-type.md +++ b/doc/models/phone-with-type.md @@ -14,14 +14,18 @@ The phone information. | `phone_type` | [`PhoneType`](../../doc/models/phone-type.md) | Optional | The phone type. | | `phone_number` | [`PhoneNumber`](../../doc/models/phone-number.md) | Required | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | -## Example (as JSON) - -```json -{ - "phone_type": "PAGER", - "phone_number": { - "national_number": "national_number6" - } -} +## Example + +```python +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType + +phone_with_type = PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.PAGER +) ``` diff --git a/doc/models/phone.md b/doc/models/phone.md index 0c8c956..5dfe17e 100644 --- a/doc/models/phone.md +++ b/doc/models/phone.md @@ -15,13 +15,15 @@ The phone number, in its canonical international [E.164 numbering plan format](h | `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}?$` | | `extension_number` | `str` | Optional | The extension number.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `15`, *Pattern*: `^[0-9]{1,15}?$` | -## Example (as JSON) - -```json -{ - "country_code": "country_code8", - "national_number": "national_number2", - "extension_number": "extension_number2" -} +## Example + +```python +from paypalserversdk.models.phone import Phone + +phone = Phone( + country_code='country_code0', + national_number='national_number4', + extension_number='extension_number0' +) ``` diff --git a/doc/models/plan-collection.md b/doc/models/plan-collection.md index f765529..c50546b 100644 --- a/doc/models/plan-collection.md +++ b/doc/models/plan-collection.md @@ -16,38 +16,30 @@ The list of plans with details. | `total_pages` | `int` | Optional | The total number of pages.

**Constraints**: `>= 0`, `<= 100000000` | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | 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" - } - ] -} +## Example + +```python +from paypalserversdk.models.billing_plan import BillingPlan +from paypalserversdk.models.plan_collection import PlanCollection +from paypalserversdk.models.subscription_plan_status import SubscriptionPlanStatus + +plan_collection = PlanCollection( + plans=[ + BillingPlan( + product_id='product_id0', + name='name4', + status=SubscriptionPlanStatus.INACTIVE, + description='description4' + ), + BillingPlan( + product_id='product_id0', + name='name4', + status=SubscriptionPlanStatus.INACTIVE, + description='description4' + ) + ], + total_items=68, + total_pages=104 +) ``` diff --git a/doc/models/plan-details.md b/doc/models/plan-details.md index 34f1612..5549b0b 100644 --- a/doc/models/plan-details.md +++ b/doc/models/plan-details.md @@ -20,157 +20,123 @@ The plan details. | `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) +## Example -```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 - } -} +```python +from paypalserversdk.models.frequency import Frequency +from paypalserversdk.models.interval_unit import IntervalUnit +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_preferences import PaymentPreferences +from paypalserversdk.models.plan_details import PlanDetails +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction +from paypalserversdk.models.subscription_billing_cycle import SubscriptionBillingCycle +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.tenure_type import TenureType + +plan_details = PlanDetails( + product_id='product_id6', + name='name0', + description='description0', + billing_cycles=[ + SubscriptionBillingCycle( + frequency=Frequency( + interval_unit=IntervalUnit.DAY, + interval_count=94 + ), + tenure_type=TenureType.REGULAR, + sequence=8, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=198 + ), + SubscriptionBillingCycle( + frequency=Frequency( + interval_unit=IntervalUnit.DAY, + interval_count=94 + ), + tenure_type=TenureType.REGULAR, + sequence=8, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=198 + ) + ], + payment_preferences=PaymentPreferences( + auto_bill_outstanding=False, + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + setup_fee_failure_action=SetupFeeFailureAction.CONTINUE, + payment_failure_threshold=104 + ), + quantity_supported=False +) ``` diff --git a/doc/models/plan-override.md b/doc/models/plan-override.md index dc5d01a..343531c 100644 --- a/doc/models/plan-override.md +++ b/doc/models/plan-override.md @@ -15,142 +15,73 @@ An inline plan object to customise the subscription. You can override plan level | `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) +## Example -```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 - } -} +```python +from paypalserversdk.models.billing_cycle_override import BillingCycleOverride +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_preferences_override import PaymentPreferencesOverride +from paypalserversdk.models.plan_override import PlanOverride +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.taxes_override import TaxesOverride + +plan_override = PlanOverride( + billing_cycles=[ + BillingCycleOverride( + sequence=8, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=198 + ) + ], + payment_preferences=PaymentPreferencesOverride( + auto_bill_outstanding=False, + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + setup_fee_failure_action=SetupFeeFailureAction.CONTINUE, + payment_failure_threshold=104 + ), + taxes=TaxesOverride( + percentage='percentage8', + inclusive=False + ) +) ``` diff --git a/doc/models/plan-request-status.md b/doc/models/plan-request-status.md index ec9a2a0..8fdc919 100644 --- a/doc/models/plan-request-status.md +++ b/doc/models/plan-request-status.md @@ -15,3 +15,11 @@ The initial state of the plan. Allowed input values are CREATED and ACTIVE. | `INACTIVE` | The plan is inactive. | | `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | +## Example + +```python +from paypalserversdk.models.plan_request_status import PlanRequestStatus + +plan_request_status = PlanRequestStatus.ACTIVE +``` + diff --git a/doc/models/plan-request.md b/doc/models/plan-request.md index 6e1e051..b69a436 100644 --- a/doc/models/plan-request.md +++ b/doc/models/plan-request.md @@ -21,78 +21,92 @@ The create plan request details. | `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) +## Example -```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 - } -} +```python +from paypalserversdk.models.frequency import Frequency +from paypalserversdk.models.interval_unit import IntervalUnit +from paypalserversdk.models.merchant_preferences import MerchantPreferences +from paypalserversdk.models.money import Money +from paypalserversdk.models.payment_preferences import PaymentPreferences +from paypalserversdk.models.plan_request import PlanRequest +from paypalserversdk.models.plan_request_status import PlanRequestStatus +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction +from paypalserversdk.models.subscription_billing_cycle import SubscriptionBillingCycle +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.taxes import Taxes +from paypalserversdk.models.tenure_type import TenureType + +plan_request = PlanRequest( + product_id='product_id8', + name='name2', + billing_cycles=[ + SubscriptionBillingCycle( + frequency=Frequency( + interval_unit=IntervalUnit.DAY, + interval_count=1 + ), + tenure_type=TenureType.REGULAR, + sequence=8, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=1 + ) + ], + payment_preferences=PaymentPreferences( + auto_bill_outstanding=True, + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + setup_fee_failure_action=SetupFeeFailureAction.CANCEL, + payment_failure_threshold=0 + ), + status=PlanRequestStatus.ACTIVE, + description='description2', + merchant_preferences=MerchantPreferences( + return_url='return_url4', + cancel_url='cancel_url6' + ), + taxes=Taxes( + percentage='percentage8', + inclusive=False + ), + quantity_supported=False +) ``` diff --git a/doc/models/plan.md b/doc/models/plan.md index 2ab62d1..ce6e3b1 100644 --- a/doc/models/plan.md +++ b/doc/models/plan.md @@ -15,56 +15,70 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. | `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() +',.:-]+$` | -## Example (as JSON) +## Example -```json -{ - "billing_cycles": [ - { - "tenure_type": "REGULAR", - "total_cycles": 1, - "sequence": 1, - "pricing_scheme": { - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "AUTO_RELOAD", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - "start_date": "start_date6" - } - ], - "one_time_charges": { - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "taxes": { - "currency_code": "currency_code6", - "value": "value2" - }, - "product_price": { - "currency_code": "currency_code6", - "value": "value2" - }, - "subtotal": { - "currency_code": "currency_code2", - "value": "value8" - }, - "total_amount": { - "currency_code": "currency_code2", - "value": "value8" - } - }, - "name": "name8" -} +```python +from paypalserversdk.models.billing_cycle import BillingCycle +from paypalserversdk.models.cycle_frequency import CycleFrequency +from paypalserversdk.models.frequency_interval_unit import FrequencyIntervalUnit +from paypalserversdk.models.money import Money +from paypalserversdk.models.one_time_charge import OneTimeCharge +from paypalserversdk.models.plan import Plan +from paypalserversdk.models.pricing_model import PricingModel +from paypalserversdk.models.pricing_scheme import PricingScheme +from paypalserversdk.models.tenure_type import TenureType + +plan = Plan( + billing_cycles=[ + BillingCycle( + tenure_type=TenureType.REGULAR, + pricing_scheme=PricingScheme( + pricing_model=PricingModel.AUTO_RELOAD, + price=Money( + currency_code='currency_code8', + value='value4' + ), + reload_threshold_amount=Money( + currency_code='currency_code0', + value='value6' + ) + ), + total_cycles=1, + sequence=1, + start_date='start_date6', + frequency=CycleFrequency( + interval_unit=FrequencyIntervalUnit.LIFETIME, + interval_count=94 + ) + ) + ], + one_time_charges=OneTimeCharge( + total_amount=Money( + currency_code='currency_code2', + value='value8' + ), + setup_fee=Money( + currency_code='currency_code8', + value='value4' + ), + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + taxes=Money( + currency_code='currency_code6', + value='value2' + ), + product_price=Money( + currency_code='currency_code6', + value='value2' + ), + subtotal=Money( + currency_code='currency_code2', + value='value8' + ) + ), + name='name4' +) ``` diff --git a/doc/models/platform-fee.md b/doc/models/platform-fee.md index 7c684f5..600b40c 100644 --- a/doc/models/platform-fee.md +++ b/doc/models/platform-fee.md @@ -14,18 +14,22 @@ The platform or partner fee, commission, or brokerage fee that is associated wit | `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -## Example (as JSON) - -```json -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.platform_fee import PlatformFee + +platform_fee = PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) +) ``` diff --git a/doc/models/pricing-model.md b/doc/models/pricing-model.md index 71f612e..1df9e55 100644 --- a/doc/models/pricing-model.md +++ b/doc/models/pricing-model.md @@ -15,3 +15,11 @@ The pricing model for the billing cycle. | `VARIABLE` | A variable pricing scheme where the customer is charged a variable amount. | | `AUTO_RELOAD` | A auto-reload pricing scheme where the customer is charged a fixed amount for reload. | +## Example + +```python +from paypalserversdk.models.pricing_model import PricingModel + +pricing_model = PricingModel.AUTO_RELOAD +``` + diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 7754c0a..94784ac 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -15,19 +15,23 @@ The pricing scheme details. | `pricing_model` | [`PricingModel`](../../doc/models/pricing-model.md) | Required | The pricing model for the billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `reload_threshold_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 -{ - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "FIXED", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_model import PricingModel +from paypalserversdk.models.pricing_scheme import PricingScheme + +pricing_scheme = PricingScheme( + pricing_model=PricingModel.AUTO_RELOAD, + price=Money( + currency_code='currency_code8', + value='value4' + ), + reload_threshold_amount=Money( + currency_code='currency_code0', + value='value6' + ) +) ``` diff --git a/doc/models/pricing-tier.md b/doc/models/pricing-tier.md index a3d9e5c..b9c8180 100644 --- a/doc/models/pricing-tier.md +++ b/doc/models/pricing-tier.md @@ -15,16 +15,19 @@ The pricing tier details. | `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" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier + +pricing_tier = PricingTier( + starting_quantity='starting_quantity0', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity2' +) ``` diff --git a/doc/models/processing-instruction.md b/doc/models/processing-instruction.md index 5a53086..be67e28 100644 --- a/doc/models/processing-instruction.md +++ b/doc/models/processing-instruction.md @@ -13,3 +13,11 @@ The instruction to process an order. | --- | --- | | `ORDER_COMPLETE_ON_PAYMENT_APPROVAL` | API Caller expects the Order to be auto completed (i.e. for PayPal to authorize or capture depending on the intent) on completion of payer approval. This option is not relevant for payment_source that typically do not require a payer approval or interaction. This option is currently only available for the following payment_source: Alipay, BANCOMAT Pay, Bancontact, BLIK, boletobancario, eps, giropay, GrabPay, iDEAL, MB WAY Multibanco, MyBank, OXXO, P24, PayU, PUI, SafetyPay, SatisPay, Swish, Sofort, Trustly, Verkkopankki, WeChat Pay | +## Example + +```python +from paypalserversdk.models.processing_instruction import ProcessingInstruction + +processing_instruction = ProcessingInstruction.ORDER_COMPLETE_ON_PAYMENT_APPROVAL +``` + diff --git a/doc/models/processor-response-code.md b/doc/models/processor-response-code.md index 99709b0..3424be4 100644 --- a/doc/models/processor-response-code.md +++ b/doc/models/processor-response-code.md @@ -166,3 +166,11 @@ Processor response code for the non-PayPal payment processor errors. | `RESPONSE_PPVE` | VALIDATION_ERROR. | | `RESPONSE_PPVT` | VIRTUAL_TERMINAL_UNSUPPORTED. | +## Example + +```python +from paypalserversdk.models.processor_response_code import ProcessorResponseCode + +processor_response_code = ProcessorResponseCode.RESPONSE_PPCO +``` + diff --git a/doc/models/processor-response.md b/doc/models/processor-response.md index b1a6327..420dd1d 100644 --- a/doc/models/processor-response.md +++ b/doc/models/processor-response.md @@ -16,14 +16,11 @@ The processor response information for payment requests, such as direct credit c | `response_code` | [`ProcessorResponseCode`](../../doc/models/processor-response-code.md) | Optional, Read-only | Processor response code for the non-PayPal payment processor errors. | | `payment_advice_code` | [`PaymentAdviceCode`](../../doc/models/payment-advice-code.md) | Optional, Read-only | 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": "M", - "cvv_code": "U", - "response_code": "PPII", - "payment_advice_code": "03" -} +## Example + +```python +from paypalserversdk.models.processor_response import ProcessorResponse + +processor_response = ProcessorResponse() ``` diff --git a/doc/models/purchase-unit-request.md b/doc/models/purchase-unit-request.md index 7fa83e1..ca128e8 100644 --- a/doc/models/purchase-unit-request.md +++ b/doc/models/purchase-unit-request.md @@ -23,80 +23,89 @@ The purchase unit request. Includes required information for the payment contrac | `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. | -## Example (as JSON) +## Example -```json -{ - "reference_id": "reference_id6", - "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" -} +```python +from paypalserversdk.models.amount_breakdown import AmountBreakdown +from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.payment_instruction import PaymentInstruction +from paypalserversdk.models.platform_fee import PlatformFee +from paypalserversdk.models.purchase_unit_request import PurchaseUnitRequest + +purchase_unit_request = PurchaseUnitRequest( + amount=AmountWithBreakdown( + currency_code='currency_code6', + value='value0', + breakdown=AmountBreakdown( + item_total=Money( + currency_code='currency_code0', + value='value6' + ), + shipping=Money( + currency_code='currency_code0', + value='value6' + ), + handling=Money( + currency_code='currency_code2', + value='value8' + ), + tax_total=Money( + currency_code='currency_code4', + value='value0' + ), + insurance=Money( + currency_code='currency_code2', + value='value8' + ) + ) + ), + reference_id='reference_id4', + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ), + payment_instruction=PaymentInstruction( + platform_fees=[ + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ) + ], + disbursement_mode=DisbursementMode.INSTANT, + payee_pricing_tier_id='payee_pricing_tier_id2', + payee_receivable_fx_rate_id='payee_receivable_fx_rate_id0' + ), + description='description2', + custom_id='custom_id6' +) ``` diff --git a/doc/models/purchase-unit.md b/doc/models/purchase-unit.md index 8f4939c..3c4e94f 100644 --- a/doc/models/purchase-unit.md +++ b/doc/models/purchase-unit.md @@ -26,79 +26,88 @@ The purchase unit details. Used to capture required information for the payment | `payments` | [`PaymentCollection`](../../doc/models/payment-collection.md) | Optional | The collection of payments, or transactions, for a purchase unit in an order. For example, authorized payments, captured payments, and refunds. | | `most_recent_errors` | `List[Any]` | Optional | The error reason code and description that are the reason for the most recent order decline.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) +## Example -```json -{ - "reference_id": "reference_id8", - "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": "description0" -} +```python +from paypalserversdk.models.amount_breakdown import AmountBreakdown +from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown +from paypalserversdk.models.disbursement_mode import DisbursementMode +from paypalserversdk.models.money import Money +from paypalserversdk.models.payee_base import PayeeBase +from paypalserversdk.models.payment_instruction import PaymentInstruction +from paypalserversdk.models.platform_fee import PlatformFee +from paypalserversdk.models.purchase_unit import PurchaseUnit + +purchase_unit = PurchaseUnit( + reference_id='reference_id8', + amount=AmountWithBreakdown( + currency_code='currency_code6', + value='value0', + breakdown=AmountBreakdown( + item_total=Money( + currency_code='currency_code0', + value='value6' + ), + shipping=Money( + currency_code='currency_code0', + value='value6' + ), + handling=Money( + currency_code='currency_code2', + value='value8' + ), + tax_total=Money( + currency_code='currency_code4', + value='value0' + ), + insurance=Money( + currency_code='currency_code2', + value='value8' + ) + ) + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ), + payment_instruction=PaymentInstruction( + platform_fees=[ + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ), + PlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + payee=PayeeBase( + email_address='email_address4', + merchant_id='merchant_id6' + ) + ) + ], + disbursement_mode=DisbursementMode.INSTANT, + payee_pricing_tier_id='payee_pricing_tier_id2', + payee_receivable_fx_rate_id='payee_receivable_fx_rate_id0' + ), + description='description0' +) ``` diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md index 008a6e1..d176d14 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -20,3 +20,11 @@ The reason code for the payment failure. | `TRANSACTION_RECEIVING_LIMIT_EXCEEDED` | The transaction exceeds the receiver's receiving limit. | | `CURRENCY_MISMATCH` | The transaction is declined due to a currency mismatch. | +## Example + +```python +from paypalserversdk.models.reason_code import ReasonCode + +reason_code = ReasonCode.PAYMENT_DENIED +``` + diff --git a/doc/models/reauthorize-request.md b/doc/models/reauthorize-request.md index 5c1ccaf..ac44bb8 100644 --- a/doc/models/reauthorize-request.md +++ b/doc/models/reauthorize-request.md @@ -13,14 +13,17 @@ Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds a | --- | --- | --- | --- | | `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 -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.reauthorize_request import ReauthorizeRequest + +reauthorize_request = ReauthorizeRequest( + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/refund-incomplete-reason.md b/doc/models/refund-incomplete-reason.md index 16791cd..d6bf088 100644 --- a/doc/models/refund-incomplete-reason.md +++ b/doc/models/refund-incomplete-reason.md @@ -13,3 +13,11 @@ The reason why the refund has the `PENDING` or `FAILED` status. | --- | --- | | `ECHECK` | The customer's account is funded through an eCheck, which has not yet cleared. | +## Example + +```python +from paypalserversdk.models.refund_incomplete_reason import RefundIncompleteReason + +refund_incomplete_reason = RefundIncompleteReason.ECHECK +``` + diff --git a/doc/models/refund-payment-instruction.md b/doc/models/refund-payment-instruction.md index 437ee65..3354a65 100644 --- a/doc/models/refund-payment-instruction.md +++ b/doc/models/refund-payment-instruction.md @@ -13,24 +13,34 @@ Any additional payments instructions during refund payment processing. This obje | --- | --- | --- | --- | | `platform_fees` | [`List[RefundPlatformFee]`](../../doc/models/refund-platform-fee.md) | Optional | Specifies the amount that the API caller will contribute to the refund being processed. The amount needs to be lower than platform_fees amount originally captured or the amount that is remaining if multiple refunds have been processed. This field is only applicable to merchants that have been enabled for PayPal Commerce Platform for Marketplaces and Platforms capability. Please speak to your account manager if you want to use this capability.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | -## Example (as JSON) - -```json -{ - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } - ] -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.refund_payment_instruction import RefundPaymentInstruction +from paypalserversdk.models.refund_platform_fee import RefundPlatformFee + +refund_payment_instruction = RefundPaymentInstruction( + platform_fees=[ + RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] +) ``` diff --git a/doc/models/refund-platform-fee.md b/doc/models/refund-platform-fee.md index 9922f31..2cec1b9 100644 --- a/doc/models/refund-platform-fee.md +++ b/doc/models/refund-platform-fee.md @@ -13,14 +13,17 @@ The platform or partner fee, commission, or brokerage fee that is associated wit | --- | --- | --- | --- | | `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 -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.refund_platform_fee import RefundPlatformFee + +refund_platform_fee = RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/refund-request.md b/doc/models/refund-request.md index fb98e7f..2a73744 100644 --- a/doc/models/refund-request.md +++ b/doc/models/refund-request.md @@ -17,39 +17,44 @@ Refunds a captured payment, by ID. For a full refund, include an empty request b | `note_to_payer` | `str` | Optional | The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^.*$` | | `payment_instruction` | [`RefundPaymentInstruction`](../../doc/models/refund-payment-instruction.md) | Optional | Any additional payments instructions during refund payment processing. This object is only applicable to merchants that have been enabled for PayPal Commerce Platform for Marketplaces and Platforms capability. Please speak to your account manager if you want to use this capability. | -## Example (as JSON) - -```json -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "custom_id": "custom_id6", - "invoice_id": "invoice_id8", - "note_to_payer": "note_to_payer0", - "payment_instruction": { - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } - ] - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.refund_payment_instruction import RefundPaymentInstruction +from paypalserversdk.models.refund_platform_fee import RefundPlatformFee +from paypalserversdk.models.refund_request import RefundRequest + +refund_request = RefundRequest( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + custom_id='custom_id8', + invoice_id='invoice_id0', + note_to_payer='note_to_payer2', + payment_instruction=RefundPaymentInstruction( + platform_fees=[ + RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ), + RefundPlatformFee( + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ) +) ``` diff --git a/doc/models/refund-status-details.md b/doc/models/refund-status-details.md index 0b639f8..89fcae6 100644 --- a/doc/models/refund-status-details.md +++ b/doc/models/refund-status-details.md @@ -13,11 +13,14 @@ The details of the refund status. | --- | --- | --- | --- | | `reason` | [`RefundIncompleteReason`](../../doc/models/refund-incomplete-reason.md) | Optional | The reason why the refund has the `PENDING` or `FAILED` status. | -## Example (as JSON) +## Example -```json -{ - "reason": "ECHECK" -} +```python +from paypalserversdk.models.refund_incomplete_reason import RefundIncompleteReason +from paypalserversdk.models.refund_status_details import RefundStatusDetails + +refund_status_details = RefundStatusDetails( + reason=RefundIncompleteReason.ECHECK +) ``` diff --git a/doc/models/refund-status-with-details.md b/doc/models/refund-status-with-details.md index a96dedf..c40f0c0 100644 --- a/doc/models/refund-status-with-details.md +++ b/doc/models/refund-status-with-details.md @@ -14,14 +14,17 @@ The refund status with details. | `status` | [`RefundStatus`](../../doc/models/refund-status.md) | Optional, Read-only | The status of the refund. | | `status_details` | [`RefundStatusDetails`](../../doc/models/refund-status-details.md) | Optional | The details of the refund status. | -## Example (as JSON) - -```json -{ - "status": "PENDING", - "status_details": { - "reason": "ECHECK" - } -} +## Example + +```python +from paypalserversdk.models.refund_incomplete_reason import RefundIncompleteReason +from paypalserversdk.models.refund_status_details import RefundStatusDetails +from paypalserversdk.models.refund_status_with_details import RefundStatusWithDetails + +refund_status_with_details = RefundStatusWithDetails( + status_details=RefundStatusDetails( + reason=RefundIncompleteReason.ECHECK + ) +) ``` diff --git a/doc/models/refund-status.md b/doc/models/refund-status.md index 591842d..8da8467 100644 --- a/doc/models/refund-status.md +++ b/doc/models/refund-status.md @@ -16,3 +16,11 @@ The status of the refund. | `PENDING` | The refund is pending. For more information, see status_details.reason. | | `COMPLETED` | The funds for this transaction were debited to the customer's account. | +## Example + +```python +from paypalserversdk.models.refund_status import RefundStatus + +refund_status = RefundStatus.CANCELLED +``` + diff --git a/doc/models/refund.md b/doc/models/refund.md index f7d7172..ca3b462 100644 --- a/doc/models/refund.md +++ b/doc/models/refund.md @@ -25,20 +25,22 @@ The refund information. | `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 -{ - "status": "CANCELLED", - "status_details": { - "reason": "ECHECK" - }, - "id": "id6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id6" -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.refund import Refund +from paypalserversdk.models.refund_incomplete_reason import RefundIncompleteReason +from paypalserversdk.models.refund_status_details import RefundStatusDetails + +refund = Refund( + status_details=RefundStatusDetails( + reason=RefundIncompleteReason.ECHECK + ), + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/related-identifiers.md b/doc/models/related-identifiers.md index ac64f76..6268caa 100644 --- a/doc/models/related-identifiers.md +++ b/doc/models/related-identifiers.md @@ -15,13 +15,15 @@ Identifiers related to a specific resource. | `authorization_id` | `str` | Optional | Authorization ID related to the resource.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[A-Z0-9]+$` | | `capture_id` | `str` | Optional | Capture ID related to the resource.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[A-Z0-9]+$` | -## Example (as JSON) - -```json -{ - "order_id": "order_id0", - "authorization_id": "authorization_id8", - "capture_id": "capture_id8" -} +## Example + +```python +from paypalserversdk.models.related_identifiers import RelatedIdentifiers + +related_identifiers = RelatedIdentifiers( + order_id='order_id4', + authorization_id='authorization_id8', + capture_id='capture_id2' +) ``` diff --git a/doc/models/return-flow.md b/doc/models/return-flow.md index f717f6c..9752d17 100644 --- a/doc/models/return-flow.md +++ b/doc/models/return-flow.md @@ -14,3 +14,11 @@ Merchant preference on how the buyer can navigate back to merchant website post | `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. | +## Example + +```python +from paypalserversdk.models.return_flow import ReturnFlow + +return_flow = ReturnFlow.AUTO +``` + diff --git a/doc/models/risk-supplementary-data.md b/doc/models/risk-supplementary-data.md index 0b397c9..b47101e 100644 --- a/doc/models/risk-supplementary-data.md +++ b/doc/models/risk-supplementary-data.md @@ -13,13 +13,16 @@ Additional information necessary to evaluate the risk profile of a transaction. | --- | --- | --- | --- | | `customer` | [`ParticipantMetadata`](../../doc/models/participant-metadata.md) | Optional | Profile information of the sender or receiver. | -## Example (as JSON) - -```json -{ - "customer": { - "ip_address": "ip_address0" - } -} +## Example + +```python +from paypalserversdk.models.participant_metadata import ParticipantMetadata +from paypalserversdk.models.risk_supplementary_data import RiskSupplementaryData + +risk_supplementary_data = RiskSupplementaryData( + customer=ParticipantMetadata( + ip_address='ip_address0' + ) +) ``` diff --git a/doc/models/search-error-exception.md b/doc/models/search-error-exception.md index fa3ce86..52c339d 100644 --- a/doc/models/search-error-exception.md +++ b/doc/models/search-error-exception.md @@ -20,32 +20,14 @@ The error details. | `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 -} +## Example + +```python +try: + # make the API call +except SearchErrorException as e: + print(e) +except ApiException as e: + print(e) ``` diff --git a/doc/models/search-response.md b/doc/models/search-response.md index 46c44c8..9908b4e 100644 --- a/doc/models/search-response.md +++ b/doc/models/search-response.md @@ -21,208 +21,91 @@ The search response information. | `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, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | -## Example (as JSON) +## Example -```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" -} +```python +from paypalserversdk.models.cart_information import CartInformation +from paypalserversdk.models.item_details import ItemDetails +from paypalserversdk.models.payer_information import PayerInformation +from paypalserversdk.models.paypal_reference_id_type import PaypalReferenceIdType +from paypalserversdk.models.phone import Phone +from paypalserversdk.models.search_response import SearchResponse +from paypalserversdk.models.shipping_information import ShippingInformation +from paypalserversdk.models.simple_postal_address_coarse_grained import SimplePostalAddressCoarseGrained +from paypalserversdk.models.store_information import StoreInformation +from paypalserversdk.models.transaction_details import TransactionDetails +from paypalserversdk.models.transaction_information import TransactionInformation + +search_response = SearchResponse( + transaction_details=[ + TransactionDetails( + transaction_info=TransactionInformation( + paypal_account_id='paypal_account_id4', + paypal_reference_id='paypal_reference_id2', + paypal_reference_id_type=PaypalReferenceIdType.ODR, + transaction_event_code='transaction_event_code6' + ), + payer_info=PayerInformation( + account_id='account_id2', + email_address='email_address2', + phone_number=Phone( + country_code='country_code2', + national_number='national_number6', + extension_number='extension_number8' + ), + address_status='address_status2', + payer_status='payer_status2' + ), + shipping_info=ShippingInformation( + name='name0', + method='method4', + address=SimplePostalAddressCoarseGrained( + line_1='line18', + city='city6', + country_code='country_code6', + line_2='line20', + state='state2', + postal_code='postal_code8' + ), + secondary_shipping_address=SimplePostalAddressCoarseGrained( + line_1='line16', + city='city4', + country_code='country_code4', + line_2='line28', + state='state0', + postal_code='postal_code6' + ) + ), + cart_info=CartInformation( + item_details=[ + ItemDetails( + item_code='item_code0', + item_name='item_name8', + item_description='item_description4', + item_options='item_options2', + item_quantity='item_quantity2' + ), + ItemDetails( + 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=StoreInformation( + store_id='store_id2', + terminal_id='terminal_id6' + ) + ) + ], + account_number='account_number8', + start_date='start_date4', + end_date='end_date8', + last_refreshed_datetime='last_refreshed_datetime2' +) ``` diff --git a/doc/models/seller-payable-breakdown.md b/doc/models/seller-payable-breakdown.md index 5bea356..661e190 100644 --- a/doc/models/seller-payable-breakdown.md +++ b/doc/models/seller-payable-breakdown.md @@ -20,30 +20,33 @@ The breakdown of the refund. | `net_amount_breakdown` | [`List[NetAmountBreakdownItem]`](../../doc/models/net-amount-breakdown-item.md) | Optional, Read-only | An array of breakdown values for the net amount. Returned when the currency of the refund is different from the currency of the PayPal account where the payee holds their funds. | | `total_refunded_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" - }, - "paypal_fee": { - "currency_code": "currency_code4", - "value": "value2" - }, - "paypal_fee_in_receivable_currency": { - "currency_code": "currency_code2", - "value": "value8" - }, - "net_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "net_amount_in_receivable_currency": { - "currency_code": "currency_code8", - "value": "value4" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.seller_payable_breakdown import SellerPayableBreakdown + +seller_payable_breakdown = SellerPayableBreakdown( + gross_amount=Money( + currency_code='currency_code4', + value='value0' + ), + paypal_fee=Money( + currency_code='currency_code4', + value='value2' + ), + paypal_fee_in_receivable_currency=Money( + currency_code='currency_code2', + value='value8' + ), + net_amount=Money( + currency_code='currency_code6', + value='value2' + ), + net_amount_in_receivable_currency=Money( + currency_code='currency_code8', + value='value4' + ) +) ``` diff --git a/doc/models/seller-protection-status.md b/doc/models/seller-protection-status.md index 5a09327..d70289b 100644 --- a/doc/models/seller-protection-status.md +++ b/doc/models/seller-protection-status.md @@ -15,3 +15,11 @@ Indicates whether the transaction is eligible for seller protection. For informa | `PARTIALLY_ELIGIBLE` | Your PayPal balance remains intact if the customer claims that they did not receive an item. | | `NOT_ELIGIBLE` | This transaction is not eligible for seller protection. | +## Example + +```python +from paypalserversdk.models.seller_protection_status import SellerProtectionStatus + +seller_protection_status = SellerProtectionStatus.PARTIALLY_ELIGIBLE +``` + diff --git a/doc/models/seller-protection.md b/doc/models/seller-protection.md index 1b33c44..2074e14 100644 --- a/doc/models/seller-protection.md +++ b/doc/models/seller-protection.md @@ -14,14 +14,11 @@ The level of protection offered as defined by [PayPal Seller Protection for Merc | `status` | [`SellerProtectionStatus`](../../doc/models/seller-protection-status.md) | Optional, Read-only | Indicates whether the transaction is eligible for seller protection. For information, see [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `dispute_categories` | [`List[DisputeCategory]`](../../doc/models/dispute-category.md) | Optional, Read-only | An array of conditions that are covered for the transaction. | -## Example (as JSON) - -```json -{ - "status": "NOT_ELIGIBLE", - "dispute_categories": [ - "ITEM_NOT_RECEIVED" - ] -} +## Example + +```python +from paypalserversdk.models.seller_protection import SellerProtection + +seller_protection = SellerProtection() ``` diff --git a/doc/models/seller-receivable-breakdown.md b/doc/models/seller-receivable-breakdown.md index 4e69a86..cce9009 100644 --- a/doc/models/seller-receivable-breakdown.md +++ b/doc/models/seller-receivable-breakdown.md @@ -19,35 +19,33 @@ The detailed breakdown of the capture activity. This is not available for transa | `exchange_rate` | [`ExchangeRate`](../../doc/models/exchange-rate.md) | Optional, Read-only | The exchange rate that determines the amount to convert from one currency to another currency. | | `platform_fees` | [`List[PlatformFee]`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees that associated with the captured payment.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | -## Example (as JSON) - -```json -{ - "gross_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "paypal_fee": { - "currency_code": "currency_code4", - "value": "value2" - }, - "paypal_fee_in_receivable_currency": { - "currency_code": "currency_code2", - "value": "value8" - }, - "net_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "receivable_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "exchange_rate": { - "source_currency": "source_currency4", - "target_currency": "target_currency6", - "value": "value6" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.seller_receivable_breakdown import SellerReceivableBreakdown + +seller_receivable_breakdown = SellerReceivableBreakdown( + gross_amount=Money( + currency_code='currency_code4', + value='value0' + ), + paypal_fee=Money( + currency_code='currency_code4', + value='value2' + ), + paypal_fee_in_receivable_currency=Money( + currency_code='currency_code2', + value='value8' + ), + net_amount=Money( + currency_code='currency_code6', + value='value2' + ), + receivable_amount=Money( + currency_code='currency_code2', + value='value8' + ) +) ``` diff --git a/doc/models/sepa-debit-experience-context.md b/doc/models/sepa-debit-experience-context.md index 720392f..401c70f 100644 --- a/doc/models/sepa-debit-experience-context.md +++ b/doc/models/sepa-debit-experience-context.md @@ -15,13 +15,15 @@ Customizes the payer experience during the approval process for the SEPA Debit p | `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" -} +## Example + +```python +from paypalserversdk.models.sepa_debit_experience_context import SepaDebitExperienceContext + +sepa_debit_experience_context = SepaDebitExperienceContext( + return_url='return_url6', + cancel_url='cancel_url8', + locale='locale8' +) ``` diff --git a/doc/models/sepa-debit-request.md b/doc/models/sepa-debit-request.md index 74109fa..d4d8ee9 100644 --- a/doc/models/sepa-debit-request.md +++ b/doc/models/sepa-debit-request.md @@ -13,15 +13,18 @@ An API resource denoting a request to securely store a SEPA Debit. | --- | --- | --- | --- | | `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" - } -} +## Example + +```python +from paypalserversdk.models.sepa_debit_experience_context import SepaDebitExperienceContext +from paypalserversdk.models.sepa_debit_request import SepaDebitRequest + +sepa_debit_request = SepaDebitRequest( + experience_context=SepaDebitExperienceContext( + return_url='return_url4', + cancel_url='cancel_url6', + locale='locale6' + ) +) ``` diff --git a/doc/models/setup-fee-failure-action.md b/doc/models/setup-fee-failure-action.md index 714e6e7..da86fef 100644 --- a/doc/models/setup-fee-failure-action.md +++ b/doc/models/setup-fee-failure-action.md @@ -14,3 +14,11 @@ The action to take on the subscription if the initial payment for the setup fail | `CONTINUE` | Continues the subscription if the initial payment for the setup fails. | | `CANCEL` | Cancels the subscription if the initial payment for the setup fails. | +## Example + +```python +from paypalserversdk.models.setup_fee_failure_action import SetupFeeFailureAction + +setup_fee_failure_action = SetupFeeFailureAction.CONTINUE +``` + diff --git a/doc/models/setup-token-request-card.md b/doc/models/setup-token-request-card.md index 96a0ecf..46a5cce 100644 --- a/doc/models/setup-token-request-card.md +++ b/doc/models/setup-token-request-card.md @@ -20,15 +20,18 @@ A Resource representing a request to vault a Card. | `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` | [`VaultCardExperienceContext`](../../doc/models/vault-card-experience-context.md) | Optional | A resource representing an experience context of vault a card. | -## Example (as JSON) - -```json -{ - "name": "name2", - "number": "number0", - "expiry": "expiry0", - "security_code": "security_code4", - "brand": "STAR" -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.setup_token_request_card import SetupTokenRequestCard + +setup_token_request_card = SetupTokenRequestCard( + name='name2', + number='number0', + expiry='expiry0', + security_code='security_code4', + brand=CardBrand.STAR +) ``` diff --git a/doc/models/setup-token-request-payment-source.md b/doc/models/setup-token-request-payment-source.md index c08c413..4a96963 100644 --- a/doc/models/setup-token-request-payment-source.md +++ b/doc/models/setup-token-request-payment-source.md @@ -18,86 +18,104 @@ The payment method to vault with the instrument details. | `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) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "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" - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_request_card import ApplePayRequestCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.setup_token_request_card import SetupTokenRequestCard +from paypalserversdk.models.setup_token_request_payment_source import SetupTokenRequestPaymentSource +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +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_token_request_type import VaultTokenRequestType +from paypalserversdk.models.vault_venmo_request import VaultVenmoRequest +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +setup_token_request_payment_source = SetupTokenRequestPaymentSource( + card=SetupTokenRequestCard( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + brand=CardBrand.CB_NATIONALE + ), + paypal=VaultPaypalWalletRequest( + description='description2', + usage_pattern=UsagePattern.THRESHOLD_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT + ), + venmo=VaultVenmoRequest( + description='description6', + usage_pattern=UsagePattern.UNSCHEDULED_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT + ), + apple_pay=VaultApplePayRequest( + token='token6', + card=ApplePayRequestCard( + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ), + token=VaultTokenRequest( + id='id6', + mtype=VaultTokenRequestType.SETUP_TOKEN + ) +) ``` diff --git a/doc/models/setup-token-request.md b/doc/models/setup-token-request.md index af4a46e..2222aae 100644 --- a/doc/models/setup-token-request.md +++ b/doc/models/setup-token-request.md @@ -14,92 +14,112 @@ Setup Token Request where the `source` defines the type of instrument to be stor | `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. | | `payment_source` | [`SetupTokenRequestPaymentSource`](../../doc/models/setup-token-request-payment-source.md) | Required | The payment method to vault with the instrument details. | -## Example (as JSON) +## Example -```json -{ - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "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" - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_request_card import ApplePayRequestCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.customer import Customer +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.setup_token_request import SetupTokenRequest +from paypalserversdk.models.setup_token_request_card import SetupTokenRequestCard +from paypalserversdk.models.setup_token_request_payment_source import SetupTokenRequestPaymentSource +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +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_token_request_type import VaultTokenRequestType +from paypalserversdk.models.vault_venmo_request import VaultVenmoRequest +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +setup_token_request = SetupTokenRequest( + payment_source=SetupTokenRequestPaymentSource( + card=SetupTokenRequestCard( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + brand=CardBrand.CB_NATIONALE + ), + paypal=VaultPaypalWalletRequest( + description='description2', + usage_pattern=UsagePattern.THRESHOLD_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT + ), + venmo=VaultVenmoRequest( + description='description6', + usage_pattern=UsagePattern.UNSCHEDULED_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT + ), + apple_pay=VaultApplePayRequest( + token='token6', + card=ApplePayRequestCard( + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) + ), + token=VaultTokenRequest( + id='id6', + mtype=VaultTokenRequestType.SETUP_TOKEN + ) + ), + customer=Customer( + id='id0', + merchant_customer_id='merchant_customer_id2' + ) +) ``` diff --git a/doc/models/setup-token-response-card.md b/doc/models/setup-token-response-card.md index 8479a78..eb3ef79 100644 --- a/doc/models/setup-token-response-card.md +++ b/doc/models/setup-token-response-card.md @@ -21,22 +21,25 @@ | `bin_details` | [`BinDetails`](../../doc/models/bin-details.md) | Optional | Bank Identification Number (BIN) details used to fund a payment. | | `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_]+$` | -## Example (as JSON) - -```json -{ - "name": "name8", - "last_digits": "last_digits2", - "brand": "DISCOVER", - "expiry": "expiry6", - "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" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response_address import CardResponseAddress +from paypalserversdk.models.setup_token_response_card import SetupTokenResponseCard + +setup_token_response_card = SetupTokenResponseCard( + name='name8', + brand=CardBrand.DISCOVER, + expiry='expiry6', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) +) ``` diff --git a/doc/models/setup-token-response-payment-source.md b/doc/models/setup-token-response-payment-source.md index 34c9dfd..140e07c 100644 --- a/doc/models/setup-token-response-payment-source.md +++ b/doc/models/setup-token-response-payment-source.md @@ -15,74 +15,28 @@ The setup payment method details. | `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional, Read-only | Full representation of a PayPal Payment Token. | | `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional, Read-only | Full representation of a Venmo Payment Token. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "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" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response_address import CardResponseAddress +from paypalserversdk.models.setup_token_response_card import SetupTokenResponseCard +from paypalserversdk.models.setup_token_response_payment_source import SetupTokenResponsePaymentSource + +setup_token_response_payment_source = SetupTokenResponsePaymentSource( + card=SetupTokenResponseCard( + name='name6', + brand=CardBrand.CB_NATIONALE, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) + ) +) ``` diff --git a/doc/models/setup-token-response.md b/doc/models/setup-token-response.md index d37c76c..9f06f81 100644 --- a/doc/models/setup-token-response.md +++ b/doc/models/setup-token-response.md @@ -17,89 +17,39 @@ Minimal representation of a cached setup token. | `payment_source` | [`SetupTokenResponsePaymentSource`](../../doc/models/setup-token-response-payment-source.md) | Optional | The setup payment method details. | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | -## Example (as JSON) - -```json -{ - "status": "CREATED", - "id": "id6", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "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" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_response_address import CardResponseAddress +from paypalserversdk.models.customer import Customer +from paypalserversdk.models.payment_token_status import PaymentTokenStatus +from paypalserversdk.models.setup_token_response import SetupTokenResponse +from paypalserversdk.models.setup_token_response_card import SetupTokenResponseCard +from paypalserversdk.models.setup_token_response_payment_source import SetupTokenResponsePaymentSource + +setup_token_response = SetupTokenResponse( + id='id0', + customer=Customer( + id='id0', + merchant_customer_id='merchant_customer_id2' + ), + status=PaymentTokenStatus.CREATED, + payment_source=SetupTokenResponsePaymentSource( + card=SetupTokenResponseCard( + name='name6', + brand=CardBrand.CB_NATIONALE, + expiry='expiry4', + billing_address=CardResponseAddress( + country_code='country_code8', + 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' + ) + ) + ) +) ``` diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md index db4cdcb..c85a9fd 100644 --- a/doc/models/shipment-carrier.md +++ b/doc/models/shipment-carrier.md @@ -1425,3 +1425,11 @@ The carrier for the shipment. Some carriers have a global version as well as loc | `TOPTRANS` | Toptrans. | | `OTHER` | Other. | +## Example + +```python +from paypalserversdk.models.shipment_carrier import ShipmentCarrier + +shipment_carrier = ShipmentCarrier.GBA +``` + diff --git a/doc/models/shipping-details.md b/doc/models/shipping-details.md index 2ccdeaf..1c60d2c 100644 --- a/doc/models/shipping-details.md +++ b/doc/models/shipping-details.md @@ -18,51 +18,39 @@ The shipping details. | `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). | -## Example (as JSON) - -```json -{ - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "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 - }, - { - "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 - } - ] -} +## Example + +```python +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.money import Money +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType + +shipping_details = ShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + options=[ + ShippingOption( + id='id2', + label='label2', + selected=False, + mtype=ShippingType.SHIPPING, + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] +) ``` diff --git a/doc/models/shipping-information.md b/doc/models/shipping-information.md index 6e0ea83..48bdf7f 100644 --- a/doc/models/shipping-information.md +++ b/doc/models/shipping-information.md @@ -16,28 +16,31 @@ The shipping information. | `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" - } -} +## Example + +```python +from paypalserversdk.models.shipping_information import ShippingInformation +from paypalserversdk.models.simple_postal_address_coarse_grained import SimplePostalAddressCoarseGrained + +shipping_information = ShippingInformation( + name='name4', + method='method8', + address=SimplePostalAddressCoarseGrained( + line_1='line18', + city='city6', + country_code='country_code6', + line_2='line20', + state='state2', + postal_code='postal_code8' + ), + secondary_shipping_address=SimplePostalAddressCoarseGrained( + line_1='line16', + city='city4', + country_code='country_code4', + line_2='line28', + state='state0', + postal_code='postal_code6' + ) +) ``` diff --git a/doc/models/shipping-name.md b/doc/models/shipping-name.md index 1090834..cee1c81 100644 --- a/doc/models/shipping-name.md +++ b/doc/models/shipping-name.md @@ -13,11 +13,13 @@ The name of the party. | --- | --- | --- | --- | | `full_name` | `str` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | -## Example (as JSON) +## Example -```json -{ - "full_name": "full_name6" -} +```python +from paypalserversdk.models.shipping_name import ShippingName + +shipping_name = ShippingName( + full_name='full_name6' +) ``` diff --git a/doc/models/shipping-option.md b/doc/models/shipping-option.md index 3c5b1b1..469459c 100644 --- a/doc/models/shipping-option.md +++ b/doc/models/shipping-option.md @@ -17,18 +17,22 @@ The options that the payee or merchant offers to the payer to ship or pick up th | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `selected` | `bool` | Required | If the API request sets `selected = true`, it represents the shipping option that the payee or merchant expects to be pre-selected for the payer when they first view the `shipping.options` in the PayPal Checkout experience. As part of the response if a `shipping.option` contains `selected=true`, it represents the shipping option that the payer selected during the course of checkout with PayPal. Only one `shipping.option` can be set to `selected=true`. | -## Example (as JSON) - -```json -{ - "id": "id4", - "label": "label4", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType + +shipping_option = ShippingOption( + id='id4', + label='label4', + selected=False, + mtype=ShippingType.PICKUP_IN_STORE, + amount=Money( + currency_code='currency_code6', + value='value0' + ) +) ``` diff --git a/doc/models/shipping-type.md b/doc/models/shipping-type.md index 5ce3cac..021354e 100644 --- a/doc/models/shipping-type.md +++ b/doc/models/shipping-type.md @@ -16,3 +16,11 @@ A classification for the method of purchase fulfillment. | `PICKUP_IN_STORE` | The payer intends to pick up the item(s) from the payee's physical store. Also termed as BOPIS, "Buy Online, Pick-up in Store". Seller protection is provided with this option. | | `PICKUP_FROM_PERSON` | The payer intends to pick up the item(s) from the payee in person. Also termed as BOPIP, "Buy Online, Pick-up in Person". Seller protection is not available, since the payer is receiving the item from the payee in person, and can validate the item prior to payment. | +## Example + +```python +from paypalserversdk.models.shipping_type import ShippingType + +shipping_type = ShippingType.PICKUP_IN_STORE +``` + diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md index 3d6adab..53fe2c7 100644 --- a/doc/models/shipping-with-tracking-details.md +++ b/doc/models/shipping-with-tracking-details.md @@ -17,73 +17,68 @@ | `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). | -## Example (as JSON) +## Example -```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" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING" -} +```python +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.order_tracker_item import OrderTrackerItem +from paypalserversdk.models.order_tracker_response import OrderTrackerResponse +from paypalserversdk.models.order_tracker_status import OrderTrackerStatus +from paypalserversdk.models.phone_number_with_optional_country_code import PhoneNumberWithOptionalCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_with_tracking_details import ShippingWithTrackingDetails + +shipping_with_tracking_details = ShippingWithTrackingDetails( + trackers=[ + OrderTrackerResponse( + status=OrderTrackerStatus.CANCELLED, + items=[ + OrderTrackerItem( + name='name8', + quantity='quantity4', + sku='sku6', + url='url2', + image_url='image_url4' + ) + ], + create_time='create_time8' + ), + OrderTrackerResponse( + status=OrderTrackerStatus.CANCELLED, + items=[ + OrderTrackerItem( + name='name8', + quantity='quantity4', + sku='sku6', + url='url2', + image_url='image_url4' + ) + ], + create_time='create_time8' + ), + OrderTrackerResponse( + status=OrderTrackerStatus.CANCELLED, + items=[ + OrderTrackerItem( + name='name8', + quantity='quantity4', + sku='sku6', + url='url2', + image_url='image_url4' + ) + ], + create_time='create_time8' + ) + ], + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address8', + phone_number=PhoneNumberWithOptionalCountryCode( + national_number='national_number6', + country_code='country_code2' + ), + mtype=FulfillmentType.SHIPPING +) ``` diff --git a/doc/models/simple-postal-address-coarse-grained.md b/doc/models/simple-postal-address-coarse-grained.md index 475237b..748d5c7 100644 --- a/doc/models/simple-postal-address-coarse-grained.md +++ b/doc/models/simple-postal-address-coarse-grained.md @@ -18,16 +18,18 @@ A simple postal address with coarse-grained fields. Do not use for an internatio | `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" -} +## Example + +```python +from paypalserversdk.models.simple_postal_address_coarse_grained import SimplePostalAddressCoarseGrained + +simple_postal_address_coarse_grained = SimplePostalAddressCoarseGrained( + line_1='line12', + city='city0', + country_code='country_code0', + line_2='line24', + state='state6', + postal_code='postal_code2' +) ``` diff --git a/doc/models/sofort-payment-object.md b/doc/models/sofort-payment-object.md index 5e7c6f9..1bb3eb5 100644 --- a/doc/models/sofort-payment-object.md +++ b/doc/models/sofort-payment-object.md @@ -16,14 +16,16 @@ Information used to pay using Sofort. | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | | `iban_last_chars` | `str` | Optional | The last characters of the IBAN used to pay.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `34`, *Pattern*: `[a-zA-Z0-9]{4}` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code6", - "bic": "bic8", - "iban_last_chars": "iban_last_chars4" -} +## Example + +```python +from paypalserversdk.models.sofort_payment_object import SofortPaymentObject + +sofort_payment_object = SofortPaymentObject( + name='name6', + country_code='country_code6', + bic='bic8', + iban_last_chars='iban_last_chars4' +) ``` diff --git a/doc/models/sofort-payment-request.md b/doc/models/sofort-payment-request.md index 353f6eb..7462751 100644 --- a/doc/models/sofort-payment-request.md +++ b/doc/models/sofort-payment-request.md @@ -15,19 +15,23 @@ Information needed to pay using Sofort. | `country_code` | `str` | Required | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name4", - "country_code": "country_code4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.sofort_payment_request import SofortPaymentRequest + +sofort_payment_request = SofortPaymentRequest( + name='name4', + country_code='country_code4', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/standard-entry-class-code.md b/doc/models/standard-entry-class-code.md index a27f248..a91a5e2 100644 --- a/doc/models/standard-entry-class-code.md +++ b/doc/models/standard-entry-class-code.md @@ -16,3 +16,11 @@ NACHA (the regulatory body governing the ACH network) requires that API callers | `CCD` | Cash concentration and disbursement for corporate debit transaction. Used to disburse or consolidate funds. Entries are usually Optional high-dollar, low-volume, and time-critical. (e.g. intra-company transfers or invoice payments to suppliers). | | `PPD` | Prearranged payment and deposit entries. Used for debit payments authorized by a consumer account holder, and usually initiated by a company. These are usually recurring debits (such as insurance premiums). | +## Example + +```python +from paypalserversdk.models.standard_entry_class_code import StandardEntryClassCode + +standard_entry_class_code = StandardEntryClassCode.TEL +``` + diff --git a/doc/models/store-in-vault-instruction.md b/doc/models/store-in-vault-instruction.md index e1a0ee1..c07ddd7 100644 --- a/doc/models/store-in-vault-instruction.md +++ b/doc/models/store-in-vault-instruction.md @@ -13,3 +13,11 @@ Defines how and when the payment source gets vaulted. | --- | --- | | `ON_SUCCESS` | Defines that the payment_source will be vaulted only when at least one authorization or capture using that payment_source is successful. | +## Example + +```python +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction + +store_in_vault_instruction = StoreInVaultInstruction.ON_SUCCESS +``` + diff --git a/doc/models/store-information.md b/doc/models/store-information.md index c6d417d..1443085 100644 --- a/doc/models/store-information.md +++ b/doc/models/store-information.md @@ -14,12 +14,14 @@ The store information. | `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) +## Example -```json -{ - "store_id": "store_id6", - "terminal_id": "terminal_id0" -} +```python +from paypalserversdk.models.store_information import StoreInformation + +store_information = StoreInformation( + store_id='store_id6', + terminal_id='terminal_id0' +) ``` diff --git a/doc/models/stored-payment-source-payment-type.md b/doc/models/stored-payment-source-payment-type.md index c173a12..0a1e167 100644 --- a/doc/models/stored-payment-source-payment-type.md +++ b/doc/models/stored-payment-source-payment-type.md @@ -15,3 +15,11 @@ Indicates the type of the stored payment_source payment. | `RECURRING` | Payment which is part of a series of payments with fixed or variable amounts, following a fixed time interval. (e.g. Subscription payments). | | `UNSCHEDULED` | Payment which is part of a series of payments that occur on a non-fixed schedule and/or have variable amounts. (e.g. Account Topup payments). | +## Example + +```python +from paypalserversdk.models.stored_payment_source_payment_type import StoredPaymentSourcePaymentType + +stored_payment_source_payment_type = StoredPaymentSourcePaymentType.RECURRING +``` + diff --git a/doc/models/stored-payment-source-usage-type.md b/doc/models/stored-payment-source-usage-type.md index fd25db6..436dcd2 100644 --- a/doc/models/stored-payment-source-usage-type.md +++ b/doc/models/stored-payment-source-usage-type.md @@ -15,3 +15,11 @@ Indicates if this is a `first` or `subsequent` payment using a stored payment so | `SUBSEQUENT` | Indicates a payment using a stored payment_source which has been successfully used previously for a payment. | | `DERIVED` | Indicates that PayPal will derive the value of `FIRST` or `SUBSEQUENT` based on data available to PayPal. | +## Example + +```python +from paypalserversdk.models.stored_payment_source_usage_type import StoredPaymentSourceUsageType + +stored_payment_source_usage_type = StoredPaymentSourceUsageType.SUBSEQUENT +``` + diff --git a/doc/models/stored-payment-source.md b/doc/models/stored-payment-source.md index 8afddf1..dae4297 100644 --- a/doc/models/stored-payment-source.md +++ b/doc/models/stored-payment-source.md @@ -16,19 +16,26 @@ Provides additional details to process a payment using a `payment_source` that h | `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` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | -## Example (as JSON) - -```json -{ - "payment_initiator": "CUSTOMER", - "payment_type": "RECURRING", - "usage": "DERIVED", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } -} +## Example + +```python +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.network_transaction import NetworkTransaction +from paypalserversdk.models.payment_initiator import PaymentInitiator +from paypalserversdk.models.stored_payment_source import StoredPaymentSource +from paypalserversdk.models.stored_payment_source_payment_type import StoredPaymentSourcePaymentType +from paypalserversdk.models.stored_payment_source_usage_type import StoredPaymentSourceUsageType + +stored_payment_source = StoredPaymentSource( + payment_initiator=PaymentInitiator.CUSTOMER, + payment_type=StoredPaymentSourcePaymentType.RECURRING, + usage=StoredPaymentSourceUsageType.DERIVED, + previous_network_transaction_reference=NetworkTransaction( + id='id6', + date='date2', + network=CardBrand.CONFIDIS, + acquirer_reference_number='acquirer_reference_number8' + ) +) ``` diff --git a/doc/models/subscriber-request.md b/doc/models/subscriber-request.md index 078f673..bde8c05 100644 --- a/doc/models/subscriber-request.md +++ b/doc/models/subscriber-request.md @@ -18,48 +18,61 @@ The subscriber request information . | `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. | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address0", - "payer_id": "payer_id0", - "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", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "type": "UNKNOWN" - } - } -} +```python +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType +from paypalserversdk.models.subscriber_request import SubscriberRequest +from paypalserversdk.models.subscription_card_request import SubscriptionCardRequest +from paypalserversdk.models.subscription_payment_source import SubscriptionPaymentSource + +subscriber_request = SubscriberRequest( + email_address='email_address6', + payer_id='payer_id6', + name=Name( + given_name='given_name2', + surname='surname8' + ), + shipping_address=ShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address8', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.PICKUP_IN_STORE, + options=[ + ShippingOption( + id='id2', + label='label2', + selected=False, + mtype=ShippingType.SHIPPING, + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ), + payment_source=SubscriptionPaymentSource( + card=SubscriptionCardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + mtype=CardType.UNKNOWN + ) + ) +) ``` diff --git a/doc/models/subscriber.md b/doc/models/subscriber.md index 35004f2..563134e 100644 --- a/doc/models/subscriber.md +++ b/doc/models/subscriber.md @@ -17,54 +17,67 @@ The subscriber response information. | `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) +## Example -```json -{ - "email_address": "email_address2", - "payer_id": "payer_id2", - "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" - } - } -} +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_response_with_billing_address import CardResponseWithBillingAddress +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.money import Money +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_details import ShippingDetails +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.shipping_option import ShippingOption +from paypalserversdk.models.shipping_type import ShippingType +from paypalserversdk.models.subscriber import Subscriber +from paypalserversdk.models.subscription_payment_source_response import SubscriptionPaymentSourceResponse + +subscriber = Subscriber( + email_address='email_address8', + payer_id='payer_id8', + name=Name( + given_name='given_name2', + surname='surname8' + ), + shipping_address=ShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address8', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.PICKUP_IN_STORE, + options=[ + ShippingOption( + id='id2', + label='label2', + selected=False, + mtype=ShippingType.SHIPPING, + amount=Money( + currency_code='currency_code6', + value='value0' + ) + ) + ] + ), + payment_source=SubscriptionPaymentSourceResponse( + card=CardResponseWithBillingAddress( + name='name6', + billing_address=Address( + country_code='country_code8', + 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' + ), + expiry='expiry4', + currency_code='currency_code2' + ) + ) +) ``` diff --git a/doc/models/subscription-amount-with-breakdown.md b/doc/models/subscription-amount-with-breakdown.md index 0447f8e..2f6235b 100644 --- a/doc/models/subscription-amount-with-breakdown.md +++ b/doc/models/subscription-amount-with-breakdown.md @@ -18,34 +18,37 @@ The breakdown details for the amount. Includes the gross, tax, fee, and shipping | `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" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.subscription_amount_with_breakdown import SubscriptionAmountWithBreakdown + +subscription_amount_with_breakdown = SubscriptionAmountWithBreakdown( + gross_amount=Money( + currency_code='currency_code4', + value='value0' + ), + total_item_amount=Money( + currency_code='currency_code8', + value='value4' + ), + fee_amount=Money( + currency_code='currency_code2', + value='value4' + ), + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + tax_amount=Money( + currency_code='currency_code2', + value='value8' + ), + net_amount=Money( + currency_code='currency_code6', + value='value2' + ) +) ``` diff --git a/doc/models/subscription-application-context.md b/doc/models/subscription-application-context.md index 8e6ed33..e051b9a 100644 --- a/doc/models/subscription-application-context.md +++ b/doc/models/subscription-application-context.md @@ -19,19 +19,25 @@ The application context, which customizes the payer experience during the subscr | `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" - } -} +## Example + +```python +from paypalserversdk.models.application_context_user_action import ApplicationContextUserAction +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference +from paypalserversdk.models.payment_method import PaymentMethod +from paypalserversdk.models.subscription_application_context import SubscriptionApplicationContext + +subscription_application_context = SubscriptionApplicationContext( + return_url='return_url4', + cancel_url='cancel_url6', + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.GET_FROM_FILE, + user_action=ApplicationContextUserAction.SUBSCRIBE_NOW, + payment_method=PaymentMethod( + payee_preferred=PayeePaymentMethodPreference.UNRESTRICTED + ) +) ``` diff --git a/doc/models/subscription-billing-cycle.md b/doc/models/subscription-billing-cycle.md index 2d5a5b1..210dacc 100644 --- a/doc/models/subscription-billing-cycle.md +++ b/doc/models/subscription-billing-cycle.md @@ -17,52 +17,60 @@ The billing cycle 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).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | -## Example (as JSON) +## Example -```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" - } -} +```python +from paypalserversdk.models.frequency import Frequency +from paypalserversdk.models.interval_unit import IntervalUnit +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.subscription_billing_cycle import SubscriptionBillingCycle +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.tenure_type import TenureType + +subscription_billing_cycle = SubscriptionBillingCycle( + frequency=Frequency( + interval_unit=IntervalUnit.DAY, + interval_count=1 + ), + tenure_type=TenureType.REGULAR, + sequence=30, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ), + total_cycles=1 +) ``` diff --git a/doc/models/subscription-billing-information.md b/doc/models/subscription-billing-information.md index 84ef8fd..6bc7f00 100644 --- a/doc/models/subscription-billing-information.md +++ b/doc/models/subscription-billing-information.md @@ -19,51 +19,37 @@ The billing details for the subscription. If the subscription was or is active, | `failed_payments_count` | `int` | Required, Read-only | 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" - } -} +## Example + +```python +from paypalserversdk.models.failed_payment_details import FailedPaymentDetails +from paypalserversdk.models.last_payment_details import LastPaymentDetails +from paypalserversdk.models.money import Money +from paypalserversdk.models.subscription_billing_information import SubscriptionBillingInformation + +subscription_billing_information = SubscriptionBillingInformation( + outstanding_balance=Money( + currency_code='currency_code8', + value='value4' + ), + failed_payments_count=None, + last_payment=LastPaymentDetails( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + time='time2' + ), + next_billing_time='next_billing_time2', + final_payment_time='final_payment_time6', + last_failed_payment=FailedPaymentDetails( + amount=Money( + currency_code='currency_code6', + value='value0' + ), + time='time4', + next_payment_retry_time='next_payment_retry_time6' + ) +) ``` diff --git a/doc/models/subscription-card-request.md b/doc/models/subscription-card-request.md index 2bd6121..ed76fc2 100644 --- a/doc/models/subscription-card-request.md +++ b/doc/models/subscription-card-request.md @@ -20,15 +20,18 @@ The payment card to use to fund a payment. Can be a credit or debit card. | `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" -} +## Example + +```python +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.subscription_card_request import SubscriptionCardRequest + +subscription_card_request = SubscriptionCardRequest( + name='name2', + number='number0', + expiry='expiry0', + security_code='security_code4', + mtype=CardType.STORE +) ``` diff --git a/doc/models/subscription-collection.md b/doc/models/subscription-collection.md index 5e02718..be928e2 100644 --- a/doc/models/subscription-collection.md +++ b/doc/models/subscription-collection.md @@ -14,39 +14,25 @@ The list of subscriptions. | `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, Read-only | 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" - } - ] -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.subscription import Subscription +from paypalserversdk.models.subscription_collection import SubscriptionCollection + +subscription_collection = SubscriptionCollection( + subscriptions=[ + Subscription( + plan_id='plan_id8', + start_time='start_time0', + quantity='quantity2', + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ) + ) + ] +) ``` diff --git a/doc/models/subscription-customer-information.md b/doc/models/subscription-customer-information.md index 4622645..e58e646 100644 --- a/doc/models/subscription-customer-information.md +++ b/doc/models/subscription-customer-information.md @@ -15,18 +15,23 @@ The details about a customer in PayPal's system of record. | `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" - } - } -} +## Example + +```python +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.subscription_customer_information import SubscriptionCustomerInformation + +subscription_customer_information = SubscriptionCustomerInformation( + id='id2', + email_address='email_address0', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ) +) ``` diff --git a/doc/models/subscription-error-exception.md b/doc/models/subscription-error-exception.md index 81f0c76..1a938de 100644 --- a/doc/models/subscription-error-exception.md +++ b/doc/models/subscription-error-exception.md @@ -18,90 +18,14 @@ The error details. | `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, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/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" - } - ] -} +## Example + +```python +try: + # make the API call +except SubscriptionErrorException as e: + print(e) +except ApiException as e: + print(e) ``` diff --git a/doc/models/subscription-patch-application-context.md b/doc/models/subscription-patch-application-context.md index a520684..cff26f7 100644 --- a/doc/models/subscription-patch-application-context.md +++ b/doc/models/subscription-patch-application-context.md @@ -18,18 +18,23 @@ The application context, which customizes the payer experience during the subscr | `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" - } -} +## Example + +```python +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.payee_payment_method_preference import PayeePaymentMethodPreference +from paypalserversdk.models.payment_method import PaymentMethod +from paypalserversdk.models.subscription_patch_application_context import SubscriptionPatchApplicationContext + +subscription_patch_application_context = SubscriptionPatchApplicationContext( + return_url='return_url6', + cancel_url='cancel_url6', + brand_name='brand_name8', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.GET_FROM_FILE, + payment_method=PaymentMethod( + payee_preferred=PayeePaymentMethodPreference.UNRESTRICTED + ) +) ``` diff --git a/doc/models/subscription-payer-name.md b/doc/models/subscription-payer-name.md index d60cc61..a3597e9 100644 --- a/doc/models/subscription-payer-name.md +++ b/doc/models/subscription-payer-name.md @@ -18,15 +18,17 @@ The name of the party. | `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" -} +## Example + +```python +from paypalserversdk.models.subscription_payer_name import SubscriptionPayerName + +subscription_payer_name = SubscriptionPayerName( + prefix='prefix4', + given_name='given_name8', + surname='surname2', + middle_name='middle_name6', + suffix='suffix6' +) ``` diff --git a/doc/models/subscription-payer.md b/doc/models/subscription-payer.md index e0c61c4..9e8e073 100644 --- a/doc/models/subscription-payer.md +++ b/doc/models/subscription-payer.md @@ -15,16 +15,19 @@ The customer who approves and pays for the order. The customer is also known as | `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. | -## Example (as JSON) - -```json -{ - "email_address": "email_address4", - "payer_id": "payer_id4", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.subscription_payer import SubscriptionPayer + +subscription_payer = SubscriptionPayer( + email_address='email_address6', + payer_id='payer_id4', + name=Name( + given_name='given_name2', + surname='surname8' + ) +) ``` diff --git a/doc/models/subscription-payment-source-response.md b/doc/models/subscription-payment-source-response.md index 6c72045..7223cdb 100644 --- a/doc/models/subscription-payment-source-response.md +++ b/doc/models/subscription-payment-source-response.md @@ -13,23 +13,27 @@ The payment source used to fund the payment. | --- | --- | --- | --- | | `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" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_response_with_billing_address import CardResponseWithBillingAddress +from paypalserversdk.models.subscription_payment_source_response import SubscriptionPaymentSourceResponse + +subscription_payment_source_response = SubscriptionPaymentSourceResponse( + card=CardResponseWithBillingAddress( + name='name6', + billing_address=Address( + country_code='country_code8', + 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' + ), + expiry='expiry4', + currency_code='currency_code2' + ) +) ``` diff --git a/doc/models/subscription-payment-source.md b/doc/models/subscription-payment-source.md index 7a8781c..57e0013 100644 --- a/doc/models/subscription-payment-source.md +++ b/doc/models/subscription-payment-source.md @@ -13,17 +13,21 @@ The payment source definition. To be eligible to create subscription using debit | --- | --- | --- | --- | | `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" - } -} +## Example + +```python +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.subscription_card_request import SubscriptionCardRequest +from paypalserversdk.models.subscription_payment_source import SubscriptionPaymentSource + +subscription_payment_source = SubscriptionPaymentSource( + card=SubscriptionCardRequest( + name='name6', + number='number6', + expiry='expiry4', + security_code='security_code8', + mtype=CardType.UNKNOWN + ) +) ``` diff --git a/doc/models/subscription-plan-status.md b/doc/models/subscription-plan-status.md index 2f4e757..e83d683 100644 --- a/doc/models/subscription-plan-status.md +++ b/doc/models/subscription-plan-status.md @@ -15,3 +15,11 @@ The plan status. | `INACTIVE` | The plan is inactive. | | `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | +## Example + +```python +from paypalserversdk.models.subscription_plan_status import SubscriptionPlanStatus + +subscription_plan_status = SubscriptionPlanStatus.INACTIVE +``` + diff --git a/doc/models/subscription-pricing-model.md b/doc/models/subscription-pricing-model.md index a76c322..17eb2dd 100644 --- a/doc/models/subscription-pricing-model.md +++ b/doc/models/subscription-pricing-model.md @@ -14,3 +14,11 @@ The pricing model for tiered plan. The `tiers` parameter is required. | `VOLUME` | A volume pricing model. | | `TIERED` | A tiered pricing model. | +## Example + +```python +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel + +subscription_pricing_model = SubscriptionPricingModel.VOLUME +``` + diff --git a/doc/models/subscription-pricing-scheme.md b/doc/models/subscription-pricing-scheme.md index 107a447..8b24a42 100644 --- a/doc/models/subscription-pricing-scheme.md +++ b/doc/models/subscription-pricing-scheme.md @@ -18,43 +18,47 @@ The pricing scheme details. | `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" -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme + +subscription_pricing_scheme = SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' +) ``` diff --git a/doc/models/subscription-status.md b/doc/models/subscription-status.md new file mode 100644 index 0000000..cb1df7d --- /dev/null +++ b/doc/models/subscription-status.md @@ -0,0 +1,28 @@ + +# Subscription Status + +The status of the subscription. + +## Enumeration + +`SubscriptionStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `APPROVAL_PENDING` | The subscription is created but not yet approved by the buyer. | +| `APPROVED` | The buyer has approved the subscription. | +| `ACTIVE` | The subscription is active. | +| `SUSPENDED` | The subscription is suspended. | +| `CANCELLED` | The subscription is cancelled. | +| `EXPIRED` | The subscription is expired. | + +## Example + +```python +from paypalserversdk.models.subscription_status import SubscriptionStatus + +subscription_status = SubscriptionStatus.ACTIVE +``` + diff --git a/doc/models/subscription-transaction-details.md b/doc/models/subscription-transaction-details.md index b770f1b..5ff5fd8 100644 --- a/doc/models/subscription-transaction-details.md +++ b/doc/models/subscription-transaction-details.md @@ -18,47 +18,51 @@ The transaction details. | `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) +## Example -```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" -} +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.subscription_amount_with_breakdown import SubscriptionAmountWithBreakdown +from paypalserversdk.models.subscription_payer_name import SubscriptionPayerName +from paypalserversdk.models.subscription_transaction_details import SubscriptionTransactionDetails + +subscription_transaction_details = SubscriptionTransactionDetails( + id=None, + amount_with_breakdown=SubscriptionAmountWithBreakdown( + gross_amount=Money( + currency_code='currency_code4', + value='value0' + ), + total_item_amount=Money( + currency_code='currency_code8', + value='value4' + ), + fee_amount=Money( + currency_code='currency_code2', + value='value4' + ), + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + tax_amount=Money( + currency_code='currency_code2', + value='value8' + ), + net_amount=Money( + currency_code='currency_code6', + value='value2' + ) + ), + time='time0', + payer_name=SubscriptionPayerName( + prefix='prefix8', + given_name='given_name2', + surname='surname8', + middle_name='middle_name0', + suffix='suffix0' + ), + payer_email='payer_email8' +) ``` diff --git a/doc/models/subscription.md b/doc/models/subscription.md index 260d705..9e2bc99 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -24,19 +24,24 @@ The subscription details. | `plan_overridden` | `bool` | Optional, Read-only | 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, Read-only | 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" - } -} +| `status` | [`SubscriptionStatus`](../../doc/models/subscription-status.md) | Optional | The status of the subscription. | +| `status_change_note` | `str` | Optional | The reason or notes for the status of the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | +| `status_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 + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.subscription import Subscription + +subscription = Subscription( + plan_id='plan_id6', + start_time='start_time8', + quantity='quantity0', + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ) +) ``` diff --git a/doc/models/subscriptions-card-attributes.md b/doc/models/subscriptions-card-attributes.md index 078ac81..3e50ec4 100644 --- a/doc/models/subscriptions-card-attributes.md +++ b/doc/models/subscriptions-card-attributes.md @@ -15,27 +15,37 @@ Additional attributes associated with the use of this card. | `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" - } -} +## Example + +```python +from paypalserversdk.models.card_customer import CardCustomer +from paypalserversdk.models.card_verification import CardVerification +from paypalserversdk.models.orders_card_verification_method import OrdersCardVerificationMethod +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.subscriptions_card_attributes import SubscriptionsCardAttributes +from paypalserversdk.models.vault_instruction_base import VaultInstructionBase + +subscriptions_card_attributes = SubscriptionsCardAttributes( + customer=CardCustomer( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + merchant_customer_id='merchant_customer_id2' + ), + vault=VaultInstructionBase( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS + ), + verification=CardVerification( + method=OrdersCardVerificationMethod.ENUM_3D_SECURE + ) +) ``` diff --git a/doc/models/subscriptions-card-brand.md b/doc/models/subscriptions-card-brand.md index 2289cd9..be53992 100644 --- a/doc/models/subscriptions-card-brand.md +++ b/doc/models/subscriptions-card-brand.md @@ -37,3 +37,11 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `EFTPOS` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | | `UNKNOWN` | UNKNOWN payment network. | +## Example + +```python +from paypalserversdk.models.subscriptions_card_brand import SubscriptionsCardBrand + +subscriptions_card_brand = SubscriptionsCardBrand.STAR +``` + diff --git a/doc/models/supplementary-data.md b/doc/models/supplementary-data.md index d4cfa6f..f6e8b94 100644 --- a/doc/models/supplementary-data.md +++ b/doc/models/supplementary-data.md @@ -14,47 +14,56 @@ Supplementary data about a payment. This object passes information that can be u | `card` | [`CardSupplementaryData`](../../doc/models/card-supplementary-data.md) | Optional | 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. | | `risk` | [`RiskSupplementaryData`](../../doc/models/risk-supplementary-data.md) | Optional | Additional information necessary to evaluate the risk profile of a transaction. | -## Example (as JSON) - -```json -{ - "card": { - "level_2": { - "invoice_id": "invoice_id4", - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - } - }, - "level_3": { - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "duty_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "discount_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "shipping_address": { - "address_line_1": "address_line_10", - "address_line_2": "address_line_20", - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "ships_from_postal_code": "ships_from_postal_code4" - } - }, - "risk": { - "customer": { - "ip_address": "ip_address0" - } - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.card_supplementary_data import CardSupplementaryData +from paypalserversdk.models.level_2_card_processing_data import Level2CardProcessingData +from paypalserversdk.models.level_3_card_processing_data import Level3CardProcessingData +from paypalserversdk.models.money import Money +from paypalserversdk.models.participant_metadata import ParticipantMetadata +from paypalserversdk.models.risk_supplementary_data import RiskSupplementaryData +from paypalserversdk.models.supplementary_data import SupplementaryData + +supplementary_data = SupplementaryData( + card=CardSupplementaryData( + level_2=Level2CardProcessingData( + invoice_id='invoice_id4', + tax_total=Money( + currency_code='currency_code4', + value='value0' + ) + ), + level_3=Level3CardProcessingData( + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + duty_amount=Money( + currency_code='currency_code6', + value='value2' + ), + discount_amount=Money( + currency_code='currency_code2', + value='value8' + ), + shipping_address=Address( + country_code='country_code0', + address_line_1='address_line_10', + address_line_2='address_line_20', + admin_area_2='admin_area_24', + admin_area_1='admin_area_16', + postal_code='postal_code2' + ), + ships_from_postal_code='ships_from_postal_code4' + ) + ), + risk=RiskSupplementaryData( + customer=ParticipantMetadata( + ip_address='ip_address0' + ) + ) +) ``` diff --git a/doc/models/suspend-subscription.md b/doc/models/suspend-subscription.md index 24ca867..14a816d 100644 --- a/doc/models/suspend-subscription.md +++ b/doc/models/suspend-subscription.md @@ -13,11 +13,13 @@ The suspend subscription request details. | --- | --- | --- | --- | | `reason` | `str` | Required | The reason for suspension of the Subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason4" -} +```python +from paypalserversdk.models.suspend_subscription import SuspendSubscription + +suspend_subscription = SuspendSubscription( + reason='reason2' +) ``` diff --git a/doc/models/tax-amount.md b/doc/models/tax-amount.md index d6a7f82..bd03a70 100644 --- a/doc/models/tax-amount.md +++ b/doc/models/tax-amount.md @@ -13,14 +13,17 @@ The tax levied by a government on the purchase of goods or services. | --- | --- | --- | --- | | `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" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.tax_amount import TaxAmount + +tax_amount = TaxAmount( + tax_amount=Money( + currency_code='currency_code2', + value='value8' + ) +) ``` diff --git a/doc/models/tax-id-type.md b/doc/models/tax-id-type.md index 0a5ac02..8053534 100644 --- a/doc/models/tax-id-type.md +++ b/doc/models/tax-id-type.md @@ -14,3 +14,11 @@ The customer's tax ID type. | `BR_CPF` | The individual tax ID type, typically is 11 characters long. | | `BR_CNPJ` | The business tax ID type, typically is 14 characters long. | +## Example + +```python +from paypalserversdk.models.tax_id_type import TaxIdType + +tax_id_type = TaxIdType.BR_CPF +``` + diff --git a/doc/models/tax-info.md b/doc/models/tax-info.md index 8eb742b..ff3fd8e 100644 --- a/doc/models/tax-info.md +++ b/doc/models/tax-info.md @@ -14,12 +14,15 @@ The tax ID of the customer. The customer is also known as the payer. Both `tax_i | `tax_id` | `str` | Required | The customer's tax ID value.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `([a-zA-Z0-9])` | | `tax_id_type` | [`TaxIdType`](../../doc/models/tax-id-type.md) | Required | The customer's tax ID type.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[A-Z0-9_]+$` | -## Example (as JSON) +## Example -```json -{ - "tax_id": "tax_id0", - "tax_id_type": "BR_CPF" -} +```python +from paypalserversdk.models.tax_id_type import TaxIdType +from paypalserversdk.models.tax_info import TaxInfo + +tax_info = TaxInfo( + tax_id='tax_id4', + tax_id_type=TaxIdType.BR_CPF +) ``` diff --git a/doc/models/taxes-override.md b/doc/models/taxes-override.md index 4e72238..809022d 100644 --- a/doc/models/taxes-override.md +++ b/doc/models/taxes-override.md @@ -14,12 +14,14 @@ The tax details. | `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) +## Example -```json -{ - "percentage": "percentage8", - "inclusive": false -} +```python +from paypalserversdk.models.taxes_override import TaxesOverride + +taxes_override = TaxesOverride( + percentage='percentage2', + inclusive=False +) ``` diff --git a/doc/models/taxes.md b/doc/models/taxes.md index 2dd81c1..c2f91d0 100644 --- a/doc/models/taxes.md +++ b/doc/models/taxes.md @@ -14,12 +14,14 @@ The tax details. | `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) +## Example -```json -{ - "percentage": "percentage6", - "inclusive": true -} +```python +from paypalserversdk.models.taxes import Taxes + +taxes = Taxes( + percentage='percentage8', + inclusive=True +) ``` diff --git a/doc/models/tenure-type.md b/doc/models/tenure-type.md index 4da9e8a..cc7d6da 100644 --- a/doc/models/tenure-type.md +++ b/doc/models/tenure-type.md @@ -14,3 +14,11 @@ The tenure type of the billing cycle identifies if the billing cycle is a trial( | `REGULAR` | A regular billing cycle to identify recurring charges for the billing agreement. | | `TRIAL` | A trial billing cycle to identify free or discounted charge for the billing agreement. Free trails will not have a price object in pricing scheme where as a discounted trial would have a discounted price compared to regular billing cycle. | +## Example + +```python +from paypalserversdk.models.tenure_type import TenureType + +tenure_type = TenureType.REGULAR +``` + diff --git a/doc/models/three-d-secure-authentication-response.md b/doc/models/three-d-secure-authentication-response.md index 3ebf6b0..3aaf3b4 100644 --- a/doc/models/three-d-secure-authentication-response.md +++ b/doc/models/three-d-secure-authentication-response.md @@ -14,12 +14,16 @@ Results of 3D Secure Authentication. | `authentication_status` | [`PaResStatus`](../../doc/models/pa-res-status.md) | Optional | Transactions status result identifier. The outcome of the issuer's authentication.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `enrollment_status` | [`EnrollmentStatus`](../../doc/models/enrollment-status.md) | Optional | Status of Authentication eligibility.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "authentication_status": "C", - "enrollment_status": "Y" -} +```python +from paypalserversdk.models.enrollment_status import EnrollmentStatus +from paypalserversdk.models.pa_res_status import PaResStatus +from paypalserversdk.models.three_d_secure_authentication_response import ThreeDSecureAuthenticationResponse + +three_d_secure_authentication_response = ThreeDSecureAuthenticationResponse( + authentication_status=PaResStatus.DECOUPLEDAUTHENTICATION, + enrollment_status=EnrollmentStatus.UNAVAILABLE +) ``` diff --git a/doc/models/three-d-secure-card-authentication-response.md b/doc/models/three-d-secure-card-authentication-response.md index 328cb47..cf50990 100644 --- a/doc/models/three-d-secure-card-authentication-response.md +++ b/doc/models/three-d-secure-card-authentication-response.md @@ -15,13 +15,17 @@ Results of 3D Secure Authentication. | `enrollment_status` | [`EnrollmentStatus`](../../doc/models/enrollment-status.md) | Optional | Status of Authentication eligibility.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `authentication_id` | `str` | Optional | The externally received 3ds authentication id, to be returned in card detokenization response.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | -## Example (as JSON) - -```json -{ - "authentication_status": "D", - "enrollment_status": "U", - "authentication_id": "authentication_id2" -} +## Example + +```python +from paypalserversdk.models.enrollment_status import EnrollmentStatus +from paypalserversdk.models.pa_res_status import PaResStatus +from paypalserversdk.models.three_d_secure_card_authentication_response import ThreeDSecureCardAuthenticationResponse + +three_d_secure_card_authentication_response = ThreeDSecureCardAuthenticationResponse( + authentication_status=PaResStatus.UNABLETOCOMPLETEAUTHENTICATION, + enrollment_status=EnrollmentStatus.UNAVAILABLE, + authentication_id='authentication_id4' +) ``` diff --git a/doc/models/token-type.md b/doc/models/token-type.md index dccb039..aba5970 100644 --- a/doc/models/token-type.md +++ b/doc/models/token-type.md @@ -13,3 +13,11 @@ The tokenization method that generated the ID. | --- | --- | | `BILLING_AGREEMENT` | The PayPal billing agreement ID. References an approved recurring payment for goods or services. | +## Example + +```python +from paypalserversdk.models.token_type import TokenType + +token_type = TokenType.BILLING_AGREEMENT +``` + diff --git a/doc/models/token.md b/doc/models/token.md index fb44271..9c8a33e 100644 --- a/doc/models/token.md +++ b/doc/models/token.md @@ -14,12 +14,15 @@ The tokenized payment source to fund a payment. | `id` | `str` | Required | The PayPal-generated ID for the token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `mtype` | [`TokenType`](../../doc/models/token-type.md) | Required | The tokenization method that generated the ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_-]+$` | -## Example (as JSON) +## Example -```json -{ - "id": "id6", - "type": "BILLING_AGREEMENT" -} +```python +from paypalserversdk.models.token import Token +from paypalserversdk.models.token_type import TokenType + +token = Token( + id='id6', + mtype=TokenType.BILLING_AGREEMENT +) ``` diff --git a/doc/models/transaction-details.md b/doc/models/transaction-details.md index 484e1ad..dd8d354 100644 --- a/doc/models/transaction-details.md +++ b/doc/models/transaction-details.md @@ -19,72 +19,82 @@ The transaction details. | `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) +## Example -```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" - } -} +```python +from paypalserversdk.models.cart_information import CartInformation +from paypalserversdk.models.item_details import ItemDetails +from paypalserversdk.models.payer_information import PayerInformation +from paypalserversdk.models.paypal_reference_id_type import PaypalReferenceIdType +from paypalserversdk.models.phone import Phone +from paypalserversdk.models.shipping_information import ShippingInformation +from paypalserversdk.models.simple_postal_address_coarse_grained import SimplePostalAddressCoarseGrained +from paypalserversdk.models.store_information import StoreInformation +from paypalserversdk.models.transaction_details import TransactionDetails +from paypalserversdk.models.transaction_information import TransactionInformation + +transaction_details = TransactionDetails( + transaction_info=TransactionInformation( + paypal_account_id='paypal_account_id4', + paypal_reference_id='paypal_reference_id2', + paypal_reference_id_type=PaypalReferenceIdType.ODR, + transaction_event_code='transaction_event_code6' + ), + payer_info=PayerInformation( + account_id='account_id2', + email_address='email_address2', + phone_number=Phone( + country_code='country_code2', + national_number='national_number6', + extension_number='extension_number8' + ), + address_status='address_status2', + payer_status='payer_status2' + ), + shipping_info=ShippingInformation( + name='name0', + method='method4', + address=SimplePostalAddressCoarseGrained( + line_1='line18', + city='city6', + country_code='country_code6', + line_2='line20', + state='state2', + postal_code='postal_code8' + ), + secondary_shipping_address=SimplePostalAddressCoarseGrained( + line_1='line16', + city='city4', + country_code='country_code4', + line_2='line28', + state='state0', + postal_code='postal_code6' + ) + ), + cart_info=CartInformation( + item_details=[ + ItemDetails( + item_code='item_code0', + item_name='item_name8', + item_description='item_description4', + item_options='item_options2', + item_quantity='item_quantity2' + ), + ItemDetails( + 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=StoreInformation( + store_id='store_id2', + terminal_id='terminal_id6' + ) +) ``` diff --git a/doc/models/transaction-information.md b/doc/models/transaction-information.md index abae034..f495040 100644 --- a/doc/models/transaction-information.md +++ b/doc/models/transaction-information.md @@ -46,15 +46,17 @@ The transaction information. | `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" -} +## Example + +```python +from paypalserversdk.models.paypal_reference_id_type import PaypalReferenceIdType +from paypalserversdk.models.transaction_information import TransactionInformation + +transaction_information = TransactionInformation( + paypal_account_id='paypal_account_id0', + paypal_reference_id='paypal_reference_id8', + paypal_reference_id_type=PaypalReferenceIdType.ODR, + transaction_event_code='transaction_event_code2' +) ``` diff --git a/doc/models/transaction-search-error-details.md b/doc/models/transaction-search-error-details.md index 4f08ba5..10692b2 100644 --- a/doc/models/transaction-search-error-details.md +++ b/doc/models/transaction-search-error-details.md @@ -17,15 +17,17 @@ The error details. Required for client-side `4XX` errors. | `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" -} +## Example + +```python +from paypalserversdk.models.transaction_search_error_details import TransactionSearchErrorDetails + +transaction_search_error_details = TransactionSearchErrorDetails( + issue='issue2', + field='field6', + value='value4', + location='body', + description='description8' +) ``` diff --git a/doc/models/transactions-list.md b/doc/models/transactions-list.md index 9a20765..c520ae0 100644 --- a/doc/models/transactions-list.md +++ b/doc/models/transactions-list.md @@ -16,65 +16,96 @@ The list transactions for a subscription request details. | `total_pages` | `int` | Optional | The total number of pages.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) +## Example -```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" - } - ] -} +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.subscription_amount_with_breakdown import SubscriptionAmountWithBreakdown +from paypalserversdk.models.subscription_payer_name import SubscriptionPayerName +from paypalserversdk.models.subscription_transaction_details import SubscriptionTransactionDetails +from paypalserversdk.models.transactions_list import TransactionsList + +transactions_list = TransactionsList( + transactions=[ + SubscriptionTransactionDetails( + id=None, + amount_with_breakdown=SubscriptionAmountWithBreakdown( + gross_amount=Money( + currency_code='currency_code4', + value='value0' + ), + total_item_amount=Money( + currency_code='currency_code8', + value='value4' + ), + fee_amount=Money( + currency_code='currency_code2', + value='value4' + ), + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + tax_amount=Money( + currency_code='currency_code2', + value='value8' + ), + net_amount=Money( + currency_code='currency_code6', + value='value2' + ) + ), + time='time8', + payer_name=SubscriptionPayerName( + prefix='prefix8', + given_name='given_name2', + surname='surname8', + middle_name='middle_name0', + suffix='suffix0' + ), + payer_email='payer_email6' + ), + SubscriptionTransactionDetails( + id=None, + amount_with_breakdown=SubscriptionAmountWithBreakdown( + gross_amount=Money( + currency_code='currency_code4', + value='value0' + ), + total_item_amount=Money( + currency_code='currency_code8', + value='value4' + ), + fee_amount=Money( + currency_code='currency_code2', + value='value4' + ), + shipping_amount=Money( + currency_code='currency_code0', + value='value6' + ), + tax_amount=Money( + currency_code='currency_code2', + value='value8' + ), + net_amount=Money( + currency_code='currency_code6', + value='value2' + ) + ), + time='time8', + payer_name=SubscriptionPayerName( + prefix='prefix8', + given_name='given_name2', + surname='surname8', + middle_name='middle_name0', + suffix='suffix0' + ), + payer_email='payer_email6' + ) + ], + total_items=8, + total_pages=44 +) ``` diff --git a/doc/models/trustly-payment-object.md b/doc/models/trustly-payment-object.md index 10f1bdb..e58dc3e 100644 --- a/doc/models/trustly-payment-object.md +++ b/doc/models/trustly-payment-object.md @@ -17,15 +17,17 @@ Information needed to pay using Trustly. | `bic` | `str` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | | `iban_last_chars` | `str` | Optional | The last characters of the IBAN used to pay.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `34`, *Pattern*: `[a-zA-Z0-9]{4}` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code6", - "email": "email0", - "bic": "bic8", - "iban_last_chars": "iban_last_chars4" -} +## Example + +```python +from paypalserversdk.models.trustly_payment_object import TrustlyPaymentObject + +trustly_payment_object = TrustlyPaymentObject( + name='name2', + country_code='country_code2', + email='email4', + bic='bic4', + iban_last_chars='iban_last_chars0' +) ``` diff --git a/doc/models/trustly-payment-request.md b/doc/models/trustly-payment-request.md index 5cc2599..68e4d79 100644 --- a/doc/models/trustly-payment-request.md +++ b/doc/models/trustly-payment-request.md @@ -16,20 +16,24 @@ Information needed to pay using Trustly. | `email` | `str` | Required | 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])+)\])$`` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```python +from paypalserversdk.models.experience_context import ExperienceContext +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.trustly_payment_request import TrustlyPaymentRequest + +trustly_payment_request = TrustlyPaymentRequest( + name='name4', + country_code='country_code6', + email='email2', + experience_context=ExperienceContext( + brand_name='brand_name2', + locale='locale6', + shipping_preference=ExperienceContextShippingPreference.NO_SHIPPING, + return_url='return_url4', + cancel_url='cancel_url6' + ) +) ``` diff --git a/doc/models/universal-product-code.md b/doc/models/universal-product-code.md index 9b3277f..6cc10f0 100644 --- a/doc/models/universal-product-code.md +++ b/doc/models/universal-product-code.md @@ -14,12 +14,15 @@ The Universal Product Code of the item. | `mtype` | [`UpcType`](../../doc/models/upc-type.md) | Required | The Universal Product Code type.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `5`, *Pattern*: `^[0-9A-Z_-]+$` | | `code` | `str` | Required | The UPC product code of the item.

**Constraints**: *Minimum Length*: `6`, *Maximum Length*: `17`, *Pattern*: `^[0-9]{0,17}$` | -## Example (as JSON) +## Example -```json -{ - "type": "UPC-E", - "code": "code2" -} +```python +from paypalserversdk.models.universal_product_code import UniversalProductCode +from paypalserversdk.models.upc_type import UpcType + +universal_product_code = UniversalProductCode( + mtype=UpcType.UPC_5, + code='code2' +) ``` diff --git a/doc/models/upc-type.md b/doc/models/upc-type.md index 6557796..2e9f352 100644 --- a/doc/models/upc-type.md +++ b/doc/models/upc-type.md @@ -19,3 +19,11 @@ The Universal Product Code type. | `UPC_2` | | `UPC_5` | +## Example + +```python +from paypalserversdk.models.upc_type import UpcType + +upc_type = UpcType.UPC_E +``` + diff --git a/doc/models/update-pricing-scheme.md b/doc/models/update-pricing-scheme.md index e36d6a8..11fbf75 100644 --- a/doc/models/update-pricing-scheme.md +++ b/doc/models/update-pricing-scheme.md @@ -14,46 +14,51 @@ The update pricing scheme request details. | `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" - } -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.update_pricing_scheme import UpdatePricingScheme + +update_pricing_scheme = UpdatePricingScheme( + billing_cycle_sequence=99, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ) +) ``` diff --git a/doc/models/update-pricing-schemes-request.md b/doc/models/update-pricing-schemes-request.md index 0c863d9..2377d5f 100644 --- a/doc/models/update-pricing-schemes-request.md +++ b/doc/models/update-pricing-schemes-request.md @@ -13,50 +13,56 @@ The update pricing scheme request details. | --- | --- | --- | --- | | `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" - } - } - ] -} +## Example + +```python +from paypalserversdk.models.money import Money +from paypalserversdk.models.pricing_tier import PricingTier +from paypalserversdk.models.subscription_pricing_model import SubscriptionPricingModel +from paypalserversdk.models.subscription_pricing_scheme import SubscriptionPricingScheme +from paypalserversdk.models.update_pricing_scheme import UpdatePricingScheme +from paypalserversdk.models.update_pricing_schemes_request import UpdatePricingSchemesRequest + +update_pricing_schemes_request = UpdatePricingSchemesRequest( + pricing_schemes=[ + UpdatePricingScheme( + billing_cycle_sequence=34, + pricing_scheme=SubscriptionPricingScheme( + fixed_price=Money( + currency_code='currency_code4', + value='value0' + ), + pricing_model=SubscriptionPricingModel.VOLUME, + tiers=[ + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ), + PricingTier( + starting_quantity='starting_quantity8', + amount=Money( + currency_code='currency_code6', + value='value0' + ), + ending_quantity='ending_quantity6' + ) + ], + create_time='create_time4' + ) + ) + ] +) ``` diff --git a/doc/models/usage-pattern.md b/doc/models/usage-pattern.md index ee8ca28..3c79d3d 100644 --- a/doc/models/usage-pattern.md +++ b/doc/models/usage-pattern.md @@ -24,3 +24,11 @@ Expected business/pricing model for the billing agreement., Expected business/ch | `INSTALLMENT_PREPAID` | Merchant-managed installment plan when the "amount" to be paid and the "billing frequency" are fixed, but there is a defined number of payments with the payment due before the good/service is delivered. | | `INSTALLMENT_POSTPAID` | Merchant-managed installment plan when the "amount" to be paid and the "billing frequency" are fixed, but there is a defined number of payments with the payment due after the goods/services are delivered. | +## Example + +```python +from paypalserversdk.models.usage_pattern import UsagePattern + +usage_pattern = UsagePattern.IMMEDIATE +``` + diff --git a/doc/models/usage-type.md b/doc/models/usage-type.md index 42be9d7..93ece64 100644 --- a/doc/models/usage-type.md +++ b/doc/models/usage-type.md @@ -14,3 +14,11 @@ The usage type associated with the PayPal payment token. | `MERCHANT` | The PayPal Payment Token will be used for future transaction directly with a merchant. | | `PLATFORM` | The PayPal Payment Token will be used for future transaction on a platform. A platform is typically a marketplace or a channel that a payer can purchase goods and services from multiple merchants. | +## Example + +```python +from paypalserversdk.models.usage_type import UsageType + +usage_type = UsageType.MERCHANT +``` + diff --git a/doc/models/vault-apple-pay-request.md b/doc/models/vault-apple-pay-request.md index 61d9c11..0770635 100644 --- a/doc/models/vault-apple-pay-request.md +++ b/doc/models/vault-apple-pay-request.md @@ -14,23 +14,29 @@ A resource representing a request to vault Apple Pay. | `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" - } - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.apple_pay_request_card import ApplePayRequestCard +from paypalserversdk.models.card_brand import CardBrand +from paypalserversdk.models.card_type import CardType +from paypalserversdk.models.vault_apple_pay_request import VaultApplePayRequest + +vault_apple_pay_request = VaultApplePayRequest( + token='token8', + card=ApplePayRequestCard( + mtype=CardType.UNKNOWN, + brand=CardBrand.CB_NATIONALE, + billing_address=Address( + country_code='country_code8', + 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' + ) + ) +) ``` diff --git a/doc/models/vault-card-experience-context.md b/doc/models/vault-card-experience-context.md index 705aaab..981cfd4 100644 --- a/doc/models/vault-card-experience-context.md +++ b/doc/models/vault-card-experience-context.md @@ -18,16 +18,20 @@ A resource representing an experience context of vault a card. | `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 -{ - "user_action": "CONTINUE", - "brand_name": "brand_name4", - "locale": "locale8", - "return_url": "return_url4", - "cancel_url": "cancel_url8", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" -} +## Example + +```python +from paypalserversdk.models.vault_card_experience_context import VaultCardExperienceContext +from paypalserversdk.models.vault_instruction_action import VaultInstructionAction +from paypalserversdk.models.vault_user_action import VaultUserAction + +vault_card_experience_context = VaultCardExperienceContext( + brand_name='brand_name2', + locale='locale6', + return_url='return_url4', + cancel_url='cancel_url6', + vault_instruction=VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS, + user_action=VaultUserAction.CONTINUE +) ``` diff --git a/doc/models/vault-card-verification-method.md b/doc/models/vault-card-verification-method.md index 2a7a90f..38cb8b2 100644 --- a/doc/models/vault-card-verification-method.md +++ b/doc/models/vault-card-verification-method.md @@ -14,3 +14,11 @@ The verification method of the card. | `SCA_WHEN_REQUIRED` | When an authorization or transaction is attempted this option will return a contingency and HATEOAS link only when local regulations require strong customer authentication, (e.g. 3DS in countries and use cases where it is mandated). The API caller should redirect the payer to the link so that they can authenticate themselves. In all cases, when an authorization is requested the AVS/CVV results will be returned in the response. | | `SCA_ALWAYS` | Selecting this option will attempt to force a strong customer authentication for the authorization/transaction. In countries where SCA has been defined and implemented it will result in a contingency and HATEOAS link being returned. The API caller should redirect the payer to that link so that they can authenticate themselves against their issuing bank or other entity. As noted, the HATEOAS link is only available in all regions where strong authentication is supported, (e.g. in European countries where 3DS is live). Merchants can use this setting as an additional layer of security if they choose to. In all cases, when an authorization is requested the AVS/CVV results will be returned in the response. | +## Example + +```python +from paypalserversdk.models.vault_card_verification_method import VaultCardVerificationMethod + +vault_card_verification_method = VaultCardVerificationMethod.SCA_WHEN_REQUIRED +``` + diff --git a/doc/models/vault-customer.md b/doc/models/vault-customer.md index c713dad..436a022 100644 --- a/doc/models/vault-customer.md +++ b/doc/models/vault-customer.md @@ -14,15 +14,18 @@ This object represents a merchant’s customer, allowing them to store contact d | `id` | `str` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "id": "id2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.vault_customer import VaultCustomer + +vault_customer = VaultCustomer( + id='id2', + name=Name( + given_name='given_name2', + surname='surname8' + ) +) ``` diff --git a/doc/models/vault-experience-context.md b/doc/models/vault-experience-context.md index 666ab11..af0514b 100644 --- a/doc/models/vault-experience-context.md +++ b/doc/models/vault-experience-context.md @@ -20,16 +20,20 @@ Customizes the Vault creation flow experience for your customers. | `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", - "user_action": "CONTINUE", - "brand_name": "brand_name0", - "locale": "locale4", - "return_url": "return_url2", - "cancel_url": "cancel_url4" -} +## Example + +```python +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.vault_experience_context import VaultExperienceContext +from paypalserversdk.models.vault_user_action import VaultUserAction + +vault_experience_context = VaultExperienceContext( + brand_name='brand_name0', + locale='locale4', + return_url='return_url2', + cancel_url='cancel_url4', + shipping_preference=ExperienceContextShippingPreference.GET_FROM_FILE, + user_action=VaultUserAction.CONTINUE +) ``` diff --git a/doc/models/vault-instruction-action.md b/doc/models/vault-instruction-action.md index a11f117..5bdebe7 100644 --- a/doc/models/vault-instruction-action.md +++ b/doc/models/vault-instruction-action.md @@ -14,3 +14,11 @@ Vault Instruction on action to be performed after a successful payer approval. | `ON_CREATE_PAYMENT_TOKENS` | Vault the payment method after API caller performs a successful POST on Payment Tokens. | | `ON_PAYER_APPROVAL` | Vault the payment method on successful payer authentication and approval. | +## Example + +```python +from paypalserversdk.models.vault_instruction_action import VaultInstructionAction + +vault_instruction_action = VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS +``` + diff --git a/doc/models/vault-instruction-base.md b/doc/models/vault-instruction-base.md index cb7b10a..9f971cc 100644 --- a/doc/models/vault-instruction-base.md +++ b/doc/models/vault-instruction-base.md @@ -13,11 +13,14 @@ Basic vault instruction specification that can be extended by specific payment s | --- | --- | --- | --- | | `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_]+$` | -## Example (as JSON) +## Example -```json -{ - "store_in_vault": "ON_SUCCESS" -} +```python +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.vault_instruction_base import VaultInstructionBase + +vault_instruction_base = VaultInstructionBase( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS +) ``` diff --git a/doc/models/vault-instruction.md b/doc/models/vault-instruction.md index 2ea341a..93a8bec 100644 --- a/doc/models/vault-instruction.md +++ b/doc/models/vault-instruction.md @@ -13,11 +13,14 @@ Base vaulting specification. The object can be extended for specific use cases w | --- | --- | --- | --- | | `store_in_vault` | [`StoreInVaultInstruction`](../../doc/models/store-in-vault-instruction.md) | Required | Defines how and when the payment source gets vaulted.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "store_in_vault": "ON_SUCCESS" -} +```python +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.vault_instruction import VaultInstruction + +vault_instruction = VaultInstruction( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS +) ``` diff --git a/doc/models/vault-paypal-wallet-request.md b/doc/models/vault-paypal-wallet-request.md index 8360cee..133a07d 100644 --- a/doc/models/vault-paypal-wallet-request.md +++ b/doc/models/vault-paypal-wallet-request.md @@ -20,33 +20,42 @@ A resource representing a request to vault PayPal Wallet. | `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 | A resource representing an experience context of vault PayPal Wallet. | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description0", - "usage_pattern": "INSTALLMENT_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +from paypalserversdk.models.vault_paypal_wallet_request import VaultPaypalWalletRequest +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +vault_paypal_wallet_request = VaultPaypalWalletRequest( + description='description0', + usage_pattern=UsagePattern.RECURRING_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT +) ``` diff --git a/doc/models/vault-response-customer.md b/doc/models/vault-response-customer.md index ec8e64d..05b9063 100644 --- a/doc/models/vault-response-customer.md +++ b/doc/models/vault-response-customer.md @@ -15,22 +15,14 @@ This object defines a customer in your system. Use it to manage customer profile | `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-_.^*$@#]+$` | | `links` | `List[Any]` | Optional, Read-only | DEPRECATED. This field is DEPRECATED.

**Constraints**: *Maximum Items*: `16` | -## Example (as JSON) - -```json -{ - "id": "id4", - "merchant_customer_id": "merchant_customer_id6", - "links": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } - ] -} +## Example + +```python +from paypalserversdk.models.vault_response_customer import VaultResponseCustomer + +vault_response_customer = VaultResponseCustomer( + id='id2', + merchant_customer_id='merchant_customer_id4' +) ``` diff --git a/doc/models/vault-response.md b/doc/models/vault-response.md index 39df225..67df45a 100644 --- a/doc/models/vault-response.md +++ b/doc/models/vault-response.md @@ -16,26 +16,24 @@ The details about a saved payment source. | `customer` | [`VaultCustomer`](../../doc/models/vault-customer.md) | Optional | This object represents a merchant’s customer, allowing them to store contact details, and track all payments associated with the same customer. | | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "CREATED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.vault_customer import VaultCustomer +from paypalserversdk.models.vault_response import VaultResponse +from paypalserversdk.models.vault_status import VaultStatus + +vault_response = VaultResponse( + id='id8', + status=VaultStatus.VAULTED, + customer=VaultCustomer( + id='id0', + name=Name( + given_name='given_name2', + surname='surname8' + ) + ) +) ``` diff --git a/doc/models/vault-status.md b/doc/models/vault-status.md index aa7e1ee..69e98db 100644 --- a/doc/models/vault-status.md +++ b/doc/models/vault-status.md @@ -15,3 +15,11 @@ The 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 | +## Example + +```python +from paypalserversdk.models.vault_status import VaultStatus + +vault_status = VaultStatus.APPROVED +``` + diff --git a/doc/models/vault-token-request-type.md b/doc/models/vault-token-request-type.md index 235563b..c4a5223 100644 --- a/doc/models/vault-token-request-type.md +++ b/doc/models/vault-token-request-type.md @@ -13,3 +13,11 @@ The tokenization method that generated the ID. | --- | --- | | `SETUP_TOKEN` | The setup token, which is a temporary reference to payment source. | +## Example + +```python +from paypalserversdk.models.vault_token_request_type import VaultTokenRequestType + +vault_token_request_type = VaultTokenRequestType.SETUP_TOKEN +``` + diff --git a/doc/models/vault-token-request.md b/doc/models/vault-token-request.md index ecb73a5..11fe04c 100644 --- a/doc/models/vault-token-request.md +++ b/doc/models/vault-token-request.md @@ -14,12 +14,15 @@ The Tokenized Payment Source representing a Request to Vault a Token. | `id` | `str` | Required | The PayPal-generated ID for the token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Za-z_-]+$` | | `mtype` | [`VaultTokenRequestType`](../../doc/models/vault-token-request-type.md) | Required | The tokenization method that generated the ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_-]+$` | -## Example (as JSON) +## Example -```json -{ - "id": "id8", - "type": "SETUP_TOKEN" -} +```python +from paypalserversdk.models.vault_token_request import VaultTokenRequest +from paypalserversdk.models.vault_token_request_type import VaultTokenRequestType + +vault_token_request = VaultTokenRequest( + id='id2', + mtype=VaultTokenRequestType.SETUP_TOKEN +) ``` diff --git a/doc/models/vault-user-action.md b/doc/models/vault-user-action.md index a7d5044..158f461 100644 --- a/doc/models/vault-user-action.md +++ b/doc/models/vault-user-action.md @@ -14,3 +14,11 @@ User Action on action to be performed after a successful payer approval. | `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. | +## Example + +```python +from paypalserversdk.models.vault_user_action import VaultUserAction + +vault_user_action = VaultUserAction.SETUP_NOW +``` + diff --git a/doc/models/vault-venmo-request.md b/doc/models/vault-venmo-request.md index c7e63d5..de19d8c 100644 --- a/doc/models/vault-venmo-request.md +++ b/doc/models/vault-venmo-request.md @@ -19,33 +19,42 @@ A resource representing a request to vault Venmo. | `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` | [`VenmoExperienceContext`](../../doc/models/venmo-experience-context.md) | Optional | A resource representing an experience context of vault a venmo account. | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description0", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +from paypalserversdk.models.vault_venmo_request import VaultVenmoRequest +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +vault_venmo_request = VaultVenmoRequest( + description='description0', + usage_pattern=UsagePattern.SUBSCRIPTION_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT +) ``` diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md index 830ecfc..ec52fa3 100644 --- a/doc/models/vaulted-digital-wallet-shipping-details.md +++ b/doc/models/vaulted-digital-wallet-shipping-details.md @@ -17,27 +17,33 @@ The shipping details. | `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). | -## Example (as JSON) - -```json -{ - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +vaulted_digital_wallet_shipping_details = VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address0', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.PICKUP_IN_STORE, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) +) ``` diff --git a/doc/models/vaulted-digital-wallet.md b/doc/models/vaulted-digital-wallet.md index b8c4a9a..3b105fb 100644 --- a/doc/models/vaulted-digital-wallet.md +++ b/doc/models/vaulted-digital-wallet.md @@ -18,33 +18,42 @@ Resource consolidating common request and response attributes for vaulting a Dig | `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_]+$` | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +from paypalserversdk.models.vaulted_digital_wallet import VaultedDigitalWallet +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails + +vaulted_digital_wallet = VaultedDigitalWallet( + description='description8', + usage_pattern=UsagePattern.INSTALLMENT_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT +) ``` diff --git a/doc/models/venmo-experience-context.md b/doc/models/venmo-experience-context.md index a56cb14..31f6d88 100644 --- a/doc/models/venmo-experience-context.md +++ b/doc/models/venmo-experience-context.md @@ -16,14 +16,19 @@ A resource representing an experience context of vault a venmo account. | `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" -} +## Example + +```python +from paypalserversdk.models.experience_context_shipping_preference import ExperienceContextShippingPreference +from paypalserversdk.models.vault_instruction_action import VaultInstructionAction +from paypalserversdk.models.vault_user_action import VaultUserAction +from paypalserversdk.models.venmo_experience_context import VenmoExperienceContext + +venmo_experience_context = VenmoExperienceContext( + brand_name='brand_name0', + shipping_preference=ExperienceContextShippingPreference.GET_FROM_FILE, + vault_instruction=VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS, + user_action=VaultUserAction.CONTINUE +) ``` diff --git a/doc/models/venmo-payment-token-customer-type.md b/doc/models/venmo-payment-token-customer-type.md index e0aa988..eb2d054 100644 --- a/doc/models/venmo-payment-token-customer-type.md +++ b/doc/models/venmo-payment-token-customer-type.md @@ -14,3 +14,11 @@ The customer type associated with the Venmo payment token. This is to indicate w | `CONSUMER` | The customer vaulting the Venmo payment token is a consumer on the merchant / platform. | | `BUSINESS` | The customer vaulting the Venmo payment token is a business on merchant / platform. | +## Example + +```python +from paypalserversdk.models.venmo_payment_token_customer_type import VenmoPaymentTokenCustomerType + +venmo_payment_token_customer_type = VenmoPaymentTokenCustomerType.CONSUMER +``` + diff --git a/doc/models/venmo-payment-token-usage-pattern.md b/doc/models/venmo-payment-token-usage-pattern.md index 473c156..e8a9dcd 100644 --- a/doc/models/venmo-payment-token-usage-pattern.md +++ b/doc/models/venmo-payment-token-usage-pattern.md @@ -18,3 +18,11 @@ Expected business/pricing model for the billing agreement. | `THRESHOLD_PREPAID` | Charge payer when the set amount is reached or monthly billing cycle, whichever comes first, before the goods/service is delivered. | | `THRESHOLD_POSTPAID` | Charge payer when the set amount is reached or monthly billing cycle, whichever comes first, after the goods/service is delivered. | +## Example + +```python +from paypalserversdk.models.venmo_payment_token_usage_pattern import VenmoPaymentTokenUsagePattern + +venmo_payment_token_usage_pattern = VenmoPaymentTokenUsagePattern.THRESHOLD_PREPAID +``` + diff --git a/doc/models/venmo-payment-token-usage-type.md b/doc/models/venmo-payment-token-usage-type.md index 3c080b4..75a2851 100644 --- a/doc/models/venmo-payment-token-usage-type.md +++ b/doc/models/venmo-payment-token-usage-type.md @@ -14,3 +14,11 @@ The usage type associated with the Venmo payment token. | `MERCHANT` | The Venmo Payment Token will be used for future transaction directly with a merchant. | | `PLATFORM` | The Venmo Payment Token will be used for future transaction on a platform. A platform is typically a marketplace or a channel that a payer can purchase goods and services from multiple merchants. | +## Example + +```python +from paypalserversdk.models.venmo_payment_token_usage_type import VenmoPaymentTokenUsageType + +venmo_payment_token_usage_type = VenmoPaymentTokenUsageType.MERCHANT +``` + diff --git a/doc/models/venmo-payment-token.md b/doc/models/venmo-payment-token.md index 04b7bee..b586370 100644 --- a/doc/models/venmo-payment-token.md +++ b/doc/models/venmo-payment-token.md @@ -24,33 +24,42 @@ Full representation of a Venmo Payment Token. | `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). | | `user_name` | `str` | Optional | The Venmo username, as chosen by the user.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50`, *Pattern*: `^[-a-zA-Z0-9_]*$` | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description4", - "usage_pattern": "INSTALLMENT_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```python +from paypalserversdk.models.address import Address +from paypalserversdk.models.fulfillment_type import FulfillmentType +from paypalserversdk.models.paypal_payment_token_usage_type import PaypalPaymentTokenUsageType +from paypalserversdk.models.phone_number_with_country_code import PhoneNumberWithCountryCode +from paypalserversdk.models.shipping_name import ShippingName +from paypalserversdk.models.usage_pattern import UsagePattern +from paypalserversdk.models.vaulted_digital_wallet_shipping_details import VaultedDigitalWalletShippingDetails +from paypalserversdk.models.venmo_payment_token import VenmoPaymentToken + +venmo_payment_token = VenmoPaymentToken( + description='description2', + usage_pattern=UsagePattern.UNSCHEDULED_PREPAID, + shipping=VaultedDigitalWalletShippingDetails( + name=ShippingName( + full_name='full_name6' + ), + email_address='email_address2', + phone_number=PhoneNumberWithCountryCode( + country_code='country_code2', + national_number='national_number6' + ), + mtype=FulfillmentType.SHIPPING, + address=Address( + country_code='country_code6', + address_line_1='address_line_16', + address_line_2='address_line_26', + admin_area_2='admin_area_20', + admin_area_1='admin_area_12', + postal_code='postal_code8' + ) + ), + permit_multiple_payment_tokens=False, + usage_type=PaypalPaymentTokenUsageType.MERCHANT +) ``` diff --git a/doc/models/venmo-vault-response-status.md b/doc/models/venmo-vault-response-status.md index e5371c0..d79f942 100644 --- a/doc/models/venmo-vault-response-status.md +++ b/doc/models/venmo-vault-response-status.md @@ -15,3 +15,11 @@ The 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 | +## Example + +```python +from paypalserversdk.models.venmo_vault_response_status import VenmoVaultResponseStatus + +venmo_vault_response_status = VenmoVaultResponseStatus.VAULTED +``` + diff --git a/doc/models/venmo-vault-response.md b/doc/models/venmo-vault-response.md index 3aa0dd0..94a0eb7 100644 --- a/doc/models/venmo-vault-response.md +++ b/doc/models/venmo-vault-response.md @@ -16,43 +16,34 @@ The details about a saved venmo payment source. | `links` | [`List[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | 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" - } - } -} +## Example + +```python +from paypalserversdk.models.customer_information import CustomerInformation +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.venmo_vault_response import VenmoVaultResponse +from paypalserversdk.models.venmo_vault_response_status import VenmoVaultResponseStatus + +venmo_vault_response = VenmoVaultResponse( + id='id6', + status=VenmoVaultResponseStatus.APPROVED, + customer=CustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) + ) +) ``` diff --git a/doc/models/venmo-wallet-additional-attributes.md b/doc/models/venmo-wallet-additional-attributes.md index 8d4d8f1..f63e1d2 100644 --- a/doc/models/venmo-wallet-additional-attributes.md +++ b/doc/models/venmo-wallet-additional-attributes.md @@ -14,32 +14,44 @@ Additional attributes associated with the use of this Venmo Wallet. | `customer` | [`VenmoWalletCustomerInformation`](../../doc/models/venmo-wallet-customer-information.md) | Optional | The details about a customer in PayPal's system of record. | | `vault` | [`VenmoWalletVaultAttributes`](../../doc/models/venmo-wallet-vault-attributes.md) | Optional | Resource consolidating common request and response attirbutes for vaulting Venmo Wallet. | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "vault": { - "store_in_vault": "ON_SUCCESS", - "description": "description6", - "usage_pattern": "THRESHOLD_PREPAID", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.venmo_payment_token_customer_type import VenmoPaymentTokenCustomerType +from paypalserversdk.models.venmo_payment_token_usage_pattern import VenmoPaymentTokenUsagePattern +from paypalserversdk.models.venmo_payment_token_usage_type import VenmoPaymentTokenUsageType +from paypalserversdk.models.venmo_wallet_additional_attributes import VenmoWalletAdditionalAttributes +from paypalserversdk.models.venmo_wallet_customer_information import VenmoWalletCustomerInformation +from paypalserversdk.models.venmo_wallet_vault_attributes import VenmoWalletVaultAttributes + +venmo_wallet_additional_attributes = VenmoWalletAdditionalAttributes( + customer=VenmoWalletCustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) + ), + vault=VenmoWalletVaultAttributes( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS, + usage_type=VenmoPaymentTokenUsageType.MERCHANT, + description='description6', + usage_pattern=VenmoPaymentTokenUsagePattern.THRESHOLD_PREPAID, + customer_type=VenmoPaymentTokenCustomerType.CONSUMER, + permit_multiple_payment_tokens=False + ) +) ``` diff --git a/doc/models/venmo-wallet-attributes-response.md b/doc/models/venmo-wallet-attributes-response.md index 17faf29..3d1fa5c 100644 --- a/doc/models/venmo-wallet-attributes-response.md +++ b/doc/models/venmo-wallet-attributes-response.md @@ -13,35 +13,37 @@ Additional attributes associated with the use of a Venmo Wallet. | --- | --- | --- | --- | | `vault` | [`VenmoVaultResponse`](../../doc/models/venmo-vault-response.md) | Optional | The details about a saved venmo payment source. | -## Example (as JSON) - -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "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" - } - } - } -} +## Example + +```python +from paypalserversdk.models.customer_information import CustomerInformation +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.venmo_vault_response import VenmoVaultResponse +from paypalserversdk.models.venmo_vault_response_status import VenmoVaultResponseStatus +from paypalserversdk.models.venmo_wallet_attributes_response import VenmoWalletAttributesResponse + +venmo_wallet_attributes_response = VenmoWalletAttributesResponse( + vault=VenmoVaultResponse( + id='id6', + status=VenmoVaultResponseStatus.APPROVED, + customer=CustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) + ) + ) +) ``` diff --git a/doc/models/venmo-wallet-customer-information.md b/doc/models/venmo-wallet-customer-information.md index 711e9dc..099541c 100644 --- a/doc/models/venmo-wallet-customer-information.md +++ b/doc/models/venmo-wallet-customer-information.md @@ -16,22 +16,28 @@ The details about a customer in PayPal's system of record. | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "id": "id4", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.venmo_wallet_customer_information import VenmoWalletCustomerInformation + +venmo_wallet_customer_information = VenmoWalletCustomerInformation( + id='id4', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) +) ``` diff --git a/doc/models/venmo-wallet-experience-context-shipping-preference.md b/doc/models/venmo-wallet-experience-context-shipping-preference.md index f1c53d2..697af9a 100644 --- a/doc/models/venmo-wallet-experience-context-shipping-preference.md +++ b/doc/models/venmo-wallet-experience-context-shipping-preference.md @@ -15,3 +15,11 @@ The location from which the shipping address is derived. | `NO_SHIPPING` | Redacts the shipping address from the PayPal site. Recommended for digital goods. | | `SET_PROVIDED_ADDRESS` | Get the merchant-provided address. The customer cannot change this address on the PayPal site. If merchant does not pass an address, customer can choose the address on PayPal pages. | +## Example + +```python +from paypalserversdk.models.venmo_wallet_experience_context_shipping_preference import VenmoWalletExperienceContextShippingPreference + +venmo_wallet_experience_context_shipping_preference = VenmoWalletExperienceContextShippingPreference.SET_PROVIDED_ADDRESS +``` + diff --git a/doc/models/venmo-wallet-experience-context-user-action.md b/doc/models/venmo-wallet-experience-context-user-action.md index 7f111b4..b6f534e 100644 --- a/doc/models/venmo-wallet-experience-context-user-action.md +++ b/doc/models/venmo-wallet-experience-context-user-action.md @@ -14,3 +14,11 @@ Configures a Continue or Pay Now checkout flow. | `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. | +## Example + +```python +from paypalserversdk.models.venmo_wallet_experience_context_user_action import VenmoWalletExperienceContextUserAction + +venmo_wallet_experience_context_user_action = VenmoWalletExperienceContextUserAction.CONTINUE +``` + diff --git a/doc/models/venmo-wallet-experience-context.md b/doc/models/venmo-wallet-experience-context.md index 7bdacdf..171687d 100644 --- a/doc/models/venmo-wallet-experience-context.md +++ b/doc/models/venmo-wallet-experience-context.md @@ -16,21 +16,27 @@ Customizes the buyer experience during the approval process for payment with Ven | `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": [ - "SHIPPING_OPTIONS", - "SHIPPING_ADDRESS", - "SHIPPING_OPTIONS" - ], - "callback_url": "callback_url6" - } -} +## Example + +```python +from paypalserversdk.models.callback_configuration import CallbackConfiguration +from paypalserversdk.models.callback_events import CallbackEvents +from paypalserversdk.models.venmo_wallet_experience_context import VenmoWalletExperienceContext +from paypalserversdk.models.venmo_wallet_experience_context_shipping_preference import VenmoWalletExperienceContextShippingPreference +from paypalserversdk.models.venmo_wallet_experience_context_user_action import VenmoWalletExperienceContextUserAction + +venmo_wallet_experience_context = VenmoWalletExperienceContext( + brand_name='brand_name2', + shipping_preference=VenmoWalletExperienceContextShippingPreference.GET_FROM_FILE, + order_update_callback_config=CallbackConfiguration( + callback_events=[ + CallbackEvents.SHIPPING_OPTIONS, + CallbackEvents.SHIPPING_ADDRESS, + CallbackEvents.SHIPPING_OPTIONS + ], + callback_url='callback_url6' + ), + user_action=VenmoWalletExperienceContextUserAction.CONTINUE +) ``` diff --git a/doc/models/venmo-wallet-request.md b/doc/models/venmo-wallet-request.md index 566f857..03a7c07 100644 --- a/doc/models/venmo-wallet-request.md +++ b/doc/models/venmo-wallet-request.md @@ -16,49 +16,67 @@ Information needed to pay using Venmo. | `experience_context` | [`VenmoWalletExperienceContext`](../../doc/models/venmo-wallet-experience-context.md) | Optional | Customizes the buyer experience during the approval process for payment with Venmo. Note: Partners and Marketplaces might configure shipping_preference during partner account setup, which overrides the request values. | | `attributes` | [`VenmoWalletAdditionalAttributes`](../../doc/models/venmo-wallet-additional-attributes.md) | Optional | Additional attributes associated with the use of this Venmo Wallet. | -## Example (as JSON) +## Example -```json -{ - "vault_id": "vault_id2", - "email_address": "email_address2", - "experience_context": { - "brand_name": "brand_name2", - "shipping_preference": "NO_SHIPPING", - "order_update_callback_config": { - "callback_events": [ - "SHIPPING_OPTIONS", - "SHIPPING_ADDRESS", - "SHIPPING_OPTIONS" - ], - "callback_url": "callback_url6" - }, - "user_action": "CONTINUE" - }, - "attributes": { - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "vault": { - "store_in_vault": "ON_SUCCESS", - "description": "description6", - "usage_pattern": "THRESHOLD_PREPAID", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false - } - } -} +```python +from paypalserversdk.models.callback_configuration import CallbackConfiguration +from paypalserversdk.models.callback_events import CallbackEvents +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.phone_type import PhoneType +from paypalserversdk.models.phone_with_type import PhoneWithType +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.venmo_payment_token_customer_type import VenmoPaymentTokenCustomerType +from paypalserversdk.models.venmo_payment_token_usage_pattern import VenmoPaymentTokenUsagePattern +from paypalserversdk.models.venmo_payment_token_usage_type import VenmoPaymentTokenUsageType +from paypalserversdk.models.venmo_wallet_additional_attributes import VenmoWalletAdditionalAttributes +from paypalserversdk.models.venmo_wallet_customer_information import VenmoWalletCustomerInformation +from paypalserversdk.models.venmo_wallet_experience_context import VenmoWalletExperienceContext +from paypalserversdk.models.venmo_wallet_experience_context_shipping_preference import VenmoWalletExperienceContextShippingPreference +from paypalserversdk.models.venmo_wallet_experience_context_user_action import VenmoWalletExperienceContextUserAction +from paypalserversdk.models.venmo_wallet_request import VenmoWalletRequest +from paypalserversdk.models.venmo_wallet_vault_attributes import VenmoWalletVaultAttributes + +venmo_wallet_request = VenmoWalletRequest( + vault_id='vault_id6', + email_address='email_address6', + experience_context=VenmoWalletExperienceContext( + brand_name='brand_name2', + shipping_preference=VenmoWalletExperienceContextShippingPreference.NO_SHIPPING, + order_update_callback_config=CallbackConfiguration( + callback_events=[ + CallbackEvents.SHIPPING_OPTIONS, + CallbackEvents.SHIPPING_ADDRESS, + CallbackEvents.SHIPPING_OPTIONS + ], + callback_url='callback_url6' + ), + user_action=VenmoWalletExperienceContextUserAction.CONTINUE + ), + attributes=VenmoWalletAdditionalAttributes( + customer=VenmoWalletCustomerInformation( + id='id0', + email_address='email_address2', + phone=PhoneWithType( + phone_number=PhoneNumber( + national_number='national_number6' + ), + phone_type=PhoneType.OTHER + ), + name=Name( + given_name='given_name2', + surname='surname8' + ) + ), + vault=VenmoWalletVaultAttributes( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS, + usage_type=VenmoPaymentTokenUsageType.MERCHANT, + description='description6', + usage_pattern=VenmoPaymentTokenUsagePattern.THRESHOLD_PREPAID, + customer_type=VenmoPaymentTokenCustomerType.CONSUMER, + permit_multiple_payment_tokens=False + ) + ) +) ``` diff --git a/doc/models/venmo-wallet-response.md b/doc/models/venmo-wallet-response.md index c293a29..103a2e9 100644 --- a/doc/models/venmo-wallet-response.md +++ b/doc/models/venmo-wallet-response.md @@ -20,21 +20,26 @@ Venmo wallet response. | `return_flow` | [`ReturnFlow`](../../doc/models/return-flow.md) | Optional, Read-only | 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", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_number": { - "national_number": "national_number6" - } -} +## Example + +```python +from paypalserversdk.models.name import Name +from paypalserversdk.models.phone_number import PhoneNumber +from paypalserversdk.models.return_flow import ReturnFlow +from paypalserversdk.models.venmo_wallet_response import VenmoWalletResponse + +venmo_wallet_response = VenmoWalletResponse( + email_address='email_address4', + account_id='account_id8', + user_name='user_name2', + name=Name( + given_name='given_name2', + surname='surname8' + ), + phone_number=PhoneNumber( + national_number='national_number6' + ), + return_flow=ReturnFlow.AUTO +) ``` diff --git a/doc/models/venmo-wallet-vault-attributes.md b/doc/models/venmo-wallet-vault-attributes.md index 675889a..bc2b831 100644 --- a/doc/models/venmo-wallet-vault-attributes.md +++ b/doc/models/venmo-wallet-vault-attributes.md @@ -18,16 +18,22 @@ Resource consolidating common request and response attirbutes for vaulting Venmo | `customer_type` | [`VenmoPaymentTokenCustomerType`](../../doc/models/venmo-payment-token-customer-type.md) | Optional | The customer type associated with the Venmo payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Default**: `"CONSUMER"`

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

**Default**: `False` | -## Example (as JSON) - -```json -{ - "store_in_vault": "ON_SUCCESS", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false, - "description": "description6", - "usage_pattern": "RECURRING_PREPAID" -} +## Example + +```python +from paypalserversdk.models.store_in_vault_instruction import StoreInVaultInstruction +from paypalserversdk.models.venmo_payment_token_customer_type import VenmoPaymentTokenCustomerType +from paypalserversdk.models.venmo_payment_token_usage_pattern import VenmoPaymentTokenUsagePattern +from paypalserversdk.models.venmo_payment_token_usage_type import VenmoPaymentTokenUsageType +from paypalserversdk.models.venmo_wallet_vault_attributes import VenmoWalletVaultAttributes + +venmo_wallet_vault_attributes = VenmoWalletVaultAttributes( + store_in_vault=StoreInVaultInstruction.ON_SUCCESS, + usage_type=VenmoPaymentTokenUsageType.MERCHANT, + description='description2', + usage_pattern=VenmoPaymentTokenUsagePattern.THRESHOLD_PREPAID, + customer_type=VenmoPaymentTokenCustomerType.CONSUMER, + permit_multiple_payment_tokens=False +) ``` diff --git a/paypalserversdk/controllers/base_controller.py b/paypalserversdk/controllers/base_controller.py index d9d6fce..a840675 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 UserAgent value.""" - return "PayPal REST API Python SDK, Version: 2.3.0, on OS {os-info}" + return "PayPal REST API Python SDK, Version: 2.4.0, on OS {os-info}" @staticmethod def user_agent_parameters(): diff --git a/paypalserversdk/models/__init__.py b/paypalserversdk/models/__init__.py index 7e61abf..0551a55 100644 --- a/paypalserversdk/models/__init__.py +++ b/paypalserversdk/models/__init__.py @@ -91,6 +91,7 @@ "customer_vault_payment_tokens_response", "cvv_code", "cycle_execution", + "cycle_frequency", "disbursement_mode", "dispute_category", "eci_flag", @@ -104,6 +105,7 @@ "experience_status", "failed_payment_details", "frequency", + "frequency_interval_unit", "fulfillment_type", "giropay_payment_object", "giropay_payment_request", @@ -305,6 +307,7 @@ "subscription_plan_status", "subscription_pricing_model", "subscription_pricing_scheme", + "subscription_status", "subscription_transaction_details", "subscriptions_card_attributes", "subscriptions_card_brand", diff --git a/paypalserversdk/models/billing_cycle.py b/paypalserversdk/models/billing_cycle.py index 0b914b9..5151977 100644 --- a/paypalserversdk/models/billing_cycle.py +++ b/paypalserversdk/models/billing_cycle.py @@ -5,6 +5,9 @@ # ruff: noqa: E501 from paypalserversdk.api_helper import APIHelper +from paypalserversdk.models.cycle_frequency import ( + CycleFrequency, +) from paypalserversdk.models.pricing_scheme import ( PricingScheme, ) @@ -37,6 +40,7 @@ class BillingCycle(object): 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. + frequency (CycleFrequency): The frequency of the terms reset cycle. """ @@ -47,6 +51,7 @@ class BillingCycle(object): "total_cycles": "total_cycles", "sequence": "sequence", "start_date": "start_date", + "frequency": "frequency", } _optionals = [ @@ -54,6 +59,7 @@ class BillingCycle(object): "total_cycles", "sequence", "start_date", + "frequency", ] def __init__( @@ -62,7 +68,8 @@ def __init__( pricing_scheme=APIHelper.SKIP, total_cycles=1, sequence=1, - start_date=APIHelper.SKIP): + start_date=APIHelper.SKIP, + frequency=APIHelper.SKIP): """Initialize a BillingCycle instance.""" # Initialize members of the class self.tenure_type = tenure_type @@ -72,6 +79,8 @@ def __init__( self.sequence = sequence if start_date is not APIHelper.SKIP: self.start_date = start_date + if frequency is not APIHelper.SKIP: + self.frequency = frequency @classmethod def from_dictionary(cls, @@ -112,13 +121,19 @@ def from_dictionary(cls, dictionary.get("start_date")\ if dictionary.get("start_date")\ else APIHelper.SKIP + frequency =\ + CycleFrequency.from_dictionary( + dictionary.get("frequency"))\ + if "frequency" in dictionary.keys()\ + else APIHelper.SKIP # Return an object of this model return cls(tenure_type, pricing_scheme, total_cycles, sequence, - start_date) + start_date, + frequency) def __repr__(self): """Return a unambiguous string representation.""" @@ -143,6 +158,11 @@ def __repr__(self): if hasattr(self, "start_date") else None ) + _frequency=( + self.frequency + if hasattr(self, "frequency") + else None + ) return ( f"{self.__class__.__name__}(" f"tenure_type={_tenure_type!r}, " @@ -150,6 +170,7 @@ def __repr__(self): f"total_cycles={_total_cycles!r}, " f"sequence={_sequence!r}, " f"start_date={_start_date!r}, " + f"frequency={_frequency!r}, " f")" ) @@ -176,6 +197,11 @@ def __str__(self): if hasattr(self, "start_date") else None ) + _frequency=( + self.frequency + if hasattr(self, "frequency") + else None + ) return ( f"{self.__class__.__name__}(" f"tenure_type={_tenure_type!s}, " @@ -183,5 +209,6 @@ def __str__(self): f"total_cycles={_total_cycles!s}, " f"sequence={_sequence!s}, " f"start_date={_start_date!s}, " + f"frequency={_frequency!s}, " f")" ) diff --git a/paypalserversdk/models/cvv_code.py b/paypalserversdk/models/cvv_code.py index d37ecef..15517d8 100644 --- a/paypalserversdk/models/cvv_code.py +++ b/paypalserversdk/models/cvv_code.py @@ -27,7 +27,7 @@ class CvvCode(object): issuer is not certified. CVV_X: For Visa, Mastercard, Discover, or American Express, no response. For Maestro, the service is not available. - ENUM_ALL OTHERS: For Visa, Mastercard, Discover, or American Express, error. + ENUM_ALL_OTHERS: For Visa, Mastercard, Discover, or American Express, error. CVV_0: For Maestro, the CVV2 matched. CVV_1: For Maestro, the CVV2 did not match. CVV_2: For Maestro, the merchant has not implemented CVV2 code handling. diff --git a/paypalserversdk/models/cycle_frequency.py b/paypalserversdk/models/cycle_frequency.py new file mode 100644 index 0000000..2134107 --- /dev/null +++ b/paypalserversdk/models/cycle_frequency.py @@ -0,0 +1,98 @@ +"""paypalserversdk. + +This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +class CycleFrequency(object): + """Implementation of the 'Cycle Frequency' model. + + The frequency of the terms reset cycle. + + Attributes: + interval_unit (FrequencyIntervalUnit): The interval unit at which the the + usage limits will be reset. + interval_count (int): The interval count at which the terms will be reset, + this is ignored if the unit is LIFETIME. + + """ + + # 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): + """Initialize a CycleFrequency instance.""" + # Initialize members of the class + self.interval_unit = interval_unit + self.interval_count = interval_count + + @classmethod + def from_dictionary(cls, + dictionary): + """Create 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 a unambiguous string representation.""" + _interval_unit=self.interval_unit + _interval_count=( + self.interval_count + if hasattr(self, "interval_count") + else None + ) + return ( + f"{self.__class__.__name__}(" + f"interval_unit={_interval_unit!r}, " + f"interval_count={_interval_count!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _interval_unit=self.interval_unit + _interval_count=( + self.interval_count + if hasattr(self, "interval_count") + else None + ) + return ( + f"{self.__class__.__name__}(" + f"interval_unit={_interval_unit!s}, " + f"interval_count={_interval_count!s}, " + f")" + ) diff --git a/paypalserversdk/models/frequency_interval_unit.py b/paypalserversdk/models/frequency_interval_unit.py new file mode 100644 index 0000000..b10d18a --- /dev/null +++ b/paypalserversdk/models/frequency_interval_unit.py @@ -0,0 +1,54 @@ +"""paypalserversdk. + +This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class FrequencyIntervalUnit(object): + """Implementation of the 'Frequency Interval Unit' enum. + + The interval unit at which the the usage limits will be reset. + + Attributes: + DAY: A daily cycle. + WEEK: A weekly cycle. + MONTH: A monthly cycle. + YEAR: A yearly cycle. + LIFETIME: The lifetime of the BA translates to 1 cycle + + """ + + DAY = "DAY" + + WEEK = "WEEK" + + MONTH = "MONTH" + + YEAR = "YEAR" + + LIFETIME = "LIFETIME" + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/paypalserversdk/models/subscription.py b/paypalserversdk/models/subscription.py index dac8ae8..3764780 100644 --- a/paypalserversdk/models/subscription.py +++ b/paypalserversdk/models/subscription.py @@ -53,6 +53,13 @@ class Subscription(object): plan (PlanDetails): The plan details. links (List[LinkDescription]): An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). + status (SubscriptionStatus): The status of the subscription. + status_change_note (str): The reason or notes for the status of the + subscription. + status_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. """ @@ -71,6 +78,9 @@ class Subscription(object): "plan_overridden": "plan_overridden", "plan": "plan", "links": "links", + "status": "status", + "status_change_note": "status_change_note", + "status_update_time": "status_update_time", } _optionals = [ @@ -87,6 +97,9 @@ class Subscription(object): "plan_overridden", "plan", "links", + "status", + "status_change_note", + "status_update_time", ] def __init__( @@ -103,7 +116,10 @@ def __init__( custom_id=APIHelper.SKIP, plan_overridden=APIHelper.SKIP, plan=APIHelper.SKIP, - links=APIHelper.SKIP): + links=APIHelper.SKIP, + status=APIHelper.SKIP, + status_change_note=APIHelper.SKIP, + status_update_time=APIHelper.SKIP): """Initialize a Subscription instance.""" # Initialize members of the class if id is not APIHelper.SKIP: @@ -132,6 +148,12 @@ def __init__( self.plan = plan if links is not APIHelper.SKIP: self.links = links + if status is not APIHelper.SKIP: + self.status = status + if status_change_note is not APIHelper.SKIP: + self.status_change_note = status_change_note + if status_update_time is not APIHelper.SKIP: + self.status_update_time = status_update_time @classmethod def from_dictionary(cls, @@ -211,6 +233,18 @@ def from_dictionary(cls, ] else: links = APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + status_change_note =\ + dictionary.get("status_change_note")\ + if dictionary.get("status_change_note")\ + else APIHelper.SKIP + status_update_time =\ + dictionary.get("status_update_time")\ + if dictionary.get("status_update_time")\ + else APIHelper.SKIP # Return an object of this model return cls(id, @@ -225,7 +259,10 @@ def from_dictionary(cls, custom_id, plan_overridden, plan, - links) + links, + status, + status_change_note, + status_update_time) def __repr__(self): """Return a unambiguous string representation.""" @@ -294,6 +331,21 @@ def __repr__(self): if hasattr(self, "links") else None ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _status_change_note=( + self.status_change_note + if hasattr(self, "status_change_note") + else None + ) + _status_update_time=( + self.status_update_time + if hasattr(self, "status_update_time") + else None + ) return ( f"{self.__class__.__name__}(" f"id={_id!r}, " @@ -309,6 +361,9 @@ def __repr__(self): f"plan_overridden={_plan_overridden!r}, " f"plan={_plan!r}, " f"links={_links!r}, " + f"status={_status!r}, " + f"status_change_note={_status_change_note!r}, " + f"status_update_time={_status_update_time!r}, " f")" ) @@ -379,6 +434,21 @@ def __str__(self): if hasattr(self, "links") else None ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _status_change_note=( + self.status_change_note + if hasattr(self, "status_change_note") + else None + ) + _status_update_time=( + self.status_update_time + if hasattr(self, "status_update_time") + else None + ) return ( f"{self.__class__.__name__}(" f"id={_id!s}, " @@ -394,5 +464,8 @@ def __str__(self): f"plan_overridden={_plan_overridden!s}, " f"plan={_plan!s}, " f"links={_links!s}, " + f"status={_status!s}, " + f"status_change_note={_status_change_note!s}, " + f"status_update_time={_status_update_time!s}, " f")" ) diff --git a/paypalserversdk/models/subscription_status.py b/paypalserversdk/models/subscription_status.py new file mode 100644 index 0000000..76738d7 --- /dev/null +++ b/paypalserversdk/models/subscription_status.py @@ -0,0 +1,58 @@ +"""paypalserversdk. + +This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class SubscriptionStatus(object): + """Implementation of the 'Subscription Status' enum. + + The status of the subscription. + + Attributes: + APPROVAL_PENDING: The subscription is created but not yet approved by the + buyer. + APPROVED: The buyer has approved the subscription. + ACTIVE: The subscription is active. + SUSPENDED: The subscription is suspended. + CANCELLED: The subscription is cancelled. + EXPIRED: The subscription is expired. + + """ + + APPROVAL_PENDING = "APPROVAL_PENDING" + + APPROVED = "APPROVED" + + ACTIVE = "ACTIVE" + + SUSPENDED = "SUSPENDED" + + CANCELLED = "CANCELLED" + + EXPIRED = "EXPIRED" + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/pyproject.toml b/pyproject.toml index 0b0dc4e..33776fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "paypal-server-sdk" description = "PayPal's SDK for interacting with the REST APIs" -version = "2.3.0" +version = "2.4.0" readme = "README.md" keywords = [] authors = []