diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 71c851d..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -## 1.1.0 -- Added new models to support Apple Pay, Google Pay -- Expanded models to support additional optional fields -- Bug fixes -- Documentation updates - -## 1.0.0 -- GA Release for Orders, Payments, and Vault APIs diff --git a/README.md b/README.md index 3fac03e..fe4a466 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,17 @@ ### Important Notes -- **Available Features:** This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future. +- **Available Features:** This SDK currently contains only 5 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future. ### Information The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers: - Orders Controller: [Orders API v2](https://developer.paypal.com/docs/api/orders/v2/) -- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2 +- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2) - Vault Controller: [Payment Method Tokens API v3](https://developer.paypal.com/docs/api/payment-tokens/v3/) *Available in the US only.* +- Transaction Search Controller: [Transaction Search API v1](https://developer.paypal.com/docs/api/transaction-search/v1/) +- Subscriptions Controller: [Subscriptions API v1](https://developer.paypal.com/docs/api/subscriptions/v1/) ## Install the Package @@ -23,43 +25,57 @@ Install the SDK by adding the following dependency in your project's pom.xml fil com.paypal.sdk paypal-server-sdk - 1.1.0 + 2.0.0 ``` You can also view the package at: -https://central.sonatype.com/artifact/com.paypal.sdk/paypal-server-sdk/1.1.0 +https://central.sonatype.com/artifact/com.paypal.sdk/paypal-server-sdk/2.0.0 ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | environment | `Environment` | The API environment.
**Default: `Environment.SANDBOX`** | -| httpClientConfig | [`Consumer`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-client-configuration-builder.md) | Set up Http Client Configuration instance. | -| loggingConfig | [`Consumer`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-logging-configuration-builder.md) | Set up Logging Configuration instance. | -| clientCredentialsAuth | [`ClientCredentialsAuth`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) | The Credentials Setter for OAuth 2 Client Credentials Grant | +| httpClientConfig | [`Consumer`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-client-configuration-builder.md) | Set up Http Client Configuration instance. | +| loggingConfig | [`Consumer`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-logging-configuration-builder.md) | Set up Logging Configuration instance. | +| clientCredentialsAuth | [`ClientCredentialsAuth`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The Credentials Setter for OAuth 2 Client Credentials Grant | The API client can be initialized as follows: ```java -PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() - .loggingConfig(builder -> builder - .level(Level.DEBUG) - .requestConfig(logConfigBuilder -> logConfigBuilder.body(true)) - .responseConfig(logConfigBuilder -> logConfigBuilder.headers(true))) - .httpClientConfig(configBuilder -> configBuilder - .timeout(0)) - .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( - "OAuthClientId", - "OAuthClientSecret" - ) - .build()) - .environment(Environment.SANDBOX) - .build(); +import com.paypal.sdk.Environment; +import com.paypal.sdk.PaypalServerSdkClient; +import com.paypal.sdk.authentication.ClientCredentialsAuthModel; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.http.response.ApiResponse; +import com.paypal.sdk.models.OAuthToken; +import java.io.IOException; +import org.slf4j.event.Level; + +public class Program { + public static void main(String[] args) { + PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() + .loggingConfig(builder -> builder + .level(Level.DEBUG) + .requestConfig(logConfigBuilder -> logConfigBuilder.body(true)) + .responseConfig(logConfigBuilder -> logConfigBuilder.headers(true))) + .httpClientConfig(configBuilder -> configBuilder + .timeout(0)) + .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( + "OAuthClientId", + "OAuthClientSecret" + ) + .build()) + .environment(Environment.SANDBOX) + .build(); + + } +} ``` ## Environments @@ -77,42 +93,46 @@ 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-Java-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) +* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md) ## List of APIs -* [Orders](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/controllers/orders.md) -* [Payments](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/controllers/payments.md) -* [Vault](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/controllers/vault.md) +* [Transactionsearch](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/controllers/transactionsearch.md) +* [Orders](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/controllers/orders.md) +* [Payments](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/controllers/payments.md) +* [Vault](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/controllers/vault.md) +* [Subscriptions](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/controllers/subscriptions.md) ## SDK Infrastructure ### Configuration -* [ApiLoggingConfiguration](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-logging-configuration.md) -* [ApiLoggingConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-logging-configuration-builder.md) -* [ApiRequestLoggingConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-request-logging-configuration-builder.md) -* [ApiResponseLoggingConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-response-logging-configuration-builder.md) -* [Configuration Interface](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/configuration-interface.md) -* [HttpClientConfiguration](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-client-configuration.md) -* [HttpClientConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-client-configuration-builder.md) +* [ApiLoggingConfiguration](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-logging-configuration.md) +* [ApiLoggingConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-logging-configuration-builder.md) +* [ApiRequestLoggingConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-request-logging-configuration-builder.md) +* [ApiResponseLoggingConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-response-logging-configuration-builder.md) +* [Configuration Interface](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/configuration-interface.md) +* [HttpClientConfiguration](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-client-configuration.md) +* [HttpClientConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-client-configuration-builder.md) +* [HttpProxyConfiguration](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-proxy-configuration.md) +* [HttpProxyConfiguration.Builder](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-proxy-configuration-builder.md) ### HTTP -* [Headers](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/headers.md) -* [HttpCallback Interface](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-callback-interface.md) -* [HttpContext](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-context.md) -* [HttpBodyRequest](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-body-request.md) -* [HttpRequest](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-request.md) -* [HttpResponse](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-response.md) -* [HttpStringResponse](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/http-string-response.md) +* [Headers](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/headers.md) +* [HttpCallback Interface](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-callback-interface.md) +* [HttpContext](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-context.md) +* [HttpBodyRequest](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-body-request.md) +* [HttpRequest](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-response.md) +* [HttpStringResponse](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/http-string-response.md) ### Utilities -* [ApiException](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-exception.md) -* [ApiResponse](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-response.md) -* [ApiHelper](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/api-helper.md) -* [FileWrapper](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/file-wrapper.md) -* [JsonObject](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/json-object.md) -* [JsonValue](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/1.1.0/doc/json-value.md) +* [ApiException](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-exception.md) +* [ApiResponse](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-response.md) +* [ApiHelper](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/api-helper.md) +* [FileWrapper](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/file-wrapper.md) +* [JsonObject](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/json-object.md) +* [JsonValue](https://www.github.com/paypal/PayPal-Java-Server-SDK/tree/2.0.0/doc/json-value.md) diff --git a/doc/auth/oauth-2-client-credentials-grant.md b/doc/auth/oauth-2-client-credentials-grant.md index 18e1162..cd6043d 100644 --- a/doc/auth/oauth-2-client-credentials-grant.md +++ b/doc/auth/oauth-2-client-credentials-grant.md @@ -27,13 +27,23 @@ Documentation for accessing and setting credentials for Oauth2. You must initialize the client with *OAuth 2.0 Client Credentials Grant* credentials as shown in the following code snippet. This will fetch the OAuth token automatically when any of the endpoints, requiring *OAuth 2.0 Client Credentials Grant* authentication, are called. ```java -PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() - .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( - "OAuthClientId", - "OAuthClientSecret" - ) - .build()) - .build(); +import com.paypal.sdk.PaypalServerSdkClient; +import com.paypal.sdk.authentication.ClientCredentialsAuthModel; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.models.OAuthToken; +import java.io.IOException; + +public class Program { + public static void main(String[] args) { + PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() + .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( + "OAuthClientId", + "OAuthClientSecret" + ) + .build()) + .build(); + } +} ``` @@ -45,18 +55,27 @@ Your application can also manually provide an OAuthToken using the setter `oAuth Whenever the OAuth Token gets updated, the provided callback implementation will be executed. For instance, you may use it to store your access token whenever it gets updated. ```java -PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() - .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( - "OAuthClientId", - "OAuthClientSecret" - ) - .oAuthOnTokenUpdate(oAuthToken -> { - // Add the callback handler to perform operations like save to DB or file etc. - // It will be triggered whenever the token gets updated - saveTokenToDatabase(oAuthToken); - }) - .build()) - .build(); +import com.paypal.sdk.PaypalServerSdkClient; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.models.OAuthToken; +import java.io.IOException; + +public class Program { + public static void main(String[] args) { + PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() + .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( + "OAuthClientId", + "OAuthClientSecret" + ) + .oAuthOnTokenUpdate(oAuthToken -> { + // Add the callback handler to perform operations like save to DB or file etc. + // It will be triggered whenever the token gets updated + saveTokenToDatabase(oAuthToken); + }) + .build()) + .build(); + } +} ``` ### Adding Custom OAuth Token Provider @@ -64,22 +83,31 @@ PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() To authorize a client using a stored access token, set up the `oAuthTokenProvider` in `ClientCredentialsAuthModel` builder along with the other auth parameters before creating the client: ```java -PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() - .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( - "OAuthClientId", - "OAuthClientSecret" - ) - .oAuthTokenProvider((lastOAuthToken, credentialsManager) -> { - // Add the callback handler to provide a new OAuth token - // It will be triggered whenever the lastOAuthToken is undefined or expired - OAuthToken oAuthToken = loadTokenFromDatabase(); - if (oAuthToken != null && !credentialsManager.isTokenExpired(oAuthToken)) { - return oAuthToken; - } - return credentialsManager.fetchToken(); - }) - .build()) - .build(); +import com.paypal.sdk.PaypalServerSdkClient; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.models.OAuthToken; +import java.io.IOException; + +public class Program { + public static void main(String[] args) { + PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() + .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( + "OAuthClientId", + "OAuthClientSecret" + ) + .oAuthTokenProvider((lastOAuthToken, credentialsManager) -> { + // Add the callback handler to provide a new OAuth token + // It will be triggered whenever the lastOAuthToken is undefined or expired + OAuthToken oAuthToken = loadTokenFromDatabase(); + if (oAuthToken != null && !credentialsManager.isTokenExpired(oAuthToken)) { + return oAuthToken; + } + return credentialsManager.fetchToken(); + }) + .build()) + .build(); + } +} ``` diff --git a/doc/client.md b/doc/client.md index 18deb56..a95d8db 100644 --- a/doc/client.md +++ b/doc/client.md @@ -13,20 +13,34 @@ The following parameters are configurable for the API Client: The API client can be initialized as follows: ```java -PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() - .loggingConfig(builder -> builder - .level(Level.DEBUG) - .requestConfig(logConfigBuilder -> logConfigBuilder.body(true)) - .responseConfig(logConfigBuilder -> logConfigBuilder.headers(true))) - .httpClientConfig(configBuilder -> configBuilder - .timeout(0)) - .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( - "OAuthClientId", - "OAuthClientSecret" - ) - .build()) - .environment(Environment.SANDBOX) - .build(); +import com.paypal.sdk.Environment; +import com.paypal.sdk.PaypalServerSdkClient; +import com.paypal.sdk.authentication.ClientCredentialsAuthModel; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.http.response.ApiResponse; +import com.paypal.sdk.models.OAuthToken; +import java.io.IOException; +import org.slf4j.event.Level; + +public class Program { + public static void main(String[] args) { + PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() + .loggingConfig(builder -> builder + .level(Level.DEBUG) + .requestConfig(logConfigBuilder -> logConfigBuilder.body(true)) + .responseConfig(logConfigBuilder -> logConfigBuilder.headers(true))) + .httpClientConfig(configBuilder -> configBuilder + .timeout(0)) + .clientCredentialsAuth(new ClientCredentialsAuthModel.Builder( + "OAuthClientId", + "OAuthClientSecret" + ) + .build()) + .environment(Environment.SANDBOX) + .build(); + + } +} ``` ## PayPal Server SDKClient Class @@ -40,6 +54,8 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al | `getOrdersController()` | Provides access to Orders controller. | `OrdersController` | | `getPaymentsController()` | Provides access to Payments controller. | `PaymentsController` | | `getVaultController()` | Provides access to Vault controller. | `VaultController` | +| `getTransactionsearchController()` | Provides access to Transactionsearch controller. | `TransactionsearchController` | +| `getSubscriptionsController()` | Provides access to Subscriptions controller. | `SubscriptionsController` | | `getOAuthAuthorizationController()` | Provides access to OAuthAuthorization controller. | `OAuthAuthorizationController` | ### Methods diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md index 333b70d..ea0e562 100644 --- a/doc/controllers/orders.md +++ b/doc/controllers/orders.md @@ -12,54 +12,65 @@ OrdersController ordersController = client.getOrdersController(); ## Methods -* [Patch Order](../../doc/controllers/orders.md#patch-order) -* [Authorize Order](../../doc/controllers/orders.md#authorize-order) -* [Update Order Tracking](../../doc/controllers/orders.md#update-order-tracking) -* [Create Order Tracking](../../doc/controllers/orders.md#create-order-tracking) * [Create Order](../../doc/controllers/orders.md#create-order) -* [Capture Order](../../doc/controllers/orders.md#capture-order) * [Get Order](../../doc/controllers/orders.md#get-order) +* [Patch Order](../../doc/controllers/orders.md#patch-order) * [Confirm Order](../../doc/controllers/orders.md#confirm-order) +* [Authorize Order](../../doc/controllers/orders.md#authorize-order) +* [Capture Order](../../doc/controllers/orders.md#capture-order) +* [Create Order Tracking](../../doc/controllers/orders.md#create-order-tracking) +* [Update Order Tracking](../../doc/controllers/orders.md#update-order-tracking) -# Patch Order +# Create Order -Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

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

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

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

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

**Default**: `"return=minimal"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | | `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`List`](../../doc/models/patch.md) | Body, Optional | - | ## Response Type -`void` +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```java -PatchOrderInput patchOrderInput = new PatchOrderInput.Builder( - "id0", - null -) -.body(Arrays.asList( - new Patch.Builder( - PatchOp.ADD +CreateOrderInput createOrderInput = new CreateOrderInput.Builder( + null, + new OrderRequest.Builder( + CheckoutPaymentIntent.CAPTURE, + Arrays.asList( + new PurchaseUnitRequest.Builder( + new AmountWithBreakdown.Builder( + "currency_code6", + "value0" + ) + .build() + ) + .build() ) - .build() - )) + ) + .build() +) +.prefer("return=minimal") .build(); -ordersController.patchOrderAsync(patchOrderInput).thenAccept(result -> { +ordersController.createOrderAsync(createOrderInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -75,47 +86,41 @@ ordersController.patchOrderAsync(patchOrderInput).thenAccept(result -> { | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Authorize Order +# Get Order -Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors. +Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors. ```java -CompletableFuture> authorizeOrderAsync( - final AuthorizeOrderInput input) +CompletableFuture> getOrderAsync( + final GetOrderInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to authorize.

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

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

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

**Default**: `"return=minimal"`

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

**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```java -AuthorizeOrderInput authorizeOrderInput = new AuthorizeOrderInput.Builder( - "id0", - null +GetOrderInput getOrderInput = new GetOrderInput.Builder( + "id0" ) -.prefer("return=minimal") .build(); -ordersController.authorizeOrderAsync(authorizeOrderInput).thenAccept(result -> { +ordersController.getOrderAsync(getOrderInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -129,32 +134,28 @@ ordersController.authorizeOrderAsync(authorizeOrderInput).thenAccept(result -> { | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Update Order Tracking +# Patch Order -Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported. +Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

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

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypalMockResponse` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | | `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`List`](../../doc/models/patch.md) | Body, Optional | - | +| `body` | [`List`](../../doc/models/patch.md) | Body, Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | ## Response Type @@ -163,9 +164,8 @@ CompletableFuture> updateOrderTrackingAsync( ## Example Usage ```java -UpdateOrderTrackingInput updateOrderTrackingInput = new UpdateOrderTrackingInput.Builder( +PatchOrderInput patchOrderInput = new PatchOrderInput.Builder( "id0", - "tracker_id2", null ) .body(Arrays.asList( @@ -176,7 +176,7 @@ UpdateOrderTrackingInput updateOrderTrackingInput = new UpdateOrderTrackingInput )) .build(); -ordersController.updateOrderTrackingAsync(updateOrderTrackingInput).thenAccept(result -> { +ordersController.patchOrderAsync(patchOrderInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -191,29 +191,30 @@ ordersController.updateOrderTrackingAsync(updateOrderTrackingInput).thenAccept(r | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Order Tracking +# Confirm Order -Adds tracking information for an Order. +Payer confirms their intent to pay for the the Order with the given payment source. ```java -CompletableFuture> createOrderTrackingAsync( - final CreateOrderTrackingInput input) +CompletableFuture> confirmOrderAsync( + final ConfirmOrderInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.

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

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

**Default**: `"return=minimal"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | +| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | ## Response Type @@ -222,18 +223,14 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The ## Example Usage ```java -CreateOrderTrackingInput createOrderTrackingInput = new CreateOrderTrackingInput.Builder( +ConfirmOrderInput confirmOrderInput = new ConfirmOrderInput.Builder( "id0", - null, - new OrderTrackerRequest.Builder( - "capture_id8" - ) - .notifyPayer(false) - .build() + null ) +.prefer("return=minimal") .build(); -ordersController.createOrderTrackingAsync(createOrderTrackingInput).thenAccept(result -> { +ordersController.confirmOrderAsync(confirmOrderInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -249,61 +246,47 @@ ordersController.createOrderTrackingAsync(createOrderTrackingInput).thenAccept(r | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Order +# Authorize Order -Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 errors. +Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors. ```java -CompletableFuture> createOrderAsync( - final CreateOrderInput input) +CompletableFuture> authorizeOrderAsync( + final AuthorizeOrderInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | +| `id` | `String` | Template, Required | The ID of the order for which to authorize.

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

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

**Default**: `"return=minimal"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | +| `paypalClientMetadataId` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). ## Example Usage ```java -CreateOrderInput createOrderInput = new CreateOrderInput.Builder( - null, - new OrderRequest.Builder( - CheckoutPaymentIntent.CAPTURE, - Arrays.asList( - new PurchaseUnitRequest.Builder( - new AmountWithBreakdown.Builder( - "currency_code6", - "value0" - ) - .build() - ) - .build() - ) - ) - .build() +AuthorizeOrderInput authorizeOrderInput = new AuthorizeOrderInput.Builder( + "id0", + null ) .prefer("return=minimal") .build(); -ordersController.createOrderAsync(createOrderInput).thenAccept(result -> { +ordersController.authorizeOrderAsync(authorizeOrderInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -319,7 +302,10 @@ ordersController.createOrderAsync(createOrderInput).thenAccept(result -> { | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -381,23 +367,22 @@ ordersController.captureOrderAsync(captureOrderInput).thenAccept(result -> { | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Order +# Create Order Tracking -Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors. +Adds tracking information for an Order. ```java -CompletableFuture> getOrderAsync( - final GetOrderInput input) +CompletableFuture> createOrderTrackingAsync( + final CreateOrderTrackingInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to show details.

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

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

**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type @@ -406,12 +391,18 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The ## Example Usage ```java -GetOrderInput getOrderInput = new GetOrderInput.Builder( - "id0" +CreateOrderTrackingInput createOrderTrackingInput = new CreateOrderTrackingInput.Builder( + "id0", + null, + new OrderTrackerRequest.Builder( + "capture_id8" + ) + .notifyPayer(false) + .build() ) .build(); -ordersController.getOrderAsync(getOrderInput).thenAccept(result -> { +ordersController.createOrderTrackingAsync(createOrderTrackingInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -425,45 +416,53 @@ ordersController.getOrderAsync(getOrderInput).thenAccept(result -> { | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Confirm Order +# Update Order Tracking -Payer confirms their intent to pay for the the Order with the given payment source. +Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported. ```java -CompletableFuture> confirmOrderAsync( - final ConfirmOrderInput input) +CompletableFuture> updateOrderTrackingAsync( + final UpdateOrderTrackingInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which the payer confirms their intent to pay.

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

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

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

**Default**: `"return=minimal"`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | -| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | +| `body` | [`List`](../../doc/models/patch.md) | Body, Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +`void` ## Example Usage ```java -ConfirmOrderInput confirmOrderInput = new ConfirmOrderInput.Builder( +UpdateOrderTrackingInput updateOrderTrackingInput = new UpdateOrderTrackingInput.Builder( "id0", + "tracker_id2", null ) -.prefer("return=minimal") +.body(Arrays.asList( + new Patch.Builder( + PatchOp.ADD + ) + .build() + )) .build(); -ordersController.confirmOrderAsync(confirmOrderInput).thenAccept(result -> { +ordersController.updateOrderTrackingAsync(updateOrderTrackingInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -479,6 +478,7 @@ ordersController.confirmOrderAsync(confirmOrderInput).thenAccept(result -> { | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | diff --git a/doc/controllers/payments.md b/doc/controllers/payments.md index 6448ba3..2580ecc 100644 --- a/doc/controllers/payments.md +++ b/doc/controllers/payments.md @@ -12,53 +12,45 @@ PaymentsController paymentsController = client.getPaymentsController(); ## Methods +* [Get Authorized Payment](../../doc/controllers/payments.md#get-authorized-payment) * [Capture Authorized Payment](../../doc/controllers/payments.md#capture-authorized-payment) -* [Get Captured Payment](../../doc/controllers/payments.md#get-captured-payment) * [Reauthorize Payment](../../doc/controllers/payments.md#reauthorize-payment) * [Void Payment](../../doc/controllers/payments.md#void-payment) +* [Get Captured Payment](../../doc/controllers/payments.md#get-captured-payment) * [Refund Captured Payment](../../doc/controllers/payments.md#refund-captured-payment) -* [Get Authorized Payment](../../doc/controllers/payments.md#get-authorized-payment) * [Get Refund](../../doc/controllers/payments.md#get-refund) -# Capture Authorized Payment +# Get Authorized Payment -Captures an authorized payment, by ID. +Shows details for an authorized payment, by ID. ```java -CompletableFuture> captureAuthorizedPaymentAsync( - final CaptureAuthorizedPaymentInput input) +CompletableFuture> getAuthorizedPaymentAsync( + final GetAuthorizedPaymentInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorizationId` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | +| `authorizationId` | `String` | Template, Required | The ID of the authorized payment for which to show details. | | `paypalMockResponse` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 45 days. | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `"return=minimal"` | | `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | -| `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). ## Example Usage ```java -CaptureAuthorizedPaymentInput captureAuthorizedPaymentInput = new CaptureAuthorizedPaymentInput.Builder( - "authorization_id8", - null +GetAuthorizedPaymentInput getAuthorizedPaymentInput = new GetAuthorizedPaymentInput.Builder( + "authorization_id8" ) -.prefer("return=minimal") -.body(new CaptureRequest.Builder() - .finalCapture(false) - .build()) .build(); -paymentsController.captureAuthorizedPaymentAsync(captureAuthorizedPaymentInput).thenAccept(result -> { +paymentsController.getAuthorizedPaymentAsync(getAuthorizedPaymentInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -72,31 +64,32 @@ paymentsController.captureAuthorizedPaymentAsync(captureAuthorizedPaymentInput). | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 409 | The server has detected a conflict while processing this request. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The request failed because it is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Captured Payment +# Capture Authorized Payment -Shows details for a captured payment, by ID. +Captures an authorized payment, by ID. ```java -CompletableFuture> getCapturedPaymentAsync( - final GetCapturedPaymentInput input) +CompletableFuture> captureAuthorizedPaymentAsync( + final CaptureAuthorizedPaymentInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `captureId` | `String` | Template, Required | The PayPal-generated ID for the captured payment for which to show details. | +| `authorizationId` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | | `paypalMockResponse` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 45 days. | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `"return=minimal"` | +| `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | +| `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type @@ -105,12 +98,17 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The ## Example Usage ```java -GetCapturedPaymentInput getCapturedPaymentInput = new GetCapturedPaymentInput.Builder( - "capture_id2" +CaptureAuthorizedPaymentInput captureAuthorizedPaymentInput = new CaptureAuthorizedPaymentInput.Builder( + "authorization_id8", + null ) +.prefer("return=minimal") +.body(new CaptureRequest.Builder() + .finalCapture(false) + .build()) .build(); -paymentsController.getCapturedPaymentAsync(getCapturedPaymentInput).thenAccept(result -> { +paymentsController.captureAuthorizedPaymentAsync(captureAuthorizedPaymentInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -124,16 +122,19 @@ paymentsController.getCapturedPaymentAsync(getCapturedPaymentInput).thenAccept(r | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | +| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 409 | The server has detected a conflict while processing this request. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The request failed because it is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | # Reauthorize Payment -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. Note: This request is currently not supported for Partner use cases. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. ```java CompletableFuture> reauthorizePaymentAsync( @@ -180,6 +181,7 @@ paymentsController.reauthorizePaymentAsync(reauthorizePaymentInput).thenAccept(r | --- | --- | --- | | 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | @@ -241,41 +243,35 @@ paymentsController.voidPaymentAsync(voidPaymentInput).thenAccept(result -> { | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Refund Captured Payment +# Get Captured Payment -Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body. +Shows details for a captured payment, by ID. ```java -CompletableFuture> refundCapturedPaymentAsync( - final RefundCapturedPaymentInput input) +CompletableFuture> getCapturedPaymentAsync( + final GetCapturedPaymentInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `captureId` | `String` | Template, Required | The PayPal-generated ID for the captured payment to refund. | +| `captureId` | `String` | Template, Required | The PayPal-generated ID for the captured payment for which to show details. | | `paypalMockResponse` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 45 days. | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `"return=minimal"` | -| `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | -| `body` | [`RefundRequest`](../../doc/models/refund-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). ## Example Usage ```java -RefundCapturedPaymentInput refundCapturedPaymentInput = new RefundCapturedPaymentInput.Builder( - "capture_id2", - null +GetCapturedPaymentInput getCapturedPaymentInput = new GetCapturedPaymentInput.Builder( + "capture_id2" ) -.prefer("return=minimal") .build(); -paymentsController.refundCapturedPaymentAsync(refundCapturedPaymentInput).thenAccept(result -> { +paymentsController.getCapturedPaymentAsync(getCapturedPaymentInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -289,46 +285,48 @@ paymentsController.refundCapturedPaymentAsync(refundCapturedPaymentInput).thenAc | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Authorized Payment +# Refund Captured Payment -Shows details for an authorized payment, by ID. +Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body. ```java -CompletableFuture> getAuthorizedPaymentAsync( - final GetAuthorizedPaymentInput input) +CompletableFuture> refundCapturedPaymentAsync( + final RefundCapturedPaymentInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorizationId` | `String` | Template, Required | The ID of the authorized payment for which to show details. | +| `captureId` | `String` | Template, Required | The PayPal-generated ID for the captured payment to refund. | | `paypalMockResponse` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 45 days. | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `"return=minimal"` | | `paypalAuthAssertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | +| `body` | [`RefundRequest`](../../doc/models/refund-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). ## Example Usage ```java -GetAuthorizedPaymentInput getAuthorizedPaymentInput = new GetAuthorizedPaymentInput.Builder( - "authorization_id8" +RefundCapturedPaymentInput refundCapturedPaymentInput = new RefundCapturedPaymentInput.Builder( + "capture_id2", + null ) +.prefer("return=minimal") .build(); -paymentsController.getAuthorizedPaymentAsync(getAuthorizedPaymentInput).thenAccept(result -> { +paymentsController.refundCapturedPaymentAsync(refundCapturedPaymentInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -342,8 +340,12 @@ paymentsController.getAuthorizedPaymentAsync(getAuthorizedPaymentInput).thenAcce | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | +| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `ApiException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md new file mode 100644 index 0000000..e29fe41 --- /dev/null +++ b/doc/controllers/subscriptions.md @@ -0,0 +1,958 @@ +# Subscriptions + +Use the `/subscriptions` resource to create, update, retrieve, and cancel subscriptions and their associated plans. + +```java +SubscriptionsController subscriptionsController = client.getSubscriptionsController(); +``` + +## Class Name + +`SubscriptionsController` + +## Methods + +* [Create Billing Plan](../../doc/controllers/subscriptions.md#create-billing-plan) +* [List Billing Plans](../../doc/controllers/subscriptions.md#list-billing-plans) +* [Get Billing Plan](../../doc/controllers/subscriptions.md#get-billing-plan) +* [Patch Billing Plan](../../doc/controllers/subscriptions.md#patch-billing-plan) +* [Activate Billing Plan](../../doc/controllers/subscriptions.md#activate-billing-plan) +* [Deactivate Billing Plan](../../doc/controllers/subscriptions.md#deactivate-billing-plan) +* [Update Billing Plan Pricing Schemes](../../doc/controllers/subscriptions.md#update-billing-plan-pricing-schemes) +* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) +* [List Subscriptions](../../doc/controllers/subscriptions.md#list-subscriptions) +* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) +* [Patch Subscription](../../doc/controllers/subscriptions.md#patch-subscription) +* [Revise Subscription](../../doc/controllers/subscriptions.md#revise-subscription) +* [Suspend Subscription](../../doc/controllers/subscriptions.md#suspend-subscription) +* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) +* [Activate Subscription](../../doc/controllers/subscriptions.md#activate-subscription) +* [Capture Subscription](../../doc/controllers/subscriptions.md#capture-subscription) +* [List Subscription Transactions](../../doc/controllers/subscriptions.md#list-subscription-transactions) + + +# Create Billing Plan + +Creates a plan that defines pricing and billing cycle details for subscriptions. + +```java +CompletableFuture> createBillingPlanAsync( + final CreateBillingPlanInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `"return=minimal"` | +| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 72 hours. | +| `body` | [`PlanRequest`](../../doc/models/plan-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`BillingPlan`](../../doc/models/billing-plan.md). + +## Example Usage + +```java +CreateBillingPlanInput createBillingPlanInput = new CreateBillingPlanInput.Builder( + null +) +.prefer("return=minimal") +.body(new PlanRequest.Builder( + "product_id2", + "name6", + Arrays.asList( + new SubscriptionBillingCycle.Builder( + new Frequency.Builder( + IntervalUnit.DAY + ) + .intervalCount(1) + .build(), + TenureType.REGULAR, + 8 + ) + .totalCycles(1) + .build() + ), + new PaymentPreferences.Builder() + .autoBillOutstanding(true) + .setupFeeFailureAction(SetupFeeFailureAction.CANCEL) + .paymentFailureThreshold(0) + .build() + ) + .status(PlanRequestStatus.ACTIVE) + .quantitySupported(false) + .build()) +.build(); + +subscriptionsController.createBillingPlanAsync(createBillingPlanInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Billing Plans + +Lists billing plans. + +```java +CompletableFuture> listBillingPlansAsync( + final ListBillingPlansInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, name, description and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `"return=minimal"` | +| `productId` | `String` | Query, Optional | Filters the response by a Product ID.

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

**Default**: `10`

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

**Default**: `1`

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

**Default**: `false` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PlanCollection`](../../doc/models/plan-collection.md). + +## Example Usage + +```java +ListBillingPlansInput listBillingPlansInput = new ListBillingPlansInput.Builder() + .prefer("return=minimal") + .pageSize(10) + .page(1) + .totalRequired(false) + .build(); + +subscriptionsController.listBillingPlansAsync(listBillingPlansInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Get Billing Plan + +Shows details for a plan, by ID. + +```java +CompletableFuture> getBillingPlanAsync( + final String id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`BillingPlan`](../../doc/models/billing-plan.md). + +## Example Usage + +```java +String id = "id0"; + +subscriptionsController.getBillingPlanAsync(id).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Patch Billing Plan + +Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` plan, you can make only status updates. You can patch these attributes and objects: Attribute or object Operations description replace payment_preferences.auto_bill_outstanding replace taxes.percentage replace payment_preferences.payment_failure_threshold replace payment_preferences.setup_fee replace payment_preferences.setup_fee_failure_action replace name replace + +```java +CompletableFuture> patchBillingPlanAsync( + final PatchBillingPlanInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | +| `body` | [`List`](../../doc/models/patch.md) | Body, Optional | - | + +## Response Type + +`void` + +## Example Usage + +```java +PatchBillingPlanInput patchBillingPlanInput = new PatchBillingPlanInput.Builder( + "id0", + null +) +.body(Arrays.asList( + new Patch.Builder( + PatchOp.ADD + ) + .build() + )) +.build(); + +subscriptionsController.patchBillingPlanAsync(patchBillingPlanInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Activate Billing Plan + +Activates a plan, by ID. + +```java +CompletableFuture> activateBillingPlanAsync( + final String id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | + +## Response Type + +`void` + +## Example Usage + +```java +String id = "id0"; + +subscriptionsController.activateBillingPlanAsync(id).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Deactivate Billing Plan + +Deactivates a plan, by ID. + +```java +CompletableFuture> deactivateBillingPlanAsync( + final String id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | + +## Response Type + +`void` + +## Example Usage + +```java +String id = "id0"; + +subscriptionsController.deactivateBillingPlanAsync(id).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Update Billing Plan Pricing Schemes + +Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month. + +```java +CompletableFuture> updateBillingPlanPricingSchemesAsync( + final UpdateBillingPlanPricingSchemesInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID for the plan. | +| `body` | [`UpdatePricingSchemesRequest`](../../doc/models/update-pricing-schemes-request.md) | Body, Optional | - | + +## Response Type + +`void` + +## Example Usage + +```java +UpdateBillingPlanPricingSchemesInput updateBillingPlanPricingSchemesInput = new UpdateBillingPlanPricingSchemesInput.Builder( + "id0", + null +) +.body(new UpdatePricingSchemesRequest.Builder( + Arrays.asList( + new UpdatePricingScheme.Builder( + 34, + new SubscriptionPricingScheme.Builder() + .build() + ) + .build() + ) + ) + .build()) +.build(); + +subscriptionsController.updateBillingPlanPricingSchemesAsync(updateBillingPlanPricingSchemesInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Create Subscription + +Creates a subscription. + +```java +CompletableFuture> createSubscriptionAsync( + final CreateSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Subscription`](../../doc/models/subscription.md). + +## Example Usage + +```java +CreateSubscriptionInput createSubscriptionInput = new CreateSubscriptionInput.Builder( + null +) +.prefer("return=minimal") +.body(new CreateSubscriptionRequest.Builder( + "plan_id8" + ) + .autoRenewal(false) + .build()) +.build(); + +subscriptionsController.createSubscriptionAsync(createSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Subscriptions + +List all subscriptions for merchant account. + +```java +CompletableFuture> listSubscriptionsAsync( + final ListSubscriptionsInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `planIds` | `String` | Query, Optional | Filters the response by list of plan IDs. Filter supports upto 70 plan IDs. URLs should not exceed a length of 2000 characters. | +| `statuses` | `String` | Query, Optional | Filters the response by list of subscription statuses.

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

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `createdBefore` | `String` | Query, Optional | Filters the response by subscription creation end time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `statusUpdatedBefore` | `String` | Query, Optional | Filters the response by status update start time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `statusUpdatedAfter` | `String` | Query, Optional | Filters the response by status update end time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `filter` | `String` | Query, Optional | Filter the response using complex expressions that could use comparison operators like ge, gt, le, lt and logical operators such as 'and' and 'or'.

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

**Default**: `10`

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

**Default**: `1`

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10`, *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SubscriptionCollection`](../../doc/models/subscription-collection.md). + +## Example Usage + +```java +ListSubscriptionsInput listSubscriptionsInput = new ListSubscriptionsInput.Builder() + .pageSize(10) + .page(1) + .build(); + +subscriptionsController.listSubscriptionsAsync(listSubscriptionsInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Get Subscription + +Shows details for a subscription, by ID. + +```java +CompletableFuture> getSubscriptionAsync( + final GetSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `fields` | `String` | Query, Optional | List of fields that are to be returned in the response. Possible value for fields are last_failed_payment and plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`Subscription`](../../doc/models/subscription.md). + +## Example Usage + +```java +GetSubscriptionInput getSubscriptionInput = new GetSubscriptionInput.Builder( + "id0" +) +.build(); + +subscriptionsController.getSubscriptionAsync(getSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Patch Subscription + +Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan level default attributes by providing customised values for plan path in the patch request. You cannot update attributes that have already completed (Example - trial cycles can’t be updated if completed). Once overridden, changes to plan resource will not impact subscription. Any price update will not impact billing cycles within next 10 days (Applicable only for subscriptions funded by PayPal account). Following are the fields eligible for patch. Attribute or object Operations billing_info.outstanding_balance replace custom_id add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.fixed_price add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace plan.billing_cycles[@sequence==n]. total_cycles replace plan.payment_preferences. auto_bill_outstanding replace plan.payment_preferences. payment_failure_threshold replace plan.taxes.inclusive add,replace plan.taxes.percentage add,replace shipping_amount add,replace start_time replace subscriber.shipping_address add,replace subscriber.payment_source (for subscriptions funded by card payments) replace + +```java +CompletableFuture> patchSubscriptionAsync( + final PatchSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID for the subscription. | +| `body` | [`List`](../../doc/models/patch.md) | Body, Optional | - | + +## Response Type + +`void` + +## Example Usage + +```java +PatchSubscriptionInput patchSubscriptionInput = new PatchSubscriptionInput.Builder( + "id0", + null +) +.body(Arrays.asList( + new Patch.Builder( + PatchOp.ADD + ) + .build() + )) +.build(); + +subscriptionsController.patchSubscriptionAsync(patchSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Revise Subscription + +Updates the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount`, `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +```java +CompletableFuture> reviseSubscriptionAsync( + final ReviseSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`ModifySubscriptionRequest`](../../doc/models/modify-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`ModifySubscriptionResponse`](../../doc/models/modify-subscription-response.md). + +## Example Usage + +```java +ReviseSubscriptionInput reviseSubscriptionInput = new ReviseSubscriptionInput.Builder( + "id0", + null +) +.build(); + +subscriptionsController.reviseSubscriptionAsync(reviseSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Suspend Subscription + +Suspends the subscription. + +```java +CompletableFuture> suspendSubscriptionAsync( + final SuspendSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`SuspendSubscription`](../../doc/models/suspend-subscription.md) | Body, Optional | - | + +## Response Type + +`void` + +## Example Usage + +```java +SuspendSubscriptionInput suspendSubscriptionInput = new SuspendSubscriptionInput.Builder( + "id0", + null +) +.build(); + +subscriptionsController.suspendSubscriptionAsync(suspendSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Cancel Subscription + +Cancels the subscription. + +```java +CompletableFuture> cancelSubscriptionAsync( + final CancelSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`CancelSubscriptionRequest`](../../doc/models/cancel-subscription-request.md) | Body, Optional | - | + +## Response Type + +`void` + +## Example Usage + +```java +CancelSubscriptionInput cancelSubscriptionInput = new CancelSubscriptionInput.Builder( + "id0", + null +) +.build(); + +subscriptionsController.cancelSubscriptionAsync(cancelSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Activate Subscription + +Activates the subscription. + +```java +CompletableFuture> activateSubscriptionAsync( + final ActivateSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`ActivateSubscriptionRequest`](../../doc/models/activate-subscription-request.md) | Body, Optional | - | + +## Response Type + +`void` + +## Example Usage + +```java +ActivateSubscriptionInput activateSubscriptionInput = new ActivateSubscriptionInput.Builder( + "id0", + null +) +.build(); + +subscriptionsController.activateSubscriptionAsync(activateSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Capture Subscription + +Captures an authorized payment from the subscriber on the subscription. + +```java +CompletableFuture> captureSubscriptionAsync( + final CaptureSubscriptionInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 72 hours. | +| `body` | [`CaptureSubscriptionRequest`](../../doc/models/capture-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SubscriptionTransactionDetails`](../../doc/models/subscription-transaction-details.md). + +## Example Usage + +```java +CaptureSubscriptionInput captureSubscriptionInput = new CaptureSubscriptionInput.Builder( + "id0", + null +) +.build(); + +subscriptionsController.captureSubscriptionAsync(captureSubscriptionInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Subscription Transactions + +Lists transactions for a subscription. + +```java +CompletableFuture> listSubscriptionTransactionsAsync( + final ListSubscriptionTransactionsInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `startTime` | `String` | Query, Required | The start time of the range of transactions to list.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `endTime` | `String` | Query, Required | The end time of the range of transactions to list.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`TransactionsList`](../../doc/models/transactions-list.md). + +## Example Usage + +```java +ListSubscriptionTransactionsInput listSubscriptionTransactionsInput = new ListSubscriptionTransactionsInput.Builder( + "id0", + "start_time6", + "end_time2" +) +.build(); + +subscriptionsController.listSubscriptionTransactionsAsync(listSubscriptionTransactionsInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + diff --git a/doc/controllers/transactionsearch.md b/doc/controllers/transactionsearch.md new file mode 100644 index 0000000..4574ea7 --- /dev/null +++ b/doc/controllers/transactionsearch.md @@ -0,0 +1,123 @@ +# Transactionsearch + +```java +TransactionsearchController transactionsearchController = client.getTransactionsearchController(); +``` + +## Class Name + +`TransactionsearchController` + +## Methods + +* [Search Transactions](../../doc/controllers/transactionsearch.md#search-transactions) +* [Search Balances](../../doc/controllers/transactionsearch.md#search-balances) + + +# Search Transactions + +Lists transactions. Specify one or more query parameters to filter the transaction that appear in the response. Notes: If you specify one or more optional query parameters, the ending_balance response field is empty. It takes a maximum of three hours for executed transactions to appear in the list transactions call. This call lists transaction for the previous three years. + +```java +CompletableFuture> searchTransactionsAsync( + final SearchTransactionsInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `startDate` | `String` | Query, Required | Filters the transactions in the response by a start date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `endDate` | `String` | Query, Required | Filters the transactions in the response by an end date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional. The maximum supported range is 31 days.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `transactionId` | `String` | Query, Optional | Filters the transactions in the response by a PayPal transaction ID. A valid transaction ID is 17 characters long, except for an order ID, which is 19 characters long. Note: A transaction ID is not unique in the reporting system. The response can list two transactions with the same ID. One transaction can be balance affecting while the other is non-balance affecting.

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

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

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

**Default**: `100`

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

**Default**: `1`

**Constraints**: `>= 1`, `<= 2147483647` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SearchResponse`](../../doc/models/search-response.md). + +## Example Usage + +```java +SearchTransactionsInput searchTransactionsInput = new SearchTransactionsInput.Builder( + "start_date6", + "end_date0" +) +.fields("transaction_info") +.balanceAffectingRecordsOnly("Y") +.pageSize(100) +.page(1) +.build(); + +transactionsearchController.searchTransactionsAsync(searchTransactionsInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| Default | The error response. | [`SearchErrorException`](../../doc/models/search-error-exception.md) | + + +# Search Balances + +List all balances. Specify date time to list balances for that time that appear in the response. Notes: It takes a maximum of three hours for balances to appear in the list balances call. This call lists balances upto the previous three years. + +```java +CompletableFuture> searchBalancesAsync( + final SearchBalancesInput input) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `asOfTime` | `String` | Query, Optional | List balances in the response at the date time provided, will return the last refreshed balance in the system when not provided.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `currencyCode` | `String` | Query, Optional | Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`BalancesResponse`](../../doc/models/balances-response.md). + +## Example Usage + +```java +SearchBalancesInput searchBalancesInput = new SearchBalancesInput.Builder() + .build(); + +transactionsearchController.searchBalancesAsync(searchBalancesInput).thenAccept(result -> { + // TODO success callback handler + System.out.println(result); +}).exceptionally(exception -> { + // TODO failure callback handler + exception.printStackTrace(); + return null; +}); +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | The request is not well-formed, is syntactically incorrect, or violates schema. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| 500 | An internal server error occurred. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| Default | The error response. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | + diff --git a/doc/controllers/vault.md b/doc/controllers/vault.md index 3c50cfc..866ecae 100644 --- a/doc/controllers/vault.md +++ b/doc/controllers/vault.md @@ -12,39 +12,48 @@ VaultController vaultController = client.getVaultController(); ## Methods -* [Delete Payment Token](../../doc/controllers/vault.md#delete-payment-token) -* [Create Setup Token](../../doc/controllers/vault.md#create-setup-token) -* [Get Setup Token](../../doc/controllers/vault.md#get-setup-token) * [Create Payment Token](../../doc/controllers/vault.md#create-payment-token) * [List Customer Payment Tokens](../../doc/controllers/vault.md#list-customer-payment-tokens) * [Get Payment Token](../../doc/controllers/vault.md#get-payment-token) +* [Delete Payment Token](../../doc/controllers/vault.md#delete-payment-token) +* [Create Setup Token](../../doc/controllers/vault.md#create-setup-token) +* [Get Setup Token](../../doc/controllers/vault.md#get-setup-token) -# Delete Payment Token +# Create Payment Token -Delete the payment token associated with the payment token id. +Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. ```java -CompletableFuture> deletePaymentTokenAsync( - final String id) +CompletableFuture> createPaymentTokenAsync( + final CreatePaymentTokenInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the payment token.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108`, *Pattern*: `^.*$` | ## Response Type -`void` +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). ## Example Usage ```java -String id = "id0"; +CreatePaymentTokenInput createPaymentTokenInput = new CreatePaymentTokenInput.Builder( + null, + new PaymentTokenRequest.Builder( + new PaymentTokenRequestPaymentSource.Builder() + .build() + ) + .build() +) +.build(); -vaultController.deletePaymentTokenAsync(id).thenAccept(result -> { +vaultController.createPaymentTokenAsync(createPaymentTokenInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -60,43 +69,45 @@ vaultController.deletePaymentTokenAsync(id).thenAccept(result -> { | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Setup Token +# List Customer Payment Tokens -Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer. +Returns all payment tokens for a customer. ```java -CompletableFuture> createSetupTokenAsync( - final CreateSetupTokenInput input) +CompletableFuture> listCustomerPaymentTokensAsync( + final ListCustomerPaymentTokensInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`SetupTokenRequest`](../../doc/models/setup-token-request.md) | Body, Required | Setup Token creation with a instrument type optional financial instrument details and customer_id. | -| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 3 hours.

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

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

**Default**: `5`

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

**Default**: `1`

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

**Default**: `false` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`CustomerVaultPaymentTokensResponse`](../../doc/models/customer-vault-payment-tokens-response.md). ## Example Usage ```java -CreateSetupTokenInput createSetupTokenInput = new CreateSetupTokenInput.Builder( - null, - new SetupTokenRequest.Builder( - new SetupTokenRequestPaymentSource.Builder() - .build() - ) - .build() +ListCustomerPaymentTokensInput listCustomerPaymentTokensInput = new ListCustomerPaymentTokensInput.Builder( + "customer_id8" ) +.pageSize(5) +.page(1) +.totalRequired(false) .build(); -vaultController.createSetupTokenAsync(createSetupTokenInput).thenAccept(result -> { +vaultController.listCustomerPaymentTokensAsync(listCustomerPaymentTokensInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -112,16 +123,15 @@ vaultController.createSetupTokenAsync(createSetupTokenInput).thenAccept(result - | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Setup Token +# Get Payment Token -Returns a readable representation of temporarily vaulted payment source associated with the setup token id. +Returns a readable representation of vaulted payment source associated with the payment token id. ```java -CompletableFuture> getSetupTokenAsync( +CompletableFuture> getPaymentTokenAsync( final String id) ``` @@ -129,18 +139,18 @@ CompletableFuture> getSetupTokenAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the setup token.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). ## Example Usage ```java String id = "id0"; -vaultController.getSetupTokenAsync(id).thenAccept(result -> { +vaultController.getPaymentTokenAsync(id).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -160,40 +170,31 @@ vaultController.getSetupTokenAsync(id).thenAccept(result -> { | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Payment Token +# Delete Payment Token -Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. +Delete the payment token associated with the payment token id. ```java -CompletableFuture> createPaymentTokenAsync( - final CreatePaymentTokenInput input) +CompletableFuture> deletePaymentTokenAsync( + final String id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. | -| `paypalRequestId` | `String` | Header, Optional | The server stores keys for 3 hours.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +`void` ## Example Usage ```java -CreatePaymentTokenInput createPaymentTokenInput = new CreatePaymentTokenInput.Builder( - null, - new PaymentTokenRequest.Builder( - new PaymentTokenRequestPaymentSource.Builder() - .build() - ) - .build() -) -.build(); +String id = "id0"; -vaultController.createPaymentTokenAsync(createPaymentTokenInput).thenAccept(result -> { +vaultController.deletePaymentTokenAsync(id).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -209,45 +210,43 @@ vaultController.createPaymentTokenAsync(createPaymentTokenInput).thenAccept(resu | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# List Customer Payment Tokens +# Create Setup Token -Returns all payment tokens for a customer. +Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer. ```java -CompletableFuture> listCustomerPaymentTokensAsync( - final ListCustomerPaymentTokensInput input) +CompletableFuture> createSetupTokenAsync( + final CreateSetupTokenInput input) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `String` | Query, Required | A unique identifier representing a specific customer in merchant's/partner's system or records.

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

**Default**: `5`

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

**Default**: `1`

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108`, *Pattern*: `^.*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`CustomerVaultPaymentTokensResponse`](../../doc/models/customer-vault-payment-tokens-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). ## Example Usage ```java -ListCustomerPaymentTokensInput listCustomerPaymentTokensInput = new ListCustomerPaymentTokensInput.Builder( - "customer_id8" +CreateSetupTokenInput createSetupTokenInput = new CreateSetupTokenInput.Builder( + null, + new SetupTokenRequest.Builder( + new SetupTokenRequestPaymentSource.Builder() + .build() + ) + .build() ) -.pageSize(5) -.page(1) -.totalRequired(false) .build(); -vaultController.listCustomerPaymentTokensAsync(listCustomerPaymentTokensInput).thenAccept(result -> { +vaultController.createSetupTokenAsync(createSetupTokenInput).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { @@ -263,15 +262,16 @@ vaultController.listCustomerPaymentTokensAsync(listCustomerPaymentTokensInput).t | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Payment Token +# Get Setup Token -Returns a readable representation of vaulted payment source associated with the payment token id. +Returns a readable representation of temporarily vaulted payment source associated with the setup token id. ```java -CompletableFuture> getPaymentTokenAsync( +CompletableFuture> getSetupTokenAsync( final String id) ``` @@ -279,18 +279,18 @@ CompletableFuture> getPaymentTokenAsync( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the payment token.

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

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `getResult()` getter of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). ## Example Usage ```java String id = "id0"; -vaultController.getPaymentTokenAsync(id).thenAccept(result -> { +vaultController.getSetupTokenAsync(id).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { diff --git a/doc/http-client-configuration-builder.md b/doc/http-client-configuration-builder.md index 27777c3..e631b75 100644 --- a/doc/http-client-configuration-builder.md +++ b/doc/http-client-configuration-builder.md @@ -23,5 +23,6 @@ Class to build instances of [HttpClientConfiguration](../doc/http-client-configu | `shouldRetryOnTimeout(boolean shouldRetryOnTimeout)` | Sets whether to retry on request timeout. | `HttpClientConfiguration.Builder` | | `httpClientInstance(okhttp3.OkHttpClient httpClientInstance)` | Sets the okhttpclient instance used to make the http calls. | `HttpClientConfiguration.Builder` | | `httpClientInstance(okhttp3.OkHttpClient httpClientInstance, boolean overrideHttpClientConfigurations)` | Sets the okhttpclient instance used to make the http calls and an option to Allow the SDK to override HTTP client instance's settings used for features like retries, timeouts etc. | `HttpClientConfiguration.Builder` | +| proxyConfig([HttpProxyConfiguration.Builder](../doc/http-proxy-configuration-builder.md) proxyBuilder) | Sets the proxy configuration for the underlying HTTP client. | `HttpClientConfiguration.Builder` | | `build()` | Builds a new HttpClientConfiguration object using the set fields. | [`HttpClientConfiguration`](../doc/http-client-configuration.md) | diff --git a/doc/http-client-configuration.md b/doc/http-client-configuration.md index eabd480..4189cd7 100644 --- a/doc/http-client-configuration.md +++ b/doc/http-client-configuration.md @@ -17,6 +17,7 @@ Class for holding http client configuration. | `shouldRetryOnTimeout()` | Whether to retry on request timeout. | `boolean` | | `getHttpClientInstance()` | The OkHttpClient instance used to make the HTTP calls. | `okhttp3.OkHttpClient` | | `shouldOverrideHttpClientConfigurations()` | Allow the SDK to override HTTP client instance's settings used for features like retries, timeouts etc. | `boolean` | +| `getProxyConfig()` | The proxy configuration settings used by the HTTP client. | [`HttpProxyConfiguration`](../doc/http-proxy-configuration.md) | | `toString()` | Converts this HttpClientConfiguration into string format. | `String` | | `newBuilder()` | Builds a new {@link HttpClientConfiguration.Builder} object. Creates the instance with the current state. | [`HttpClientConfiguration.Builder`](../doc/http-client-configuration-builder.md) | diff --git a/doc/http-proxy-configuration-builder.md b/doc/http-proxy-configuration-builder.md new file mode 100644 index 0000000..08e6bf8 --- /dev/null +++ b/doc/http-proxy-configuration-builder.md @@ -0,0 +1,36 @@ + +# HttpProxyConfiguration.Builder + +Class to build instances of [HttpProxyConfiguration](../doc/http-proxy-configuration.md). + +## Constructors + +| Name | Description | +| --- | --- | +| `Builder()` | Default Constructor to initiate builder with default properties. | + +## Methods + +| Name | Description | Return Type | +| --- | --- | --- | +| `Builder(String address, int port)` | Constructs HttpProxyConfiguration.Builder with proxy address and port. | `HttpProxyConfiguration.Builder` | +| `auth(String username, String password)` | Sets the username and password for proxy auth. | `HttpProxyConfiguration.Builder` | +| `build()` | Builds a new HttpProxyConfiguration object using the set fields. | [`HttpProxyConfiguration`](../doc/http-proxy-configuration.md) | + +### Client Initialization with Proxy Configuration + +To configure the SDK to use a proxy server, initialize the proxy configuration during client setup as shown in the Usage Example. + +## Usage Example + +```java +import com.paypal.sdk.PaypalServerSdkClient; +import com.paypal.sdk.http.client.HttpProxyConfiguration; + +PaypalServerSdkClient client = new PaypalServerSdkClient.Builder() + .httpClientConfig(configBuilder -> configBuilder + .proxyConfig(new HttpProxyConfiguration.Builder("http://localhost", + 8080).auth("username", "password"))) + .build(); +``` + diff --git a/doc/http-proxy-configuration.md b/doc/http-proxy-configuration.md new file mode 100644 index 0000000..a04f59a --- /dev/null +++ b/doc/http-proxy-configuration.md @@ -0,0 +1,16 @@ + +# HttpProxyConfiguration + +Class for holding http proxy configuration. + +## Methods + +| Name | Description | Return Type | +| --- | --- | --- | +| `getAddress()` | The proxy server address. | `String` | +| `getPort()` | The proxy server port. | `String` | +| `getUsername()` | The username used for proxy authentication. | `String` | +| `getPassword()` | The password used for proxy authentication. | `String` | +| `toString()` | Converts this HttpProxyConfiguration into string format. | `String` | +| `newBuilder()` | Builds a new HttpProxyConfiguration.Builder object. Creates the instance with the current state. | [`HttpProxyConfiguration.Builder`](../doc/http-proxy-configuration-builder.md) | + diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md new file mode 100644 index 0000000..6d9a755 --- /dev/null +++ b/doc/models/activate-subscription-request.md @@ -0,0 +1,23 @@ + +# Activate Subscription Request + +The activate subscription request details. + +## Structure + +`ActivateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Reason` | `String` | Optional | The reason for activation of a subscription. Required to reactivate the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | String getReason() | setReason(String reason) | + +## Example (as JSON) + +```json +{ + "reason": "reason4" +} +``` + diff --git a/doc/models/amount-breakdown.md b/doc/models/amount-breakdown.md index 1cd6de3..d4a9981 100644 --- a/doc/models/amount-breakdown.md +++ b/doc/models/amount-breakdown.md @@ -17,7 +17,7 @@ The breakdown of the amount. Breakdown provides details such as total item amoun | `TaxTotal` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTaxTotal() | setTaxTotal(Money taxTotal) | | `Insurance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getInsurance() | setInsurance(Money insurance) | | `ShippingDiscount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingDiscount() | setShippingDiscount(Money shippingDiscount) | -| `Discount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getDiscount() | setDiscount(Money discount) | +| `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. | Money getDiscount() | setDiscount(Money discount) | ## Example (as JSON) diff --git a/doc/models/app-switch-context.md b/doc/models/app-switch-context.md new file mode 100644 index 0000000..5c0f8a6 --- /dev/null +++ b/doc/models/app-switch-context.md @@ -0,0 +1,31 @@ + +# App Switch Context + +Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. + +## Structure + +`AppSwitchContext` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `NativeApp` | [`NativeAppContext`](../../doc/models/native-app-context.md) | Optional | Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. | NativeAppContext getNativeApp() | setNativeApp(NativeAppContext nativeApp) | +| `MobileWeb` | [`MobileWebContext`](../../doc/models/mobile-web-context.md) | Optional | Buyer's mobile web browser context to app switch to the PayPal consumer app. | MobileWebContext getMobileWeb() | setMobileWeb(MobileWebContext mobileWeb) | + +## Example (as JSON) + +```json +{ + "native_app": { + "os_type": "IOS", + "os_version": "os_version0" + }, + "mobile_web": { + "return_flow": "AUTO", + "buyer_user_agent": "buyer_user_agent8" + } +} +``` + diff --git a/doc/models/apple-pay-card-response.md b/doc/models/apple-pay-card-response.md index a0f51ff..593c42c 100644 --- a/doc/models/apple-pay-card-response.md +++ b/doc/models/apple-pay-card-response.md @@ -31,9 +31,9 @@ The Card from Apple Pay Wallet used to fund the payment. { "name": "name4", "last_digits": "last_digits8", - "brand": "HIPER", + "brand": "ACCEL", "available_networks": [ - "RUPAY" + "STAR_ACCESS" ], "type": "DEBIT" } diff --git a/doc/models/apple-pay-card.md b/doc/models/apple-pay-card.md index f70ec5c..9bb5e8f 100644 --- a/doc/models/apple-pay-card.md +++ b/doc/models/apple-pay-card.md @@ -24,7 +24,7 @@ The payment card to be used to fund a payment. Can be a credit or debit card. "name": "name4", "last_digits": "last_digits8", "type": "UNKNOWN", - "brand": "AMEX", + "brand": "SWITCH", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/apple-pay-decrypted-token-data.md b/doc/models/apple-pay-decrypted-token-data.md index a848075..3fd391a 100644 --- a/doc/models/apple-pay-decrypted-token-data.md +++ b/doc/models/apple-pay-decrypted-token-data.md @@ -29,7 +29,7 @@ Information about the Payment data obtained by decrypting Apple Pay token. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id2", diff --git a/doc/models/apple-pay-payment-token.md b/doc/models/apple-pay-payment-token.md index a28db05..6ea3998 100644 --- a/doc/models/apple-pay-payment-token.md +++ b/doc/models/apple-pay-payment-token.md @@ -21,7 +21,7 @@ A resource representing a response for Apple Pay. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/apple-pay-request-card.md b/doc/models/apple-pay-request-card.md new file mode 100644 index 0000000..a972525 --- /dev/null +++ b/doc/models/apple-pay-request-card.md @@ -0,0 +1,34 @@ + +# Apple Pay Request Card + +The payment card to be used to fund a payment. Can be a credit or debit card. + +## Structure + +`ApplePayRequestCard` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Type` | [`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_]+$` | CardType getType() | setType(CardType type) | +| `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_]+$` | CardBrand getBrand() | setBrand(CardBrand brand) | +| `BillingAddress` | [`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). | Address getBillingAddress() | setBillingAddress(Address billingAddress) | + +## Example (as JSON) + +```json +{ + "type": "PREPAID", + "brand": "PULSE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } +} +``` + diff --git a/doc/models/apple-pay-request.md b/doc/models/apple-pay-request.md index c3eacfe..c80d3ce 100644 --- a/doc/models/apple-pay-request.md +++ b/doc/models/apple-pay-request.md @@ -40,7 +40,7 @@ Information needed to pay using ApplePay. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", diff --git a/doc/models/apple-pay-tokenized-card.md b/doc/models/apple-pay-tokenized-card.md index a94aba3..2c9250b 100644 --- a/doc/models/apple-pay-tokenized-card.md +++ b/doc/models/apple-pay-tokenized-card.md @@ -14,7 +14,7 @@ The payment card to use to fund a payment. Can be a credit or debit card. | `Name` | `String` | Optional | The card holder's name as it appears on the card.

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

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | String getNumber() | setNumber(String number) | | `Expiry` | `String` | 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])$` | String getExpiry() | setExpiry(String expiry) | -| `CardType` | [`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_]+$` | CardBrand getCardType() | setCardType(CardBrand cardType) | +| `CardType` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card brand or network. Typically used in the response.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | CardBrand getCardType() | setCardType(CardBrand cardType) | | `Type` | [`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_]+$` | CardType getType() | setType(CardType type) | | `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_]+$` | CardBrand getBrand() | setBrand(CardBrand brand) | | `BillingAddress` | [`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). | Address getBillingAddress() | setBillingAddress(Address billingAddress) | diff --git a/doc/models/application-context-user-action.md b/doc/models/application-context-user-action.md new file mode 100644 index 0000000..6ed3fbd --- /dev/null +++ b/doc/models/application-context-user-action.md @@ -0,0 +1,16 @@ + +# Application Context User Action + +Configures the label name to `Continue` or `Subscribe Now` for subscription consent experience. + +## Enumeration + +`ApplicationContextUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `Continue` | After you redirect the customer to the PayPal subscription consent page, a Continue button appears. Use this option when you want to control the activation of the subscription and do not want PayPal to activate the subscription. | +| `SubscribeNow` | After you redirect the customer to the PayPal subscription consent page, a Subscribe Now button appears. Use this option when you want PayPal to activate the subscription. | + diff --git a/doc/models/auction-information.md b/doc/models/auction-information.md new file mode 100644 index 0000000..a0b73e3 --- /dev/null +++ b/doc/models/auction-information.md @@ -0,0 +1,29 @@ + +# Auction Information + +The auction information. + +## Structure + +`AuctionInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `AuctionSite` | `String` | Optional | The name of the auction site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getAuctionSite() | setAuctionSite(String auctionSite) | +| `AuctionItemSite` | `String` | Optional | The auction site URL.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getAuctionItemSite() | setAuctionItemSite(String auctionItemSite) | +| `AuctionBuyerId` | `String` | 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_'\-., ":;\!?]*$` | String getAuctionBuyerId() | setAuctionBuyerId(String auctionBuyerId) | +| `AuctionClosingDate` | `String` | 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})$` | String getAuctionClosingDate() | setAuctionClosingDate(String auctionClosingDate) | + +## Example (as JSON) + +```json +{ + "auction_site": "auction_site6", + "auction_item_site": "auction_item_site8", + "auction_buyer_id": "auction_buyer_id0", + "auction_closing_date": "auction_closing_date0" +} +``` + diff --git a/doc/models/authorization-with-additional-data.md b/doc/models/authorization-with-additional-data.md index 8588c38..8314a11 100644 --- a/doc/models/authorization-with-additional-data.md +++ b/doc/models/authorization-with-additional-data.md @@ -17,7 +17,7 @@ The authorization with additional payment details, such as risk assessment and p | `Amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAmount() | setAmount(Money amount) | | `InvoiceId` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | String getInvoiceId() | setInvoiceId(String invoiceId) | | `CustomId` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | String getCustomId() | setCustomId(String customId) | -| `NetworkTransactionReference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransactionReference getNetworkTransactionReference() | setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) | +| `NetworkTransactionReference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransaction getNetworkTransactionReference() | setNetworkTransactionReference(NetworkTransaction networkTransactionReference) | | `SellerProtection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | SellerProtection getSellerProtection() | setSellerProtection(SellerProtection sellerProtection) | | `ExpirationTime` | `String` | 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})$` | String getExpirationTime() | setExpirationTime(String expirationTime) | | `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | diff --git a/doc/models/authorization.md b/doc/models/authorization.md index 01762b5..ef0736d 100644 --- a/doc/models/authorization.md +++ b/doc/models/authorization.md @@ -17,7 +17,7 @@ The authorized payment transaction. | `Amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAmount() | setAmount(Money amount) | | `InvoiceId` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | String getInvoiceId() | setInvoiceId(String invoiceId) | | `CustomId` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | String getCustomId() | setCustomId(String customId) | -| `NetworkTransactionReference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransactionReference getNetworkTransactionReference() | setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) | +| `NetworkTransactionReference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransaction getNetworkTransactionReference() | setNetworkTransactionReference(NetworkTransaction networkTransactionReference) | | `SellerProtection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | SellerProtection getSellerProtection() | setSellerProtection(SellerProtection sellerProtection) | | `ExpirationTime` | `String` | 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})$` | String getExpirationTime() | setExpirationTime(String expirationTime) | | `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | diff --git a/doc/models/balance-information.md b/doc/models/balance-information.md new file mode 100644 index 0000000..dbdafdd --- /dev/null +++ b/doc/models/balance-information.md @@ -0,0 +1,40 @@ + +# Balance Information + +The Balance information. + +## Structure + +`BalanceInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Currency` | `String` | Required | The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | String getCurrency() | setCurrency(String currency) | +| `Primary` | `Boolean` | Optional | Optional field representing if the currency is primary currency or not. | Boolean getPrimary() | setPrimary(Boolean primary) | +| `TotalBalance` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTotalBalance() | setTotalBalance(Money totalBalance) | +| `AvailableBalance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAvailableBalance() | setAvailableBalance(Money availableBalance) | +| `WithheldBalance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getWithheldBalance() | setWithheldBalance(Money withheldBalance) | + +## Example (as JSON) + +```json +{ + "currency": "currency4", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } +} +``` + diff --git a/doc/models/balances-response.md b/doc/models/balances-response.md new file mode 100644 index 0000000..b623a0d --- /dev/null +++ b/doc/models/balances-response.md @@ -0,0 +1,78 @@ + +# Balances Response + +The balances response information. + +## Structure + +`BalancesResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Balances` | [`List`](../../doc/models/balance-information.md) | Optional | An array of balance detail objects.

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

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | String getAccountId() | setAccountId(String accountId) | +| `AsOfTime` | `String` | 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})$` | String getAsOfTime() | setAsOfTime(String asOfTime) | +| `LastRefreshTime` | `String` | 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})$` | String getLastRefreshTime() | setLastRefreshTime(String lastRefreshTime) | + +## Example (as JSON) + +```json +{ + "balances": [ + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + }, + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + }, + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + } + ], + "account_id": "account_id0", + "as_of_time": "as_of_time2", + "last_refresh_time": "last_refresh_time0" +} +``` + diff --git a/doc/models/bank-request.md b/doc/models/bank-request.md new file mode 100644 index 0000000..026ebf3 --- /dev/null +++ b/doc/models/bank-request.md @@ -0,0 +1,34 @@ + +# Bank Request + +A Resource representing a request to vault a Bank used for ACH Debit. + +## Structure + +`BankRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `AchDebit` | `JsonValue` | Optional | A Resource representing a request to vault a ACH Debit. | JsonValue getAchDebit() | setAchDebit(JsonValue achDebit) | +| `SepaDebit` | [`SepaDebitRequest`](../../doc/models/sepa-debit-request.md) | Optional | An API resource denoting a request to securely store a SEPA Debit. | SepaDebitRequest getSepaDebit() | setSepaDebit(SepaDebitRequest sepaDebit) | + +## Example (as JSON) + +```json +{ + "ach_debit": { + "key1": "val1", + "key2": "val2" + }, + "sepa_debit": { + "experience_context": { + "locale": "locale6", + "return_url": "return_url4", + "cancel_url": "cancel_url6" + } + } +} +``` + diff --git a/doc/models/billing-cycle-override.md b/doc/models/billing-cycle-override.md new file mode 100644 index 0000000..2bebea4 --- /dev/null +++ b/doc/models/billing-cycle-override.md @@ -0,0 +1,61 @@ + +# Billing Cycle Override + +The billing cycle details to override at subscription level. The subscription billing cycle definition has to adhere to the plan billing cycle definition. + +## Structure + +`BillingCycleOverride` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `PricingScheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Optional | The pricing scheme details. | SubscriptionPricingScheme getPricingScheme() | setPricingScheme(SubscriptionPricingScheme pricingScheme) | +| `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` | int getSequence() | setSequence(int sequence) | +| `TotalCycles` | `Integer` | 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` | Integer getTotalCycles() | setTotalCycles(Integer totalCycles) | + +## Example (as JSON) + +```json +{ + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 58, + "total_cycles": 248 +} +``` + diff --git a/doc/models/billing-cycle.md b/doc/models/billing-cycle.md index cf1c62d..5dbb4be 100644 --- a/doc/models/billing-cycle.md +++ b/doc/models/billing-cycle.md @@ -13,7 +13,6 @@ The billing cycle providing details of the billing frequency, amount, duration a | --- | --- | --- | --- | --- | --- | | `TenureType` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | TenureType getTenureType() | setTenureType(TenureType tenureType) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The pricing scheme details. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | -| `Frequency` | `JsonValue` | Optional | The frequency details for this billing cycle. | JsonValue getFrequency() | setFrequency(JsonValue frequency) | | `TotalCycles` | `Integer` | 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` | Integer getTotalCycles() | setTotalCycles(Integer totalCycles) | | `Sequence` | `Integer` | 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` | Integer getSequence() | setSequence(Integer sequence) | | `StartDate` | `String` | 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])$` | String getStartDate() | setStartDate(String startDate) | @@ -36,10 +35,6 @@ The billing cycle providing details of the billing frequency, amount, duration a "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date0" } ``` diff --git a/doc/models/billing-plan.md b/doc/models/billing-plan.md new file mode 100644 index 0000000..0f117bb --- /dev/null +++ b/doc/models/billing-plan.md @@ -0,0 +1,40 @@ + +# Billing Plan + +The plan details. + +## Structure + +`BillingPlan` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Id` | `String` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | String getId() | setId(String id) | +| `ProductId` | `String` | Optional | The ID for the product.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | String getProductId() | setProductId(String productId) | +| `Name` | `String` | Optional | The plan name.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | SubscriptionPlanStatus getStatus() | setStatus(SubscriptionPlanStatus status) | +| `Description` | `String` | Optional | The detailed description of the plan.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | List getBillingCycles() | setBillingCycles(List billingCycles) | +| `PaymentPreferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Optional | The payment preferences for a subscription. | PaymentPreferences getPaymentPreferences() | setPaymentPreferences(PaymentPreferences paymentPreferences) | +| `MerchantPreferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | MerchantPreferences getMerchantPreferences() | setMerchantPreferences(MerchantPreferences merchantPreferences) | +| `Taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | Taxes getTaxes() | setTaxes(Taxes taxes) | +| `QuantitySupported` | `Boolean` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `false` | Boolean getQuantitySupported() | setQuantitySupported(Boolean quantitySupported) | +| `CreateTime` | `String` | 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})$` | String getCreateTime() | setCreateTime(String createTime) | +| `UpdateTime` | `String` | 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})$` | String getUpdateTime() | setUpdateTime(String updateTime) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

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

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

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

**Default**: `ShippingPreference.GET_FROM_FILE`

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

**Default**: `ExperienceContextShippingPreference.GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | ExperienceContextShippingPreference getShippingPreference() | setShippingPreference(ExperienceContextShippingPreference shippingPreference) | | `ReturnUrl` | `String` | Optional | Describes the URL. | String getReturnUrl() | setReturnUrl(String returnUrl) | | `CancelUrl` | `String` | Optional | Describes the URL. | String getCancelUrl() | setCancelUrl(String cancelUrl) | | `ConsumerIp` | `String` | 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*$` | String getConsumerIp() | setConsumerIp(String consumerIp) | diff --git a/doc/models/cancel-subscription-request.md b/doc/models/cancel-subscription-request.md new file mode 100644 index 0000000..829fe46 --- /dev/null +++ b/doc/models/cancel-subscription-request.md @@ -0,0 +1,23 @@ + +# Cancel Subscription Request + +The cancel subscription request details. + +## Structure + +`CancelSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Reason` | `String` | Required | The reason for the cancellation of a subscription.

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

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

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

**Constraints**: *Maximum Length*: `127` | String getInvoiceId() | setInvoiceId(String invoiceId) | | `FinalCapture` | `Boolean` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `false` | Boolean getFinalCapture() | setFinalCapture(Boolean finalCapture) | | `PaymentInstruction` | [`CapturePaymentInstruction`](../../doc/models/capture-payment-instruction.md) | Optional | Any additional payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. | CapturePaymentInstruction getPaymentInstruction() | setPaymentInstruction(CapturePaymentInstruction paymentInstruction) | +| `NoteToPayer` | `String` | 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` | String getNoteToPayer() | setNoteToPayer(String noteToPayer) | | `SoftDescriptor` | `String` | Optional | The payment descriptor on the payer's account statement.

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

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

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

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

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

**Default**: `DisbursementMode.INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | DisbursementMode getDisbursementMode() | setDisbursementMode(DisbursementMode disbursementMode) | | `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | -| `ProcessorResponse` | [`PaymentsProcessorResponse`](../../doc/models/payments-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | PaymentsProcessorResponse getProcessorResponse() | setProcessorResponse(PaymentsProcessorResponse processorResponse) | +| `ProcessorResponse` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | ProcessorResponse getProcessorResponse() | setProcessorResponse(ProcessorResponse processorResponse) | | `CreateTime` | `String` | 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})$` | String getCreateTime() | setCreateTime(String createTime) | | `UpdateTime` | `String` | 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})$` | String getUpdateTime() | setUpdateTime(String updateTime) | | `SupplementaryData` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | PaymentSupplementaryData getSupplementaryData() | setSupplementaryData(PaymentSupplementaryData supplementaryData) | diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md index 0e7c566..a66d291 100644 --- a/doc/models/card-brand.md +++ b/doc/models/card-brand.md @@ -35,5 +35,10 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `Ge` | The GE Credit Union 3Point card payment network. | | `Synchrony` | The Synchrony Financial (SYF) payment network. | | `Eftpos` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | +| `CarteBancaire` | The Carte Bancaire payment network. | +| `StarAccess` | The Star Access payment network. | +| `Pulse` | The Pulse payment network. | +| `Nyce` | The NYCE payment network. | +| `Accel` | The Accel payment network. | | `Unknown` | UNKNOWN payment network. | diff --git a/doc/models/card-customer.md b/doc/models/card-customer.md new file mode 100644 index 0000000..f474f55 --- /dev/null +++ b/doc/models/card-customer.md @@ -0,0 +1,34 @@ + +# Card Customer + +The details about a customer in PayPal's system of record. + +## Structure + +`CardCustomer` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | String getId() | setId(String id) | +| `EmailAddress` | `String` | 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])+)\])`` | String getEmailAddress() | setEmailAddress(String emailAddress) | +| `Phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | PhoneWithType getPhone() | setPhone(PhoneWithType phone) | +| `MerchantCustomerId` | `String` | 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-_.^*$@#]+$` | String getMerchantCustomerId() | setMerchantCustomerId(String merchantCustomerId) | + +## Example (as JSON) + +```json +{ + "id": "id2", + "email_address": "email_address0", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "merchant_customer_id": "merchant_customer_id4" +} +``` + diff --git a/doc/models/card-response-with-billing-address.md b/doc/models/card-response-with-billing-address.md new file mode 100644 index 0000000..06cc1cb --- /dev/null +++ b/doc/models/card-response-with-billing-address.md @@ -0,0 +1,36 @@ + +# Card Response With Billing Address + +The payment card used to fund the payment. Card can be a credit or debit card. + +## Structure + +`CardResponseWithBillingAddress` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | `String` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `300` | String getName() | setName(String name) | +| `BillingAddress` | [`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). | Address getBillingAddress() | setBillingAddress(Address billingAddress) | +| `Expiry` | `String` | 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])$` | String getExpiry() | setExpiry(String expiry) | +| `CurrencyCode` | `String` | Optional | The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies the currency.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | StoredPaymentSourcePaymentType getPaymentType() | setPaymentType(StoredPaymentSourcePaymentType paymentType) | | `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**: `StoredPaymentSourceUsageType.DERIVED`

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

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

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | String getDate() | setDate(String date) | -| `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_]+$` | CardBrand getNetwork() | setNetwork(CardBrand network) | -| `Time` | `String` | 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})$` | String getTime() | setTime(String time) | +| `Network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | DEPRECATED. This field is DEPRECATED. Please find the network data in the 'network' field under the 'network_transaction_reference' object instead of the 'verification' object.

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

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | String getTime() | setTime(String time) | | `Amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAmount() | setAmount(Money amount) | | `ProcessorResponse` | [`CardVerificationProcessorResponse`](../../doc/models/card-verification-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | CardVerificationProcessorResponse getProcessorResponse() | setProcessorResponse(CardVerificationProcessorResponse processorResponse) | | `ThreeDSecure` | `JsonValue` | 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. | JsonValue getThreeDSecure() | setThreeDSecure(JsonValue threeDSecure) | @@ -25,7 +25,7 @@ Card Verification details including the authorization details and 3D SECURE deta { "network_transaction_id": "network_transaction_id4", "date": "date8", - "network": "EFTPOS", + "network": "ACCEL", "time": "time2", "amount": { "currency_code": "currency_code6", diff --git a/doc/models/cart-information.md b/doc/models/cart-information.md new file mode 100644 index 0000000..7296439 --- /dev/null +++ b/doc/models/cart-information.md @@ -0,0 +1,35 @@ + +# Cart Information + +The cart information. + +## Structure + +`CartInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `ItemDetails` | [`List`](../../doc/models/item-details.md) | Optional | An array of item details.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | List getItemDetails() | setItemDetails(List itemDetails) | +| `TaxInclusive` | `Boolean` | Optional | Indicates whether the item amount or the shipping amount already includes tax.

**Default**: `false` | Boolean getTaxInclusive() | setTaxInclusive(Boolean taxInclusive) | +| `PaypalInvoiceId` | `String` | Optional | The ID of the invoice. Appears for only PayPal-generated invoices.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getCheckoutOptionName() | setCheckoutOptionName(String checkoutOptionName) | +| `CheckoutOptionValue` | `String` | 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_'\-., ":;\!?]*$` | String getCheckoutOptionValue() | setCheckoutOptionValue(String checkoutOptionValue) | + +## Example (as JSON) + +```json +{ + "checkout_option_name": "checkout_option_name6", + "checkout_option_value": "checkout_option_value0" +} +``` + diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md index 2279ac3..3341f1e 100644 --- a/doc/models/confirm-order-request.md +++ b/doc/models/confirm-order-request.md @@ -97,7 +97,7 @@ Payer confirms the intent to pay for the Order using the provided payment source "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md new file mode 100644 index 0000000..c3dcd00 --- /dev/null +++ b/doc/models/create-subscription-request.md @@ -0,0 +1,82 @@ + +# Create Subscription Request + +The create subscription request details. + +## Structure + +`CreateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `PlanId` | `String` | Required | The ID of the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | String getPlanId() | setPlanId(String planId) | +| `StartTime` | `String` | 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})$` | String getStartTime() | setStartTime(String startTime) | +| `Quantity` | `String` | Optional | The quantity of the product in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | String getQuantity() | setQuantity(String quantity) | +| `ShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingAmount() | setShippingAmount(Money shippingAmount) | +| `Subscriber` | [`SubscriberRequest`](../../doc/models/subscriber-request.md) | Optional | The subscriber request information . | SubscriberRequest getSubscriber() | setSubscriber(SubscriberRequest subscriber) | +| `AutoRenewal` | `Boolean` | Optional | DEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete.

**Default**: `false` | Boolean getAutoRenewal() | setAutoRenewal(Boolean autoRenewal) | +| `ApplicationContext` | [`SubscriptionApplicationContext`](../../doc/models/subscription-application-context.md) | Optional | DEPRECATED. The application context, which customizes the payer experience during the subscription approval process with PayPal. | SubscriptionApplicationContext getApplicationContext() | setApplicationContext(SubscriptionApplicationContext applicationContext) | +| `CustomId` | `String` | Optional | The custom id for the subscription. Can be invoice id.

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

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

**Constraints**: `>= 0`, `<= 99` | int getSequence() | setSequence(int sequence) | +| `CyclesCompleted` | `int` | Required | The number of billing cycles that have completed.

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

**Constraints**: `>= 0`, `<= 9999` | Integer getCyclesRemaining() | setCyclesRemaining(Integer cyclesRemaining) | +| `CurrentPricingSchemeVersion` | `Integer` | Optional | The active pricing scheme version for the billing cycle.

**Constraints**: `>= 1`, `<= 99` | Integer getCurrentPricingSchemeVersion() | setCurrentPricingSchemeVersion(Integer currentPricingSchemeVersion) | +| `TotalCycles` | `Integer` | 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` | Integer getTotalCycles() | setTotalCycles(Integer totalCycles) | + +## Example (as JSON) + +```json +{ + "tenure_type": "REGULAR", + "sequence": 99, + "cycles_completed": 172, + "cycles_remaining": 208, + "current_pricing_scheme_version": 99, + "total_cycles": 60 +} +``` + diff --git a/doc/models/default-error-exception.md b/doc/models/default-error-exception.md new file mode 100644 index 0000000..a16287d --- /dev/null +++ b/doc/models/default-error-exception.md @@ -0,0 +1,47 @@ + +# Default Error Exception + +The error details. + +## Structure + +`DefaultErrorException` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | `String` | Required | The human-readable, unique name of the error. | String getName() | setName(String name) | +| `Message` | `String` | Required | The message that describes the error. | String getMessageField() | setMessageField(String messageField) | +| `DebugId` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | String getDebugId() | setDebugId(String debugId) | +| `InformationLink` | `String` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | String getInformationLink() | setInformationLink(String informationLink) | +| `Details` | [`List`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | List getDetails() | setDetails(List details) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | + +## Example (as JSON) + +```json +{ + "name": "name2", + "message": "message2", + "debug_id": "debug_id8", + "information_link": "information_link4", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/experience-context-shipping-preference.md b/doc/models/experience-context-shipping-preference.md new file mode 100644 index 0000000..0efcd63 --- /dev/null +++ b/doc/models/experience-context-shipping-preference.md @@ -0,0 +1,17 @@ + +# Experience Context Shipping Preference + +The location from which the shipping address is derived., The shipping preference. This only applies to PayPal payment source., The shipping preference. This only applies to PayPal payment source., The location from which the shipping address is derived. + +## Enumeration + +`ExperienceContextShippingPreference` + +## Fields + +| Name | Description | +| --- | --- | +| `GetFromFile` | Get the customer-provided shipping address on the PayPal site. | +| `NoShipping` | Redacts the shipping address from the PayPal site. Recommended for digital goods. | +| `SetProvidedAddress` | Merchant sends the shipping address using purchase_units.shipping.address. The customer cannot change this address on the PayPal site. | + diff --git a/doc/models/experience-context.md b/doc/models/experience-context.md index cd5abd3..02810f0 100644 --- a/doc/models/experience-context.md +++ b/doc/models/experience-context.md @@ -13,7 +13,7 @@ Customizes the payer experience during the approval process for the payment. | --- | --- | --- | --- | --- | --- | | `BrandName` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

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

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

**Default**: `ShippingPreference.GET_FROM_FILE`

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

**Default**: `ExperienceContextShippingPreference.GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | ExperienceContextShippingPreference getShippingPreference() | setShippingPreference(ExperienceContextShippingPreference shippingPreference) | | `ReturnUrl` | `String` | Optional | Describes the URL. | String getReturnUrl() | setReturnUrl(String returnUrl) | | `CancelUrl` | `String` | Optional | Describes the URL. | String getCancelUrl() | setCancelUrl(String cancelUrl) | diff --git a/doc/models/experience-status.md b/doc/models/experience-status.md new file mode 100644 index 0000000..22023cb --- /dev/null +++ b/doc/models/experience-status.md @@ -0,0 +1,18 @@ + +# Experience Status + +This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process. + +## Enumeration + +`ExperienceStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `NotStarted` | PayPal checkout process has not yet begun. | +| `InProgress` | PayPal checkout initiated. User is on the checkout page for order review before approval. | +| `Canceled` | PayPal checkout is canceled (by closing the checkout window or clicking cancel) before the order approval. | +| `Approved` | Order is approved. User has completed the checkout process. | + diff --git a/doc/models/failed-payment-details.md b/doc/models/failed-payment-details.md new file mode 100644 index 0000000..5d394bd --- /dev/null +++ b/doc/models/failed-payment-details.md @@ -0,0 +1,32 @@ + +# Failed Payment Details + +The details for the failed payment of the subscription. + +## Structure + +`FailedPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAmount() | setAmount(Money amount) | +| `Time` | `String` | 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})$` | String getTime() | setTime(String time) | +| `ReasonCode` | [`ReasonCode`](../../doc/models/reason-code.md) | Optional | The reason code for the payment failure.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `120`, *Pattern*: `^[A-Z_]+$` | ReasonCode getReasonCode() | setReasonCode(ReasonCode reasonCode) | +| `NextPaymentRetryTime` | `String` | 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})$` | String getNextPaymentRetryTime() | setNextPaymentRetryTime(String nextPaymentRetryTime) | + +## Example (as JSON) + +```json +{ + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time6", + "reason_code": "TRANSACTION_RECEIVING_LIMIT_EXCEEDED", + "next_payment_retry_time": "next_payment_retry_time6" +} +``` + diff --git a/doc/models/frequency.md b/doc/models/frequency.md new file mode 100644 index 0000000..4082e25 --- /dev/null +++ b/doc/models/frequency.md @@ -0,0 +1,25 @@ + +# Frequency + +The frequency of the billing cycle. + +## Structure + +`Frequency` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `IntervalUnit` | [`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_]+$` | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | +| `IntervalCount` | `Integer` | 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` | Integer getIntervalCount() | setIntervalCount(Integer intervalCount) | + +## Example (as JSON) + +```json +{ + "interval_unit": "DAY", + "interval_count": 1 +} +``` + diff --git a/doc/models/google-pay-card-response.md b/doc/models/google-pay-card-response.md index d45dcc7..809ead5 100644 --- a/doc/models/google-pay-card-response.md +++ b/doc/models/google-pay-card-response.md @@ -25,7 +25,7 @@ The payment card to use to fund a Google Pay payment response. Can be a credit o "name": "name4", "last_digits": "last_digits8", "type": "DEBIT", - "brand": "ELECTRON", + "brand": "ACCEL", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-request-card.md b/doc/models/google-pay-request-card.md index 489ecc9..25aea82 100644 --- a/doc/models/google-pay-request-card.md +++ b/doc/models/google-pay-request-card.md @@ -22,7 +22,7 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car { "name": "name8", "type": "STORE", - "brand": "DISCOVER", + "brand": "CONFIDIS", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md index 2312bd1..8ae50c8 100644 --- a/doc/models/google-pay-request.md +++ b/doc/models/google-pay-request.md @@ -32,7 +32,7 @@ Information needed to pay using Google Pay. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-wallet-response.md b/doc/models/google-pay-wallet-response.md index 87da252..0b44726 100644 --- a/doc/models/google-pay-wallet-response.md +++ b/doc/models/google-pay-wallet-response.md @@ -30,7 +30,7 @@ Google Pay Wallet payment data. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/incentive-details.md b/doc/models/incentive-details.md new file mode 100644 index 0000000..e22c68b --- /dev/null +++ b/doc/models/incentive-details.md @@ -0,0 +1,32 @@ + +# Incentive Details + +The incentive details. + +## Structure + +`IncentiveDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `IncentiveType` | `String` | Optional | The type of incentive, such as a special offer or coupon.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getIncentiveCode() | setIncentiveCode(String incentiveCode) | +| `IncentiveAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getIncentiveAmount() | setIncentiveAmount(Money incentiveAmount) | +| `IncentiveProgramCode` | `String` | 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_'\-., ":;\!?]*$` | String getIncentiveProgramCode() | setIncentiveProgramCode(String incentiveProgramCode) | + +## Example (as JSON) + +```json +{ + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" +} +``` + diff --git a/doc/models/incentive-information.md b/doc/models/incentive-information.md new file mode 100644 index 0000000..1d6cd63 --- /dev/null +++ b/doc/models/incentive-information.md @@ -0,0 +1,51 @@ + +# Incentive Information + +The incentive details. + +## Structure + +`IncentiveInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `IncentiveDetails` | [`List`](../../doc/models/incentive-details.md) | Optional | An array of incentive details.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getItemCode() | setItemCode(String itemCode) | +| `ItemName` | `String` | Optional | The item name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getItemName() | setItemName(String itemName) | +| `ItemDescription` | `String` | Optional | The item description.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getItemQuantity() | setItemQuantity(String itemQuantity) | +| `ItemUnitPrice` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getItemUnitPrice() | setItemUnitPrice(Money itemUnitPrice) | +| `ItemAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getItemAmount() | setItemAmount(Money itemAmount) | +| `DiscountAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getDiscountAmount() | setDiscountAmount(Money discountAmount) | +| `AdjustmentAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAdjustmentAmount() | setAdjustmentAmount(Money adjustmentAmount) | +| `GiftWrapAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getGiftWrapAmount() | setGiftWrapAmount(Money giftWrapAmount) | +| `TaxPercentage` | `String` | 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]+))$` | String getTaxPercentage() | setTaxPercentage(String taxPercentage) | +| `TaxAmounts` | [`List`](../../doc/models/tax-amount.md) | Optional | An array of tax amounts levied by a government on the purchase of goods or services.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | List getTaxAmounts() | setTaxAmounts(List taxAmounts) | +| `BasicShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getBasicShippingAmount() | setBasicShippingAmount(Money basicShippingAmount) | +| `ExtraShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getExtraShippingAmount() | setExtraShippingAmount(Money extraShippingAmount) | +| `HandlingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getHandlingAmount() | setHandlingAmount(Money handlingAmount) | +| `InsuranceAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getInsuranceAmount() | setInsuranceAmount(Money insuranceAmount) | +| `TotalItemAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTotalItemAmount() | setTotalItemAmount(Money totalItemAmount) | +| `InvoiceNumber` | `String` | 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_'\-., ":;\!?]*$` | String getInvoiceNumber() | setInvoiceNumber(String invoiceNumber) | +| `CheckoutOptions` | [`List`](../../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` | List getCheckoutOptions() | setCheckoutOptions(List checkoutOptions) | + +## Example (as JSON) + +```json +{ + "item_code": "item_code4", + "item_name": "item_name2", + "item_description": "item_description0", + "item_options": "item_options4", + "item_quantity": "item_quantity4" +} +``` + diff --git a/doc/models/item-request.md b/doc/models/item-request.md new file mode 100644 index 0000000..48a3f3e --- /dev/null +++ b/doc/models/item-request.md @@ -0,0 +1,46 @@ + +# Item Request + +The details for the items to be purchased. + +## Structure + +`ItemRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | `String` | Required | The item name or title.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | String getName() | setName(String name) | +| `UnitAmount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | Money getUnitAmount() | setUnitAmount(Money unitAmount) | +| `Tax` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTax() | setTax(Money tax) | +| `Quantity` | `String` | Required | The item quantity. Must be a whole number.

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

**Constraints**: *Maximum Length*: `4000` | String getDescription() | setDescription(String description) | +| `Sku` | `String` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | String getSku() | setSku(String sku) | +| `Url` | `String` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20` | ItemCategory getCategory() | setCategory(ItemCategory category) | +| `ImageUrl` | `String` | 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)` | String getImageUrl() | setImageUrl(String imageUrl) | +| `Upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | UniversalProductCode getUpc() | setUpc(UniversalProductCode upc) | +| `BillingPlan` | [`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. | OrderBillingPlan getBillingPlan() | setBillingPlan(OrderBillingPlan billingPlan) | + +## Example (as JSON) + +```json +{ + "name": "name0", + "unit_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "tax": { + "currency_code": "currency_code0", + "value": "value6" + }, + "quantity": "quantity6", + "description": "description0", + "sku": "sku6", + "url": "url4", + "category": "DIGITAL_GOODS" +} +``` + diff --git a/doc/models/item.md b/doc/models/item.md index 5f17fb6..5b5b080 100644 --- a/doc/models/item.md +++ b/doc/models/item.md @@ -19,7 +19,7 @@ The details for the items to be purchased. | `Sku` | `String` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | String getSku() | setSku(String sku) | | `Url` | `String` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20` | ItemCategory getCategory() | setCategory(ItemCategory category) | -| `ImageUrl` | `String` | 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)` | String getImageUrl() | setImageUrl(String imageUrl) | +| `ImageUrl` | `String` | 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)(\?.*)?$` | String getImageUrl() | setImageUrl(String imageUrl) | | `Upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | UniversalProductCode getUpc() | setUpc(UniversalProductCode upc) | | `BillingPlan` | [`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. | OrderBillingPlan getBillingPlan() | setBillingPlan(OrderBillingPlan billingPlan) | diff --git a/doc/models/last-payment-details.md b/doc/models/last-payment-details.md new file mode 100644 index 0000000..b636204 --- /dev/null +++ b/doc/models/last-payment-details.md @@ -0,0 +1,26 @@ + +# Last Payment Details + +## Structure + +`LastPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAmount() | setAmount(Money amount) | +| `Time` | `String` | 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})$` | String getTime() | setTime(String time) | + +## Example (as JSON) + +```json +{ + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time0" +} +``` + diff --git a/doc/models/line-item.md b/doc/models/line-item.md index 81dad91..4a0f490 100644 --- a/doc/models/line-item.md +++ b/doc/models/line-item.md @@ -16,7 +16,7 @@ The line items for this purchase. If your merchant account has been configured f | `Description` | `String` | Optional | The detailed item description.

**Constraints**: *Maximum Length*: `2048` | String getDescription() | setDescription(String description) | | `Sku` | `String` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | String getSku() | setSku(String sku) | | `Url` | `String` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | String getUrl() | setUrl(String url) | -| `ImageUrl` | `String` | 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)` | String getImageUrl() | setImageUrl(String imageUrl) | +| `ImageUrl` | `String` | 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)(\?.*)?$` | String getImageUrl() | setImageUrl(String imageUrl) | | `Upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | UniversalProductCode getUpc() | setUpc(UniversalProductCode upc) | | `BillingPlan` | [`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. | OrderBillingPlan getBillingPlan() | setBillingPlan(OrderBillingPlan billingPlan) | | `UnitAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getUnitAmount() | setUnitAmount(Money unitAmount) | diff --git a/doc/models/link-http-method.md b/doc/models/link-http-method.md index 1c2588b..92a567b 100644 --- a/doc/models/link-http-method.md +++ b/doc/models/link-http-method.md @@ -9,14 +9,14 @@ The HTTP method required to make the related call. ## Fields -| Name | -| --- | -| `Get` | -| `Post` | -| `Put` | -| `Delete` | -| `Head` | -| `Connect` | -| `Options` | -| `Patch` | +| Name | Description | +| --- | --- | +| `Get` | The HTTP GET method. | +| `Post` | The HTTP POST method. | +| `Put` | The HTTP PUT method. | +| `Delete` | The HTTP DELETE method. | +| `Head` | The HTTP HEAD method. | +| `Connect` | The HTTP CONNECT method. | +| `Options` | The HTTP OPTIONS method. | +| `Patch` | The HTTP PATCH method. | diff --git a/doc/models/merchant-preferences.md b/doc/models/merchant-preferences.md new file mode 100644 index 0000000..a81a7ff --- /dev/null +++ b/doc/models/merchant-preferences.md @@ -0,0 +1,25 @@ + +# Merchant Preferences + +The merchant preferences for a subscription. + +## Structure + +`MerchantPreferences` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `ReturnUrl` | `String` | Optional | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | String getReturnUrl() | setReturnUrl(String returnUrl) | +| `CancelUrl` | `String` | Optional | The URL where the customer is redirected after the customer cancels the payment.

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

**Default**: `MobileReturnFlow.AUTO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | MobileReturnFlow getReturnFlow() | setReturnFlow(MobileReturnFlow returnFlow) | +| `BuyerUserAgent` | `String` | 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*: `^.*$` | String getBuyerUserAgent() | setBuyerUserAgent(String buyerUserAgent) | + +## Example (as JSON) + +```json +{ + "return_flow": "AUTO", + "buyer_user_agent": "buyer_user_agent8" +} +``` + diff --git a/doc/models/modify-subscription-request.md b/doc/models/modify-subscription-request.md new file mode 100644 index 0000000..3465be5 --- /dev/null +++ b/doc/models/modify-subscription-request.md @@ -0,0 +1,66 @@ + +# Modify Subscription Request + +The request to update the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount` and `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +## Structure + +`ModifySubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `PlanId` | `String` | Optional | The unique PayPal-generated ID for the plan.

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | String getQuantity() | setQuantity(String quantity) | +| `ShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingAmount() | setShippingAmount(Money shippingAmount) | +| `ShippingAddress` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | ShippingDetails getShippingAddress() | setShippingAddress(ShippingDetails shippingAddress) | +| `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. | PlanOverride getPlan() | setPlan(PlanOverride plan) | +| `PlanOverridden` | `Boolean` | Optional | Indicates whether the subscription has overridden any plan attributes. | Boolean getPlanOverridden() | setPlanOverridden(Boolean planOverridden) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id6", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "plan": { + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } + } +} +``` + diff --git a/doc/models/native-app-context.md b/doc/models/native-app-context.md new file mode 100644 index 0000000..a431396 --- /dev/null +++ b/doc/models/native-app-context.md @@ -0,0 +1,25 @@ + +# Native App Context + +Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. + +## Structure + +`NativeAppContext` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `OsType` | [`OsType`](../../doc/models/os-type.md) | Optional | Operating System type of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `7`, *Pattern*: `^[A-Z_]+$` | OsType getOsType() | setOsType(OsType osType) | +| `OsVersion` | `String` | Optional | Operating System version of the device that the buyer is using.

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

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

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

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

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | String getDate() | setDate(String date) | | `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_]+$` | CardBrand getNetwork() | setNetwork(CardBrand network) | | `AcquirerReferenceNumber` | `String` | 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]+$` | String getAcquirerReferenceNumber() | setAcquirerReferenceNumber(String acquirerReferenceNumber) | @@ -20,10 +20,10 @@ Reference values used by the card network to identify a transaction. ```json { - "id": "id6", - "date": "date8", - "network": "ELECTRON", - "acquirer_reference_number": "acquirer_reference_number2" + "id": "id0", + "date": "date4", + "network": "CETELEM", + "acquirer_reference_number": "acquirer_reference_number8" } ``` diff --git a/doc/models/order-application-context-shipping-preference.md b/doc/models/order-application-context-shipping-preference.md index 23289fa..f2b38ff 100644 --- a/doc/models/order-application-context-shipping-preference.md +++ b/doc/models/order-application-context-shipping-preference.md @@ -1,7 +1,7 @@ # Order Application Context Shipping Preference -DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object., The shipping preference. This only applies to PayPal payment source., The shipping preference. This only applies to PayPal payment source. +DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object. ## Enumeration diff --git a/doc/models/order-application-context.md b/doc/models/order-application-context.md index 8c7a014..7ef6848 100644 --- a/doc/models/order-application-context.md +++ b/doc/models/order-application-context.md @@ -12,14 +12,14 @@ Customizes the payer experience during the approval process for the payment with | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `BrandName` | `String` | Optional | DEPRECATED. The label that overrides the business name in the PayPal account on the PayPal site. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.brand_name`). Please specify this field in the `experience_context` object instead of the `application_context` object.

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

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

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

**Default**: `OrderApplicationContextLandingPage.NO_PREFERENCE`

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

**Default**: `OrderApplicationContextShippingPreference.GET_FROM_FILE`

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

**Default**: `OrderApplicationContextUserAction.CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | OrderApplicationContextUserAction getUserAction() | setUserAction(OrderApplicationContextUserAction userAction) | -| `PaymentMethod` | [`PaymentMethodPreference`](../../doc/models/payment-method-preference.md) | Optional | The customer and merchant payment preferences. | PaymentMethodPreference getPaymentMethod() | setPaymentMethod(PaymentMethodPreference paymentMethod) | +| `PaymentMethod` | [`PaymentMethodPreference`](../../doc/models/payment-method-preference.md) | Optional | DEPRECATED. The customer and merchant payment preferences. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.payment_method_selected`). Please specify this field in the `experience_context` object instead of the `application_context` object.. | PaymentMethodPreference getPaymentMethod() | setPaymentMethod(PaymentMethodPreference paymentMethod) | | `ReturnUrl` | `String` | Optional | DEPRECATED. The URL where the customer is redirected after the customer approves the payment. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.return_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. | String getReturnUrl() | setReturnUrl(String returnUrl) | | `CancelUrl` | `String` | 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. | String getCancelUrl() | setCancelUrl(String cancelUrl) | -| `StoredPaymentSource` | [`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. | StoredPaymentSource getStoredPaymentSource() | setStoredPaymentSource(StoredPaymentSource storedPaymentSource) | +| `StoredPaymentSource` | [`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. | StoredPaymentSource getStoredPaymentSource() | setStoredPaymentSource(StoredPaymentSource storedPaymentSource) | ## Example (as JSON) diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md index 81de643..9883fee 100644 --- a/doc/models/order-authorize-request-payment-source.md +++ b/doc/models/order-authorize-request-payment-source.md @@ -71,7 +71,7 @@ The payment source definition. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -94,7 +94,7 @@ The payment source definition. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md index fb23c97..ec94fbe 100644 --- a/doc/models/order-authorize-request.md +++ b/doc/models/order-authorize-request.md @@ -67,7 +67,7 @@ The authorization of an order request. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -90,7 +90,7 @@ The authorization of an order request. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-response-payment-source.md b/doc/models/order-authorize-response-payment-source.md index 9b1566b..02d43d9 100644 --- a/doc/models/order-authorize-response-payment-source.md +++ b/doc/models/order-authorize-response-payment-source.md @@ -24,9 +24,9 @@ The payment source used to fund the payment. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, @@ -60,7 +60,7 @@ The payment source used to fund the payment. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md index e36a32e..ecb114b 100644 --- a/doc/models/order-authorize-response.md +++ b/doc/models/order-authorize-response.md @@ -1,6 +1,8 @@ # Order Authorize Response +The order authorize response. + ## Structure `OrderAuthorizeResponse` @@ -14,10 +16,10 @@ | `Id` | `String` | Optional | The ID of the order. | String getId() | setId(String id) | | `PaymentSource` | [`OrderAuthorizeResponsePaymentSource`](../../doc/models/order-authorize-response-payment-source.md) | Optional | The payment source used to fund the payment. | OrderAuthorizeResponsePaymentSource getPaymentSource() | setPaymentSource(OrderAuthorizeResponsePaymentSource paymentSource) | | `Intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | CheckoutPaymentIntent getIntent() | setIntent(CheckoutPaymentIntent intent) | -| `Payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | Payer getPayer() | setPayer(Payer payer) | +| `Payer` | [`Payer`](../../doc/models/payer.md) | Optional | The customer who approves and pays for the order. The customer is also known as the payer. | Payer getPayer() | setPayer(Payer payer) | | `PurchaseUnits` | [`List`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

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

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

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | List getPurchaseUnits() | setPurchaseUnits(List purchaseUnits) | | `PaymentSource` | [`PaymentSource`](../../doc/models/payment-source.md) | Optional | The payment source definition. | PaymentSource getPaymentSource() | setPaymentSource(PaymentSource paymentSource) | | `ApplicationContext` | [`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. | OrderApplicationContext getApplicationContext() | setApplicationContext(OrderApplicationContext applicationContext) | diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md index 789ec18..2bdf3f9 100644 --- a/doc/models/order-tracker-request.md +++ b/doc/models/order-tracker-request.md @@ -25,7 +25,7 @@ The tracking details of an order. "capture_id": "capture_id0", "notify_payer": false, "tracking_number": "tracking_number6", - "carrier": "LEADER", + "carrier": "ZELERIS", "carrier_name_other": "carrier_name_other0", "items": [ { diff --git a/doc/models/order-update-callback-error-response-details.md b/doc/models/order-update-callback-error-response-details.md deleted file mode 100644 index bcfa63e..0000000 --- a/doc/models/order-update-callback-error-response-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Update Callback Error Response Details - -The error details. Required for client-side `4XX` errors. - -## Structure - -`OrderUpdateCallbackErrorResponseDetails` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `Field` | `String` | Optional | The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `256`, *Pattern*: `^.*$` | String getField() | setField(String field) | -| `Value` | `String` | Optional | The value of the field that caused the error.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `1024`, *Pattern*: `^.*$` | String getValue() | setValue(String value) | -| `Issue` | `String` | Required | The unique, fine-grained application-level error code.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | String getName() | setName(String name) | -| `Message` | `String` | Optional | The message that describes the error.

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

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

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

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

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

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

**Constraints**: *Maximum Length*: `300` | String getAdminArea1() | setAdminArea1(String adminArea1) | -| `PostalCode` | `String` | 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` | String getPostalCode() | setPostalCode(String postalCode) | -| `CountryCode` | `String` | Required | The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

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

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

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

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

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

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

**Default**: `false` | Boolean getFinalCapture() | setFinalCapture(Boolean finalCapture) | | `SellerReceivableBreakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | SellerReceivableBreakdown getSellerReceivableBreakdown() | setSellerReceivableBreakdown(SellerReceivableBreakdown sellerReceivableBreakdown) | diff --git a/doc/models/os-type.md b/doc/models/os-type.md new file mode 100644 index 0000000..a3ab063 --- /dev/null +++ b/doc/models/os-type.md @@ -0,0 +1,17 @@ + +# Os Type + +Operating System type of the device that the buyer is using. + +## Enumeration + +`OsType` + +## Fields + +| Name | Description | +| --- | --- | +| `Android` | Google Android OS. | +| `Ios` | Apple OS typically found in Apple mobile devices. | +| `Other` | Any other OS type. | + diff --git a/doc/models/payer-information.md b/doc/models/payer-information.md new file mode 100644 index 0000000..488aa5b --- /dev/null +++ b/doc/models/payer-information.md @@ -0,0 +1,38 @@ + +# Payer Information + +The payer information. + +## Structure + +`PayerInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `AccountId` | `String` | Optional | The PayPal` customer account ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[a-zA-Z0-9]*$` | String getAccountId() | setAccountId(String accountId) | +| `EmailAddress` | `String` | 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*: `^.+@[^"\-].+$` | String getEmailAddress() | setEmailAddress(String emailAddress) | +| `PhoneNumber` | [`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). | Phone getPhoneNumber() | setPhoneNumber(Phone phoneNumber) | +| `AddressStatus` | `String` | Optional | The address status of the payer. Value is either: Y. Verified. N. Not verified.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[N\|Y]$` | String getAddressStatus() | setAddressStatus(String addressStatus) | +| `PayerStatus` | `String` | Optional | The status of the payer. Value is `Y` or `N`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[N\|Y]$` | String getPayerStatus() | setPayerStatus(String payerStatus) | +| `PayerName` | [`PayerName`](../../doc/models/payer-name.md) | Optional | The name of the party. | PayerName getPayerName() | setPayerName(PayerName payerName) | +| `CountryCode` | `String` | 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)$` | String getCountryCode() | setCountryCode(String countryCode) | +| `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. | SimplePostalAddressCoarseGrained getAddress() | setAddress(SimplePostalAddressCoarseGrained address) | + +## Example (as JSON) + +```json +{ + "account_id": "account_id6", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status8" +} +``` + diff --git a/doc/models/payer-name.md b/doc/models/payer-name.md new file mode 100644 index 0000000..02c03d7 --- /dev/null +++ b/doc/models/payer-name.md @@ -0,0 +1,33 @@ + +# Payer Name + +The name of the party. + +## Structure + +`PayerName` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Prefix` | `String` | Optional | The prefix, or title, to the party's name.

**Constraints**: *Maximum Length*: `140` | String getPrefix() | setPrefix(String prefix) | +| `GivenName` | `String` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | String getGivenName() | setGivenName(String givenName) | +| `Surname` | `String` | 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` | String getSurname() | setSurname(String surname) | +| `MiddleName` | `String` | Optional | When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.

**Constraints**: *Maximum Length*: `140` | String getMiddleName() | setMiddleName(String middleName) | +| `Suffix` | `String` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | String getSuffix() | setSuffix(String suffix) | +| `AlternateFullName` | `String` | 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` | String getAlternateFullName() | setAlternateFullName(String alternateFullName) | +| `FullName` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | String getFullName() | setFullName(String fullName) | + +## Example (as JSON) + +```json +{ + "prefix": "prefix4", + "given_name": "given_name8", + "surname": "surname8", + "middle_name": "middle_name6", + "suffix": "suffix6" +} +``` + diff --git a/doc/models/payer.md b/doc/models/payer.md index 54abd5e..6dc50d7 100644 --- a/doc/models/payer.md +++ b/doc/models/payer.md @@ -1,6 +1,8 @@ # Payer +The customer who approves and pays for the order. The customer is also known as the payer. + ## Structure `Payer` diff --git a/doc/models/payment-authorization.md b/doc/models/payment-authorization.md index 79a4983..4d436e2 100644 --- a/doc/models/payment-authorization.md +++ b/doc/models/payment-authorization.md @@ -17,7 +17,7 @@ The authorized payment transaction. | `Amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAmount() | setAmount(Money amount) | | `InvoiceId` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | String getInvoiceId() | setInvoiceId(String invoiceId) | | `CustomId` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | String getCustomId() | setCustomId(String customId) | -| `NetworkTransactionReference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransactionReference getNetworkTransactionReference() | setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) | +| `NetworkTransactionReference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransaction getNetworkTransactionReference() | setNetworkTransactionReference(NetworkTransaction networkTransactionReference) | | `SellerProtection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | SellerProtection getSellerProtection() | setSellerProtection(SellerProtection sellerProtection) | | `ExpirationTime` | `String` | 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})$` | String getExpirationTime() | setExpirationTime(String expirationTime) | | `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | diff --git a/doc/models/payment-method.md b/doc/models/payment-method.md new file mode 100644 index 0000000..aaa49b0 --- /dev/null +++ b/doc/models/payment-method.md @@ -0,0 +1,23 @@ + +# Payment Method + +The customer and merchant payment preferences. + +## Structure + +`PaymentMethod` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `PayeePreferred` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `PayeePaymentMethodPreference.UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | PayeePaymentMethodPreference getPayeePreferred() | setPayeePreferred(PayeePaymentMethodPreference payeePreferred) | + +## Example (as JSON) + +```json +{ + "payee_preferred": "UNRESTRICTED" +} +``` + diff --git a/doc/models/payment-preferences-override.md b/doc/models/payment-preferences-override.md new file mode 100644 index 0000000..a056a5d --- /dev/null +++ b/doc/models/payment-preferences-override.md @@ -0,0 +1,32 @@ + +# Payment Preferences Override + +The payment preferences to override at subscription level. + +## Structure + +`PaymentPreferencesOverride` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `AutoBillOutstanding` | `Boolean` | Optional | Indicates whether to automatically bill the outstanding amount in the next billing cycle. | Boolean getAutoBillOutstanding() | setAutoBillOutstanding(Boolean autoBillOutstanding) | +| `SetupFee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getSetupFee() | setSetupFee(Money setupFee) | +| `SetupFeeFailureAction` | [`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_]+$` | SetupFeeFailureAction getSetupFeeFailureAction() | setSetupFeeFailureAction(SetupFeeFailureAction setupFeeFailureAction) | +| `PaymentFailureThreshold` | `Integer` | 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` | Integer getPaymentFailureThreshold() | setPaymentFailureThreshold(Integer paymentFailureThreshold) | + +## Example (as JSON) + +```json +{ + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 80 +} +``` + diff --git a/doc/models/payment-preferences.md b/doc/models/payment-preferences.md new file mode 100644 index 0000000..874dcf4 --- /dev/null +++ b/doc/models/payment-preferences.md @@ -0,0 +1,32 @@ + +# Payment Preferences + +The payment preferences for a subscription. + +## Structure + +`PaymentPreferences` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `AutoBillOutstanding` | `Boolean` | Optional | Indicates whether to automatically bill the outstanding amount in the next billing cycle.

**Default**: `true` | Boolean getAutoBillOutstanding() | setAutoBillOutstanding(Boolean autoBillOutstanding) | +| `SetupFee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getSetupFee() | setSetupFee(Money setupFee) | +| `SetupFeeFailureAction` | [`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**: `SetupFeeFailureAction.CANCEL`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | SetupFeeFailureAction getSetupFeeFailureAction() | setSetupFeeFailureAction(SetupFeeFailureAction setupFeeFailureAction) | +| `PaymentFailureThreshold` | `Integer` | 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` | Integer getPaymentFailureThreshold() | setPaymentFailureThreshold(Integer paymentFailureThreshold) | + +## Example (as JSON) + +```json +{ + "auto_bill_outstanding": true, + "setup_fee_failure_action": "CANCEL", + "payment_failure_threshold": 0, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + } +} +``` + diff --git a/doc/models/payment-source-response.md b/doc/models/payment-source-response.md index fdd163e..fe929cf 100644 --- a/doc/models/payment-source-response.md +++ b/doc/models/payment-source-response.md @@ -33,9 +33,9 @@ The payment source used to fund the payment. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, diff --git a/doc/models/payment-token-request-card.md b/doc/models/payment-token-request-card.md index 0460d3c..1862bf4 100644 --- a/doc/models/payment-token-request-card.md +++ b/doc/models/payment-token-request-card.md @@ -26,7 +26,7 @@ A Resource representing a request to vault a Card. "number": "number8", "expiry": "expiry2", "security_code": "security_code6", - "brand": "EFTPOS" + "brand": "HIPER" } ``` diff --git a/doc/models/payment-token-request-payment-source.md b/doc/models/payment-token-request-payment-source.md index 857215d..9dc593f 100644 --- a/doc/models/payment-token-request-payment-source.md +++ b/doc/models/payment-token-request-payment-source.md @@ -23,7 +23,7 @@ The payment method to vault with the instrument details. "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "token": { "id": "id6", diff --git a/doc/models/payment-token-request.md b/doc/models/payment-token-request.md index e144683..f6b8727 100644 --- a/doc/models/payment-token-request.md +++ b/doc/models/payment-token-request.md @@ -28,7 +28,7 @@ Payment Token Request where the `source` defines the type of instrument to be st "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "token": { "id": "id6", diff --git a/doc/models/payment-token-response-payment-source.md b/doc/models/payment-token-response-payment-source.md index f21982c..34574da 100644 --- a/doc/models/payment-token-response-payment-source.md +++ b/doc/models/payment-token-response-payment-source.md @@ -12,8 +12,8 @@ The vaulted payment method details. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Card` | [`CardPaymentTokenEntity`](../../doc/models/card-payment-token-entity.md) | Optional | Full representation of a Card Payment Token including network token. | CardPaymentTokenEntity getCard() | setCard(CardPaymentTokenEntity card) | -| `Paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | - | PaypalPaymentToken getPaypal() | setPaypal(PaypalPaymentToken paypal) | -| `Venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | - | VenmoPaymentToken getVenmo() | setVenmo(VenmoPaymentToken venmo) | +| `Paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | Full representation of a PayPal Payment Token. | PaypalPaymentToken getPaypal() | setPaypal(PaypalPaymentToken paypal) | +| `Venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | Full representation of a Venmo Payment Token. | VenmoPaymentToken getVenmo() | setVenmo(VenmoPaymentToken venmo) | | `ApplePay` | [`ApplePayPaymentToken`](../../doc/models/apple-pay-payment-token.md) | Optional | A resource representing a response for Apple Pay. | ApplePayPaymentToken getApplePay() | setApplePay(ApplePayPaymentToken applePay) | ## Example (as JSON) @@ -23,7 +23,7 @@ The vaulted payment method details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -41,6 +41,7 @@ The vaulted payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -65,6 +66,7 @@ The vaulted payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -87,7 +89,7 @@ The vaulted payment method details. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/payment-token-response.md b/doc/models/payment-token-response.md index 3a8026d..0eef85c 100644 --- a/doc/models/payment-token-response.md +++ b/doc/models/payment-token-response.md @@ -11,7 +11,7 @@ Full representation of a saved payment token. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Id` | `String` | Optional | The PayPal-generated ID for the vault token.

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

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

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

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

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

**Default**: `DisbursementMode.INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | DisbursementMode getDisbursementMode() | setDisbursementMode(DisbursementMode disbursementMode) | | `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | -| `ProcessorResponse` | [`PaymentsProcessorResponse`](../../doc/models/payments-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | PaymentsProcessorResponse getProcessorResponse() | setProcessorResponse(PaymentsProcessorResponse processorResponse) | +| `ProcessorResponse` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | ProcessorResponse getProcessorResponse() | setProcessorResponse(ProcessorResponse processorResponse) | | `CreateTime` | `String` | 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})$` | String getCreateTime() | setCreateTime(String createTime) | | `UpdateTime` | `String` | 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})$` | String getUpdateTime() | setUpdateTime(String updateTime) | diff --git a/doc/models/payments-payment-advice-code.md b/doc/models/payments-payment-advice-code.md deleted file mode 100644 index 2841c0f..0000000 --- a/doc/models/payments-payment-advice-code.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Payments Payment Advice Code - -The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. - -## Enumeration - -`PaymentsPaymentAdviceCode` - -## Fields - -| Name | Description | -| --- | --- | -| `PaymentAdvice01` | For Mastercard, expired card account upgrade or portfolio sale conversion. Obtain new account information before next billing cycle. | -| `PaymentAdvice02` | For Mastercard, over credit limit or insufficient funds. Retry the transaction 72 hours later. For Visa, the card holder wants to stop only one specific payment in the recurring payment relationship. The merchant must NOT resubmit the same transaction. The merchant can continue the billing process in the subsequent billing period. | -| `PaymentAdvice03` | For Mastercard, account closed as fraudulent. Obtain another type of payment from customer due to account being closed or fraud. Possible reason: Account closed as fraudulent. For Visa, the card holder wants to stop all recurring payment transactions for a specific merchant. Stop recurring payment requests. | -| `PaymentAdvice21` | For Mastercard, the card holder has been unsuccessful at canceling recurring payment through merchant. Stop recurring payment requests. For Visa, all recurring payments were canceled for the card number requested. Stop recurring payment requests. | - diff --git a/doc/models/payments-processor-response.md b/doc/models/payments-processor-response.md deleted file mode 100644 index 102fc56..0000000 --- a/doc/models/payments-processor-response.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Payments Processor Response - -The processor response information for payment requests, such as direct credit card transactions. - -## Structure - -`PaymentsProcessorResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `AvsCode` | [`AvsCode`](../../doc/models/avs-code.md) | Optional | The address verification code for Visa, Discover, Mastercard, or American Express transactions. | AvsCode getAvsCode() | setAvsCode(AvsCode avsCode) | -| `CvvCode` | [`CvvCode`](../../doc/models/cvv-code.md) | Optional | The card verification value code for for Visa, Discover, Mastercard, or American Express. | CvvCode getCvvCode() | setCvvCode(CvvCode cvvCode) | -| `ResponseCode` | [`ProcessorResponseCode`](../../doc/models/processor-response-code.md) | Optional | Processor response code for the non-PayPal payment processor errors. | ProcessorResponseCode getResponseCode() | setResponseCode(ProcessorResponseCode responseCode) | -| `PaymentAdviceCode` | [`PaymentsPaymentAdviceCode`](../../doc/models/payments-payment-advice-code.md) | Optional | The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. | PaymentsPaymentAdviceCode getPaymentAdviceCode() | setPaymentAdviceCode(PaymentsPaymentAdviceCode paymentAdviceCode) | - -## Example (as JSON) - -```json -{ - "avs_code": "A", - "cvv_code": "E", - "response_code": "5150", - "payment_advice_code": "01" -} -``` - diff --git a/doc/models/paypal-experience-landing-page.md b/doc/models/paypal-experience-landing-page.md index a7a65ab..754bef4 100644 --- a/doc/models/paypal-experience-landing-page.md +++ b/doc/models/paypal-experience-landing-page.md @@ -14,4 +14,5 @@ The type of landing page to show on the PayPal site for customer checkout. | `Login` | When the customer clicks PayPal Checkout, the customer is redirected to a page to log in to PayPal and approve the payment. | | `GuestCheckout` | When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. This option has previously been also called as 'BILLING' | | `NoPreference` | When the customer clicks PayPal Checkout, the customer is redirected to either a page to log in to PayPal and approve the payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase, depending on their previous interaction with PayPal. | +| `Billing` | DEPRECATED - please use GUEST_CHECKOUT. All implementations of 'BILLING' will be routed to 'GUEST_CHECKOUT'. When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. | diff --git a/doc/models/paypal-payment-token.md b/doc/models/paypal-payment-token.md index e3277f0..92980b1 100644 --- a/doc/models/paypal-payment-token.md +++ b/doc/models/paypal-payment-token.md @@ -1,6 +1,8 @@ # Paypal Payment Token +Full representation of a PayPal Payment Token. + ## Structure `PaypalPaymentToken` @@ -15,7 +17,7 @@ | `PermitMultiplePaymentTokens` | `Boolean` | 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` | Boolean getPermitMultiplePaymentTokens() | setPermitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) | | `UsageType` | [`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_]+$` | PaypalPaymentTokenUsageType getUsageType() | setUsageType(PaypalPaymentTokenUsageType usageType) | | `CustomerType` | [`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_]+$` | PaypalPaymentTokenCustomerType getCustomerType() | setCustomerType(PaypalPaymentTokenCustomerType customerType) | -| `EmailAddress` | `String` | 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])+)\])`` | String getEmailAddress() | setEmailAddress(String emailAddress) | +| `EmailAddress` | `String` | 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])+)\])`` | String getEmailAddress() | setEmailAddress(String emailAddress) | | `PayerId` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | String getPayerId() | setPayerId(String payerId) | | `Name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | Name getName() | setName(Name name) | | `Phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | PhoneWithType getPhone() | setPhone(PhoneWithType phone) | @@ -34,6 +36,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/paypal-reference-id-type.md b/doc/models/paypal-reference-id-type.md new file mode 100644 index 0000000..645138b --- /dev/null +++ b/doc/models/paypal-reference-id-type.md @@ -0,0 +1,18 @@ + +# Paypal Reference Id Type + +The PayPal reference ID type. + +## Enumeration + +`PaypalReferenceIdType` + +## Fields + +| Name | Description | +| --- | --- | +| `Odr` | An order ID. | +| `Txn` | A transaction ID. | +| `Sub` | A subscription ID. | +| `Pap` | A pre-approved payment ID. | + diff --git a/doc/models/paypal-wallet-attributes.md b/doc/models/paypal-wallet-attributes.md index 39ccc10..11bbecd 100644 --- a/doc/models/paypal-wallet-attributes.md +++ b/doc/models/paypal-wallet-attributes.md @@ -12,7 +12,7 @@ Additional attributes associated with the use of this PayPal Wallet. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Customer` | [`PaypalWalletCustomerRequest`](../../doc/models/paypal-wallet-customer-request.md) | Optional | - | PaypalWalletCustomerRequest getCustomer() | setCustomer(PaypalWalletCustomerRequest customer) | -| `Vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | - | PaypalWalletVaultInstruction getVault() | setVault(PaypalWalletVaultInstruction vault) | +| `Vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | Resource consolidating common request and response attributes for vaulting PayPal Wallet. | PaypalWalletVaultInstruction getVault() | setVault(PaypalWalletVaultInstruction vault) | ## Example (as JSON) @@ -34,7 +34,6 @@ Additional attributes associated with the use of this PayPal Wallet. "merchant_customer_id": "merchant_customer_id2" }, "vault": { - "store_in_vault": "ON_SUCCESS", "description": "description6", "usage_pattern": "THRESHOLD_PREPAID", "usage_type": "MERCHANT", diff --git a/doc/models/paypal-wallet-experience-context.md b/doc/models/paypal-wallet-experience-context.md index 61eeefe..a64786a 100644 --- a/doc/models/paypal-wallet-experience-context.md +++ b/doc/models/paypal-wallet-experience-context.md @@ -17,6 +17,7 @@ Customizes the payer experience during the approval process for payment with Pay | `ContactPreference` | [`PaypalWalletContactPreference`](../../doc/models/paypal-wallet-contact-preference.md) | Optional | The preference to display the contact information (buyer’s shipping email & phone number) on PayPal's checkout for easy merchant-buyer communication.

**Default**: `PaypalWalletContactPreference.NO_CONTACT_INFO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | PaypalWalletContactPreference getContactPreference() | setContactPreference(PaypalWalletContactPreference contactPreference) | | `ReturnUrl` | `String` | Optional | Describes the URL. | String getReturnUrl() | setReturnUrl(String returnUrl) | | `CancelUrl` | `String` | Optional | Describes the URL. | String getCancelUrl() | setCancelUrl(String cancelUrl) | +| `AppSwitchContext` | [`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. | AppSwitchContext getAppSwitchContext() | setAppSwitchContext(AppSwitchContext appSwitchContext) | | `LandingPage` | [`PaypalExperienceLandingPage`](../../doc/models/paypal-experience-landing-page.md) | Optional | The type of landing page to show on the PayPal site for customer checkout.

**Default**: `PaypalExperienceLandingPage.NO_PREFERENCE`

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

**Default**: `PaypalExperienceUserAction.CONTINUE`

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

**Default**: `PayeePaymentMethodPreference.UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | PayeePaymentMethodPreference getPaymentMethodPreference() | setPaymentMethodPreference(PayeePaymentMethodPreference paymentMethodPreference) | diff --git a/doc/models/paypal-wallet-response.md b/doc/models/paypal-wallet-response.md index 21331af..3fd2e31 100644 --- a/doc/models/paypal-wallet-response.md +++ b/doc/models/paypal-wallet-response.md @@ -23,6 +23,7 @@ The PayPal Wallet response. | `Address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | Address getAddress() | setAddress(Address address) | | `Attributes` | [`PaypalWalletAttributesResponse`](../../doc/models/paypal-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a PayPal Wallet. | PaypalWalletAttributesResponse getAttributes() | setAttributes(PaypalWalletAttributesResponse attributes) | | `StoredCredential` | [`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. | PaypalWalletStoredCredential getStoredCredential() | setStoredCredential(PaypalWalletStoredCredential storedCredential) | +| `ExperienceStatus` | [`ExperienceStatus`](../../doc/models/experience-status.md) | Optional | This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | PaymentInitiator getPaymentInitiator() | setPaymentInitiator(PaymentInitiator paymentInitiator) | -| `ChargePattern` | [`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_]+$` | UsagePattern getChargePattern() | setChargePattern(UsagePattern chargePattern) | +| `ChargePattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | DEPRECATED. Expected business/pricing model for the billing agreement, Please use usage_pattern instead.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | UsagePattern getChargePattern() | setChargePattern(UsagePattern chargePattern) | | `UsagePattern` | [`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_]+$` | UsagePattern getUsagePattern() | setUsagePattern(UsagePattern usagePattern) | | `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**: `StoredPaymentSourceUsageType.DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | StoredPaymentSourceUsageType getUsage() | setUsage(StoredPaymentSourceUsageType usage) | diff --git a/doc/models/paypal-wallet-vault-instruction.md b/doc/models/paypal-wallet-vault-instruction.md index dcda924..c015998 100644 --- a/doc/models/paypal-wallet-vault-instruction.md +++ b/doc/models/paypal-wallet-vault-instruction.md @@ -1,6 +1,8 @@ # Paypal Wallet Vault Instruction +Resource consolidating common request and response attributes for vaulting PayPal Wallet. + ## Structure `PaypalWalletVaultInstruction` @@ -9,7 +11,6 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `StoreInVault` | [`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_]+$` | StoreInVaultInstruction getStoreInVault() | setStoreInVault(StoreInVaultInstruction storeInVault) | | `Description` | `String` | Optional | The description displayed to PayPal consumer on the approval flow for PayPal, as well as on the PayPal payment token management experience on PayPal.com.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | PaypalPaymentTokenUsageType getUsageType() | setUsageType(PaypalPaymentTokenUsageType usageType) | @@ -23,7 +24,6 @@ "usage_type": "MERCHANT", "customer_type": "CONSUMER", "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", "description": "description4", "usage_pattern": "UNSCHEDULED_PREPAID" } diff --git a/doc/models/phone-number-with-country-code.md b/doc/models/phone-number-with-country-code.md index 8a4c90f..d1b73f9 100644 --- a/doc/models/phone-number-with-country-code.md +++ b/doc/models/phone-number-with-country-code.md @@ -1,7 +1,7 @@ # Phone Number With Country Code -The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). ## Structure diff --git a/doc/models/phone-number-with-optional-country-code.md b/doc/models/phone-number-with-optional-country-code.md new file mode 100644 index 0000000..797acae --- /dev/null +++ b/doc/models/phone-number-with-optional-country-code.md @@ -0,0 +1,25 @@ + +# Phone Number With Optional Country Code + +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). + +## Structure + +`PhoneNumberWithOptionalCountryCode` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `CountryCode` | `String` | 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}?$` | String getCountryCode() | setCountryCode(String countryCode) | +| `NationalNumber` | `String` | 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}?$` | String getNationalNumber() | setNationalNumber(String nationalNumber) | + +## Example (as JSON) + +```json +{ + "country_code": "country_code6", + "national_number": "national_number0" +} +``` + diff --git a/doc/models/phone-number.md b/doc/models/phone-number.md index 2c6a528..4282377 100644 --- a/doc/models/phone-number.md +++ b/doc/models/phone-number.md @@ -1,7 +1,7 @@ # Phone Number -The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). ## Structure diff --git a/doc/models/phone-type.md b/doc/models/phone-type.md index eb52444..1f7de80 100644 --- a/doc/models/phone-type.md +++ b/doc/models/phone-type.md @@ -9,11 +9,11 @@ The phone type. ## Fields -| Name | -| --- | -| `Fax` | -| `Home` | -| `Mobile` | -| `Other` | -| `Pager` | +| Name | Description | +| --- | --- | +| `Fax` | Fax number. | +| `Home` | Home phone number. | +| `Mobile` | Mobile phone number. | +| `Other` | Other phone number. | +| `Pager` | Pager number. | diff --git a/doc/models/plan-collection.md b/doc/models/plan-collection.md new file mode 100644 index 0000000..bdfa6d5 --- /dev/null +++ b/doc/models/plan-collection.md @@ -0,0 +1,53 @@ + +# Plan Collection + +The list of plans with details. + +## Structure + +`PlanCollection` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Plans` | [`List`](../../doc/models/billing-plan.md) | Optional | An array of plans.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | List getPlans() | setPlans(List plans) | +| `TotalItems` | `Integer` | Optional | The total number of items.

**Constraints**: `>= 0`, `<= 500000000` | Integer getTotalItems() | setTotalItems(Integer totalItems) | +| `TotalPages` | `Integer` | Optional | The total number of pages.

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

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

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | String getProductId() | setProductId(String productId) | +| `Name` | `String` | Optional | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | String getName() | setName(String name) | +| `Description` | `String` | Optional | The detailed description of the plan.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | List getBillingCycles() | setBillingCycles(List billingCycles) | +| `PaymentPreferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Optional | The payment preferences for a subscription. | PaymentPreferences getPaymentPreferences() | setPaymentPreferences(PaymentPreferences paymentPreferences) | +| `MerchantPreferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | MerchantPreferences getMerchantPreferences() | setMerchantPreferences(MerchantPreferences merchantPreferences) | +| `Taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | Taxes getTaxes() | setTaxes(Taxes taxes) | +| `QuantitySupported` | `Boolean` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

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

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

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | String getProductId() | setProductId(String productId) | +| `Name` | `String` | Required | The plan name.

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

**Default**: `PlanRequestStatus.ACTIVE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | PlanRequestStatus getStatus() | setStatus(PlanRequestStatus status) | +| `Description` | `String` | Optional | The detailed description of the plan.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | List getBillingCycles() | setBillingCycles(List billingCycles) | +| `PaymentPreferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Required | The payment preferences for a subscription. | PaymentPreferences getPaymentPreferences() | setPaymentPreferences(PaymentPreferences paymentPreferences) | +| `MerchantPreferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | MerchantPreferences getMerchantPreferences() | setMerchantPreferences(MerchantPreferences merchantPreferences) | +| `Taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | Taxes getTaxes() | setTaxes(Taxes taxes) | +| `QuantitySupported` | `Boolean` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `3` | List getBillingCycles() | setBillingCycles(List billingCycles) | -| `Product` | `JsonValue` | Optional | Product details associated with any one-time product purchase. | JsonValue getProduct() | setProduct(JsonValue product) | | `OneTimeCharges` | [`OneTimeCharge`](../../doc/models/one-time-charge.md) | Required | The one-time charge info at the time of checkout. | OneTimeCharge getOneTimeCharges() | setOneTimeCharges(OneTimeCharge oneTimeCharges) | | `Name` | `String` | Optional | Name of the recurring plan.

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

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

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

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

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

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000` | String getSoftDescriptor() | setSoftDescriptor(String softDescriptor) | +| `Items` | [`List`](../../doc/models/item-request.md) | Optional | An array of items that the customer purchases from the merchant. | List getItems() | setItems(List items) | | `Shipping` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | ShippingDetails getShipping() | setShipping(ShippingDetails shipping) | | `SupplementaryData` | [`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. | SupplementaryData getSupplementaryData() | setSupplementaryData(SupplementaryData supplementaryData) | diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md new file mode 100644 index 0000000..c871a9d --- /dev/null +++ b/doc/models/reason-code.md @@ -0,0 +1,22 @@ + +# Reason Code + +The reason code for the payment failure. + +## Enumeration + +`ReasonCode` + +## Fields + +| Name | Description | +| --- | --- | +| `PaymentDenied` | PayPal declined the payment due to one or more customer issues. | +| `InternalServerError` | An internal server error has occurred. | +| `PayeeAccountRestricted` | The payee account is not in good standing and cannot receive payments. | +| `PayerAccountRestricted` | The payer account is not in good standing and cannot make payments. | +| `PayerCannotPay` | Payer cannot pay for this transaction. | +| `SendingLimitExceeded` | The transaction exceeds the payer's sending limit. | +| `TransactionReceivingLimitExceeded` | The transaction exceeds the receiver's receiving limit. | +| `CurrencyMismatch` | The transaction is declined due to a currency mismatch. | + diff --git a/doc/models/reauthorize-request.md b/doc/models/reauthorize-request.md index 43959ea..f86ee27 100644 --- a/doc/models/reauthorize-request.md +++ b/doc/models/reauthorize-request.md @@ -1,7 +1,7 @@ # Reauthorize Request -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. Note: This request is currently not supported for Partner use cases. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. ## Structure diff --git a/doc/models/return-flow.md b/doc/models/return-flow.md new file mode 100644 index 0000000..da08623 --- /dev/null +++ b/doc/models/return-flow.md @@ -0,0 +1,16 @@ + +# Return Flow + +Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App. + +## Enumeration + +`ReturnFlow` + +## Fields + +| Name | Description | +| --- | --- | +| `Auto` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | +| `Manual` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | + diff --git a/doc/models/search-error-exception.md b/doc/models/search-error-exception.md new file mode 100644 index 0000000..fb126f6 --- /dev/null +++ b/doc/models/search-error-exception.md @@ -0,0 +1,51 @@ + +# Search Error Exception + +The error details. + +## Structure + +`SearchErrorException` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | `String` | Required | The human-readable, unique name of the error. | String getName() | setName(String name) | +| `Message` | `String` | Required | The message that describes the error. | String getMessageField() | setMessageField(String messageField) | +| `DebugId` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | String getDebugId() | setDebugId(String debugId) | +| `InformationLink` | `String` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | String getInformationLink() | setInformationLink(String informationLink) | +| `Details` | [`List`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | List getDetails() | setDetails(List details) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | +| `TotalItems` | `Integer` | Optional | The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | Integer getTotalItems() | setTotalItems(Integer totalItems) | +| `MaximumItems` | `Integer` | Optional | The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `2147483647` | List getTransactionDetails() | setTransactionDetails(List transactionDetails) | +| `AccountNumber` | `String` | Optional | The merchant account number.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[a-zA-Z0-9]*$` | String getAccountNumber() | setAccountNumber(String accountNumber) | +| `StartDate` | `String` | 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})$` | String getStartDate() | setStartDate(String startDate) | +| `EndDate` | `String` | 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})$` | String getEndDate() | setEndDate(String endDate) | +| `LastRefreshedDatetime` | `String` | 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})$` | String getLastRefreshedDatetime() | setLastRefreshedDatetime(String lastRefreshedDatetime) | +| `Page` | `Integer` | Optional | A zero-relative index of transactions.

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

**Constraints**: `>= 0`, `<= 2147483647` | Integer getTotalItems() | setTotalItems(Integer totalItems) | +| `TotalPages` | `Integer` | 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` | Integer getTotalPages() | setTotalPages(Integer totalPages) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links).

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | String getLocale() | setLocale(String locale) | +| `ReturnUrl` | `String` | Required | Describes the URL. | String getReturnUrl() | setReturnUrl(String returnUrl) | +| `CancelUrl` | `String` | Required | Describes the URL. | String getCancelUrl() | setCancelUrl(String cancelUrl) | + +## Example (as JSON) + +```json +{ + "locale": "locale8", + "return_url": "return_url6", + "cancel_url": "cancel_url8" +} +``` + diff --git a/doc/models/sepa-debit-request.md b/doc/models/sepa-debit-request.md new file mode 100644 index 0000000..bfcb1b6 --- /dev/null +++ b/doc/models/sepa-debit-request.md @@ -0,0 +1,27 @@ + +# Sepa Debit Request + +An API resource denoting a request to securely store a SEPA Debit. + +## Structure + +`SepaDebitRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `ExperienceContext` | [`SepaDebitExperienceContext`](../../doc/models/sepa-debit-experience-context.md) | Optional | Customizes the payer experience during the approval process for the SEPA Debit payment. | SepaDebitExperienceContext getExperienceContext() | setExperienceContext(SepaDebitExperienceContext experienceContext) | + +## Example (as JSON) + +```json +{ + "experience_context": { + "locale": "locale6", + "return_url": "return_url4", + "cancel_url": "cancel_url6" + } +} +``` + diff --git a/doc/models/setup-fee-failure-action.md b/doc/models/setup-fee-failure-action.md new file mode 100644 index 0000000..403a23b --- /dev/null +++ b/doc/models/setup-fee-failure-action.md @@ -0,0 +1,16 @@ + +# Setup Fee Failure Action + +The action to take on the subscription if the initial payment for the setup fails. + +## Enumeration + +`SetupFeeFailureAction` + +## Fields + +| Name | Description | +| --- | --- | +| `Continue` | Continues the subscription if the initial payment for the setup fails. | +| `Cancel` | Cancels the subscription if the initial payment for the setup fails. | + diff --git a/doc/models/setup-token-request-card.md b/doc/models/setup-token-request-card.md index 783be1f..7b6c8b1 100644 --- a/doc/models/setup-token-request-card.md +++ b/doc/models/setup-token-request-card.md @@ -18,7 +18,7 @@ A Resource representing a request to vault a Card. | `Brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | CardBrand getBrand() | setBrand(CardBrand brand) | | `BillingAddress` | [`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). | Address getBillingAddress() | setBillingAddress(Address billingAddress) | | `VerificationMethod` | [`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_]+$` | VaultCardVerificationMethod getVerificationMethod() | setVerificationMethod(VaultCardVerificationMethod verificationMethod) | -| `ExperienceContext` | [`SetupTokenCardExperienceContext`](../../doc/models/setup-token-card-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | SetupTokenCardExperienceContext getExperienceContext() | setExperienceContext(SetupTokenCardExperienceContext experienceContext) | +| `ExperienceContext` | [`VaultCardExperienceContext`](../../doc/models/vault-card-experience-context.md) | Optional | A resource representing an experience context of vault a card. | VaultCardExperienceContext getExperienceContext() | setExperienceContext(VaultCardExperienceContext experienceContext) | ## Example (as JSON) @@ -28,7 +28,7 @@ A Resource representing a request to vault a Card. "number": "number0", "expiry": "expiry0", "security_code": "security_code4", - "brand": "DINERS" + "brand": "STAR" } ``` diff --git a/doc/models/setup-token-request-payment-source.md b/doc/models/setup-token-request-payment-source.md index deac8ba..1f57151 100644 --- a/doc/models/setup-token-request-payment-source.md +++ b/doc/models/setup-token-request-payment-source.md @@ -13,8 +13,10 @@ The payment method to vault with the instrument details. | --- | --- | --- | --- | --- | --- | | `Card` | [`SetupTokenRequestCard`](../../doc/models/setup-token-request-card.md) | Optional | A Resource representing a request to vault a Card. | SetupTokenRequestCard getCard() | setCard(SetupTokenRequestCard card) | | `Paypal` | [`VaultPaypalWalletRequest`](../../doc/models/vault-paypal-wallet-request.md) | Optional | A resource representing a request to vault PayPal Wallet. | VaultPaypalWalletRequest getPaypal() | setPaypal(VaultPaypalWalletRequest paypal) | -| `Venmo` | [`VaultVenmoRequest`](../../doc/models/vault-venmo-request.md) | Optional | - | VaultVenmoRequest getVenmo() | setVenmo(VaultVenmoRequest venmo) | +| `Venmo` | [`VaultVenmoRequest`](../../doc/models/vault-venmo-request.md) | Optional | A resource representing a request to vault Venmo. | VaultVenmoRequest getVenmo() | setVenmo(VaultVenmoRequest venmo) | +| `ApplePay` | [`VaultApplePayRequest`](../../doc/models/vault-apple-pay-request.md) | Optional | A resource representing a request to vault Apple Pay. | VaultApplePayRequest getApplePay() | setApplePay(VaultApplePayRequest applePay) | | `Token` | [`VaultTokenRequest`](../../doc/models/vault-token-request.md) | Optional | The Tokenized Payment Source representing a Request to Vault a Token. | VaultTokenRequest getToken() | setToken(VaultTokenRequest token) | +| `Bank` | [`BankRequest`](../../doc/models/bank-request.md) | Optional | A Resource representing a request to vault a Bank used for ACH Debit. | BankRequest getBank() | setBank(BankRequest bank) | ## Example (as JSON) @@ -25,7 +27,7 @@ The payment method to vault with the instrument details. "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "paypal": { "description": "description2", @@ -34,6 +36,7 @@ The payment method to vault with the instrument details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -58,6 +61,7 @@ The payment method to vault with the instrument details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -75,6 +79,21 @@ The payment method to vault with the instrument details. "permit_multiple_payment_tokens": false, "usage_type": "MERCHANT" }, + "apple_pay": { + "token": "token6", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } + }, "token": { "id": "id6", "type": "SETUP_TOKEN" diff --git a/doc/models/setup-token-request.md b/doc/models/setup-token-request.md index 9fef19b..c27a33e 100644 --- a/doc/models/setup-token-request.md +++ b/doc/models/setup-token-request.md @@ -28,7 +28,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "paypal": { "description": "description2", @@ -37,6 +37,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -61,6 +62,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -78,6 +80,21 @@ Setup Token Request where the `source` defines the type of instrument to be stor "permit_multiple_payment_tokens": false, "usage_type": "MERCHANT" }, + "apple_pay": { + "token": "token6", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } + }, "token": { "id": "id6", "type": "SETUP_TOKEN" diff --git a/doc/models/setup-token-response-card.md b/doc/models/setup-token-response-card.md index 91abdbc..55fc54f 100644 --- a/doc/models/setup-token-response-card.md +++ b/doc/models/setup-token-response-card.md @@ -27,7 +27,7 @@ { "name": "name8", "last_digits": "last_digits2", - "brand": "ELO", + "brand": "DISCOVER", "expiry": "expiry6", "billing_address": { "address_line_1": "address_line_12", diff --git a/doc/models/setup-token-response-payment-source.md b/doc/models/setup-token-response-payment-source.md index 07c8e7b..91470ac 100644 --- a/doc/models/setup-token-response-payment-source.md +++ b/doc/models/setup-token-response-payment-source.md @@ -12,8 +12,8 @@ The setup payment method details. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Card` | [`SetupTokenResponseCard`](../../doc/models/setup-token-response-card.md) | Optional | - | SetupTokenResponseCard getCard() | setCard(SetupTokenResponseCard card) | -| `Paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | - | PaypalPaymentToken getPaypal() | setPaypal(PaypalPaymentToken paypal) | -| `Venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | - | VenmoPaymentToken getVenmo() | setVenmo(VenmoPaymentToken venmo) | +| `Paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | Full representation of a PayPal Payment Token. | PaypalPaymentToken getPaypal() | setPaypal(PaypalPaymentToken paypal) | +| `Venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | Full representation of a Venmo Payment Token. | VenmoPaymentToken getVenmo() | setVenmo(VenmoPaymentToken venmo) | ## Example (as JSON) @@ -22,7 +22,7 @@ The setup payment method details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -40,6 +40,7 @@ The setup payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -64,6 +65,7 @@ The setup payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/setup-token-response.md b/doc/models/setup-token-response.md index 6a46324..ffa2508 100644 --- a/doc/models/setup-token-response.md +++ b/doc/models/setup-token-response.md @@ -11,7 +11,7 @@ Minimal representation of a cached setup token. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Id` | `String` | Optional | The PayPal-generated ID for the vault token.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | String getId() | setId(String id) | | `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. | Customer getCustomer() | setCustomer(Customer customer) | | `Status` | [`PaymentTokenStatus`](../../doc/models/payment-token-status.md) | Optional | The status of the payment token.

**Default**: `PaymentTokenStatus.CREATED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | PaymentTokenStatus getStatus() | setStatus(PaymentTokenStatus status) | | `PaymentSource` | [`SetupTokenResponsePaymentSource`](../../doc/models/setup-token-response-payment-source.md) | Optional | The setup payment method details. | SetupTokenResponsePaymentSource getPaymentSource() | setPaymentSource(SetupTokenResponsePaymentSource paymentSource) | @@ -31,7 +31,7 @@ Minimal representation of a cached setup token. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -49,6 +49,7 @@ Minimal representation of a cached setup token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -73,6 +74,7 @@ Minimal representation of a cached setup token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md index 438eac4..6e760f1 100644 --- a/doc/models/shipment-carrier.md +++ b/doc/models/shipment-carrier.md @@ -1387,4 +1387,40 @@ The carrier for the shipment. Some carriers have a global version as well as loc | `UpsChecker` | ups-checker. | | `Wineshipping` | Wineshipping. | | `Spedisci` | Spedisci online. | +| `Fourkites` | Fourkites. | +| `Etonas` | Etonas. | +| `Finmile` | Fin Mile. | +| `Uniuni` | Uniuni. | +| `Rodonaves` | Rodonaves. | +| `InpostIt` | Inpost Italy. | +| `TforceFreight` | Tforce Freight. | +| `Richmom` | Rich Mom. | +| `Franco` | Corriere Franco. | +| `Ecparcel` | Ecparcel. | +| `FedexChina` | Fedex China. | +| `GofoExpress` | Gofo Express. | +| `Shipbob` | Shipbob. | +| `JerseypostAtlas` | Jersey Post Group. | +| `Coretrails` | Coretrails. | +| `RhenusItaly` | Rhenus Logistics Italy. | +| `Jadlog` | Jadlog. | +| `Jitsu` | Jitsu. | +| `YanwenExpress` | Yanwen Express. | +| `Dashlink` | Dashlink. | +| `SeinoSuperExpress` | Seino Super Express. | +| `Floship` | Floship. | +| `Metroscg` | Metro Supply Chain. | +| `Sendparcel` | Sendparcel. | +| `P2P` | P2p. | +| `CnExpress` | Cn Express. | +| `Cirrotrack` | Cirro Track. | +| `LandLogistics` | Land Logistics. | +| `Veho` | Veho. | +| `Medline` | Medline. | +| `Vdtrack` | Vdtrack. | +| `SinoScm` | Sino Scm. | +| `Enum3PeExpress` | 3pe Express. | +| `Swiftx` | Swiftx. | +| `Sfydexpress` | Sfyd Express. | +| `Toptrans` | Toptrans. | diff --git a/doc/models/shipping-information.md b/doc/models/shipping-information.md new file mode 100644 index 0000000..8da2553 --- /dev/null +++ b/doc/models/shipping-information.md @@ -0,0 +1,43 @@ + +# Shipping Information + +The shipping information. + +## Structure + +`ShippingInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | `String` | Optional | The recipient's name.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | String getMethod() | setMethod(String method) | +| `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. | SimplePostalAddressCoarseGrained getAddress() | setAddress(SimplePostalAddressCoarseGrained address) | +| `SecondaryShippingAddress` | [`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. | SimplePostalAddressCoarseGrained getSecondaryShippingAddress() | setSecondaryShippingAddress(SimplePostalAddressCoarseGrained secondaryShippingAddress) | + +## Example (as JSON) + +```json +{ + "name": "name8", + "method": "method2", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } +} +``` + diff --git a/doc/models/shipping-options-purchase-unit.md b/doc/models/shipping-options-purchase-unit.md deleted file mode 100644 index 19c232d..0000000 --- a/doc/models/shipping-options-purchase-unit.md +++ /dev/null @@ -1,108 +0,0 @@ - -# Shipping Options Purchase Unit - -This would contain shipping option and amount data at purchase unit level. - -## Structure - -`ShippingOptionsPurchaseUnit` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `ReferenceId` | `String` | Optional | The API caller-provided external ID for the purchase unit. Required for multiple purchase units when you must update the order through `PATCH`. If you omit this value and the order contains only one purchase unit, PayPal sets this value to `default`. Note: If there are multiple purchase units, reference_id is required for each purchase unit.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | List getShippingOptions() | setShippingOptions(List shippingOptions) | - -## Example (as JSON) - -```json -{ - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } - }, - "items": [ - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - }, - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - } - ], - "shipping_options": [ - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] -} -``` - diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md index 46bab28..42e0c6e 100644 --- a/doc/models/shipping-with-tracking-details.md +++ b/doc/models/shipping-with-tracking-details.md @@ -1,8 +1,6 @@ # Shipping With Tracking Details -The order shipping details. - ## Structure `ShippingWithTrackingDetails` @@ -11,18 +9,72 @@ The order shipping details. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | +| `Trackers` | [`List`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | List getTrackers() | setTrackers(List trackers) | | `Name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | ShippingName getName() | setName(ShippingName name) | | `EmailAddress` | `String` | 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])+)\])$`` | String getEmailAddress() | setEmailAddress(String emailAddress) | -| `PhoneNumber` | [`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). | PhoneNumberWithCountryCode getPhoneNumber() | setPhoneNumber(PhoneNumberWithCountryCode phoneNumber) | +| `PhoneNumber` | [`PhoneNumberWithOptionalCountryCode`](../../doc/models/phone-number-with-optional-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | PhoneNumberWithOptionalCountryCode getPhoneNumber() | setPhoneNumber(PhoneNumberWithOptionalCountryCode phoneNumber) | | `Type` | [`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_]+$` | FulfillmentType getType() | setType(FulfillmentType type) | | `Options` | [`List`](../../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` | List getOptions() | setOptions(List options) | | `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). | Address getAddress() | setAddress(Address address) | -| `Trackers` | [`List`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | List getTrackers() | setTrackers(List trackers) | ## Example (as JSON) ```json { + "trackers": [ + { + "id": "id2", + "status": "CANCELLED", + "items": [ + { + "name": "name8", + "quantity": "quantity4", + "sku": "sku6", + "url": "url2", + "image_url": "image_url4" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "create_time": "create_time8" + }, + { + "id": "id2", + "status": "CANCELLED", + "items": [ + { + "name": "name8", + "quantity": "quantity4", + "sku": "sku6", + "url": "url2", + "image_url": "image_url4" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "create_time": "create_time8" + } + ], "name": { "full_name": "full_name6" }, @@ -31,29 +83,7 @@ The order shipping details. "country_code": "country_code2", "national_number": "national_number6" }, - "type": "SHIPPING", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] + "type": "SHIPPING" } ``` diff --git a/doc/models/simple-postal-address-coarse-grained.md b/doc/models/simple-postal-address-coarse-grained.md new file mode 100644 index 0000000..490a74e --- /dev/null +++ b/doc/models/simple-postal-address-coarse-grained.md @@ -0,0 +1,33 @@ + +# Simple Postal Address Coarse Grained + +A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. + +## Structure + +`SimplePostalAddressCoarseGrained` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Line1` | `String` | Required | The first line of the address. For example, number or street. | String getLine1() | setLine1(String line1) | +| `Line2` | `String` | Optional | The second line of the address. For example, suite or apartment number. | String getLine2() | setLine2(String line2) | +| `City` | `String` | Required | The city name. | String getCity() | setCity(String city) | +| `State` | `String` | Optional | The [code](/docs/api/reference/state-codes/) for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: [Argentina](/docs/api/reference/state-codes/#argentina), [Brazil](/docs/api/reference/state-codes/#brazil), [Canada](/docs/api/reference/state-codes/#canada), [China](/docs/api/reference/state-codes/#china), [India](/docs/api/reference/state-codes/#india), [Italy](/docs/api/reference/state-codes/#italy), [Japan](/docs/api/reference/state-codes/#japan), [Mexico](/docs/api/reference/state-codes/#mexico), [Thailand](/docs/api/reference/state-codes/#thailand), or [United States](/docs/api/reference/state-codes/#usa). Maximum length is 40 single-byte characters. | String getState() | setState(String state) | +| `CountryCode` | `String` | 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)$` | String getCountryCode() | setCountryCode(String countryCode) | +| `PostalCode` | `String` | 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). | String getPostalCode() | setPostalCode(String postalCode) | + +## Example (as JSON) + +```json +{ + "line1": "line14", + "line2": "line26", + "city": "city2", + "state": "state8", + "country_code": "country_code2", + "postal_code": "postal_code4" +} +``` + diff --git a/doc/models/store-information.md b/doc/models/store-information.md new file mode 100644 index 0000000..68b4dc6 --- /dev/null +++ b/doc/models/store-information.md @@ -0,0 +1,25 @@ + +# Store Information + +The store information. + +## Structure + +`StoreInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `StoreId` | `String` | 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]*$` | String getStoreId() | setStoreId(String storeId) | +| `TerminalId` | `String` | Optional | The terminal ID for the checkout stand in a merchant store.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | StoredPaymentSourcePaymentType getPaymentType() | setPaymentType(StoredPaymentSourcePaymentType paymentType) | | `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**: `StoredPaymentSourceUsageType.DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | StoredPaymentSourceUsageType getUsage() | setUsage(StoredPaymentSourceUsageType usage) | -| `PreviousNetworkTransactionReference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransactionReference getPreviousNetworkTransactionReference() | setPreviousNetworkTransactionReference(NetworkTransactionReference previousNetworkTransactionReference) | +| `PreviousNetworkTransactionReference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | NetworkTransaction getPreviousNetworkTransactionReference() | setPreviousNetworkTransactionReference(NetworkTransaction previousNetworkTransactionReference) | ## Example (as JSON) @@ -26,7 +26,7 @@ Provides additional details to process a payment using a `payment_source` that h "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/subscriber-request.md b/doc/models/subscriber-request.md new file mode 100644 index 0000000..7b36915 --- /dev/null +++ b/doc/models/subscriber-request.md @@ -0,0 +1,67 @@ + +# Subscriber Request + +The subscriber request information . + +## Structure + +`SubscriberRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | Name getName() | setName(Name name) | +| `Phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | PhoneWithType getPhone() | setPhone(PhoneWithType phone) | +| `ShippingAddress` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | ShippingDetails getShippingAddress() | setShippingAddress(ShippingDetails shippingAddress) | +| `PaymentSource` | [`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. | SubscriptionPaymentSource getPaymentSource() | setPaymentSource(SubscriptionPaymentSource paymentSource) | + +## Example (as JSON) + +```json +{ + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } + } +} +``` + diff --git a/doc/models/subscriber.md b/doc/models/subscriber.md new file mode 100644 index 0000000..48a23b1 --- /dev/null +++ b/doc/models/subscriber.md @@ -0,0 +1,66 @@ + +# Subscriber + +The subscriber response information. + +## Structure + +`Subscriber` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | Name getName() | setName(Name name) | +| `ShippingAddress` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | ShippingDetails getShippingAddress() | setShippingAddress(ShippingDetails shippingAddress) | +| `PaymentSource` | [`SubscriptionPaymentSourceResponse`](../../doc/models/subscription-payment-source-response.md) | Optional | The payment source used to fund the payment. | SubscriptionPaymentSourceResponse getPaymentSource() | setPaymentSource(SubscriptionPaymentSourceResponse paymentSource) | + +## Example (as JSON) + +```json +{ + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry4", + "currency_code": "currency_code2" + } + } +} +``` + diff --git a/doc/models/subscription-amount-with-breakdown.md b/doc/models/subscription-amount-with-breakdown.md new file mode 100644 index 0000000..50cfc8a --- /dev/null +++ b/doc/models/subscription-amount-with-breakdown.md @@ -0,0 +1,51 @@ + +# Subscription Amount With Breakdown + +The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. + +## Structure + +`SubscriptionAmountWithBreakdown` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `GrossAmount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | Money getGrossAmount() | setGrossAmount(Money grossAmount) | +| `TotalItemAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTotalItemAmount() | setTotalItemAmount(Money totalItemAmount) | +| `FeeAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getFeeAmount() | setFeeAmount(Money feeAmount) | +| `ShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingAmount() | setShippingAmount(Money shippingAmount) | +| `TaxAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTaxAmount() | setTaxAmount(Money taxAmount) | +| `NetAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getNetAmount() | setNetAmount(Money netAmount) | + +## Example (as JSON) + +```json +{ + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } +} +``` + diff --git a/doc/models/subscription-application-context.md b/doc/models/subscription-application-context.md new file mode 100644 index 0000000..4eef96f --- /dev/null +++ b/doc/models/subscription-application-context.md @@ -0,0 +1,37 @@ + +# Subscription Application Context + +The application context, which customizes the payer experience during the subscription approval process with PayPal. + +## Structure + +`SubscriptionApplicationContext` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `BrandName` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site.

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

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

**Default**: `ExperienceContextShippingPreference.GET_FROM_FILE`

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

**Default**: `ApplicationContextUserAction.SUBSCRIBE_NOW`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | ApplicationContextUserAction getUserAction() | setUserAction(ApplicationContextUserAction userAction) | +| `PaymentMethod` | [`PaymentMethod`](../../doc/models/payment-method.md) | Optional | The customer and merchant payment preferences. | PaymentMethod getPaymentMethod() | setPaymentMethod(PaymentMethod paymentMethod) | +| `ReturnUrl` | `String` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | String getReturnUrl() | setReturnUrl(String returnUrl) | +| `CancelUrl` | `String` | Required | The URL where the customer is redirected after the customer cancels the payment.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | TenureType getTenureType() | setTenureType(TenureType tenureType) | +| `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` | int getSequence() | setSequence(int sequence) | +| `TotalCycles` | `Integer` | 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` | Integer getTotalCycles() | setTotalCycles(Integer totalCycles) | + +## Example (as JSON) + +```json +{ + "frequency": { + "interval_unit": "DAY", + "interval_count": 1 + }, + "tenure_type": "REGULAR", + "sequence": 30, + "total_cycles": 1, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } +} +``` + diff --git a/doc/models/subscription-billing-information.md b/doc/models/subscription-billing-information.md new file mode 100644 index 0000000..ceae62f --- /dev/null +++ b/doc/models/subscription-billing-information.md @@ -0,0 +1,69 @@ + +# Subscription Billing Information + +The billing details for the subscription. If the subscription was or is active, these fields are populated. + +## Structure + +`SubscriptionBillingInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `OutstandingBalance` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | Money getOutstandingBalance() | setOutstandingBalance(Money outstandingBalance) | +| `CycleExecutions` | [`List`](../../doc/models/cycle-execution.md) | Optional | The trial and regular billing executions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `3` | List getCycleExecutions() | setCycleExecutions(List cycleExecutions) | +| `LastPayment` | [`LastPaymentDetails`](../../doc/models/last-payment-details.md) | Optional | The details for the last payment. | LastPaymentDetails getLastPayment() | setLastPayment(LastPaymentDetails lastPayment) | +| `NextBillingTime` | `String` | 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})$` | String getNextBillingTime() | setNextBillingTime(String nextBillingTime) | +| `FinalPaymentTime` | `String` | 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})$` | String getFinalPaymentTime() | setFinalPaymentTime(String finalPaymentTime) | +| `FailedPaymentsCount` | `int` | Required | The number of consecutive payment failures. Resets to `0` after a successful payment. If this reaches the `payment_failure_threshold` value, the subscription updates to the `SUSPENDED` state.

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

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

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | String getNumber() | setNumber(String number) | +| `Expiry` | `String` | 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])$` | String getExpiry() | setExpiry(String expiry) | +| `SecurityCode` | `String` | Optional | The three- or four-digit security code of the card. Also known as the CVV, CVC, CVN, CVE, or CID. This parameter cannot be present in the request when `payment_initiator=MERCHANT`.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `4`, *Pattern*: `^[0-9]{3,4}$` | String getSecurityCode() | setSecurityCode(String securityCode) | +| `Type` | [`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_]+$` | CardType getType() | setType(CardType type) | +| `Brand` | [`SubscriptionsCardBrand`](../../doc/models/subscriptions-card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | SubscriptionsCardBrand getBrand() | setBrand(SubscriptionsCardBrand brand) | +| `BillingAddress` | [`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). | Address getBillingAddress() | setBillingAddress(Address billingAddress) | +| `Attributes` | [`SubscriptionsCardAttributes`](../../doc/models/subscriptions-card-attributes.md) | Optional | Additional attributes associated with the use of this card. | SubscriptionsCardAttributes getAttributes() | setAttributes(SubscriptionsCardAttributes attributes) | + +## Example (as JSON) + +```json +{ + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" +} +``` + diff --git a/doc/models/subscription-collection.md b/doc/models/subscription-collection.md new file mode 100644 index 0000000..1e57a98 --- /dev/null +++ b/doc/models/subscription-collection.md @@ -0,0 +1,52 @@ + +# Subscription Collection + +The list of subscriptions. + +## Structure + +`SubscriptionCollection` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Subscriptions` | [`List`](../../doc/models/subscription.md) | Optional | An array of subscriptions.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | String getId() | setId(String id) | +| `EmailAddress` | `String` | 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])+)\])`` | String getEmailAddress() | setEmailAddress(String emailAddress) | +| `Phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | PhoneWithType getPhone() | setPhone(PhoneWithType phone) | + +## Example (as JSON) + +```json +{ + "id": "id2", + "email_address": "email_address0", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + } +} +``` + diff --git a/doc/models/subscription-error-exception.md b/doc/models/subscription-error-exception.md new file mode 100644 index 0000000..c9779ab --- /dev/null +++ b/doc/models/subscription-error-exception.md @@ -0,0 +1,107 @@ + +# Subscription Error Exception + +The error details. + +## Structure + +`SubscriptionErrorException` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Name` | `String` | Required | The human-readable, unique name of the error. | String getName() | setName(String name) | +| `Message` | `String` | Required | The message that describes the error. | String getMessageField() | setMessageField(String messageField) | +| `DebugId` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | String getDebugId() | setDebugId(String debugId) | +| `InformationLink` | `String` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | String getInformationLink() | setInformationLink(String informationLink) | +| `Details` | [`List`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | List getDetails() | setDetails(List details) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). | List getLinks() | setLinks(List links) | + +## Example (as JSON) + +```json +{ + "name": "name0", + "message": "message0", + "debug_id": "debug_id4", + "information_link": "information_link8", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + }, + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + }, + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/subscription-patch-application-context.md b/doc/models/subscription-patch-application-context.md new file mode 100644 index 0000000..64b10d7 --- /dev/null +++ b/doc/models/subscription-patch-application-context.md @@ -0,0 +1,35 @@ + +# Subscription Patch Application Context + +The application context, which customizes the payer experience during the subscription approval process with PayPal. + +## Structure + +`SubscriptionPatchApplicationContext` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `BrandName` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site.

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

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

**Default**: `ExperienceContextShippingPreference.GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | ExperienceContextShippingPreference getShippingPreference() | setShippingPreference(ExperienceContextShippingPreference shippingPreference) | +| `PaymentMethod` | [`PaymentMethod`](../../doc/models/payment-method.md) | Optional | The customer and merchant payment preferences. | PaymentMethod getPaymentMethod() | setPaymentMethod(PaymentMethod paymentMethod) | +| `ReturnUrl` | `String` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | String getReturnUrl() | setReturnUrl(String returnUrl) | +| `CancelUrl` | `String` | Required | The URL where the customer is redirected after the customer cancels the payment.

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

**Constraints**: *Maximum Length*: `140` | String getPrefix() | setPrefix(String prefix) | +| `GivenName` | `String` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | String getGivenName() | setGivenName(String givenName) | +| `Surname` | `String` | 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` | String getSurname() | setSurname(String surname) | +| `MiddleName` | `String` | Optional | When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.

**Constraints**: *Maximum Length*: `140` | String getMiddleName() | setMiddleName(String middleName) | +| `Suffix` | `String` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | String getSuffix() | setSuffix(String suffix) | +| `FullName` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | String getFullName() | setFullName(String fullName) | + +## Example (as JSON) + +```json +{ + "prefix": "prefix4", + "given_name": "given_name8", + "surname": "surname2", + "middle_name": "middle_name4", + "suffix": "suffix4" +} +``` + diff --git a/doc/models/subscription-payment-source-response.md b/doc/models/subscription-payment-source-response.md new file mode 100644 index 0000000..02debce --- /dev/null +++ b/doc/models/subscription-payment-source-response.md @@ -0,0 +1,35 @@ + +# Subscription Payment Source Response + +The payment source used to fund the payment. + +## Structure + +`SubscriptionPaymentSourceResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `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. | CardResponseWithBillingAddress getCard() | setCard(CardResponseWithBillingAddress card) | + +## Example (as JSON) + +```json +{ + "card": { + "name": "name6", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry4", + "currency_code": "currency_code2" + } +} +``` + diff --git a/doc/models/subscription-payment-source.md b/doc/models/subscription-payment-source.md new file mode 100644 index 0000000..8255724 --- /dev/null +++ b/doc/models/subscription-payment-source.md @@ -0,0 +1,29 @@ + +# Subscription Payment Source + +The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions. + +## Structure + +`SubscriptionPaymentSource` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `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. | SubscriptionCardRequest getCard() | setCard(SubscriptionCardRequest card) | + +## Example (as JSON) + +```json +{ + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } +} +``` + diff --git a/doc/models/subscription-plan-status.md b/doc/models/subscription-plan-status.md new file mode 100644 index 0000000..87542ff --- /dev/null +++ b/doc/models/subscription-plan-status.md @@ -0,0 +1,17 @@ + +# Subscription Plan Status + +The plan status. + +## Enumeration + +`SubscriptionPlanStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `Created` | The plan was created. You cannot create subscriptions for a plan in this state. | +| `Inactive` | The plan is inactive. | +| `Active` | The plan is active. You can only create subscriptions for a plan in this state. | + diff --git a/doc/models/subscription-pricing-model.md b/doc/models/subscription-pricing-model.md new file mode 100644 index 0000000..2e26914 --- /dev/null +++ b/doc/models/subscription-pricing-model.md @@ -0,0 +1,16 @@ + +# Subscription Pricing Model + +The pricing model for tiered plan. The `tiers` parameter is required. + +## Enumeration + +`SubscriptionPricingModel` + +## Fields + +| Name | Description | +| --- | --- | +| `Volume` | A volume pricing model. | +| `Tiered` | A tiered pricing model. | + diff --git a/doc/models/subscription-pricing-scheme.md b/doc/models/subscription-pricing-scheme.md new file mode 100644 index 0000000..c124e9a --- /dev/null +++ b/doc/models/subscription-pricing-scheme.md @@ -0,0 +1,60 @@ + +# Subscription Pricing Scheme + +The pricing scheme details. + +## Structure + +`SubscriptionPricingScheme` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Version` | `Integer` | Optional | The version of the pricing scheme.

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

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | List getTiers() | setTiers(List tiers) | +| `CreateTime` | `String` | 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})$` | String getCreateTime() | setCreateTime(String createTime) | +| `UpdateTime` | `String` | 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})$` | String getUpdateTime() | setUpdateTime(String updateTime) | + +## Example (as JSON) + +```json +{ + "version": 172, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time2" +} +``` + diff --git a/doc/models/subscription-transaction-details.md b/doc/models/subscription-transaction-details.md new file mode 100644 index 0000000..2d360ba --- /dev/null +++ b/doc/models/subscription-transaction-details.md @@ -0,0 +1,64 @@ + +# Subscription Transaction Details + +The transaction details. + +## Structure + +`SubscriptionTransactionDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Status` | [`CaptureStatus`](../../doc/models/capture-status.md) | Optional | The status of the captured payment. | CaptureStatus getStatus() | setStatus(CaptureStatus status) | +| `Id` | `String` | Required | The PayPal-generated transaction ID.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | String getId() | setId(String id) | +| `AmountWithBreakdown` | [`SubscriptionAmountWithBreakdown`](../../doc/models/subscription-amount-with-breakdown.md) | Required | The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. | SubscriptionAmountWithBreakdown getAmountWithBreakdown() | setAmountWithBreakdown(SubscriptionAmountWithBreakdown amountWithBreakdown) | +| `PayerName` | [`SubscriptionPayerName`](../../doc/models/subscription-payer-name.md) | Optional | The name of the party. | SubscriptionPayerName getPayerName() | setPayerName(SubscriptionPayerName payerName) | +| `PayerEmail` | `String` | 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])+)\])$`` | String getPayerEmail() | setPayerEmail(String payerEmail) | +| `Time` | `String` | 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})$` | String getTime() | setTime(String time) | + +## Example (as JSON) + +```json +{ + "status": "REFUNDED", + "id": "id4", + "amount_with_breakdown": { + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } + }, + "payer_name": { + "prefix": "prefix8", + "given_name": "given_name2", + "surname": "surname8", + "middle_name": "middle_name0", + "suffix": "suffix0" + }, + "payer_email": "payer_email2", + "time": "time4" +} +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md new file mode 100644 index 0000000..4ea6e14 --- /dev/null +++ b/doc/models/subscription.md @@ -0,0 +1,42 @@ + +# Subscription + +The subscription details. + +## Structure + +`Subscription` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Id` | `String` | Optional | The PayPal-generated ID for the subscription.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | String getId() | setId(String id) | +| `PlanId` | `String` | Optional | The ID of the plan.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | String getPlanId() | setPlanId(String planId) | +| `StartTime` | `String` | 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})$` | String getStartTime() | setStartTime(String startTime) | +| `Quantity` | `String` | Optional | The quantity of the product in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | String getQuantity() | setQuantity(String quantity) | +| `ShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingAmount() | setShippingAmount(Money shippingAmount) | +| `Subscriber` | [`Subscriber`](../../doc/models/subscriber.md) | Optional | The subscriber response information. | Subscriber getSubscriber() | setSubscriber(Subscriber subscriber) | +| `BillingInfo` | [`SubscriptionBillingInformation`](../../doc/models/subscription-billing-information.md) | Optional | The billing details for the subscription. If the subscription was or is active, these fields are populated. | SubscriptionBillingInformation getBillingInfo() | setBillingInfo(SubscriptionBillingInformation billingInfo) | +| `CreateTime` | `String` | 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})$` | String getCreateTime() | setCreateTime(String createTime) | +| `UpdateTime` | `String` | 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})$` | String getUpdateTime() | setUpdateTime(String updateTime) | +| `CustomId` | `String` | Optional | The custom id for the subscription. Can be invoice id.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\x20-\x7E]+` | String getCustomId() | setCustomId(String customId) | +| `PlanOverridden` | `Boolean` | Optional | Indicates whether the subscription has overridden any plan attributes. | Boolean getPlanOverridden() | setPlanOverridden(Boolean planOverridden) | +| `Plan` | [`PlanDetails`](../../doc/models/plan-details.md) | Optional | The plan details. | PlanDetails getPlan() | setPlan(PlanDetails plan) | +| `Links` | [`List`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | List getLinks() | setLinks(List links) | + +## Example (as JSON) + +```json +{ + "id": "id4", + "plan_id": "plan_id6", + "start_time": "start_time8", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } +} +``` + diff --git a/doc/models/subscriptions-card-attributes.md b/doc/models/subscriptions-card-attributes.md new file mode 100644 index 0000000..04e7aca --- /dev/null +++ b/doc/models/subscriptions-card-attributes.md @@ -0,0 +1,41 @@ + +# Subscriptions Card Attributes + +Additional attributes associated with the use of this card. + +## Structure + +`SubscriptionsCardAttributes` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Customer` | [`CardCustomer`](../../doc/models/card-customer.md) | Optional | The details about a customer in PayPal's system of record. | CardCustomer getCustomer() | setCustomer(CardCustomer customer) | +| `Vault` | [`VaultInstructionBase`](../../doc/models/vault-instruction-base.md) | Optional | Basic vault instruction specification that can be extended by specific payment sources that supports vaulting. | VaultInstructionBase getVault() | setVault(VaultInstructionBase vault) | +| `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). | CardVerification getVerification() | setVerification(CardVerification verification) | + +## Example (as JSON) + +```json +{ + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "merchant_customer_id": "merchant_customer_id2" + }, + "vault": { + "store_in_vault": "ON_SUCCESS" + }, + "verification": { + "method": "3D_SECURE" + } +} +``` + diff --git a/doc/models/subscriptions-card-brand.md b/doc/models/subscriptions-card-brand.md new file mode 100644 index 0000000..9742d14 --- /dev/null +++ b/doc/models/subscriptions-card-brand.md @@ -0,0 +1,39 @@ + +# Subscriptions Card Brand + +The card network or brand. Applies to credit, debit, gift, and payment cards. + +## Enumeration + +`SubscriptionsCardBrand` + +## Fields + +| Name | Description | +| --- | --- | +| `Visa` | Visa card. | +| `Mastercard` | Mastercard card. | +| `Discover` | Discover card. | +| `Amex` | American Express card. | +| `Solo` | Solo debit card. | +| `Jcb` | Japan Credit Bureau card. | +| `Star` | Military Star card. | +| `Delta` | Delta Airlines card. | +| `Switch` | Switch credit card. | +| `Maestro` | Maestro credit card. | +| `CbNationale` | Carte Bancaire (CB) credit card. | +| `Configoga` | Configoga credit card. | +| `Confidis` | Confidis credit card. | +| `Electron` | Visa Electron credit card. | +| `Cetelem` | Cetelem credit card. | +| `ChinaUnionPay` | China union pay credit card. | +| `Diners` | The Diners Club International banking and payment services capability network owned by Discover Financial Services (DFS), one of the most recognized brands in US financial services. | +| `Elo` | The Brazilian Elo card payment network. | +| `Hiper` | The Hiper - Ingenico ePayment network. | +| `Hipercard` | The Brazilian Hipercard payment network that's widely accepted in the retail market. | +| `Rupay` | The RuPay payment network. | +| `Ge` | The GE Credit Union 3Point card payment network. | +| `Synchrony` | The Synchrony Financial (SYF) payment network. | +| `Eftpos` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | +| `Unknown` | UNKNOWN payment network. | + diff --git a/doc/models/supplementary-purchase-data.md b/doc/models/supplementary-purchase-data.md deleted file mode 100644 index f023691..0000000 --- a/doc/models/supplementary-purchase-data.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Supplementary Purchase Data - -The capture identification-related fields. Includes the invoice ID, custom ID, note to payer, and soft descriptor. - -## Structure - -`SupplementaryPurchaseData` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `InvoiceId` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | String getReason() | setReason(String reason) | + +## Example (as JSON) + +```json +{ + "reason": "reason4" +} +``` + diff --git a/doc/models/tax-amount.md b/doc/models/tax-amount.md new file mode 100644 index 0000000..7375429 --- /dev/null +++ b/doc/models/tax-amount.md @@ -0,0 +1,26 @@ + +# Tax Amount + +The tax levied by a government on the purchase of goods or services. + +## Structure + +`TaxAmount` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `TaxAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTaxAmount() | setTaxAmount(Money taxAmount) | + +## Example (as JSON) + +```json +{ + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + } +} +``` + diff --git a/doc/models/taxes-override.md b/doc/models/taxes-override.md new file mode 100644 index 0000000..ace08d0 --- /dev/null +++ b/doc/models/taxes-override.md @@ -0,0 +1,25 @@ + +# Taxes Override + +The tax details. + +## Structure + +`TaxesOverride` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Percentage` | `String` | 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]+))$` | String getPercentage() | setPercentage(String percentage) | +| `Inclusive` | `Boolean` | Optional | Indicates whether the tax was already included in the billing amount. | Boolean getInclusive() | setInclusive(Boolean inclusive) | + +## Example (as JSON) + +```json +{ + "percentage": "percentage8", + "inclusive": false +} +``` + diff --git a/doc/models/taxes.md b/doc/models/taxes.md new file mode 100644 index 0000000..8c028a7 --- /dev/null +++ b/doc/models/taxes.md @@ -0,0 +1,25 @@ + +# Taxes + +The tax details. + +## Structure + +`Taxes` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Percentage` | `String` | 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]+))$` | String getPercentage() | setPercentage(String percentage) | +| `Inclusive` | `Boolean` | Optional | Indicates whether the tax was already included in the billing amount.

**Default**: `true` | Boolean getInclusive() | setInclusive(Boolean inclusive) | + +## Example (as JSON) + +```json +{ + "percentage": "percentage6", + "inclusive": true +} +``` + diff --git a/doc/models/tenure-type.md b/doc/models/tenure-type.md index 394ed40..b04c13c 100644 --- a/doc/models/tenure-type.md +++ b/doc/models/tenure-type.md @@ -1,7 +1,7 @@ # Tenure Type -The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle. +The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle., The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan., The type of the billing cycle. ## Enumeration diff --git a/doc/models/transaction-details.md b/doc/models/transaction-details.md new file mode 100644 index 0000000..6c64792 --- /dev/null +++ b/doc/models/transaction-details.md @@ -0,0 +1,90 @@ + +# Transaction Details + +The transaction details. + +## Structure + +`TransactionDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `TransactionInfo` | [`TransactionInformation`](../../doc/models/transaction-information.md) | Optional | The transaction information. | TransactionInformation getTransactionInfo() | setTransactionInfo(TransactionInformation transactionInfo) | +| `PayerInfo` | [`PayerInformation`](../../doc/models/payer-information.md) | Optional | The payer information. | PayerInformation getPayerInfo() | setPayerInfo(PayerInformation payerInfo) | +| `ShippingInfo` | [`ShippingInformation`](../../doc/models/shipping-information.md) | Optional | The shipping information. | ShippingInformation getShippingInfo() | setShippingInfo(ShippingInformation shippingInfo) | +| `CartInfo` | [`CartInformation`](../../doc/models/cart-information.md) | Optional | The cart information. | CartInformation getCartInfo() | setCartInfo(CartInformation cartInfo) | +| `StoreInfo` | [`StoreInformation`](../../doc/models/store-information.md) | Optional | The store information. | StoreInformation getStoreInfo() | setStoreInfo(StoreInformation storeInfo) | +| `AuctionInfo` | [`AuctionInformation`](../../doc/models/auction-information.md) | Optional | The auction information. | AuctionInformation getAuctionInfo() | setAuctionInfo(AuctionInformation auctionInfo) | +| `IncentiveInfo` | [`IncentiveInformation`](../../doc/models/incentive-information.md) | Optional | The incentive details. | IncentiveInformation getIncentiveInfo() | setIncentiveInfo(IncentiveInformation incentiveInfo) | + +## Example (as JSON) + +```json +{ + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } +} +``` + diff --git a/doc/models/transaction-information.md b/doc/models/transaction-information.md new file mode 100644 index 0000000..cae1ac6 --- /dev/null +++ b/doc/models/transaction-information.md @@ -0,0 +1,60 @@ + +# Transaction Information + +The transaction information. + +## Structure + +`TransactionInformation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `PaypalAccountId` | `String` | Optional | The ID of the PayPal account of the counterparty.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | String getPaypalAccountId() | setPaypalAccountId(String paypalAccountId) | +| `TransactionId` | `String` | Optional | The PayPal-generated transaction ID.

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `5`, *Pattern*: `^[a-zA-Z0-9]*$` | String getTransactionEventCode() | setTransactionEventCode(String transactionEventCode) | +| `TransactionInitiationDate` | `String` | 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})$` | String getTransactionInitiationDate() | setTransactionInitiationDate(String transactionInitiationDate) | +| `TransactionUpdatedDate` | `String` | 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})$` | String getTransactionUpdatedDate() | setTransactionUpdatedDate(String transactionUpdatedDate) | +| `TransactionAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTransactionAmount() | setTransactionAmount(Money transactionAmount) | +| `FeeAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getFeeAmount() | setFeeAmount(Money feeAmount) | +| `DiscountAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getDiscountAmount() | setDiscountAmount(Money discountAmount) | +| `InsuranceAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getInsuranceAmount() | setInsuranceAmount(Money insuranceAmount) | +| `SalesTaxAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getSalesTaxAmount() | setSalesTaxAmount(Money salesTaxAmount) | +| `ShippingAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingAmount() | setShippingAmount(Money shippingAmount) | +| `ShippingDiscountAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingDiscountAmount() | setShippingDiscountAmount(Money shippingDiscountAmount) | +| `ShippingTaxAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getShippingTaxAmount() | setShippingTaxAmount(Money shippingTaxAmount) | +| `OtherAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getOtherAmount() | setOtherAmount(Money otherAmount) | +| `TipAmount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getTipAmount() | setTipAmount(Money tipAmount) | +| `TransactionStatus` | `String` | Optional | A code that indicates the transaction status. Value is: Status code Description D PayPal or merchant rules denied the transaction. P The transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S. S The transaction successfully completed without a denial and after any pending statuses. V A successful transaction was fully reversed and funds were refunded to the original sender.

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9]*$` | String getPaymentTrackingId() | setPaymentTrackingId(String paymentTrackingId) | +| `BankReferenceId` | `String` | Optional | The bank reference ID. The bank provides this value for an ACH transaction.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9]*$` | String getBankReferenceId() | setBankReferenceId(String bankReferenceId) | +| `EndingBalance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getEndingBalance() | setEndingBalance(Money endingBalance) | +| `AvailableBalance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getAvailableBalance() | setAvailableBalance(Money availableBalance) | +| `InvoiceId` | `String` | Optional | The invoice ID that is sent by the merchant with the transaction. Note: If an invoice ID was sent with the capture request, the value is reported. Otherwise, the invoice ID of the authorizing transaction is reported.

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z0-9.]*$` | String getCreditTerm() | setCreditTerm(String creditTerm) | +| `CreditTransactionalFee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getCreditTransactionalFee() | setCreditTransactionalFee(Money creditTransactionalFee) | +| `CreditPromotionalFee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | Money getCreditPromotionalFee() | setCreditPromotionalFee(Money creditPromotionalFee) | +| `AnnualPercentageRate` | `String` | 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]+))$` | String getAnnualPercentageRate() | setAnnualPercentageRate(String annualPercentageRate) | +| `PaymentMethodType` | `String` | Optional | The payment method that was used for a transaction. Value is PUI, installment, or mEFT. Note: Appears only for pay upon invoice (PUI), installment, and mEFT transactions. Merchants and partners in the EMEA region can use this attribute to note transactions that attract turn-over tax.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[a-zA-Z0-9-]*$` | String getPaymentMethodType() | setPaymentMethodType(String paymentMethodType) | +| `InstrumentType` | `String` | 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` | String getInstrumentType() | setInstrumentType(String instrumentType) | +| `InstrumentSubType` | `String` | 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` | String getInstrumentSubType() | setInstrumentSubType(String instrumentSubType) | + +## Example (as JSON) + +```json +{ + "paypal_account_id": "paypal_account_id6", + "transaction_id": "transaction_id2", + "paypal_reference_id": "paypal_reference_id4", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code8" +} +``` + diff --git a/doc/models/transaction-search-error-details.md b/doc/models/transaction-search-error-details.md new file mode 100644 index 0000000..d8e47b5 --- /dev/null +++ b/doc/models/transaction-search-error-details.md @@ -0,0 +1,31 @@ + +# Transaction Search Error Details + +The error details. Required for client-side `4XX` errors. + +## Structure + +`TransactionSearchErrorDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Field` | `String` | Optional | The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors. | String getField() | setField(String field) | +| `Value` | `String` | Optional | The value of the field that caused the error. | String getValue() | setValue(String value) | +| `Location` | `String` | Optional | The location of the field that caused the error. Value is `body`, `path`, or `query`.

**Default**: `"body"` | String getLocation() | setLocation(String location) | +| `Issue` | `String` | Required | The unique, fine-grained application-level error code. | String getIssue() | setIssue(String issue) | +| `Description` | `String` | 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. | String getDescription() | setDescription(String description) | + +## Example (as JSON) + +```json +{ + "location": "body", + "issue": "issue2", + "field": "field0", + "value": "value8", + "description": "description6" +} +``` + diff --git a/doc/models/transactions-list.md b/doc/models/transactions-list.md new file mode 100644 index 0000000..ab608db --- /dev/null +++ b/doc/models/transactions-list.md @@ -0,0 +1,80 @@ + +# Transactions List + +The list transactions for a subscription request details. + +## Structure + +`TransactionsList` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Transactions` | [`List`](../../doc/models/subscription-transaction-details.md) | Optional | An array of transactions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | List getTransactions() | setTransactions(List transactions) | +| `TotalItems` | `Integer` | Optional | The total number of items.

**Constraints**: `>= 0`, `<= 500000000` | Integer getTotalItems() | setTotalItems(Integer totalItems) | +| `TotalPages` | `Integer` | Optional | The total number of pages.

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

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | String getToken() | setToken(String token) | +| `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. | ApplePayRequestCard getCard() | setCard(ApplePayRequestCard card) | + +## Example (as JSON) + +```json +{ + "token": "token4", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } +} +``` + diff --git a/doc/models/setup-token-card-experience-context.md b/doc/models/vault-card-experience-context.md similarity index 61% rename from doc/models/setup-token-card-experience-context.md rename to doc/models/vault-card-experience-context.md index b474a5b..f4af1f5 100644 --- a/doc/models/setup-token-card-experience-context.md +++ b/doc/models/vault-card-experience-context.md @@ -1,31 +1,33 @@ -# Setup Token Card Experience Context +# Vault Card Experience Context -Customizes the Vault creation flow experience for your customers. +A resource representing an experience context of vault a card. ## Structure -`SetupTokenCardExperienceContext` +`VaultCardExperienceContext` ## Fields | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `BrandName` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

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

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

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

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

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

**Default**: `VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | VaultInstructionAction getVaultInstruction() | setVaultInstruction(VaultInstructionAction vaultInstruction) | +| `VaultInstruction` | [`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_]+$` | VaultInstructionAction getVaultInstruction() | setVaultInstruction(VaultInstructionAction vaultInstruction) | +| `UserAction` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction.CONTINUE`

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

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

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

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

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

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

**Default**: `OrderApplicationContextShippingPreference.GET_FROM_FILE`

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

**Default**: `VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS`

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

**Default**: `ExperienceContextShippingPreference.GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | ExperienceContextShippingPreference getShippingPreference() | setShippingPreference(ExperienceContextShippingPreference shippingPreference) | +| `VaultInstruction` | [`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_]+$` | VaultInstructionAction getVaultInstruction() | setVaultInstruction(VaultInstructionAction vaultInstruction) | +| `AppSwitchContext` | [`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. | AppSwitchContext getAppSwitchContext() | setAppSwitchContext(AppSwitchContext appSwitchContext) | +| `UserAction` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction.CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | VaultUserAction getUserAction() | setUserAction(VaultUserAction userAction) | ## Example (as JSON) ```json { "shipping_preference": "GET_FROM_FILE", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", + "user_action": "CONTINUE", "brand_name": "brand_name0", "locale": "locale4", "return_url": "return_url2", diff --git a/doc/models/vault-paypal-wallet-request.md b/doc/models/vault-paypal-wallet-request.md index b4546c7..92b38bd 100644 --- a/doc/models/vault-paypal-wallet-request.md +++ b/doc/models/vault-paypal-wallet-request.md @@ -18,7 +18,7 @@ A resource representing a request to vault PayPal Wallet. | `UsageType` | [`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_]+$` | PaypalPaymentTokenUsageType getUsageType() | setUsageType(PaypalPaymentTokenUsageType usageType) | | `CustomerType` | [`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_]+$` | PaypalPaymentTokenCustomerType getCustomerType() | setCustomerType(PaypalPaymentTokenCustomerType customerType) | | `BillingPlan` | [`Plan`](../../doc/models/plan.md) | Optional | The merchant level Recurring Billing plan metadata for the Billing Agreement. | Plan getBillingPlan() | setBillingPlan(Plan billingPlan) | -| `ExperienceContext` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | VaultExperienceContext getExperienceContext() | setExperienceContext(VaultExperienceContext experienceContext) | +| `ExperienceContext` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | A resource representing an experience context of vault PayPal Wallet. | VaultExperienceContext getExperienceContext() | setExperienceContext(VaultExperienceContext experienceContext) | ## Example (as JSON) @@ -31,6 +31,7 @@ A resource representing a request to vault PayPal Wallet. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vault-user-action.md b/doc/models/vault-user-action.md new file mode 100644 index 0000000..3e88121 --- /dev/null +++ b/doc/models/vault-user-action.md @@ -0,0 +1,16 @@ + +# Vault User Action + +User Action on action to be performed after a successful payer approval. + +## Enumeration + +`VaultUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `SetupNow` | After you redirect the customer to the PayPal payment page, a Setup Now button appears. Use this option when no additional inputs are needed from merchant site and to create the billing agreement immediately when the customer clicks Setup Now. | +| `Continue` | After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when you want to redirect the customer from the completed payment page to the merchant site for additional inputs without immediately creating the billing agreement. | + diff --git a/doc/models/vault-venmo-experience-context.md b/doc/models/vault-venmo-experience-context.md deleted file mode 100644 index 893c56c..0000000 --- a/doc/models/vault-venmo-experience-context.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Vault Venmo Experience Context - -Customizes the Vault creation flow experience for your customers. - -## Structure - -`VaultVenmoExperienceContext` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `BrandName` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

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

**Default**: `OrderApplicationContextShippingPreference.GET_FROM_FILE`

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

**Default**: `VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | VaultInstructionAction getVaultInstruction() | setVaultInstruction(VaultInstructionAction vaultInstruction) | - -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", - "brand_name": "brand_name0" -} -``` - diff --git a/doc/models/vault-venmo-request.md b/doc/models/vault-venmo-request.md index 42709dc..5de7464 100644 --- a/doc/models/vault-venmo-request.md +++ b/doc/models/vault-venmo-request.md @@ -1,6 +1,8 @@ # Vault Venmo Request +A resource representing a request to vault Venmo. + ## Structure `VaultVenmoRequest` @@ -15,7 +17,7 @@ | `PermitMultiplePaymentTokens` | `Boolean` | 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` | Boolean getPermitMultiplePaymentTokens() | setPermitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) | | `UsageType` | [`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_]+$` | PaypalPaymentTokenUsageType getUsageType() | setUsageType(PaypalPaymentTokenUsageType usageType) | | `CustomerType` | [`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_]+$` | PaypalPaymentTokenCustomerType getCustomerType() | setCustomerType(PaypalPaymentTokenCustomerType customerType) | -| `ExperienceContext` | [`VaultVenmoExperienceContext`](../../doc/models/vault-venmo-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | VaultVenmoExperienceContext getExperienceContext() | setExperienceContext(VaultVenmoExperienceContext experienceContext) | +| `ExperienceContext` | [`VenmoExperienceContext`](../../doc/models/venmo-experience-context.md) | Optional | A resource representing an experience context of vault a venmo account. | VenmoExperienceContext getExperienceContext() | setExperienceContext(VenmoExperienceContext experienceContext) | ## Example (as JSON) @@ -28,6 +30,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md index 034375b..6cb1da0 100644 --- a/doc/models/vaulted-digital-wallet-shipping-details.md +++ b/doc/models/vaulted-digital-wallet-shipping-details.md @@ -12,6 +12,7 @@ The shipping details. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | ShippingName getName() | setName(ShippingName name) | +| `EmailAddress` | `String` | 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])+)\])$`` | String getEmailAddress() | setEmailAddress(String emailAddress) | | `PhoneNumber` | [`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). | PhoneNumberWithCountryCode getPhoneNumber() | setPhoneNumber(PhoneNumberWithCountryCode phoneNumber) | | `Type` | [`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_]+$` | FulfillmentType getType() | setType(FulfillmentType type) | | `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). | Address getAddress() | setAddress(Address address) | @@ -23,6 +24,7 @@ The shipping details. "name": { "full_name": "full_name6" }, + "email_address": "email_address6", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vaulted-digital-wallet.md b/doc/models/vaulted-digital-wallet.md index 604522b..577644a 100644 --- a/doc/models/vaulted-digital-wallet.md +++ b/doc/models/vaulted-digital-wallet.md @@ -29,6 +29,7 @@ Resource consolidating common request and response attributes for vaulting a Dig "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/venmo-experience-context.md b/doc/models/venmo-experience-context.md new file mode 100644 index 0000000..f3e3bc2 --- /dev/null +++ b/doc/models/venmo-experience-context.md @@ -0,0 +1,29 @@ + +# Venmo Experience Context + +A resource representing an experience context of vault a venmo account. + +## Structure + +`VenmoExperienceContext` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `BrandName` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

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

**Default**: `ExperienceContextShippingPreference.GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | ExperienceContextShippingPreference getShippingPreference() | setShippingPreference(ExperienceContextShippingPreference shippingPreference) | +| `VaultInstruction` | [`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_]+$` | VaultInstructionAction getVaultInstruction() | setVaultInstruction(VaultInstructionAction vaultInstruction) | +| `UserAction` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction.CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | VaultUserAction getUserAction() | setUserAction(VaultUserAction userAction) | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "user_action": "CONTINUE", + "brand_name": "brand_name0", + "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" +} +``` + diff --git a/doc/models/venmo-payment-token.md b/doc/models/venmo-payment-token.md index 4abbc4f..7a8a8d5 100644 --- a/doc/models/venmo-payment-token.md +++ b/doc/models/venmo-payment-token.md @@ -1,6 +1,8 @@ # Venmo Payment Token +Full representation of a Venmo Payment Token. + ## Structure `VenmoPaymentToken` @@ -15,7 +17,7 @@ | `PermitMultiplePaymentTokens` | `Boolean` | 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` | Boolean getPermitMultiplePaymentTokens() | setPermitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) | | `UsageType` | [`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_]+$` | PaypalPaymentTokenUsageType getUsageType() | setUsageType(PaypalPaymentTokenUsageType usageType) | | `CustomerType` | [`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_]+$` | PaypalPaymentTokenCustomerType getCustomerType() | setCustomerType(PaypalPaymentTokenCustomerType customerType) | -| `EmailAddress` | `String` | 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])+)\])`` | String getEmailAddress() | setEmailAddress(String emailAddress) | +| `EmailAddress` | `String` | 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])+)\])`` | String getEmailAddress() | setEmailAddress(String emailAddress) | | `PayerId` | `String` | Optional | The account identifier for a PayPal account.

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

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

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | List getLinks() | setLinks(List links) | +| `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. | CustomerInformation getCustomer() | setCustomer(CustomerInformation customer) | + +## Example (as JSON) + +```json +{ + "id": "id2", + "status": "CREATED", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "name": { + "given_name": "given_name2", + "surname": "surname8" + } + } +} +``` + diff --git a/doc/models/venmo-wallet-attributes-response.md b/doc/models/venmo-wallet-attributes-response.md index 960c404..8d59c46 100644 --- a/doc/models/venmo-wallet-attributes-response.md +++ b/doc/models/venmo-wallet-attributes-response.md @@ -11,7 +11,7 @@ Additional attributes associated with the use of a Venmo Wallet. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Vault` | [`VaultResponse`](../../doc/models/vault-response.md) | Optional | The details about a saved payment source. | VaultResponse getVault() | setVault(VaultResponse vault) | +| `Vault` | [`VenmoVaultResponse`](../../doc/models/venmo-vault-response.md) | Optional | The details about a saved venmo payment source. | VenmoVaultResponse getVault() | setVault(VenmoVaultResponse vault) | ## Example (as JSON) @@ -20,20 +20,27 @@ Additional attributes associated with the use of a Venmo Wallet. "vault": { "id": "id6", "status": "APPROVED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, "links": [ { "href": "href6", "rel": "rel0", "method": "HEAD" } - ] + ], + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "name": { + "given_name": "given_name2", + "surname": "surname8" + } + } } } ``` diff --git a/doc/models/shipping-preference.md b/doc/models/venmo-wallet-experience-context-shipping-preference.md similarity index 83% rename from doc/models/shipping-preference.md rename to doc/models/venmo-wallet-experience-context-shipping-preference.md index c50b181..61917d0 100644 --- a/doc/models/shipping-preference.md +++ b/doc/models/venmo-wallet-experience-context-shipping-preference.md @@ -1,11 +1,11 @@ -# Shipping Preference +# Venmo Wallet Experience Context Shipping Preference The location from which the shipping address is derived. ## Enumeration -`ShippingPreference` +`VenmoWalletExperienceContextShippingPreference` ## Fields diff --git a/doc/models/venmo-wallet-experience-context-user-action.md b/doc/models/venmo-wallet-experience-context-user-action.md new file mode 100644 index 0000000..83a26bc --- /dev/null +++ b/doc/models/venmo-wallet-experience-context-user-action.md @@ -0,0 +1,16 @@ + +# Venmo Wallet Experience Context User Action + +Configures a Continue or Pay Now checkout flow. + +## Enumeration + +`VenmoWalletExperienceContextUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `Continue` | After you redirect the customer to the Venmo payment page, a Continue button appears. Use this option when the final amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant page without processing the payment. | +| `PayNow` | After you redirect the customer to the Venmo payment page, a Pay Now button appears. Use this option when the final amount is known when the checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. | + diff --git a/doc/models/venmo-wallet-experience-context.md b/doc/models/venmo-wallet-experience-context.md index 0c1faee..1495dad 100644 --- a/doc/models/venmo-wallet-experience-context.md +++ b/doc/models/venmo-wallet-experience-context.md @@ -12,14 +12,16 @@ Customizes the buyer experience during the approval process for payment with Ven | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `BrandName` | `String` | Optional | The business name of the merchant. The pattern is defined by an external party and supports Unicode.

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

**Default**: `ShippingPreference.GET_FROM_FILE`

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

**Default**: `VenmoWalletExperienceContextShippingPreference.GET_FROM_FILE`

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

**Default**: `VenmoWalletExperienceContextUserAction.CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | VenmoWalletExperienceContextUserAction getUserAction() | setUserAction(VenmoWalletExperienceContextUserAction userAction) | ## Example (as JSON) ```json { "shipping_preference": "GET_FROM_FILE", + "user_action": "CONTINUE", "brand_name": "brand_name6", "order_update_callback_config": { "callback_events": [ diff --git a/doc/models/venmo-wallet-request.md b/doc/models/venmo-wallet-request.md index 375a580..057a87e 100644 --- a/doc/models/venmo-wallet-request.md +++ b/doc/models/venmo-wallet-request.md @@ -32,7 +32,8 @@ Information needed to pay using Venmo. "SHIPPING_OPTIONS" ], "callback_url": "callback_url6" - } + }, + "user_action": "CONTINUE" }, "attributes": { "customer": { diff --git a/doc/models/venmo-wallet-response.md b/doc/models/venmo-wallet-response.md index 9eee6a0..1702fdf 100644 --- a/doc/models/venmo-wallet-response.md +++ b/doc/models/venmo-wallet-response.md @@ -17,12 +17,14 @@ Venmo wallet response. | `Name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | Name getName() | setName(Name name) | | `PhoneNumber` | [`PhoneNumber`](../../doc/models/phone-number.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | PhoneNumber getPhoneNumber() | setPhoneNumber(PhoneNumber phoneNumber) | | `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). | Address getAddress() | setAddress(Address address) | +| `ReturnFlow` | [`ReturnFlow`](../../doc/models/return-flow.md) | Optional | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App.

**Default**: `ReturnFlow.AUTO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | ReturnFlow getReturnFlow() | setReturnFlow(ReturnFlow returnFlow) | | `Attributes` | [`VenmoWalletAttributesResponse`](../../doc/models/venmo-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a Venmo Wallet. | VenmoWalletAttributesResponse getAttributes() | setAttributes(VenmoWalletAttributesResponse attributes) | ## Example (as JSON) ```json { + "return_flow": "AUTO", "email_address": "email_address6", "account_id": "account_id8", "user_name": "user_name2", diff --git a/pom.xml b/pom.xml index d0e215c..7380494 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ 4.0.0 com.paypal.sdk paypal-server-sdk - 1.1.0 + 2.0.0 jar PayPal Server SDK PayPal's SDK for interacting with the REST APIs @@ -35,26 +35,22 @@ Repository Snapshot Server https://s01.oss.sonatype.org/content/repositories/snapshots - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - io.apimatic core-interfaces - [0.3.1, 0.4) + [0.3.4, 0.4) io.apimatic core - [0.6.8, 0.7) + [0.6.15, 0.7) io.apimatic okhttp-client-adapter - [0.3.1, 0.4) + [0.3.5, 0.4) @@ -164,14 +160,15 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://s01.oss.sonatype.org/ - true + ossrh + true + true + validated diff --git a/src/main/java/com/paypal/sdk/PaypalServerSdkClient.java b/src/main/java/com/paypal/sdk/PaypalServerSdkClient.java index cc67e2e..aeb2ea7 100644 --- a/src/main/java/com/paypal/sdk/PaypalServerSdkClient.java +++ b/src/main/java/com/paypal/sdk/PaypalServerSdkClient.java @@ -11,6 +11,8 @@ import com.paypal.sdk.controllers.OAuthAuthorizationController; import com.paypal.sdk.controllers.OrdersController; import com.paypal.sdk.controllers.PaymentsController; +import com.paypal.sdk.controllers.SubscriptionsController; +import com.paypal.sdk.controllers.TransactionsearchController; import com.paypal.sdk.controllers.VaultController; import com.paypal.sdk.http.client.HttpCallback; import com.paypal.sdk.http.client.HttpClientConfiguration; @@ -41,11 +43,13 @@ public final class PaypalServerSdkClient implements Configuration { private OrdersController orders; private PaymentsController payments; private VaultController vault; + private TransactionsearchController transactionsearch; + private SubscriptionsController subscriptions; private OAuthAuthorizationController oAuthAuthorization; private static final CompatibilityFactory compatibilityFactory = new CompatibilityFactoryImpl(); - private static String userAgent = "PayPal REST API Java SDK, Version: 1.1.0, on OS {os-info}"; + private static String userAgent = "PayPal REST API Java SDK, Version: 2.0.0, on OS {os-info}"; /** * Current API environment. @@ -116,6 +120,8 @@ private PaypalServerSdkClient(Environment environment, HttpClient httpClient, orders = new OrdersController(globalConfig); payments = new PaymentsController(globalConfig); vault = new VaultController(globalConfig); + transactionsearch = new TransactionsearchController(globalConfig); + subscriptions = new SubscriptionsController(globalConfig); oAuthAuthorization = new OAuthAuthorizationController(globalConfig); } @@ -150,6 +156,22 @@ public VaultController getVaultController() { return vault; } + /** + * Get the instance of TransactionsearchController. + * @return transactionsearch + */ + public TransactionsearchController getTransactionsearchController() { + return transactionsearch; + } + + /** + * Get the instance of SubscriptionsController. + * @return subscriptions + */ + public SubscriptionsController getSubscriptionsController() { + return subscriptions; + } + /** * Get the instance of OAuthAuthorizationController. * @return oAuthAuthorization diff --git a/src/main/java/com/paypal/sdk/controllers/OAuthAuthorizationController.java b/src/main/java/com/paypal/sdk/controllers/OAuthAuthorizationController.java index ec913fb..878b72f 100644 --- a/src/main/java/com/paypal/sdk/controllers/OAuthAuthorizationController.java +++ b/src/main/java/com/paypal/sdk/controllers/OAuthAuthorizationController.java @@ -59,10 +59,10 @@ public ApiResponse requestToken( public CompletableFuture> requestTokenAsync( final RequestTokenInput input, final Map fieldParameters) { - try { - return prepareRequestTokenRequest(input, fieldParameters).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareRequestTokenRequest(input, fieldParameters).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } @@ -71,7 +71,7 @@ public CompletableFuture> requestTokenAsync( */ private ApiCall, ApiException> prepareRequestTokenRequest( final RequestTokenInput input, - final Map fieldParameters) throws IOException { + final Map fieldParameters) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder diff --git a/src/main/java/com/paypal/sdk/controllers/OrdersController.java b/src/main/java/com/paypal/sdk/controllers/OrdersController.java index acffef0..7d7e8ee 100644 --- a/src/main/java/com/paypal/sdk/controllers/OrdersController.java +++ b/src/main/java/com/paypal/sdk/controllers/OrdersController.java @@ -6,7 +6,6 @@ package com.paypal.sdk.controllers; -import com.fasterxml.jackson.core.JsonProcessingException; import com.paypal.sdk.ApiHelper; import com.paypal.sdk.Server; import com.paypal.sdk.exceptions.ApiException; @@ -44,6 +43,157 @@ public OrdersController(GlobalConfiguration globalConfig) { super(globalConfig); } + /** + * Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce + * risk and payment processing costs. For more information about processing payments, see + * checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 + * errors. + * @param input CreateOrderInput object containing request parameters + * @return Returns the Order wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse createOrder( + final CreateOrderInput input) throws ApiException, IOException { + return prepareCreateOrderRequest(input).execute(); + } + + /** + * Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce + * risk and payment processing costs. For more information about processing payments, see + * checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 + * errors. + * @param input CreateOrderInput object containing request parameters + * @return Returns the Order wrapped in ApiResponse response from the API call + */ + public CompletableFuture> createOrderAsync( + final CreateOrderInput input) { + try { + return prepareCreateOrderRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for createOrder. + */ + private ApiCall, ApiException> prepareCreateOrderRequest( + final CreateOrderInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v2/checkout/orders") + .bodyParam(param -> param.value(input.getBody())) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("PayPal-Mock-Response") + .value(input.getPaypalMockResponse()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Partner-Attribution-Id") + .value(input.getPaypalPartnerAttributionId()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Client-Metadata-Id") + .value(input.getPaypalClientMetadataId()).isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Auth-Assertion") + .value(input.getPaypalAuthAssertion()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, Order.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new ErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders + * v2 errors. + * @param input GetOrderInput object containing request parameters + * @return Returns the Order wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse getOrder( + final GetOrderInput input) throws ApiException, IOException { + return prepareGetOrderRequest(input).execute(); + } + + /** + * Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders + * v2 errors. + * @param input GetOrderInput object containing request parameters + * @return Returns the Order wrapped in ApiResponse response from the API call + */ + public CompletableFuture> getOrderAsync( + final GetOrderInput input) { + try { + return prepareGetOrderRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for getOrder. + */ + private ApiCall, ApiException> prepareGetOrderRequest( + final GetOrderInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v2/checkout/orders/{id}") + .queryParam(param -> param.key("fields") + .value(input.getFields()).isRequired(false)) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("PayPal-Mock-Response") + .value(input.getPaypalMockResponse()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Auth-Assertion") + .value(input.getPaypalAuthAssertion()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, Order.class)) + .nullify404(false) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new ErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + /** * Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the * `COMPLETED` status.<br/><br/>To make an update, you must provide a `reference_id`. If you @@ -89,6 +239,7 @@ public OrdersController(GlobalConfiguration globalConfig) { * remove</td><td></td></tr><tr><td><code>application_context.client_configuration</code></td><td>replace, * add</td><td></td></tr></tbody></table>. * @param input PatchOrderInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ @@ -146,10 +297,10 @@ public ApiResponse patchOrder( */ public CompletableFuture> patchOrderAsync( final PatchOrderInput input) { - try { - return preparePatchOrderRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return preparePatchOrderRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } @@ -157,7 +308,7 @@ public CompletableFuture> patchOrderAsync( * Builds the ApiCall object for patchOrder. */ private ApiCall, ApiException> preparePatchOrderRequest( - final PatchOrderInput input) throws JsonProcessingException, IOException { + final PatchOrderInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder @@ -199,65 +350,53 @@ private ApiCall, ApiException> preparePatchOrderRequest( } /** - * Authorizes payment for an order. To successfully authorize payment for an order, the buyer - * must first approve the order or a valid payment_source must be provided in the request. A - * buyer can approve the order upon being redirected to the rel:approve URL that was returned in - * the HATEOAS links in the create order response. Note: For error handling and troubleshooting, - * see Orders v2 errors. - * @param input AuthorizeOrderInput object containing request parameters - * @return Returns the OrderAuthorizeResponse wrapped in ApiResponse response from the API call + * Payer confirms their intent to pay for the the Order with the given payment source. + * @param input ConfirmOrderInput object containing request parameters + * @return Returns the Order wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse authorizeOrder( - final AuthorizeOrderInput input) throws ApiException, IOException { - return prepareAuthorizeOrderRequest(input).execute(); + public ApiResponse confirmOrder( + final ConfirmOrderInput input) throws ApiException, IOException { + return prepareConfirmOrderRequest(input).execute(); } /** - * Authorizes payment for an order. To successfully authorize payment for an order, the buyer - * must first approve the order or a valid payment_source must be provided in the request. A - * buyer can approve the order upon being redirected to the rel:approve URL that was returned in - * the HATEOAS links in the create order response. Note: For error handling and troubleshooting, - * see Orders v2 errors. - * @param input AuthorizeOrderInput object containing request parameters - * @return Returns the OrderAuthorizeResponse wrapped in ApiResponse response from the API call + * Payer confirms their intent to pay for the the Order with the given payment source. + * @param input ConfirmOrderInput object containing request parameters + * @return Returns the Order wrapped in ApiResponse response from the API call */ - public CompletableFuture> authorizeOrderAsync( - final AuthorizeOrderInput input) { - try { - return prepareAuthorizeOrderRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> confirmOrderAsync( + final ConfirmOrderInput input) { + try { + return prepareConfirmOrderRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for authorizeOrder. + * Builds the ApiCall object for confirmOrder. */ - private ApiCall, ApiException> prepareAuthorizeOrderRequest( - final AuthorizeOrderInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareConfirmOrderRequest( + final ConfirmOrderInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/checkout/orders/{id}/authorize") + .path("/v2/checkout/orders/{id}/confirm-payment-source") .bodyParam(param -> param.value(input.getBody()).isRequired(false)) .bodySerializer(() -> ApiHelper.serialize(input.getBody())) .templateParam(param -> param.key("id").value(input.getId()) .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .headerParam(param -> param.key("PayPal-Mock-Response") - .value(input.getPaypalMockResponse()).isRequired(false)) - .headerParam(param -> param.key("PayPal-Request-Id") - .value(input.getPaypalRequestId()).isRequired(false)) - .headerParam(param -> param.key("Prefer") - .value(input.getPrefer()).isRequired(false)) .headerParam(param -> param.key("PayPal-Client-Metadata-Id") .value(input.getPaypalClientMetadataId()).isRequired(false)) .headerParam(param -> param.key("PayPal-Auth-Assertion") .value(input.getPaypalAuthAssertion()).isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) @@ -265,89 +404,7 @@ private ApiCall, ApiException> prepareAuthor .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, OrderAuthorizeResponse.class)) - .nullify404(false) - .localErrorCase("400", - ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("401", - ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("403", - ErrorCase.setReason("The authorized payment failed due to insufficient permissions.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("404", - ErrorCase.setReason("The specified resource does not exist.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("422", - ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("500", - ErrorCase.setReason("An internal server error has occurred.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase(ErrorCase.DEFAULT, - ErrorCase.setReason("The error response.", - (reason, context) -> new ErrorException(reason, context))) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes - * or objects: Attribute Op Notes items replace Using replace op for items will replace the - * entire items object with the value sent in request. notify_payer replace, add status replace - * Only patching status to CANCELLED is currently supported. - * @param input UpdateOrderTrackingInput object containing request parameters - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - public ApiResponse updateOrderTracking( - final UpdateOrderTrackingInput input) throws ApiException, IOException { - return prepareUpdateOrderTrackingRequest(input).execute(); - } - - /** - * Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes - * or objects: Attribute Op Notes items replace Using replace op for items will replace the - * entire items object with the value sent in request. notify_payer replace, add status replace - * Only patching status to CANCELLED is currently supported. - * @param input UpdateOrderTrackingInput object containing request parameters - * @return Returns the Void wrapped in ApiResponse response from the API call - */ - public CompletableFuture> updateOrderTrackingAsync( - final UpdateOrderTrackingInput input) { - try { - return prepareUpdateOrderTrackingRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for updateOrderTracking. - */ - private ApiCall, ApiException> prepareUpdateOrderTrackingRequest( - final UpdateOrderTrackingInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v2/checkout/orders/{id}/trackers/{tracker_id}") - .bodyParam(param -> param.value(input.getBody()).isRequired(false)) - .bodySerializer(() -> ApiHelper.serialize(input.getBody())) - .templateParam(param -> param.key("id").value(input.getId()) - .shouldEncode(true)) - .templateParam(param -> param.key("tracker_id").value(input.getTrackerId()) - .shouldEncode(true)) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) - .headerParam(param -> param.key("PayPal-Auth-Assertion") - .value(input.getPaypalAuthAssertion()).isRequired(false)) - .withAuth(auth -> auth - .add("Oauth2")) - .httpMethod(HttpMethod.PATCH)) - .responseHandler(responseHandler -> responseHandler - .responseClassType(ResponseClassType.API_RESPONSE) + response -> ApiHelper.deserialize(response, Order.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -355,9 +412,6 @@ private ApiCall, ApiException> prepareUpdateOrderTrackingReque .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("404", - ErrorCase.setReason("The specified resource does not exist.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("422", ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", (reason, context) -> new ErrorException(reason, context))) @@ -372,136 +426,63 @@ private ApiCall, ApiException> prepareUpdateOrderTrackingReque } /** - * Adds tracking information for an Order. - * @param input CreateOrderTrackingInput object containing request parameters - * @return Returns the Order wrapped in ApiResponse response from the API call + * Authorizes payment for an order. To successfully authorize payment for an order, the buyer + * must first approve the order or a valid payment_source must be provided in the request. A + * buyer can approve the order upon being redirected to the rel:approve URL that was returned in + * the HATEOAS links in the create order response. Note: For error handling and troubleshooting, + * see Orders v2 errors. + * @param input AuthorizeOrderInput object containing request parameters + * @return Returns the OrderAuthorizeResponse wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse createOrderTracking( - final CreateOrderTrackingInput input) throws ApiException, IOException { - return prepareCreateOrderTrackingRequest(input).execute(); + public ApiResponse authorizeOrder( + final AuthorizeOrderInput input) throws ApiException, IOException { + return prepareAuthorizeOrderRequest(input).execute(); } /** - * Adds tracking information for an Order. - * @param input CreateOrderTrackingInput object containing request parameters - * @return Returns the Order wrapped in ApiResponse response from the API call + * Authorizes payment for an order. To successfully authorize payment for an order, the buyer + * must first approve the order or a valid payment_source must be provided in the request. A + * buyer can approve the order upon being redirected to the rel:approve URL that was returned in + * the HATEOAS links in the create order response. Note: For error handling and troubleshooting, + * see Orders v2 errors. + * @param input AuthorizeOrderInput object containing request parameters + * @return Returns the OrderAuthorizeResponse wrapped in ApiResponse response from the API call */ - public CompletableFuture> createOrderTrackingAsync( - final CreateOrderTrackingInput input) { - try { - return prepareCreateOrderTrackingRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> authorizeOrderAsync( + final AuthorizeOrderInput input) { + try { + return prepareAuthorizeOrderRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for createOrderTracking. + * Builds the ApiCall object for authorizeOrder. */ - private ApiCall, ApiException> prepareCreateOrderTrackingRequest( - final CreateOrderTrackingInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareAuthorizeOrderRequest( + final AuthorizeOrderInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/checkout/orders/{id}/track") - .bodyParam(param -> param.value(input.getBody())) + .path("/v2/checkout/orders/{id}/authorize") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) .bodySerializer(() -> ApiHelper.serialize(input.getBody())) .templateParam(param -> param.key("id").value(input.getId()) .shouldEncode(true)) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) - .headerParam(param -> param.key("PayPal-Auth-Assertion") - .value(input.getPaypalAuthAssertion()).isRequired(false)) - .headerParam(param -> param.key("accept").value("application/json")) - .withAuth(auth -> auth - .add("Oauth2")) - .httpMethod(HttpMethod.POST)) - .responseHandler(responseHandler -> responseHandler - .responseClassType(ResponseClassType.API_RESPONSE) - .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, Order.class)) - .nullify404(false) - .localErrorCase("400", - ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("403", - ErrorCase.setReason("Authorization failed due to insufficient permissions.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("404", - ErrorCase.setReason("The specified resource does not exist.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("422", - ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("500", - ErrorCase.setReason("An internal server error has occurred.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase(ErrorCase.DEFAULT, - ErrorCase.setReason("The error response.", - (reason, context) -> new ErrorException(reason, context))) - .globalErrorCase(GLOBAL_ERROR_CASES)) - .build(); - } - - /** - * Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce - * risk and payment processing costs. For more information about processing payments, see - * checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 - * errors. - * @param input CreateOrderInput object containing request parameters - * @return Returns the Order wrapped in ApiResponse response from the API call - * @throws ApiException Represents error response from the server. - * @throws IOException Signals that an I/O exception of some sort has occurred. - */ - public ApiResponse createOrder( - final CreateOrderInput input) throws ApiException, IOException { - return prepareCreateOrderRequest(input).execute(); - } - - /** - * Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce - * risk and payment processing costs. For more information about processing payments, see - * checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 - * errors. - * @param input CreateOrderInput object containing request parameters - * @return Returns the Order wrapped in ApiResponse response from the API call - */ - public CompletableFuture> createOrderAsync( - final CreateOrderInput input) { - try { - return prepareCreateOrderRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); - } - } - - /** - * Builds the ApiCall object for createOrder. - */ - private ApiCall, ApiException> prepareCreateOrderRequest( - final CreateOrderInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() - .globalConfig(getGlobalConfiguration()) - .requestBuilder(requestBuilder -> requestBuilder - .server(Server.ENUM_DEFAULT.value()) - .path("/v2/checkout/orders") - .bodyParam(param -> param.value(input.getBody())) - .bodySerializer(() -> ApiHelper.serialize(input.getBody())) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("PayPal-Mock-Response") .value(input.getPaypalMockResponse()).isRequired(false)) .headerParam(param -> param.key("PayPal-Request-Id") .value(input.getPaypalRequestId()).isRequired(false)) - .headerParam(param -> param.key("PayPal-Partner-Attribution-Id") - .value(input.getPaypalPartnerAttributionId()).isRequired(false)) - .headerParam(param -> param.key("PayPal-Client-Metadata-Id") - .value(input.getPaypalClientMetadataId()).isRequired(false)) .headerParam(param -> param.key("Prefer") .value(input.getPrefer()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Client-Metadata-Id") + .value(input.getPaypalClientMetadataId()).isRequired(false)) .headerParam(param -> param.key("PayPal-Auth-Assertion") .value(input.getPaypalAuthAssertion()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) @@ -511,7 +492,7 @@ private ApiCall, ApiException> prepareCreateOrderRequest( .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, Order.class)) + response -> ApiHelper.deserialize(response, OrderAuthorizeResponse.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -519,9 +500,18 @@ private ApiCall, ApiException> prepareCreateOrderRequest( .localErrorCase("401", ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("The authorized payment failed due to insufficient permissions.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("422", ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase(ErrorCase.DEFAULT, ErrorCase.setReason("The error response.", (reason, context) -> new ErrorException(reason, context))) @@ -556,10 +546,10 @@ public ApiResponse captureOrder( */ public CompletableFuture> captureOrderAsync( final CaptureOrderInput input) { - try { - return prepareCaptureOrderRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareCaptureOrderRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } @@ -567,7 +557,7 @@ public CompletableFuture> captureOrderAsync( * Builds the ApiCall object for captureOrder. */ private ApiCall, ApiException> prepareCaptureOrderRequest( - final CaptureOrderInput input) throws JsonProcessingException, IOException { + final CaptureOrderInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder @@ -624,66 +614,73 @@ private ApiCall, ApiException> prepareCaptureOrderRequest( } /** - * Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders - * v2 errors. - * @param input GetOrderInput object containing request parameters + * Adds tracking information for an Order. + * @param input CreateOrderTrackingInput object containing request parameters * @return Returns the Order wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse getOrder( - final GetOrderInput input) throws ApiException, IOException { - return prepareGetOrderRequest(input).execute(); + public ApiResponse createOrderTracking( + final CreateOrderTrackingInput input) throws ApiException, IOException { + return prepareCreateOrderTrackingRequest(input).execute(); } /** - * Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders - * v2 errors. - * @param input GetOrderInput object containing request parameters + * Adds tracking information for an Order. + * @param input CreateOrderTrackingInput object containing request parameters * @return Returns the Order wrapped in ApiResponse response from the API call */ - public CompletableFuture> getOrderAsync( - final GetOrderInput input) { - try { - return prepareGetOrderRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> createOrderTrackingAsync( + final CreateOrderTrackingInput input) { + try { + return prepareCreateOrderTrackingRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for getOrder. + * Builds the ApiCall object for createOrderTracking. */ - private ApiCall, ApiException> prepareGetOrderRequest( - final GetOrderInput input) throws IOException { + private ApiCall, ApiException> prepareCreateOrderTrackingRequest( + final CreateOrderTrackingInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/checkout/orders/{id}") - .queryParam(param -> param.key("fields") - .value(input.getFields()).isRequired(false)) + .path("/v2/checkout/orders/{id}/track") + .bodyParam(param -> param.value(input.getBody())) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) .templateParam(param -> param.key("id").value(input.getId()) .shouldEncode(true)) - .headerParam(param -> param.key("PayPal-Mock-Response") - .value(input.getPaypalMockResponse()).isRequired(false)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) .headerParam(param -> param.key("PayPal-Auth-Assertion") .value(input.getPaypalAuthAssertion()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.GET)) + .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( response -> ApiHelper.deserialize(response, Order.class)) .nullify404(false) - .localErrorCase("401", - ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + .localErrorCase("400", + ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) .localErrorCase("404", ErrorCase.setReason("The specified resource does not exist.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase(ErrorCase.DEFAULT, ErrorCase.setReason("The error response.", (reason, context) -> new ErrorException(reason, context))) @@ -692,61 +689,62 @@ private ApiCall, ApiException> prepareGetOrderRequest( } /** - * Payer confirms their intent to pay for the the Order with the given payment source. - * @param input ConfirmOrderInput object containing request parameters - * @return Returns the Order wrapped in ApiResponse response from the API call + * Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes + * or objects: Attribute Op Notes items replace Using replace op for items will replace the + * entire items object with the value sent in request. notify_payer replace, add status replace + * Only patching status to CANCELLED is currently supported. + * @param input UpdateOrderTrackingInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse confirmOrder( - final ConfirmOrderInput input) throws ApiException, IOException { - return prepareConfirmOrderRequest(input).execute(); + public ApiResponse updateOrderTracking( + final UpdateOrderTrackingInput input) throws ApiException, IOException { + return prepareUpdateOrderTrackingRequest(input).execute(); } /** - * Payer confirms their intent to pay for the the Order with the given payment source. - * @param input ConfirmOrderInput object containing request parameters - * @return Returns the Order wrapped in ApiResponse response from the API call + * Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes + * or objects: Attribute Op Notes items replace Using replace op for items will replace the + * entire items object with the value sent in request. notify_payer replace, add status replace + * Only patching status to CANCELLED is currently supported. + * @param input UpdateOrderTrackingInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call */ - public CompletableFuture> confirmOrderAsync( - final ConfirmOrderInput input) { - try { - return prepareConfirmOrderRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> updateOrderTrackingAsync( + final UpdateOrderTrackingInput input) { + try { + return prepareUpdateOrderTrackingRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for confirmOrder. + * Builds the ApiCall object for updateOrderTracking. */ - private ApiCall, ApiException> prepareConfirmOrderRequest( - final ConfirmOrderInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareUpdateOrderTrackingRequest( + final UpdateOrderTrackingInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/checkout/orders/{id}/confirm-payment-source") + .path("/v2/checkout/orders/{id}/trackers/{tracker_id}") .bodyParam(param -> param.value(input.getBody()).isRequired(false)) .bodySerializer(() -> ApiHelper.serialize(input.getBody())) .templateParam(param -> param.key("id").value(input.getId()) .shouldEncode(true)) + .templateParam(param -> param.key("tracker_id").value(input.getTrackerId()) + .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .headerParam(param -> param.key("PayPal-Client-Metadata-Id") - .value(input.getPaypalClientMetadataId()).isRequired(false)) .headerParam(param -> param.key("PayPal-Auth-Assertion") .value(input.getPaypalAuthAssertion()).isRequired(false)) - .headerParam(param -> param.key("Prefer") - .value(input.getPrefer()).isRequired(false)) - .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.POST)) + .httpMethod(HttpMethod.PATCH)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) - .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, Order.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -754,6 +752,9 @@ private ApiCall, ApiException> prepareConfirmOrderRequest( .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("422", ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", (reason, context) -> new ErrorException(reason, context))) diff --git a/src/main/java/com/paypal/sdk/controllers/PaymentsController.java b/src/main/java/com/paypal/sdk/controllers/PaymentsController.java index 9e0f449..2bb34e6 100644 --- a/src/main/java/com/paypal/sdk/controllers/PaymentsController.java +++ b/src/main/java/com/paypal/sdk/controllers/PaymentsController.java @@ -6,7 +6,6 @@ package com.paypal.sdk.controllers; -import com.fasterxml.jackson.core.JsonProcessingException; import com.paypal.sdk.ApiHelper; import com.paypal.sdk.Server; import com.paypal.sdk.exceptions.ApiException; @@ -45,67 +44,56 @@ public PaymentsController(GlobalConfiguration globalConfig) { } /** - * Captures an authorized payment, by ID. - * @param input CaptureAuthorizedPaymentInput object containing request parameters - * @return Returns the CapturedPayment wrapped in ApiResponse response from the API call + * Shows details for an authorized payment, by ID. + * @param input GetAuthorizedPaymentInput object containing request parameters + * @return Returns the PaymentAuthorization wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse captureAuthorizedPayment( - final CaptureAuthorizedPaymentInput input) throws ApiException, IOException { - return prepareCaptureAuthorizedPaymentRequest(input).execute(); + public ApiResponse getAuthorizedPayment( + final GetAuthorizedPaymentInput input) throws ApiException, IOException { + return prepareGetAuthorizedPaymentRequest(input).execute(); } /** - * Captures an authorized payment, by ID. - * @param input CaptureAuthorizedPaymentInput object containing request parameters - * @return Returns the CapturedPayment wrapped in ApiResponse response from the API call + * Shows details for an authorized payment, by ID. + * @param input GetAuthorizedPaymentInput object containing request parameters + * @return Returns the PaymentAuthorization wrapped in ApiResponse response from the API call */ - public CompletableFuture> captureAuthorizedPaymentAsync( - final CaptureAuthorizedPaymentInput input) { - try { - return prepareCaptureAuthorizedPaymentRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> getAuthorizedPaymentAsync( + final GetAuthorizedPaymentInput input) { + try { + return prepareGetAuthorizedPaymentRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for captureAuthorizedPayment. + * Builds the ApiCall object for getAuthorizedPayment. */ - private ApiCall, ApiException> prepareCaptureAuthorizedPaymentRequest( - final CaptureAuthorizedPaymentInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareGetAuthorizedPaymentRequest( + final GetAuthorizedPaymentInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/payments/authorizations/{authorization_id}/capture") - .bodyParam(param -> param.value(input.getBody()).isRequired(false)) - .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .path("/v2/payments/authorizations/{authorization_id}") .templateParam(param -> param.key("authorization_id").value(input.getAuthorizationId()) .shouldEncode(true)) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) .headerParam(param -> param.key("PayPal-Mock-Response") .value(input.getPaypalMockResponse()).isRequired(false)) - .headerParam(param -> param.key("PayPal-Request-Id") - .value(input.getPaypalRequestId()).isRequired(false)) - .headerParam(param -> param.key("Prefer") - .value(input.getPrefer()).isRequired(false)) .headerParam(param -> param.key("PayPal-Auth-Assertion") .value(input.getPaypalAuthAssertion()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.POST)) + .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, CapturedPayment.class)) + response -> ApiHelper.deserialize(response, PaymentAuthorization.class)) .nullify404(false) - .localErrorCase("400", - ErrorCase.setReason("The request failed because it is not well-formed or is syntactically incorrect or violates schema.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("401", ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", (reason, context) -> new ErrorException(reason, context))) @@ -115,12 +103,6 @@ private ApiCall, ApiException> prepareCaptureAuthor .localErrorCase("404", ErrorCase.setReason("The request failed because the resource does not exist.", (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("409", - ErrorCase.setReason("The server has detected a conflict while processing this request.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("422", - ErrorCase.setReason("The request failed because it is semantically incorrect or failed business validation.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("The request failed because an internal server error occurred.", (reason, context) -> new ApiException(reason, context))) @@ -132,54 +114,67 @@ private ApiCall, ApiException> prepareCaptureAuthor } /** - * Shows details for a captured payment, by ID. - * @param input GetCapturedPaymentInput object containing request parameters + * Captures an authorized payment, by ID. + * @param input CaptureAuthorizedPaymentInput object containing request parameters * @return Returns the CapturedPayment wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse getCapturedPayment( - final GetCapturedPaymentInput input) throws ApiException, IOException { - return prepareGetCapturedPaymentRequest(input).execute(); + public ApiResponse captureAuthorizedPayment( + final CaptureAuthorizedPaymentInput input) throws ApiException, IOException { + return prepareCaptureAuthorizedPaymentRequest(input).execute(); } /** - * Shows details for a captured payment, by ID. - * @param input GetCapturedPaymentInput object containing request parameters + * Captures an authorized payment, by ID. + * @param input CaptureAuthorizedPaymentInput object containing request parameters * @return Returns the CapturedPayment wrapped in ApiResponse response from the API call */ - public CompletableFuture> getCapturedPaymentAsync( - final GetCapturedPaymentInput input) { - try { - return prepareGetCapturedPaymentRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> captureAuthorizedPaymentAsync( + final CaptureAuthorizedPaymentInput input) { + try { + return prepareCaptureAuthorizedPaymentRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for getCapturedPayment. + * Builds the ApiCall object for captureAuthorizedPayment. */ - private ApiCall, ApiException> prepareGetCapturedPaymentRequest( - final GetCapturedPaymentInput input) throws IOException { + private ApiCall, ApiException> prepareCaptureAuthorizedPaymentRequest( + final CaptureAuthorizedPaymentInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/payments/captures/{capture_id}") - .templateParam(param -> param.key("capture_id").value(input.getCaptureId()) + .path("/v2/payments/authorizations/{authorization_id}/capture") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("authorization_id").value(input.getAuthorizationId()) .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) .headerParam(param -> param.key("PayPal-Mock-Response") .value(input.getPaypalMockResponse()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Auth-Assertion") + .value(input.getPaypalAuthAssertion()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.GET)) + .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( response -> ApiHelper.deserialize(response, CapturedPayment.class)) .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("The request failed because it is not well-formed or is syntactically incorrect or violates schema.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("401", ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", (reason, context) -> new ErrorException(reason, context))) @@ -189,6 +184,12 @@ private ApiCall, ApiException> prepareGetCapturedPa .localErrorCase("404", ErrorCase.setReason("The request failed because the resource does not exist.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("409", + ErrorCase.setReason("The server has detected a conflict while processing this request.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The request failed because it is semantically incorrect or failed business validation.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("The request failed because an internal server error occurred.", (reason, context) -> new ApiException(reason, context))) @@ -209,7 +210,6 @@ private ApiCall, ApiException> prepareGetCapturedPa * authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends * on context and geography, for example in US it is up to 115% of the original authorized * amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. - * Note: This request is currently not supported for Partner use cases. * @param input ReauthorizePaymentInput object containing request parameters * @return Returns the PaymentAuthorization wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. @@ -230,16 +230,15 @@ public ApiResponse reauthorizePayment( * authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends * on context and geography, for example in US it is up to 115% of the original authorized * amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. - * Note: This request is currently not supported for Partner use cases. * @param input ReauthorizePaymentInput object containing request parameters * @return Returns the PaymentAuthorization wrapped in ApiResponse response from the API call */ public CompletableFuture> reauthorizePaymentAsync( final ReauthorizePaymentInput input) { - try { - return prepareReauthorizePaymentRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareReauthorizePaymentRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } @@ -247,7 +246,7 @@ public CompletableFuture> reauthorizePaymentAs * Builds the ApiCall object for reauthorizePayment. */ private ApiCall, ApiException> prepareReauthorizePaymentRequest( - final ReauthorizePaymentInput input) throws JsonProcessingException, IOException { + final ReauthorizePaymentInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder @@ -280,6 +279,9 @@ private ApiCall, ApiException> prepareReauthor .localErrorCase("401", ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("The request failed because the caller has insufficient permissions.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("404", ErrorCase.setReason("The request failed because the resource does not exist.", (reason, context) -> new ErrorException(reason, context))) @@ -317,10 +319,10 @@ public ApiResponse voidPayment( */ public CompletableFuture> voidPaymentAsync( final VoidPaymentInput input) { - try { - return prepareVoidPaymentRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareVoidPaymentRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } @@ -328,7 +330,7 @@ public CompletableFuture> voidPaymentAsync( * Builds the ApiCall object for voidPayment. */ private ApiCall, ApiException> prepareVoidPaymentRequest( - final VoidPaymentInput input) throws IOException { + final VoidPaymentInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder @@ -380,69 +382,54 @@ private ApiCall, ApiException> prepareVoidPaym } /** - * Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON - * request body. For a partial refund, include an amount object in the JSON request body. - * @param input RefundCapturedPaymentInput object containing request parameters - * @return Returns the Refund wrapped in ApiResponse response from the API call + * Shows details for a captured payment, by ID. + * @param input GetCapturedPaymentInput object containing request parameters + * @return Returns the CapturedPayment wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse refundCapturedPayment( - final RefundCapturedPaymentInput input) throws ApiException, IOException { - return prepareRefundCapturedPaymentRequest(input).execute(); + public ApiResponse getCapturedPayment( + final GetCapturedPaymentInput input) throws ApiException, IOException { + return prepareGetCapturedPaymentRequest(input).execute(); } /** - * Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON - * request body. For a partial refund, include an amount object in the JSON request body. - * @param input RefundCapturedPaymentInput object containing request parameters - * @return Returns the Refund wrapped in ApiResponse response from the API call + * Shows details for a captured payment, by ID. + * @param input GetCapturedPaymentInput object containing request parameters + * @return Returns the CapturedPayment wrapped in ApiResponse response from the API call */ - public CompletableFuture> refundCapturedPaymentAsync( - final RefundCapturedPaymentInput input) { - try { - return prepareRefundCapturedPaymentRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> getCapturedPaymentAsync( + final GetCapturedPaymentInput input) { + try { + return prepareGetCapturedPaymentRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for refundCapturedPayment. + * Builds the ApiCall object for getCapturedPayment. */ - private ApiCall, ApiException> prepareRefundCapturedPaymentRequest( - final RefundCapturedPaymentInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareGetCapturedPaymentRequest( + final GetCapturedPaymentInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/payments/captures/{capture_id}/refund") - .bodyParam(param -> param.value(input.getBody()).isRequired(false)) - .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .path("/v2/payments/captures/{capture_id}") .templateParam(param -> param.key("capture_id").value(input.getCaptureId()) .shouldEncode(true)) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) .headerParam(param -> param.key("PayPal-Mock-Response") .value(input.getPaypalMockResponse()).isRequired(false)) - .headerParam(param -> param.key("PayPal-Request-Id") - .value(input.getPaypalRequestId()).isRequired(false)) - .headerParam(param -> param.key("Prefer") - .value(input.getPrefer()).isRequired(false)) - .headerParam(param -> param.key("PayPal-Auth-Assertion") - .value(input.getPaypalAuthAssertion()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.POST)) + .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, Refund.class)) + response -> ApiHelper.deserialize(response, CapturedPayment.class)) .nullify404(false) - .localErrorCase("400", - ErrorCase.setReason("The request failed because it is not well-formed or is syntactically incorrect or violates schema.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("401", ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", (reason, context) -> new ErrorException(reason, context))) @@ -452,12 +439,6 @@ private ApiCall, ApiException> prepareRefundCapturedPaymentR .localErrorCase("404", ErrorCase.setReason("The request failed because the resource does not exist.", (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("409", - ErrorCase.setReason("The request failed because a previous call for the given resource is in progress.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("422", - ErrorCase.setReason("The request failed because it either is semantically incorrect or failed business validation.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("The request failed because an internal server error occurred.", (reason, context) -> new ApiException(reason, context))) @@ -469,62 +450,84 @@ private ApiCall, ApiException> prepareRefundCapturedPaymentR } /** - * Shows details for an authorized payment, by ID. - * @param input GetAuthorizedPaymentInput object containing request parameters - * @return Returns the PaymentAuthorization wrapped in ApiResponse response from the API call + * Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON + * request body. For a partial refund, include an amount object in the JSON request body. + * @param input RefundCapturedPaymentInput object containing request parameters + * @return Returns the Refund wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse getAuthorizedPayment( - final GetAuthorizedPaymentInput input) throws ApiException, IOException { - return prepareGetAuthorizedPaymentRequest(input).execute(); + public ApiResponse refundCapturedPayment( + final RefundCapturedPaymentInput input) throws ApiException, IOException { + return prepareRefundCapturedPaymentRequest(input).execute(); } /** - * Shows details for an authorized payment, by ID. - * @param input GetAuthorizedPaymentInput object containing request parameters - * @return Returns the PaymentAuthorization wrapped in ApiResponse response from the API call + * Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON + * request body. For a partial refund, include an amount object in the JSON request body. + * @param input RefundCapturedPaymentInput object containing request parameters + * @return Returns the Refund wrapped in ApiResponse response from the API call */ - public CompletableFuture> getAuthorizedPaymentAsync( - final GetAuthorizedPaymentInput input) { - try { - return prepareGetAuthorizedPaymentRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> refundCapturedPaymentAsync( + final RefundCapturedPaymentInput input) { + try { + return prepareRefundCapturedPaymentRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for getAuthorizedPayment. + * Builds the ApiCall object for refundCapturedPayment. */ - private ApiCall, ApiException> prepareGetAuthorizedPaymentRequest( - final GetAuthorizedPaymentInput input) throws IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareRefundCapturedPaymentRequest( + final RefundCapturedPaymentInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v2/payments/authorizations/{authorization_id}") - .templateParam(param -> param.key("authorization_id").value(input.getAuthorizationId()) + .path("/v2/payments/captures/{capture_id}/refund") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("capture_id").value(input.getCaptureId()) .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) .headerParam(param -> param.key("PayPal-Mock-Response") .value(input.getPaypalMockResponse()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) .headerParam(param -> param.key("PayPal-Auth-Assertion") .value(input.getPaypalAuthAssertion()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.GET)) + .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, PaymentAuthorization.class)) + response -> ApiHelper.deserialize(response, Refund.class)) .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("The request failed because it is not well-formed or is syntactically incorrect or violates schema.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("401", ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("The request failed because the caller has insufficient permissions.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("404", ErrorCase.setReason("The request failed because the resource does not exist.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("409", + ErrorCase.setReason("The request failed because a previous call for the given resource is in progress.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The request failed because it either is semantically incorrect or failed business validation.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("The request failed because an internal server error occurred.", (reason, context) -> new ApiException(reason, context))) @@ -554,10 +557,10 @@ public ApiResponse getRefund( */ public CompletableFuture> getRefundAsync( final GetRefundInput input) { - try { - return prepareGetRefundRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareGetRefundRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } @@ -565,7 +568,7 @@ public CompletableFuture> getRefundAsync( * Builds the ApiCall object for getRefund. */ private ApiCall, ApiException> prepareGetRefundRequest( - final GetRefundInput input) throws IOException { + final GetRefundInput input) { return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder diff --git a/src/main/java/com/paypal/sdk/controllers/SubscriptionsController.java b/src/main/java/com/paypal/sdk/controllers/SubscriptionsController.java new file mode 100644 index 0000000..86f0acc --- /dev/null +++ b/src/main/java/com/paypal/sdk/controllers/SubscriptionsController.java @@ -0,0 +1,1343 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.controllers; + +import com.paypal.sdk.ApiHelper; +import com.paypal.sdk.Server; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.exceptions.SubscriptionErrorException; +import com.paypal.sdk.http.request.HttpMethod; +import com.paypal.sdk.http.response.ApiResponse; +import com.paypal.sdk.models.ActivateSubscriptionInput; +import com.paypal.sdk.models.BillingPlan; +import com.paypal.sdk.models.CancelSubscriptionInput; +import com.paypal.sdk.models.CaptureSubscriptionInput; +import com.paypal.sdk.models.CreateBillingPlanInput; +import com.paypal.sdk.models.CreateSubscriptionInput; +import com.paypal.sdk.models.GetSubscriptionInput; +import com.paypal.sdk.models.ListBillingPlansInput; +import com.paypal.sdk.models.ListSubscriptionTransactionsInput; +import com.paypal.sdk.models.ListSubscriptionsInput; +import com.paypal.sdk.models.ModifySubscriptionResponse; +import com.paypal.sdk.models.PatchBillingPlanInput; +import com.paypal.sdk.models.PatchSubscriptionInput; +import com.paypal.sdk.models.PlanCollection; +import com.paypal.sdk.models.ReviseSubscriptionInput; +import com.paypal.sdk.models.Subscription; +import com.paypal.sdk.models.SubscriptionCollection; +import com.paypal.sdk.models.SubscriptionTransactionDetails; +import com.paypal.sdk.models.SuspendSubscriptionInput; +import com.paypal.sdk.models.TransactionsList; +import com.paypal.sdk.models.UpdateBillingPlanPricingSchemesInput; +import io.apimatic.core.ApiCall; +import io.apimatic.core.ErrorCase; +import io.apimatic.core.GlobalConfiguration; +import io.apimatic.coreinterfaces.http.request.ResponseClassType; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; + +/** + * This class lists all the endpoints of the groups. + */ +public final class SubscriptionsController extends BaseController { + + /** + * Initializes the controller. + * @param globalConfig Configurations added in client. + */ + public SubscriptionsController(GlobalConfiguration globalConfig) { + super(globalConfig); + } + + /** + * Creates a plan that defines pricing and billing cycle details for subscriptions. + * @param input CreateBillingPlanInput object containing request parameters + * @return Returns the BillingPlan wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse createBillingPlan( + final CreateBillingPlanInput input) throws ApiException, IOException { + return prepareCreateBillingPlanRequest(input).execute(); + } + + /** + * Creates a plan that defines pricing and billing cycle details for subscriptions. + * @param input CreateBillingPlanInput object containing request parameters + * @return Returns the BillingPlan wrapped in ApiResponse response from the API call + */ + public CompletableFuture> createBillingPlanAsync( + final CreateBillingPlanInput input) { + try { + return prepareCreateBillingPlanRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for createBillingPlan. + */ + private ApiCall, ApiException> prepareCreateBillingPlanRequest( + final CreateBillingPlanInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, BillingPlan.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Lists billing plans. + * @param input ListBillingPlansInput object containing request parameters + * @return Returns the PlanCollection wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse listBillingPlans( + final ListBillingPlansInput input) throws ApiException, IOException { + return prepareListBillingPlansRequest(input).execute(); + } + + /** + * Lists billing plans. + * @param input ListBillingPlansInput object containing request parameters + * @return Returns the PlanCollection wrapped in ApiResponse response from the API call + */ + public CompletableFuture> listBillingPlansAsync( + final ListBillingPlansInput input) { + try { + return prepareListBillingPlansRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for listBillingPlans. + */ + private ApiCall, ApiException> prepareListBillingPlansRequest( + final ListBillingPlansInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans") + .queryParam(param -> param.key("product_id") + .value(input.getProductId()).isRequired(false)) + .queryParam(param -> param.key("page_size") + .value(input.getPageSize()).isRequired(false)) + .queryParam(param -> param.key("page") + .value(input.getPage()).isRequired(false)) + .queryParam(param -> param.key("total_required") + .value(input.getTotalRequired()).isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, PlanCollection.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Shows details for a plan, by ID. + * @param id Required parameter: The ID of the plan. + * @return Returns the BillingPlan wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse getBillingPlan( + final String id) throws ApiException, IOException { + return prepareGetBillingPlanRequest(id).execute(); + } + + /** + * Shows details for a plan, by ID. + * @param id Required parameter: The ID of the plan. + * @return Returns the BillingPlan wrapped in ApiResponse response from the API call + */ + public CompletableFuture> getBillingPlanAsync( + final String id) { + try { + return prepareGetBillingPlanRequest(id).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for getBillingPlan. + */ + private ApiCall, ApiException> prepareGetBillingPlanRequest( + final String id) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans/{id}") + .templateParam(param -> param.key("id").value(id) + .shouldEncode(true)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, BillingPlan.class)) + .nullify404(false) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` plan, you can make + * only status updates. You can patch these attributes and objects: Attribute or object + * Operations description replace payment_preferences.auto_bill_outstanding replace + * taxes.percentage replace payment_preferences.payment_failure_threshold replace + * payment_preferences.setup_fee replace payment_preferences.setup_fee_failure_action replace + * name replace. + * @param input PatchBillingPlanInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse patchBillingPlan( + final PatchBillingPlanInput input) throws ApiException, IOException { + return preparePatchBillingPlanRequest(input).execute(); + } + + /** + * Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` plan, you can make + * only status updates. You can patch these attributes and objects: Attribute or object + * Operations description replace payment_preferences.auto_bill_outstanding replace + * taxes.percentage replace payment_preferences.payment_failure_threshold replace + * payment_preferences.setup_fee replace payment_preferences.setup_fee_failure_action replace + * name replace. + * @param input PatchBillingPlanInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> patchBillingPlanAsync( + final PatchBillingPlanInput input) { + try { + return preparePatchBillingPlanRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for patchBillingPlan. + */ + private ApiCall, ApiException> preparePatchBillingPlanRequest( + final PatchBillingPlanInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans/{id}") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.PATCH)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Activates a plan, by ID. + * @param id Required parameter: The ID of the plan. + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse activateBillingPlan( + final String id) throws ApiException, IOException { + return prepareActivateBillingPlanRequest(id).execute(); + } + + /** + * Activates a plan, by ID. + * @param id Required parameter: The ID of the plan. + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> activateBillingPlanAsync( + final String id) { + try { + return prepareActivateBillingPlanRequest(id).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for activateBillingPlan. + */ + private ApiCall, ApiException> prepareActivateBillingPlanRequest( + final String id) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans/{id}/activate") + .templateParam(param -> param.key("id").value(id) + .shouldEncode(true)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Deactivates a plan, by ID. + * @param id Required parameter: The ID of the plan. + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse deactivateBillingPlan( + final String id) throws ApiException, IOException { + return prepareDeactivateBillingPlanRequest(id).execute(); + } + + /** + * Deactivates a plan, by ID. + * @param id Required parameter: The ID of the plan. + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> deactivateBillingPlanAsync( + final String id) { + try { + return prepareDeactivateBillingPlanRequest(id).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for deactivateBillingPlan. + */ + private ApiCall, ApiException> prepareDeactivateBillingPlanRequest( + final String id) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans/{id}/deactivate") + .templateParam(param -> param.key("id").value(id) + .shouldEncode(true)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per + * month to $7 per month. + * @param input UpdateBillingPlanPricingSchemesInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse updateBillingPlanPricingSchemes( + final UpdateBillingPlanPricingSchemesInput input) throws ApiException, IOException { + return prepareUpdateBillingPlanPricingSchemesRequest(input).execute(); + } + + /** + * Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per + * month to $7 per month. + * @param input UpdateBillingPlanPricingSchemesInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> updateBillingPlanPricingSchemesAsync( + final UpdateBillingPlanPricingSchemesInput input) { + try { + return prepareUpdateBillingPlanPricingSchemesRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for updateBillingPlanPricingSchemes. + */ + private ApiCall, ApiException> prepareUpdateBillingPlanPricingSchemesRequest( + final UpdateBillingPlanPricingSchemesInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/plans/{id}/update-pricing-schemes") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Creates a subscription. + * @param input CreateSubscriptionInput object containing request parameters + * @return Returns the Subscription wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse createSubscription( + final CreateSubscriptionInput input) throws ApiException, IOException { + return prepareCreateSubscriptionRequest(input).execute(); + } + + /** + * Creates a subscription. + * @param input CreateSubscriptionInput object containing request parameters + * @return Returns the Subscription wrapped in ApiResponse response from the API call + */ + public CompletableFuture> createSubscriptionAsync( + final CreateSubscriptionInput input) { + try { + return prepareCreateSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for createSubscription. + */ + private ApiCall, ApiException> prepareCreateSubscriptionRequest( + final CreateSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("Prefer") + .value(input.getPrefer()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("PayPal-Client-Metadata-Id") + .value(input.getPaypalClientMetadataId()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, Subscription.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * List all subscriptions for merchant account. + * @param input ListSubscriptionsInput object containing request parameters + * @return Returns the SubscriptionCollection wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse listSubscriptions( + final ListSubscriptionsInput input) throws ApiException, IOException { + return prepareListSubscriptionsRequest(input).execute(); + } + + /** + * List all subscriptions for merchant account. + * @param input ListSubscriptionsInput object containing request parameters + * @return Returns the SubscriptionCollection wrapped in ApiResponse response from the API call + */ + public CompletableFuture> listSubscriptionsAsync( + final ListSubscriptionsInput input) { + try { + return prepareListSubscriptionsRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for listSubscriptions. + */ + private ApiCall, ApiException> prepareListSubscriptionsRequest( + final ListSubscriptionsInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions") + .queryParam(param -> param.key("plan_ids") + .value(input.getPlanIds()).isRequired(false)) + .queryParam(param -> param.key("statuses") + .value(input.getStatuses()).isRequired(false)) + .queryParam(param -> param.key("created_after") + .value(input.getCreatedAfter()).isRequired(false)) + .queryParam(param -> param.key("created_before") + .value(input.getCreatedBefore()).isRequired(false)) + .queryParam(param -> param.key("status_updated_before") + .value(input.getStatusUpdatedBefore()).isRequired(false)) + .queryParam(param -> param.key("status_updated_after") + .value(input.getStatusUpdatedAfter()).isRequired(false)) + .queryParam(param -> param.key("filter") + .value(input.getFilter()).isRequired(false)) + .queryParam(param -> param.key("page_size") + .value(input.getPageSize()).isRequired(false)) + .queryParam(param -> param.key("page") + .value(input.getPage()).isRequired(false)) + .queryParam(param -> param.key("customer_ids") + .value(input.getCustomerIds()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, SubscriptionCollection.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Shows details for a subscription, by ID. + * @param input GetSubscriptionInput object containing request parameters + * @return Returns the Subscription wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse getSubscription( + final GetSubscriptionInput input) throws ApiException, IOException { + return prepareGetSubscriptionRequest(input).execute(); + } + + /** + * Shows details for a subscription, by ID. + * @param input GetSubscriptionInput object containing request parameters + * @return Returns the Subscription wrapped in ApiResponse response from the API call + */ + public CompletableFuture> getSubscriptionAsync( + final GetSubscriptionInput input) { + try { + return prepareGetSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for getSubscription. + */ + private ApiCall, ApiException> prepareGetSubscriptionRequest( + final GetSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}") + .queryParam(param -> param.key("fields") + .value(input.getFields()).isRequired(false)) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, Subscription.class)) + .nullify404(false) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan + * level default attributes by providing customised values for plan path in the patch request. + * You cannot update attributes that have already completed (Example - trial cycles can’t be + * updated if completed). Once overridden, changes to plan resource will not impact + * subscription. Any price update will not impact billing cycles within next 10 days (Applicable + * only for subscriptions funded by PayPal account). Following are the fields eligible for + * patch. Attribute or object Operations billing_info.outstanding_balance replace custom_id + * add,replace plan.billing_cycles[{@literal @}sequence==n]. pricing_scheme.fixed_price add,replace + * plan.billing_cycles[{@literal @}sequence==n]. pricing_scheme.tiers replace + * plan.billing_cycles[{@literal @}sequence==n]. total_cycles replace plan.payment_preferences. + * auto_bill_outstanding replace plan.payment_preferences. payment_failure_threshold replace + * plan.taxes.inclusive add,replace plan.taxes.percentage add,replace shipping_amount + * add,replace start_time replace subscriber.shipping_address add,replace + * subscriber.payment_source (for subscriptions funded by card payments) replace. + * @param input PatchSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse patchSubscription( + final PatchSubscriptionInput input) throws ApiException, IOException { + return preparePatchSubscriptionRequest(input).execute(); + } + + /** + * Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan + * level default attributes by providing customised values for plan path in the patch request. + * You cannot update attributes that have already completed (Example - trial cycles can’t be + * updated if completed). Once overridden, changes to plan resource will not impact + * subscription. Any price update will not impact billing cycles within next 10 days (Applicable + * only for subscriptions funded by PayPal account). Following are the fields eligible for + * patch. Attribute or object Operations billing_info.outstanding_balance replace custom_id + * add,replace plan.billing_cycles[{@literal @}sequence==n]. pricing_scheme.fixed_price add,replace + * plan.billing_cycles[{@literal @}sequence==n]. pricing_scheme.tiers replace + * plan.billing_cycles[{@literal @}sequence==n]. total_cycles replace plan.payment_preferences. + * auto_bill_outstanding replace plan.payment_preferences. payment_failure_threshold replace + * plan.taxes.inclusive add,replace plan.taxes.percentage add,replace shipping_amount + * add,replace start_time replace subscriber.shipping_address add,replace + * subscriber.payment_source (for subscriptions funded by card payments) replace. + * @param input PatchSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> patchSubscriptionAsync( + final PatchSubscriptionInput input) { + try { + return preparePatchSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for patchSubscription. + */ + private ApiCall, ApiException> preparePatchSubscriptionRequest( + final PatchSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.PATCH)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Updates the quantity of the product or service in a subscription. You can also use this + * method to switch the plan and update the `shipping_amount`, `shipping_address` values for the + * subscription. This type of update requires the buyer's consent. + * @param input ReviseSubscriptionInput object containing request parameters + * @return Returns the ModifySubscriptionResponse wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse reviseSubscription( + final ReviseSubscriptionInput input) throws ApiException, IOException { + return prepareReviseSubscriptionRequest(input).execute(); + } + + /** + * Updates the quantity of the product or service in a subscription. You can also use this + * method to switch the plan and update the `shipping_amount`, `shipping_address` values for the + * subscription. This type of update requires the buyer's consent. + * @param input ReviseSubscriptionInput object containing request parameters + * @return Returns the ModifySubscriptionResponse wrapped in ApiResponse response from the API call + */ + public CompletableFuture> reviseSubscriptionAsync( + final ReviseSubscriptionInput input) { + try { + return prepareReviseSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for reviseSubscription. + */ + private ApiCall, ApiException> prepareReviseSubscriptionRequest( + final ReviseSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}/revise") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, ModifySubscriptionResponse.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Suspends the subscription. + * @param input SuspendSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse suspendSubscription( + final SuspendSubscriptionInput input) throws ApiException, IOException { + return prepareSuspendSubscriptionRequest(input).execute(); + } + + /** + * Suspends the subscription. + * @param input SuspendSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> suspendSubscriptionAsync( + final SuspendSubscriptionInput input) { + try { + return prepareSuspendSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for suspendSubscription. + */ + private ApiCall, ApiException> prepareSuspendSubscriptionRequest( + final SuspendSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}/suspend") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Cancels the subscription. + * @param input CancelSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse cancelSubscription( + final CancelSubscriptionInput input) throws ApiException, IOException { + return prepareCancelSubscriptionRequest(input).execute(); + } + + /** + * Cancels the subscription. + * @param input CancelSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> cancelSubscriptionAsync( + final CancelSubscriptionInput input) { + try { + return prepareCancelSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for cancelSubscription. + */ + private ApiCall, ApiException> prepareCancelSubscriptionRequest( + final CancelSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}/cancel") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Activates the subscription. + * @param input ActivateSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse activateSubscription( + final ActivateSubscriptionInput input) throws ApiException, IOException { + return prepareActivateSubscriptionRequest(input).execute(); + } + + /** + * Activates the subscription. + * @param input ActivateSubscriptionInput object containing request parameters + * @return Returns the Void wrapped in ApiResponse response from the API call + */ + public CompletableFuture> activateSubscriptionAsync( + final ActivateSubscriptionInput input) { + try { + return prepareActivateSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for activateSubscription. + */ + private ApiCall, ApiException> prepareActivateSubscriptionRequest( + final ActivateSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}/activate") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Captures an authorized payment from the subscriber on the subscription. + * @param input CaptureSubscriptionInput object containing request parameters + * @return Returns the SubscriptionTransactionDetails wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse captureSubscription( + final CaptureSubscriptionInput input) throws ApiException, IOException { + return prepareCaptureSubscriptionRequest(input).execute(); + } + + /** + * Captures an authorized payment from the subscriber on the subscription. + * @param input CaptureSubscriptionInput object containing request parameters + * @return Returns the SubscriptionTransactionDetails wrapped in ApiResponse response from the API call + */ + public CompletableFuture> captureSubscriptionAsync( + final CaptureSubscriptionInput input) { + try { + return prepareCaptureSubscriptionRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for captureSubscription. + */ + private ApiCall, ApiException> prepareCaptureSubscriptionRequest( + final CaptureSubscriptionInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}/capture") + .bodyParam(param -> param.value(input.getBody()).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.POST)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, SubscriptionTransactionDetails.class)) + .nullableResponseType(true) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Lists transactions for a subscription. + * @param input ListSubscriptionTransactionsInput object containing request parameters + * @return Returns the TransactionsList wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse listSubscriptionTransactions( + final ListSubscriptionTransactionsInput input) throws ApiException, IOException { + return prepareListSubscriptionTransactionsRequest(input).execute(); + } + + /** + * Lists transactions for a subscription. + * @param input ListSubscriptionTransactionsInput object containing request parameters + * @return Returns the TransactionsList wrapped in ApiResponse response from the API call + */ + public CompletableFuture> listSubscriptionTransactionsAsync( + final ListSubscriptionTransactionsInput input) { + try { + return prepareListSubscriptionTransactionsRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for listSubscriptionTransactions. + */ + private ApiCall, ApiException> prepareListSubscriptionTransactionsRequest( + final ListSubscriptionTransactionsInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/billing/subscriptions/{id}/transactions") + .queryParam(param -> param.key("start_time") + .value(input.getStartTime())) + .queryParam(param -> param.key("end_time") + .value(input.getEndTime())) + .templateParam(param -> param.key("id").value(input.getId()) + .shouldEncode(true)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, TransactionsList.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("401", + ErrorCase.setReason("Authentication failed due to missing authorization header, or invalid authentication credentials.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("The specified resource does not exist.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error has occurred.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SubscriptionErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/controllers/TransactionsearchController.java b/src/main/java/com/paypal/sdk/controllers/TransactionsearchController.java new file mode 100644 index 0000000..72b2249 --- /dev/null +++ b/src/main/java/com/paypal/sdk/controllers/TransactionsearchController.java @@ -0,0 +1,197 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.controllers; + +import com.paypal.sdk.ApiHelper; +import com.paypal.sdk.Server; +import com.paypal.sdk.exceptions.ApiException; +import com.paypal.sdk.exceptions.DefaultErrorException; +import com.paypal.sdk.exceptions.SearchErrorException; +import com.paypal.sdk.http.request.HttpMethod; +import com.paypal.sdk.http.response.ApiResponse; +import com.paypal.sdk.models.BalancesResponse; +import com.paypal.sdk.models.SearchBalancesInput; +import com.paypal.sdk.models.SearchResponse; +import com.paypal.sdk.models.SearchTransactionsInput; +import io.apimatic.core.ApiCall; +import io.apimatic.core.ErrorCase; +import io.apimatic.core.GlobalConfiguration; +import io.apimatic.coreinterfaces.http.request.ResponseClassType; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; + +/** + * This class lists all the endpoints of the groups. + */ +public final class TransactionsearchController extends BaseController { + + /** + * Initializes the controller. + * @param globalConfig Configurations added in client. + */ + public TransactionsearchController(GlobalConfiguration globalConfig) { + super(globalConfig); + } + + /** + * Lists transactions. Specify one or more query parameters to filter the transaction that + * appear in the response. Notes: If you specify one or more optional query parameters, the + * ending_balance response field is empty. It takes a maximum of three hours for executed + * transactions to appear in the list transactions call. This call lists transaction for the + * previous three years. + * @param input SearchTransactionsInput object containing request parameters + * @return Returns the SearchResponse wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse searchTransactions( + final SearchTransactionsInput input) throws ApiException, IOException { + return prepareSearchTransactionsRequest(input).execute(); + } + + /** + * Lists transactions. Specify one or more query parameters to filter the transaction that + * appear in the response. Notes: If you specify one or more optional query parameters, the + * ending_balance response field is empty. It takes a maximum of three hours for executed + * transactions to appear in the list transactions call. This call lists transaction for the + * previous three years. + * @param input SearchTransactionsInput object containing request parameters + * @return Returns the SearchResponse wrapped in ApiResponse response from the API call + */ + public CompletableFuture> searchTransactionsAsync( + final SearchTransactionsInput input) { + try { + return prepareSearchTransactionsRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for searchTransactions. + */ + private ApiCall, ApiException> prepareSearchTransactionsRequest( + final SearchTransactionsInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/reporting/transactions") + .queryParam(param -> param.key("start_date") + .value(input.getStartDate())) + .queryParam(param -> param.key("end_date") + .value(input.getEndDate())) + .queryParam(param -> param.key("transaction_id") + .value(input.getTransactionId()).isRequired(false)) + .queryParam(param -> param.key("transaction_type") + .value(input.getTransactionType()).isRequired(false)) + .queryParam(param -> param.key("transaction_status") + .value(input.getTransactionStatus()).isRequired(false)) + .queryParam(param -> param.key("transaction_amount") + .value(input.getTransactionAmount()).isRequired(false)) + .queryParam(param -> param.key("transaction_currency") + .value(input.getTransactionCurrency()).isRequired(false)) + .queryParam(param -> param.key("payment_instrument_type") + .value(input.getPaymentInstrumentType()).isRequired(false)) + .queryParam(param -> param.key("store_id") + .value(input.getStoreId()).isRequired(false)) + .queryParam(param -> param.key("terminal_id") + .value(input.getTerminalId()).isRequired(false)) + .queryParam(param -> param.key("fields") + .value(input.getFields()).isRequired(false)) + .queryParam(param -> param.key("balance_affecting_records_only") + .value(input.getBalanceAffectingRecordsOnly()).isRequired(false)) + .queryParam(param -> param.key("page_size") + .value(input.getPageSize()).isRequired(false)) + .queryParam(param -> param.key("page") + .value(input.getPage()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, SearchResponse.class)) + .nullify404(false) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new SearchErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * List all balances. Specify date time to list balances for that time that appear in the + * response. Notes: It takes a maximum of three hours for balances to appear in the list + * balances call. This call lists balances upto the previous three years. + * @param input SearchBalancesInput object containing request parameters + * @return Returns the BalancesResponse wrapped in ApiResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public ApiResponse searchBalances( + final SearchBalancesInput input) throws ApiException, IOException { + return prepareSearchBalancesRequest(input).execute(); + } + + /** + * List all balances. Specify date time to list balances for that time that appear in the + * response. Notes: It takes a maximum of three hours for balances to appear in the list + * balances call. This call lists balances upto the previous three years. + * @param input SearchBalancesInput object containing request parameters + * @return Returns the BalancesResponse wrapped in ApiResponse response from the API call + */ + public CompletableFuture> searchBalancesAsync( + final SearchBalancesInput input) { + try { + return prepareSearchBalancesRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); + } + } + + /** + * Builds the ApiCall object for searchBalances. + */ + private ApiCall, ApiException> prepareSearchBalancesRequest( + final SearchBalancesInput input) { + return new ApiCall.Builder, ApiException>() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.ENUM_DEFAULT.value()) + .path("/v1/reporting/balances") + .queryParam(param -> param.key("as_of_time") + .value(input.getAsOfTime()).isRequired(false)) + .queryParam(param -> param.key("currency_code") + .value(input.getCurrencyCode()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("Oauth2")) + .httpMethod(HttpMethod.GET)) + .responseHandler(responseHandler -> responseHandler + .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, BalancesResponse.class)) + .nullify404(false) + .localErrorCase("400", + ErrorCase.setReason("The request is not well-formed, is syntactically incorrect, or violates schema.", + (reason, context) -> new DefaultErrorException(reason, context))) + .localErrorCase("403", + ErrorCase.setReason("Authorization failed due to insufficient permissions.", + (reason, context) -> new DefaultErrorException(reason, context))) + .localErrorCase("500", + ErrorCase.setReason("An internal server error occurred.", + (reason, context) -> new DefaultErrorException(reason, context))) + .localErrorCase(ErrorCase.DEFAULT, + ErrorCase.setReason("The error response.", + (reason, context) -> new DefaultErrorException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/controllers/VaultController.java b/src/main/java/com/paypal/sdk/controllers/VaultController.java index 0e57cfc..7410d9e 100644 --- a/src/main/java/com/paypal/sdk/controllers/VaultController.java +++ b/src/main/java/com/paypal/sdk/controllers/VaultController.java @@ -6,7 +6,6 @@ package com.paypal.sdk.controllers; -import com.fasterxml.jackson.core.JsonProcessingException; import com.paypal.sdk.ApiHelper; import com.paypal.sdk.Server; import com.paypal.sdk.exceptions.ApiException; @@ -41,47 +40,57 @@ public VaultController(GlobalConfiguration globalConfig) { } /** - * Delete the payment token associated with the payment token id. - * @param id Required parameter: ID of the payment token. + * Creates a Payment Token from the given payment source and adds it to the Vault of the + * associated customer. + * @param input CreatePaymentTokenInput object containing request parameters + * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse deletePaymentToken( - final String id) throws ApiException, IOException { - return prepareDeletePaymentTokenRequest(id).execute(); + public ApiResponse createPaymentToken( + final CreatePaymentTokenInput input) throws ApiException, IOException { + return prepareCreatePaymentTokenRequest(input).execute(); } /** - * Delete the payment token associated with the payment token id. - * @param id Required parameter: ID of the payment token. - * @return Returns the Void wrapped in ApiResponse response from the API call + * Creates a Payment Token from the given payment source and adds it to the Vault of the + * associated customer. + * @param input CreatePaymentTokenInput object containing request parameters + * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call */ - public CompletableFuture> deletePaymentTokenAsync( - final String id) { - try { - return prepareDeletePaymentTokenRequest(id).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> createPaymentTokenAsync( + final CreatePaymentTokenInput input) { + try { + return prepareCreatePaymentTokenRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for deletePaymentToken. + * Builds the ApiCall object for createPaymentToken. */ - private ApiCall, ApiException> prepareDeletePaymentTokenRequest( - final String id) throws IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareCreatePaymentTokenRequest( + final CreatePaymentTokenInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v3/vault/payment-tokens/{id}") - .templateParam(param -> param.key("id").value(id) - .shouldEncode(true)) + .path("/v3/vault/payment-tokens") + .bodyParam(param -> param.value(input.getBody())) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.DELETE)) + .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) + .apiResponseDeserializer( + response -> ApiHelper.deserialize(response, PaymentTokenResponse.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -89,6 +98,12 @@ private ApiCall, ApiException> prepareDeletePaymentTokenReques .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("404", + ErrorCase.setReason("Request contains reference to resources that do not exist.", + (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("An internal server error has occurred.", (reason, context) -> new ErrorException(reason, context))) @@ -97,57 +112,57 @@ private ApiCall, ApiException> prepareDeletePaymentTokenReques } /** - * Creates a Setup Token from the given payment source and adds it to the Vault of the - * associated customer. - * @param input CreateSetupTokenInput object containing request parameters - * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call + * Returns all payment tokens for a customer. + * @param input ListCustomerPaymentTokensInput object containing request parameters + * @return Returns the CustomerVaultPaymentTokensResponse wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse createSetupToken( - final CreateSetupTokenInput input) throws ApiException, IOException { - return prepareCreateSetupTokenRequest(input).execute(); + public ApiResponse listCustomerPaymentTokens( + final ListCustomerPaymentTokensInput input) throws ApiException, IOException { + return prepareListCustomerPaymentTokensRequest(input).execute(); } /** - * Creates a Setup Token from the given payment source and adds it to the Vault of the - * associated customer. - * @param input CreateSetupTokenInput object containing request parameters - * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call + * Returns all payment tokens for a customer. + * @param input ListCustomerPaymentTokensInput object containing request parameters + * @return Returns the CustomerVaultPaymentTokensResponse wrapped in ApiResponse response from the API call */ - public CompletableFuture> createSetupTokenAsync( - final CreateSetupTokenInput input) { - try { - return prepareCreateSetupTokenRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> listCustomerPaymentTokensAsync( + final ListCustomerPaymentTokensInput input) { + try { + return prepareListCustomerPaymentTokensRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for createSetupToken. + * Builds the ApiCall object for listCustomerPaymentTokens. */ - private ApiCall, ApiException> prepareCreateSetupTokenRequest( - final CreateSetupTokenInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareListCustomerPaymentTokensRequest( + final ListCustomerPaymentTokensInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v3/vault/setup-tokens") - .bodyParam(param -> param.value(input.getBody())) - .bodySerializer(() -> ApiHelper.serialize(input.getBody())) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) - .headerParam(param -> param.key("PayPal-Request-Id") - .value(input.getPaypalRequestId()).isRequired(false)) + .path("/v3/vault/payment-tokens") + .queryParam(param -> param.key("customer_id") + .value(input.getCustomerId())) + .queryParam(param -> param.key("page_size") + .value(input.getPageSize()).isRequired(false)) + .queryParam(param -> param.key("page") + .value(input.getPage()).isRequired(false)) + .queryParam(param -> param.key("total_required") + .value(input.getTotalRequired()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.POST)) + .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, SetupTokenResponse.class)) + response -> ApiHelper.deserialize(response, CustomerVaultPaymentTokensResponse.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -155,9 +170,6 @@ private ApiCall, ApiException> prepareCreateSetu .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("422", - ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("An internal server error has occurred.", (reason, context) -> new ErrorException(reason, context))) @@ -166,43 +178,43 @@ private ApiCall, ApiException> prepareCreateSetu } /** - * Returns a readable representation of temporarily vaulted payment source associated with the - * setup token id. - * @param id Required parameter: ID of the setup token. - * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call + * Returns a readable representation of vaulted payment source associated with the payment token + * id. + * @param id Required parameter: ID of the payment token. + * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse getSetupToken( + public ApiResponse getPaymentToken( final String id) throws ApiException, IOException { - return prepareGetSetupTokenRequest(id).execute(); + return prepareGetPaymentTokenRequest(id).execute(); } /** - * Returns a readable representation of temporarily vaulted payment source associated with the - * setup token id. - * @param id Required parameter: ID of the setup token. - * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call + * Returns a readable representation of vaulted payment source associated with the payment token + * id. + * @param id Required parameter: ID of the payment token. + * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call */ - public CompletableFuture> getSetupTokenAsync( + public CompletableFuture> getPaymentTokenAsync( final String id) { - try { - return prepareGetSetupTokenRequest(id).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareGetPaymentTokenRequest(id).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for getSetupToken. + * Builds the ApiCall object for getPaymentToken. */ - private ApiCall, ApiException> prepareGetSetupTokenRequest( - final String id) throws IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareGetPaymentTokenRequest( + final String id) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v3/vault/setup-tokens/{id}") + .path("/v3/vault/payment-tokens/{id}") .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) @@ -212,7 +224,7 @@ private ApiCall, ApiException> prepareGetSetupTo .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, SetupTokenResponse.class)) + response -> ApiHelper.deserialize(response, PaymentTokenResponse.class)) .nullify404(false) .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", @@ -231,57 +243,48 @@ private ApiCall, ApiException> prepareGetSetupTo } /** - * Creates a Payment Token from the given payment source and adds it to the Vault of the - * associated customer. - * @param input CreatePaymentTokenInput object containing request parameters - * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call + * Delete the payment token associated with the payment token id. + * @param id Required parameter: ID of the payment token. + * @return Returns the Void wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse createPaymentToken( - final CreatePaymentTokenInput input) throws ApiException, IOException { - return prepareCreatePaymentTokenRequest(input).execute(); + public ApiResponse deletePaymentToken( + final String id) throws ApiException, IOException { + return prepareDeletePaymentTokenRequest(id).execute(); } /** - * Creates a Payment Token from the given payment source and adds it to the Vault of the - * associated customer. - * @param input CreatePaymentTokenInput object containing request parameters - * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call + * Delete the payment token associated with the payment token id. + * @param id Required parameter: ID of the payment token. + * @return Returns the Void wrapped in ApiResponse response from the API call */ - public CompletableFuture> createPaymentTokenAsync( - final CreatePaymentTokenInput input) { - try { - return prepareCreatePaymentTokenRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> deletePaymentTokenAsync( + final String id) { + try { + return prepareDeletePaymentTokenRequest(id).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for createPaymentToken. + * Builds the ApiCall object for deletePaymentToken. */ - private ApiCall, ApiException> prepareCreatePaymentTokenRequest( - final CreatePaymentTokenInput input) throws JsonProcessingException, IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareDeletePaymentTokenRequest( + final String id) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v3/vault/payment-tokens") - .bodyParam(param -> param.value(input.getBody())) - .bodySerializer(() -> ApiHelper.serialize(input.getBody())) - .headerParam(param -> param.key("Content-Type") - .value("application/json").isRequired(false)) - .headerParam(param -> param.key("PayPal-Request-Id") - .value(input.getPaypalRequestId()).isRequired(false)) - .headerParam(param -> param.key("accept").value("application/json")) + .path("/v3/vault/payment-tokens/{id}") + .templateParam(param -> param.key("id").value(id) + .shouldEncode(true)) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.POST)) + .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) - .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, PaymentTokenResponse.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -289,12 +292,6 @@ private ApiCall, ApiException> prepareCreatePa .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("404", - ErrorCase.setReason("Request contains reference to resources that do not exist.", - (reason, context) -> new ErrorException(reason, context))) - .localErrorCase("422", - ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", - (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("An internal server error has occurred.", (reason, context) -> new ErrorException(reason, context))) @@ -303,57 +300,57 @@ private ApiCall, ApiException> prepareCreatePa } /** - * Returns all payment tokens for a customer. - * @param input ListCustomerPaymentTokensInput object containing request parameters - * @return Returns the CustomerVaultPaymentTokensResponse wrapped in ApiResponse response from the API call + * Creates a Setup Token from the given payment source and adds it to the Vault of the + * associated customer. + * @param input CreateSetupTokenInput object containing request parameters + * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse listCustomerPaymentTokens( - final ListCustomerPaymentTokensInput input) throws ApiException, IOException { - return prepareListCustomerPaymentTokensRequest(input).execute(); + public ApiResponse createSetupToken( + final CreateSetupTokenInput input) throws ApiException, IOException { + return prepareCreateSetupTokenRequest(input).execute(); } /** - * Returns all payment tokens for a customer. - * @param input ListCustomerPaymentTokensInput object containing request parameters - * @return Returns the CustomerVaultPaymentTokensResponse wrapped in ApiResponse response from the API call + * Creates a Setup Token from the given payment source and adds it to the Vault of the + * associated customer. + * @param input CreateSetupTokenInput object containing request parameters + * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call */ - public CompletableFuture> listCustomerPaymentTokensAsync( - final ListCustomerPaymentTokensInput input) { - try { - return prepareListCustomerPaymentTokensRequest(input).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + public CompletableFuture> createSetupTokenAsync( + final CreateSetupTokenInput input) { + try { + return prepareCreateSetupTokenRequest(input).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for listCustomerPaymentTokens. + * Builds the ApiCall object for createSetupToken. */ - private ApiCall, ApiException> prepareListCustomerPaymentTokensRequest( - final ListCustomerPaymentTokensInput input) throws IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareCreateSetupTokenRequest( + final CreateSetupTokenInput input) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v3/vault/payment-tokens") - .queryParam(param -> param.key("customer_id") - .value(input.getCustomerId())) - .queryParam(param -> param.key("page_size") - .value(input.getPageSize()).isRequired(false)) - .queryParam(param -> param.key("page") - .value(input.getPage()).isRequired(false)) - .queryParam(param -> param.key("total_required") - .value(input.getTotalRequired()).isRequired(false)) + .path("/v3/vault/setup-tokens") + .bodyParam(param -> param.value(input.getBody())) + .bodySerializer(() -> ApiHelper.serialize(input.getBody())) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("PayPal-Request-Id") + .value(input.getPaypalRequestId()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("Oauth2")) - .httpMethod(HttpMethod.GET)) + .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, CustomerVaultPaymentTokensResponse.class)) + response -> ApiHelper.deserialize(response, SetupTokenResponse.class)) .nullify404(false) .localErrorCase("400", ErrorCase.setReason("Request is not well-formed, syntactically incorrect, or violates schema.", @@ -361,6 +358,9 @@ private ApiCall, ApiException> p .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", (reason, context) -> new ErrorException(reason, context))) + .localErrorCase("422", + ErrorCase.setReason("The requested action could not be performed, semantically incorrect, or failed business validation.", + (reason, context) -> new ErrorException(reason, context))) .localErrorCase("500", ErrorCase.setReason("An internal server error has occurred.", (reason, context) -> new ErrorException(reason, context))) @@ -369,43 +369,43 @@ private ApiCall, ApiException> p } /** - * Returns a readable representation of vaulted payment source associated with the payment token - * id. - * @param id Required parameter: ID of the payment token. - * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call + * Returns a readable representation of temporarily vaulted payment source associated with the + * setup token id. + * @param id Required parameter: ID of the setup token. + * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public ApiResponse getPaymentToken( + public ApiResponse getSetupToken( final String id) throws ApiException, IOException { - return prepareGetPaymentTokenRequest(id).execute(); + return prepareGetSetupTokenRequest(id).execute(); } /** - * Returns a readable representation of vaulted payment source associated with the payment token - * id. - * @param id Required parameter: ID of the payment token. - * @return Returns the PaymentTokenResponse wrapped in ApiResponse response from the API call + * Returns a readable representation of temporarily vaulted payment source associated with the + * setup token id. + * @param id Required parameter: ID of the setup token. + * @return Returns the SetupTokenResponse wrapped in ApiResponse response from the API call */ - public CompletableFuture> getPaymentTokenAsync( + public CompletableFuture> getSetupTokenAsync( final String id) { - try { - return prepareGetPaymentTokenRequest(id).executeAsync(); - } catch (Exception e) { - throw new CompletionException(e); + try { + return prepareGetSetupTokenRequest(id).executeAsync(); + } catch (Exception e) { + throw new CompletionException(e); } } /** - * Builds the ApiCall object for getPaymentToken. + * Builds the ApiCall object for getSetupToken. */ - private ApiCall, ApiException> prepareGetPaymentTokenRequest( - final String id) throws IOException { - return new ApiCall.Builder, ApiException>() + private ApiCall, ApiException> prepareGetSetupTokenRequest( + final String id) { + return new ApiCall.Builder, ApiException>() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) - .path("/v3/vault/payment-tokens/{id}") + .path("/v3/vault/setup-tokens/{id}") .templateParam(param -> param.key("id").value(id) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) @@ -415,7 +415,7 @@ private ApiCall, ApiException> prepareGetPayme .responseHandler(responseHandler -> responseHandler .responseClassType(ResponseClassType.API_RESPONSE) .apiResponseDeserializer( - response -> ApiHelper.deserialize(response, PaymentTokenResponse.class)) + response -> ApiHelper.deserialize(response, SetupTokenResponse.class)) .nullify404(false) .localErrorCase("403", ErrorCase.setReason("Authorization failed due to insufficient permissions.", diff --git a/src/main/java/com/paypal/sdk/exceptions/DefaultErrorException.java b/src/main/java/com/paypal/sdk/exceptions/DefaultErrorException.java new file mode 100644 index 0000000..6daabcf --- /dev/null +++ b/src/main/java/com/paypal/sdk/exceptions/DefaultErrorException.java @@ -0,0 +1,173 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.exceptions; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.paypal.sdk.models.LinkDescription; +import com.paypal.sdk.models.TransactionSearchErrorDetails; +import io.apimatic.coreinterfaces.http.Context; +import java.util.List; + +/** + * This is a model class for DefaultErrorException type. + */ +public class DefaultErrorException extends ApiException { + private static final long serialVersionUID = -3267319731354007920L; + private String name; + private String message; + private String debugId; + private String informationLink; + private List details; + private List links; + + /** + * Initialization constructor. + * @param reason The reason for throwing exception + * @param context The context of the API exception + */ + public DefaultErrorException(String reason, Context context) { + super(reason, context); + } + + + /** + * Getter for Name. + * The human-readable, unique name of the error. + * @return Returns the String + */ + @JsonGetter("name") + public String getName() { + return this.name; + } + + /** + * Setter for Name. + * The human-readable, unique name of the error. + * @param name Value for String + */ + @JsonSetter("name") + private void setName(String name) { + this.name = name; + } + + /** + * Getter for Message. + * The message that describes the error. + * @return Returns the String + */ + @JsonGetter("message") + public String getMessageField() { + return this.message; + } + + /** + * Setter for Message. + * The message that describes the error. + * @param messageField Value for String + */ + @JsonSetter("message") + private void setMessageField(String messageField) { + this.message = messageField; + } + + /** + * Getter for DebugId. + * The PayPal internal ID. Used for correlation purposes. + * @return Returns the String + */ + @JsonGetter("debug_id") + public String getDebugId() { + return this.debugId; + } + + /** + * Setter for DebugId. + * The PayPal internal ID. Used for correlation purposes. + * @param debugId Value for String + */ + @JsonSetter("debug_id") + private void setDebugId(String debugId) { + this.debugId = debugId; + } + + /** + * Getter for InformationLink. + * The information link, or URI, that shows detailed information about this error for the + * developer. + * @return Returns the String + */ + @JsonGetter("information_link") + public String getInformationLink() { + return this.informationLink; + } + + /** + * Setter for InformationLink. + * The information link, or URI, that shows detailed information about this error for the + * developer. + * @param informationLink Value for String + */ + @JsonSetter("information_link") + private void setInformationLink(String informationLink) { + this.informationLink = informationLink; + } + + /** + * Getter for Details. + * An array of additional details about the error. + * @return Returns the List of TransactionSearchErrorDetails + */ + @JsonGetter("details") + public List getDetails() { + return this.details; + } + + /** + * Setter for Details. + * An array of additional details about the error. + * @param details Value for List of TransactionSearchErrorDetails + */ + @JsonSetter("details") + private void setDetails(List details) { + this.details = details; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + public List getLinks() { + return this.links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + private void setLinks(List links) { + this.links = links; + } + + /** + * Converts this DefaultErrorException into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "DefaultErrorException [" + "statusCode=" + getResponseCode() + ", message=" + + getMessage() + ", name=" + name + ", message=" + message + ", debugId=" + debugId + + ", informationLink=" + informationLink + ", details=" + details + ", links=" + + links + "]"; + } +} diff --git a/src/main/java/com/paypal/sdk/exceptions/SearchErrorException.java b/src/main/java/com/paypal/sdk/exceptions/SearchErrorException.java new file mode 100644 index 0000000..15b56c8 --- /dev/null +++ b/src/main/java/com/paypal/sdk/exceptions/SearchErrorException.java @@ -0,0 +1,215 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.exceptions; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.paypal.sdk.models.LinkDescription; +import com.paypal.sdk.models.TransactionSearchErrorDetails; +import io.apimatic.coreinterfaces.http.Context; +import java.util.List; + +/** + * This is a model class for SearchErrorException type. + */ +public class SearchErrorException extends ApiException { + private static final long serialVersionUID = 7306043535138755505L; + private String name; + private String message; + private String debugId; + private String informationLink; + private List details; + private List links; + private Integer totalItems; + private Integer maximumItems; + + /** + * Initialization constructor. + * @param reason The reason for throwing exception + * @param context The context of the API exception + */ + public SearchErrorException(String reason, Context context) { + super(reason, context); + } + + + /** + * Getter for Name. + * The human-readable, unique name of the error. + * @return Returns the String + */ + @JsonGetter("name") + public String getName() { + return this.name; + } + + /** + * Setter for Name. + * The human-readable, unique name of the error. + * @param name Value for String + */ + @JsonSetter("name") + private void setName(String name) { + this.name = name; + } + + /** + * Getter for Message. + * The message that describes the error. + * @return Returns the String + */ + @JsonGetter("message") + public String getMessageField() { + return this.message; + } + + /** + * Setter for Message. + * The message that describes the error. + * @param messageField Value for String + */ + @JsonSetter("message") + private void setMessageField(String messageField) { + this.message = messageField; + } + + /** + * Getter for DebugId. + * The PayPal internal ID. Used for correlation purposes. + * @return Returns the String + */ + @JsonGetter("debug_id") + public String getDebugId() { + return this.debugId; + } + + /** + * Setter for DebugId. + * The PayPal internal ID. Used for correlation purposes. + * @param debugId Value for String + */ + @JsonSetter("debug_id") + private void setDebugId(String debugId) { + this.debugId = debugId; + } + + /** + * Getter for InformationLink. + * The information link, or URI, that shows detailed information about this error for the + * developer. + * @return Returns the String + */ + @JsonGetter("information_link") + public String getInformationLink() { + return this.informationLink; + } + + /** + * Setter for InformationLink. + * The information link, or URI, that shows detailed information about this error for the + * developer. + * @param informationLink Value for String + */ + @JsonSetter("information_link") + private void setInformationLink(String informationLink) { + this.informationLink = informationLink; + } + + /** + * Getter for Details. + * An array of additional details about the error. + * @return Returns the List of TransactionSearchErrorDetails + */ + @JsonGetter("details") + public List getDetails() { + return this.details; + } + + /** + * Setter for Details. + * An array of additional details about the error. + * @param details Value for List of TransactionSearchErrorDetails + */ + @JsonSetter("details") + private void setDetails(List details) { + this.details = details; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + public List getLinks() { + return this.links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + private void setLinks(List links) { + this.links = links; + } + + /** + * Getter for TotalItems. + * The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`. + * @return Returns the Integer + */ + @JsonGetter("total_items") + public Integer getTotalItems() { + return this.totalItems; + } + + /** + * Setter for TotalItems. + * The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`. + * @param totalItems Value for Integer + */ + @JsonSetter("total_items") + private void setTotalItems(Integer totalItems) { + this.totalItems = totalItems; + } + + /** + * Getter for MaximumItems. + * The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`. + * @return Returns the Integer + */ + @JsonGetter("maximum_items") + public Integer getMaximumItems() { + return this.maximumItems; + } + + /** + * Setter for MaximumItems. + * The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`. + * @param maximumItems Value for Integer + */ + @JsonSetter("maximum_items") + private void setMaximumItems(Integer maximumItems) { + this.maximumItems = maximumItems; + } + + /** + * Converts this SearchErrorException into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SearchErrorException [" + "statusCode=" + getResponseCode() + ", message=" + + getMessage() + ", name=" + name + ", message=" + message + ", debugId=" + debugId + + ", informationLink=" + informationLink + ", details=" + details + ", links=" + + links + ", totalItems=" + totalItems + ", maximumItems=" + maximumItems + "]"; + } +} diff --git a/src/main/java/com/paypal/sdk/exceptions/SubscriptionErrorException.java b/src/main/java/com/paypal/sdk/exceptions/SubscriptionErrorException.java new file mode 100644 index 0000000..18057e1 --- /dev/null +++ b/src/main/java/com/paypal/sdk/exceptions/SubscriptionErrorException.java @@ -0,0 +1,171 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.exceptions; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.paypal.sdk.models.ErrorDetails; +import com.paypal.sdk.models.LinkDescription; +import io.apimatic.coreinterfaces.http.Context; +import java.util.List; + +/** + * This is a model class for SubscriptionErrorException type. + */ +public class SubscriptionErrorException extends ApiException { + private static final long serialVersionUID = -3553823881580351752L; + private String name; + private String message; + private String debugId; + private String informationLink; + private List details; + private List links; + + /** + * Initialization constructor. + * @param reason The reason for throwing exception + * @param context The context of the API exception + */ + public SubscriptionErrorException(String reason, Context context) { + super(reason, context); + } + + + /** + * Getter for Name. + * The human-readable, unique name of the error. + * @return Returns the String + */ + @JsonGetter("name") + public String getName() { + return this.name; + } + + /** + * Setter for Name. + * The human-readable, unique name of the error. + * @param name Value for String + */ + @JsonSetter("name") + private void setName(String name) { + this.name = name; + } + + /** + * Getter for Message. + * The message that describes the error. + * @return Returns the String + */ + @JsonGetter("message") + public String getMessageField() { + return this.message; + } + + /** + * Setter for Message. + * The message that describes the error. + * @param messageField Value for String + */ + @JsonSetter("message") + private void setMessageField(String messageField) { + this.message = messageField; + } + + /** + * Getter for DebugId. + * The PayPal internal ID. Used for correlation purposes. + * @return Returns the String + */ + @JsonGetter("debug_id") + public String getDebugId() { + return this.debugId; + } + + /** + * Setter for DebugId. + * The PayPal internal ID. Used for correlation purposes. + * @param debugId Value for String + */ + @JsonSetter("debug_id") + private void setDebugId(String debugId) { + this.debugId = debugId; + } + + /** + * Getter for InformationLink. + * The information link, or URI, that shows detailed information about this error for the + * developer. + * @return Returns the String + */ + @JsonGetter("information_link") + public String getInformationLink() { + return this.informationLink; + } + + /** + * Setter for InformationLink. + * The information link, or URI, that shows detailed information about this error for the + * developer. + * @param informationLink Value for String + */ + @JsonSetter("information_link") + private void setInformationLink(String informationLink) { + this.informationLink = informationLink; + } + + /** + * Getter for Details. + * An array of additional details about the error. + * @return Returns the List of ErrorDetails + */ + @JsonGetter("details") + public List getDetails() { + return this.details; + } + + /** + * Setter for Details. + * An array of additional details about the error. + * @param details Value for List of ErrorDetails + */ + @JsonSetter("details") + private void setDetails(List details) { + this.details = details; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + public List getLinks() { + return this.links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + private void setLinks(List links) { + this.links = links; + } + + /** + * Converts this SubscriptionErrorException into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionErrorException [" + "statusCode=" + getResponseCode() + ", message=" + + getMessage() + ", name=" + name + ", message=" + message + ", debugId=" + debugId + + ", informationLink=" + informationLink + ", details=" + details + ", links=" + + links + "]"; + } +} diff --git a/src/main/java/com/paypal/sdk/http/client/HttpClientConfiguration.java b/src/main/java/com/paypal/sdk/http/client/HttpClientConfiguration.java index 8d3d1a1..1cce3e4 100644 --- a/src/main/java/com/paypal/sdk/http/client/HttpClientConfiguration.java +++ b/src/main/java/com/paypal/sdk/http/client/HttpClientConfiguration.java @@ -12,6 +12,7 @@ import io.apimatic.coreinterfaces.http.HttpMethodType; import io.apimatic.coreinterfaces.http.Method; import java.util.Set; +import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -21,11 +22,19 @@ public class HttpClientConfiguration implements ReadonlyHttpClientConfiguration { private final ClientConfiguration configuration; + private final ReadonlyHttpProxyConfiguration proxyConfiguration; /** * Default Constructor. */ - private HttpClientConfiguration(CoreHttpClientConfiguration.Builder configurationBuilder) { + private HttpClientConfiguration(CoreHttpClientConfiguration.Builder configurationBuilder, + HttpProxyConfiguration.Builder proxyConfiguration){ + this.proxyConfiguration = proxyConfiguration != null ? proxyConfiguration.build() : null; + + if (proxyConfiguration != null) { + configurationBuilder.proxyConfiguration(proxyConfiguration.build().getConfiguration()); + } + this.configuration = configurationBuilder.build(); } @@ -115,6 +124,15 @@ public boolean shouldOverrideHttpClientConfigurations() { return configuration.shouldOverrideHttpClientConfigurations(); } + + /** + * Retrieves the proxy configuration settings used by the HTTP client. + * @return the {@link ReadonlyHttpProxyConfiguration} containing the configured proxy settings + */ + public ReadonlyHttpProxyConfiguration getProxyConfig() { + return this.proxyConfiguration; + } + /** * Returns the ClientConfiguration instance. * @return ClientConfiguration @@ -136,7 +154,7 @@ public String toString() { + ", maximumRetryWaitTime=" + getMaximumRetryWaitTime() + ", shouldRetryOnTimeout=" + shouldRetryOnTimeout() + ", httpClientInstance=" + getHttpClientInstance() + ", overrideHttpClientConfigurations=" + shouldOverrideHttpClientConfigurations() - + "]"; + + ", proxyConfig=" + getProxyConfig() + "]"; } /** @@ -155,7 +173,11 @@ public Builder newBuilder() { .httpMethodsToRetry(getHttpMethodsToRetry()) .maximumRetryWaitTime(getMaximumRetryWaitTime()) .shouldRetryOnTimeout(shouldRetryOnTimeout()) - .httpClientInstance(getHttpClientInstance(), shouldOverrideHttpClientConfigurations()); + .httpClientInstance(getHttpClientInstance(), shouldOverrideHttpClientConfigurations()) + .proxyConfig(() -> { + HttpProxyConfiguration proxyConfig = (HttpProxyConfiguration) getProxyConfig(); + return proxyConfig != null ? proxyConfig.newBuilder() : null; + }); } /** @@ -166,6 +188,8 @@ public static class Builder { private final CoreHttpClientConfiguration.Builder configurationBuilder = new CoreHttpClientConfiguration.Builder(); + private HttpProxyConfiguration.Builder proxyConfigurationBuilder = null; + /** * Default Constructor to initiate builder with default properties. */ @@ -285,12 +309,33 @@ public Builder httpClientInstance(okhttp3.OkHttpClient httpClientInstance, return this; } + /** + * Sets the proxy configuration for the underlying HTTP client. + * @param proxyBuilder The builder instance used to configure the proxy settings + * @return Builder + */ + public Builder proxyConfig(HttpProxyConfiguration.Builder proxyBuilder) { + proxyConfigurationBuilder = proxyBuilder; + return this; + } + + /** + * Private setter for the Builder of ProxyConfiguration, takes in an operation to be + * performed on the builder instance of proxy configuration. + * @param proxySupplier Supplier for the builder of ProxyConfiguration. + * @return Builder + */ + private Builder proxyConfig(Supplier proxySupplier) { + proxyConfigurationBuilder = proxySupplier.get(); + return this; + } + /** * Builds a new HttpClientConfiguration object using the set fields. * @return {@link HttpClientConfiguration} */ public HttpClientConfiguration build() { - return new HttpClientConfiguration(configurationBuilder); + return new HttpClientConfiguration(configurationBuilder, proxyConfigurationBuilder); } } } \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/http/client/HttpProxyConfiguration.java b/src/main/java/com/paypal/sdk/http/client/HttpProxyConfiguration.java new file mode 100644 index 0000000..2500bf7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/http/client/HttpProxyConfiguration.java @@ -0,0 +1,135 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.http.client; + +import io.apimatic.core.configurations.http.client.CoreProxyConfiguration; +import io.apimatic.coreinterfaces.http.proxy.ProxyConfiguration; + +/** +* Represents the HTTP proxy configuration used by the SDK. +*/ +public class HttpProxyConfiguration implements ReadonlyHttpProxyConfiguration { + + private final CoreProxyConfiguration configuration; + + /** + * Creates a new {@code HttpProxyConfiguration} instance with the given core proxy + * configuration. + * @param configuration the underlying {@link CoreProxyConfiguration} to wrap. + */ + private HttpProxyConfiguration(final CoreProxyConfiguration configuration) { + this.configuration = configuration; + } + + /** + * Gets the proxy server address. + * @return the proxy address as a string. + */ + public String getAddress() { + return configuration.getAddress(); + } + + /** + * Gets the proxy server port. + * @return the proxy port number. + */ + public int getPort() { + return configuration.getPort(); + } + + /** + * Gets the username used for proxy authentication. + * @return the proxy username, or {@code null} if authentication is not required. + */ + public String getUsername() { + return configuration.getUsername(); + } + + /** + * Gets the password used for proxy authentication. + * @return the proxy password, or {@code null} if authentication is not required. + */ + public String getPassword() { + return configuration.getPassword(); + } + + /** + * Retrieves the underlying proxy configuration. + * @return the {@link ProxyConfiguration} instance containing all proxy settings. + */ + public ProxyConfiguration getConfiguration() { + return configuration; + } + + /** + * Creates a new builder initialized with the current configuration's values. + * @return a new {@link CoreProxyConfiguration.Builder} instance + */ + public HttpProxyConfiguration.Builder newBuilder() { + return new Builder(this.getAddress(), this.getPort()) + .auth(this.getUsername(), this.getPassword()); + } + + /** + * Returns a string representation of this proxy configuration. + * @return string representation of this object + */ + @Override + public String toString() { + return "HttpProxyConfiguration [" + + "address=" + this.getAddress() + + ", port=" + this.getPort() + + ", username=" + this.getUsername() + + ", password=" + this.getPassword() + + "]"; + } + + /** + * Builder class for constructing {@link CoreProxyConfiguration} instances. + */ + public static class Builder { + + private final String address; + private final int port; + private String username; + private String password; + + /** + * Creates a new {@code Builder} instance with the specified proxy server address and port. + * @param address the proxy server address. + * @param port the proxy server port. + */ + public Builder(String address, int port) { + this.address = address; + this.port = port; + } + + /** + * Sets the username and password for proxy auth. + * @param username the username to set for proxy auth. + * @param password the password to set for proxy auth. + * @return the builder instance + */ + public Builder auth(String username, String password) { + this.username = username; + this.password = password; + return this; + } + + /** + * Builds a new {@link HttpProxyConfiguration} instance using the set fields. + * @return the built {@link HttpProxyConfiguration} + */ + public HttpProxyConfiguration build() { + return new HttpProxyConfiguration( + new CoreProxyConfiguration.Builder(address, port) + .username(username) + .password(password) + .build()); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpClientConfiguration.java b/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpClientConfiguration.java index 75e953c..554b170 100644 --- a/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpClientConfiguration.java +++ b/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpClientConfiguration.java @@ -75,4 +75,9 @@ public interface ReadonlyHttpClientConfiguration { */ boolean shouldOverrideHttpClientConfigurations(); + /** + * Retrieves the proxy configuration settings used by the HTTP client. + * @return configuration + */ + ReadonlyHttpProxyConfiguration getProxyConfig(); } \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpProxyConfiguration.java b/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpProxyConfiguration.java new file mode 100644 index 0000000..40122c7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/http/client/ReadonlyHttpProxyConfiguration.java @@ -0,0 +1,37 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.http.client; + +public interface ReadonlyHttpProxyConfiguration { + /** + * Returns the address (hostname or IP) of the proxy server. + * + * @return the proxy server address as a {@link String} + */ + String getAddress(); + + /** + * Returns the port number on which the proxy server is listening. + * + * @return the proxy server port + */ + int getPort(); + + /** + * Returns the username used for proxy authentication. + * + * @return the proxy authentication username as a {@link String} + */ + String getUsername(); + + /** + * Returns the password associated with the proxy authentication username. + * + * @return the proxy authentication password as a {@link String} + */ + String getPassword(); +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/ActivateSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/ActivateSubscriptionInput.java new file mode 100644 index 0000000..db1641e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ActivateSubscriptionInput.java @@ -0,0 +1,183 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ActivateSubscriptionInput type. + */ +public class ActivateSubscriptionInput { + private String id; + private String contentType; + private ActivateSubscriptionRequest body; + + /** + * Default constructor. + */ + public ActivateSubscriptionInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body ActivateSubscriptionRequest value for body. + */ + public ActivateSubscriptionInput( + String id, + String contentType, + ActivateSubscriptionRequest body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the ActivateSubscriptionRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ActivateSubscriptionRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for ActivateSubscriptionRequest + */ + @JsonSetter("body") + public void setBody(ActivateSubscriptionRequest body) { + this.body = body; + } + + /** + * Converts this ActivateSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ActivateSubscriptionInput [" + "id=" + id + ", contentType=" + contentType + + ", body=" + body + "]"; + } + + /** + * Builds a new {@link ActivateSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ActivateSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link ActivateSubscriptionInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private ActivateSubscriptionRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body ActivateSubscriptionRequest value for body. + * @return Builder + */ + public Builder body(ActivateSubscriptionRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link ActivateSubscriptionInput} object using the set fields. + * @return {@link ActivateSubscriptionInput} + */ + public ActivateSubscriptionInput build() { + return new ActivateSubscriptionInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ActivateSubscriptionRequest.java b/src/main/java/com/paypal/sdk/models/ActivateSubscriptionRequest.java new file mode 100644 index 0000000..6ec0cff --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ActivateSubscriptionRequest.java @@ -0,0 +1,101 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ActivateSubscriptionRequest type. + */ +public class ActivateSubscriptionRequest { + private String reason; + + /** + * Default constructor. + */ + public ActivateSubscriptionRequest() { + } + + /** + * Initialization constructor. + * @param reason String value for reason. + */ + public ActivateSubscriptionRequest( + String reason) { + this.reason = reason; + } + + /** + * Getter for Reason. + * The reason for activation of a subscription. Required to reactivate the subscription. + * @return Returns the String + */ + @JsonGetter("reason") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getReason() { + return reason; + } + + /** + * Setter for Reason. + * The reason for activation of a subscription. Required to reactivate the subscription. + * @param reason Value for String + */ + @JsonSetter("reason") + public void setReason(String reason) { + this.reason = reason; + } + + /** + * Converts this ActivateSubscriptionRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ActivateSubscriptionRequest [" + "reason=" + reason + "]"; + } + + /** + * Builds a new {@link ActivateSubscriptionRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ActivateSubscriptionRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .reason(getReason()); + return builder; + } + + /** + * Class to build instances of {@link ActivateSubscriptionRequest}. + */ + public static class Builder { + private String reason; + + + + /** + * Setter for reason. + * @param reason String value for reason. + * @return Builder + */ + public Builder reason(String reason) { + this.reason = reason; + return this; + } + + /** + * Builds a new {@link ActivateSubscriptionRequest} object using the set fields. + * @return {@link ActivateSubscriptionRequest} + */ + public ActivateSubscriptionRequest build() { + return new ActivateSubscriptionRequest(reason); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/AmountBreakdown.java b/src/main/java/com/paypal/sdk/models/AmountBreakdown.java index cd6f5f4..0ec6459 100644 --- a/src/main/java/com/paypal/sdk/models/AmountBreakdown.java +++ b/src/main/java/com/paypal/sdk/models/AmountBreakdown.java @@ -183,7 +183,8 @@ public void setShippingDiscount(Money shippingDiscount) { /** * Getter for Discount. - * The currency and amount for a financial transaction, such as a balance or payment due. + * The discount amount and currency code. For list of supported currencies and decimal + * precision, see the PayPal REST APIs Currency Codes. * @return Returns the Money */ @JsonGetter("discount") @@ -194,7 +195,8 @@ public Money getDiscount() { /** * Setter for Discount. - * The currency and amount for a financial transaction, such as a balance or payment due. + * The discount amount and currency code. For list of supported currencies and decimal + * precision, see the PayPal REST APIs Currency Codes. * @param discount Value for Money */ @JsonSetter("discount") diff --git a/src/main/java/com/paypal/sdk/models/AppSwitchContext.java b/src/main/java/com/paypal/sdk/models/AppSwitchContext.java new file mode 100644 index 0000000..c2ae3f6 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/AppSwitchContext.java @@ -0,0 +1,138 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for AppSwitchContext type. + */ +public class AppSwitchContext { + private NativeAppContext nativeApp; + private MobileWebContext mobileWeb; + + /** + * Default constructor. + */ + public AppSwitchContext() { + } + + /** + * Initialization constructor. + * @param nativeApp NativeAppContext value for nativeApp. + * @param mobileWeb MobileWebContext value for mobileWeb. + */ + public AppSwitchContext( + NativeAppContext nativeApp, + MobileWebContext mobileWeb) { + this.nativeApp = nativeApp; + this.mobileWeb = mobileWeb; + } + + /** + * Getter for NativeApp. + * Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. + * @return Returns the NativeAppContext + */ + @JsonGetter("native_app") + @JsonInclude(JsonInclude.Include.NON_NULL) + public NativeAppContext getNativeApp() { + return nativeApp; + } + + /** + * Setter for NativeApp. + * Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. + * @param nativeApp Value for NativeAppContext + */ + @JsonSetter("native_app") + public void setNativeApp(NativeAppContext nativeApp) { + this.nativeApp = nativeApp; + } + + /** + * Getter for MobileWeb. + * Buyer's mobile web browser context to app switch to the PayPal consumer app. + * @return Returns the MobileWebContext + */ + @JsonGetter("mobile_web") + @JsonInclude(JsonInclude.Include.NON_NULL) + public MobileWebContext getMobileWeb() { + return mobileWeb; + } + + /** + * Setter for MobileWeb. + * Buyer's mobile web browser context to app switch to the PayPal consumer app. + * @param mobileWeb Value for MobileWebContext + */ + @JsonSetter("mobile_web") + public void setMobileWeb(MobileWebContext mobileWeb) { + this.mobileWeb = mobileWeb; + } + + /** + * Converts this AppSwitchContext into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "AppSwitchContext [" + "nativeApp=" + nativeApp + ", mobileWeb=" + mobileWeb + "]"; + } + + /** + * Builds a new {@link AppSwitchContext.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link AppSwitchContext.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .nativeApp(getNativeApp()) + .mobileWeb(getMobileWeb()); + return builder; + } + + /** + * Class to build instances of {@link AppSwitchContext}. + */ + public static class Builder { + private NativeAppContext nativeApp; + private MobileWebContext mobileWeb; + + + + /** + * Setter for nativeApp. + * @param nativeApp NativeAppContext value for nativeApp. + * @return Builder + */ + public Builder nativeApp(NativeAppContext nativeApp) { + this.nativeApp = nativeApp; + return this; + } + + /** + * Setter for mobileWeb. + * @param mobileWeb MobileWebContext value for mobileWeb. + * @return Builder + */ + public Builder mobileWeb(MobileWebContext mobileWeb) { + this.mobileWeb = mobileWeb; + return this; + } + + /** + * Builds a new {@link AppSwitchContext} object using the set fields. + * @return {@link AppSwitchContext} + */ + public AppSwitchContext build() { + return new AppSwitchContext(nativeApp, mobileWeb); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ApplePayRequestCard.java b/src/main/java/com/paypal/sdk/models/ApplePayRequestCard.java new file mode 100644 index 0000000..89b8bb4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ApplePayRequestCard.java @@ -0,0 +1,182 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ApplePayRequestCard type. + */ +public class ApplePayRequestCard { + private CardType type; + private CardBrand brand; + private Address billingAddress; + + /** + * Default constructor. + */ + public ApplePayRequestCard() { + } + + /** + * Initialization constructor. + * @param type CardType value for type. + * @param brand CardBrand value for brand. + * @param billingAddress Address value for billingAddress. + */ + public ApplePayRequestCard( + CardType type, + CardBrand brand, + Address billingAddress) { + this.type = type; + this.brand = brand; + this.billingAddress = billingAddress; + } + + /** + * Getter for Type. + * Type of card. i.e Credit, Debit and so on. + * @return Returns the CardType + */ + @JsonGetter("type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CardType getType() { + return type; + } + + /** + * Setter for Type. + * Type of card. i.e Credit, Debit and so on. + * @param type Value for CardType + */ + @JsonSetter("type") + public void setType(CardType type) { + this.type = type; + } + + /** + * Getter for Brand. + * The card network or brand. Applies to credit, debit, gift, and payment cards. + * @return Returns the CardBrand + */ + @JsonGetter("brand") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CardBrand getBrand() { + return brand; + } + + /** + * Setter for Brand. + * The card network or brand. Applies to credit, debit, gift, and payment cards. + * @param brand Value for CardBrand + */ + @JsonSetter("brand") + public void setBrand(CardBrand brand) { + this.brand = brand; + } + + /** + * Getter for BillingAddress. + * The portable international postal address. Maps to + * [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) + * and HTML 5.1 [Autofilling form controls: the autocomplete + * attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). + * @return Returns the Address + */ + @JsonGetter("billing_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Address getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * 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). + * @param billingAddress Value for Address + */ + @JsonSetter("billing_address") + public void setBillingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Converts this ApplePayRequestCard into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ApplePayRequestCard [" + "type=" + type + ", brand=" + brand + ", billingAddress=" + + billingAddress + "]"; + } + + /** + * Builds a new {@link ApplePayRequestCard.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ApplePayRequestCard.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .type(getType()) + .brand(getBrand()) + .billingAddress(getBillingAddress()); + return builder; + } + + /** + * Class to build instances of {@link ApplePayRequestCard}. + */ + public static class Builder { + private CardType type; + private CardBrand brand; + private Address billingAddress; + + + + /** + * Setter for type. + * @param type CardType value for type. + * @return Builder + */ + public Builder type(CardType type) { + this.type = type; + return this; + } + + /** + * Setter for brand. + * @param brand CardBrand value for brand. + * @return Builder + */ + public Builder brand(CardBrand brand) { + this.brand = brand; + return this; + } + + /** + * Setter for billingAddress. + * @param billingAddress Address value for billingAddress. + * @return Builder + */ + public Builder billingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + /** + * Builds a new {@link ApplePayRequestCard} object using the set fields. + * @return {@link ApplePayRequestCard} + */ + public ApplePayRequestCard build() { + return new ApplePayRequestCard(type, brand, billingAddress); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ApplePayTokenizedCard.java b/src/main/java/com/paypal/sdk/models/ApplePayTokenizedCard.java index a93a7e0..2edfb57 100644 --- a/src/main/java/com/paypal/sdk/models/ApplePayTokenizedCard.java +++ b/src/main/java/com/paypal/sdk/models/ApplePayTokenizedCard.java @@ -122,7 +122,7 @@ public void setExpiry(String expiry) { /** * Getter for CardType. - * The card network or brand. Applies to credit, debit, gift, and payment cards. + * The card brand or network. Typically used in the response. * @return Returns the CardBrand */ @JsonGetter("card_type") @@ -133,7 +133,7 @@ public CardBrand getCardType() { /** * Setter for CardType. - * The card network or brand. Applies to credit, debit, gift, and payment cards. + * The card brand or network. Typically used in the response. * @param cardType Value for CardBrand */ @JsonSetter("card_type") diff --git a/src/main/java/com/paypal/sdk/models/ApplicationContextUserAction.java b/src/main/java/com/paypal/sdk/models/ApplicationContextUserAction.java new file mode 100644 index 0000000..3be86a7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ApplicationContextUserAction.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * ApplicationContextUserAction to be used. + */ +public enum ApplicationContextUserAction { + /** + * 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. + */ + CONTINUE, + + /** + * 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. + */ + SUBSCRIBE_NOW, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CONTINUE.value = "CONTINUE"; + SUBSCRIBE_NOW.value = "SUBSCRIBE_NOW"; + _UNKNOWN.value = null; + + valueMap.put("CONTINUE", CONTINUE); + valueMap.put("SUBSCRIBE_NOW", SUBSCRIBE_NOW); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static ApplicationContextUserAction constructFromString(String toConvert) throws IOException { + ApplicationContextUserAction enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static ApplicationContextUserAction fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of ApplicationContextUserAction values to list of string values. + * @param toConvert The list of ApplicationContextUserAction values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (ApplicationContextUserAction enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/AuctionInformation.java b/src/main/java/com/paypal/sdk/models/AuctionInformation.java new file mode 100644 index 0000000..345f44a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/AuctionInformation.java @@ -0,0 +1,223 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for AuctionInformation type. + */ +public class AuctionInformation { + private String auctionSite; + private String auctionItemSite; + private String auctionBuyerId; + private String auctionClosingDate; + + /** + * Default constructor. + */ + public AuctionInformation() { + } + + /** + * Initialization constructor. + * @param auctionSite String value for auctionSite. + * @param auctionItemSite String value for auctionItemSite. + * @param auctionBuyerId String value for auctionBuyerId. + * @param auctionClosingDate String value for auctionClosingDate. + */ + public AuctionInformation( + String auctionSite, + String auctionItemSite, + String auctionBuyerId, + String auctionClosingDate) { + this.auctionSite = auctionSite; + this.auctionItemSite = auctionItemSite; + this.auctionBuyerId = auctionBuyerId; + this.auctionClosingDate = auctionClosingDate; + } + + /** + * Getter for AuctionSite. + * The name of the auction site. + * @return Returns the String + */ + @JsonGetter("auction_site") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAuctionSite() { + return auctionSite; + } + + /** + * Setter for AuctionSite. + * The name of the auction site. + * @param auctionSite Value for String + */ + @JsonSetter("auction_site") + public void setAuctionSite(String auctionSite) { + this.auctionSite = auctionSite; + } + + /** + * Getter for AuctionItemSite. + * The auction site URL. + * @return Returns the String + */ + @JsonGetter("auction_item_site") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAuctionItemSite() { + return auctionItemSite; + } + + /** + * Setter for AuctionItemSite. + * The auction site URL. + * @param auctionItemSite Value for String + */ + @JsonSetter("auction_item_site") + public void setAuctionItemSite(String auctionItemSite) { + this.auctionItemSite = auctionItemSite; + } + + /** + * Getter for AuctionBuyerId. + * 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. + * @return Returns the String + */ + @JsonGetter("auction_buyer_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAuctionBuyerId() { + return auctionBuyerId; + } + + /** + * Setter for AuctionBuyerId. + * 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. + * @param auctionBuyerId Value for String + */ + @JsonSetter("auction_buyer_id") + public void setAuctionBuyerId(String auctionBuyerId) { + this.auctionBuyerId = auctionBuyerId; + } + + /** + * Getter for AuctionClosingDate. + * 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. + * @return Returns the String + */ + @JsonGetter("auction_closing_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAuctionClosingDate() { + return auctionClosingDate; + } + + /** + * Setter for AuctionClosingDate. + * 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. + * @param auctionClosingDate Value for String + */ + @JsonSetter("auction_closing_date") + public void setAuctionClosingDate(String auctionClosingDate) { + this.auctionClosingDate = auctionClosingDate; + } + + /** + * Converts this AuctionInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "AuctionInformation [" + "auctionSite=" + auctionSite + ", auctionItemSite=" + + auctionItemSite + ", auctionBuyerId=" + auctionBuyerId + ", auctionClosingDate=" + + auctionClosingDate + "]"; + } + + /** + * Builds a new {@link AuctionInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link AuctionInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .auctionSite(getAuctionSite()) + .auctionItemSite(getAuctionItemSite()) + .auctionBuyerId(getAuctionBuyerId()) + .auctionClosingDate(getAuctionClosingDate()); + return builder; + } + + /** + * Class to build instances of {@link AuctionInformation}. + */ + public static class Builder { + private String auctionSite; + private String auctionItemSite; + private String auctionBuyerId; + private String auctionClosingDate; + + + + /** + * Setter for auctionSite. + * @param auctionSite String value for auctionSite. + * @return Builder + */ + public Builder auctionSite(String auctionSite) { + this.auctionSite = auctionSite; + return this; + } + + /** + * Setter for auctionItemSite. + * @param auctionItemSite String value for auctionItemSite. + * @return Builder + */ + public Builder auctionItemSite(String auctionItemSite) { + this.auctionItemSite = auctionItemSite; + return this; + } + + /** + * Setter for auctionBuyerId. + * @param auctionBuyerId String value for auctionBuyerId. + * @return Builder + */ + public Builder auctionBuyerId(String auctionBuyerId) { + this.auctionBuyerId = auctionBuyerId; + return this; + } + + /** + * Setter for auctionClosingDate. + * @param auctionClosingDate String value for auctionClosingDate. + * @return Builder + */ + public Builder auctionClosingDate(String auctionClosingDate) { + this.auctionClosingDate = auctionClosingDate; + return this; + } + + /** + * Builds a new {@link AuctionInformation} object using the set fields. + * @return {@link AuctionInformation} + */ + public AuctionInformation build() { + return new AuctionInformation(auctionSite, auctionItemSite, auctionBuyerId, + auctionClosingDate); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/Authorization.java b/src/main/java/com/paypal/sdk/models/Authorization.java index e6a1f07..aec9f86 100644 --- a/src/main/java/com/paypal/sdk/models/Authorization.java +++ b/src/main/java/com/paypal/sdk/models/Authorization.java @@ -21,7 +21,7 @@ public class Authorization { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private String expirationTime; private List links; @@ -42,7 +42,7 @@ public Authorization() { * @param amount Money value for amount. * @param invoiceId String value for invoiceId. * @param customId String value for customId. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @param sellerProtection SellerProtection value for sellerProtection. * @param expirationTime String value for expirationTime. @@ -57,7 +57,7 @@ public Authorization( Money amount, String invoiceId, String customId, - NetworkTransactionReference networkTransactionReference, + NetworkTransaction networkTransactionReference, SellerProtection sellerProtection, String expirationTime, List links, @@ -210,21 +210,21 @@ public void setCustomId(String customId) { /** * Getter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getNetworkTransactionReference() { + public NetworkTransaction getNetworkTransactionReference() { return networkTransactionReference; } /** * Setter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param networkTransactionReference Value for NetworkTransactionReference + * @param networkTransactionReference Value for NetworkTransaction */ @JsonSetter("network_transaction_reference") - public void setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) { + public void setNetworkTransactionReference(NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; } @@ -399,7 +399,7 @@ public static class Builder { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private String expirationTime; private List links; @@ -470,12 +470,12 @@ public Builder customId(String customId) { /** * Setter for networkTransactionReference. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @return Builder */ public Builder networkTransactionReference( - NetworkTransactionReference networkTransactionReference) { + NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/AuthorizationWithAdditionalData.java b/src/main/java/com/paypal/sdk/models/AuthorizationWithAdditionalData.java index 1f99261..957573c 100644 --- a/src/main/java/com/paypal/sdk/models/AuthorizationWithAdditionalData.java +++ b/src/main/java/com/paypal/sdk/models/AuthorizationWithAdditionalData.java @@ -21,7 +21,7 @@ public class AuthorizationWithAdditionalData { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private String expirationTime; private List links; @@ -43,7 +43,7 @@ public AuthorizationWithAdditionalData() { * @param amount Money value for amount. * @param invoiceId String value for invoiceId. * @param customId String value for customId. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @param sellerProtection SellerProtection value for sellerProtection. * @param expirationTime String value for expirationTime. @@ -59,7 +59,7 @@ public AuthorizationWithAdditionalData( Money amount, String invoiceId, String customId, - NetworkTransactionReference networkTransactionReference, + NetworkTransaction networkTransactionReference, SellerProtection sellerProtection, String expirationTime, List links, @@ -214,21 +214,21 @@ public void setCustomId(String customId) { /** * Getter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getNetworkTransactionReference() { + public NetworkTransaction getNetworkTransactionReference() { return networkTransactionReference; } /** * Setter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param networkTransactionReference Value for NetworkTransactionReference + * @param networkTransactionReference Value for NetworkTransaction */ @JsonSetter("network_transaction_reference") - public void setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) { + public void setNetworkTransactionReference(NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; } @@ -428,7 +428,7 @@ public static class Builder { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private String expirationTime; private List links; @@ -500,12 +500,12 @@ public Builder customId(String customId) { /** * Setter for networkTransactionReference. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @return Builder */ public Builder networkTransactionReference( - NetworkTransactionReference networkTransactionReference) { + NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/BalanceInformation.java b/src/main/java/com/paypal/sdk/models/BalanceInformation.java new file mode 100644 index 0000000..0fe8d4b --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/BalanceInformation.java @@ -0,0 +1,264 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for BalanceInformation type. + */ +public class BalanceInformation { + private String currency; + private Boolean primary; + private Money totalBalance; + private Money availableBalance; + private Money withheldBalance; + + /** + * Default constructor. + */ + public BalanceInformation() { + } + + /** + * Initialization constructor. + * @param currency String value for currency. + * @param totalBalance Money value for totalBalance. + * @param primary Boolean value for primary. + * @param availableBalance Money value for availableBalance. + * @param withheldBalance Money value for withheldBalance. + */ + public BalanceInformation( + String currency, + Money totalBalance, + Boolean primary, + Money availableBalance, + Money withheldBalance) { + this.currency = currency; + this.primary = primary; + this.totalBalance = totalBalance; + this.availableBalance = availableBalance; + this.withheldBalance = withheldBalance; + } + + /** + * Getter for Currency. + * The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/) + * that identifies the currency. + * @return Returns the String + */ + @JsonGetter("currency") + public String getCurrency() { + return currency; + } + + /** + * Setter for Currency. + * The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/) + * that identifies the currency. + * @param currency Value for String + */ + @JsonSetter("currency") + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Getter for Primary. + * Optional field representing if the currency is primary currency or not. + * @return Returns the Boolean + */ + @JsonGetter("primary") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getPrimary() { + return primary; + } + + /** + * Setter for Primary. + * Optional field representing if the currency is primary currency or not. + * @param primary Value for Boolean + */ + @JsonSetter("primary") + public void setPrimary(Boolean primary) { + this.primary = primary; + } + + /** + * Getter for TotalBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("total_balance") + public Money getTotalBalance() { + return totalBalance; + } + + /** + * Setter for TotalBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param totalBalance Value for Money + */ + @JsonSetter("total_balance") + public void setTotalBalance(Money totalBalance) { + this.totalBalance = totalBalance; + } + + /** + * Getter for AvailableBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("available_balance") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getAvailableBalance() { + return availableBalance; + } + + /** + * Setter for AvailableBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param availableBalance Value for Money + */ + @JsonSetter("available_balance") + public void setAvailableBalance(Money availableBalance) { + this.availableBalance = availableBalance; + } + + /** + * Getter for WithheldBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("withheld_balance") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getWithheldBalance() { + return withheldBalance; + } + + /** + * Setter for WithheldBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param withheldBalance Value for Money + */ + @JsonSetter("withheld_balance") + public void setWithheldBalance(Money withheldBalance) { + this.withheldBalance = withheldBalance; + } + + /** + * Converts this BalanceInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BalanceInformation [" + "currency=" + currency + ", totalBalance=" + totalBalance + + ", primary=" + primary + ", availableBalance=" + availableBalance + + ", withheldBalance=" + withheldBalance + "]"; + } + + /** + * Builds a new {@link BalanceInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BalanceInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(currency, totalBalance) + .primary(getPrimary()) + .availableBalance(getAvailableBalance()) + .withheldBalance(getWithheldBalance()); + return builder; + } + + /** + * Class to build instances of {@link BalanceInformation}. + */ + public static class Builder { + private String currency; + private Money totalBalance; + private Boolean primary; + private Money availableBalance; + private Money withheldBalance; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param currency String value for currency. + * @param totalBalance Money value for totalBalance. + */ + public Builder(String currency, Money totalBalance) { + this.currency = currency; + this.totalBalance = totalBalance; + } + + /** + * Setter for currency. + * @param currency String value for currency. + * @return Builder + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Setter for totalBalance. + * @param totalBalance Money value for totalBalance. + * @return Builder + */ + public Builder totalBalance(Money totalBalance) { + this.totalBalance = totalBalance; + return this; + } + + /** + * Setter for primary. + * @param primary Boolean value for primary. + * @return Builder + */ + public Builder primary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Setter for availableBalance. + * @param availableBalance Money value for availableBalance. + * @return Builder + */ + public Builder availableBalance(Money availableBalance) { + this.availableBalance = availableBalance; + return this; + } + + /** + * Setter for withheldBalance. + * @param withheldBalance Money value for withheldBalance. + * @return Builder + */ + public Builder withheldBalance(Money withheldBalance) { + this.withheldBalance = withheldBalance; + return this; + } + + /** + * Builds a new {@link BalanceInformation} object using the set fields. + * @return {@link BalanceInformation} + */ + public BalanceInformation build() { + return new BalanceInformation(currency, totalBalance, primary, availableBalance, + withheldBalance); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/BalancesResponse.java b/src/main/java/com/paypal/sdk/models/BalancesResponse.java new file mode 100644 index 0000000..cfa3fd6 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/BalancesResponse.java @@ -0,0 +1,230 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for BalancesResponse type. + */ +public class BalancesResponse { + private List balances; + private String accountId; + private String asOfTime; + private String lastRefreshTime; + + /** + * Default constructor. + */ + public BalancesResponse() { + } + + /** + * Initialization constructor. + * @param balances List of BalanceInformation value for balances. + * @param accountId String value for accountId. + * @param asOfTime String value for asOfTime. + * @param lastRefreshTime String value for lastRefreshTime. + */ + public BalancesResponse( + List balances, + String accountId, + String asOfTime, + String lastRefreshTime) { + this.balances = balances; + this.accountId = accountId; + this.asOfTime = asOfTime; + this.lastRefreshTime = lastRefreshTime; + } + + /** + * Getter for Balances. + * An array of balance detail objects. + * @return Returns the List of BalanceInformation + */ + @JsonGetter("balances") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getBalances() { + return balances; + } + + /** + * Setter for Balances. + * An array of balance detail objects. + * @param balances Value for List of BalanceInformation + */ + @JsonSetter("balances") + public void setBalances(List balances) { + this.balances = balances; + } + + /** + * Getter for AccountId. + * The PayPal payer ID, which is a masked version of the PayPal account number intended for use + * with third parties. The account number is reversibly encrypted and a proprietary variant of + * Base32 is used to encode the result. + * @return Returns the String + */ + @JsonGetter("account_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAccountId() { + return accountId; + } + + /** + * Setter for AccountId. + * The PayPal payer ID, which is a masked version of the PayPal account number intended for use + * with third parties. The account number is reversibly encrypted and a proprietary variant of + * Base32 is used to encode the result. + * @param accountId Value for String + */ + @JsonSetter("account_id") + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + /** + * Getter for AsOfTime. + * 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. + * @return Returns the String + */ + @JsonGetter("as_of_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAsOfTime() { + return asOfTime; + } + + /** + * Setter for AsOfTime. + * 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. + * @param asOfTime Value for String + */ + @JsonSetter("as_of_time") + public void setAsOfTime(String asOfTime) { + this.asOfTime = asOfTime; + } + + /** + * Getter for LastRefreshTime. + * 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. + * @return Returns the String + */ + @JsonGetter("last_refresh_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLastRefreshTime() { + return lastRefreshTime; + } + + /** + * Setter for LastRefreshTime. + * 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. + * @param lastRefreshTime Value for String + */ + @JsonSetter("last_refresh_time") + public void setLastRefreshTime(String lastRefreshTime) { + this.lastRefreshTime = lastRefreshTime; + } + + /** + * Converts this BalancesResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BalancesResponse [" + "balances=" + balances + ", accountId=" + accountId + + ", asOfTime=" + asOfTime + ", lastRefreshTime=" + lastRefreshTime + "]"; + } + + /** + * Builds a new {@link BalancesResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BalancesResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .balances(getBalances()) + .accountId(getAccountId()) + .asOfTime(getAsOfTime()) + .lastRefreshTime(getLastRefreshTime()); + return builder; + } + + /** + * Class to build instances of {@link BalancesResponse}. + */ + public static class Builder { + private List balances; + private String accountId; + private String asOfTime; + private String lastRefreshTime; + + + + /** + * Setter for balances. + * @param balances List of BalanceInformation value for balances. + * @return Builder + */ + public Builder balances(List balances) { + this.balances = balances; + return this; + } + + /** + * Setter for accountId. + * @param accountId String value for accountId. + * @return Builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Setter for asOfTime. + * @param asOfTime String value for asOfTime. + * @return Builder + */ + public Builder asOfTime(String asOfTime) { + this.asOfTime = asOfTime; + return this; + } + + /** + * Setter for lastRefreshTime. + * @param lastRefreshTime String value for lastRefreshTime. + * @return Builder + */ + public Builder lastRefreshTime(String lastRefreshTime) { + this.lastRefreshTime = lastRefreshTime; + return this; + } + + /** + * Builds a new {@link BalancesResponse} object using the set fields. + * @return {@link BalancesResponse} + */ + public BalancesResponse build() { + return new BalancesResponse(balances, accountId, asOfTime, lastRefreshTime); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/BankRequest.java b/src/main/java/com/paypal/sdk/models/BankRequest.java new file mode 100644 index 0000000..52b0fd4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/BankRequest.java @@ -0,0 +1,139 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.paypal.sdk.utilities.JsonValue; + +/** + * This is a model class for BankRequest type. + */ +public class BankRequest { + private JsonValue achDebit; + private SepaDebitRequest sepaDebit; + + /** + * Default constructor. + */ + public BankRequest() { + } + + /** + * Initialization constructor. + * @param achDebit JsonValue value for achDebit. + * @param sepaDebit SepaDebitRequest value for sepaDebit. + */ + public BankRequest( + JsonValue achDebit, + SepaDebitRequest sepaDebit) { + this.achDebit = achDebit; + this.sepaDebit = sepaDebit; + } + + /** + * Getter for AchDebit. + * A Resource representing a request to vault a ACH Debit. + * @return Returns the JsonValue + */ + @JsonGetter("ach_debit") + @JsonInclude(JsonInclude.Include.NON_NULL) + public JsonValue getAchDebit() { + return achDebit; + } + + /** + * Setter for AchDebit. + * A Resource representing a request to vault a ACH Debit. + * @param achDebit Value for JsonValue + */ + @JsonSetter("ach_debit") + public void setAchDebit(JsonValue achDebit) { + this.achDebit = achDebit; + } + + /** + * Getter for SepaDebit. + * An API resource denoting a request to securely store a SEPA Debit. + * @return Returns the SepaDebitRequest + */ + @JsonGetter("sepa_debit") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SepaDebitRequest getSepaDebit() { + return sepaDebit; + } + + /** + * Setter for SepaDebit. + * An API resource denoting a request to securely store a SEPA Debit. + * @param sepaDebit Value for SepaDebitRequest + */ + @JsonSetter("sepa_debit") + public void setSepaDebit(SepaDebitRequest sepaDebit) { + this.sepaDebit = sepaDebit; + } + + /** + * Converts this BankRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BankRequest [" + "achDebit=" + achDebit + ", sepaDebit=" + sepaDebit + "]"; + } + + /** + * Builds a new {@link BankRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BankRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .achDebit(getAchDebit()) + .sepaDebit(getSepaDebit()); + return builder; + } + + /** + * Class to build instances of {@link BankRequest}. + */ + public static class Builder { + private JsonValue achDebit; + private SepaDebitRequest sepaDebit; + + + + /** + * Setter for achDebit. + * @param achDebit JsonValue value for achDebit. + * @return Builder + */ + public Builder achDebit(JsonValue achDebit) { + this.achDebit = achDebit; + return this; + } + + /** + * Setter for sepaDebit. + * @param sepaDebit SepaDebitRequest value for sepaDebit. + * @return Builder + */ + public Builder sepaDebit(SepaDebitRequest sepaDebit) { + this.sepaDebit = sepaDebit; + return this; + } + + /** + * Builds a new {@link BankRequest} object using the set fields. + * @return {@link BankRequest} + */ + public BankRequest build() { + return new BankRequest(achDebit, sepaDebit); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/BillingCycle.java b/src/main/java/com/paypal/sdk/models/BillingCycle.java index 82d372b..803ae7b 100644 --- a/src/main/java/com/paypal/sdk/models/BillingCycle.java +++ b/src/main/java/com/paypal/sdk/models/BillingCycle.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; -import com.paypal.sdk.utilities.JsonValue; /** * This is a model class for BillingCycle type. @@ -17,7 +16,6 @@ public class BillingCycle { private TenureType tenureType; private PricingScheme pricingScheme; - private JsonValue frequency; private Integer totalCycles; private Integer sequence; private String startDate; @@ -34,7 +32,6 @@ public BillingCycle() { * Initialization constructor. * @param tenureType TenureType value for tenureType. * @param pricingScheme PricingScheme value for pricingScheme. - * @param frequency JsonValue value for frequency. * @param totalCycles Integer value for totalCycles. * @param sequence Integer value for sequence. * @param startDate String value for startDate. @@ -42,13 +39,11 @@ public BillingCycle() { public BillingCycle( TenureType tenureType, PricingScheme pricingScheme, - JsonValue frequency, Integer totalCycles, Integer sequence, String startDate) { this.tenureType = tenureType; this.pricingScheme = pricingScheme; - this.frequency = frequency; this.totalCycles = totalCycles; this.sequence = sequence; this.startDate = startDate; @@ -97,27 +92,6 @@ public void setPricingScheme(PricingScheme pricingScheme) { this.pricingScheme = pricingScheme; } - /** - * Getter for Frequency. - * The frequency details for this billing cycle. - * @return Returns the JsonValue - */ - @JsonGetter("frequency") - @JsonInclude(JsonInclude.Include.NON_NULL) - public JsonValue getFrequency() { - return frequency; - } - - /** - * Setter for Frequency. - * The frequency details for this billing cycle. - * @param frequency Value for JsonValue - */ - @JsonSetter("frequency") - public void setFrequency(JsonValue frequency) { - this.frequency = frequency; - } - /** * Getter for TotalCycles. * The number of times this billing cycle gets executed. Trial billing cycles can only be @@ -206,8 +180,8 @@ public void setStartDate(String startDate) { @Override public String toString() { return "BillingCycle [" + "tenureType=" + tenureType + ", pricingScheme=" + pricingScheme - + ", frequency=" + frequency + ", totalCycles=" + totalCycles + ", sequence=" - + sequence + ", startDate=" + startDate + "]"; + + ", totalCycles=" + totalCycles + ", sequence=" + sequence + ", startDate=" + + startDate + "]"; } /** @@ -218,7 +192,6 @@ public String toString() { public Builder toBuilder() { Builder builder = new Builder(tenureType) .pricingScheme(getPricingScheme()) - .frequency(getFrequency()) .totalCycles(getTotalCycles()) .sequence(getSequence()) .startDate(getStartDate()); @@ -231,7 +204,6 @@ public Builder toBuilder() { public static class Builder { private TenureType tenureType; private PricingScheme pricingScheme; - private JsonValue frequency; private Integer totalCycles = 1; private Integer sequence = 1; private String startDate; @@ -270,16 +242,6 @@ public Builder pricingScheme(PricingScheme pricingScheme) { return this; } - /** - * Setter for frequency. - * @param frequency JsonValue value for frequency. - * @return Builder - */ - public Builder frequency(JsonValue frequency) { - this.frequency = frequency; - return this; - } - /** * Setter for totalCycles. * @param totalCycles Integer value for totalCycles. @@ -315,8 +277,7 @@ public Builder startDate(String startDate) { * @return {@link BillingCycle} */ public BillingCycle build() { - return new BillingCycle(tenureType, pricingScheme, frequency, totalCycles, sequence, - startDate); + return new BillingCycle(tenureType, pricingScheme, totalCycles, sequence, startDate); } } } diff --git a/src/main/java/com/paypal/sdk/models/BillingCycleOverride.java b/src/main/java/com/paypal/sdk/models/BillingCycleOverride.java new file mode 100644 index 0000000..045303e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/BillingCycleOverride.java @@ -0,0 +1,196 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for BillingCycleOverride type. + */ +public class BillingCycleOverride { + private SubscriptionPricingScheme pricingScheme; + private int sequence; + private Integer totalCycles; + + /** + * Default constructor. + */ + public BillingCycleOverride() { + } + + /** + * Initialization constructor. + * @param sequence int value for sequence. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + * @param totalCycles Integer value for totalCycles. + */ + public BillingCycleOverride( + int sequence, + SubscriptionPricingScheme pricingScheme, + Integer totalCycles) { + this.pricingScheme = pricingScheme; + this.sequence = sequence; + this.totalCycles = totalCycles; + } + + /** + * Getter for PricingScheme. + * The pricing scheme details. + * @return Returns the SubscriptionPricingScheme + */ + @JsonGetter("pricing_scheme") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPricingScheme getPricingScheme() { + return pricingScheme; + } + + /** + * Setter for PricingScheme. + * The pricing scheme details. + * @param pricingScheme Value for SubscriptionPricingScheme + */ + @JsonSetter("pricing_scheme") + public void setPricingScheme(SubscriptionPricingScheme pricingScheme) { + this.pricingScheme = pricingScheme; + } + + /** + * Getter for Sequence. + * 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. + * @return Returns the int + */ + @JsonGetter("sequence") + public int getSequence() { + return sequence; + } + + /** + * Setter for Sequence. + * 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. + * @param sequence Value for int + */ + @JsonSetter("sequence") + public void setSequence(int sequence) { + this.sequence = sequence; + } + + /** + * Getter for TotalCycles. + * 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). + * @return Returns the Integer + */ + @JsonGetter("total_cycles") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalCycles() { + return totalCycles; + } + + /** + * Setter for TotalCycles. + * 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). + * @param totalCycles Value for Integer + */ + @JsonSetter("total_cycles") + public void setTotalCycles(Integer totalCycles) { + this.totalCycles = totalCycles; + } + + /** + * Converts this BillingCycleOverride into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BillingCycleOverride [" + "sequence=" + sequence + ", pricingScheme=" + + pricingScheme + ", totalCycles=" + totalCycles + "]"; + } + + /** + * Builds a new {@link BillingCycleOverride.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BillingCycleOverride.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(sequence) + .pricingScheme(getPricingScheme()) + .totalCycles(getTotalCycles()); + return builder; + } + + /** + * Class to build instances of {@link BillingCycleOverride}. + */ + public static class Builder { + private int sequence; + private SubscriptionPricingScheme pricingScheme; + private Integer totalCycles; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param sequence int value for sequence. + */ + public Builder(int sequence) { + this.sequence = sequence; + } + + /** + * Setter for sequence. + * @param sequence int value for sequence. + * @return Builder + */ + public Builder sequence(int sequence) { + this.sequence = sequence; + return this; + } + + /** + * Setter for pricingScheme. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + * @return Builder + */ + public Builder pricingScheme(SubscriptionPricingScheme pricingScheme) { + this.pricingScheme = pricingScheme; + return this; + } + + /** + * Setter for totalCycles. + * @param totalCycles Integer value for totalCycles. + * @return Builder + */ + public Builder totalCycles(Integer totalCycles) { + this.totalCycles = totalCycles; + return this; + } + + /** + * Builds a new {@link BillingCycleOverride} object using the set fields. + * @return {@link BillingCycleOverride} + */ + public BillingCycleOverride build() { + return new BillingCycleOverride(sequence, pricingScheme, totalCycles); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/BillingPlan.java b/src/main/java/com/paypal/sdk/models/BillingPlan.java new file mode 100644 index 0000000..be99306 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/BillingPlan.java @@ -0,0 +1,572 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for BillingPlan type. + */ +public class BillingPlan { + private String id; + private String productId; + private String name; + private SubscriptionPlanStatus status; + private String description; + private List billingCycles; + private PaymentPreferences paymentPreferences; + private MerchantPreferences merchantPreferences; + private Taxes taxes; + private Boolean quantitySupported; + private String createTime; + private String updateTime; + private List links; + + /** + * Default constructor. + */ + public BillingPlan() { + quantitySupported = false; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param productId String value for productId. + * @param name String value for name. + * @param status SubscriptionPlanStatus value for status. + * @param description String value for description. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + * @param merchantPreferences MerchantPreferences value for merchantPreferences. + * @param taxes Taxes value for taxes. + * @param quantitySupported Boolean value for quantitySupported. + * @param createTime String value for createTime. + * @param updateTime String value for updateTime. + * @param links List of LinkDescription value for links. + */ + public BillingPlan( + String id, + String productId, + String name, + SubscriptionPlanStatus status, + String description, + List billingCycles, + PaymentPreferences paymentPreferences, + MerchantPreferences merchantPreferences, + Taxes taxes, + Boolean quantitySupported, + String createTime, + String updateTime, + List links) { + this.id = id; + this.productId = productId; + this.name = name; + this.status = status; + this.description = description; + this.billingCycles = billingCycles; + this.paymentPreferences = paymentPreferences; + this.merchantPreferences = merchantPreferences; + this.taxes = taxes; + this.quantitySupported = quantitySupported; + this.createTime = createTime; + this.updateTime = updateTime; + this.links = links; + } + + /** + * Getter for Id. + * The unique PayPal-generated ID for the plan. + * @return Returns the String + */ + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getId() { + return id; + } + + /** + * Setter for Id. + * The unique PayPal-generated ID for the plan. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ProductId. + * The ID for the product. + * @return Returns the String + */ + @JsonGetter("product_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getProductId() { + return productId; + } + + /** + * Setter for ProductId. + * The ID for the product. + * @param productId Value for String + */ + @JsonSetter("product_id") + public void setProductId(String productId) { + this.productId = productId; + } + + /** + * Getter for Name. + * The plan name. + * @return Returns the String + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getName() { + return name; + } + + /** + * Setter for Name. + * The plan name. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for Status. + * The plan status. + * @return Returns the SubscriptionPlanStatus + */ + @JsonGetter("status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPlanStatus getStatus() { + return status; + } + + /** + * Setter for Status. + * The plan status. + * @param status Value for SubscriptionPlanStatus + */ + @JsonSetter("status") + public void setStatus(SubscriptionPlanStatus status) { + this.status = status; + } + + /** + * Getter for Description. + * The detailed description of the plan. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * The detailed description of the plan. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. A plan can have at most two + * trial cycles and only one regular cycle. + * @return Returns the List of SubscriptionBillingCycle + */ + @JsonGetter("billing_cycles") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getBillingCycles() { + return billingCycles; + } + + /** + * Setter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. A plan can have at most two + * trial cycles and only one regular cycle. + * @param billingCycles Value for List of SubscriptionBillingCycle + */ + @JsonSetter("billing_cycles") + public void setBillingCycles(List billingCycles) { + this.billingCycles = billingCycles; + } + + /** + * Getter for PaymentPreferences. + * The payment preferences for a subscription. + * @return Returns the PaymentPreferences + */ + @JsonGetter("payment_preferences") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PaymentPreferences getPaymentPreferences() { + return paymentPreferences; + } + + /** + * Setter for PaymentPreferences. + * The payment preferences for a subscription. + * @param paymentPreferences Value for PaymentPreferences + */ + @JsonSetter("payment_preferences") + public void setPaymentPreferences(PaymentPreferences paymentPreferences) { + this.paymentPreferences = paymentPreferences; + } + + /** + * Getter for MerchantPreferences. + * The merchant preferences for a subscription. + * @return Returns the MerchantPreferences + */ + @JsonGetter("merchant_preferences") + @JsonInclude(JsonInclude.Include.NON_NULL) + public MerchantPreferences getMerchantPreferences() { + return merchantPreferences; + } + + /** + * Setter for MerchantPreferences. + * The merchant preferences for a subscription. + * @param merchantPreferences Value for MerchantPreferences + */ + @JsonSetter("merchant_preferences") + public void setMerchantPreferences(MerchantPreferences merchantPreferences) { + this.merchantPreferences = merchantPreferences; + } + + /** + * Getter for Taxes. + * The tax details. + * @return Returns the Taxes + */ + @JsonGetter("taxes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Taxes getTaxes() { + return taxes; + } + + /** + * Setter for Taxes. + * The tax details. + * @param taxes Value for Taxes + */ + @JsonSetter("taxes") + public void setTaxes(Taxes taxes) { + this.taxes = taxes; + } + + /** + * Getter for QuantitySupported. + * Indicates whether you can subscribe to this plan by providing a quantity for the goods or + * service. + * @return Returns the Boolean + */ + @JsonGetter("quantity_supported") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getQuantitySupported() { + return quantitySupported; + } + + /** + * Setter for QuantitySupported. + * Indicates whether you can subscribe to this plan by providing a quantity for the goods or + * service. + * @param quantitySupported Value for Boolean + */ + @JsonSetter("quantity_supported") + public void setQuantitySupported(Boolean quantitySupported) { + this.quantitySupported = quantitySupported; + } + + /** + * Getter for CreateTime. + * 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. + * @return Returns the String + */ + @JsonGetter("create_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreateTime() { + return createTime; + } + + /** + * Setter for CreateTime. + * 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. + * @param createTime Value for String + */ + @JsonSetter("create_time") + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + /** + * Getter for UpdateTime. + * 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. + * @return Returns the String + */ + @JsonGetter("update_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUpdateTime() { + return updateTime; + } + + /** + * Setter for UpdateTime. + * 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. + * @param updateTime Value for String + */ + @JsonSetter("update_time") + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this BillingPlan into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "BillingPlan [" + "id=" + id + ", productId=" + productId + ", name=" + name + + ", status=" + status + ", description=" + description + ", billingCycles=" + + billingCycles + ", paymentPreferences=" + paymentPreferences + + ", merchantPreferences=" + merchantPreferences + ", taxes=" + taxes + + ", quantitySupported=" + quantitySupported + ", createTime=" + createTime + + ", updateTime=" + updateTime + ", links=" + links + "]"; + } + + /** + * Builds a new {@link BillingPlan.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link BillingPlan.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .id(getId()) + .productId(getProductId()) + .name(getName()) + .status(getStatus()) + .description(getDescription()) + .billingCycles(getBillingCycles()) + .paymentPreferences(getPaymentPreferences()) + .merchantPreferences(getMerchantPreferences()) + .taxes(getTaxes()) + .quantitySupported(getQuantitySupported()) + .createTime(getCreateTime()) + .updateTime(getUpdateTime()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link BillingPlan}. + */ + public static class Builder { + private String id; + private String productId; + private String name; + private SubscriptionPlanStatus status; + private String description; + private List billingCycles; + private PaymentPreferences paymentPreferences; + private MerchantPreferences merchantPreferences; + private Taxes taxes; + private Boolean quantitySupported = false; + private String createTime; + private String updateTime; + private List links; + + + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for productId. + * @param productId String value for productId. + * @return Builder + */ + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for status. + * @param status SubscriptionPlanStatus value for status. + * @return Builder + */ + public Builder status(SubscriptionPlanStatus status) { + this.status = status; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Setter for billingCycles. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @return Builder + */ + public Builder billingCycles(List billingCycles) { + this.billingCycles = billingCycles; + return this; + } + + /** + * Setter for paymentPreferences. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + * @return Builder + */ + public Builder paymentPreferences(PaymentPreferences paymentPreferences) { + this.paymentPreferences = paymentPreferences; + return this; + } + + /** + * Setter for merchantPreferences. + * @param merchantPreferences MerchantPreferences value for merchantPreferences. + * @return Builder + */ + public Builder merchantPreferences(MerchantPreferences merchantPreferences) { + this.merchantPreferences = merchantPreferences; + return this; + } + + /** + * Setter for taxes. + * @param taxes Taxes value for taxes. + * @return Builder + */ + public Builder taxes(Taxes taxes) { + this.taxes = taxes; + return this; + } + + /** + * Setter for quantitySupported. + * @param quantitySupported Boolean value for quantitySupported. + * @return Builder + */ + public Builder quantitySupported(Boolean quantitySupported) { + this.quantitySupported = quantitySupported; + return this; + } + + /** + * Setter for createTime. + * @param createTime String value for createTime. + * @return Builder + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + /** + * Setter for updateTime. + * @param updateTime String value for updateTime. + * @return Builder + */ + public Builder updateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link BillingPlan} object using the set fields. + * @return {@link BillingPlan} + */ + public BillingPlan build() { + return new BillingPlan(id, productId, name, status, description, billingCycles, + paymentPreferences, merchantPreferences, taxes, quantitySupported, createTime, + updateTime, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/BlikExperienceContext.java b/src/main/java/com/paypal/sdk/models/BlikExperienceContext.java index e85e48a..496ff81 100644 --- a/src/main/java/com/paypal/sdk/models/BlikExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/BlikExperienceContext.java @@ -16,7 +16,7 @@ public class BlikExperienceContext { private String brandName; private String locale; - private ShippingPreference shippingPreference; + private ExperienceContextShippingPreference shippingPreference; private String returnUrl; private String cancelUrl; private String consumerIp; @@ -26,14 +26,14 @@ public class BlikExperienceContext { * Default constructor. */ public BlikExperienceContext() { - shippingPreference = ShippingPreference.GET_FROM_FILE; + shippingPreference = ExperienceContextShippingPreference.GET_FROM_FILE; } /** * Initialization constructor. * @param brandName String value for brandName. * @param locale String value for locale. - * @param shippingPreference ShippingPreference value for shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for shippingPreference. * @param returnUrl String value for returnUrl. * @param cancelUrl String value for cancelUrl. * @param consumerIp String value for consumerIp. @@ -42,7 +42,7 @@ public BlikExperienceContext() { public BlikExperienceContext( String brandName, String locale, - ShippingPreference shippingPreference, + ExperienceContextShippingPreference shippingPreference, String returnUrl, String cancelUrl, String consumerIp, @@ -115,21 +115,21 @@ public void setLocale(String locale) { /** * Getter for ShippingPreference. * The location from which the shipping address is derived. - * @return Returns the ShippingPreference + * @return Returns the ExperienceContextShippingPreference */ @JsonGetter("shipping_preference") @JsonInclude(JsonInclude.Include.NON_NULL) - public ShippingPreference getShippingPreference() { + public ExperienceContextShippingPreference getShippingPreference() { return shippingPreference; } /** * Setter for ShippingPreference. * The location from which the shipping address is derived. - * @param shippingPreference Value for ShippingPreference + * @param shippingPreference Value for ExperienceContextShippingPreference */ @JsonSetter("shipping_preference") - public void setShippingPreference(ShippingPreference shippingPreference) { + public void setShippingPreference(ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; } @@ -256,7 +256,8 @@ public Builder toBuilder() { public static class Builder { private String brandName; private String locale; - private ShippingPreference shippingPreference = ShippingPreference.GET_FROM_FILE; + private ExperienceContextShippingPreference shippingPreference = + ExperienceContextShippingPreference.GET_FROM_FILE; private String returnUrl; private String cancelUrl; private String consumerIp; @@ -286,10 +287,12 @@ public Builder locale(String locale) { /** * Setter for shippingPreference. - * @param shippingPreference ShippingPreference value for shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for + * shippingPreference. * @return Builder */ - public Builder shippingPreference(ShippingPreference shippingPreference) { + public Builder shippingPreference( + ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/CancelSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/CancelSubscriptionInput.java new file mode 100644 index 0000000..cd5df88 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CancelSubscriptionInput.java @@ -0,0 +1,183 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CancelSubscriptionInput type. + */ +public class CancelSubscriptionInput { + private String id; + private String contentType; + private CancelSubscriptionRequest body; + + /** + * Default constructor. + */ + public CancelSubscriptionInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body CancelSubscriptionRequest value for body. + */ + public CancelSubscriptionInput( + String id, + String contentType, + CancelSubscriptionRequest body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the CancelSubscriptionRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CancelSubscriptionRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for CancelSubscriptionRequest + */ + @JsonSetter("body") + public void setBody(CancelSubscriptionRequest body) { + this.body = body; + } + + /** + * Converts this CancelSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CancelSubscriptionInput [" + "id=" + id + ", contentType=" + contentType + ", body=" + + body + "]"; + } + + /** + * Builds a new {@link CancelSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CancelSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link CancelSubscriptionInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private CancelSubscriptionRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body CancelSubscriptionRequest value for body. + * @return Builder + */ + public Builder body(CancelSubscriptionRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link CancelSubscriptionInput} object using the set fields. + * @return {@link CancelSubscriptionInput} + */ + public CancelSubscriptionInput build() { + return new CancelSubscriptionInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CancelSubscriptionRequest.java b/src/main/java/com/paypal/sdk/models/CancelSubscriptionRequest.java new file mode 100644 index 0000000..03cf690 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CancelSubscriptionRequest.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CancelSubscriptionRequest type. + */ +public class CancelSubscriptionRequest { + private String reason; + + /** + * Default constructor. + */ + public CancelSubscriptionRequest() { + } + + /** + * Initialization constructor. + * @param reason String value for reason. + */ + public CancelSubscriptionRequest( + String reason) { + this.reason = reason; + } + + /** + * Getter for Reason. + * The reason for the cancellation of a subscription. + * @return Returns the String + */ + @JsonGetter("reason") + public String getReason() { + return reason; + } + + /** + * Setter for Reason. + * The reason for the cancellation of a subscription. + * @param reason Value for String + */ + @JsonSetter("reason") + public void setReason(String reason) { + this.reason = reason; + } + + /** + * Converts this CancelSubscriptionRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CancelSubscriptionRequest [" + "reason=" + reason + "]"; + } + + /** + * Builds a new {@link CancelSubscriptionRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CancelSubscriptionRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(reason); + return builder; + } + + /** + * Class to build instances of {@link CancelSubscriptionRequest}. + */ + public static class Builder { + private String reason; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param reason String value for reason. + */ + public Builder(String reason) { + this.reason = reason; + } + + /** + * Setter for reason. + * @param reason String value for reason. + * @return Builder + */ + public Builder reason(String reason) { + this.reason = reason; + return this; + } + + /** + * Builds a new {@link CancelSubscriptionRequest} object using the set fields. + * @return {@link CancelSubscriptionRequest} + */ + public CancelSubscriptionRequest build() { + return new CancelSubscriptionRequest(reason); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CaptureRequest.java b/src/main/java/com/paypal/sdk/models/CaptureRequest.java index 1798940..461ca26 100644 --- a/src/main/java/com/paypal/sdk/models/CaptureRequest.java +++ b/src/main/java/com/paypal/sdk/models/CaptureRequest.java @@ -14,11 +14,11 @@ * This is a model class for CaptureRequest type. */ public class CaptureRequest { - private String invoiceId; - private String noteToPayer; private Money amount; + private String invoiceId; private Boolean finalCapture; private CapturePaymentInstruction paymentInstruction; + private String noteToPayer; private String softDescriptor; /** @@ -30,28 +30,49 @@ public CaptureRequest() { /** * Initialization constructor. - * @param invoiceId String value for invoiceId. - * @param noteToPayer String value for noteToPayer. * @param amount Money value for amount. + * @param invoiceId String value for invoiceId. * @param finalCapture Boolean value for finalCapture. * @param paymentInstruction CapturePaymentInstruction value for paymentInstruction. + * @param noteToPayer String value for noteToPayer. * @param softDescriptor String value for softDescriptor. */ public CaptureRequest( - String invoiceId, - String noteToPayer, Money amount, + String invoiceId, Boolean finalCapture, CapturePaymentInstruction paymentInstruction, + String noteToPayer, String softDescriptor) { - this.invoiceId = invoiceId; - this.noteToPayer = noteToPayer; this.amount = amount; + this.invoiceId = invoiceId; this.finalCapture = finalCapture; this.paymentInstruction = paymentInstruction; + this.noteToPayer = noteToPayer; this.softDescriptor = softDescriptor; } + /** + * Getter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param amount Value for Money + */ + @JsonSetter("amount") + public void setAmount(Money amount) { + this.amount = amount; + } + /** * Getter for InvoiceId. * The API caller-provided external invoice number for this order. Appears in both the payer's @@ -75,50 +96,6 @@ public void setInvoiceId(String invoiceId) { this.invoiceId = invoiceId; } - /** - * Getter for NoteToPayer. - * An informational note about this settlement. Appears in both the payer's transaction history - * and the emails that the payer receives. - * @return Returns the String - */ - @JsonGetter("note_to_payer") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getNoteToPayer() { - return noteToPayer; - } - - /** - * Setter for NoteToPayer. - * An informational note about this settlement. Appears in both the payer's transaction history - * and the emails that the payer receives. - * @param noteToPayer Value for String - */ - @JsonSetter("note_to_payer") - public void setNoteToPayer(String noteToPayer) { - this.noteToPayer = noteToPayer; - } - - /** - * Getter for Amount. - * The currency and amount for a financial transaction, such as a balance or payment due. - * @return Returns the Money - */ - @JsonGetter("amount") - @JsonInclude(JsonInclude.Include.NON_NULL) - public Money getAmount() { - return amount; - } - - /** - * Setter for Amount. - * The currency and amount for a financial transaction, such as a balance or payment due. - * @param amount Value for Money - */ - @JsonSetter("amount") - public void setAmount(Money amount) { - this.amount = amount; - } - /** * Getter for FinalCapture. * Indicates whether you can make additional captures against the authorized payment. Set to @@ -167,6 +144,29 @@ public void setPaymentInstruction(CapturePaymentInstruction paymentInstruction) this.paymentInstruction = paymentInstruction; } + /** + * Getter for NoteToPayer. + * An informational note about this settlement. Appears in both the payer's transaction history + * and the emails that the payer receives. + * @return Returns the String + */ + @JsonGetter("note_to_payer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getNoteToPayer() { + return noteToPayer; + } + + /** + * Setter for NoteToPayer. + * An informational note about this settlement. Appears in both the payer's transaction history + * and the emails that the payer receives. + * @param noteToPayer Value for String + */ + @JsonSetter("note_to_payer") + public void setNoteToPayer(String noteToPayer) { + this.noteToPayer = noteToPayer; + } + /** * Getter for SoftDescriptor. * The payment descriptor on the payer's account statement. @@ -194,9 +194,9 @@ public void setSoftDescriptor(String softDescriptor) { */ @Override public String toString() { - return "CaptureRequest [" + "invoiceId=" + invoiceId + ", noteToPayer=" + noteToPayer - + ", amount=" + amount + ", finalCapture=" + finalCapture + ", paymentInstruction=" - + paymentInstruction + ", softDescriptor=" + softDescriptor + "]"; + return "CaptureRequest [" + "amount=" + amount + ", invoiceId=" + invoiceId + + ", finalCapture=" + finalCapture + ", paymentInstruction=" + paymentInstruction + + ", noteToPayer=" + noteToPayer + ", softDescriptor=" + softDescriptor + "]"; } /** @@ -206,11 +206,11 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder() - .invoiceId(getInvoiceId()) - .noteToPayer(getNoteToPayer()) .amount(getAmount()) + .invoiceId(getInvoiceId()) .finalCapture(getFinalCapture()) .paymentInstruction(getPaymentInstruction()) + .noteToPayer(getNoteToPayer()) .softDescriptor(getSoftDescriptor()); return builder; } @@ -219,42 +219,32 @@ public Builder toBuilder() { * Class to build instances of {@link CaptureRequest}. */ public static class Builder { - private String invoiceId; - private String noteToPayer; private Money amount; + private String invoiceId; private Boolean finalCapture = false; private CapturePaymentInstruction paymentInstruction; + private String noteToPayer; private String softDescriptor; /** - * Setter for invoiceId. - * @param invoiceId String value for invoiceId. - * @return Builder - */ - public Builder invoiceId(String invoiceId) { - this.invoiceId = invoiceId; - return this; - } - - /** - * Setter for noteToPayer. - * @param noteToPayer String value for noteToPayer. + * Setter for amount. + * @param amount Money value for amount. * @return Builder */ - public Builder noteToPayer(String noteToPayer) { - this.noteToPayer = noteToPayer; + public Builder amount(Money amount) { + this.amount = amount; return this; } /** - * Setter for amount. - * @param amount Money value for amount. + * Setter for invoiceId. + * @param invoiceId String value for invoiceId. * @return Builder */ - public Builder amount(Money amount) { - this.amount = amount; + public Builder invoiceId(String invoiceId) { + this.invoiceId = invoiceId; return this; } @@ -278,6 +268,16 @@ public Builder paymentInstruction(CapturePaymentInstruction paymentInstruction) return this; } + /** + * Setter for noteToPayer. + * @param noteToPayer String value for noteToPayer. + * @return Builder + */ + public Builder noteToPayer(String noteToPayer) { + this.noteToPayer = noteToPayer; + return this; + } + /** * Setter for softDescriptor. * @param softDescriptor String value for softDescriptor. @@ -293,8 +293,8 @@ public Builder softDescriptor(String softDescriptor) { * @return {@link CaptureRequest} */ public CaptureRequest build() { - return new CaptureRequest(invoiceId, noteToPayer, amount, finalCapture, - paymentInstruction, softDescriptor); + return new CaptureRequest(amount, invoiceId, finalCapture, paymentInstruction, + noteToPayer, softDescriptor); } } } diff --git a/src/main/java/com/paypal/sdk/models/CaptureSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/CaptureSubscriptionInput.java new file mode 100644 index 0000000..2392e43 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CaptureSubscriptionInput.java @@ -0,0 +1,220 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CaptureSubscriptionInput type. + */ +public class CaptureSubscriptionInput { + private String id; + private String contentType; + private String paypalRequestId; + private CaptureSubscriptionRequest body; + + /** + * Default constructor. + */ + public CaptureSubscriptionInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param paypalRequestId String value for paypalRequestId. + * @param body CaptureSubscriptionRequest value for body. + */ + public CaptureSubscriptionInput( + String id, + String contentType, + String paypalRequestId, + CaptureSubscriptionRequest body) { + this.id = id; + this.contentType = contentType; + this.paypalRequestId = paypalRequestId; + this.body = body; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for PaypalRequestId. + * The server stores keys for 72 hours. + * @return Returns the String + */ + @JsonGetter("PayPal-Request-Id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalRequestId() { + return paypalRequestId; + } + + /** + * Setter for PaypalRequestId. + * The server stores keys for 72 hours. + * @param paypalRequestId Value for String + */ + @JsonSetter("PayPal-Request-Id") + public void setPaypalRequestId(String paypalRequestId) { + this.paypalRequestId = paypalRequestId; + } + + /** + * Getter for Body. + * @return Returns the CaptureSubscriptionRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CaptureSubscriptionRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for CaptureSubscriptionRequest + */ + @JsonSetter("body") + public void setBody(CaptureSubscriptionRequest body) { + this.body = body; + } + + /** + * Converts this CaptureSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CaptureSubscriptionInput [" + "id=" + id + ", contentType=" + contentType + + ", paypalRequestId=" + paypalRequestId + ", body=" + body + "]"; + } + + /** + * Builds a new {@link CaptureSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CaptureSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .paypalRequestId(getPaypalRequestId()) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link CaptureSubscriptionInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private String paypalRequestId; + private CaptureSubscriptionRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for paypalRequestId. + * @param paypalRequestId String value for paypalRequestId. + * @return Builder + */ + public Builder paypalRequestId(String paypalRequestId) { + this.paypalRequestId = paypalRequestId; + return this; + } + + /** + * Setter for body. + * @param body CaptureSubscriptionRequest value for body. + * @return Builder + */ + public Builder body(CaptureSubscriptionRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link CaptureSubscriptionInput} object using the set fields. + * @return {@link CaptureSubscriptionInput} + */ + public CaptureSubscriptionInput build() { + return new CaptureSubscriptionInput(id, contentType, paypalRequestId, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CaptureSubscriptionRequest.java b/src/main/java/com/paypal/sdk/models/CaptureSubscriptionRequest.java new file mode 100644 index 0000000..6e8da0f --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CaptureSubscriptionRequest.java @@ -0,0 +1,185 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CaptureSubscriptionRequest type. + */ +public class CaptureSubscriptionRequest { + private String note; + private CaptureType captureType; + private Money amount; + + /** + * Default constructor. + */ + public CaptureSubscriptionRequest() { + } + + /** + * Initialization constructor. + * @param note String value for note. + * @param captureType CaptureType value for captureType. + * @param amount Money value for amount. + */ + public CaptureSubscriptionRequest( + String note, + CaptureType captureType, + Money amount) { + this.note = note; + this.captureType = captureType; + this.amount = amount; + } + + /** + * Getter for Note. + * The reason or note for the subscription charge. + * @return Returns the String + */ + @JsonGetter("note") + public String getNote() { + return note; + } + + /** + * Setter for Note. + * The reason or note for the subscription charge. + * @param note Value for String + */ + @JsonSetter("note") + public void setNote(String note) { + this.note = note; + } + + /** + * Getter for CaptureType. + * The type of capture. + * @return Returns the CaptureType + */ + @JsonGetter("capture_type") + public CaptureType getCaptureType() { + return captureType; + } + + /** + * Setter for CaptureType. + * The type of capture. + * @param captureType Value for CaptureType + */ + @JsonSetter("capture_type") + public void setCaptureType(CaptureType captureType) { + this.captureType = captureType; + } + + /** + * Getter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("amount") + public Money getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param amount Value for Money + */ + @JsonSetter("amount") + public void setAmount(Money amount) { + this.amount = amount; + } + + /** + * Converts this CaptureSubscriptionRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CaptureSubscriptionRequest [" + "note=" + note + ", captureType=" + captureType + + ", amount=" + amount + "]"; + } + + /** + * Builds a new {@link CaptureSubscriptionRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CaptureSubscriptionRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(note, captureType, amount); + return builder; + } + + /** + * Class to build instances of {@link CaptureSubscriptionRequest}. + */ + public static class Builder { + private String note; + private CaptureType captureType; + private Money amount; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param note String value for note. + * @param captureType CaptureType value for captureType. + * @param amount Money value for amount. + */ + public Builder(String note, CaptureType captureType, Money amount) { + this.note = note; + this.captureType = captureType; + this.amount = amount; + } + + /** + * Setter for note. + * @param note String value for note. + * @return Builder + */ + public Builder note(String note) { + this.note = note; + return this; + } + + /** + * Setter for captureType. + * @param captureType CaptureType value for captureType. + * @return Builder + */ + public Builder captureType(CaptureType captureType) { + this.captureType = captureType; + return this; + } + + /** + * Setter for amount. + * @param amount Money value for amount. + * @return Builder + */ + public Builder amount(Money amount) { + this.amount = amount; + return this; + } + + /** + * Builds a new {@link CaptureSubscriptionRequest} object using the set fields. + * @return {@link CaptureSubscriptionRequest} + */ + public CaptureSubscriptionRequest build() { + return new CaptureSubscriptionRequest(note, captureType, amount); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CaptureType.java b/src/main/java/com/paypal/sdk/models/CaptureType.java new file mode 100644 index 0000000..5891100 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CaptureType.java @@ -0,0 +1,103 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * CaptureType to be used. + */ +public enum CaptureType { + /** + * The outstanding balance that the subscriber must clear. + */ + OUTSTANDING_BALANCE, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + OUTSTANDING_BALANCE.value = "OUTSTANDING_BALANCE"; + _UNKNOWN.value = null; + + valueMap.put("OUTSTANDING_BALANCE", OUTSTANDING_BALANCE); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static CaptureType constructFromString(String toConvert) throws IOException { + CaptureType enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static CaptureType fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of CaptureType values to list of string values. + * @param toConvert The list of CaptureType values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (CaptureType enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/CapturedPayment.java b/src/main/java/com/paypal/sdk/models/CapturedPayment.java index 04cd512..c2d80d3 100644 --- a/src/main/java/com/paypal/sdk/models/CapturedPayment.java +++ b/src/main/java/com/paypal/sdk/models/CapturedPayment.java @@ -21,13 +21,13 @@ public class CapturedPayment { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private Boolean finalCapture; private SellerReceivableBreakdown sellerReceivableBreakdown; private DisbursementMode disbursementMode; private List links; - private PaymentsProcessorResponse processorResponse; + private ProcessorResponse processorResponse; private String createTime; private String updateTime; private PaymentSupplementaryData supplementaryData; @@ -49,7 +49,7 @@ public CapturedPayment() { * @param amount Money value for amount. * @param invoiceId String value for invoiceId. * @param customId String value for customId. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @param sellerProtection SellerProtection value for sellerProtection. * @param finalCapture Boolean value for finalCapture. @@ -57,7 +57,7 @@ public CapturedPayment() { * sellerReceivableBreakdown. * @param disbursementMode DisbursementMode value for disbursementMode. * @param links List of LinkDescription value for links. - * @param processorResponse PaymentsProcessorResponse value for processorResponse. + * @param processorResponse ProcessorResponse value for processorResponse. * @param createTime String value for createTime. * @param updateTime String value for updateTime. * @param supplementaryData PaymentSupplementaryData value for supplementaryData. @@ -70,13 +70,13 @@ public CapturedPayment( Money amount, String invoiceId, String customId, - NetworkTransactionReference networkTransactionReference, + NetworkTransaction networkTransactionReference, SellerProtection sellerProtection, Boolean finalCapture, SellerReceivableBreakdown sellerReceivableBreakdown, DisbursementMode disbursementMode, List links, - PaymentsProcessorResponse processorResponse, + ProcessorResponse processorResponse, String createTime, String updateTime, PaymentSupplementaryData supplementaryData, @@ -233,21 +233,21 @@ public void setCustomId(String customId) { /** * Getter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getNetworkTransactionReference() { + public NetworkTransaction getNetworkTransactionReference() { return networkTransactionReference; } /** * Setter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param networkTransactionReference Value for NetworkTransactionReference + * @param networkTransactionReference Value for NetworkTransaction */ @JsonSetter("network_transaction_reference") - public void setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) { + public void setNetworkTransactionReference(NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; } @@ -368,11 +368,11 @@ public void setLinks(List links) { * Getter for ProcessorResponse. * The processor response information for payment requests, such as direct credit card * transactions. - * @return Returns the PaymentsProcessorResponse + * @return Returns the ProcessorResponse */ @JsonGetter("processor_response") @JsonInclude(JsonInclude.Include.NON_NULL) - public PaymentsProcessorResponse getProcessorResponse() { + public ProcessorResponse getProcessorResponse() { return processorResponse; } @@ -380,10 +380,10 @@ public PaymentsProcessorResponse getProcessorResponse() { * Setter for ProcessorResponse. * The processor response information for payment requests, such as direct credit card * transactions. - * @param processorResponse Value for PaymentsProcessorResponse + * @param processorResponse Value for ProcessorResponse */ @JsonSetter("processor_response") - public void setProcessorResponse(PaymentsProcessorResponse processorResponse) { + public void setProcessorResponse(ProcessorResponse processorResponse) { this.processorResponse = processorResponse; } @@ -538,13 +538,13 @@ public static class Builder { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private Boolean finalCapture = false; private SellerReceivableBreakdown sellerReceivableBreakdown; private DisbursementMode disbursementMode = DisbursementMode.INSTANT; private List links; - private PaymentsProcessorResponse processorResponse; + private ProcessorResponse processorResponse; private String createTime; private String updateTime; private PaymentSupplementaryData supplementaryData; @@ -614,12 +614,12 @@ public Builder customId(String customId) { /** * Setter for networkTransactionReference. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @return Builder */ public Builder networkTransactionReference( - NetworkTransactionReference networkTransactionReference) { + NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; return this; } @@ -678,10 +678,10 @@ public Builder links(List links) { /** * Setter for processorResponse. - * @param processorResponse PaymentsProcessorResponse value for processorResponse. + * @param processorResponse ProcessorResponse value for processorResponse. * @return Builder */ - public Builder processorResponse(PaymentsProcessorResponse processorResponse) { + public Builder processorResponse(ProcessorResponse processorResponse) { this.processorResponse = processorResponse; return this; } diff --git a/src/main/java/com/paypal/sdk/models/CardBrand.java b/src/main/java/com/paypal/sdk/models/CardBrand.java index a437eb7..da09f62 100644 --- a/src/main/java/com/paypal/sdk/models/CardBrand.java +++ b/src/main/java/com/paypal/sdk/models/CardBrand.java @@ -137,6 +137,31 @@ public enum CardBrand { */ EFTPOS, + /** + * The Carte Bancaire payment network. + */ + CARTE_BANCAIRE, + + /** + * The Star Access payment network. + */ + STAR_ACCESS, + + /** + * The Pulse payment network. + */ + PULSE, + + /** + * The NYCE payment network. + */ + NYCE, + + /** + * The Accel payment network. + */ + ACCEL, + /** * UNKNOWN payment network. */ @@ -176,6 +201,11 @@ public enum CardBrand { GE.value = "GE"; SYNCHRONY.value = "SYNCHRONY"; EFTPOS.value = "EFTPOS"; + CARTE_BANCAIRE.value = "CARTE_BANCAIRE"; + STAR_ACCESS.value = "STAR_ACCESS"; + PULSE.value = "PULSE"; + NYCE.value = "NYCE"; + ACCEL.value = "ACCEL"; UNKNOWN.value = "UNKNOWN"; _UNKNOWN.value = null; @@ -203,6 +233,11 @@ public enum CardBrand { valueMap.put("GE", GE); valueMap.put("SYNCHRONY", SYNCHRONY); valueMap.put("EFTPOS", EFTPOS); + valueMap.put("CARTE_BANCAIRE", CARTE_BANCAIRE); + valueMap.put("STAR_ACCESS", STAR_ACCESS); + valueMap.put("PULSE", PULSE); + valueMap.put("NYCE", NYCE); + valueMap.put("ACCEL", ACCEL); valueMap.put("UNKNOWN", UNKNOWN); } diff --git a/src/main/java/com/paypal/sdk/models/CardCustomer.java b/src/main/java/com/paypal/sdk/models/CardCustomer.java new file mode 100644 index 0000000..8f21c5d --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CardCustomer.java @@ -0,0 +1,221 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CardCustomer type. + */ +public class CardCustomer { + private String id; + private String emailAddress; + private PhoneWithType phone; + private String merchantCustomerId; + + /** + * Default constructor. + */ + public CardCustomer() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param emailAddress String value for emailAddress. + * @param phone PhoneWithType value for phone. + * @param merchantCustomerId String value for merchantCustomerId. + */ + public CardCustomer( + String id, + String emailAddress, + PhoneWithType phone, + String merchantCustomerId) { + this.id = id; + this.emailAddress = emailAddress; + this.phone = phone; + this.merchantCustomerId = merchantCustomerId; + } + + /** + * Getter for Id. + * The unique ID for a customer generated by PayPal. + * @return Returns the String + */ + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getId() { + return id; + } + + /** + * Setter for Id. + * The unique ID for a customer generated by PayPal. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @return Returns the String + */ + @JsonGetter("email_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getEmailAddress() { + return emailAddress; + } + + /** + * Setter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @param emailAddress Value for String + */ + @JsonSetter("email_address") + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + /** + * Getter for Phone. + * The phone information. + * @return Returns the PhoneWithType + */ + @JsonGetter("phone") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PhoneWithType getPhone() { + return phone; + } + + /** + * Setter for Phone. + * The phone information. + * @param phone Value for PhoneWithType + */ + @JsonSetter("phone") + public void setPhone(PhoneWithType phone) { + this.phone = phone; + } + + /** + * Getter for MerchantCustomerId. + * 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. + * @return Returns the String + */ + @JsonGetter("merchant_customer_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getMerchantCustomerId() { + return merchantCustomerId; + } + + /** + * Setter for MerchantCustomerId. + * 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. + * @param merchantCustomerId Value for String + */ + @JsonSetter("merchant_customer_id") + public void setMerchantCustomerId(String merchantCustomerId) { + this.merchantCustomerId = merchantCustomerId; + } + + /** + * Converts this CardCustomer into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CardCustomer [" + "id=" + id + ", emailAddress=" + emailAddress + ", phone=" + phone + + ", merchantCustomerId=" + merchantCustomerId + "]"; + } + + /** + * Builds a new {@link CardCustomer.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CardCustomer.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .id(getId()) + .emailAddress(getEmailAddress()) + .phone(getPhone()) + .merchantCustomerId(getMerchantCustomerId()); + return builder; + } + + /** + * Class to build instances of {@link CardCustomer}. + */ + public static class Builder { + private String id; + private String emailAddress; + private PhoneWithType phone; + private String merchantCustomerId; + + + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for emailAddress. + * @param emailAddress String value for emailAddress. + * @return Builder + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Setter for phone. + * @param phone PhoneWithType value for phone. + * @return Builder + */ + public Builder phone(PhoneWithType phone) { + this.phone = phone; + return this; + } + + /** + * Setter for merchantCustomerId. + * @param merchantCustomerId String value for merchantCustomerId. + * @return Builder + */ + public Builder merchantCustomerId(String merchantCustomerId) { + this.merchantCustomerId = merchantCustomerId; + return this; + } + + /** + * Builds a new {@link CardCustomer} object using the set fields. + * @return {@link CardCustomer} + */ + public CardCustomer build() { + return new CardCustomer(id, emailAddress, phone, merchantCustomerId); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CardResponseWithBillingAddress.java b/src/main/java/com/paypal/sdk/models/CardResponseWithBillingAddress.java new file mode 100644 index 0000000..b2d299a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CardResponseWithBillingAddress.java @@ -0,0 +1,223 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CardResponseWithBillingAddress type. + */ +public class CardResponseWithBillingAddress { + private String name; + private Address billingAddress; + private String expiry; + private String currencyCode; + + /** + * Default constructor. + */ + public CardResponseWithBillingAddress() { + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param billingAddress Address value for billingAddress. + * @param expiry String value for expiry. + * @param currencyCode String value for currencyCode. + */ + public CardResponseWithBillingAddress( + String name, + Address billingAddress, + String expiry, + String currencyCode) { + this.name = name; + this.billingAddress = billingAddress; + this.expiry = expiry; + this.currencyCode = currencyCode; + } + + /** + * Getter for Name. + * The card holder's name as it appears on the card. + * @return Returns the String + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getName() { + return name; + } + + /** + * Setter for Name. + * The card holder's name as it appears on the card. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for BillingAddress. + * The portable international postal address. Maps to + * [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) + * and HTML 5.1 [Autofilling form controls: the autocomplete + * attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). + * @return Returns the Address + */ + @JsonGetter("billing_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Address getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * 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). + * @param billingAddress Value for Address + */ + @JsonSetter("billing_address") + public void setBillingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Getter for Expiry. + * 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). + * @return Returns the String + */ + @JsonGetter("expiry") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getExpiry() { + return expiry; + } + + /** + * Setter for Expiry. + * 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). + * @param expiry Value for String + */ + @JsonSetter("expiry") + public void setExpiry(String expiry) { + this.expiry = expiry; + } + + /** + * Getter for CurrencyCode. + * The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that + * identifies the currency. + * @return Returns the String + */ + @JsonGetter("currency_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCurrencyCode() { + return currencyCode; + } + + /** + * Setter for CurrencyCode. + * The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that + * identifies the currency. + * @param currencyCode Value for String + */ + @JsonSetter("currency_code") + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + /** + * Converts this CardResponseWithBillingAddress into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CardResponseWithBillingAddress [" + "name=" + name + ", billingAddress=" + + billingAddress + ", expiry=" + expiry + ", currencyCode=" + currencyCode + "]"; + } + + /** + * Builds a new {@link CardResponseWithBillingAddress.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CardResponseWithBillingAddress.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .name(getName()) + .billingAddress(getBillingAddress()) + .expiry(getExpiry()) + .currencyCode(getCurrencyCode()); + return builder; + } + + /** + * Class to build instances of {@link CardResponseWithBillingAddress}. + */ + public static class Builder { + private String name; + private Address billingAddress; + private String expiry; + private String currencyCode; + + + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for billingAddress. + * @param billingAddress Address value for billingAddress. + * @return Builder + */ + public Builder billingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + /** + * Setter for expiry. + * @param expiry String value for expiry. + * @return Builder + */ + public Builder expiry(String expiry) { + this.expiry = expiry; + return this; + } + + /** + * Setter for currencyCode. + * @param currencyCode String value for currencyCode. + * @return Builder + */ + public Builder currencyCode(String currencyCode) { + this.currencyCode = currencyCode; + return this; + } + + /** + * Builds a new {@link CardResponseWithBillingAddress} object using the set fields. + * @return {@link CardResponseWithBillingAddress} + */ + public CardResponseWithBillingAddress build() { + return new CardResponseWithBillingAddress(name, billingAddress, expiry, currencyCode); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CardStoredCredential.java b/src/main/java/com/paypal/sdk/models/CardStoredCredential.java index a72c18d..40fa921 100644 --- a/src/main/java/com/paypal/sdk/models/CardStoredCredential.java +++ b/src/main/java/com/paypal/sdk/models/CardStoredCredential.java @@ -17,7 +17,7 @@ public class CardStoredCredential { private PaymentInitiator paymentInitiator; private StoredPaymentSourcePaymentType paymentType; private StoredPaymentSourceUsageType usage; - private NetworkTransactionReference previousNetworkTransactionReference; + private NetworkTransaction previousNetworkTransactionReference; /** * Default constructor. @@ -31,14 +31,14 @@ public CardStoredCredential() { * @param paymentInitiator PaymentInitiator value for paymentInitiator. * @param paymentType StoredPaymentSourcePaymentType value for paymentType. * @param usage StoredPaymentSourceUsageType value for usage. - * @param previousNetworkTransactionReference NetworkTransactionReference value for + * @param previousNetworkTransactionReference NetworkTransaction value for * previousNetworkTransactionReference. */ public CardStoredCredential( PaymentInitiator paymentInitiator, StoredPaymentSourcePaymentType paymentType, StoredPaymentSourceUsageType usage, - NetworkTransactionReference previousNetworkTransactionReference) { + NetworkTransaction previousNetworkTransactionReference) { this.paymentInitiator = paymentInitiator; this.paymentType = paymentType; this.usage = usage; @@ -111,21 +111,21 @@ public void setUsage(StoredPaymentSourceUsageType usage) { /** * Getter for PreviousNetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("previous_network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getPreviousNetworkTransactionReference() { + public NetworkTransaction getPreviousNetworkTransactionReference() { return previousNetworkTransactionReference; } /** * Setter for PreviousNetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param previousNetworkTransactionReference Value for NetworkTransactionReference + * @param previousNetworkTransactionReference Value for NetworkTransaction */ @JsonSetter("previous_network_transaction_reference") - public void setPreviousNetworkTransactionReference(NetworkTransactionReference previousNetworkTransactionReference) { + public void setPreviousNetworkTransactionReference(NetworkTransaction previousNetworkTransactionReference) { this.previousNetworkTransactionReference = previousNetworkTransactionReference; } @@ -159,7 +159,7 @@ public static class Builder { private PaymentInitiator paymentInitiator; private StoredPaymentSourcePaymentType paymentType; private StoredPaymentSourceUsageType usage = StoredPaymentSourceUsageType.DERIVED; - private NetworkTransactionReference previousNetworkTransactionReference; + private NetworkTransaction previousNetworkTransactionReference; /** * Initialization constructor. @@ -210,12 +210,12 @@ public Builder usage(StoredPaymentSourceUsageType usage) { /** * Setter for previousNetworkTransactionReference. - * @param previousNetworkTransactionReference NetworkTransactionReference value for + * @param previousNetworkTransactionReference NetworkTransaction value for * previousNetworkTransactionReference. * @return Builder */ public Builder previousNetworkTransactionReference( - NetworkTransactionReference previousNetworkTransactionReference) { + NetworkTransaction previousNetworkTransactionReference) { this.previousNetworkTransactionReference = previousNetworkTransactionReference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/CardVerificationDetails.java b/src/main/java/com/paypal/sdk/models/CardVerificationDetails.java index 7cc4f97..b71e1ac 100644 --- a/src/main/java/com/paypal/sdk/models/CardVerificationDetails.java +++ b/src/main/java/com/paypal/sdk/models/CardVerificationDetails.java @@ -104,7 +104,8 @@ public void setDate(String date) { /** * Getter for Network. - * The card network or brand. Applies to credit, debit, gift, and payment cards. + * DEPRECATED. This field is DEPRECATED. Please find the network data in the 'network' field + * under the 'network_transaction_reference' object instead of the 'verification' object. * @return Returns the CardBrand */ @JsonGetter("network") @@ -115,7 +116,8 @@ public CardBrand getNetwork() { /** * Setter for Network. - * The card network or brand. Applies to credit, debit, gift, and payment cards. + * DEPRECATED. This field is DEPRECATED. Please find the network data in the 'network' field + * under the 'network_transaction_reference' object instead of the 'verification' object. * @param network Value for CardBrand */ @JsonSetter("network") @@ -125,10 +127,8 @@ public void setNetwork(CardBrand network) { /** * Getter for Time. - * 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. + * DEPRECATED. This field is DEPRECATED. Please find the time data in the 'time' field under the + * 'network_transaction_reference' object instead of the 'verification' object. * @return Returns the String */ @JsonGetter("time") @@ -139,10 +139,8 @@ public String getTime() { /** * Setter for Time. - * 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. + * DEPRECATED. This field is DEPRECATED. Please find the time data in the 'time' field under the + * 'network_transaction_reference' object instead of the 'verification' object. * @param time Value for String */ @JsonSetter("time") diff --git a/src/main/java/com/paypal/sdk/models/CartInformation.java b/src/main/java/com/paypal/sdk/models/CartInformation.java new file mode 100644 index 0000000..820f6e4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CartInformation.java @@ -0,0 +1,178 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for CartInformation type. + */ +public class CartInformation { + private List itemDetails; + private Boolean taxInclusive; + private String paypalInvoiceId; + + /** + * Default constructor. + */ + public CartInformation() { + taxInclusive = false; + } + + /** + * Initialization constructor. + * @param itemDetails List of ItemDetails value for itemDetails. + * @param taxInclusive Boolean value for taxInclusive. + * @param paypalInvoiceId String value for paypalInvoiceId. + */ + public CartInformation( + List itemDetails, + Boolean taxInclusive, + String paypalInvoiceId) { + this.itemDetails = itemDetails; + this.taxInclusive = taxInclusive; + this.paypalInvoiceId = paypalInvoiceId; + } + + /** + * Getter for ItemDetails. + * An array of item details. + * @return Returns the List of ItemDetails + */ + @JsonGetter("item_details") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getItemDetails() { + return itemDetails; + } + + /** + * Setter for ItemDetails. + * An array of item details. + * @param itemDetails Value for List of ItemDetails + */ + @JsonSetter("item_details") + public void setItemDetails(List itemDetails) { + this.itemDetails = itemDetails; + } + + /** + * Getter for TaxInclusive. + * Indicates whether the item amount or the shipping amount already includes tax. + * @return Returns the Boolean + */ + @JsonGetter("tax_inclusive") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getTaxInclusive() { + return taxInclusive; + } + + /** + * Setter for TaxInclusive. + * Indicates whether the item amount or the shipping amount already includes tax. + * @param taxInclusive Value for Boolean + */ + @JsonSetter("tax_inclusive") + public void setTaxInclusive(Boolean taxInclusive) { + this.taxInclusive = taxInclusive; + } + + /** + * Getter for PaypalInvoiceId. + * The ID of the invoice. Appears for only PayPal-generated invoices. + * @return Returns the String + */ + @JsonGetter("paypal_invoice_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalInvoiceId() { + return paypalInvoiceId; + } + + /** + * Setter for PaypalInvoiceId. + * The ID of the invoice. Appears for only PayPal-generated invoices. + * @param paypalInvoiceId Value for String + */ + @JsonSetter("paypal_invoice_id") + public void setPaypalInvoiceId(String paypalInvoiceId) { + this.paypalInvoiceId = paypalInvoiceId; + } + + /** + * Converts this CartInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CartInformation [" + "itemDetails=" + itemDetails + ", taxInclusive=" + taxInclusive + + ", paypalInvoiceId=" + paypalInvoiceId + "]"; + } + + /** + * Builds a new {@link CartInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CartInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .itemDetails(getItemDetails()) + .taxInclusive(getTaxInclusive()) + .paypalInvoiceId(getPaypalInvoiceId()); + return builder; + } + + /** + * Class to build instances of {@link CartInformation}. + */ + public static class Builder { + private List itemDetails; + private Boolean taxInclusive = false; + private String paypalInvoiceId; + + + + /** + * Setter for itemDetails. + * @param itemDetails List of ItemDetails value for itemDetails. + * @return Builder + */ + public Builder itemDetails(List itemDetails) { + this.itemDetails = itemDetails; + return this; + } + + /** + * Setter for taxInclusive. + * @param taxInclusive Boolean value for taxInclusive. + * @return Builder + */ + public Builder taxInclusive(Boolean taxInclusive) { + this.taxInclusive = taxInclusive; + return this; + } + + /** + * Setter for paypalInvoiceId. + * @param paypalInvoiceId String value for paypalInvoiceId. + * @return Builder + */ + public Builder paypalInvoiceId(String paypalInvoiceId) { + this.paypalInvoiceId = paypalInvoiceId; + return this; + } + + /** + * Builds a new {@link CartInformation} object using the set fields. + * @return {@link CartInformation} + */ + public CartInformation build() { + return new CartInformation(itemDetails, taxInclusive, paypalInvoiceId); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CheckoutOption.java b/src/main/java/com/paypal/sdk/models/CheckoutOption.java new file mode 100644 index 0000000..f65538a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CheckoutOption.java @@ -0,0 +1,141 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CheckoutOption type. + */ +public class CheckoutOption { + private String checkoutOptionName; + private String checkoutOptionValue; + + /** + * Default constructor. + */ + public CheckoutOption() { + } + + /** + * Initialization constructor. + * @param checkoutOptionName String value for checkoutOptionName. + * @param checkoutOptionValue String value for checkoutOptionValue. + */ + public CheckoutOption( + String checkoutOptionName, + String checkoutOptionValue) { + this.checkoutOptionName = checkoutOptionName; + this.checkoutOptionValue = checkoutOptionValue; + } + + /** + * Getter for CheckoutOptionName. + * The checkout option name, such as `color` or `texture`. + * @return Returns the String + */ + @JsonGetter("checkout_option_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCheckoutOptionName() { + return checkoutOptionName; + } + + /** + * Setter for CheckoutOptionName. + * The checkout option name, such as `color` or `texture`. + * @param checkoutOptionName Value for String + */ + @JsonSetter("checkout_option_name") + public void setCheckoutOptionName(String checkoutOptionName) { + this.checkoutOptionName = checkoutOptionName; + } + + /** + * Getter for CheckoutOptionValue. + * 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`. + * @return Returns the String + */ + @JsonGetter("checkout_option_value") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCheckoutOptionValue() { + return checkoutOptionValue; + } + + /** + * Setter for CheckoutOptionValue. + * 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`. + * @param checkoutOptionValue Value for String + */ + @JsonSetter("checkout_option_value") + public void setCheckoutOptionValue(String checkoutOptionValue) { + this.checkoutOptionValue = checkoutOptionValue; + } + + /** + * Converts this CheckoutOption into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CheckoutOption [" + "checkoutOptionName=" + checkoutOptionName + + ", checkoutOptionValue=" + checkoutOptionValue + "]"; + } + + /** + * Builds a new {@link CheckoutOption.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CheckoutOption.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .checkoutOptionName(getCheckoutOptionName()) + .checkoutOptionValue(getCheckoutOptionValue()); + return builder; + } + + /** + * Class to build instances of {@link CheckoutOption}. + */ + public static class Builder { + private String checkoutOptionName; + private String checkoutOptionValue; + + + + /** + * Setter for checkoutOptionName. + * @param checkoutOptionName String value for checkoutOptionName. + * @return Builder + */ + public Builder checkoutOptionName(String checkoutOptionName) { + this.checkoutOptionName = checkoutOptionName; + return this; + } + + /** + * Setter for checkoutOptionValue. + * @param checkoutOptionValue String value for checkoutOptionValue. + * @return Builder + */ + public Builder checkoutOptionValue(String checkoutOptionValue) { + this.checkoutOptionValue = checkoutOptionValue; + return this; + } + + /** + * Builds a new {@link CheckoutOption} object using the set fields. + * @return {@link CheckoutOption} + */ + public CheckoutOption build() { + return new CheckoutOption(checkoutOptionName, checkoutOptionValue); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CreateBillingPlanInput.java b/src/main/java/com/paypal/sdk/models/CreateBillingPlanInput.java new file mode 100644 index 0000000..ff19b5b --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CreateBillingPlanInput.java @@ -0,0 +1,229 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CreateBillingPlanInput type. + */ +public class CreateBillingPlanInput { + private String contentType; + private String prefer; + private String paypalRequestId; + private PlanRequest body; + + /** + * Default constructor. + */ + public CreateBillingPlanInput() { + contentType = "application/json"; + prefer = "return=minimal"; + } + + /** + * Initialization constructor. + * @param contentType String value for contentType. + * @param prefer String value for prefer. + * @param paypalRequestId String value for paypalRequestId. + * @param body PlanRequest value for body. + */ + public CreateBillingPlanInput( + String contentType, + String prefer, + String paypalRequestId, + PlanRequest body) { + this.contentType = contentType; + this.prefer = prefer; + this.paypalRequestId = paypalRequestId; + this.body = body; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Prefer. + * The preferred server response upon successful completion of the request. Value is: + * return=minimal. The server returns a minimal response to optimize communication between the + * API caller and the server. A minimal response includes the id, status and HATEOAS links. + * return=representation. The server returns a complete resource representation, including the + * current state of the resource. + * @return Returns the String + */ + @JsonGetter("Prefer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPrefer() { + return prefer; + } + + /** + * Setter for Prefer. + * The preferred server response upon successful completion of the request. Value is: + * return=minimal. The server returns a minimal response to optimize communication between the + * API caller and the server. A minimal response includes the id, status and HATEOAS links. + * return=representation. The server returns a complete resource representation, including the + * current state of the resource. + * @param prefer Value for String + */ + @JsonSetter("Prefer") + public void setPrefer(String prefer) { + this.prefer = prefer; + } + + /** + * Getter for PaypalRequestId. + * The server stores keys for 72 hours. + * @return Returns the String + */ + @JsonGetter("PayPal-Request-Id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalRequestId() { + return paypalRequestId; + } + + /** + * Setter for PaypalRequestId. + * The server stores keys for 72 hours. + * @param paypalRequestId Value for String + */ + @JsonSetter("PayPal-Request-Id") + public void setPaypalRequestId(String paypalRequestId) { + this.paypalRequestId = paypalRequestId; + } + + /** + * Getter for Body. + * @return Returns the PlanRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PlanRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for PlanRequest + */ + @JsonSetter("body") + public void setBody(PlanRequest body) { + this.body = body; + } + + /** + * Converts this CreateBillingPlanInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CreateBillingPlanInput [" + "contentType=" + contentType + ", prefer=" + prefer + + ", paypalRequestId=" + paypalRequestId + ", body=" + body + "]"; + } + + /** + * Builds a new {@link CreateBillingPlanInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CreateBillingPlanInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(contentType) + .prefer(getPrefer()) + .paypalRequestId(getPaypalRequestId()) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link CreateBillingPlanInput}. + */ + public static class Builder { + private String contentType = "application/json"; + private String prefer = "return=minimal"; + private String paypalRequestId; + private PlanRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param contentType String value for contentType. + */ + public Builder(String contentType) { + this.contentType = contentType; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for prefer. + * @param prefer String value for prefer. + * @return Builder + */ + public Builder prefer(String prefer) { + this.prefer = prefer; + return this; + } + + /** + * Setter for paypalRequestId. + * @param paypalRequestId String value for paypalRequestId. + * @return Builder + */ + public Builder paypalRequestId(String paypalRequestId) { + this.paypalRequestId = paypalRequestId; + return this; + } + + /** + * Setter for body. + * @param body PlanRequest value for body. + * @return Builder + */ + public Builder body(PlanRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link CreateBillingPlanInput} object using the set fields. + * @return {@link CreateBillingPlanInput} + */ + public CreateBillingPlanInput build() { + return new CreateBillingPlanInput(contentType, prefer, paypalRequestId, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CreateSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/CreateSubscriptionInput.java new file mode 100644 index 0000000..e90853a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CreateSubscriptionInput.java @@ -0,0 +1,276 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CreateSubscriptionInput type. + */ +public class CreateSubscriptionInput { + private String contentType; + private String prefer; + private String paypalRequestId; + private String paypalClientMetadataId; + private CreateSubscriptionRequest body; + + /** + * Default constructor. + */ + public CreateSubscriptionInput() { + contentType = "application/json"; + prefer = "return=minimal"; + } + + /** + * Initialization constructor. + * @param contentType String value for contentType. + * @param prefer String value for prefer. + * @param paypalRequestId String value for paypalRequestId. + * @param paypalClientMetadataId String value for paypalClientMetadataId. + * @param body CreateSubscriptionRequest value for body. + */ + public CreateSubscriptionInput( + String contentType, + String prefer, + String paypalRequestId, + String paypalClientMetadataId, + CreateSubscriptionRequest body) { + this.contentType = contentType; + this.prefer = prefer; + this.paypalRequestId = paypalRequestId; + this.paypalClientMetadataId = paypalClientMetadataId; + this.body = body; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Prefer. + * The preferred server response upon successful completion of the request. Value is: + * return=minimal. The server returns a minimal response to optimize communication between the + * API caller and the server. A minimal response includes the id, status and HATEOAS links. + * return=representation. The server returns a complete resource representation, including the + * current state of the resource. + * @return Returns the String + */ + @JsonGetter("Prefer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPrefer() { + return prefer; + } + + /** + * Setter for Prefer. + * The preferred server response upon successful completion of the request. Value is: + * return=minimal. The server returns a minimal response to optimize communication between the + * API caller and the server. A minimal response includes the id, status and HATEOAS links. + * return=representation. The server returns a complete resource representation, including the + * current state of the resource. + * @param prefer Value for String + */ + @JsonSetter("Prefer") + public void setPrefer(String prefer) { + this.prefer = prefer; + } + + /** + * Getter for PaypalRequestId. + * The server stores keys for 72 hours. + * @return Returns the String + */ + @JsonGetter("PayPal-Request-Id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalRequestId() { + return paypalRequestId; + } + + /** + * Setter for PaypalRequestId. + * The server stores keys for 72 hours. + * @param paypalRequestId Value for String + */ + @JsonSetter("PayPal-Request-Id") + public void setPaypalRequestId(String paypalRequestId) { + this.paypalRequestId = paypalRequestId; + } + + /** + * Getter for PaypalClientMetadataId. + * The PayPal Client Metadata Id(CMID) is used to provide device-specific information to + * PayPal's risk engine. This is crucial for transactions that require device-specific risk + * assessments. Merchants typically use the Paypal SDK that automatically submits the CMID or + * they use tools like Fraudnet JS for web or Magnes JS for mobile to generate the CMID on the + * frontend and then pass it to the API as part of the request headers. + * @return Returns the String + */ + @JsonGetter("PayPal-Client-Metadata-Id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalClientMetadataId() { + return paypalClientMetadataId; + } + + /** + * Setter for PaypalClientMetadataId. + * The PayPal Client Metadata Id(CMID) is used to provide device-specific information to + * PayPal's risk engine. This is crucial for transactions that require device-specific risk + * assessments. Merchants typically use the Paypal SDK that automatically submits the CMID or + * they use tools like Fraudnet JS for web or Magnes JS for mobile to generate the CMID on the + * frontend and then pass it to the API as part of the request headers. + * @param paypalClientMetadataId Value for String + */ + @JsonSetter("PayPal-Client-Metadata-Id") + public void setPaypalClientMetadataId(String paypalClientMetadataId) { + this.paypalClientMetadataId = paypalClientMetadataId; + } + + /** + * Getter for Body. + * @return Returns the CreateSubscriptionRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CreateSubscriptionRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for CreateSubscriptionRequest + */ + @JsonSetter("body") + public void setBody(CreateSubscriptionRequest body) { + this.body = body; + } + + /** + * Converts this CreateSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CreateSubscriptionInput [" + "contentType=" + contentType + ", prefer=" + prefer + + ", paypalRequestId=" + paypalRequestId + ", paypalClientMetadataId=" + + paypalClientMetadataId + ", body=" + body + "]"; + } + + /** + * Builds a new {@link CreateSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CreateSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(contentType) + .prefer(getPrefer()) + .paypalRequestId(getPaypalRequestId()) + .paypalClientMetadataId(getPaypalClientMetadataId()) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link CreateSubscriptionInput}. + */ + public static class Builder { + private String contentType = "application/json"; + private String prefer = "return=minimal"; + private String paypalRequestId; + private String paypalClientMetadataId; + private CreateSubscriptionRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param contentType String value for contentType. + */ + public Builder(String contentType) { + this.contentType = contentType; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for prefer. + * @param prefer String value for prefer. + * @return Builder + */ + public Builder prefer(String prefer) { + this.prefer = prefer; + return this; + } + + /** + * Setter for paypalRequestId. + * @param paypalRequestId String value for paypalRequestId. + * @return Builder + */ + public Builder paypalRequestId(String paypalRequestId) { + this.paypalRequestId = paypalRequestId; + return this; + } + + /** + * Setter for paypalClientMetadataId. + * @param paypalClientMetadataId String value for paypalClientMetadataId. + * @return Builder + */ + public Builder paypalClientMetadataId(String paypalClientMetadataId) { + this.paypalClientMetadataId = paypalClientMetadataId; + return this; + } + + /** + * Setter for body. + * @param body CreateSubscriptionRequest value for body. + * @return Builder + */ + public Builder body(CreateSubscriptionRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link CreateSubscriptionInput} object using the set fields. + * @return {@link CreateSubscriptionInput} + */ + public CreateSubscriptionInput build() { + return new CreateSubscriptionInput(contentType, prefer, paypalRequestId, + paypalClientMetadataId, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CreateSubscriptionRequest.java b/src/main/java/com/paypal/sdk/models/CreateSubscriptionRequest.java new file mode 100644 index 0000000..63e2ee9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CreateSubscriptionRequest.java @@ -0,0 +1,422 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CreateSubscriptionRequest type. + */ +public class CreateSubscriptionRequest { + private String planId; + private String startTime; + private String quantity; + private Money shippingAmount; + private SubscriberRequest subscriber; + private Boolean autoRenewal; + private SubscriptionApplicationContext applicationContext; + private String customId; + private PlanOverride plan; + + /** + * Default constructor. + */ + public CreateSubscriptionRequest() { + autoRenewal = false; + } + + /** + * Initialization constructor. + * @param planId String value for planId. + * @param startTime String value for startTime. + * @param quantity String value for quantity. + * @param shippingAmount Money value for shippingAmount. + * @param subscriber SubscriberRequest value for subscriber. + * @param autoRenewal Boolean value for autoRenewal. + * @param applicationContext SubscriptionApplicationContext value for applicationContext. + * @param customId String value for customId. + * @param plan PlanOverride value for plan. + */ + public CreateSubscriptionRequest( + String planId, + String startTime, + String quantity, + Money shippingAmount, + SubscriberRequest subscriber, + Boolean autoRenewal, + SubscriptionApplicationContext applicationContext, + String customId, + PlanOverride plan) { + this.planId = planId; + this.startTime = startTime; + this.quantity = quantity; + this.shippingAmount = shippingAmount; + this.subscriber = subscriber; + this.autoRenewal = autoRenewal; + this.applicationContext = applicationContext; + this.customId = customId; + this.plan = plan; + } + + /** + * Getter for PlanId. + * The ID of the plan. + * @return Returns the String + */ + @JsonGetter("plan_id") + public String getPlanId() { + return planId; + } + + /** + * Setter for PlanId. + * The ID of the plan. + * @param planId Value for String + */ + @JsonSetter("plan_id") + public void setPlanId(String planId) { + this.planId = planId; + } + + /** + * Getter for StartTime. + * 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. + * @return Returns the String + */ + @JsonGetter("start_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStartTime() { + return startTime; + } + + /** + * Setter for StartTime. + * 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. + * @param startTime Value for String + */ + @JsonSetter("start_time") + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + /** + * Getter for Quantity. + * The quantity of the product in the subscription. + * @return Returns the String + */ + @JsonGetter("quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The quantity of the product in the subscription. + * @param quantity Value for String + */ + @JsonSetter("quantity") + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + * Getter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingAmount() { + return shippingAmount; + } + + /** + * Setter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingAmount Value for Money + */ + @JsonSetter("shipping_amount") + public void setShippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + } + + /** + * Getter for Subscriber. + * The subscriber request information . + * @return Returns the SubscriberRequest + */ + @JsonGetter("subscriber") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriberRequest getSubscriber() { + return subscriber; + } + + /** + * Setter for Subscriber. + * The subscriber request information . + * @param subscriber Value for SubscriberRequest + */ + @JsonSetter("subscriber") + public void setSubscriber(SubscriberRequest subscriber) { + this.subscriber = subscriber; + } + + /** + * Getter for AutoRenewal. + * DEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete. + * @return Returns the Boolean + */ + @JsonGetter("auto_renewal") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getAutoRenewal() { + return autoRenewal; + } + + /** + * Setter for AutoRenewal. + * DEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete. + * @param autoRenewal Value for Boolean + */ + @JsonSetter("auto_renewal") + public void setAutoRenewal(Boolean autoRenewal) { + this.autoRenewal = autoRenewal; + } + + /** + * Getter for ApplicationContext. + * DEPRECATED. The application context, which customizes the payer experience during the + * subscription approval process with PayPal. + * @return Returns the SubscriptionApplicationContext + */ + @JsonGetter("application_context") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * Setter for ApplicationContext. + * DEPRECATED. The application context, which customizes the payer experience during the + * subscription approval process with PayPal. + * @param applicationContext Value for SubscriptionApplicationContext + */ + @JsonSetter("application_context") + public void setApplicationContext(SubscriptionApplicationContext applicationContext) { + this.applicationContext = applicationContext; + } + + /** + * Getter for CustomId. + * The custom id for the subscription. Can be invoice id. + * @return Returns the String + */ + @JsonGetter("custom_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCustomId() { + return customId; + } + + /** + * Setter for CustomId. + * The custom id for the subscription. Can be invoice id. + * @param customId Value for String + */ + @JsonSetter("custom_id") + public void setCustomId(String customId) { + this.customId = customId; + } + + /** + * Getter for Plan. + * 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. + * @return Returns the PlanOverride + */ + @JsonGetter("plan") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PlanOverride getPlan() { + return plan; + } + + /** + * Setter for Plan. + * 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. + * @param plan Value for PlanOverride + */ + @JsonSetter("plan") + public void setPlan(PlanOverride plan) { + this.plan = plan; + } + + /** + * Converts this CreateSubscriptionRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CreateSubscriptionRequest [" + "planId=" + planId + ", startTime=" + startTime + + ", quantity=" + quantity + ", shippingAmount=" + shippingAmount + ", subscriber=" + + subscriber + ", autoRenewal=" + autoRenewal + ", applicationContext=" + + applicationContext + ", customId=" + customId + ", plan=" + plan + "]"; + } + + /** + * Builds a new {@link CreateSubscriptionRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CreateSubscriptionRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(planId) + .startTime(getStartTime()) + .quantity(getQuantity()) + .shippingAmount(getShippingAmount()) + .subscriber(getSubscriber()) + .autoRenewal(getAutoRenewal()) + .applicationContext(getApplicationContext()) + .customId(getCustomId()) + .plan(getPlan()); + return builder; + } + + /** + * Class to build instances of {@link CreateSubscriptionRequest}. + */ + public static class Builder { + private String planId; + private String startTime; + private String quantity; + private Money shippingAmount; + private SubscriberRequest subscriber; + private Boolean autoRenewal = false; + private SubscriptionApplicationContext applicationContext; + private String customId; + private PlanOverride plan; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param planId String value for planId. + */ + public Builder(String planId) { + this.planId = planId; + } + + /** + * Setter for planId. + * @param planId String value for planId. + * @return Builder + */ + public Builder planId(String planId) { + this.planId = planId; + return this; + } + + /** + * Setter for startTime. + * @param startTime String value for startTime. + * @return Builder + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Setter for quantity. + * @param quantity String value for quantity. + * @return Builder + */ + public Builder quantity(String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for shippingAmount. + * @param shippingAmount Money value for shippingAmount. + * @return Builder + */ + public Builder shippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + return this; + } + + /** + * Setter for subscriber. + * @param subscriber SubscriberRequest value for subscriber. + * @return Builder + */ + public Builder subscriber(SubscriberRequest subscriber) { + this.subscriber = subscriber; + return this; + } + + /** + * Setter for autoRenewal. + * @param autoRenewal Boolean value for autoRenewal. + * @return Builder + */ + public Builder autoRenewal(Boolean autoRenewal) { + this.autoRenewal = autoRenewal; + return this; + } + + /** + * Setter for applicationContext. + * @param applicationContext SubscriptionApplicationContext value for applicationContext. + * @return Builder + */ + public Builder applicationContext(SubscriptionApplicationContext applicationContext) { + this.applicationContext = applicationContext; + return this; + } + + /** + * Setter for customId. + * @param customId String value for customId. + * @return Builder + */ + public Builder customId(String customId) { + this.customId = customId; + return this; + } + + /** + * Setter for plan. + * @param plan PlanOverride value for plan. + * @return Builder + */ + public Builder plan(PlanOverride plan) { + this.plan = plan; + return this; + } + + /** + * Builds a new {@link CreateSubscriptionRequest} object using the set fields. + * @return {@link CreateSubscriptionRequest} + */ + public CreateSubscriptionRequest build() { + return new CreateSubscriptionRequest(planId, startTime, quantity, shippingAmount, + subscriber, autoRenewal, applicationContext, customId, plan); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/CycleExecution.java b/src/main/java/com/paypal/sdk/models/CycleExecution.java new file mode 100644 index 0000000..7e6d39e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/CycleExecution.java @@ -0,0 +1,308 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for CycleExecution type. + */ +public class CycleExecution { + private TenureType tenureType; + private int sequence; + private int cyclesCompleted; + private Integer cyclesRemaining; + private Integer currentPricingSchemeVersion; + private Integer totalCycles; + + /** + * Default constructor. + */ + public CycleExecution() { + } + + /** + * Initialization constructor. + * @param tenureType TenureType value for tenureType. + * @param sequence int value for sequence. + * @param cyclesCompleted int value for cyclesCompleted. + * @param cyclesRemaining Integer value for cyclesRemaining. + * @param currentPricingSchemeVersion Integer value for currentPricingSchemeVersion. + * @param totalCycles Integer value for totalCycles. + */ + public CycleExecution( + TenureType tenureType, + int sequence, + int cyclesCompleted, + Integer cyclesRemaining, + Integer currentPricingSchemeVersion, + Integer totalCycles) { + this.tenureType = tenureType; + this.sequence = sequence; + this.cyclesCompleted = cyclesCompleted; + this.cyclesRemaining = cyclesRemaining; + this.currentPricingSchemeVersion = currentPricingSchemeVersion; + this.totalCycles = totalCycles; + } + + /** + * Getter for TenureType. + * The type of the billing cycle. + * @return Returns the TenureType + */ + @JsonGetter("tenure_type") + public TenureType getTenureType() { + return tenureType; + } + + /** + * Setter for TenureType. + * The type of the billing cycle. + * @param tenureType Value for TenureType + */ + @JsonSetter("tenure_type") + public void setTenureType(TenureType tenureType) { + this.tenureType = tenureType; + } + + /** + * Getter for Sequence. + * The order in which to run this cycle among other billing cycles. + * @return Returns the int + */ + @JsonGetter("sequence") + public int getSequence() { + return sequence; + } + + /** + * Setter for Sequence. + * The order in which to run this cycle among other billing cycles. + * @param sequence Value for int + */ + @JsonSetter("sequence") + public void setSequence(int sequence) { + this.sequence = sequence; + } + + /** + * Getter for CyclesCompleted. + * The number of billing cycles that have completed. + * @return Returns the int + */ + @JsonGetter("cycles_completed") + public int getCyclesCompleted() { + return cyclesCompleted; + } + + /** + * Setter for CyclesCompleted. + * The number of billing cycles that have completed. + * @param cyclesCompleted Value for int + */ + @JsonSetter("cycles_completed") + public void setCyclesCompleted(int cyclesCompleted) { + this.cyclesCompleted = cyclesCompleted; + } + + /** + * Getter for CyclesRemaining. + * For a finite billing cycle, cycles_remaining is the number of remaining cycles. For an + * infinite billing cycle, cycles_remaining is set as 0. + * @return Returns the Integer + */ + @JsonGetter("cycles_remaining") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getCyclesRemaining() { + return cyclesRemaining; + } + + /** + * Setter for CyclesRemaining. + * For a finite billing cycle, cycles_remaining is the number of remaining cycles. For an + * infinite billing cycle, cycles_remaining is set as 0. + * @param cyclesRemaining Value for Integer + */ + @JsonSetter("cycles_remaining") + public void setCyclesRemaining(Integer cyclesRemaining) { + this.cyclesRemaining = cyclesRemaining; + } + + /** + * Getter for CurrentPricingSchemeVersion. + * The active pricing scheme version for the billing cycle. + * @return Returns the Integer + */ + @JsonGetter("current_pricing_scheme_version") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getCurrentPricingSchemeVersion() { + return currentPricingSchemeVersion; + } + + /** + * Setter for CurrentPricingSchemeVersion. + * The active pricing scheme version for the billing cycle. + * @param currentPricingSchemeVersion Value for Integer + */ + @JsonSetter("current_pricing_scheme_version") + public void setCurrentPricingSchemeVersion(Integer currentPricingSchemeVersion) { + this.currentPricingSchemeVersion = currentPricingSchemeVersion; + } + + /** + * Getter for TotalCycles. + * 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). + * @return Returns the Integer + */ + @JsonGetter("total_cycles") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalCycles() { + return totalCycles; + } + + /** + * Setter for TotalCycles. + * 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). + * @param totalCycles Value for Integer + */ + @JsonSetter("total_cycles") + public void setTotalCycles(Integer totalCycles) { + this.totalCycles = totalCycles; + } + + /** + * Converts this CycleExecution into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "CycleExecution [" + "tenureType=" + tenureType + ", sequence=" + sequence + + ", cyclesCompleted=" + cyclesCompleted + ", cyclesRemaining=" + cyclesRemaining + + ", currentPricingSchemeVersion=" + currentPricingSchemeVersion + ", totalCycles=" + + totalCycles + "]"; + } + + /** + * Builds a new {@link CycleExecution.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link CycleExecution.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(tenureType, sequence, cyclesCompleted) + .cyclesRemaining(getCyclesRemaining()) + .currentPricingSchemeVersion(getCurrentPricingSchemeVersion()) + .totalCycles(getTotalCycles()); + return builder; + } + + /** + * Class to build instances of {@link CycleExecution}. + */ + public static class Builder { + private TenureType tenureType; + private int sequence; + private int cyclesCompleted; + private Integer cyclesRemaining; + private Integer currentPricingSchemeVersion; + private Integer totalCycles; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param tenureType TenureType value for tenureType. + * @param sequence int value for sequence. + * @param cyclesCompleted int value for cyclesCompleted. + */ + public Builder(TenureType tenureType, int sequence, int cyclesCompleted) { + this.tenureType = tenureType; + this.sequence = sequence; + this.cyclesCompleted = cyclesCompleted; + } + + /** + * Setter for tenureType. + * @param tenureType TenureType value for tenureType. + * @return Builder + */ + public Builder tenureType(TenureType tenureType) { + this.tenureType = tenureType; + return this; + } + + /** + * Setter for sequence. + * @param sequence int value for sequence. + * @return Builder + */ + public Builder sequence(int sequence) { + this.sequence = sequence; + return this; + } + + /** + * Setter for cyclesCompleted. + * @param cyclesCompleted int value for cyclesCompleted. + * @return Builder + */ + public Builder cyclesCompleted(int cyclesCompleted) { + this.cyclesCompleted = cyclesCompleted; + return this; + } + + /** + * Setter for cyclesRemaining. + * @param cyclesRemaining Integer value for cyclesRemaining. + * @return Builder + */ + public Builder cyclesRemaining(Integer cyclesRemaining) { + this.cyclesRemaining = cyclesRemaining; + return this; + } + + /** + * Setter for currentPricingSchemeVersion. + * @param currentPricingSchemeVersion Integer value for currentPricingSchemeVersion. + * @return Builder + */ + public Builder currentPricingSchemeVersion(Integer currentPricingSchemeVersion) { + this.currentPricingSchemeVersion = currentPricingSchemeVersion; + return this; + } + + /** + * Setter for totalCycles. + * @param totalCycles Integer value for totalCycles. + * @return Builder + */ + public Builder totalCycles(Integer totalCycles) { + this.totalCycles = totalCycles; + return this; + } + + /** + * Builds a new {@link CycleExecution} object using the set fields. + * @return {@link CycleExecution} + */ + public CycleExecution build() { + return new CycleExecution(tenureType, sequence, cyclesCompleted, cyclesRemaining, + currentPricingSchemeVersion, totalCycles); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ExperienceContext.java b/src/main/java/com/paypal/sdk/models/ExperienceContext.java index 1a0737c..cdca4fa 100644 --- a/src/main/java/com/paypal/sdk/models/ExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/ExperienceContext.java @@ -16,7 +16,7 @@ public class ExperienceContext { private String brandName; private String locale; - private ShippingPreference shippingPreference; + private ExperienceContextShippingPreference shippingPreference; private String returnUrl; private String cancelUrl; @@ -24,21 +24,21 @@ public class ExperienceContext { * Default constructor. */ public ExperienceContext() { - shippingPreference = ShippingPreference.GET_FROM_FILE; + shippingPreference = ExperienceContextShippingPreference.GET_FROM_FILE; } /** * Initialization constructor. * @param brandName String value for brandName. * @param locale String value for locale. - * @param shippingPreference ShippingPreference value for shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for shippingPreference. * @param returnUrl String value for returnUrl. * @param cancelUrl String value for cancelUrl. */ public ExperienceContext( String brandName, String locale, - ShippingPreference shippingPreference, + ExperienceContextShippingPreference shippingPreference, String returnUrl, String cancelUrl) { this.brandName = brandName; @@ -107,21 +107,21 @@ public void setLocale(String locale) { /** * Getter for ShippingPreference. * The location from which the shipping address is derived. - * @return Returns the ShippingPreference + * @return Returns the ExperienceContextShippingPreference */ @JsonGetter("shipping_preference") @JsonInclude(JsonInclude.Include.NON_NULL) - public ShippingPreference getShippingPreference() { + public ExperienceContextShippingPreference getShippingPreference() { return shippingPreference; } /** * Setter for ShippingPreference. * The location from which the shipping address is derived. - * @param shippingPreference Value for ShippingPreference + * @param shippingPreference Value for ExperienceContextShippingPreference */ @JsonSetter("shipping_preference") - public void setShippingPreference(ShippingPreference shippingPreference) { + public void setShippingPreference(ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; } @@ -199,7 +199,8 @@ public Builder toBuilder() { public static class Builder { private String brandName; private String locale; - private ShippingPreference shippingPreference = ShippingPreference.GET_FROM_FILE; + private ExperienceContextShippingPreference shippingPreference = + ExperienceContextShippingPreference.GET_FROM_FILE; private String returnUrl; private String cancelUrl; @@ -227,10 +228,12 @@ public Builder locale(String locale) { /** * Setter for shippingPreference. - * @param shippingPreference ShippingPreference value for shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for + * shippingPreference. * @return Builder */ - public Builder shippingPreference(ShippingPreference shippingPreference) { + public Builder shippingPreference( + ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/ExperienceContextShippingPreference.java b/src/main/java/com/paypal/sdk/models/ExperienceContextShippingPreference.java new file mode 100644 index 0000000..d6b17bf --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ExperienceContextShippingPreference.java @@ -0,0 +1,117 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * ExperienceContextShippingPreference to be used. + */ +public enum ExperienceContextShippingPreference { + /** + * Get the customer-provided shipping address on the PayPal site. + */ + GET_FROM_FILE, + + /** + * Redacts the shipping address from the PayPal site. Recommended for digital goods. + */ + NO_SHIPPING, + + /** + * Merchant sends the shipping address using purchase_units.shipping.address. The customer cannot change this address on the PayPal site. + */ + SET_PROVIDED_ADDRESS, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + GET_FROM_FILE.value = "GET_FROM_FILE"; + NO_SHIPPING.value = "NO_SHIPPING"; + SET_PROVIDED_ADDRESS.value = "SET_PROVIDED_ADDRESS"; + _UNKNOWN.value = null; + + valueMap.put("GET_FROM_FILE", GET_FROM_FILE); + valueMap.put("NO_SHIPPING", NO_SHIPPING); + valueMap.put("SET_PROVIDED_ADDRESS", SET_PROVIDED_ADDRESS); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static ExperienceContextShippingPreference constructFromString(String toConvert) throws IOException { + ExperienceContextShippingPreference enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static ExperienceContextShippingPreference fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of ExperienceContextShippingPreference values to list of string values. + * @param toConvert The list of ExperienceContextShippingPreference values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (ExperienceContextShippingPreference enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/ExperienceStatus.java b/src/main/java/com/paypal/sdk/models/ExperienceStatus.java new file mode 100644 index 0000000..a840f43 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ExperienceStatus.java @@ -0,0 +1,124 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * ExperienceStatus to be used. + */ +public enum ExperienceStatus { + /** + * PayPal checkout process has not yet begun. + */ + NOT_STARTED, + + /** + * PayPal checkout initiated. User is on the checkout page for order review before approval. + */ + IN_PROGRESS, + + /** + * PayPal checkout is canceled (by closing the checkout window or clicking cancel) before the order approval. + */ + CANCELED, + + /** + * Order is approved. User has completed the checkout process. + */ + APPROVED, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + NOT_STARTED.value = "NOT_STARTED"; + IN_PROGRESS.value = "IN_PROGRESS"; + CANCELED.value = "CANCELED"; + APPROVED.value = "APPROVED"; + _UNKNOWN.value = null; + + valueMap.put("NOT_STARTED", NOT_STARTED); + valueMap.put("IN_PROGRESS", IN_PROGRESS); + valueMap.put("CANCELED", CANCELED); + valueMap.put("APPROVED", APPROVED); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static ExperienceStatus constructFromString(String toConvert) throws IOException { + ExperienceStatus enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static ExperienceStatus fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of ExperienceStatus values to list of string values. + * @param toConvert The list of ExperienceStatus values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (ExperienceStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/FailedPaymentDetails.java b/src/main/java/com/paypal/sdk/models/FailedPaymentDetails.java new file mode 100644 index 0000000..a1397e6 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/FailedPaymentDetails.java @@ -0,0 +1,235 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for FailedPaymentDetails type. + */ +public class FailedPaymentDetails { + private Money amount; + private String time; + private ReasonCode reasonCode; + private String nextPaymentRetryTime; + + /** + * Default constructor. + */ + public FailedPaymentDetails() { + } + + /** + * Initialization constructor. + * @param amount Money value for amount. + * @param time String value for time. + * @param reasonCode ReasonCode value for reasonCode. + * @param nextPaymentRetryTime String value for nextPaymentRetryTime. + */ + public FailedPaymentDetails( + Money amount, + String time, + ReasonCode reasonCode, + String nextPaymentRetryTime) { + this.amount = amount; + this.time = time; + this.reasonCode = reasonCode; + this.nextPaymentRetryTime = nextPaymentRetryTime; + } + + /** + * Getter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("amount") + public Money getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param amount Value for Money + */ + @JsonSetter("amount") + public void setAmount(Money amount) { + this.amount = amount; + } + + /** + * Getter for Time. + * 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. + * @return Returns the String + */ + @JsonGetter("time") + public String getTime() { + return time; + } + + /** + * Setter for Time. + * 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. + * @param time Value for String + */ + @JsonSetter("time") + public void setTime(String time) { + this.time = time; + } + + /** + * Getter for ReasonCode. + * The reason code for the payment failure. + * @return Returns the ReasonCode + */ + @JsonGetter("reason_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ReasonCode getReasonCode() { + return reasonCode; + } + + /** + * Setter for ReasonCode. + * The reason code for the payment failure. + * @param reasonCode Value for ReasonCode + */ + @JsonSetter("reason_code") + public void setReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + } + + /** + * Getter for NextPaymentRetryTime. + * 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. + * @return Returns the String + */ + @JsonGetter("next_payment_retry_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getNextPaymentRetryTime() { + return nextPaymentRetryTime; + } + + /** + * Setter for NextPaymentRetryTime. + * 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. + * @param nextPaymentRetryTime Value for String + */ + @JsonSetter("next_payment_retry_time") + public void setNextPaymentRetryTime(String nextPaymentRetryTime) { + this.nextPaymentRetryTime = nextPaymentRetryTime; + } + + /** + * Converts this FailedPaymentDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "FailedPaymentDetails [" + "amount=" + amount + ", time=" + time + ", reasonCode=" + + reasonCode + ", nextPaymentRetryTime=" + nextPaymentRetryTime + "]"; + } + + /** + * Builds a new {@link FailedPaymentDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link FailedPaymentDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(amount, time) + .reasonCode(getReasonCode()) + .nextPaymentRetryTime(getNextPaymentRetryTime()); + return builder; + } + + /** + * Class to build instances of {@link FailedPaymentDetails}. + */ + public static class Builder { + private Money amount; + private String time; + private ReasonCode reasonCode; + private String nextPaymentRetryTime; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param amount Money value for amount. + * @param time String value for time. + */ + public Builder(Money amount, String time) { + this.amount = amount; + this.time = time; + } + + /** + * Setter for amount. + * @param amount Money value for amount. + * @return Builder + */ + public Builder amount(Money amount) { + this.amount = amount; + return this; + } + + /** + * Setter for time. + * @param time String value for time. + * @return Builder + */ + public Builder time(String time) { + this.time = time; + return this; + } + + /** + * Setter for reasonCode. + * @param reasonCode ReasonCode value for reasonCode. + * @return Builder + */ + public Builder reasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Setter for nextPaymentRetryTime. + * @param nextPaymentRetryTime String value for nextPaymentRetryTime. + * @return Builder + */ + public Builder nextPaymentRetryTime(String nextPaymentRetryTime) { + this.nextPaymentRetryTime = nextPaymentRetryTime; + return this; + } + + /** + * Builds a new {@link FailedPaymentDetails} object using the set fields. + * @return {@link FailedPaymentDetails} + */ + public FailedPaymentDetails build() { + return new FailedPaymentDetails(amount, time, reasonCode, nextPaymentRetryTime); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/Frequency.java b/src/main/java/com/paypal/sdk/models/Frequency.java new file mode 100644 index 0000000..048dcc4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/Frequency.java @@ -0,0 +1,158 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for Frequency type. + */ +public class Frequency { + private IntervalUnit intervalUnit; + private Integer intervalCount; + + /** + * Default constructor. + */ + public Frequency() { + intervalCount = 1; + } + + /** + * Initialization constructor. + * @param intervalUnit IntervalUnit value for intervalUnit. + * @param intervalCount Integer value for intervalCount. + */ + public Frequency( + IntervalUnit intervalUnit, + Integer intervalCount) { + this.intervalUnit = intervalUnit; + this.intervalCount = intervalCount; + } + + /** + * Getter for IntervalUnit. + * The interval at which the subscription is charged or billed. + * @return Returns the IntervalUnit + */ + @JsonGetter("interval_unit") + public IntervalUnit getIntervalUnit() { + return intervalUnit; + } + + /** + * Setter for IntervalUnit. + * The interval at which the subscription is charged or billed. + * @param intervalUnit Value for IntervalUnit + */ + @JsonSetter("interval_unit") + public void setIntervalUnit(IntervalUnit intervalUnit) { + this.intervalUnit = intervalUnit; + } + + /** + * Getter for IntervalCount. + * 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 + * @return Returns the Integer + */ + @JsonGetter("interval_count") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getIntervalCount() { + return intervalCount; + } + + /** + * Setter for IntervalCount. + * 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 + * @param intervalCount Value for Integer + */ + @JsonSetter("interval_count") + public void setIntervalCount(Integer intervalCount) { + this.intervalCount = intervalCount; + } + + /** + * Converts this Frequency into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "Frequency [" + "intervalUnit=" + intervalUnit + ", intervalCount=" + intervalCount + + "]"; + } + + /** + * Builds a new {@link Frequency.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link Frequency.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(intervalUnit) + .intervalCount(getIntervalCount()); + return builder; + } + + /** + * Class to build instances of {@link Frequency}. + */ + public static class Builder { + private IntervalUnit intervalUnit; + private Integer intervalCount = 1; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param intervalUnit IntervalUnit value for intervalUnit. + */ + public Builder(IntervalUnit intervalUnit) { + this.intervalUnit = intervalUnit; + } + + /** + * Setter for intervalUnit. + * @param intervalUnit IntervalUnit value for intervalUnit. + * @return Builder + */ + public Builder intervalUnit(IntervalUnit intervalUnit) { + this.intervalUnit = intervalUnit; + return this; + } + + /** + * Setter for intervalCount. + * @param intervalCount Integer value for intervalCount. + * @return Builder + */ + public Builder intervalCount(Integer intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** + * Builds a new {@link Frequency} object using the set fields. + * @return {@link Frequency} + */ + public Frequency build() { + return new Frequency(intervalUnit, intervalCount); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/GetSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/GetSubscriptionInput.java new file mode 100644 index 0000000..f4da81f --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/GetSubscriptionInput.java @@ -0,0 +1,150 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for GetSubscriptionInput type. + */ +public class GetSubscriptionInput { + private String id; + private String fields; + + /** + * Default constructor. + */ + public GetSubscriptionInput() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param fields String value for fields. + */ + public GetSubscriptionInput( + String id, + String fields) { + this.id = id; + this.fields = fields; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for Fields. + * List of fields that are to be returned in the response. Possible value for fields are + * last_failed_payment and plan. + * @return Returns the String + */ + @JsonGetter("fields") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFields() { + return fields; + } + + /** + * Setter for Fields. + * List of fields that are to be returned in the response. Possible value for fields are + * last_failed_payment and plan. + * @param fields Value for String + */ + @JsonSetter("fields") + public void setFields(String fields) { + this.fields = fields; + } + + /** + * Converts this GetSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "GetSubscriptionInput [" + "id=" + id + ", fields=" + fields + "]"; + } + + /** + * Builds a new {@link GetSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link GetSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id) + .fields(getFields()); + return builder; + } + + /** + * Class to build instances of {@link GetSubscriptionInput}. + */ + public static class Builder { + private String id; + private String fields; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + */ + public Builder(String id) { + this.id = id; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for fields. + * @param fields String value for fields. + * @return Builder + */ + public Builder fields(String fields) { + this.fields = fields; + return this; + } + + /** + * Builds a new {@link GetSubscriptionInput} object using the set fields. + * @return {@link GetSubscriptionInput} + */ + public GetSubscriptionInput build() { + return new GetSubscriptionInput(id, fields); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/IncentiveDetails.java b/src/main/java/com/paypal/sdk/models/IncentiveDetails.java new file mode 100644 index 0000000..eb6dc7f --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/IncentiveDetails.java @@ -0,0 +1,215 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for IncentiveDetails type. + */ +public class IncentiveDetails { + private String incentiveType; + private String incentiveCode; + private Money incentiveAmount; + private String incentiveProgramCode; + + /** + * Default constructor. + */ + public IncentiveDetails() { + } + + /** + * Initialization constructor. + * @param incentiveType String value for incentiveType. + * @param incentiveCode String value for incentiveCode. + * @param incentiveAmount Money value for incentiveAmount. + * @param incentiveProgramCode String value for incentiveProgramCode. + */ + public IncentiveDetails( + String incentiveType, + String incentiveCode, + Money incentiveAmount, + String incentiveProgramCode) { + this.incentiveType = incentiveType; + this.incentiveCode = incentiveCode; + this.incentiveAmount = incentiveAmount; + this.incentiveProgramCode = incentiveProgramCode; + } + + /** + * Getter for IncentiveType. + * The type of incentive, such as a special offer or coupon. + * @return Returns the String + */ + @JsonGetter("incentive_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getIncentiveType() { + return incentiveType; + } + + /** + * Setter for IncentiveType. + * The type of incentive, such as a special offer or coupon. + * @param incentiveType Value for String + */ + @JsonSetter("incentive_type") + public void setIncentiveType(String incentiveType) { + this.incentiveType = incentiveType; + } + + /** + * Getter for IncentiveCode. + * The code that identifies an incentive, such as a coupon. + * @return Returns the String + */ + @JsonGetter("incentive_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getIncentiveCode() { + return incentiveCode; + } + + /** + * Setter for IncentiveCode. + * The code that identifies an incentive, such as a coupon. + * @param incentiveCode Value for String + */ + @JsonSetter("incentive_code") + public void setIncentiveCode(String incentiveCode) { + this.incentiveCode = incentiveCode; + } + + /** + * Getter for IncentiveAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("incentive_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getIncentiveAmount() { + return incentiveAmount; + } + + /** + * Setter for IncentiveAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param incentiveAmount Value for Money + */ + @JsonSetter("incentive_amount") + public void setIncentiveAmount(Money incentiveAmount) { + this.incentiveAmount = incentiveAmount; + } + + /** + * Getter for IncentiveProgramCode. + * The incentive program code that identifies a merchant loyalty or incentive program. + * @return Returns the String + */ + @JsonGetter("incentive_program_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getIncentiveProgramCode() { + return incentiveProgramCode; + } + + /** + * Setter for IncentiveProgramCode. + * The incentive program code that identifies a merchant loyalty or incentive program. + * @param incentiveProgramCode Value for String + */ + @JsonSetter("incentive_program_code") + public void setIncentiveProgramCode(String incentiveProgramCode) { + this.incentiveProgramCode = incentiveProgramCode; + } + + /** + * Converts this IncentiveDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "IncentiveDetails [" + "incentiveType=" + incentiveType + ", incentiveCode=" + + incentiveCode + ", incentiveAmount=" + incentiveAmount + ", incentiveProgramCode=" + + incentiveProgramCode + "]"; + } + + /** + * Builds a new {@link IncentiveDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link IncentiveDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .incentiveType(getIncentiveType()) + .incentiveCode(getIncentiveCode()) + .incentiveAmount(getIncentiveAmount()) + .incentiveProgramCode(getIncentiveProgramCode()); + return builder; + } + + /** + * Class to build instances of {@link IncentiveDetails}. + */ + public static class Builder { + private String incentiveType; + private String incentiveCode; + private Money incentiveAmount; + private String incentiveProgramCode; + + + + /** + * Setter for incentiveType. + * @param incentiveType String value for incentiveType. + * @return Builder + */ + public Builder incentiveType(String incentiveType) { + this.incentiveType = incentiveType; + return this; + } + + /** + * Setter for incentiveCode. + * @param incentiveCode String value for incentiveCode. + * @return Builder + */ + public Builder incentiveCode(String incentiveCode) { + this.incentiveCode = incentiveCode; + return this; + } + + /** + * Setter for incentiveAmount. + * @param incentiveAmount Money value for incentiveAmount. + * @return Builder + */ + public Builder incentiveAmount(Money incentiveAmount) { + this.incentiveAmount = incentiveAmount; + return this; + } + + /** + * Setter for incentiveProgramCode. + * @param incentiveProgramCode String value for incentiveProgramCode. + * @return Builder + */ + public Builder incentiveProgramCode(String incentiveProgramCode) { + this.incentiveProgramCode = incentiveProgramCode; + return this; + } + + /** + * Builds a new {@link IncentiveDetails} object using the set fields. + * @return {@link IncentiveDetails} + */ + public IncentiveDetails build() { + return new IncentiveDetails(incentiveType, incentiveCode, incentiveAmount, + incentiveProgramCode); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/IncentiveInformation.java b/src/main/java/com/paypal/sdk/models/IncentiveInformation.java new file mode 100644 index 0000000..bc012a5 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/IncentiveInformation.java @@ -0,0 +1,102 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for IncentiveInformation type. + */ +public class IncentiveInformation { + private List incentiveDetails; + + /** + * Default constructor. + */ + public IncentiveInformation() { + } + + /** + * Initialization constructor. + * @param incentiveDetails List of IncentiveDetails value for incentiveDetails. + */ + public IncentiveInformation( + List incentiveDetails) { + this.incentiveDetails = incentiveDetails; + } + + /** + * Getter for IncentiveDetails. + * An array of incentive details. + * @return Returns the List of IncentiveDetails + */ + @JsonGetter("incentive_details") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getIncentiveDetails() { + return incentiveDetails; + } + + /** + * Setter for IncentiveDetails. + * An array of incentive details. + * @param incentiveDetails Value for List of IncentiveDetails + */ + @JsonSetter("incentive_details") + public void setIncentiveDetails(List incentiveDetails) { + this.incentiveDetails = incentiveDetails; + } + + /** + * Converts this IncentiveInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "IncentiveInformation [" + "incentiveDetails=" + incentiveDetails + "]"; + } + + /** + * Builds a new {@link IncentiveInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link IncentiveInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .incentiveDetails(getIncentiveDetails()); + return builder; + } + + /** + * Class to build instances of {@link IncentiveInformation}. + */ + public static class Builder { + private List incentiveDetails; + + + + /** + * Setter for incentiveDetails. + * @param incentiveDetails List of IncentiveDetails value for incentiveDetails. + * @return Builder + */ + public Builder incentiveDetails(List incentiveDetails) { + this.incentiveDetails = incentiveDetails; + return this; + } + + /** + * Builds a new {@link IncentiveInformation} object using the set fields. + * @return {@link IncentiveInformation} + */ + public IncentiveInformation build() { + return new IncentiveInformation(incentiveDetails); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/IntervalUnit.java b/src/main/java/com/paypal/sdk/models/IntervalUnit.java new file mode 100644 index 0000000..20c917e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/IntervalUnit.java @@ -0,0 +1,124 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * IntervalUnit to be used. + */ +public enum IntervalUnit { + /** + * A daily billing cycle. + */ + DAY, + + /** + * A weekly billing cycle. + */ + WEEK, + + /** + * A monthly billing cycle. + */ + MONTH, + + /** + * A yearly billing cycle. + */ + YEAR, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + DAY.value = "DAY"; + WEEK.value = "WEEK"; + MONTH.value = "MONTH"; + YEAR.value = "YEAR"; + _UNKNOWN.value = null; + + valueMap.put("DAY", DAY); + valueMap.put("WEEK", WEEK); + valueMap.put("MONTH", MONTH); + valueMap.put("YEAR", YEAR); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static IntervalUnit constructFromString(String toConvert) throws IOException { + IntervalUnit enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static IntervalUnit fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of IntervalUnit values to list of string values. + * @param toConvert The list of IntervalUnit values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (IntervalUnit enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/ItemDetails.java b/src/main/java/com/paypal/sdk/models/ItemDetails.java new file mode 100644 index 0000000..3b035b9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ItemDetails.java @@ -0,0 +1,783 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for ItemDetails type. + */ +public class ItemDetails { + private String itemCode; + private String itemName; + private String itemDescription; + private String itemOptions; + private String itemQuantity; + private Money itemUnitPrice; + private Money itemAmount; + private Money discountAmount; + private Money adjustmentAmount; + private Money giftWrapAmount; + private String taxPercentage; + private List taxAmounts; + private Money basicShippingAmount; + private Money extraShippingAmount; + private Money handlingAmount; + private Money insuranceAmount; + private Money totalItemAmount; + private String invoiceNumber; + private List checkoutOptions; + + /** + * Default constructor. + */ + public ItemDetails() { + } + + /** + * Initialization constructor. + * @param itemCode String value for itemCode. + * @param itemName String value for itemName. + * @param itemDescription String value for itemDescription. + * @param itemOptions String value for itemOptions. + * @param itemQuantity String value for itemQuantity. + * @param itemUnitPrice Money value for itemUnitPrice. + * @param itemAmount Money value for itemAmount. + * @param discountAmount Money value for discountAmount. + * @param adjustmentAmount Money value for adjustmentAmount. + * @param giftWrapAmount Money value for giftWrapAmount. + * @param taxPercentage String value for taxPercentage. + * @param taxAmounts List of TaxAmount value for taxAmounts. + * @param basicShippingAmount Money value for basicShippingAmount. + * @param extraShippingAmount Money value for extraShippingAmount. + * @param handlingAmount Money value for handlingAmount. + * @param insuranceAmount Money value for insuranceAmount. + * @param totalItemAmount Money value for totalItemAmount. + * @param invoiceNumber String value for invoiceNumber. + * @param checkoutOptions List of CheckoutOption value for checkoutOptions. + */ + public ItemDetails( + String itemCode, + String itemName, + String itemDescription, + String itemOptions, + String itemQuantity, + Money itemUnitPrice, + Money itemAmount, + Money discountAmount, + Money adjustmentAmount, + Money giftWrapAmount, + String taxPercentage, + List taxAmounts, + Money basicShippingAmount, + Money extraShippingAmount, + Money handlingAmount, + Money insuranceAmount, + Money totalItemAmount, + String invoiceNumber, + List checkoutOptions) { + this.itemCode = itemCode; + this.itemName = itemName; + this.itemDescription = itemDescription; + this.itemOptions = itemOptions; + this.itemQuantity = itemQuantity; + this.itemUnitPrice = itemUnitPrice; + this.itemAmount = itemAmount; + this.discountAmount = discountAmount; + this.adjustmentAmount = adjustmentAmount; + this.giftWrapAmount = giftWrapAmount; + this.taxPercentage = taxPercentage; + this.taxAmounts = taxAmounts; + this.basicShippingAmount = basicShippingAmount; + this.extraShippingAmount = extraShippingAmount; + this.handlingAmount = handlingAmount; + this.insuranceAmount = insuranceAmount; + this.totalItemAmount = totalItemAmount; + this.invoiceNumber = invoiceNumber; + this.checkoutOptions = checkoutOptions; + } + + /** + * Getter for ItemCode. + * An item code that identifies a merchant's goods or service. + * @return Returns the String + */ + @JsonGetter("item_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getItemCode() { + return itemCode; + } + + /** + * Setter for ItemCode. + * An item code that identifies a merchant's goods or service. + * @param itemCode Value for String + */ + @JsonSetter("item_code") + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + /** + * Getter for ItemName. + * The item name. + * @return Returns the String + */ + @JsonGetter("item_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getItemName() { + return itemName; + } + + /** + * Setter for ItemName. + * The item name. + * @param itemName Value for String + */ + @JsonSetter("item_name") + public void setItemName(String itemName) { + this.itemName = itemName; + } + + /** + * Getter for ItemDescription. + * The item description. + * @return Returns the String + */ + @JsonGetter("item_description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getItemDescription() { + return itemDescription; + } + + /** + * Setter for ItemDescription. + * The item description. + * @param itemDescription Value for String + */ + @JsonSetter("item_description") + public void setItemDescription(String itemDescription) { + this.itemDescription = itemDescription; + } + + /** + * Getter for ItemOptions. + * The item options. Describes option choices on the purchase of the item in some detail. + * @return Returns the String + */ + @JsonGetter("item_options") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getItemOptions() { + return itemOptions; + } + + /** + * Setter for ItemOptions. + * The item options. Describes option choices on the purchase of the item in some detail. + * @param itemOptions Value for String + */ + @JsonSetter("item_options") + public void setItemOptions(String itemOptions) { + this.itemOptions = itemOptions; + } + + /** + * Getter for ItemQuantity. + * The number of purchased units of goods or a service. + * @return Returns the String + */ + @JsonGetter("item_quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getItemQuantity() { + return itemQuantity; + } + + /** + * Setter for ItemQuantity. + * The number of purchased units of goods or a service. + * @param itemQuantity Value for String + */ + @JsonSetter("item_quantity") + public void setItemQuantity(String itemQuantity) { + this.itemQuantity = itemQuantity; + } + + /** + * Getter for ItemUnitPrice. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("item_unit_price") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getItemUnitPrice() { + return itemUnitPrice; + } + + /** + * Setter for ItemUnitPrice. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param itemUnitPrice Value for Money + */ + @JsonSetter("item_unit_price") + public void setItemUnitPrice(Money itemUnitPrice) { + this.itemUnitPrice = itemUnitPrice; + } + + /** + * Getter for ItemAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("item_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getItemAmount() { + return itemAmount; + } + + /** + * Setter for ItemAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param itemAmount Value for Money + */ + @JsonSetter("item_amount") + public void setItemAmount(Money itemAmount) { + this.itemAmount = itemAmount; + } + + /** + * Getter for DiscountAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("discount_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getDiscountAmount() { + return discountAmount; + } + + /** + * Setter for DiscountAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param discountAmount Value for Money + */ + @JsonSetter("discount_amount") + public void setDiscountAmount(Money discountAmount) { + this.discountAmount = discountAmount; + } + + /** + * Getter for AdjustmentAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("adjustment_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getAdjustmentAmount() { + return adjustmentAmount; + } + + /** + * Setter for AdjustmentAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param adjustmentAmount Value for Money + */ + @JsonSetter("adjustment_amount") + public void setAdjustmentAmount(Money adjustmentAmount) { + this.adjustmentAmount = adjustmentAmount; + } + + /** + * Getter for GiftWrapAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("gift_wrap_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getGiftWrapAmount() { + return giftWrapAmount; + } + + /** + * Setter for GiftWrapAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param giftWrapAmount Value for Money + */ + @JsonSetter("gift_wrap_amount") + public void setGiftWrapAmount(Money giftWrapAmount) { + this.giftWrapAmount = giftWrapAmount; + } + + /** + * Getter for TaxPercentage. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @return Returns the String + */ + @JsonGetter("tax_percentage") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTaxPercentage() { + return taxPercentage; + } + + /** + * Setter for TaxPercentage. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @param taxPercentage Value for String + */ + @JsonSetter("tax_percentage") + public void setTaxPercentage(String taxPercentage) { + this.taxPercentage = taxPercentage; + } + + /** + * Getter for TaxAmounts. + * An array of tax amounts levied by a government on the purchase of goods or services. + * @return Returns the List of TaxAmount + */ + @JsonGetter("tax_amounts") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTaxAmounts() { + return taxAmounts; + } + + /** + * Setter for TaxAmounts. + * An array of tax amounts levied by a government on the purchase of goods or services. + * @param taxAmounts Value for List of TaxAmount + */ + @JsonSetter("tax_amounts") + public void setTaxAmounts(List taxAmounts) { + this.taxAmounts = taxAmounts; + } + + /** + * Getter for BasicShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("basic_shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getBasicShippingAmount() { + return basicShippingAmount; + } + + /** + * Setter for BasicShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param basicShippingAmount Value for Money + */ + @JsonSetter("basic_shipping_amount") + public void setBasicShippingAmount(Money basicShippingAmount) { + this.basicShippingAmount = basicShippingAmount; + } + + /** + * Getter for ExtraShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("extra_shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getExtraShippingAmount() { + return extraShippingAmount; + } + + /** + * Setter for ExtraShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param extraShippingAmount Value for Money + */ + @JsonSetter("extra_shipping_amount") + public void setExtraShippingAmount(Money extraShippingAmount) { + this.extraShippingAmount = extraShippingAmount; + } + + /** + * Getter for HandlingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("handling_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getHandlingAmount() { + return handlingAmount; + } + + /** + * Setter for HandlingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param handlingAmount Value for Money + */ + @JsonSetter("handling_amount") + public void setHandlingAmount(Money handlingAmount) { + this.handlingAmount = handlingAmount; + } + + /** + * Getter for InsuranceAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("insurance_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getInsuranceAmount() { + return insuranceAmount; + } + + /** + * Setter for InsuranceAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param insuranceAmount Value for Money + */ + @JsonSetter("insurance_amount") + public void setInsuranceAmount(Money insuranceAmount) { + this.insuranceAmount = insuranceAmount; + } + + /** + * Getter for TotalItemAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("total_item_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTotalItemAmount() { + return totalItemAmount; + } + + /** + * Setter for TotalItemAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param totalItemAmount Value for Money + */ + @JsonSetter("total_item_amount") + public void setTotalItemAmount(Money totalItemAmount) { + this.totalItemAmount = totalItemAmount; + } + + /** + * Getter for InvoiceNumber. + * The invoice number. An alphanumeric string that identifies a billing for a merchant. + * @return Returns the String + */ + @JsonGetter("invoice_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getInvoiceNumber() { + return invoiceNumber; + } + + /** + * Setter for InvoiceNumber. + * The invoice number. An alphanumeric string that identifies a billing for a merchant. + * @param invoiceNumber Value for String + */ + @JsonSetter("invoice_number") + public void setInvoiceNumber(String invoiceNumber) { + this.invoiceNumber = invoiceNumber; + } + + /** + * Getter for CheckoutOptions. + * An array of checkout options. Each option has a name and value. + * @return Returns the List of CheckoutOption + */ + @JsonGetter("checkout_options") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getCheckoutOptions() { + return checkoutOptions; + } + + /** + * Setter for CheckoutOptions. + * An array of checkout options. Each option has a name and value. + * @param checkoutOptions Value for List of CheckoutOption + */ + @JsonSetter("checkout_options") + public void setCheckoutOptions(List checkoutOptions) { + this.checkoutOptions = checkoutOptions; + } + + /** + * Converts this ItemDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ItemDetails [" + "itemCode=" + itemCode + ", itemName=" + itemName + + ", itemDescription=" + itemDescription + ", itemOptions=" + itemOptions + + ", itemQuantity=" + itemQuantity + ", itemUnitPrice=" + itemUnitPrice + + ", itemAmount=" + itemAmount + ", discountAmount=" + discountAmount + + ", adjustmentAmount=" + adjustmentAmount + ", giftWrapAmount=" + giftWrapAmount + + ", taxPercentage=" + taxPercentage + ", taxAmounts=" + taxAmounts + + ", basicShippingAmount=" + basicShippingAmount + ", extraShippingAmount=" + + extraShippingAmount + ", handlingAmount=" + handlingAmount + ", insuranceAmount=" + + insuranceAmount + ", totalItemAmount=" + totalItemAmount + ", invoiceNumber=" + + invoiceNumber + ", checkoutOptions=" + checkoutOptions + "]"; + } + + /** + * Builds a new {@link ItemDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ItemDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .itemCode(getItemCode()) + .itemName(getItemName()) + .itemDescription(getItemDescription()) + .itemOptions(getItemOptions()) + .itemQuantity(getItemQuantity()) + .itemUnitPrice(getItemUnitPrice()) + .itemAmount(getItemAmount()) + .discountAmount(getDiscountAmount()) + .adjustmentAmount(getAdjustmentAmount()) + .giftWrapAmount(getGiftWrapAmount()) + .taxPercentage(getTaxPercentage()) + .taxAmounts(getTaxAmounts()) + .basicShippingAmount(getBasicShippingAmount()) + .extraShippingAmount(getExtraShippingAmount()) + .handlingAmount(getHandlingAmount()) + .insuranceAmount(getInsuranceAmount()) + .totalItemAmount(getTotalItemAmount()) + .invoiceNumber(getInvoiceNumber()) + .checkoutOptions(getCheckoutOptions()); + return builder; + } + + /** + * Class to build instances of {@link ItemDetails}. + */ + public static class Builder { + private String itemCode; + private String itemName; + private String itemDescription; + private String itemOptions; + private String itemQuantity; + private Money itemUnitPrice; + private Money itemAmount; + private Money discountAmount; + private Money adjustmentAmount; + private Money giftWrapAmount; + private String taxPercentage; + private List taxAmounts; + private Money basicShippingAmount; + private Money extraShippingAmount; + private Money handlingAmount; + private Money insuranceAmount; + private Money totalItemAmount; + private String invoiceNumber; + private List checkoutOptions; + + + + /** + * Setter for itemCode. + * @param itemCode String value for itemCode. + * @return Builder + */ + public Builder itemCode(String itemCode) { + this.itemCode = itemCode; + return this; + } + + /** + * Setter for itemName. + * @param itemName String value for itemName. + * @return Builder + */ + public Builder itemName(String itemName) { + this.itemName = itemName; + return this; + } + + /** + * Setter for itemDescription. + * @param itemDescription String value for itemDescription. + * @return Builder + */ + public Builder itemDescription(String itemDescription) { + this.itemDescription = itemDescription; + return this; + } + + /** + * Setter for itemOptions. + * @param itemOptions String value for itemOptions. + * @return Builder + */ + public Builder itemOptions(String itemOptions) { + this.itemOptions = itemOptions; + return this; + } + + /** + * Setter for itemQuantity. + * @param itemQuantity String value for itemQuantity. + * @return Builder + */ + public Builder itemQuantity(String itemQuantity) { + this.itemQuantity = itemQuantity; + return this; + } + + /** + * Setter for itemUnitPrice. + * @param itemUnitPrice Money value for itemUnitPrice. + * @return Builder + */ + public Builder itemUnitPrice(Money itemUnitPrice) { + this.itemUnitPrice = itemUnitPrice; + return this; + } + + /** + * Setter for itemAmount. + * @param itemAmount Money value for itemAmount. + * @return Builder + */ + public Builder itemAmount(Money itemAmount) { + this.itemAmount = itemAmount; + return this; + } + + /** + * Setter for discountAmount. + * @param discountAmount Money value for discountAmount. + * @return Builder + */ + public Builder discountAmount(Money discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Setter for adjustmentAmount. + * @param adjustmentAmount Money value for adjustmentAmount. + * @return Builder + */ + public Builder adjustmentAmount(Money adjustmentAmount) { + this.adjustmentAmount = adjustmentAmount; + return this; + } + + /** + * Setter for giftWrapAmount. + * @param giftWrapAmount Money value for giftWrapAmount. + * @return Builder + */ + public Builder giftWrapAmount(Money giftWrapAmount) { + this.giftWrapAmount = giftWrapAmount; + return this; + } + + /** + * Setter for taxPercentage. + * @param taxPercentage String value for taxPercentage. + * @return Builder + */ + public Builder taxPercentage(String taxPercentage) { + this.taxPercentage = taxPercentage; + return this; + } + + /** + * Setter for taxAmounts. + * @param taxAmounts List of TaxAmount value for taxAmounts. + * @return Builder + */ + public Builder taxAmounts(List taxAmounts) { + this.taxAmounts = taxAmounts; + return this; + } + + /** + * Setter for basicShippingAmount. + * @param basicShippingAmount Money value for basicShippingAmount. + * @return Builder + */ + public Builder basicShippingAmount(Money basicShippingAmount) { + this.basicShippingAmount = basicShippingAmount; + return this; + } + + /** + * Setter for extraShippingAmount. + * @param extraShippingAmount Money value for extraShippingAmount. + * @return Builder + */ + public Builder extraShippingAmount(Money extraShippingAmount) { + this.extraShippingAmount = extraShippingAmount; + return this; + } + + /** + * Setter for handlingAmount. + * @param handlingAmount Money value for handlingAmount. + * @return Builder + */ + public Builder handlingAmount(Money handlingAmount) { + this.handlingAmount = handlingAmount; + return this; + } + + /** + * Setter for insuranceAmount. + * @param insuranceAmount Money value for insuranceAmount. + * @return Builder + */ + public Builder insuranceAmount(Money insuranceAmount) { + this.insuranceAmount = insuranceAmount; + return this; + } + + /** + * Setter for totalItemAmount. + * @param totalItemAmount Money value for totalItemAmount. + * @return Builder + */ + public Builder totalItemAmount(Money totalItemAmount) { + this.totalItemAmount = totalItemAmount; + return this; + } + + /** + * Setter for invoiceNumber. + * @param invoiceNumber String value for invoiceNumber. + * @return Builder + */ + public Builder invoiceNumber(String invoiceNumber) { + this.invoiceNumber = invoiceNumber; + return this; + } + + /** + * Setter for checkoutOptions. + * @param checkoutOptions List of CheckoutOption value for checkoutOptions. + * @return Builder + */ + public Builder checkoutOptions(List checkoutOptions) { + this.checkoutOptions = checkoutOptions; + return this; + } + + /** + * Builds a new {@link ItemDetails} object using the set fields. + * @return {@link ItemDetails} + */ + public ItemDetails build() { + return new ItemDetails(itemCode, itemName, itemDescription, itemOptions, itemQuantity, + itemUnitPrice, itemAmount, discountAmount, adjustmentAmount, giftWrapAmount, + taxPercentage, taxAmounts, basicShippingAmount, extraShippingAmount, + handlingAmount, insuranceAmount, totalItemAmount, invoiceNumber, + checkoutOptions); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ItemRequest.java b/src/main/java/com/paypal/sdk/models/ItemRequest.java new file mode 100644 index 0000000..b2757b9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ItemRequest.java @@ -0,0 +1,493 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ItemRequest type. + */ +public class ItemRequest { + private String name; + private Money unitAmount; + private Money tax; + private String quantity; + private String description; + private String sku; + private String url; + private ItemCategory category; + private String imageUrl; + private UniversalProductCode upc; + private OrderBillingPlan billingPlan; + + /** + * Default constructor. + */ + public ItemRequest() { + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param unitAmount Money value for unitAmount. + * @param quantity String value for quantity. + * @param tax Money value for tax. + * @param description String value for description. + * @param sku String value for sku. + * @param url String value for url. + * @param category ItemCategory value for category. + * @param imageUrl String value for imageUrl. + * @param upc UniversalProductCode value for upc. + * @param billingPlan OrderBillingPlan value for billingPlan. + */ + public ItemRequest( + String name, + Money unitAmount, + String quantity, + Money tax, + String description, + String sku, + String url, + ItemCategory category, + String imageUrl, + UniversalProductCode upc, + OrderBillingPlan billingPlan) { + this.name = name; + this.unitAmount = unitAmount; + this.tax = tax; + this.quantity = quantity; + this.description = description; + this.sku = sku; + this.url = url; + this.category = category; + this.imageUrl = imageUrl; + this.upc = upc; + this.billingPlan = billingPlan; + } + + /** + * Getter for Name. + * The item name or title. + * @return Returns the String + */ + @JsonGetter("name") + public String getName() { + return name; + } + + /** + * Setter for Name. + * The item name or title. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for UnitAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("unit_amount") + public Money getUnitAmount() { + return unitAmount; + } + + /** + * Setter for UnitAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param unitAmount Value for Money + */ + @JsonSetter("unit_amount") + public void setUnitAmount(Money unitAmount) { + this.unitAmount = unitAmount; + } + + /** + * Getter for Tax. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("tax") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTax() { + return tax; + } + + /** + * Setter for Tax. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param tax Value for Money + */ + @JsonSetter("tax") + public void setTax(Money tax) { + this.tax = tax; + } + + /** + * Getter for Quantity. + * The item quantity. Must be a whole number. + * @return Returns the String + */ + @JsonGetter("quantity") + public String getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The item quantity. Must be a whole number. + * @param quantity Value for String + */ + @JsonSetter("quantity") + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + * Getter for Description. + * This field supports up to 4000 characters, but any content beyond 2048 characters (including + * spaces) will be truncated. The 2048 character limit is reflected in the response + * representation of this field. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * This field supports up to 4000 characters, but any content beyond 2048 characters (including + * spaces) will be truncated. The 2048 character limit is reflected in the response + * representation of this field. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for Sku. + * The stock keeping unit (SKU) for the item. + * @return Returns the String + */ + @JsonGetter("sku") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSku() { + return sku; + } + + /** + * Setter for Sku. + * The stock keeping unit (SKU) for the item. + * @param sku Value for String + */ + @JsonSetter("sku") + public void setSku(String sku) { + this.sku = sku; + } + + /** + * Getter for Url. + * The URL to the item being purchased. Visible to buyer and used in buyer experiences. + * @return Returns the String + */ + @JsonGetter("url") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUrl() { + return url; + } + + /** + * Setter for Url. + * The URL to the item being purchased. Visible to buyer and used in buyer experiences. + * @param url Value for String + */ + @JsonSetter("url") + public void setUrl(String url) { + this.url = url; + } + + /** + * Getter for Category. + * The item category type. + * @return Returns the ItemCategory + */ + @JsonGetter("category") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ItemCategory getCategory() { + return category; + } + + /** + * Setter for Category. + * The item category type. + * @param category Value for ItemCategory + */ + @JsonSetter("category") + public void setCategory(ItemCategory category) { + this.category = category; + } + + /** + * Getter for ImageUrl. + * The URL of the item's image. File type and size restrictions apply. An image that violates + * these restrictions will not be honored. + * @return Returns the String + */ + @JsonGetter("image_url") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getImageUrl() { + return imageUrl; + } + + /** + * Setter for ImageUrl. + * The URL of the item's image. File type and size restrictions apply. An image that violates + * these restrictions will not be honored. + * @param imageUrl Value for String + */ + @JsonSetter("image_url") + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * Getter for Upc. + * The Universal Product Code of the item. + * @return Returns the UniversalProductCode + */ + @JsonGetter("upc") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UniversalProductCode getUpc() { + return upc; + } + + /** + * Setter for Upc. + * The Universal Product Code of the item. + * @param upc Value for UniversalProductCode + */ + @JsonSetter("upc") + public void setUpc(UniversalProductCode upc) { + this.upc = upc; + } + + /** + * Getter for BillingPlan. + * Metadata for merchant-managed recurring billing plans. Valid only during the saved payment + * method token or billing agreement creation. + * @return Returns the OrderBillingPlan + */ + @JsonGetter("billing_plan") + @JsonInclude(JsonInclude.Include.NON_NULL) + public OrderBillingPlan getBillingPlan() { + return billingPlan; + } + + /** + * Setter for BillingPlan. + * Metadata for merchant-managed recurring billing plans. Valid only during the saved payment + * method token or billing agreement creation. + * @param billingPlan Value for OrderBillingPlan + */ + @JsonSetter("billing_plan") + public void setBillingPlan(OrderBillingPlan billingPlan) { + this.billingPlan = billingPlan; + } + + /** + * Converts this ItemRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ItemRequest [" + "name=" + name + ", unitAmount=" + unitAmount + ", quantity=" + + quantity + ", tax=" + tax + ", description=" + description + ", sku=" + sku + + ", url=" + url + ", category=" + category + ", imageUrl=" + imageUrl + ", upc=" + + upc + ", billingPlan=" + billingPlan + "]"; + } + + /** + * Builds a new {@link ItemRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ItemRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(name, unitAmount, quantity) + .tax(getTax()) + .description(getDescription()) + .sku(getSku()) + .url(getUrl()) + .category(getCategory()) + .imageUrl(getImageUrl()) + .upc(getUpc()) + .billingPlan(getBillingPlan()); + return builder; + } + + /** + * Class to build instances of {@link ItemRequest}. + */ + public static class Builder { + private String name; + private Money unitAmount; + private String quantity; + private Money tax; + private String description; + private String sku; + private String url; + private ItemCategory category; + private String imageUrl; + private UniversalProductCode upc; + private OrderBillingPlan billingPlan; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param unitAmount Money value for unitAmount. + * @param quantity String value for quantity. + */ + public Builder(String name, Money unitAmount, String quantity) { + this.name = name; + this.unitAmount = unitAmount; + this.quantity = quantity; + } + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for unitAmount. + * @param unitAmount Money value for unitAmount. + * @return Builder + */ + public Builder unitAmount(Money unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Setter for quantity. + * @param quantity String value for quantity. + * @return Builder + */ + public Builder quantity(String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for tax. + * @param tax Money value for tax. + * @return Builder + */ + public Builder tax(Money tax) { + this.tax = tax; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Setter for sku. + * @param sku String value for sku. + * @return Builder + */ + public Builder sku(String sku) { + this.sku = sku; + return this; + } + + /** + * Setter for url. + * @param url String value for url. + * @return Builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * Setter for category. + * @param category ItemCategory value for category. + * @return Builder + */ + public Builder category(ItemCategory category) { + this.category = category; + return this; + } + + /** + * Setter for imageUrl. + * @param imageUrl String value for imageUrl. + * @return Builder + */ + public Builder imageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Setter for upc. + * @param upc UniversalProductCode value for upc. + * @return Builder + */ + public Builder upc(UniversalProductCode upc) { + this.upc = upc; + return this; + } + + /** + * Setter for billingPlan. + * @param billingPlan OrderBillingPlan value for billingPlan. + * @return Builder + */ + public Builder billingPlan(OrderBillingPlan billingPlan) { + this.billingPlan = billingPlan; + return this; + } + + /** + * Builds a new {@link ItemRequest} object using the set fields. + * @return {@link ItemRequest} + */ + public ItemRequest build() { + return new ItemRequest(name, unitAmount, quantity, tax, description, sku, url, category, + imageUrl, upc, billingPlan); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/LastPaymentDetails.java b/src/main/java/com/paypal/sdk/models/LastPaymentDetails.java new file mode 100644 index 0000000..ebfb0a8 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/LastPaymentDetails.java @@ -0,0 +1,144 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for LastPaymentDetails type. + */ +public class LastPaymentDetails { + private Money amount; + private String time; + + /** + * Default constructor. + */ + public LastPaymentDetails() { + } + + /** + * Initialization constructor. + * @param amount Money value for amount. + * @param time String value for time. + */ + public LastPaymentDetails( + Money amount, + String time) { + this.amount = amount; + this.time = time; + } + + /** + * Getter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param amount Value for Money + */ + @JsonSetter("amount") + public void setAmount(Money amount) { + this.amount = amount; + } + + /** + * Getter for Time. + * 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. + * @return Returns the String + */ + @JsonGetter("time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTime() { + return time; + } + + /** + * Setter for Time. + * 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. + * @param time Value for String + */ + @JsonSetter("time") + public void setTime(String time) { + this.time = time; + } + + /** + * Converts this LastPaymentDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "LastPaymentDetails [" + "amount=" + amount + ", time=" + time + "]"; + } + + /** + * Builds a new {@link LastPaymentDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link LastPaymentDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .amount(getAmount()) + .time(getTime()); + return builder; + } + + /** + * Class to build instances of {@link LastPaymentDetails}. + */ + public static class Builder { + private Money amount; + private String time; + + + + /** + * Setter for amount. + * @param amount Money value for amount. + * @return Builder + */ + public Builder amount(Money amount) { + this.amount = amount; + return this; + } + + /** + * Setter for time. + * @param time String value for time. + * @return Builder + */ + public Builder time(String time) { + this.time = time; + return this; + } + + /** + * Builds a new {@link LastPaymentDetails} object using the set fields. + * @return {@link LastPaymentDetails} + */ + public LastPaymentDetails build() { + return new LastPaymentDetails(amount, time); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/LinkHttpMethod.java b/src/main/java/com/paypal/sdk/models/LinkHttpMethod.java index c17a8ad..7f6190e 100644 --- a/src/main/java/com/paypal/sdk/models/LinkHttpMethod.java +++ b/src/main/java/com/paypal/sdk/models/LinkHttpMethod.java @@ -17,20 +17,44 @@ * LinkHttpMethod to be used. */ public enum LinkHttpMethod { + /** + * The HTTP GET method. + */ GET, + /** + * The HTTP POST method. + */ POST, + /** + * The HTTP PUT method. + */ PUT, + /** + * The HTTP DELETE method. + */ DELETE, + /** + * The HTTP HEAD method. + */ HEAD, + /** + * The HTTP CONNECT method. + */ CONNECT, + /** + * The HTTP OPTIONS method. + */ OPTIONS, + /** + * The HTTP PATCH method. + */ PATCH, /** diff --git a/src/main/java/com/paypal/sdk/models/ListBillingPlansInput.java b/src/main/java/com/paypal/sdk/models/ListBillingPlansInput.java new file mode 100644 index 0000000..b4599c0 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ListBillingPlansInput.java @@ -0,0 +1,267 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ListBillingPlansInput type. + */ +public class ListBillingPlansInput { + private String prefer; + private String productId; + private Integer pageSize; + private Integer page; + private Boolean totalRequired; + + /** + * Default constructor. + */ + public ListBillingPlansInput() { + prefer = "return=minimal"; + pageSize = 10; + page = 1; + totalRequired = false; + } + + /** + * Initialization constructor. + * @param prefer String value for prefer. + * @param productId String value for productId. + * @param pageSize Integer value for pageSize. + * @param page Integer value for page. + * @param totalRequired Boolean value for totalRequired. + */ + public ListBillingPlansInput( + String prefer, + String productId, + Integer pageSize, + Integer page, + Boolean totalRequired) { + this.prefer = prefer; + this.productId = productId; + this.pageSize = pageSize; + this.page = page; + this.totalRequired = totalRequired; + } + + /** + * Getter for Prefer. + * The preferred server response upon successful completion of the request. Value is: + * return=minimal. The server returns a minimal response to optimize communication between the + * API caller and the server. A minimal response includes the id, name, description and HATEOAS + * links. return=representation. The server returns a complete resource representation, + * including the current state of the resource. + * @return Returns the String + */ + @JsonGetter("Prefer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPrefer() { + return prefer; + } + + /** + * Setter for Prefer. + * The preferred server response upon successful completion of the request. Value is: + * return=minimal. The server returns a minimal response to optimize communication between the + * API caller and the server. A minimal response includes the id, name, description and HATEOAS + * links. return=representation. The server returns a complete resource representation, + * including the current state of the resource. + * @param prefer Value for String + */ + @JsonSetter("Prefer") + public void setPrefer(String prefer) { + this.prefer = prefer; + } + + /** + * Getter for ProductId. + * Filters the response by a Product ID. + * @return Returns the String + */ + @JsonGetter("product_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getProductId() { + return productId; + } + + /** + * Setter for ProductId. + * Filters the response by a Product ID. + * @param productId Value for String + */ + @JsonSetter("product_id") + public void setProductId(String productId) { + this.productId = productId; + } + + /** + * Getter for PageSize. + * The number of items to return in the response. + * @return Returns the Integer + */ + @JsonGetter("page_size") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPageSize() { + return pageSize; + } + + /** + * Setter for PageSize. + * The number of items to return in the response. + * @param pageSize Value for Integer + */ + @JsonSetter("page_size") + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + /** + * Getter for Page. + * A non-zero integer which is the start index of the entire list of items to return in the + * response. The combination of `page=1` and `page_size=20` returns the first 20 items. The + * combination of `page=2` and `page_size=20` returns the next 20 items. + * @return Returns the Integer + */ + @JsonGetter("page") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPage() { + return page; + } + + /** + * Setter for Page. + * A non-zero integer which is the start index of the entire list of items to return in the + * response. The combination of `page=1` and `page_size=20` returns the first 20 items. The + * combination of `page=2` and `page_size=20` returns the next 20 items. + * @param page Value for Integer + */ + @JsonSetter("page") + public void setPage(Integer page) { + this.page = page; + } + + /** + * Getter for TotalRequired. + * Indicates whether to show the total count in the response. + * @return Returns the Boolean + */ + @JsonGetter("total_required") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getTotalRequired() { + return totalRequired; + } + + /** + * Setter for TotalRequired. + * Indicates whether to show the total count in the response. + * @param totalRequired Value for Boolean + */ + @JsonSetter("total_required") + public void setTotalRequired(Boolean totalRequired) { + this.totalRequired = totalRequired; + } + + /** + * Converts this ListBillingPlansInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ListBillingPlansInput [" + "prefer=" + prefer + ", productId=" + productId + + ", pageSize=" + pageSize + ", page=" + page + ", totalRequired=" + totalRequired + + "]"; + } + + /** + * Builds a new {@link ListBillingPlansInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ListBillingPlansInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .prefer(getPrefer()) + .productId(getProductId()) + .pageSize(getPageSize()) + .page(getPage()) + .totalRequired(getTotalRequired()); + return builder; + } + + /** + * Class to build instances of {@link ListBillingPlansInput}. + */ + public static class Builder { + private String prefer = "return=minimal"; + private String productId; + private Integer pageSize = 10; + private Integer page = 1; + private Boolean totalRequired = false; + + + + /** + * Setter for prefer. + * @param prefer String value for prefer. + * @return Builder + */ + public Builder prefer(String prefer) { + this.prefer = prefer; + return this; + } + + /** + * Setter for productId. + * @param productId String value for productId. + * @return Builder + */ + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + /** + * Setter for pageSize. + * @param pageSize Integer value for pageSize. + * @return Builder + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Setter for page. + * @param page Integer value for page. + * @return Builder + */ + public Builder page(Integer page) { + this.page = page; + return this; + } + + /** + * Setter for totalRequired. + * @param totalRequired Boolean value for totalRequired. + * @return Builder + */ + public Builder totalRequired(Boolean totalRequired) { + this.totalRequired = totalRequired; + return this; + } + + /** + * Builds a new {@link ListBillingPlansInput} object using the set fields. + * @return {@link ListBillingPlansInput} + */ + public ListBillingPlansInput build() { + return new ListBillingPlansInput(prefer, productId, pageSize, page, totalRequired); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ListSubscriptionTransactionsInput.java b/src/main/java/com/paypal/sdk/models/ListSubscriptionTransactionsInput.java new file mode 100644 index 0000000..3d395b6 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ListSubscriptionTransactionsInput.java @@ -0,0 +1,185 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ListSubscriptionTransactionsInput type. + */ +public class ListSubscriptionTransactionsInput { + private String id; + private String startTime; + private String endTime; + + /** + * Default constructor. + */ + public ListSubscriptionTransactionsInput() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param startTime String value for startTime. + * @param endTime String value for endTime. + */ + public ListSubscriptionTransactionsInput( + String id, + String startTime, + String endTime) { + this.id = id; + this.startTime = startTime; + this.endTime = endTime; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for StartTime. + * The start time of the range of transactions to list. + * @return Returns the String + */ + @JsonGetter("start_time") + public String getStartTime() { + return startTime; + } + + /** + * Setter for StartTime. + * The start time of the range of transactions to list. + * @param startTime Value for String + */ + @JsonSetter("start_time") + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + /** + * Getter for EndTime. + * The end time of the range of transactions to list. + * @return Returns the String + */ + @JsonGetter("end_time") + public String getEndTime() { + return endTime; + } + + /** + * Setter for EndTime. + * The end time of the range of transactions to list. + * @param endTime Value for String + */ + @JsonSetter("end_time") + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + /** + * Converts this ListSubscriptionTransactionsInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ListSubscriptionTransactionsInput [" + "id=" + id + ", startTime=" + startTime + + ", endTime=" + endTime + "]"; + } + + /** + * Builds a new {@link ListSubscriptionTransactionsInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ListSubscriptionTransactionsInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, startTime, endTime); + return builder; + } + + /** + * Class to build instances of {@link ListSubscriptionTransactionsInput}. + */ + public static class Builder { + private String id; + private String startTime; + private String endTime; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param startTime String value for startTime. + * @param endTime String value for endTime. + */ + public Builder(String id, String startTime, String endTime) { + this.id = id; + this.startTime = startTime; + this.endTime = endTime; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for startTime. + * @param startTime String value for startTime. + * @return Builder + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Setter for endTime. + * @param endTime String value for endTime. + * @return Builder + */ + public Builder endTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Builds a new {@link ListSubscriptionTransactionsInput} object using the set fields. + * @return {@link ListSubscriptionTransactionsInput} + */ + public ListSubscriptionTransactionsInput build() { + return new ListSubscriptionTransactionsInput(id, startTime, endTime); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ListSubscriptionsInput.java b/src/main/java/com/paypal/sdk/models/ListSubscriptionsInput.java new file mode 100644 index 0000000..c5e979a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ListSubscriptionsInput.java @@ -0,0 +1,450 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for ListSubscriptionsInput type. + */ +public class ListSubscriptionsInput { + private String planIds; + private String statuses; + private String createdAfter; + private String createdBefore; + private String statusUpdatedBefore; + private String statusUpdatedAfter; + private String filter; + private Integer pageSize; + private Integer page; + private List customerIds; + + /** + * Default constructor. + */ + public ListSubscriptionsInput() { + pageSize = 10; + page = 1; + } + + /** + * Initialization constructor. + * @param planIds String value for planIds. + * @param statuses String value for statuses. + * @param createdAfter String value for createdAfter. + * @param createdBefore String value for createdBefore. + * @param statusUpdatedBefore String value for statusUpdatedBefore. + * @param statusUpdatedAfter String value for statusUpdatedAfter. + * @param filter String value for filter. + * @param pageSize Integer value for pageSize. + * @param page Integer value for page. + * @param customerIds List of String value for customerIds. + */ + public ListSubscriptionsInput( + String planIds, + String statuses, + String createdAfter, + String createdBefore, + String statusUpdatedBefore, + String statusUpdatedAfter, + String filter, + Integer pageSize, + Integer page, + List customerIds) { + this.planIds = planIds; + this.statuses = statuses; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.statusUpdatedBefore = statusUpdatedBefore; + this.statusUpdatedAfter = statusUpdatedAfter; + this.filter = filter; + this.pageSize = pageSize; + this.page = page; + this.customerIds = customerIds; + } + + /** + * Getter for PlanIds. + * Filters the response by list of plan IDs. Filter supports upto 70 plan IDs. URLs should not + * exceed a length of 2000 characters. + * @return Returns the String + */ + @JsonGetter("plan_ids") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPlanIds() { + return planIds; + } + + /** + * Setter for PlanIds. + * Filters the response by list of plan IDs. Filter supports upto 70 plan IDs. URLs should not + * exceed a length of 2000 characters. + * @param planIds Value for String + */ + @JsonSetter("plan_ids") + public void setPlanIds(String planIds) { + this.planIds = planIds; + } + + /** + * Getter for Statuses. + * Filters the response by list of subscription statuses. + * @return Returns the String + */ + @JsonGetter("statuses") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStatuses() { + return statuses; + } + + /** + * Setter for Statuses. + * Filters the response by list of subscription statuses. + * @param statuses Value for String + */ + @JsonSetter("statuses") + public void setStatuses(String statuses) { + this.statuses = statuses; + } + + /** + * Getter for CreatedAfter. + * Filters the response by subscription creation start time for a range of subscriptions. + * @return Returns the String + */ + @JsonGetter("created_after") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreatedAfter() { + return createdAfter; + } + + /** + * Setter for CreatedAfter. + * Filters the response by subscription creation start time for a range of subscriptions. + * @param createdAfter Value for String + */ + @JsonSetter("created_after") + public void setCreatedAfter(String createdAfter) { + this.createdAfter = createdAfter; + } + + /** + * Getter for CreatedBefore. + * Filters the response by subscription creation end time for a range of subscriptions. + * @return Returns the String + */ + @JsonGetter("created_before") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreatedBefore() { + return createdBefore; + } + + /** + * Setter for CreatedBefore. + * Filters the response by subscription creation end time for a range of subscriptions. + * @param createdBefore Value for String + */ + @JsonSetter("created_before") + public void setCreatedBefore(String createdBefore) { + this.createdBefore = createdBefore; + } + + /** + * Getter for StatusUpdatedBefore. + * Filters the response by status update start time for a range of subscriptions. + * @return Returns the String + */ + @JsonGetter("status_updated_before") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStatusUpdatedBefore() { + return statusUpdatedBefore; + } + + /** + * Setter for StatusUpdatedBefore. + * Filters the response by status update start time for a range of subscriptions. + * @param statusUpdatedBefore Value for String + */ + @JsonSetter("status_updated_before") + public void setStatusUpdatedBefore(String statusUpdatedBefore) { + this.statusUpdatedBefore = statusUpdatedBefore; + } + + /** + * Getter for StatusUpdatedAfter. + * Filters the response by status update end time for a range of subscriptions. + * @return Returns the String + */ + @JsonGetter("status_updated_after") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStatusUpdatedAfter() { + return statusUpdatedAfter; + } + + /** + * Setter for StatusUpdatedAfter. + * Filters the response by status update end time for a range of subscriptions. + * @param statusUpdatedAfter Value for String + */ + @JsonSetter("status_updated_after") + public void setStatusUpdatedAfter(String statusUpdatedAfter) { + this.statusUpdatedAfter = statusUpdatedAfter; + } + + /** + * Getter for Filter. + * Filter the response using complex expressions that could use comparison operators like ge, + * gt, le, lt and logical operators such as 'and' and 'or'. + * @return Returns the String + */ + @JsonGetter("filter") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFilter() { + return filter; + } + + /** + * Setter for Filter. + * Filter the response using complex expressions that could use comparison operators like ge, + * gt, le, lt and logical operators such as 'and' and 'or'. + * @param filter Value for String + */ + @JsonSetter("filter") + public void setFilter(String filter) { + this.filter = filter; + } + + /** + * Getter for PageSize. + * The number of items to return in the response. + * @return Returns the Integer + */ + @JsonGetter("page_size") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPageSize() { + return pageSize; + } + + /** + * Setter for PageSize. + * The number of items to return in the response. + * @param pageSize Value for Integer + */ + @JsonSetter("page_size") + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + /** + * Getter for Page. + * A non-zero integer which is the start index of the entire list of items to return in the + * response. The combination of `page=1` and `page_size=20` returns the first 20 items. The + * combination of `page=2` and `page_size=20` returns the next 20 items. + * @return Returns the Integer + */ + @JsonGetter("page") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPage() { + return page; + } + + /** + * Setter for Page. + * A non-zero integer which is the start index of the entire list of items to return in the + * response. The combination of `page=1` and `page_size=20` returns the first 20 items. The + * combination of `page=2` and `page_size=20` returns the next 20 items. + * @param page Value for Integer + */ + @JsonSetter("page") + public void setPage(Integer page) { + this.page = page; + } + + /** + * Getter for CustomerIds. + * Filters the response by comma separated vault customer IDs (FSS subscriptions only). + * @return Returns the List of String + */ + @JsonGetter("customer_ids") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getCustomerIds() { + return customerIds; + } + + /** + * Setter for CustomerIds. + * Filters the response by comma separated vault customer IDs (FSS subscriptions only). + * @param customerIds Value for List of String + */ + @JsonSetter("customer_ids") + public void setCustomerIds(List customerIds) { + this.customerIds = customerIds; + } + + /** + * Converts this ListSubscriptionsInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ListSubscriptionsInput [" + "planIds=" + planIds + ", statuses=" + statuses + + ", createdAfter=" + createdAfter + ", createdBefore=" + createdBefore + + ", statusUpdatedBefore=" + statusUpdatedBefore + ", statusUpdatedAfter=" + + statusUpdatedAfter + ", filter=" + filter + ", pageSize=" + pageSize + ", page=" + + page + ", customerIds=" + customerIds + "]"; + } + + /** + * Builds a new {@link ListSubscriptionsInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ListSubscriptionsInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .planIds(getPlanIds()) + .statuses(getStatuses()) + .createdAfter(getCreatedAfter()) + .createdBefore(getCreatedBefore()) + .statusUpdatedBefore(getStatusUpdatedBefore()) + .statusUpdatedAfter(getStatusUpdatedAfter()) + .filter(getFilter()) + .pageSize(getPageSize()) + .page(getPage()) + .customerIds(getCustomerIds()); + return builder; + } + + /** + * Class to build instances of {@link ListSubscriptionsInput}. + */ + public static class Builder { + private String planIds; + private String statuses; + private String createdAfter; + private String createdBefore; + private String statusUpdatedBefore; + private String statusUpdatedAfter; + private String filter; + private Integer pageSize = 10; + private Integer page = 1; + private List customerIds; + + + + /** + * Setter for planIds. + * @param planIds String value for planIds. + * @return Builder + */ + public Builder planIds(String planIds) { + this.planIds = planIds; + return this; + } + + /** + * Setter for statuses. + * @param statuses String value for statuses. + * @return Builder + */ + public Builder statuses(String statuses) { + this.statuses = statuses; + return this; + } + + /** + * Setter for createdAfter. + * @param createdAfter String value for createdAfter. + * @return Builder + */ + public Builder createdAfter(String createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + /** + * Setter for createdBefore. + * @param createdBefore String value for createdBefore. + * @return Builder + */ + public Builder createdBefore(String createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + /** + * Setter for statusUpdatedBefore. + * @param statusUpdatedBefore String value for statusUpdatedBefore. + * @return Builder + */ + public Builder statusUpdatedBefore(String statusUpdatedBefore) { + this.statusUpdatedBefore = statusUpdatedBefore; + return this; + } + + /** + * Setter for statusUpdatedAfter. + * @param statusUpdatedAfter String value for statusUpdatedAfter. + * @return Builder + */ + public Builder statusUpdatedAfter(String statusUpdatedAfter) { + this.statusUpdatedAfter = statusUpdatedAfter; + return this; + } + + /** + * Setter for filter. + * @param filter String value for filter. + * @return Builder + */ + public Builder filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Setter for pageSize. + * @param pageSize Integer value for pageSize. + * @return Builder + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Setter for page. + * @param page Integer value for page. + * @return Builder + */ + public Builder page(Integer page) { + this.page = page; + return this; + } + + /** + * Setter for customerIds. + * @param customerIds List of String value for customerIds. + * @return Builder + */ + public Builder customerIds(List customerIds) { + this.customerIds = customerIds; + return this; + } + + /** + * Builds a new {@link ListSubscriptionsInput} object using the set fields. + * @return {@link ListSubscriptionsInput} + */ + public ListSubscriptionsInput build() { + return new ListSubscriptionsInput(planIds, statuses, createdAfter, createdBefore, + statusUpdatedBefore, statusUpdatedAfter, filter, pageSize, page, customerIds); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/MerchantPreferences.java b/src/main/java/com/paypal/sdk/models/MerchantPreferences.java new file mode 100644 index 0000000..b5b13da --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/MerchantPreferences.java @@ -0,0 +1,139 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for MerchantPreferences type. + */ +public class MerchantPreferences { + private String returnUrl; + private String cancelUrl; + + /** + * Default constructor. + */ + public MerchantPreferences() { + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + */ + public MerchantPreferences( + String returnUrl, + String cancelUrl) { + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Getter for ReturnUrl. + * The URL where the customer is redirected after the customer approves the payment. + * @return Returns the String + */ + @JsonGetter("return_url") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getReturnUrl() { + return returnUrl; + } + + /** + * Setter for ReturnUrl. + * The URL where the customer is redirected after the customer approves the payment. + * @param returnUrl Value for String + */ + @JsonSetter("return_url") + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + } + + /** + * Getter for CancelUrl. + * The URL where the customer is redirected after the customer cancels the payment. + * @return Returns the String + */ + @JsonGetter("cancel_url") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCancelUrl() { + return cancelUrl; + } + + /** + * Setter for CancelUrl. + * The URL where the customer is redirected after the customer cancels the payment. + * @param cancelUrl Value for String + */ + @JsonSetter("cancel_url") + public void setCancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + } + + /** + * Converts this MerchantPreferences into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "MerchantPreferences [" + "returnUrl=" + returnUrl + ", cancelUrl=" + cancelUrl + + "]"; + } + + /** + * Builds a new {@link MerchantPreferences.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link MerchantPreferences.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .returnUrl(getReturnUrl()) + .cancelUrl(getCancelUrl()); + return builder; + } + + /** + * Class to build instances of {@link MerchantPreferences}. + */ + public static class Builder { + private String returnUrl; + private String cancelUrl; + + + + /** + * Setter for returnUrl. + * @param returnUrl String value for returnUrl. + * @return Builder + */ + public Builder returnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * Setter for cancelUrl. + * @param cancelUrl String value for cancelUrl. + * @return Builder + */ + public Builder cancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + return this; + } + + /** + * Builds a new {@link MerchantPreferences} object using the set fields. + * @return {@link MerchantPreferences} + */ + public MerchantPreferences build() { + return new MerchantPreferences(returnUrl, cancelUrl); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/MobileReturnFlow.java b/src/main/java/com/paypal/sdk/models/MobileReturnFlow.java new file mode 100644 index 0000000..1490fee --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/MobileReturnFlow.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * MobileReturnFlow to be used. + */ +public enum MobileReturnFlow { + /** + * After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. + */ + AUTO, + + /** + * 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. + */ + MANUAL, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + AUTO.value = "AUTO"; + MANUAL.value = "MANUAL"; + _UNKNOWN.value = null; + + valueMap.put("AUTO", AUTO); + valueMap.put("MANUAL", MANUAL); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static MobileReturnFlow constructFromString(String toConvert) throws IOException { + MobileReturnFlow enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static MobileReturnFlow fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of MobileReturnFlow values to list of string values. + * @param toConvert The list of MobileReturnFlow values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (MobileReturnFlow enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/MobileWebContext.java b/src/main/java/com/paypal/sdk/models/MobileWebContext.java new file mode 100644 index 0000000..16469d4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/MobileWebContext.java @@ -0,0 +1,146 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for MobileWebContext type. + */ +public class MobileWebContext { + private MobileReturnFlow returnFlow; + private String buyerUserAgent; + + /** + * Default constructor. + */ + public MobileWebContext() { + returnFlow = MobileReturnFlow.AUTO; + } + + /** + * Initialization constructor. + * @param returnFlow MobileReturnFlow value for returnFlow. + * @param buyerUserAgent String value for buyerUserAgent. + */ + public MobileWebContext( + MobileReturnFlow returnFlow, + String buyerUserAgent) { + this.returnFlow = returnFlow; + this.buyerUserAgent = buyerUserAgent; + } + + /** + * Getter for ReturnFlow. + * Merchant preference on how the buyer can navigate back to merchant website post approving the + * transaction on the PayPal App. + * @return Returns the MobileReturnFlow + */ + @JsonGetter("return_flow") + @JsonInclude(JsonInclude.Include.NON_NULL) + public MobileReturnFlow getReturnFlow() { + return returnFlow; + } + + /** + * Setter for ReturnFlow. + * Merchant preference on how the buyer can navigate back to merchant website post approving the + * transaction on the PayPal App. + * @param returnFlow Value for MobileReturnFlow + */ + @JsonSetter("return_flow") + public void setReturnFlow(MobileReturnFlow returnFlow) { + this.returnFlow = returnFlow; + } + + /** + * Getter for BuyerUserAgent. + * 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. + * @return Returns the String + */ + @JsonGetter("buyer_user_agent") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getBuyerUserAgent() { + return buyerUserAgent; + } + + /** + * Setter for BuyerUserAgent. + * 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. + * @param buyerUserAgent Value for String + */ + @JsonSetter("buyer_user_agent") + public void setBuyerUserAgent(String buyerUserAgent) { + this.buyerUserAgent = buyerUserAgent; + } + + /** + * Converts this MobileWebContext into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "MobileWebContext [" + "returnFlow=" + returnFlow + ", buyerUserAgent=" + + buyerUserAgent + "]"; + } + + /** + * Builds a new {@link MobileWebContext.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link MobileWebContext.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .returnFlow(getReturnFlow()) + .buyerUserAgent(getBuyerUserAgent()); + return builder; + } + + /** + * Class to build instances of {@link MobileWebContext}. + */ + public static class Builder { + private MobileReturnFlow returnFlow = MobileReturnFlow.AUTO; + private String buyerUserAgent; + + + + /** + * Setter for returnFlow. + * @param returnFlow MobileReturnFlow value for returnFlow. + * @return Builder + */ + public Builder returnFlow(MobileReturnFlow returnFlow) { + this.returnFlow = returnFlow; + return this; + } + + /** + * Setter for buyerUserAgent. + * @param buyerUserAgent String value for buyerUserAgent. + * @return Builder + */ + public Builder buyerUserAgent(String buyerUserAgent) { + this.buyerUserAgent = buyerUserAgent; + return this; + } + + /** + * Builds a new {@link MobileWebContext} object using the set fields. + * @return {@link MobileWebContext} + */ + public MobileWebContext build() { + return new MobileWebContext(returnFlow, buyerUserAgent); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ModifySubscriptionRequest.java b/src/main/java/com/paypal/sdk/models/ModifySubscriptionRequest.java new file mode 100644 index 0000000..29f61db --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ModifySubscriptionRequest.java @@ -0,0 +1,295 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ModifySubscriptionRequest type. + */ +public class ModifySubscriptionRequest { + private String planId; + private String quantity; + private Money shippingAmount; + private ShippingDetails shippingAddress; + private SubscriptionPatchApplicationContext applicationContext; + private PlanOverride plan; + + /** + * Default constructor. + */ + public ModifySubscriptionRequest() { + } + + /** + * Initialization constructor. + * @param planId String value for planId. + * @param quantity String value for quantity. + * @param shippingAmount Money value for shippingAmount. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @param applicationContext SubscriptionPatchApplicationContext value for applicationContext. + * @param plan PlanOverride value for plan. + */ + public ModifySubscriptionRequest( + String planId, + String quantity, + Money shippingAmount, + ShippingDetails shippingAddress, + SubscriptionPatchApplicationContext applicationContext, + PlanOverride plan) { + this.planId = planId; + this.quantity = quantity; + this.shippingAmount = shippingAmount; + this.shippingAddress = shippingAddress; + this.applicationContext = applicationContext; + this.plan = plan; + } + + /** + * Getter for PlanId. + * The unique PayPal-generated ID for the plan. + * @return Returns the String + */ + @JsonGetter("plan_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPlanId() { + return planId; + } + + /** + * Setter for PlanId. + * The unique PayPal-generated ID for the plan. + * @param planId Value for String + */ + @JsonSetter("plan_id") + public void setPlanId(String planId) { + this.planId = planId; + } + + /** + * Getter for Quantity. + * The quantity of the product or service in the subscription. + * @return Returns the String + */ + @JsonGetter("quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The quantity of the product or service in the subscription. + * @param quantity Value for String + */ + @JsonSetter("quantity") + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + * Getter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingAmount() { + return shippingAmount; + } + + /** + * Setter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingAmount Value for Money + */ + @JsonSetter("shipping_amount") + public void setShippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + } + + /** + * Getter for ShippingAddress. + * The shipping details. + * @return Returns the ShippingDetails + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ShippingDetails getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * The shipping details. + * @param shippingAddress Value for ShippingDetails + */ + @JsonSetter("shipping_address") + public void setShippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for ApplicationContext. + * The application context, which customizes the payer experience during the subscription + * approval process with PayPal. + * @return Returns the SubscriptionPatchApplicationContext + */ + @JsonGetter("application_context") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPatchApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * Setter for ApplicationContext. + * The application context, which customizes the payer experience during the subscription + * approval process with PayPal. + * @param applicationContext Value for SubscriptionPatchApplicationContext + */ + @JsonSetter("application_context") + public void setApplicationContext(SubscriptionPatchApplicationContext applicationContext) { + this.applicationContext = applicationContext; + } + + /** + * Getter for Plan. + * 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. + * @return Returns the PlanOverride + */ + @JsonGetter("plan") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PlanOverride getPlan() { + return plan; + } + + /** + * Setter for Plan. + * 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. + * @param plan Value for PlanOverride + */ + @JsonSetter("plan") + public void setPlan(PlanOverride plan) { + this.plan = plan; + } + + /** + * Converts this ModifySubscriptionRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ModifySubscriptionRequest [" + "planId=" + planId + ", quantity=" + quantity + + ", shippingAmount=" + shippingAmount + ", shippingAddress=" + shippingAddress + + ", applicationContext=" + applicationContext + ", plan=" + plan + "]"; + } + + /** + * Builds a new {@link ModifySubscriptionRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ModifySubscriptionRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .planId(getPlanId()) + .quantity(getQuantity()) + .shippingAmount(getShippingAmount()) + .shippingAddress(getShippingAddress()) + .applicationContext(getApplicationContext()) + .plan(getPlan()); + return builder; + } + + /** + * Class to build instances of {@link ModifySubscriptionRequest}. + */ + public static class Builder { + private String planId; + private String quantity; + private Money shippingAmount; + private ShippingDetails shippingAddress; + private SubscriptionPatchApplicationContext applicationContext; + private PlanOverride plan; + + + + /** + * Setter for planId. + * @param planId String value for planId. + * @return Builder + */ + public Builder planId(String planId) { + this.planId = planId; + return this; + } + + /** + * Setter for quantity. + * @param quantity String value for quantity. + * @return Builder + */ + public Builder quantity(String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for shippingAmount. + * @param shippingAmount Money value for shippingAmount. + * @return Builder + */ + public Builder shippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + return this; + } + + /** + * Setter for shippingAddress. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @return Builder + */ + public Builder shippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Setter for applicationContext. + * @param applicationContext SubscriptionPatchApplicationContext value for + * applicationContext. + * @return Builder + */ + public Builder applicationContext( + SubscriptionPatchApplicationContext applicationContext) { + this.applicationContext = applicationContext; + return this; + } + + /** + * Setter for plan. + * @param plan PlanOverride value for plan. + * @return Builder + */ + public Builder plan(PlanOverride plan) { + this.plan = plan; + return this; + } + + /** + * Builds a new {@link ModifySubscriptionRequest} object using the set fields. + * @return {@link ModifySubscriptionRequest} + */ + public ModifySubscriptionRequest build() { + return new ModifySubscriptionRequest(planId, quantity, shippingAmount, shippingAddress, + applicationContext, plan); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ModifySubscriptionResponse.java b/src/main/java/com/paypal/sdk/models/ModifySubscriptionResponse.java new file mode 100644 index 0000000..13d71b9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ModifySubscriptionResponse.java @@ -0,0 +1,332 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for ModifySubscriptionResponse type. + */ +public class ModifySubscriptionResponse { + private String planId; + private String quantity; + private Money shippingAmount; + private ShippingDetails shippingAddress; + private PlanOverride plan; + private Boolean planOverridden; + private List links; + + /** + * Default constructor. + */ + public ModifySubscriptionResponse() { + } + + /** + * Initialization constructor. + * @param planId String value for planId. + * @param quantity String value for quantity. + * @param shippingAmount Money value for shippingAmount. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @param plan PlanOverride value for plan. + * @param planOverridden Boolean value for planOverridden. + * @param links List of LinkDescription value for links. + */ + public ModifySubscriptionResponse( + String planId, + String quantity, + Money shippingAmount, + ShippingDetails shippingAddress, + PlanOverride plan, + Boolean planOverridden, + List links) { + this.planId = planId; + this.quantity = quantity; + this.shippingAmount = shippingAmount; + this.shippingAddress = shippingAddress; + this.plan = plan; + this.planOverridden = planOverridden; + this.links = links; + } + + /** + * Getter for PlanId. + * The unique PayPal-generated ID for the plan. + * @return Returns the String + */ + @JsonGetter("plan_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPlanId() { + return planId; + } + + /** + * Setter for PlanId. + * The unique PayPal-generated ID for the plan. + * @param planId Value for String + */ + @JsonSetter("plan_id") + public void setPlanId(String planId) { + this.planId = planId; + } + + /** + * Getter for Quantity. + * The quantity of the product or service in the subscription. + * @return Returns the String + */ + @JsonGetter("quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The quantity of the product or service in the subscription. + * @param quantity Value for String + */ + @JsonSetter("quantity") + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + * Getter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingAmount() { + return shippingAmount; + } + + /** + * Setter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingAmount Value for Money + */ + @JsonSetter("shipping_amount") + public void setShippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + } + + /** + * Getter for ShippingAddress. + * The shipping details. + * @return Returns the ShippingDetails + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ShippingDetails getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * The shipping details. + * @param shippingAddress Value for ShippingDetails + */ + @JsonSetter("shipping_address") + public void setShippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for Plan. + * 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. + * @return Returns the PlanOverride + */ + @JsonGetter("plan") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PlanOverride getPlan() { + return plan; + } + + /** + * Setter for Plan. + * 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. + * @param plan Value for PlanOverride + */ + @JsonSetter("plan") + public void setPlan(PlanOverride plan) { + this.plan = plan; + } + + /** + * Getter for PlanOverridden. + * Indicates whether the subscription has overridden any plan attributes. + * @return Returns the Boolean + */ + @JsonGetter("plan_overridden") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getPlanOverridden() { + return planOverridden; + } + + /** + * Setter for PlanOverridden. + * Indicates whether the subscription has overridden any plan attributes. + * @param planOverridden Value for Boolean + */ + @JsonSetter("plan_overridden") + public void setPlanOverridden(Boolean planOverridden) { + this.planOverridden = planOverridden; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this ModifySubscriptionResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ModifySubscriptionResponse [" + "planId=" + planId + ", quantity=" + quantity + + ", shippingAmount=" + shippingAmount + ", shippingAddress=" + shippingAddress + + ", plan=" + plan + ", planOverridden=" + planOverridden + ", links=" + links + + "]"; + } + + /** + * Builds a new {@link ModifySubscriptionResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ModifySubscriptionResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .planId(getPlanId()) + .quantity(getQuantity()) + .shippingAmount(getShippingAmount()) + .shippingAddress(getShippingAddress()) + .plan(getPlan()) + .planOverridden(getPlanOverridden()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link ModifySubscriptionResponse}. + */ + public static class Builder { + private String planId; + private String quantity; + private Money shippingAmount; + private ShippingDetails shippingAddress; + private PlanOverride plan; + private Boolean planOverridden; + private List links; + + + + /** + * Setter for planId. + * @param planId String value for planId. + * @return Builder + */ + public Builder planId(String planId) { + this.planId = planId; + return this; + } + + /** + * Setter for quantity. + * @param quantity String value for quantity. + * @return Builder + */ + public Builder quantity(String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for shippingAmount. + * @param shippingAmount Money value for shippingAmount. + * @return Builder + */ + public Builder shippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + return this; + } + + /** + * Setter for shippingAddress. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @return Builder + */ + public Builder shippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Setter for plan. + * @param plan PlanOverride value for plan. + * @return Builder + */ + public Builder plan(PlanOverride plan) { + this.plan = plan; + return this; + } + + /** + * Setter for planOverridden. + * @param planOverridden Boolean value for planOverridden. + * @return Builder + */ + public Builder planOverridden(Boolean planOverridden) { + this.planOverridden = planOverridden; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link ModifySubscriptionResponse} object using the set fields. + * @return {@link ModifySubscriptionResponse} + */ + public ModifySubscriptionResponse build() { + return new ModifySubscriptionResponse(planId, quantity, shippingAmount, shippingAddress, + plan, planOverridden, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/NativeAppContext.java b/src/main/java/com/paypal/sdk/models/NativeAppContext.java new file mode 100644 index 0000000..1ebd9ec --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/NativeAppContext.java @@ -0,0 +1,138 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for NativeAppContext type. + */ +public class NativeAppContext { + private OsType osType; + private String osVersion; + + /** + * Default constructor. + */ + public NativeAppContext() { + } + + /** + * Initialization constructor. + * @param osType OsType value for osType. + * @param osVersion String value for osVersion. + */ + public NativeAppContext( + OsType osType, + String osVersion) { + this.osType = osType; + this.osVersion = osVersion; + } + + /** + * Getter for OsType. + * Operating System type of the device that the buyer is using. + * @return Returns the OsType + */ + @JsonGetter("os_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public OsType getOsType() { + return osType; + } + + /** + * Setter for OsType. + * Operating System type of the device that the buyer is using. + * @param osType Value for OsType + */ + @JsonSetter("os_type") + public void setOsType(OsType osType) { + this.osType = osType; + } + + /** + * Getter for OsVersion. + * Operating System version of the device that the buyer is using. + * @return Returns the String + */ + @JsonGetter("os_version") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getOsVersion() { + return osVersion; + } + + /** + * Setter for OsVersion. + * Operating System version of the device that the buyer is using. + * @param osVersion Value for String + */ + @JsonSetter("os_version") + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + /** + * Converts this NativeAppContext into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "NativeAppContext [" + "osType=" + osType + ", osVersion=" + osVersion + "]"; + } + + /** + * Builds a new {@link NativeAppContext.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link NativeAppContext.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .osType(getOsType()) + .osVersion(getOsVersion()); + return builder; + } + + /** + * Class to build instances of {@link NativeAppContext}. + */ + public static class Builder { + private OsType osType; + private String osVersion; + + + + /** + * Setter for osType. + * @param osType OsType value for osType. + * @return Builder + */ + public Builder osType(OsType osType) { + this.osType = osType; + return this; + } + + /** + * Setter for osVersion. + * @param osVersion String value for osVersion. + * @return Builder + */ + public Builder osVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Builds a new {@link NativeAppContext} object using the set fields. + * @return {@link NativeAppContext} + */ + public NativeAppContext build() { + return new NativeAppContext(osType, osVersion); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/NetworkTransactionReference.java b/src/main/java/com/paypal/sdk/models/NetworkTransaction.java similarity index 82% rename from src/main/java/com/paypal/sdk/models/NetworkTransactionReference.java rename to src/main/java/com/paypal/sdk/models/NetworkTransaction.java index 34f4a26..55fee52 100644 --- a/src/main/java/com/paypal/sdk/models/NetworkTransactionReference.java +++ b/src/main/java/com/paypal/sdk/models/NetworkTransaction.java @@ -11,9 +11,9 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for NetworkTransactionReference type. + * This is a model class for NetworkTransaction type. */ -public class NetworkTransactionReference { +public class NetworkTransaction { private String id; private String date; private CardBrand network; @@ -22,7 +22,7 @@ public class NetworkTransactionReference { /** * Default constructor. */ - public NetworkTransactionReference() { + public NetworkTransaction() { } /** @@ -32,7 +32,7 @@ public NetworkTransactionReference() { * @param network CardBrand value for network. * @param acquirerReferenceNumber String value for acquirerReferenceNumber. */ - public NetworkTransactionReference( + public NetworkTransaction( String id, String date, CardBrand network, @@ -53,6 +53,7 @@ public NetworkTransactionReference( * @return Returns the String */ @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) public String getId() { return id; } @@ -74,7 +75,9 @@ public void setId(String id) { /** * Getter for Date. * The date that the transaction was authorized by the scheme. This field may not be returned - * for all networks. MasterCard refers to this field as "BankNet reference date. + * for all networks. MasterCard refers to this field as "BankNet reference date". For some + * specific networks, such as MasterCard and Discover, this date field is mandatory when the + * `previous_network_transaction_reference_id` is passed. * @return Returns the String */ @JsonGetter("date") @@ -86,7 +89,9 @@ public String getDate() { /** * Setter for Date. * The date that the transaction was authorized by the scheme. This field may not be returned - * for all networks. MasterCard refers to this field as "BankNet reference date. + * for all networks. MasterCard refers to this field as "BankNet reference date". For some + * specific networks, such as MasterCard and Discover, this date field is mandatory when the + * `previous_network_transaction_reference_id` is passed. * @param date Value for String */ @JsonSetter("date") @@ -139,22 +144,23 @@ public void setAcquirerReferenceNumber(String acquirerReferenceNumber) { } /** - * Converts this NetworkTransactionReference into string format. + * Converts this NetworkTransaction into string format. * @return String representation of this class */ @Override public String toString() { - return "NetworkTransactionReference [" + "id=" + id + ", date=" + date + ", network=" - + network + ", acquirerReferenceNumber=" + acquirerReferenceNumber + "]"; + return "NetworkTransaction [" + "id=" + id + ", date=" + date + ", network=" + network + + ", acquirerReferenceNumber=" + acquirerReferenceNumber + "]"; } /** - * Builds a new {@link NetworkTransactionReference.Builder} object. + * Builds a new {@link NetworkTransaction.Builder} object. * Creates the instance with the state of the current model. - * @return a new {@link NetworkTransactionReference.Builder} object + * @return a new {@link NetworkTransaction.Builder} object */ public Builder toBuilder() { - Builder builder = new Builder(id) + Builder builder = new Builder() + .id(getId()) .date(getDate()) .network(getNetwork()) .acquirerReferenceNumber(getAcquirerReferenceNumber()); @@ -162,7 +168,7 @@ public Builder toBuilder() { } /** - * Class to build instances of {@link NetworkTransactionReference}. + * Class to build instances of {@link NetworkTransaction}. */ public static class Builder { private String id; @@ -170,19 +176,7 @@ public static class Builder { private CardBrand network; private String acquirerReferenceNumber; - /** - * Initialization constructor. - */ - public Builder() { - } - /** - * Initialization constructor. - * @param id String value for id. - */ - public Builder(String id) { - this.id = id; - } /** * Setter for id. @@ -225,11 +219,11 @@ public Builder acquirerReferenceNumber(String acquirerReferenceNumber) { } /** - * Builds a new {@link NetworkTransactionReference} object using the set fields. - * @return {@link NetworkTransactionReference} + * Builds a new {@link NetworkTransaction} object using the set fields. + * @return {@link NetworkTransaction} */ - public NetworkTransactionReference build() { - return new NetworkTransactionReference(id, date, network, acquirerReferenceNumber); + public NetworkTransaction build() { + return new NetworkTransaction(id, date, network, acquirerReferenceNumber); } } } diff --git a/src/main/java/com/paypal/sdk/models/Order.java b/src/main/java/com/paypal/sdk/models/Order.java index 8752f7b..6f994c6 100644 --- a/src/main/java/com/paypal/sdk/models/Order.java +++ b/src/main/java/com/paypal/sdk/models/Order.java @@ -185,6 +185,10 @@ public void setIntent(CheckoutPaymentIntent intent) { /** * Getter for Payer. + * DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be + * used with the `payment_source.paypal` object. In order to make this design more clear, the + * details in the `payer` object are now available under `payment_source.paypal`. Please use + * `payment_source.paypal`. * @return Returns the Payer */ @JsonGetter("payer") @@ -195,6 +199,10 @@ public Payer getPayer() { /** * Setter for Payer. + * DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be + * used with the `payment_source.paypal` object. In order to make this design more clear, the + * details in the `payer` object are now available under `payment_source.paypal`. Please use + * `payment_source.paypal`. * @param payer Value for Payer */ @JsonSetter("payer") diff --git a/src/main/java/com/paypal/sdk/models/OrderApplicationContext.java b/src/main/java/com/paypal/sdk/models/OrderApplicationContext.java index f263436..a90bd4f 100644 --- a/src/main/java/com/paypal/sdk/models/OrderApplicationContext.java +++ b/src/main/java/com/paypal/sdk/models/OrderApplicationContext.java @@ -98,13 +98,13 @@ public void setBrandName(String brandName) { /** * Getter for Locale. - * The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to - * localize the error-related strings, such as messages, issues, and suggested actions. The tag - * is made up of the [ISO 639-2 language - * code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 - * script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 - * country code](/api/rest/reference/country-codes/) or [M49 region - * code](https://unstats.un.org/unsd/methodology/m49/). + * DEPRECATED. The BCP 47-formatted locale of pages that the PayPal payment experience shows. + * PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, + * `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. The fields in + * `application_context` are now available in the `experience_context` object under the + * `payment_source` which supports them (eg. `payment_source.paypal.experience_context.locale`). + * Please specify this field in the `experience_context` object instead of the + * `application_context` object. * @return Returns the String */ @JsonGetter("locale") @@ -115,13 +115,13 @@ public String getLocale() { /** * Setter for Locale. - * The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to - * localize the error-related strings, such as messages, issues, and suggested actions. The tag - * is made up of the [ISO 639-2 language - * code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 - * script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 - * country code](/api/rest/reference/country-codes/) or [M49 region - * code](https://unstats.un.org/unsd/methodology/m49/). + * DEPRECATED. The BCP 47-formatted locale of pages that the PayPal payment experience shows. + * PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, + * `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. The fields in + * `application_context` are now available in the `experience_context` object under the + * `payment_source` which supports them (eg. `payment_source.paypal.experience_context.locale`). + * Please specify this field in the `experience_context` object instead of the + * `application_context` object. * @param locale Value for String */ @JsonSetter("locale") @@ -222,7 +222,11 @@ public void setUserAction(OrderApplicationContextUserAction userAction) { /** * Getter for PaymentMethod. - * The customer and merchant payment preferences. + * DEPRECATED. The customer and merchant payment preferences. The fields in + * `application_context` are now available in the `experience_context` object under the + * `payment_source` which supports them (eg. + * `payment_source.paypal.experience_context.payment_method_selected`). Please specify this + * field in the `experience_context` object instead of the `application_context` object.. * @return Returns the PaymentMethodPreference */ @JsonGetter("payment_method") @@ -233,7 +237,11 @@ public PaymentMethodPreference getPaymentMethod() { /** * Setter for PaymentMethod. - * The customer and merchant payment preferences. + * DEPRECATED. The customer and merchant payment preferences. The fields in + * `application_context` are now available in the `experience_context` object under the + * `payment_source` which supports them (eg. + * `payment_source.paypal.experience_context.payment_method_selected`). Please specify this + * field in the `experience_context` object instead of the `application_context` object.. * @param paymentMethod Value for PaymentMethodPreference */ @JsonSetter("payment_method") @@ -301,14 +309,18 @@ public void setCancelUrl(String cancelUrl) { /** * Getter for StoredPaymentSource. - * Provides additional details to process a payment using a `payment_source` that has been - * stored or is intended to be stored (also referred to as stored_credential or card-on-file). - * Parameter compatibility: `payment_type=ONE_TIME` is compatible only with + * 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. + * 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. * @return Returns the StoredPaymentSource */ @JsonGetter("stored_payment_source") @@ -319,14 +331,18 @@ public StoredPaymentSource getStoredPaymentSource() { /** * Setter for StoredPaymentSource. - * Provides additional details to process a payment using a `payment_source` that has been - * stored or is intended to be stored (also referred to as stored_credential or card-on-file). - * Parameter compatibility: `payment_type=ONE_TIME` is compatible only with + * 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. + * 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. * @param storedPaymentSource Value for StoredPaymentSource */ @JsonSetter("stored_payment_source") diff --git a/src/main/java/com/paypal/sdk/models/OrderAuthorizeResponse.java b/src/main/java/com/paypal/sdk/models/OrderAuthorizeResponse.java index d6343b1..a6ef3fa 100644 --- a/src/main/java/com/paypal/sdk/models/OrderAuthorizeResponse.java +++ b/src/main/java/com/paypal/sdk/models/OrderAuthorizeResponse.java @@ -185,6 +185,7 @@ public void setIntent(CheckoutPaymentIntent intent) { /** * Getter for Payer. + * The customer who approves and pays for the order. The customer is also known as the payer. * @return Returns the Payer */ @JsonGetter("payer") @@ -195,6 +196,7 @@ public Payer getPayer() { /** * Setter for Payer. + * The customer who approves and pays for the order. The customer is also known as the payer. * @param payer Value for Payer */ @JsonSetter("payer") @@ -250,9 +252,14 @@ public void setStatus(OrderStatus status) { /** * Getter for Links. - * An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links) that are - * either relevant to the issue by providing additional information or offering potential - * resolutions. + * 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. * @return Returns the List of LinkDescription */ @JsonGetter("links") @@ -263,9 +270,14 @@ public List getLinks() { /** * Setter for Links. - * An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links) that are - * either relevant to the issue by providing additional information or offering potential - * resolutions. + * 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. * @param links Value for List of LinkDescription */ @JsonSetter("links") diff --git a/src/main/java/com/paypal/sdk/models/OrderRequest.java b/src/main/java/com/paypal/sdk/models/OrderRequest.java index 9a1d083..ff6a492 100644 --- a/src/main/java/com/paypal/sdk/models/OrderRequest.java +++ b/src/main/java/com/paypal/sdk/models/OrderRequest.java @@ -72,6 +72,10 @@ public void setIntent(CheckoutPaymentIntent intent) { /** * Getter for Payer. + * DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be + * used with the `payment_source.paypal` object. In order to make this design more clear, the + * details in the `payer` object are now available under `payment_source.paypal`. Please use + * `payment_source.paypal`. * @return Returns the Payer */ @JsonGetter("payer") @@ -82,6 +86,10 @@ public Payer getPayer() { /** * Setter for Payer. + * DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be + * used with the `payment_source.paypal` object. In order to make this design more clear, the + * details in the `payer` object are now available under `payment_source.paypal`. Please use + * `payment_source.paypal`. * @param payer Value for Payer */ @JsonSetter("payer") diff --git a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackErrorResponse.java b/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackErrorResponse.java deleted file mode 100644 index ad59da4..0000000 --- a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackErrorResponse.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; -import java.util.List; - -/** - * This is a model class for OrderUpdateCallbackErrorResponse type. - */ -public class OrderUpdateCallbackErrorResponse { - private String name; - private String message; - private List details; - - /** - * Default constructor. - */ - public OrderUpdateCallbackErrorResponse() { - } - - /** - * Initialization constructor. - * @param name String value for name. - * @param message String value for message. - * @param details List of OrderUpdateCallbackErrorResponseDetails value for details. - */ - public OrderUpdateCallbackErrorResponse( - String name, - String message, - List details) { - this.name = name; - this.message = message; - this.details = details; - } - - /** - * Getter for Name. - * The human-readable, unique name of the error. - * @return Returns the String - */ - @JsonGetter("name") - public String getName() { - return name; - } - - /** - * Setter for Name. - * The human-readable, unique name of the error. - * @param name Value for String - */ - @JsonSetter("name") - public void setName(String name) { - this.name = name; - } - - /** - * Getter for Message. - * The message that describes the error. - * @return Returns the String - */ - @JsonGetter("message") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getMessage() { - return message; - } - - /** - * Setter for Message. - * The message that describes the error. - * @param message Value for String - */ - @JsonSetter("message") - public void setMessage(String message) { - this.message = message; - } - - /** - * Getter for Details. - * An array of additional details about the error. - * @return Returns the List of OrderUpdateCallbackErrorResponseDetails - */ - @JsonGetter("details") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getDetails() { - return details; - } - - /** - * Setter for Details. - * An array of additional details about the error. - * @param details Value for List of OrderUpdateCallbackErrorResponseDetails - */ - @JsonSetter("details") - public void setDetails(List details) { - this.details = details; - } - - /** - * Converts this OrderUpdateCallbackErrorResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "OrderUpdateCallbackErrorResponse [" + "name=" + name + ", message=" + message - + ", details=" + details + "]"; - } - - /** - * Builds a new {@link OrderUpdateCallbackErrorResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link OrderUpdateCallbackErrorResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(name) - .message(getMessage()) - .details(getDetails()); - return builder; - } - - /** - * Class to build instances of {@link OrderUpdateCallbackErrorResponse}. - */ - public static class Builder { - private String name; - private String message; - private List details; - - /** - * Initialization constructor. - */ - public Builder() { - } - - /** - * Initialization constructor. - * @param name String value for name. - */ - public Builder(String name) { - this.name = name; - } - - /** - * Setter for name. - * @param name String value for name. - * @return Builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Setter for message. - * @param message String value for message. - * @return Builder - */ - public Builder message(String message) { - this.message = message; - return this; - } - - /** - * Setter for details. - * @param details List of OrderUpdateCallbackErrorResponseDetails value for details. - * @return Builder - */ - public Builder details(List details) { - this.details = details; - return this; - } - - /** - * Builds a new {@link OrderUpdateCallbackErrorResponse} object using the set fields. - * @return {@link OrderUpdateCallbackErrorResponse} - */ - public OrderUpdateCallbackErrorResponse build() { - return new OrderUpdateCallbackErrorResponse(name, message, details); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackRequest.java b/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackRequest.java deleted file mode 100644 index 13ccae9..0000000 --- a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackRequest.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; -import java.util.List; - -/** - * This is a model class for OrderUpdateCallbackRequest type. - */ -public class OrderUpdateCallbackRequest { - private String id; - private OrderUpdateCallbackShippingAddress shippingAddress; - private OrderUpdateCallbackShippingOption shippingOption; - private List purchaseUnits; - - /** - * Default constructor. - */ - public OrderUpdateCallbackRequest() { - } - - /** - * Initialization constructor. - * @param shippingAddress OrderUpdateCallbackShippingAddress value for shippingAddress. - * @param purchaseUnits List of PurchaseUnitRequest value for purchaseUnits. - * @param id String value for id. - * @param shippingOption OrderUpdateCallbackShippingOption value for shippingOption. - */ - public OrderUpdateCallbackRequest( - OrderUpdateCallbackShippingAddress shippingAddress, - List purchaseUnits, - String id, - OrderUpdateCallbackShippingOption shippingOption) { - this.id = id; - this.shippingAddress = shippingAddress; - this.shippingOption = shippingOption; - this.purchaseUnits = purchaseUnits; - } - - /** - * Getter for Id. - * The ID of the order. - * @return Returns the String - */ - @JsonGetter("id") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getId() { - return id; - } - - /** - * Setter for Id. - * The ID of the order. - * @param id Value for String - */ - @JsonSetter("id") - public void setId(String id) { - this.id = id; - } - - /** - * Getter for ShippingAddress. - * The portable international postal address. Maps to - * [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) - * and HTML 5.1 [Autofilling form controls: the autocomplete - * attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). - * @return Returns the OrderUpdateCallbackShippingAddress - */ - @JsonGetter("shipping_address") - public OrderUpdateCallbackShippingAddress getShippingAddress() { - return shippingAddress; - } - - /** - * Setter for ShippingAddress. - * 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). - * @param shippingAddress Value for OrderUpdateCallbackShippingAddress - */ - @JsonSetter("shipping_address") - public void setShippingAddress(OrderUpdateCallbackShippingAddress shippingAddress) { - this.shippingAddress = shippingAddress; - } - - /** - * Getter for ShippingOption. - * The options that the payee or merchant offers to the payer to ship or pick up their items. - * @return Returns the OrderUpdateCallbackShippingOption - */ - @JsonGetter("shipping_option") - @JsonInclude(JsonInclude.Include.NON_NULL) - public OrderUpdateCallbackShippingOption getShippingOption() { - return shippingOption; - } - - /** - * Setter for ShippingOption. - * The options that the payee or merchant offers to the payer to ship or pick up their items. - * @param shippingOption Value for OrderUpdateCallbackShippingOption - */ - @JsonSetter("shipping_option") - public void setShippingOption(OrderUpdateCallbackShippingOption shippingOption) { - this.shippingOption = shippingOption; - } - - /** - * Getter for PurchaseUnits. - * An array of purchase units. At present only 1 purchase_unit is supported. Each purchase unit - * establishes a contract between a payer and the payee. Each purchase unit represents either a - * full or partial order that the payer intends to purchase from the payee. - * @return Returns the List of PurchaseUnitRequest - */ - @JsonGetter("purchase_units") - public List getPurchaseUnits() { - return purchaseUnits; - } - - /** - * Setter for PurchaseUnits. - * An array of purchase units. At present only 1 purchase_unit is supported. Each purchase unit - * establishes a contract between a payer and the payee. Each purchase unit represents either a - * full or partial order that the payer intends to purchase from the payee. - * @param purchaseUnits Value for List of PurchaseUnitRequest - */ - @JsonSetter("purchase_units") - public void setPurchaseUnits(List purchaseUnits) { - this.purchaseUnits = purchaseUnits; - } - - /** - * Converts this OrderUpdateCallbackRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "OrderUpdateCallbackRequest [" + "shippingAddress=" + shippingAddress - + ", purchaseUnits=" + purchaseUnits + ", id=" + id + ", shippingOption=" - + shippingOption + "]"; - } - - /** - * Builds a new {@link OrderUpdateCallbackRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link OrderUpdateCallbackRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(shippingAddress, purchaseUnits) - .id(getId()) - .shippingOption(getShippingOption()); - return builder; - } - - /** - * Class to build instances of {@link OrderUpdateCallbackRequest}. - */ - public static class Builder { - private OrderUpdateCallbackShippingAddress shippingAddress; - private List purchaseUnits; - private String id; - private OrderUpdateCallbackShippingOption shippingOption; - - /** - * Initialization constructor. - */ - public Builder() { - } - - /** - * Initialization constructor. - * @param shippingAddress OrderUpdateCallbackShippingAddress value for shippingAddress. - * @param purchaseUnits List of PurchaseUnitRequest value for purchaseUnits. - */ - public Builder(OrderUpdateCallbackShippingAddress shippingAddress, - List purchaseUnits) { - this.shippingAddress = shippingAddress; - this.purchaseUnits = purchaseUnits; - } - - /** - * Setter for shippingAddress. - * @param shippingAddress OrderUpdateCallbackShippingAddress value for shippingAddress. - * @return Builder - */ - public Builder shippingAddress(OrderUpdateCallbackShippingAddress shippingAddress) { - this.shippingAddress = shippingAddress; - return this; - } - - /** - * Setter for purchaseUnits. - * @param purchaseUnits List of PurchaseUnitRequest value for purchaseUnits. - * @return Builder - */ - public Builder purchaseUnits(List purchaseUnits) { - this.purchaseUnits = purchaseUnits; - return this; - } - - /** - * Setter for id. - * @param id String value for id. - * @return Builder - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Setter for shippingOption. - * @param shippingOption OrderUpdateCallbackShippingOption value for shippingOption. - * @return Builder - */ - public Builder shippingOption(OrderUpdateCallbackShippingOption shippingOption) { - this.shippingOption = shippingOption; - return this; - } - - /** - * Builds a new {@link OrderUpdateCallbackRequest} object using the set fields. - * @return {@link OrderUpdateCallbackRequest} - */ - public OrderUpdateCallbackRequest build() { - return new OrderUpdateCallbackRequest(shippingAddress, purchaseUnits, id, - shippingOption); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackResponse.java b/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackResponse.java deleted file mode 100644 index c459c0f..0000000 --- a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackResponse.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for OrderUpdateCallbackResponse type. - */ -public class OrderUpdateCallbackResponse { - private String id; - private ShippingOptionsPurchaseUnit purchaseUnits; - - /** - * Default constructor. - */ - public OrderUpdateCallbackResponse() { - } - - /** - * Initialization constructor. - * @param id String value for id. - * @param purchaseUnits ShippingOptionsPurchaseUnit value for purchaseUnits. - */ - public OrderUpdateCallbackResponse( - String id, - ShippingOptionsPurchaseUnit purchaseUnits) { - this.id = id; - this.purchaseUnits = purchaseUnits; - } - - /** - * Getter for Id. - * The ID of the order. - * @return Returns the String - */ - @JsonGetter("id") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getId() { - return id; - } - - /** - * Setter for Id. - * The ID of the order. - * @param id Value for String - */ - @JsonSetter("id") - public void setId(String id) { - this.id = id; - } - - /** - * Getter for PurchaseUnits. - * This would contain shipping option and amount data at purchase unit level. - * @return Returns the ShippingOptionsPurchaseUnit - */ - @JsonGetter("purchase_units") - @JsonInclude(JsonInclude.Include.NON_NULL) - public ShippingOptionsPurchaseUnit getPurchaseUnits() { - return purchaseUnits; - } - - /** - * Setter for PurchaseUnits. - * This would contain shipping option and amount data at purchase unit level. - * @param purchaseUnits Value for ShippingOptionsPurchaseUnit - */ - @JsonSetter("purchase_units") - public void setPurchaseUnits(ShippingOptionsPurchaseUnit purchaseUnits) { - this.purchaseUnits = purchaseUnits; - } - - /** - * Converts this OrderUpdateCallbackResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "OrderUpdateCallbackResponse [" + "id=" + id + ", purchaseUnits=" + purchaseUnits - + "]"; - } - - /** - * Builds a new {@link OrderUpdateCallbackResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link OrderUpdateCallbackResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .id(getId()) - .purchaseUnits(getPurchaseUnits()); - return builder; - } - - /** - * Class to build instances of {@link OrderUpdateCallbackResponse}. - */ - public static class Builder { - private String id; - private ShippingOptionsPurchaseUnit purchaseUnits; - - - - /** - * Setter for id. - * @param id String value for id. - * @return Builder - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Setter for purchaseUnits. - * @param purchaseUnits ShippingOptionsPurchaseUnit value for purchaseUnits. - * @return Builder - */ - public Builder purchaseUnits(ShippingOptionsPurchaseUnit purchaseUnits) { - this.purchaseUnits = purchaseUnits; - return this; - } - - /** - * Builds a new {@link OrderUpdateCallbackResponse} object using the set fields. - * @return {@link OrderUpdateCallbackResponse} - */ - public OrderUpdateCallbackResponse build() { - return new OrderUpdateCallbackResponse(id, purchaseUnits); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackShippingAddress.java b/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackShippingAddress.java deleted file mode 100644 index b471d23..0000000 --- a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackShippingAddress.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for OrderUpdateCallbackShippingAddress type. - */ -public class OrderUpdateCallbackShippingAddress { - private String adminArea2; - private String adminArea1; - private String postalCode; - private String countryCode; - - /** - * Default constructor. - */ - public OrderUpdateCallbackShippingAddress() { - } - - /** - * Initialization constructor. - * @param countryCode String value for countryCode. - * @param adminArea2 String value for adminArea2. - * @param adminArea1 String value for adminArea1. - * @param postalCode String value for postalCode. - */ - public OrderUpdateCallbackShippingAddress( - String countryCode, - String adminArea2, - String adminArea1, - String postalCode) { - this.adminArea2 = adminArea2; - this.adminArea1 = adminArea1; - this.postalCode = postalCode; - this.countryCode = countryCode; - } - - /** - * Getter for AdminArea2. - * A city, town, or village. Smaller than `admin_area_level_1`. - * @return Returns the String - */ - @JsonGetter("admin_area_2") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getAdminArea2() { - return adminArea2; - } - - /** - * Setter for AdminArea2. - * A city, town, or village. Smaller than `admin_area_level_1`. - * @param adminArea2 Value for String - */ - @JsonSetter("admin_area_2") - public void setAdminArea2(String adminArea2) { - this.adminArea2 = adminArea2; - } - - /** - * Getter for AdminArea1. - * The highest-level sub-division in a country, which is usually a province, state, or - * ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, `CA` and not - * `California`. Value, by country, is: UK. A county. US. A state. Canada. A province. Japan. A - * prefecture. Switzerland. A *kanton*. - * @return Returns the String - */ - @JsonGetter("admin_area_1") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getAdminArea1() { - return adminArea1; - } - - /** - * Setter for AdminArea1. - * The highest-level sub-division in a country, which is usually a province, state, or - * ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, `CA` and not - * `California`. Value, by country, is: UK. A county. US. A state. Canada. A province. Japan. A - * prefecture. Switzerland. A *kanton*. - * @param adminArea1 Value for String - */ - @JsonSetter("admin_area_1") - public void setAdminArea1(String adminArea1) { - this.adminArea1 = adminArea1; - } - - /** - * Getter for PostalCode. - * 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). - * @return Returns the String - */ - @JsonGetter("postal_code") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getPostalCode() { - return postalCode; - } - - /** - * Setter for PostalCode. - * 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). - * @param postalCode Value for String - */ - @JsonSetter("postal_code") - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - - /** - * Getter for CountryCode. - * The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the - * country or region. Note: The country code for Great Britain is GB and not UK as used in the - * top-level domain names for that country. Use the `C2` country code for China worldwide for - * comparable uncontrolled price (CUP) method, bank card, and cross-border transactions. - * @return Returns the String - */ - @JsonGetter("country_code") - public String getCountryCode() { - return countryCode; - } - - /** - * Setter for CountryCode. - * The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the - * country or region. Note: The country code for Great Britain is GB and not UK as used in the - * top-level domain names for that country. Use the `C2` country code for China worldwide for - * comparable uncontrolled price (CUP) method, bank card, and cross-border transactions. - * @param countryCode Value for String - */ - @JsonSetter("country_code") - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - - /** - * Converts this OrderUpdateCallbackShippingAddress into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "OrderUpdateCallbackShippingAddress [" + "countryCode=" + countryCode - + ", adminArea2=" + adminArea2 + ", adminArea1=" + adminArea1 + ", postalCode=" - + postalCode + "]"; - } - - /** - * Builds a new {@link OrderUpdateCallbackShippingAddress.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link OrderUpdateCallbackShippingAddress.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(countryCode) - .adminArea2(getAdminArea2()) - .adminArea1(getAdminArea1()) - .postalCode(getPostalCode()); - return builder; - } - - /** - * Class to build instances of {@link OrderUpdateCallbackShippingAddress}. - */ - public static class Builder { - private String countryCode; - private String adminArea2; - private String adminArea1; - private String postalCode; - - /** - * Initialization constructor. - */ - public Builder() { - } - - /** - * Initialization constructor. - * @param countryCode String value for countryCode. - */ - public Builder(String countryCode) { - this.countryCode = countryCode; - } - - /** - * Setter for countryCode. - * @param countryCode String value for countryCode. - * @return Builder - */ - public Builder countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } - - /** - * Setter for adminArea2. - * @param adminArea2 String value for adminArea2. - * @return Builder - */ - public Builder adminArea2(String adminArea2) { - this.adminArea2 = adminArea2; - return this; - } - - /** - * Setter for adminArea1. - * @param adminArea1 String value for adminArea1. - * @return Builder - */ - public Builder adminArea1(String adminArea1) { - this.adminArea1 = adminArea1; - return this; - } - - /** - * Setter for postalCode. - * @param postalCode String value for postalCode. - * @return Builder - */ - public Builder postalCode(String postalCode) { - this.postalCode = postalCode; - return this; - } - - /** - * Builds a new {@link OrderUpdateCallbackShippingAddress} object using the set fields. - * @return {@link OrderUpdateCallbackShippingAddress} - */ - public OrderUpdateCallbackShippingAddress build() { - return new OrderUpdateCallbackShippingAddress(countryCode, adminArea2, adminArea1, - postalCode); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackShippingOption.java b/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackShippingOption.java deleted file mode 100644 index 81f7a85..0000000 --- a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackShippingOption.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for OrderUpdateCallbackShippingOption type. - */ -public class OrderUpdateCallbackShippingOption { - private String id; - private String label; - private ShippingType type; - private Money amount; - - /** - * Default constructor. - */ - public OrderUpdateCallbackShippingOption() { - } - - /** - * Initialization constructor. - * @param id String value for id. - * @param label String value for label. - * @param type ShippingType value for type. - * @param amount Money value for amount. - */ - public OrderUpdateCallbackShippingOption( - String id, - String label, - ShippingType type, - Money amount) { - this.id = id; - this.label = label; - this.type = type; - this.amount = amount; - } - - /** - * Getter for Id. - * A unique ID that identifies a payer-selected shipping option. - * @return Returns the String - */ - @JsonGetter("id") - public String getId() { - return id; - } - - /** - * Setter for Id. - * A unique ID that identifies a payer-selected shipping option. - * @param id Value for String - */ - @JsonSetter("id") - public void setId(String id) { - this.id = id; - } - - /** - * Getter for Label. - * A description that the payer sees, which helps them choose an appropriate shipping option. - * For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or - * `USPS yōuxiān fā huò`. Localize this description to the payer's locale. - * @return Returns the String - */ - @JsonGetter("label") - public String getLabel() { - return label; - } - - /** - * Setter for Label. - * A description that the payer sees, which helps them choose an appropriate shipping option. - * For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or - * `USPS yōuxiān fā huò`. Localize this description to the payer's locale. - * @param label Value for String - */ - @JsonSetter("label") - public void setLabel(String label) { - this.label = label; - } - - /** - * Getter for Type. - * A classification for the method of purchase fulfillment. - * @return Returns the ShippingType - */ - @JsonGetter("type") - @JsonInclude(JsonInclude.Include.NON_NULL) - public ShippingType getType() { - return type; - } - - /** - * Setter for Type. - * A classification for the method of purchase fulfillment. - * @param type Value for ShippingType - */ - @JsonSetter("type") - public void setType(ShippingType type) { - this.type = type; - } - - /** - * Getter for Amount. - * The currency and amount for a financial transaction, such as a balance or payment due. - * @return Returns the Money - */ - @JsonGetter("amount") - @JsonInclude(JsonInclude.Include.NON_NULL) - public Money getAmount() { - return amount; - } - - /** - * Setter for Amount. - * The currency and amount for a financial transaction, such as a balance or payment due. - * @param amount Value for Money - */ - @JsonSetter("amount") - public void setAmount(Money amount) { - this.amount = amount; - } - - /** - * Converts this OrderUpdateCallbackShippingOption into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "OrderUpdateCallbackShippingOption [" + "id=" + id + ", label=" + label + ", type=" - + type + ", amount=" + amount + "]"; - } - - /** - * Builds a new {@link OrderUpdateCallbackShippingOption.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link OrderUpdateCallbackShippingOption.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(id, label) - .type(getType()) - .amount(getAmount()); - return builder; - } - - /** - * Class to build instances of {@link OrderUpdateCallbackShippingOption}. - */ - public static class Builder { - private String id; - private String label; - private ShippingType type; - private Money amount; - - /** - * Initialization constructor. - */ - public Builder() { - } - - /** - * Initialization constructor. - * @param id String value for id. - * @param label String value for label. - */ - public Builder(String id, String label) { - this.id = id; - this.label = label; - } - - /** - * Setter for id. - * @param id String value for id. - * @return Builder - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Setter for label. - * @param label String value for label. - * @return Builder - */ - public Builder label(String label) { - this.label = label; - return this; - } - - /** - * Setter for type. - * @param type ShippingType value for type. - * @return Builder - */ - public Builder type(ShippingType type) { - this.type = type; - return this; - } - - /** - * Setter for amount. - * @param amount Money value for amount. - * @return Builder - */ - public Builder amount(Money amount) { - this.amount = amount; - return this; - } - - /** - * Builds a new {@link OrderUpdateCallbackShippingOption} object using the set fields. - * @return {@link OrderUpdateCallbackShippingOption} - */ - public OrderUpdateCallbackShippingOption build() { - return new OrderUpdateCallbackShippingOption(id, label, type, amount); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/OrdersCapture.java b/src/main/java/com/paypal/sdk/models/OrdersCapture.java index 0f7d724..eb60202 100644 --- a/src/main/java/com/paypal/sdk/models/OrdersCapture.java +++ b/src/main/java/com/paypal/sdk/models/OrdersCapture.java @@ -21,7 +21,7 @@ public class OrdersCapture { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private Boolean finalCapture; private SellerReceivableBreakdown sellerReceivableBreakdown; @@ -47,7 +47,7 @@ public OrdersCapture() { * @param amount Money value for amount. * @param invoiceId String value for invoiceId. * @param customId String value for customId. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @param sellerProtection SellerProtection value for sellerProtection. * @param finalCapture Boolean value for finalCapture. @@ -66,7 +66,7 @@ public OrdersCapture( Money amount, String invoiceId, String customId, - NetworkTransactionReference networkTransactionReference, + NetworkTransaction networkTransactionReference, SellerProtection sellerProtection, Boolean finalCapture, SellerReceivableBreakdown sellerReceivableBreakdown, @@ -225,21 +225,21 @@ public void setCustomId(String customId) { /** * Getter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getNetworkTransactionReference() { + public NetworkTransaction getNetworkTransactionReference() { return networkTransactionReference; } /** * Setter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param networkTransactionReference Value for NetworkTransactionReference + * @param networkTransactionReference Value for NetworkTransaction */ @JsonSetter("network_transaction_reference") - public void setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) { + public void setNetworkTransactionReference(NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; } @@ -483,7 +483,7 @@ public static class Builder { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private Boolean finalCapture = false; private SellerReceivableBreakdown sellerReceivableBreakdown; @@ -557,12 +557,12 @@ public Builder customId(String customId) { /** * Setter for networkTransactionReference. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @return Builder */ public Builder networkTransactionReference( - NetworkTransactionReference networkTransactionReference) { + NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/OsType.java b/src/main/java/com/paypal/sdk/models/OsType.java new file mode 100644 index 0000000..be4fd3f --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/OsType.java @@ -0,0 +1,117 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * OsType to be used. + */ +public enum OsType { + /** + * Google Android OS. + */ + ANDROID, + + /** + * Apple OS typically found in Apple mobile devices. + */ + IOS, + + /** + * Any other OS type. + */ + OTHER, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + ANDROID.value = "ANDROID"; + IOS.value = "IOS"; + OTHER.value = "OTHER"; + _UNKNOWN.value = null; + + valueMap.put("ANDROID", ANDROID); + valueMap.put("IOS", IOS); + valueMap.put("OTHER", OTHER); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static OsType constructFromString(String toConvert) throws IOException { + OsType enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static OsType fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of OsType values to list of string values. + * @param toConvert The list of OsType values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (OsType enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/PatchBillingPlanInput.java b/src/main/java/com/paypal/sdk/models/PatchBillingPlanInput.java new file mode 100644 index 0000000..397f8be --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PatchBillingPlanInput.java @@ -0,0 +1,184 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for PatchBillingPlanInput type. + */ +public class PatchBillingPlanInput { + private String id; + private String contentType; + private List body; + + /** + * Default constructor. + */ + public PatchBillingPlanInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body List of Patch value for body. + */ + public PatchBillingPlanInput( + String id, + String contentType, + List body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID of the plan. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the plan. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the List of Patch + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for List of Patch + */ + @JsonSetter("body") + public void setBody(List body) { + this.body = body; + } + + /** + * Converts this PatchBillingPlanInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PatchBillingPlanInput [" + "id=" + id + ", contentType=" + contentType + ", body=" + + body + "]"; + } + + /** + * Builds a new {@link PatchBillingPlanInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PatchBillingPlanInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link PatchBillingPlanInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private List body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body List of Patch value for body. + * @return Builder + */ + public Builder body(List body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link PatchBillingPlanInput} object using the set fields. + * @return {@link PatchBillingPlanInput} + */ + public PatchBillingPlanInput build() { + return new PatchBillingPlanInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PatchSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/PatchSubscriptionInput.java new file mode 100644 index 0000000..18e5d5e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PatchSubscriptionInput.java @@ -0,0 +1,184 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for PatchSubscriptionInput type. + */ +public class PatchSubscriptionInput { + private String id; + private String contentType; + private List body; + + /** + * Default constructor. + */ + public PatchSubscriptionInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body List of Patch value for body. + */ + public PatchSubscriptionInput( + String id, + String contentType, + List body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID for the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID for the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the List of Patch + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for List of Patch + */ + @JsonSetter("body") + public void setBody(List body) { + this.body = body; + } + + /** + * Converts this PatchSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PatchSubscriptionInput [" + "id=" + id + ", contentType=" + contentType + ", body=" + + body + "]"; + } + + /** + * Builds a new {@link PatchSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PatchSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link PatchSubscriptionInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private List body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body List of Patch value for body. + * @return Builder + */ + public Builder body(List body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link PatchSubscriptionInput} object using the set fields. + * @return {@link PatchSubscriptionInput} + */ + public PatchSubscriptionInput build() { + return new PatchSubscriptionInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PayerInformation.java b/src/main/java/com/paypal/sdk/models/PayerInformation.java new file mode 100644 index 0000000..723a917 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PayerInformation.java @@ -0,0 +1,380 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PayerInformation type. + */ +public class PayerInformation { + private String accountId; + private String emailAddress; + private Phone phoneNumber; + private String addressStatus; + private String payerStatus; + private PayerName payerName; + private String countryCode; + private SimplePostalAddressCoarseGrained address; + + /** + * Default constructor. + */ + public PayerInformation() { + } + + /** + * Initialization constructor. + * @param accountId String value for accountId. + * @param emailAddress String value for emailAddress. + * @param phoneNumber Phone value for phoneNumber. + * @param addressStatus String value for addressStatus. + * @param payerStatus String value for payerStatus. + * @param payerName PayerName value for payerName. + * @param countryCode String value for countryCode. + * @param address SimplePostalAddressCoarseGrained value for address. + */ + public PayerInformation( + String accountId, + String emailAddress, + Phone phoneNumber, + String addressStatus, + String payerStatus, + PayerName payerName, + String countryCode, + SimplePostalAddressCoarseGrained address) { + this.accountId = accountId; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.addressStatus = addressStatus; + this.payerStatus = payerStatus; + this.payerName = payerName; + this.countryCode = countryCode; + this.address = address; + } + + /** + * Getter for AccountId. + * The PayPal` customer account ID. + * @return Returns the String + */ + @JsonGetter("account_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAccountId() { + return accountId; + } + + /** + * Setter for AccountId. + * The PayPal` customer account ID. + * @param accountId Value for String + */ + @JsonSetter("account_id") + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + /** + * Getter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @return Returns the String + */ + @JsonGetter("email_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getEmailAddress() { + return emailAddress; + } + + /** + * Setter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @param emailAddress Value for String + */ + @JsonSetter("email_address") + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + /** + * Getter for PhoneNumber. + * The phone number, in its canonical international [E.164 numbering plan + * format](https://www.itu.int/rec/T-REC-E.164/en). + * @return Returns the Phone + */ + @JsonGetter("phone_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Phone getPhoneNumber() { + return phoneNumber; + } + + /** + * Setter for PhoneNumber. + * The phone number, in its canonical international [E.164 numbering plan + * format](https://www.itu.int/rec/T-REC-E.164/en). + * @param phoneNumber Value for Phone + */ + @JsonSetter("phone_number") + public void setPhoneNumber(Phone phoneNumber) { + this.phoneNumber = phoneNumber; + } + + /** + * Getter for AddressStatus. + * The address status of the payer. Value is either: Y. Verified. N. Not verified. + * @return Returns the String + */ + @JsonGetter("address_status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAddressStatus() { + return addressStatus; + } + + /** + * Setter for AddressStatus. + * The address status of the payer. Value is either: Y. Verified. N. Not verified. + * @param addressStatus Value for String + */ + @JsonSetter("address_status") + public void setAddressStatus(String addressStatus) { + this.addressStatus = addressStatus; + } + + /** + * Getter for PayerStatus. + * The status of the payer. Value is `Y` or `N`. + * @return Returns the String + */ + @JsonGetter("payer_status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPayerStatus() { + return payerStatus; + } + + /** + * Setter for PayerStatus. + * The status of the payer. Value is `Y` or `N`. + * @param payerStatus Value for String + */ + @JsonSetter("payer_status") + public void setPayerStatus(String payerStatus) { + this.payerStatus = payerStatus; + } + + /** + * Getter for PayerName. + * The name of the party. + * @return Returns the PayerName + */ + @JsonGetter("payer_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PayerName getPayerName() { + return payerName; + } + + /** + * Setter for PayerName. + * The name of the party. + * @param payerName Value for PayerName + */ + @JsonSetter("payer_name") + public void setPayerName(PayerName payerName) { + this.payerName = payerName; + } + + /** + * Getter for CountryCode. + * 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. + * @return Returns the String + */ + @JsonGetter("country_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCountryCode() { + return countryCode; + } + + /** + * Setter for CountryCode. + * 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. + * @param countryCode Value for String + */ + @JsonSetter("country_code") + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + /** + * Getter for Address. + * A simple postal address with coarse-grained fields. Do not use for an international address. + * Use for backward compatibility only. Does not contain phone. + * @return Returns the SimplePostalAddressCoarseGrained + */ + @JsonGetter("address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SimplePostalAddressCoarseGrained getAddress() { + return address; + } + + /** + * Setter for Address. + * A simple postal address with coarse-grained fields. Do not use for an international address. + * Use for backward compatibility only. Does not contain phone. + * @param address Value for SimplePostalAddressCoarseGrained + */ + @JsonSetter("address") + public void setAddress(SimplePostalAddressCoarseGrained address) { + this.address = address; + } + + /** + * Converts this PayerInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PayerInformation [" + "accountId=" + accountId + ", emailAddress=" + emailAddress + + ", phoneNumber=" + phoneNumber + ", addressStatus=" + addressStatus + + ", payerStatus=" + payerStatus + ", payerName=" + payerName + ", countryCode=" + + countryCode + ", address=" + address + "]"; + } + + /** + * Builds a new {@link PayerInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PayerInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .accountId(getAccountId()) + .emailAddress(getEmailAddress()) + .phoneNumber(getPhoneNumber()) + .addressStatus(getAddressStatus()) + .payerStatus(getPayerStatus()) + .payerName(getPayerName()) + .countryCode(getCountryCode()) + .address(getAddress()); + return builder; + } + + /** + * Class to build instances of {@link PayerInformation}. + */ + public static class Builder { + private String accountId; + private String emailAddress; + private Phone phoneNumber; + private String addressStatus; + private String payerStatus; + private PayerName payerName; + private String countryCode; + private SimplePostalAddressCoarseGrained address; + + + + /** + * Setter for accountId. + * @param accountId String value for accountId. + * @return Builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Setter for emailAddress. + * @param emailAddress String value for emailAddress. + * @return Builder + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Setter for phoneNumber. + * @param phoneNumber Phone value for phoneNumber. + * @return Builder + */ + public Builder phoneNumber(Phone phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Setter for addressStatus. + * @param addressStatus String value for addressStatus. + * @return Builder + */ + public Builder addressStatus(String addressStatus) { + this.addressStatus = addressStatus; + return this; + } + + /** + * Setter for payerStatus. + * @param payerStatus String value for payerStatus. + * @return Builder + */ + public Builder payerStatus(String payerStatus) { + this.payerStatus = payerStatus; + return this; + } + + /** + * Setter for payerName. + * @param payerName PayerName value for payerName. + * @return Builder + */ + public Builder payerName(PayerName payerName) { + this.payerName = payerName; + return this; + } + + /** + * Setter for countryCode. + * @param countryCode String value for countryCode. + * @return Builder + */ + public Builder countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Setter for address. + * @param address SimplePostalAddressCoarseGrained value for address. + * @return Builder + */ + public Builder address(SimplePostalAddressCoarseGrained address) { + this.address = address; + return this; + } + + /** + * Builds a new {@link PayerInformation} object using the set fields. + * @return {@link PayerInformation} + */ + public PayerInformation build() { + return new PayerInformation(accountId, emailAddress, phoneNumber, addressStatus, + payerStatus, payerName, countryCode, address); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PayerName.java b/src/main/java/com/paypal/sdk/models/PayerName.java new file mode 100644 index 0000000..aff8971 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PayerName.java @@ -0,0 +1,334 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PayerName type. + */ +public class PayerName { + private String prefix; + private String givenName; + private String surname; + private String middleName; + private String suffix; + private String alternateFullName; + private String fullName; + + /** + * Default constructor. + */ + public PayerName() { + } + + /** + * Initialization constructor. + * @param prefix String value for prefix. + * @param givenName String value for givenName. + * @param surname String value for surname. + * @param middleName String value for middleName. + * @param suffix String value for suffix. + * @param alternateFullName String value for alternateFullName. + * @param fullName String value for fullName. + */ + public PayerName( + String prefix, + String givenName, + String surname, + String middleName, + String suffix, + String alternateFullName, + String fullName) { + this.prefix = prefix; + this.givenName = givenName; + this.surname = surname; + this.middleName = middleName; + this.suffix = suffix; + this.alternateFullName = alternateFullName; + this.fullName = fullName; + } + + /** + * Getter for Prefix. + * The prefix, or title, to the party's name. + * @return Returns the String + */ + @JsonGetter("prefix") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPrefix() { + return prefix; + } + + /** + * Setter for Prefix. + * The prefix, or title, to the party's name. + * @param prefix Value for String + */ + @JsonSetter("prefix") + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + /** + * Getter for GivenName. + * When the party is a person, the party's given, or first, name. + * @return Returns the String + */ + @JsonGetter("given_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getGivenName() { + return givenName; + } + + /** + * Setter for GivenName. + * When the party is a person, the party's given, or first, name. + * @param givenName Value for String + */ + @JsonSetter("given_name") + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + /** + * Getter for Surname. + * 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. + * @return Returns the String + */ + @JsonGetter("surname") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSurname() { + return surname; + } + + /** + * Setter for Surname. + * 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. + * @param surname Value for String + */ + @JsonSetter("surname") + public void setSurname(String surname) { + this.surname = surname; + } + + /** + * Getter for MiddleName. + * When the party is a person, the party's middle name. Use also to store multiple middle names + * including the patronymic, or father's, middle name. + * @return Returns the String + */ + @JsonGetter("middle_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getMiddleName() { + return middleName; + } + + /** + * Setter for MiddleName. + * When the party is a person, the party's middle name. Use also to store multiple middle names + * including the patronymic, or father's, middle name. + * @param middleName Value for String + */ + @JsonSetter("middle_name") + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + /** + * Getter for Suffix. + * The suffix for the party's name. + * @return Returns the String + */ + @JsonGetter("suffix") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSuffix() { + return suffix; + } + + /** + * Setter for Suffix. + * The suffix for the party's name. + * @param suffix Value for String + */ + @JsonSetter("suffix") + public void setSuffix(String suffix) { + this.suffix = suffix; + } + + /** + * Getter for AlternateFullName. + * 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. + * @return Returns the String + */ + @JsonGetter("alternate_full_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAlternateFullName() { + return alternateFullName; + } + + /** + * Setter for AlternateFullName. + * 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. + * @param alternateFullName Value for String + */ + @JsonSetter("alternate_full_name") + public void setAlternateFullName(String alternateFullName) { + this.alternateFullName = alternateFullName; + } + + /** + * Getter for FullName. + * When the party is a person, the party's full name. + * @return Returns the String + */ + @JsonGetter("full_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFullName() { + return fullName; + } + + /** + * Setter for FullName. + * When the party is a person, the party's full name. + * @param fullName Value for String + */ + @JsonSetter("full_name") + public void setFullName(String fullName) { + this.fullName = fullName; + } + + /** + * Converts this PayerName into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PayerName [" + "prefix=" + prefix + ", givenName=" + givenName + ", surname=" + + surname + ", middleName=" + middleName + ", suffix=" + suffix + + ", alternateFullName=" + alternateFullName + ", fullName=" + fullName + "]"; + } + + /** + * Builds a new {@link PayerName.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PayerName.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .prefix(getPrefix()) + .givenName(getGivenName()) + .surname(getSurname()) + .middleName(getMiddleName()) + .suffix(getSuffix()) + .alternateFullName(getAlternateFullName()) + .fullName(getFullName()); + return builder; + } + + /** + * Class to build instances of {@link PayerName}. + */ + public static class Builder { + private String prefix; + private String givenName; + private String surname; + private String middleName; + private String suffix; + private String alternateFullName; + private String fullName; + + + + /** + * Setter for prefix. + * @param prefix String value for prefix. + * @return Builder + */ + public Builder prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Setter for givenName. + * @param givenName String value for givenName. + * @return Builder + */ + public Builder givenName(String givenName) { + this.givenName = givenName; + return this; + } + + /** + * Setter for surname. + * @param surname String value for surname. + * @return Builder + */ + public Builder surname(String surname) { + this.surname = surname; + return this; + } + + /** + * Setter for middleName. + * @param middleName String value for middleName. + * @return Builder + */ + public Builder middleName(String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Setter for suffix. + * @param suffix String value for suffix. + * @return Builder + */ + public Builder suffix(String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Setter for alternateFullName. + * @param alternateFullName String value for alternateFullName. + * @return Builder + */ + public Builder alternateFullName(String alternateFullName) { + this.alternateFullName = alternateFullName; + return this; + } + + /** + * Setter for fullName. + * @param fullName String value for fullName. + * @return Builder + */ + public Builder fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Builds a new {@link PayerName} object using the set fields. + * @return {@link PayerName} + */ + public PayerName build() { + return new PayerName(prefix, givenName, surname, middleName, suffix, alternateFullName, + fullName); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PaymentAuthorization.java b/src/main/java/com/paypal/sdk/models/PaymentAuthorization.java index dda9845..8e4aff4 100644 --- a/src/main/java/com/paypal/sdk/models/PaymentAuthorization.java +++ b/src/main/java/com/paypal/sdk/models/PaymentAuthorization.java @@ -21,7 +21,7 @@ public class PaymentAuthorization { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private String expirationTime; private List links; @@ -44,7 +44,7 @@ public PaymentAuthorization() { * @param amount Money value for amount. * @param invoiceId String value for invoiceId. * @param customId String value for customId. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @param sellerProtection SellerProtection value for sellerProtection. * @param expirationTime String value for expirationTime. @@ -61,7 +61,7 @@ public PaymentAuthorization( Money amount, String invoiceId, String customId, - NetworkTransactionReference networkTransactionReference, + NetworkTransaction networkTransactionReference, SellerProtection sellerProtection, String expirationTime, List links, @@ -218,21 +218,21 @@ public void setCustomId(String customId) { /** * Getter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getNetworkTransactionReference() { + public NetworkTransaction getNetworkTransactionReference() { return networkTransactionReference; } /** * Setter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param networkTransactionReference Value for NetworkTransactionReference + * @param networkTransactionReference Value for NetworkTransaction */ @JsonSetter("network_transaction_reference") - public void setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) { + public void setNetworkTransactionReference(NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; } @@ -453,7 +453,7 @@ public static class Builder { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private String expirationTime; private List links; @@ -526,12 +526,12 @@ public Builder customId(String customId) { /** * Setter for networkTransactionReference. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @return Builder */ public Builder networkTransactionReference( - NetworkTransactionReference networkTransactionReference) { + NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/PaymentMethod.java b/src/main/java/com/paypal/sdk/models/PaymentMethod.java new file mode 100644 index 0000000..533c130 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PaymentMethod.java @@ -0,0 +1,103 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PaymentMethod type. + */ +public class PaymentMethod { + private PayeePaymentMethodPreference payeePreferred; + + /** + * Default constructor. + */ + public PaymentMethod() { + payeePreferred = PayeePaymentMethodPreference.UNRESTRICTED; + } + + /** + * Initialization constructor. + * @param payeePreferred PayeePaymentMethodPreference value for payeePreferred. + */ + public PaymentMethod( + PayeePaymentMethodPreference payeePreferred) { + this.payeePreferred = payeePreferred; + } + + /** + * Getter for PayeePreferred. + * The merchant-preferred payment methods. + * @return Returns the PayeePaymentMethodPreference + */ + @JsonGetter("payee_preferred") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PayeePaymentMethodPreference getPayeePreferred() { + return payeePreferred; + } + + /** + * Setter for PayeePreferred. + * The merchant-preferred payment methods. + * @param payeePreferred Value for PayeePaymentMethodPreference + */ + @JsonSetter("payee_preferred") + public void setPayeePreferred(PayeePaymentMethodPreference payeePreferred) { + this.payeePreferred = payeePreferred; + } + + /** + * Converts this PaymentMethod into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PaymentMethod [" + "payeePreferred=" + payeePreferred + "]"; + } + + /** + * Builds a new {@link PaymentMethod.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PaymentMethod.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .payeePreferred(getPayeePreferred()); + return builder; + } + + /** + * Class to build instances of {@link PaymentMethod}. + */ + public static class Builder { + private PayeePaymentMethodPreference payeePreferred = + PayeePaymentMethodPreference.UNRESTRICTED; + + + + /** + * Setter for payeePreferred. + * @param payeePreferred PayeePaymentMethodPreference value for payeePreferred. + * @return Builder + */ + public Builder payeePreferred(PayeePaymentMethodPreference payeePreferred) { + this.payeePreferred = payeePreferred; + return this; + } + + /** + * Builds a new {@link PaymentMethod} object using the set fields. + * @return {@link PaymentMethod} + */ + public PaymentMethod build() { + return new PaymentMethod(payeePreferred); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PaymentPreferences.java b/src/main/java/com/paypal/sdk/models/PaymentPreferences.java new file mode 100644 index 0000000..1440ecc --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PaymentPreferences.java @@ -0,0 +1,222 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PaymentPreferences type. + */ +public class PaymentPreferences { + private Boolean autoBillOutstanding; + private Money setupFee; + private SetupFeeFailureAction setupFeeFailureAction; + private Integer paymentFailureThreshold; + + /** + * Default constructor. + */ + public PaymentPreferences() { + autoBillOutstanding = true; + setupFeeFailureAction = SetupFeeFailureAction.CANCEL; + paymentFailureThreshold = 0; + } + + /** + * Initialization constructor. + * @param autoBillOutstanding Boolean value for autoBillOutstanding. + * @param setupFee Money value for setupFee. + * @param setupFeeFailureAction SetupFeeFailureAction value for setupFeeFailureAction. + * @param paymentFailureThreshold Integer value for paymentFailureThreshold. + */ + public PaymentPreferences( + Boolean autoBillOutstanding, + Money setupFee, + SetupFeeFailureAction setupFeeFailureAction, + Integer paymentFailureThreshold) { + this.autoBillOutstanding = autoBillOutstanding; + this.setupFee = setupFee; + this.setupFeeFailureAction = setupFeeFailureAction; + this.paymentFailureThreshold = paymentFailureThreshold; + } + + /** + * Getter for AutoBillOutstanding. + * Indicates whether to automatically bill the outstanding amount in the next billing cycle. + * @return Returns the Boolean + */ + @JsonGetter("auto_bill_outstanding") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getAutoBillOutstanding() { + return autoBillOutstanding; + } + + /** + * Setter for AutoBillOutstanding. + * Indicates whether to automatically bill the outstanding amount in the next billing cycle. + * @param autoBillOutstanding Value for Boolean + */ + @JsonSetter("auto_bill_outstanding") + public void setAutoBillOutstanding(Boolean autoBillOutstanding) { + this.autoBillOutstanding = autoBillOutstanding; + } + + /** + * Getter for SetupFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("setup_fee") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getSetupFee() { + return setupFee; + } + + /** + * Setter for SetupFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param setupFee Value for Money + */ + @JsonSetter("setup_fee") + public void setSetupFee(Money setupFee) { + this.setupFee = setupFee; + } + + /** + * Getter for SetupFeeFailureAction. + * The action to take on the subscription if the initial payment for the setup fails. + * @return Returns the SetupFeeFailureAction + */ + @JsonGetter("setup_fee_failure_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SetupFeeFailureAction getSetupFeeFailureAction() { + return setupFeeFailureAction; + } + + /** + * Setter for SetupFeeFailureAction. + * The action to take on the subscription if the initial payment for the setup fails. + * @param setupFeeFailureAction Value for SetupFeeFailureAction + */ + @JsonSetter("setup_fee_failure_action") + public void setSetupFeeFailureAction(SetupFeeFailureAction setupFeeFailureAction) { + this.setupFeeFailureAction = setupFeeFailureAction; + } + + /** + * Getter for PaymentFailureThreshold. + * 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. + * @return Returns the Integer + */ + @JsonGetter("payment_failure_threshold") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPaymentFailureThreshold() { + return paymentFailureThreshold; + } + + /** + * Setter for PaymentFailureThreshold. + * 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. + * @param paymentFailureThreshold Value for Integer + */ + @JsonSetter("payment_failure_threshold") + public void setPaymentFailureThreshold(Integer paymentFailureThreshold) { + this.paymentFailureThreshold = paymentFailureThreshold; + } + + /** + * Converts this PaymentPreferences into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PaymentPreferences [" + "autoBillOutstanding=" + autoBillOutstanding + ", setupFee=" + + setupFee + ", setupFeeFailureAction=" + setupFeeFailureAction + + ", paymentFailureThreshold=" + paymentFailureThreshold + "]"; + } + + /** + * Builds a new {@link PaymentPreferences.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PaymentPreferences.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .autoBillOutstanding(getAutoBillOutstanding()) + .setupFee(getSetupFee()) + .setupFeeFailureAction(getSetupFeeFailureAction()) + .paymentFailureThreshold(getPaymentFailureThreshold()); + return builder; + } + + /** + * Class to build instances of {@link PaymentPreferences}. + */ + public static class Builder { + private Boolean autoBillOutstanding = true; + private Money setupFee; + private SetupFeeFailureAction setupFeeFailureAction = SetupFeeFailureAction.CANCEL; + private Integer paymentFailureThreshold = 0; + + + + /** + * Setter for autoBillOutstanding. + * @param autoBillOutstanding Boolean value for autoBillOutstanding. + * @return Builder + */ + public Builder autoBillOutstanding(Boolean autoBillOutstanding) { + this.autoBillOutstanding = autoBillOutstanding; + return this; + } + + /** + * Setter for setupFee. + * @param setupFee Money value for setupFee. + * @return Builder + */ + public Builder setupFee(Money setupFee) { + this.setupFee = setupFee; + return this; + } + + /** + * Setter for setupFeeFailureAction. + * @param setupFeeFailureAction SetupFeeFailureAction value for setupFeeFailureAction. + * @return Builder + */ + public Builder setupFeeFailureAction(SetupFeeFailureAction setupFeeFailureAction) { + this.setupFeeFailureAction = setupFeeFailureAction; + return this; + } + + /** + * Setter for paymentFailureThreshold. + * @param paymentFailureThreshold Integer value for paymentFailureThreshold. + * @return Builder + */ + public Builder paymentFailureThreshold(Integer paymentFailureThreshold) { + this.paymentFailureThreshold = paymentFailureThreshold; + return this; + } + + /** + * Builds a new {@link PaymentPreferences} object using the set fields. + * @return {@link PaymentPreferences} + */ + public PaymentPreferences build() { + return new PaymentPreferences(autoBillOutstanding, setupFee, setupFeeFailureAction, + paymentFailureThreshold); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PaymentPreferencesOverride.java b/src/main/java/com/paypal/sdk/models/PaymentPreferencesOverride.java new file mode 100644 index 0000000..2f4547e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PaymentPreferencesOverride.java @@ -0,0 +1,219 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PaymentPreferencesOverride type. + */ +public class PaymentPreferencesOverride { + private Boolean autoBillOutstanding; + private Money setupFee; + private SetupFeeFailureAction setupFeeFailureAction; + private Integer paymentFailureThreshold; + + /** + * Default constructor. + */ + public PaymentPreferencesOverride() { + } + + /** + * Initialization constructor. + * @param autoBillOutstanding Boolean value for autoBillOutstanding. + * @param setupFee Money value for setupFee. + * @param setupFeeFailureAction SetupFeeFailureAction value for setupFeeFailureAction. + * @param paymentFailureThreshold Integer value for paymentFailureThreshold. + */ + public PaymentPreferencesOverride( + Boolean autoBillOutstanding, + Money setupFee, + SetupFeeFailureAction setupFeeFailureAction, + Integer paymentFailureThreshold) { + this.autoBillOutstanding = autoBillOutstanding; + this.setupFee = setupFee; + this.setupFeeFailureAction = setupFeeFailureAction; + this.paymentFailureThreshold = paymentFailureThreshold; + } + + /** + * Getter for AutoBillOutstanding. + * Indicates whether to automatically bill the outstanding amount in the next billing cycle. + * @return Returns the Boolean + */ + @JsonGetter("auto_bill_outstanding") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getAutoBillOutstanding() { + return autoBillOutstanding; + } + + /** + * Setter for AutoBillOutstanding. + * Indicates whether to automatically bill the outstanding amount in the next billing cycle. + * @param autoBillOutstanding Value for Boolean + */ + @JsonSetter("auto_bill_outstanding") + public void setAutoBillOutstanding(Boolean autoBillOutstanding) { + this.autoBillOutstanding = autoBillOutstanding; + } + + /** + * Getter for SetupFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("setup_fee") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getSetupFee() { + return setupFee; + } + + /** + * Setter for SetupFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param setupFee Value for Money + */ + @JsonSetter("setup_fee") + public void setSetupFee(Money setupFee) { + this.setupFee = setupFee; + } + + /** + * Getter for SetupFeeFailureAction. + * The action to take on the subscription if the initial payment for the setup fails. + * @return Returns the SetupFeeFailureAction + */ + @JsonGetter("setup_fee_failure_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SetupFeeFailureAction getSetupFeeFailureAction() { + return setupFeeFailureAction; + } + + /** + * Setter for SetupFeeFailureAction. + * The action to take on the subscription if the initial payment for the setup fails. + * @param setupFeeFailureAction Value for SetupFeeFailureAction + */ + @JsonSetter("setup_fee_failure_action") + public void setSetupFeeFailureAction(SetupFeeFailureAction setupFeeFailureAction) { + this.setupFeeFailureAction = setupFeeFailureAction; + } + + /** + * Getter for PaymentFailureThreshold. + * 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. + * @return Returns the Integer + */ + @JsonGetter("payment_failure_threshold") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPaymentFailureThreshold() { + return paymentFailureThreshold; + } + + /** + * Setter for PaymentFailureThreshold. + * 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. + * @param paymentFailureThreshold Value for Integer + */ + @JsonSetter("payment_failure_threshold") + public void setPaymentFailureThreshold(Integer paymentFailureThreshold) { + this.paymentFailureThreshold = paymentFailureThreshold; + } + + /** + * Converts this PaymentPreferencesOverride into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PaymentPreferencesOverride [" + "autoBillOutstanding=" + autoBillOutstanding + + ", setupFee=" + setupFee + ", setupFeeFailureAction=" + setupFeeFailureAction + + ", paymentFailureThreshold=" + paymentFailureThreshold + "]"; + } + + /** + * Builds a new {@link PaymentPreferencesOverride.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PaymentPreferencesOverride.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .autoBillOutstanding(getAutoBillOutstanding()) + .setupFee(getSetupFee()) + .setupFeeFailureAction(getSetupFeeFailureAction()) + .paymentFailureThreshold(getPaymentFailureThreshold()); + return builder; + } + + /** + * Class to build instances of {@link PaymentPreferencesOverride}. + */ + public static class Builder { + private Boolean autoBillOutstanding; + private Money setupFee; + private SetupFeeFailureAction setupFeeFailureAction; + private Integer paymentFailureThreshold; + + + + /** + * Setter for autoBillOutstanding. + * @param autoBillOutstanding Boolean value for autoBillOutstanding. + * @return Builder + */ + public Builder autoBillOutstanding(Boolean autoBillOutstanding) { + this.autoBillOutstanding = autoBillOutstanding; + return this; + } + + /** + * Setter for setupFee. + * @param setupFee Money value for setupFee. + * @return Builder + */ + public Builder setupFee(Money setupFee) { + this.setupFee = setupFee; + return this; + } + + /** + * Setter for setupFeeFailureAction. + * @param setupFeeFailureAction SetupFeeFailureAction value for setupFeeFailureAction. + * @return Builder + */ + public Builder setupFeeFailureAction(SetupFeeFailureAction setupFeeFailureAction) { + this.setupFeeFailureAction = setupFeeFailureAction; + return this; + } + + /** + * Setter for paymentFailureThreshold. + * @param paymentFailureThreshold Integer value for paymentFailureThreshold. + * @return Builder + */ + public Builder paymentFailureThreshold(Integer paymentFailureThreshold) { + this.paymentFailureThreshold = paymentFailureThreshold; + return this; + } + + /** + * Builds a new {@link PaymentPreferencesOverride} object using the set fields. + * @return {@link PaymentPreferencesOverride} + */ + public PaymentPreferencesOverride build() { + return new PaymentPreferencesOverride(autoBillOutstanding, setupFee, + setupFeeFailureAction, paymentFailureThreshold); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PaymentTokenResponse.java b/src/main/java/com/paypal/sdk/models/PaymentTokenResponse.java index 84fce70..a18734e 100644 --- a/src/main/java/com/paypal/sdk/models/PaymentTokenResponse.java +++ b/src/main/java/com/paypal/sdk/models/PaymentTokenResponse.java @@ -46,7 +46,8 @@ public PaymentTokenResponse( /** * Getter for Id. - * The PayPal-generated ID for the vault token. + * The PayPal-generated ID for the vaulted payment source. This ID should be stored on the + * merchant's server so the saved payment source can be used for future transactions. * @return Returns the String */ @JsonGetter("id") @@ -57,7 +58,8 @@ public String getId() { /** * Setter for Id. - * The PayPal-generated ID for the vault token. + * The PayPal-generated ID for the vaulted payment source. This ID should be stored on the + * merchant's server so the saved payment source can be used for future transactions. * @param id Value for String */ @JsonSetter("id") diff --git a/src/main/java/com/paypal/sdk/models/PaymentTokenResponsePaymentSource.java b/src/main/java/com/paypal/sdk/models/PaymentTokenResponsePaymentSource.java index b1e45a5..9387982 100644 --- a/src/main/java/com/paypal/sdk/models/PaymentTokenResponsePaymentSource.java +++ b/src/main/java/com/paypal/sdk/models/PaymentTokenResponsePaymentSource.java @@ -66,6 +66,7 @@ public void setCard(CardPaymentTokenEntity card) { /** * Getter for Paypal. + * Full representation of a PayPal Payment Token. * @return Returns the PaypalPaymentToken */ @JsonGetter("paypal") @@ -76,6 +77,7 @@ public PaypalPaymentToken getPaypal() { /** * Setter for Paypal. + * Full representation of a PayPal Payment Token. * @param paypal Value for PaypalPaymentToken */ @JsonSetter("paypal") @@ -85,6 +87,7 @@ public void setPaypal(PaypalPaymentToken paypal) { /** * Getter for Venmo. + * Full representation of a Venmo Payment Token. * @return Returns the VenmoPaymentToken */ @JsonGetter("venmo") @@ -95,6 +98,7 @@ public VenmoPaymentToken getVenmo() { /** * Setter for Venmo. + * Full representation of a Venmo Payment Token. * @param venmo Value for VenmoPaymentToken */ @JsonSetter("venmo") diff --git a/src/main/java/com/paypal/sdk/models/PaymentTokenStatus.java b/src/main/java/com/paypal/sdk/models/PaymentTokenStatus.java index a64b767..2c1eaa0 100644 --- a/src/main/java/com/paypal/sdk/models/PaymentTokenStatus.java +++ b/src/main/java/com/paypal/sdk/models/PaymentTokenStatus.java @@ -23,7 +23,7 @@ public enum PaymentTokenStatus { CREATED, /** - * A contingecy on payer approval is required before the payment method can be saved. + * A contingency on payer approval is required before the payment method can be saved. */ PAYER_ACTION_REQUIRED, diff --git a/src/main/java/com/paypal/sdk/models/PaymentsCapture.java b/src/main/java/com/paypal/sdk/models/PaymentsCapture.java index 5c4245f..0aadf45 100644 --- a/src/main/java/com/paypal/sdk/models/PaymentsCapture.java +++ b/src/main/java/com/paypal/sdk/models/PaymentsCapture.java @@ -21,13 +21,13 @@ public class PaymentsCapture { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private Boolean finalCapture; private SellerReceivableBreakdown sellerReceivableBreakdown; private DisbursementMode disbursementMode; private List links; - private PaymentsProcessorResponse processorResponse; + private ProcessorResponse processorResponse; private String createTime; private String updateTime; @@ -47,7 +47,7 @@ public PaymentsCapture() { * @param amount Money value for amount. * @param invoiceId String value for invoiceId. * @param customId String value for customId. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @param sellerProtection SellerProtection value for sellerProtection. * @param finalCapture Boolean value for finalCapture. @@ -55,7 +55,7 @@ public PaymentsCapture() { * sellerReceivableBreakdown. * @param disbursementMode DisbursementMode value for disbursementMode. * @param links List of LinkDescription value for links. - * @param processorResponse PaymentsProcessorResponse value for processorResponse. + * @param processorResponse ProcessorResponse value for processorResponse. * @param createTime String value for createTime. * @param updateTime String value for updateTime. */ @@ -66,13 +66,13 @@ public PaymentsCapture( Money amount, String invoiceId, String customId, - NetworkTransactionReference networkTransactionReference, + NetworkTransaction networkTransactionReference, SellerProtection sellerProtection, Boolean finalCapture, SellerReceivableBreakdown sellerReceivableBreakdown, DisbursementMode disbursementMode, List links, - PaymentsProcessorResponse processorResponse, + ProcessorResponse processorResponse, String createTime, String updateTime) { this.status = status; @@ -225,21 +225,21 @@ public void setCustomId(String customId) { /** * Getter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getNetworkTransactionReference() { + public NetworkTransaction getNetworkTransactionReference() { return networkTransactionReference; } /** * Setter for NetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param networkTransactionReference Value for NetworkTransactionReference + * @param networkTransactionReference Value for NetworkTransaction */ @JsonSetter("network_transaction_reference") - public void setNetworkTransactionReference(NetworkTransactionReference networkTransactionReference) { + public void setNetworkTransactionReference(NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; } @@ -360,11 +360,11 @@ public void setLinks(List links) { * Getter for ProcessorResponse. * The processor response information for payment requests, such as direct credit card * transactions. - * @return Returns the PaymentsProcessorResponse + * @return Returns the ProcessorResponse */ @JsonGetter("processor_response") @JsonInclude(JsonInclude.Include.NON_NULL) - public PaymentsProcessorResponse getProcessorResponse() { + public ProcessorResponse getProcessorResponse() { return processorResponse; } @@ -372,10 +372,10 @@ public PaymentsProcessorResponse getProcessorResponse() { * Setter for ProcessorResponse. * The processor response information for payment requests, such as direct credit card * transactions. - * @param processorResponse Value for PaymentsProcessorResponse + * @param processorResponse Value for ProcessorResponse */ @JsonSetter("processor_response") - public void setProcessorResponse(PaymentsProcessorResponse processorResponse) { + public void setProcessorResponse(ProcessorResponse processorResponse) { this.processorResponse = processorResponse; } @@ -483,13 +483,13 @@ public static class Builder { private Money amount; private String invoiceId; private String customId; - private NetworkTransactionReference networkTransactionReference; + private NetworkTransaction networkTransactionReference; private SellerProtection sellerProtection; private Boolean finalCapture = false; private SellerReceivableBreakdown sellerReceivableBreakdown; private DisbursementMode disbursementMode = DisbursementMode.INSTANT; private List links; - private PaymentsProcessorResponse processorResponse; + private ProcessorResponse processorResponse; private String createTime; private String updateTime; @@ -557,12 +557,12 @@ public Builder customId(String customId) { /** * Setter for networkTransactionReference. - * @param networkTransactionReference NetworkTransactionReference value for + * @param networkTransactionReference NetworkTransaction value for * networkTransactionReference. * @return Builder */ public Builder networkTransactionReference( - NetworkTransactionReference networkTransactionReference) { + NetworkTransaction networkTransactionReference) { this.networkTransactionReference = networkTransactionReference; return this; } @@ -621,10 +621,10 @@ public Builder links(List links) { /** * Setter for processorResponse. - * @param processorResponse PaymentsProcessorResponse value for processorResponse. + * @param processorResponse ProcessorResponse value for processorResponse. * @return Builder */ - public Builder processorResponse(PaymentsProcessorResponse processorResponse) { + public Builder processorResponse(ProcessorResponse processorResponse) { this.processorResponse = processorResponse; return this; } diff --git a/src/main/java/com/paypal/sdk/models/PaymentsPaymentAdviceCode.java b/src/main/java/com/paypal/sdk/models/PaymentsPaymentAdviceCode.java deleted file mode 100644 index b948623..0000000 --- a/src/main/java/com/paypal/sdk/models/PaymentsPaymentAdviceCode.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.TreeMap; - - -/** - * PaymentsPaymentAdviceCode to be used. - */ -public enum PaymentsPaymentAdviceCode { - /** - * For Mastercard, expired card account upgrade or portfolio sale conversion. Obtain new account information before next billing cycle. - */ - PAYMENTADVICE_01, - - /** - * For Mastercard, over credit limit or insufficient funds. Retry the transaction 72 hours later. For Visa, the card holder wants to stop only one specific payment in the recurring payment relationship. The merchant must NOT resubmit the same transaction. The merchant can continue the billing process in the subsequent billing period. - */ - PAYMENTADVICE_02, - - /** - * For Mastercard, account closed as fraudulent. Obtain another type of payment from customer due to account being closed or fraud. Possible reason: Account closed as fraudulent. For Visa, the card holder wants to stop all recurring payment transactions for a specific merchant. Stop recurring payment requests. - */ - PAYMENTADVICE_03, - - /** - * For Mastercard, the card holder has been unsuccessful at canceling recurring payment through merchant. Stop recurring payment requests. For Visa, all recurring payments were canceled for the card number requested. Stop recurring payment requests. - */ - PAYMENTADVICE_21, - - /** - * Unknown values will be mapped by this enum member - */ - _UNKNOWN; - - - private static TreeMap valueMap = new TreeMap<>(); - private String value; - - static { - PAYMENTADVICE_01.value = "01"; - PAYMENTADVICE_02.value = "02"; - PAYMENTADVICE_03.value = "03"; - PAYMENTADVICE_21.value = "21"; - _UNKNOWN.value = null; - - valueMap.put("01", PAYMENTADVICE_01); - valueMap.put("02", PAYMENTADVICE_02); - valueMap.put("03", PAYMENTADVICE_03); - valueMap.put("21", PAYMENTADVICE_21); - } - - /** - * Returns the enum member associated with the given string value. - * @param toConvert String value to get enum member. - * @return The enum member against the given string value. - * @throws IOException when provided value is not mapped to any enum member. - */ - @JsonCreator - public static PaymentsPaymentAdviceCode constructFromString(String toConvert) throws IOException { - PaymentsPaymentAdviceCode enumValue = fromString(toConvert); - if (enumValue == null) { - throw new IOException("Unable to create enum instance with value: " + toConvert); - } - return enumValue; - } - - /** - * Returns the enum member associated with the given string value. - * @param toConvert String value to get enum member. - * @return The enum member against the given string value. - */ - public static PaymentsPaymentAdviceCode fromString(String toConvert) { - if (!valueMap.containsKey(toConvert)) { - return _UNKNOWN; - } - return valueMap.get(toConvert); - } - - /** - * Returns the string value associated with the enum member. - * @return The string value against enum member. - */ - @JsonValue - public String value() { - return value; - } - - /** - * Get string representation of this enum. - */ - @Override - public String toString() { - if (value == null) { - return null; - } - return value.toString(); - } - - /** - * Convert list of PaymentsPaymentAdviceCode values to list of string values. - * @param toConvert The list of PaymentsPaymentAdviceCode values to convert. - * @return List of representative string values. - */ - public static List toValue(List toConvert) { - if (toConvert == null) { - return null; - } - List convertedValues = new ArrayList<>(); - for (PaymentsPaymentAdviceCode enumValue : toConvert) { - convertedValues.add(enumValue.value); - } - return convertedValues; - } -} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/PaymentsProcessorResponse.java b/src/main/java/com/paypal/sdk/models/PaymentsProcessorResponse.java deleted file mode 100644 index 6ad662a..0000000 --- a/src/main/java/com/paypal/sdk/models/PaymentsProcessorResponse.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for PaymentsProcessorResponse type. - */ -public class PaymentsProcessorResponse { - private AvsCode avsCode; - private CvvCode cvvCode; - private ProcessorResponseCode responseCode; - private PaymentsPaymentAdviceCode paymentAdviceCode; - - /** - * Default constructor. - */ - public PaymentsProcessorResponse() { - } - - /** - * Initialization constructor. - * @param avsCode AvsCode value for avsCode. - * @param cvvCode CvvCode value for cvvCode. - * @param responseCode ProcessorResponseCode value for responseCode. - * @param paymentAdviceCode PaymentsPaymentAdviceCode value for paymentAdviceCode. - */ - public PaymentsProcessorResponse( - AvsCode avsCode, - CvvCode cvvCode, - ProcessorResponseCode responseCode, - PaymentsPaymentAdviceCode paymentAdviceCode) { - this.avsCode = avsCode; - this.cvvCode = cvvCode; - this.responseCode = responseCode; - this.paymentAdviceCode = paymentAdviceCode; - } - - /** - * Getter for AvsCode. - * The address verification code for Visa, Discover, Mastercard, or American Express - * transactions. - * @return Returns the AvsCode - */ - @JsonGetter("avs_code") - @JsonInclude(JsonInclude.Include.NON_NULL) - public AvsCode getAvsCode() { - return avsCode; - } - - /** - * Setter for AvsCode. - * The address verification code for Visa, Discover, Mastercard, or American Express - * transactions. - * @param avsCode Value for AvsCode - */ - @JsonSetter("avs_code") - public void setAvsCode(AvsCode avsCode) { - this.avsCode = avsCode; - } - - /** - * Getter for CvvCode. - * The card verification value code for for Visa, Discover, Mastercard, or American Express. - * @return Returns the CvvCode - */ - @JsonGetter("cvv_code") - @JsonInclude(JsonInclude.Include.NON_NULL) - public CvvCode getCvvCode() { - return cvvCode; - } - - /** - * Setter for CvvCode. - * The card verification value code for for Visa, Discover, Mastercard, or American Express. - * @param cvvCode Value for CvvCode - */ - @JsonSetter("cvv_code") - public void setCvvCode(CvvCode cvvCode) { - this.cvvCode = cvvCode; - } - - /** - * Getter for ResponseCode. - * Processor response code for the non-PayPal payment processor errors. - * @return Returns the ProcessorResponseCode - */ - @JsonGetter("response_code") - @JsonInclude(JsonInclude.Include.NON_NULL) - public ProcessorResponseCode getResponseCode() { - return responseCode; - } - - /** - * Setter for ResponseCode. - * Processor response code for the non-PayPal payment processor errors. - * @param responseCode Value for ProcessorResponseCode - */ - @JsonSetter("response_code") - public void setResponseCode(ProcessorResponseCode responseCode) { - this.responseCode = responseCode; - } - - /** - * Getter for PaymentAdviceCode. - * The declined payment transactions might have payment advice codes. The card networks, like - * Visa and Mastercard, return payment advice codes. - * @return Returns the PaymentsPaymentAdviceCode - */ - @JsonGetter("payment_advice_code") - @JsonInclude(JsonInclude.Include.NON_NULL) - public PaymentsPaymentAdviceCode getPaymentAdviceCode() { - return paymentAdviceCode; - } - - /** - * Setter for PaymentAdviceCode. - * The declined payment transactions might have payment advice codes. The card networks, like - * Visa and Mastercard, return payment advice codes. - * @param paymentAdviceCode Value for PaymentsPaymentAdviceCode - */ - @JsonSetter("payment_advice_code") - public void setPaymentAdviceCode(PaymentsPaymentAdviceCode paymentAdviceCode) { - this.paymentAdviceCode = paymentAdviceCode; - } - - /** - * Converts this PaymentsProcessorResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "PaymentsProcessorResponse [" + "avsCode=" + avsCode + ", cvvCode=" + cvvCode - + ", responseCode=" + responseCode + ", paymentAdviceCode=" + paymentAdviceCode - + "]"; - } - - /** - * Builds a new {@link PaymentsProcessorResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link PaymentsProcessorResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .avsCode(getAvsCode()) - .cvvCode(getCvvCode()) - .responseCode(getResponseCode()) - .paymentAdviceCode(getPaymentAdviceCode()); - return builder; - } - - /** - * Class to build instances of {@link PaymentsProcessorResponse}. - */ - public static class Builder { - private AvsCode avsCode; - private CvvCode cvvCode; - private ProcessorResponseCode responseCode; - private PaymentsPaymentAdviceCode paymentAdviceCode; - - - - /** - * Setter for avsCode. - * @param avsCode AvsCode value for avsCode. - * @return Builder - */ - public Builder avsCode(AvsCode avsCode) { - this.avsCode = avsCode; - return this; - } - - /** - * Setter for cvvCode. - * @param cvvCode CvvCode value for cvvCode. - * @return Builder - */ - public Builder cvvCode(CvvCode cvvCode) { - this.cvvCode = cvvCode; - return this; - } - - /** - * Setter for responseCode. - * @param responseCode ProcessorResponseCode value for responseCode. - * @return Builder - */ - public Builder responseCode(ProcessorResponseCode responseCode) { - this.responseCode = responseCode; - return this; - } - - /** - * Setter for paymentAdviceCode. - * @param paymentAdviceCode PaymentsPaymentAdviceCode value for paymentAdviceCode. - * @return Builder - */ - public Builder paymentAdviceCode(PaymentsPaymentAdviceCode paymentAdviceCode) { - this.paymentAdviceCode = paymentAdviceCode; - return this; - } - - /** - * Builds a new {@link PaymentsProcessorResponse} object using the set fields. - * @return {@link PaymentsProcessorResponse} - */ - public PaymentsProcessorResponse build() { - return new PaymentsProcessorResponse(avsCode, cvvCode, responseCode, paymentAdviceCode); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/PaypalExperienceLandingPage.java b/src/main/java/com/paypal/sdk/models/PaypalExperienceLandingPage.java index d9f9dec..d6bb5fe 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalExperienceLandingPage.java +++ b/src/main/java/com/paypal/sdk/models/PaypalExperienceLandingPage.java @@ -32,6 +32,11 @@ public enum PaypalExperienceLandingPage { */ NO_PREFERENCE, + /** + * 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. + */ + BILLING, + /** * Unknown values will be mapped by this enum member */ @@ -45,11 +50,13 @@ public enum PaypalExperienceLandingPage { LOGIN.value = "LOGIN"; GUEST_CHECKOUT.value = "GUEST_CHECKOUT"; NO_PREFERENCE.value = "NO_PREFERENCE"; + BILLING.value = "BILLING"; _UNKNOWN.value = null; valueMap.put("LOGIN", LOGIN); valueMap.put("GUEST_CHECKOUT", GUEST_CHECKOUT); valueMap.put("NO_PREFERENCE", NO_PREFERENCE); + valueMap.put("BILLING", BILLING); } /** diff --git a/src/main/java/com/paypal/sdk/models/PaypalPaymentToken.java b/src/main/java/com/paypal/sdk/models/PaypalPaymentToken.java index 3dee248..1943958 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalPaymentToken.java +++ b/src/main/java/com/paypal/sdk/models/PaypalPaymentToken.java @@ -222,9 +222,10 @@ public void setCustomerType(PaypalPaymentTokenCustomerType customerType) { /** * Getter for EmailAddress. - * The internationalized email address. Note: Up to 64 characters are allowed before and 255 - * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for - * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters + * are allowed before and 255 characters are allowed after the <code>{@literal @}</code> sign. However, the + * generally accepted maximum length for an email address is 254 characters. The pattern + * verifies that an unquoted <code>{@literal @}</code> sign exists.</blockquote> * @return Returns the String */ @JsonGetter("email_address") @@ -235,9 +236,10 @@ public String getEmailAddress() { /** * Setter for EmailAddress. - * The internationalized email address. Note: Up to 64 characters are allowed before and 255 - * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for - * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters + * are allowed before and 255 characters are allowed after the <code>{@literal @}</code> sign. However, the + * generally accepted maximum length for an email address is 254 characters. The pattern + * verifies that an unquoted <code>{@literal @}</code> sign exists.</blockquote> * @param emailAddress Value for String */ @JsonSetter("email_address") diff --git a/src/main/java/com/paypal/sdk/models/PaypalReferenceIdType.java b/src/main/java/com/paypal/sdk/models/PaypalReferenceIdType.java new file mode 100644 index 0000000..e2055d9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PaypalReferenceIdType.java @@ -0,0 +1,124 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * PaypalReferenceIdType to be used. + */ +public enum PaypalReferenceIdType { + /** + * An order ID. + */ + ODR, + + /** + * A transaction ID. + */ + TXN, + + /** + * A subscription ID. + */ + SUB, + + /** + * A pre-approved payment ID. + */ + PAP, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + ODR.value = "ODR"; + TXN.value = "TXN"; + SUB.value = "SUB"; + PAP.value = "PAP"; + _UNKNOWN.value = null; + + valueMap.put("ODR", ODR); + valueMap.put("TXN", TXN); + valueMap.put("SUB", SUB); + valueMap.put("PAP", PAP); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static PaypalReferenceIdType constructFromString(String toConvert) throws IOException { + PaypalReferenceIdType enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static PaypalReferenceIdType fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of PaypalReferenceIdType values to list of string values. + * @param toConvert The list of PaypalReferenceIdType values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (PaypalReferenceIdType enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/PaypalWalletAttributes.java b/src/main/java/com/paypal/sdk/models/PaypalWalletAttributes.java index ef80c94..16b151e 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalWalletAttributes.java +++ b/src/main/java/com/paypal/sdk/models/PaypalWalletAttributes.java @@ -56,6 +56,7 @@ public void setCustomer(PaypalWalletCustomerRequest customer) { /** * Getter for Vault. + * Resource consolidating common request and response attributes for vaulting PayPal Wallet. * @return Returns the PaypalWalletVaultInstruction */ @JsonGetter("vault") @@ -66,6 +67,7 @@ public PaypalWalletVaultInstruction getVault() { /** * Setter for Vault. + * Resource consolidating common request and response attributes for vaulting PayPal Wallet. * @param vault Value for PaypalWalletVaultInstruction */ @JsonSetter("vault") diff --git a/src/main/java/com/paypal/sdk/models/PaypalWalletExperienceContext.java b/src/main/java/com/paypal/sdk/models/PaypalWalletExperienceContext.java index b733570..5d2489d 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalWalletExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/PaypalWalletExperienceContext.java @@ -20,6 +20,7 @@ public class PaypalWalletExperienceContext { private PaypalWalletContactPreference contactPreference; private String returnUrl; private String cancelUrl; + private AppSwitchContext appSwitchContext; private PaypalExperienceLandingPage landingPage; private PaypalExperienceUserAction userAction; private PayeePaymentMethodPreference paymentMethodPreference; @@ -45,6 +46,7 @@ public PaypalWalletExperienceContext() { * @param contactPreference PaypalWalletContactPreference value for contactPreference. * @param returnUrl String value for returnUrl. * @param cancelUrl String value for cancelUrl. + * @param appSwitchContext AppSwitchContext value for appSwitchContext. * @param landingPage PaypalExperienceLandingPage value for landingPage. * @param userAction PaypalExperienceUserAction value for userAction. * @param paymentMethodPreference PayeePaymentMethodPreference value for @@ -58,6 +60,7 @@ public PaypalWalletExperienceContext( PaypalWalletContactPreference contactPreference, String returnUrl, String cancelUrl, + AppSwitchContext appSwitchContext, PaypalExperienceLandingPage landingPage, PaypalExperienceUserAction userAction, PayeePaymentMethodPreference paymentMethodPreference, @@ -68,6 +71,7 @@ public PaypalWalletExperienceContext( this.contactPreference = contactPreference; this.returnUrl = returnUrl; this.cancelUrl = cancelUrl; + this.appSwitchContext = appSwitchContext; this.landingPage = landingPage; this.userAction = userAction; this.paymentMethodPreference = paymentMethodPreference; @@ -216,6 +220,29 @@ public void setCancelUrl(String cancelUrl) { this.cancelUrl = cancelUrl; } + /** + * Getter for AppSwitchContext. + * Merchant provided details of the native app or mobile web browser to facilitate buyer's app + * switch to the PayPal consumer app. + * @return Returns the AppSwitchContext + */ + @JsonGetter("app_switch_context") + @JsonInclude(JsonInclude.Include.NON_NULL) + public AppSwitchContext getAppSwitchContext() { + return appSwitchContext; + } + + /** + * Setter for AppSwitchContext. + * Merchant provided details of the native app or mobile web browser to facilitate buyer's app + * switch to the PayPal consumer app. + * @param appSwitchContext Value for AppSwitchContext + */ + @JsonSetter("app_switch_context") + public void setAppSwitchContext(AppSwitchContext appSwitchContext) { + this.appSwitchContext = appSwitchContext; + } + /** * Getter for LandingPage. * The type of landing page to show on the PayPal site for customer checkout. @@ -309,9 +336,10 @@ public String toString() { return "PaypalWalletExperienceContext [" + "brandName=" + brandName + ", locale=" + locale + ", shippingPreference=" + shippingPreference + ", contactPreference=" + contactPreference + ", returnUrl=" + returnUrl + ", cancelUrl=" + cancelUrl - + ", landingPage=" + landingPage + ", userAction=" + userAction - + ", paymentMethodPreference=" + paymentMethodPreference - + ", orderUpdateCallbackConfig=" + orderUpdateCallbackConfig + "]"; + + ", appSwitchContext=" + appSwitchContext + ", landingPage=" + landingPage + + ", userAction=" + userAction + ", paymentMethodPreference=" + + paymentMethodPreference + ", orderUpdateCallbackConfig=" + + orderUpdateCallbackConfig + "]"; } /** @@ -327,6 +355,7 @@ public Builder toBuilder() { .contactPreference(getContactPreference()) .returnUrl(getReturnUrl()) .cancelUrl(getCancelUrl()) + .appSwitchContext(getAppSwitchContext()) .landingPage(getLandingPage()) .userAction(getUserAction()) .paymentMethodPreference(getPaymentMethodPreference()) @@ -346,6 +375,7 @@ public static class Builder { PaypalWalletContactPreference.NO_CONTACT_INFO; private String returnUrl; private String cancelUrl; + private AppSwitchContext appSwitchContext; private PaypalExperienceLandingPage landingPage = PaypalExperienceLandingPage.NO_PREFERENCE; private PaypalExperienceUserAction userAction = PaypalExperienceUserAction.CONTINUE; private PayeePaymentMethodPreference paymentMethodPreference = @@ -416,6 +446,16 @@ public Builder cancelUrl(String cancelUrl) { return this; } + /** + * Setter for appSwitchContext. + * @param appSwitchContext AppSwitchContext value for appSwitchContext. + * @return Builder + */ + public Builder appSwitchContext(AppSwitchContext appSwitchContext) { + this.appSwitchContext = appSwitchContext; + return this; + } + /** * Setter for landingPage. * @param landingPage PaypalExperienceLandingPage value for landingPage. @@ -466,8 +506,8 @@ public Builder orderUpdateCallbackConfig( */ public PaypalWalletExperienceContext build() { return new PaypalWalletExperienceContext(brandName, locale, shippingPreference, - contactPreference, returnUrl, cancelUrl, landingPage, userAction, - paymentMethodPreference, orderUpdateCallbackConfig); + contactPreference, returnUrl, cancelUrl, appSwitchContext, landingPage, + userAction, paymentMethodPreference, orderUpdateCallbackConfig); } } } diff --git a/src/main/java/com/paypal/sdk/models/PaypalWalletResponse.java b/src/main/java/com/paypal/sdk/models/PaypalWalletResponse.java index 0b65ce7..b107de6 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalWalletResponse.java +++ b/src/main/java/com/paypal/sdk/models/PaypalWalletResponse.java @@ -26,6 +26,7 @@ public class PaypalWalletResponse { private Address address; private PaypalWalletAttributesResponse attributes; private PaypalWalletStoredCredential storedCredential; + private ExperienceStatus experienceStatus; /** * Default constructor. @@ -47,6 +48,7 @@ public PaypalWalletResponse() { * @param address Address value for address. * @param attributes PaypalWalletAttributesResponse value for attributes. * @param storedCredential PaypalWalletStoredCredential value for storedCredential. + * @param experienceStatus ExperienceStatus value for experienceStatus. */ public PaypalWalletResponse( String emailAddress, @@ -60,7 +62,8 @@ public PaypalWalletResponse( TaxInfo taxInfo, Address address, PaypalWalletAttributesResponse attributes, - PaypalWalletStoredCredential storedCredential) { + PaypalWalletStoredCredential storedCredential, + ExperienceStatus experienceStatus) { this.emailAddress = emailAddress; this.accountId = accountId; this.accountStatus = accountStatus; @@ -73,6 +76,7 @@ public PaypalWalletResponse( this.address = address; this.attributes = attributes; this.storedCredential = storedCredential; + this.experienceStatus = experienceStatus; } /** @@ -357,6 +361,29 @@ public void setStoredCredential(PaypalWalletStoredCredential storedCredential) { this.storedCredential = storedCredential; } + /** + * Getter for ExperienceStatus. + * This field indicates the status of PayPal's Checkout experience throughout the order + * lifecycle. The values reflect the current stage of the checkout process. + * @return Returns the ExperienceStatus + */ + @JsonGetter("experience_status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ExperienceStatus getExperienceStatus() { + return experienceStatus; + } + + /** + * Setter for ExperienceStatus. + * This field indicates the status of PayPal's Checkout experience throughout the order + * lifecycle. The values reflect the current stage of the checkout process. + * @param experienceStatus Value for ExperienceStatus + */ + @JsonSetter("experience_status") + public void setExperienceStatus(ExperienceStatus experienceStatus) { + this.experienceStatus = experienceStatus; + } + /** * Converts this PaypalWalletResponse into string format. * @return String representation of this class @@ -367,7 +394,8 @@ public String toString() { + accountId + ", accountStatus=" + accountStatus + ", name=" + name + ", phoneType=" + phoneType + ", phoneNumber=" + phoneNumber + ", birthDate=" + birthDate + ", businessName=" + businessName + ", taxInfo=" + taxInfo + ", address=" + address - + ", attributes=" + attributes + ", storedCredential=" + storedCredential + "]"; + + ", attributes=" + attributes + ", storedCredential=" + storedCredential + + ", experienceStatus=" + experienceStatus + "]"; } /** @@ -388,7 +416,8 @@ public Builder toBuilder() { .taxInfo(getTaxInfo()) .address(getAddress()) .attributes(getAttributes()) - .storedCredential(getStoredCredential()); + .storedCredential(getStoredCredential()) + .experienceStatus(getExperienceStatus()); return builder; } @@ -408,6 +437,7 @@ public static class Builder { private Address address; private PaypalWalletAttributesResponse attributes; private PaypalWalletStoredCredential storedCredential; + private ExperienceStatus experienceStatus; @@ -531,6 +561,16 @@ public Builder storedCredential(PaypalWalletStoredCredential storedCredential) { return this; } + /** + * Setter for experienceStatus. + * @param experienceStatus ExperienceStatus value for experienceStatus. + * @return Builder + */ + public Builder experienceStatus(ExperienceStatus experienceStatus) { + this.experienceStatus = experienceStatus; + return this; + } + /** * Builds a new {@link PaypalWalletResponse} object using the set fields. * @return {@link PaypalWalletResponse} @@ -538,7 +578,7 @@ public Builder storedCredential(PaypalWalletStoredCredential storedCredential) { public PaypalWalletResponse build() { return new PaypalWalletResponse(emailAddress, accountId, accountStatus, name, phoneType, phoneNumber, birthDate, businessName, taxInfo, address, attributes, - storedCredential); + storedCredential, experienceStatus); } } } diff --git a/src/main/java/com/paypal/sdk/models/PaypalWalletStoredCredential.java b/src/main/java/com/paypal/sdk/models/PaypalWalletStoredCredential.java index 4cedb14..4a9fb42 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalWalletStoredCredential.java +++ b/src/main/java/com/paypal/sdk/models/PaypalWalletStoredCredential.java @@ -66,7 +66,8 @@ public void setPaymentInitiator(PaymentInitiator paymentInitiator) { /** * Getter for ChargePattern. - * Expected business/pricing model for the billing agreement. + * DEPRECATED. Expected business/pricing model for the billing agreement, Please use + * usage_pattern instead. * @return Returns the UsagePattern */ @JsonGetter("charge_pattern") @@ -77,7 +78,8 @@ public UsagePattern getChargePattern() { /** * Setter for ChargePattern. - * Expected business/pricing model for the billing agreement. + * DEPRECATED. Expected business/pricing model for the billing agreement, Please use + * usage_pattern instead. * @param chargePattern Value for UsagePattern */ @JsonSetter("charge_pattern") diff --git a/src/main/java/com/paypal/sdk/models/PaypalWalletVaultInstruction.java b/src/main/java/com/paypal/sdk/models/PaypalWalletVaultInstruction.java index f8c3234..9c621df 100644 --- a/src/main/java/com/paypal/sdk/models/PaypalWalletVaultInstruction.java +++ b/src/main/java/com/paypal/sdk/models/PaypalWalletVaultInstruction.java @@ -14,7 +14,6 @@ * This is a model class for PaypalWalletVaultInstruction type. */ public class PaypalWalletVaultInstruction { - private StoreInVaultInstruction storeInVault; private String description; private UsagePattern usagePattern; private PaypalPaymentTokenUsageType usageType; @@ -32,7 +31,6 @@ public PaypalWalletVaultInstruction() { /** * Initialization constructor. * @param usageType PaypalPaymentTokenUsageType value for usageType. - * @param storeInVault StoreInVaultInstruction value for storeInVault. * @param description String value for description. * @param usagePattern UsagePattern value for usagePattern. * @param customerType PaypalPaymentTokenCustomerType value for customerType. @@ -40,12 +38,10 @@ public PaypalWalletVaultInstruction() { */ public PaypalWalletVaultInstruction( PaypalPaymentTokenUsageType usageType, - StoreInVaultInstruction storeInVault, String description, UsagePattern usagePattern, PaypalPaymentTokenCustomerType customerType, Boolean permitMultiplePaymentTokens) { - this.storeInVault = storeInVault; this.description = description; this.usagePattern = usagePattern; this.usageType = usageType; @@ -53,27 +49,6 @@ public PaypalWalletVaultInstruction( this.permitMultiplePaymentTokens = permitMultiplePaymentTokens; } - /** - * Getter for StoreInVault. - * Defines how and when the payment source gets vaulted. - * @return Returns the StoreInVaultInstruction - */ - @JsonGetter("store_in_vault") - @JsonInclude(JsonInclude.Include.NON_NULL) - public StoreInVaultInstruction getStoreInVault() { - return storeInVault; - } - - /** - * Setter for StoreInVault. - * Defines how and when the payment source gets vaulted. - * @param storeInVault Value for StoreInVaultInstruction - */ - @JsonSetter("store_in_vault") - public void setStoreInVault(StoreInVaultInstruction storeInVault) { - this.storeInVault = storeInVault; - } - /** * Getter for Description. * The description displayed to PayPal consumer on the approval flow for PayPal, as well as on @@ -198,10 +173,9 @@ public void setPermitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) */ @Override public String toString() { - return "PaypalWalletVaultInstruction [" + "usageType=" + usageType + ", storeInVault=" - + storeInVault + ", description=" + description + ", usagePattern=" + usagePattern - + ", customerType=" + customerType + ", permitMultiplePaymentTokens=" - + permitMultiplePaymentTokens + "]"; + return "PaypalWalletVaultInstruction [" + "usageType=" + usageType + ", description=" + + description + ", usagePattern=" + usagePattern + ", customerType=" + customerType + + ", permitMultiplePaymentTokens=" + permitMultiplePaymentTokens + "]"; } /** @@ -211,7 +185,6 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder(usageType) - .storeInVault(getStoreInVault()) .description(getDescription()) .usagePattern(getUsagePattern()) .customerType(getCustomerType()) @@ -224,7 +197,6 @@ public Builder toBuilder() { */ public static class Builder { private PaypalPaymentTokenUsageType usageType; - private StoreInVaultInstruction storeInVault; private String description; private UsagePattern usagePattern; private PaypalPaymentTokenCustomerType customerType = @@ -255,16 +227,6 @@ public Builder usageType(PaypalPaymentTokenUsageType usageType) { return this; } - /** - * Setter for storeInVault. - * @param storeInVault StoreInVaultInstruction value for storeInVault. - * @return Builder - */ - public Builder storeInVault(StoreInVaultInstruction storeInVault) { - this.storeInVault = storeInVault; - return this; - } - /** * Setter for description. * @param description String value for description. @@ -310,8 +272,8 @@ public Builder permitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) * @return {@link PaypalWalletVaultInstruction} */ public PaypalWalletVaultInstruction build() { - return new PaypalWalletVaultInstruction(usageType, storeInVault, description, - usagePattern, customerType, permitMultiplePaymentTokens); + return new PaypalWalletVaultInstruction(usageType, description, usagePattern, + customerType, permitMultiplePaymentTokens); } } } diff --git a/src/main/java/com/paypal/sdk/models/PhoneNumberWithOptionalCountryCode.java b/src/main/java/com/paypal/sdk/models/PhoneNumberWithOptionalCountryCode.java new file mode 100644 index 0000000..f1ad903 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PhoneNumberWithOptionalCountryCode.java @@ -0,0 +1,161 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PhoneNumberWithOptionalCountryCode type. + */ +public class PhoneNumberWithOptionalCountryCode { + private String countryCode; + private String nationalNumber; + + /** + * Default constructor. + */ + public PhoneNumberWithOptionalCountryCode() { + } + + /** + * Initialization constructor. + * @param nationalNumber String value for nationalNumber. + * @param countryCode String value for countryCode. + */ + public PhoneNumberWithOptionalCountryCode( + String nationalNumber, + String countryCode) { + this.countryCode = countryCode; + this.nationalNumber = nationalNumber; + } + + /** + * Getter for CountryCode. + * 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). + * @return Returns the String + */ + @JsonGetter("country_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCountryCode() { + return countryCode; + } + + /** + * Setter for CountryCode. + * 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). + * @param countryCode Value for String + */ + @JsonSetter("country_code") + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + /** + * Getter for NationalNumber. + * 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). + * @return Returns the String + */ + @JsonGetter("national_number") + public String getNationalNumber() { + return nationalNumber; + } + + /** + * Setter for NationalNumber. + * 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). + * @param nationalNumber Value for String + */ + @JsonSetter("national_number") + public void setNationalNumber(String nationalNumber) { + this.nationalNumber = nationalNumber; + } + + /** + * Converts this PhoneNumberWithOptionalCountryCode into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PhoneNumberWithOptionalCountryCode [" + "nationalNumber=" + nationalNumber + + ", countryCode=" + countryCode + "]"; + } + + /** + * Builds a new {@link PhoneNumberWithOptionalCountryCode.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PhoneNumberWithOptionalCountryCode.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(nationalNumber) + .countryCode(getCountryCode()); + return builder; + } + + /** + * Class to build instances of {@link PhoneNumberWithOptionalCountryCode}. + */ + public static class Builder { + private String nationalNumber; + private String countryCode; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param nationalNumber String value for nationalNumber. + */ + public Builder(String nationalNumber) { + this.nationalNumber = nationalNumber; + } + + /** + * Setter for nationalNumber. + * @param nationalNumber String value for nationalNumber. + * @return Builder + */ + public Builder nationalNumber(String nationalNumber) { + this.nationalNumber = nationalNumber; + return this; + } + + /** + * Setter for countryCode. + * @param countryCode String value for countryCode. + * @return Builder + */ + public Builder countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Builds a new {@link PhoneNumberWithOptionalCountryCode} object using the set fields. + * @return {@link PhoneNumberWithOptionalCountryCode} + */ + public PhoneNumberWithOptionalCountryCode build() { + return new PhoneNumberWithOptionalCountryCode(nationalNumber, countryCode); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PhoneType.java b/src/main/java/com/paypal/sdk/models/PhoneType.java index b668ff0..e815abb 100644 --- a/src/main/java/com/paypal/sdk/models/PhoneType.java +++ b/src/main/java/com/paypal/sdk/models/PhoneType.java @@ -17,14 +17,29 @@ * PhoneType to be used. */ public enum PhoneType { + /** + * Fax number. + */ FAX, + /** + * Home phone number. + */ HOME, + /** + * Mobile phone number. + */ MOBILE, + /** + * Other phone number. + */ OTHER, + /** + * Pager number. + */ PAGER, /** diff --git a/src/main/java/com/paypal/sdk/models/Plan.java b/src/main/java/com/paypal/sdk/models/Plan.java index 6fea6eb..0bdbd27 100644 --- a/src/main/java/com/paypal/sdk/models/Plan.java +++ b/src/main/java/com/paypal/sdk/models/Plan.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; -import com.paypal.sdk.utilities.JsonValue; import java.util.List; /** @@ -17,7 +16,6 @@ */ public class Plan { private List billingCycles; - private JsonValue product; private OneTimeCharge oneTimeCharges; private String name; @@ -31,16 +29,13 @@ public Plan() { * Initialization constructor. * @param billingCycles List of BillingCycle value for billingCycles. * @param oneTimeCharges OneTimeCharge value for oneTimeCharges. - * @param product JsonValue value for product. * @param name String value for name. */ public Plan( List billingCycles, OneTimeCharge oneTimeCharges, - JsonValue product, String name) { this.billingCycles = billingCycles; - this.product = product; this.oneTimeCharges = oneTimeCharges; this.name = name; } @@ -67,27 +62,6 @@ public void setBillingCycles(List billingCycles) { this.billingCycles = billingCycles; } - /** - * Getter for Product. - * Product details associated with any one-time product purchase. - * @return Returns the JsonValue - */ - @JsonGetter("product") - @JsonInclude(JsonInclude.Include.NON_NULL) - public JsonValue getProduct() { - return product; - } - - /** - * Setter for Product. - * Product details associated with any one-time product purchase. - * @param product Value for JsonValue - */ - @JsonSetter("product") - public void setProduct(JsonValue product) { - this.product = product; - } - /** * Getter for OneTimeCharges. * The one-time charge info at the time of checkout. @@ -136,7 +110,7 @@ public void setName(String name) { @Override public String toString() { return "Plan [" + "billingCycles=" + billingCycles + ", oneTimeCharges=" + oneTimeCharges - + ", product=" + product + ", name=" + name + "]"; + + ", name=" + name + "]"; } /** @@ -146,7 +120,6 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder(billingCycles, oneTimeCharges) - .product(getProduct()) .name(getName()); return builder; } @@ -157,7 +130,6 @@ public Builder toBuilder() { public static class Builder { private List billingCycles; private OneTimeCharge oneTimeCharges; - private JsonValue product; private String name; /** @@ -196,16 +168,6 @@ public Builder oneTimeCharges(OneTimeCharge oneTimeCharges) { return this; } - /** - * Setter for product. - * @param product JsonValue value for product. - * @return Builder - */ - public Builder product(JsonValue product) { - this.product = product; - return this; - } - /** * Setter for name. * @param name String value for name. @@ -221,7 +183,7 @@ public Builder name(String name) { * @return {@link Plan} */ public Plan build() { - return new Plan(billingCycles, oneTimeCharges, product, name); + return new Plan(billingCycles, oneTimeCharges, name); } } } diff --git a/src/main/java/com/paypal/sdk/models/PlanCollection.java b/src/main/java/com/paypal/sdk/models/PlanCollection.java new file mode 100644 index 0000000..e2d9176 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PlanCollection.java @@ -0,0 +1,216 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for PlanCollection type. + */ +public class PlanCollection { + private List plans; + private Integer totalItems; + private Integer totalPages; + private List links; + + /** + * Default constructor. + */ + public PlanCollection() { + } + + /** + * Initialization constructor. + * @param plans List of BillingPlan value for plans. + * @param totalItems Integer value for totalItems. + * @param totalPages Integer value for totalPages. + * @param links List of LinkDescription value for links. + */ + public PlanCollection( + List plans, + Integer totalItems, + Integer totalPages, + List links) { + this.plans = plans; + this.totalItems = totalItems; + this.totalPages = totalPages; + this.links = links; + } + + /** + * Getter for Plans. + * An array of plans. + * @return Returns the List of BillingPlan + */ + @JsonGetter("plans") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getPlans() { + return plans; + } + + /** + * Setter for Plans. + * An array of plans. + * @param plans Value for List of BillingPlan + */ + @JsonSetter("plans") + public void setPlans(List plans) { + this.plans = plans; + } + + /** + * Getter for TotalItems. + * The total number of items. + * @return Returns the Integer + */ + @JsonGetter("total_items") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalItems() { + return totalItems; + } + + /** + * Setter for TotalItems. + * The total number of items. + * @param totalItems Value for Integer + */ + @JsonSetter("total_items") + public void setTotalItems(Integer totalItems) { + this.totalItems = totalItems; + } + + /** + * Getter for TotalPages. + * The total number of pages. + * @return Returns the Integer + */ + @JsonGetter("total_pages") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalPages() { + return totalPages; + } + + /** + * Setter for TotalPages. + * The total number of pages. + * @param totalPages Value for Integer + */ + @JsonSetter("total_pages") + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this PlanCollection into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PlanCollection [" + "plans=" + plans + ", totalItems=" + totalItems + + ", totalPages=" + totalPages + ", links=" + links + "]"; + } + + /** + * Builds a new {@link PlanCollection.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PlanCollection.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .plans(getPlans()) + .totalItems(getTotalItems()) + .totalPages(getTotalPages()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link PlanCollection}. + */ + public static class Builder { + private List plans; + private Integer totalItems; + private Integer totalPages; + private List links; + + + + /** + * Setter for plans. + * @param plans List of BillingPlan value for plans. + * @return Builder + */ + public Builder plans(List plans) { + this.plans = plans; + return this; + } + + /** + * Setter for totalItems. + * @param totalItems Integer value for totalItems. + * @return Builder + */ + public Builder totalItems(Integer totalItems) { + this.totalItems = totalItems; + return this; + } + + /** + * Setter for totalPages. + * @param totalPages Integer value for totalPages. + * @return Builder + */ + public Builder totalPages(Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link PlanCollection} object using the set fields. + * @return {@link PlanCollection} + */ + public PlanCollection build() { + return new PlanCollection(plans, totalItems, totalPages, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PlanDetails.java b/src/main/java/com/paypal/sdk/models/PlanDetails.java new file mode 100644 index 0000000..041f4cd --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PlanDetails.java @@ -0,0 +1,370 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for PlanDetails type. + */ +public class PlanDetails { + private String productId; + private String name; + private String description; + private List billingCycles; + private PaymentPreferences paymentPreferences; + private MerchantPreferences merchantPreferences; + private Taxes taxes; + private Boolean quantitySupported; + + /** + * Default constructor. + */ + public PlanDetails() { + quantitySupported = false; + } + + /** + * Initialization constructor. + * @param productId String value for productId. + * @param name String value for name. + * @param description String value for description. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + * @param merchantPreferences MerchantPreferences value for merchantPreferences. + * @param taxes Taxes value for taxes. + * @param quantitySupported Boolean value for quantitySupported. + */ + public PlanDetails( + String productId, + String name, + String description, + List billingCycles, + PaymentPreferences paymentPreferences, + MerchantPreferences merchantPreferences, + Taxes taxes, + Boolean quantitySupported) { + this.productId = productId; + this.name = name; + this.description = description; + this.billingCycles = billingCycles; + this.paymentPreferences = paymentPreferences; + this.merchantPreferences = merchantPreferences; + this.taxes = taxes; + this.quantitySupported = quantitySupported; + } + + /** + * Getter for ProductId. + * The ID for the product. + * @return Returns the String + */ + @JsonGetter("product_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getProductId() { + return productId; + } + + /** + * Setter for ProductId. + * The ID for the product. + * @param productId Value for String + */ + @JsonSetter("product_id") + public void setProductId(String productId) { + this.productId = productId; + } + + /** + * Getter for Name. + * The plan name. + * @return Returns the String + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getName() { + return name; + } + + /** + * Setter for Name. + * The plan name. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for Description. + * The detailed description of the plan. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * The detailed description of the plan. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. A plan can have at most two + * trial cycles and only one regular cycle. + * @return Returns the List of SubscriptionBillingCycle + */ + @JsonGetter("billing_cycles") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getBillingCycles() { + return billingCycles; + } + + /** + * Setter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. A plan can have at most two + * trial cycles and only one regular cycle. + * @param billingCycles Value for List of SubscriptionBillingCycle + */ + @JsonSetter("billing_cycles") + public void setBillingCycles(List billingCycles) { + this.billingCycles = billingCycles; + } + + /** + * Getter for PaymentPreferences. + * The payment preferences for a subscription. + * @return Returns the PaymentPreferences + */ + @JsonGetter("payment_preferences") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PaymentPreferences getPaymentPreferences() { + return paymentPreferences; + } + + /** + * Setter for PaymentPreferences. + * The payment preferences for a subscription. + * @param paymentPreferences Value for PaymentPreferences + */ + @JsonSetter("payment_preferences") + public void setPaymentPreferences(PaymentPreferences paymentPreferences) { + this.paymentPreferences = paymentPreferences; + } + + /** + * Getter for MerchantPreferences. + * The merchant preferences for a subscription. + * @return Returns the MerchantPreferences + */ + @JsonGetter("merchant_preferences") + @JsonInclude(JsonInclude.Include.NON_NULL) + public MerchantPreferences getMerchantPreferences() { + return merchantPreferences; + } + + /** + * Setter for MerchantPreferences. + * The merchant preferences for a subscription. + * @param merchantPreferences Value for MerchantPreferences + */ + @JsonSetter("merchant_preferences") + public void setMerchantPreferences(MerchantPreferences merchantPreferences) { + this.merchantPreferences = merchantPreferences; + } + + /** + * Getter for Taxes. + * The tax details. + * @return Returns the Taxes + */ + @JsonGetter("taxes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Taxes getTaxes() { + return taxes; + } + + /** + * Setter for Taxes. + * The tax details. + * @param taxes Value for Taxes + */ + @JsonSetter("taxes") + public void setTaxes(Taxes taxes) { + this.taxes = taxes; + } + + /** + * Getter for QuantitySupported. + * Indicates whether you can subscribe to this plan by providing a quantity for the goods or + * service. + * @return Returns the Boolean + */ + @JsonGetter("quantity_supported") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getQuantitySupported() { + return quantitySupported; + } + + /** + * Setter for QuantitySupported. + * Indicates whether you can subscribe to this plan by providing a quantity for the goods or + * service. + * @param quantitySupported Value for Boolean + */ + @JsonSetter("quantity_supported") + public void setQuantitySupported(Boolean quantitySupported) { + this.quantitySupported = quantitySupported; + } + + /** + * Converts this PlanDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PlanDetails [" + "productId=" + productId + ", name=" + name + ", description=" + + description + ", billingCycles=" + billingCycles + ", paymentPreferences=" + + paymentPreferences + ", merchantPreferences=" + merchantPreferences + ", taxes=" + + taxes + ", quantitySupported=" + quantitySupported + "]"; + } + + /** + * Builds a new {@link PlanDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PlanDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .productId(getProductId()) + .name(getName()) + .description(getDescription()) + .billingCycles(getBillingCycles()) + .paymentPreferences(getPaymentPreferences()) + .merchantPreferences(getMerchantPreferences()) + .taxes(getTaxes()) + .quantitySupported(getQuantitySupported()); + return builder; + } + + /** + * Class to build instances of {@link PlanDetails}. + */ + public static class Builder { + private String productId; + private String name; + private String description; + private List billingCycles; + private PaymentPreferences paymentPreferences; + private MerchantPreferences merchantPreferences; + private Taxes taxes; + private Boolean quantitySupported = false; + + + + /** + * Setter for productId. + * @param productId String value for productId. + * @return Builder + */ + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Setter for billingCycles. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @return Builder + */ + public Builder billingCycles(List billingCycles) { + this.billingCycles = billingCycles; + return this; + } + + /** + * Setter for paymentPreferences. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + * @return Builder + */ + public Builder paymentPreferences(PaymentPreferences paymentPreferences) { + this.paymentPreferences = paymentPreferences; + return this; + } + + /** + * Setter for merchantPreferences. + * @param merchantPreferences MerchantPreferences value for merchantPreferences. + * @return Builder + */ + public Builder merchantPreferences(MerchantPreferences merchantPreferences) { + this.merchantPreferences = merchantPreferences; + return this; + } + + /** + * Setter for taxes. + * @param taxes Taxes value for taxes. + * @return Builder + */ + public Builder taxes(Taxes taxes) { + this.taxes = taxes; + return this; + } + + /** + * Setter for quantitySupported. + * @param quantitySupported Boolean value for quantitySupported. + * @return Builder + */ + public Builder quantitySupported(Boolean quantitySupported) { + this.quantitySupported = quantitySupported; + return this; + } + + /** + * Builds a new {@link PlanDetails} object using the set fields. + * @return {@link PlanDetails} + */ + public PlanDetails build() { + return new PlanDetails(productId, name, description, billingCycles, paymentPreferences, + merchantPreferences, taxes, quantitySupported); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PlanOverride.java b/src/main/java/com/paypal/sdk/models/PlanOverride.java new file mode 100644 index 0000000..4f2b18b --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PlanOverride.java @@ -0,0 +1,179 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for PlanOverride type. + */ +public class PlanOverride { + private List billingCycles; + private PaymentPreferencesOverride paymentPreferences; + private TaxesOverride taxes; + + /** + * Default constructor. + */ + public PlanOverride() { + } + + /** + * Initialization constructor. + * @param billingCycles List of BillingCycleOverride value for billingCycles. + * @param paymentPreferences PaymentPreferencesOverride value for paymentPreferences. + * @param taxes TaxesOverride value for taxes. + */ + public PlanOverride( + List billingCycles, + PaymentPreferencesOverride paymentPreferences, + TaxesOverride taxes) { + this.billingCycles = billingCycles; + this.paymentPreferences = paymentPreferences; + this.taxes = taxes; + } + + /** + * Getter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. The subscription billing + * cycle definition has to adhere to the plan billing cycle definition. + * @return Returns the List of BillingCycleOverride + */ + @JsonGetter("billing_cycles") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getBillingCycles() { + return billingCycles; + } + + /** + * Setter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. The subscription billing + * cycle definition has to adhere to the plan billing cycle definition. + * @param billingCycles Value for List of BillingCycleOverride + */ + @JsonSetter("billing_cycles") + public void setBillingCycles(List billingCycles) { + this.billingCycles = billingCycles; + } + + /** + * Getter for PaymentPreferences. + * The payment preferences to override at subscription level. + * @return Returns the PaymentPreferencesOverride + */ + @JsonGetter("payment_preferences") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PaymentPreferencesOverride getPaymentPreferences() { + return paymentPreferences; + } + + /** + * Setter for PaymentPreferences. + * The payment preferences to override at subscription level. + * @param paymentPreferences Value for PaymentPreferencesOverride + */ + @JsonSetter("payment_preferences") + public void setPaymentPreferences(PaymentPreferencesOverride paymentPreferences) { + this.paymentPreferences = paymentPreferences; + } + + /** + * Getter for Taxes. + * The tax details. + * @return Returns the TaxesOverride + */ + @JsonGetter("taxes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public TaxesOverride getTaxes() { + return taxes; + } + + /** + * Setter for Taxes. + * The tax details. + * @param taxes Value for TaxesOverride + */ + @JsonSetter("taxes") + public void setTaxes(TaxesOverride taxes) { + this.taxes = taxes; + } + + /** + * Converts this PlanOverride into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PlanOverride [" + "billingCycles=" + billingCycles + ", paymentPreferences=" + + paymentPreferences + ", taxes=" + taxes + "]"; + } + + /** + * Builds a new {@link PlanOverride.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PlanOverride.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .billingCycles(getBillingCycles()) + .paymentPreferences(getPaymentPreferences()) + .taxes(getTaxes()); + return builder; + } + + /** + * Class to build instances of {@link PlanOverride}. + */ + public static class Builder { + private List billingCycles; + private PaymentPreferencesOverride paymentPreferences; + private TaxesOverride taxes; + + + + /** + * Setter for billingCycles. + * @param billingCycles List of BillingCycleOverride value for billingCycles. + * @return Builder + */ + public Builder billingCycles(List billingCycles) { + this.billingCycles = billingCycles; + return this; + } + + /** + * Setter for paymentPreferences. + * @param paymentPreferences PaymentPreferencesOverride value for paymentPreferences. + * @return Builder + */ + public Builder paymentPreferences(PaymentPreferencesOverride paymentPreferences) { + this.paymentPreferences = paymentPreferences; + return this; + } + + /** + * Setter for taxes. + * @param taxes TaxesOverride value for taxes. + * @return Builder + */ + public Builder taxes(TaxesOverride taxes) { + this.taxes = taxes; + return this; + } + + /** + * Builds a new {@link PlanOverride} object using the set fields. + * @return {@link PlanOverride} + */ + public PlanOverride build() { + return new PlanOverride(billingCycles, paymentPreferences, taxes); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PlanRequest.java b/src/main/java/com/paypal/sdk/models/PlanRequest.java new file mode 100644 index 0000000..3752390 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PlanRequest.java @@ -0,0 +1,420 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for PlanRequest type. + */ +public class PlanRequest { + private String productId; + private String name; + private PlanRequestStatus status; + private String description; + private List billingCycles; + private PaymentPreferences paymentPreferences; + private MerchantPreferences merchantPreferences; + private Taxes taxes; + private Boolean quantitySupported; + + /** + * Default constructor. + */ + public PlanRequest() { + status = PlanRequestStatus.ACTIVE; + quantitySupported = false; + } + + /** + * Initialization constructor. + * @param productId String value for productId. + * @param name String value for name. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + * @param status PlanRequestStatus value for status. + * @param description String value for description. + * @param merchantPreferences MerchantPreferences value for merchantPreferences. + * @param taxes Taxes value for taxes. + * @param quantitySupported Boolean value for quantitySupported. + */ + public PlanRequest( + String productId, + String name, + List billingCycles, + PaymentPreferences paymentPreferences, + PlanRequestStatus status, + String description, + MerchantPreferences merchantPreferences, + Taxes taxes, + Boolean quantitySupported) { + this.productId = productId; + this.name = name; + this.status = status; + this.description = description; + this.billingCycles = billingCycles; + this.paymentPreferences = paymentPreferences; + this.merchantPreferences = merchantPreferences; + this.taxes = taxes; + this.quantitySupported = quantitySupported; + } + + /** + * Getter for ProductId. + * The ID of the product created through Catalog Products API. + * @return Returns the String + */ + @JsonGetter("product_id") + public String getProductId() { + return productId; + } + + /** + * Setter for ProductId. + * The ID of the product created through Catalog Products API. + * @param productId Value for String + */ + @JsonSetter("product_id") + public void setProductId(String productId) { + this.productId = productId; + } + + /** + * Getter for Name. + * The plan name. + * @return Returns the String + */ + @JsonGetter("name") + public String getName() { + return name; + } + + /** + * Setter for Name. + * The plan name. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for Status. + * The initial state of the plan. Allowed input values are CREATED and ACTIVE. + * @return Returns the PlanRequestStatus + */ + @JsonGetter("status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PlanRequestStatus getStatus() { + return status; + } + + /** + * Setter for Status. + * The initial state of the plan. Allowed input values are CREATED and ACTIVE. + * @param status Value for PlanRequestStatus + */ + @JsonSetter("status") + public void setStatus(PlanRequestStatus status) { + this.status = status; + } + + /** + * Getter for Description. + * The detailed description of the plan. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * The detailed description of the plan. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. A plan can have at most two + * trial cycles and only one regular cycle. + * @return Returns the List of SubscriptionBillingCycle + */ + @JsonGetter("billing_cycles") + public List getBillingCycles() { + return billingCycles; + } + + /** + * Setter for BillingCycles. + * An array of billing cycles for trial billing and regular billing. A plan can have at most two + * trial cycles and only one regular cycle. + * @param billingCycles Value for List of SubscriptionBillingCycle + */ + @JsonSetter("billing_cycles") + public void setBillingCycles(List billingCycles) { + this.billingCycles = billingCycles; + } + + /** + * Getter for PaymentPreferences. + * The payment preferences for a subscription. + * @return Returns the PaymentPreferences + */ + @JsonGetter("payment_preferences") + public PaymentPreferences getPaymentPreferences() { + return paymentPreferences; + } + + /** + * Setter for PaymentPreferences. + * The payment preferences for a subscription. + * @param paymentPreferences Value for PaymentPreferences + */ + @JsonSetter("payment_preferences") + public void setPaymentPreferences(PaymentPreferences paymentPreferences) { + this.paymentPreferences = paymentPreferences; + } + + /** + * Getter for MerchantPreferences. + * The merchant preferences for a subscription. + * @return Returns the MerchantPreferences + */ + @JsonGetter("merchant_preferences") + @JsonInclude(JsonInclude.Include.NON_NULL) + public MerchantPreferences getMerchantPreferences() { + return merchantPreferences; + } + + /** + * Setter for MerchantPreferences. + * The merchant preferences for a subscription. + * @param merchantPreferences Value for MerchantPreferences + */ + @JsonSetter("merchant_preferences") + public void setMerchantPreferences(MerchantPreferences merchantPreferences) { + this.merchantPreferences = merchantPreferences; + } + + /** + * Getter for Taxes. + * The tax details. + * @return Returns the Taxes + */ + @JsonGetter("taxes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Taxes getTaxes() { + return taxes; + } + + /** + * Setter for Taxes. + * The tax details. + * @param taxes Value for Taxes + */ + @JsonSetter("taxes") + public void setTaxes(Taxes taxes) { + this.taxes = taxes; + } + + /** + * Getter for QuantitySupported. + * Indicates whether you can subscribe to this plan by providing a quantity for the goods or + * service. + * @return Returns the Boolean + */ + @JsonGetter("quantity_supported") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getQuantitySupported() { + return quantitySupported; + } + + /** + * Setter for QuantitySupported. + * Indicates whether you can subscribe to this plan by providing a quantity for the goods or + * service. + * @param quantitySupported Value for Boolean + */ + @JsonSetter("quantity_supported") + public void setQuantitySupported(Boolean quantitySupported) { + this.quantitySupported = quantitySupported; + } + + /** + * Converts this PlanRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PlanRequest [" + "productId=" + productId + ", name=" + name + ", billingCycles=" + + billingCycles + ", paymentPreferences=" + paymentPreferences + ", status=" + + status + ", description=" + description + ", merchantPreferences=" + + merchantPreferences + ", taxes=" + taxes + ", quantitySupported=" + + quantitySupported + "]"; + } + + /** + * Builds a new {@link PlanRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PlanRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(productId, name, billingCycles, paymentPreferences) + .status(getStatus()) + .description(getDescription()) + .merchantPreferences(getMerchantPreferences()) + .taxes(getTaxes()) + .quantitySupported(getQuantitySupported()); + return builder; + } + + /** + * Class to build instances of {@link PlanRequest}. + */ + public static class Builder { + private String productId; + private String name; + private List billingCycles; + private PaymentPreferences paymentPreferences; + private PlanRequestStatus status = PlanRequestStatus.ACTIVE; + private String description; + private MerchantPreferences merchantPreferences; + private Taxes taxes; + private Boolean quantitySupported = false; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param productId String value for productId. + * @param name String value for name. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + */ + public Builder(String productId, String name, List billingCycles, + PaymentPreferences paymentPreferences) { + this.productId = productId; + this.name = name; + this.billingCycles = billingCycles; + this.paymentPreferences = paymentPreferences; + } + + /** + * Setter for productId. + * @param productId String value for productId. + * @return Builder + */ + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for billingCycles. + * @param billingCycles List of SubscriptionBillingCycle value for billingCycles. + * @return Builder + */ + public Builder billingCycles(List billingCycles) { + this.billingCycles = billingCycles; + return this; + } + + /** + * Setter for paymentPreferences. + * @param paymentPreferences PaymentPreferences value for paymentPreferences. + * @return Builder + */ + public Builder paymentPreferences(PaymentPreferences paymentPreferences) { + this.paymentPreferences = paymentPreferences; + return this; + } + + /** + * Setter for status. + * @param status PlanRequestStatus value for status. + * @return Builder + */ + public Builder status(PlanRequestStatus status) { + this.status = status; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Setter for merchantPreferences. + * @param merchantPreferences MerchantPreferences value for merchantPreferences. + * @return Builder + */ + public Builder merchantPreferences(MerchantPreferences merchantPreferences) { + this.merchantPreferences = merchantPreferences; + return this; + } + + /** + * Setter for taxes. + * @param taxes Taxes value for taxes. + * @return Builder + */ + public Builder taxes(Taxes taxes) { + this.taxes = taxes; + return this; + } + + /** + * Setter for quantitySupported. + * @param quantitySupported Boolean value for quantitySupported. + * @return Builder + */ + public Builder quantitySupported(Boolean quantitySupported) { + this.quantitySupported = quantitySupported; + return this; + } + + /** + * Builds a new {@link PlanRequest} object using the set fields. + * @return {@link PlanRequest} + */ + public PlanRequest build() { + return new PlanRequest(productId, name, billingCycles, paymentPreferences, status, + description, merchantPreferences, taxes, quantitySupported); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PlanRequestStatus.java b/src/main/java/com/paypal/sdk/models/PlanRequestStatus.java new file mode 100644 index 0000000..d934f55 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PlanRequestStatus.java @@ -0,0 +1,117 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * PlanRequestStatus to be used. + */ +public enum PlanRequestStatus { + /** + * The plan was created. You cannot create subscriptions for a plan in this state. + */ + CREATED, + + /** + * The plan is inactive. + */ + INACTIVE, + + /** + * The plan is active. You can only create subscriptions for a plan in this state. + */ + ACTIVE, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CREATED.value = "CREATED"; + INACTIVE.value = "INACTIVE"; + ACTIVE.value = "ACTIVE"; + _UNKNOWN.value = null; + + valueMap.put("CREATED", CREATED); + valueMap.put("INACTIVE", INACTIVE); + valueMap.put("ACTIVE", ACTIVE); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static PlanRequestStatus constructFromString(String toConvert) throws IOException { + PlanRequestStatus enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static PlanRequestStatus fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of PlanRequestStatus values to list of string values. + * @param toConvert The list of PlanRequestStatus values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (PlanRequestStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/PricingTier.java b/src/main/java/com/paypal/sdk/models/PricingTier.java new file mode 100644 index 0000000..5d0a428 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/PricingTier.java @@ -0,0 +1,186 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for PricingTier type. + */ +public class PricingTier { + private String startingQuantity; + private String endingQuantity; + private Money amount; + + /** + * Default constructor. + */ + public PricingTier() { + } + + /** + * Initialization constructor. + * @param startingQuantity String value for startingQuantity. + * @param amount Money value for amount. + * @param endingQuantity String value for endingQuantity. + */ + public PricingTier( + String startingQuantity, + Money amount, + String endingQuantity) { + this.startingQuantity = startingQuantity; + this.endingQuantity = endingQuantity; + this.amount = amount; + } + + /** + * Getter for StartingQuantity. + * The starting quantity for the tier. + * @return Returns the String + */ + @JsonGetter("starting_quantity") + public String getStartingQuantity() { + return startingQuantity; + } + + /** + * Setter for StartingQuantity. + * The starting quantity for the tier. + * @param startingQuantity Value for String + */ + @JsonSetter("starting_quantity") + public void setStartingQuantity(String startingQuantity) { + this.startingQuantity = startingQuantity; + } + + /** + * Getter for EndingQuantity. + * The ending quantity for the tier. Optional for the last tier. + * @return Returns the String + */ + @JsonGetter("ending_quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getEndingQuantity() { + return endingQuantity; + } + + /** + * Setter for EndingQuantity. + * The ending quantity for the tier. Optional for the last tier. + * @param endingQuantity Value for String + */ + @JsonSetter("ending_quantity") + public void setEndingQuantity(String endingQuantity) { + this.endingQuantity = endingQuantity; + } + + /** + * Getter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("amount") + public Money getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param amount Value for Money + */ + @JsonSetter("amount") + public void setAmount(Money amount) { + this.amount = amount; + } + + /** + * Converts this PricingTier into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "PricingTier [" + "startingQuantity=" + startingQuantity + ", amount=" + amount + + ", endingQuantity=" + endingQuantity + "]"; + } + + /** + * Builds a new {@link PricingTier.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link PricingTier.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(startingQuantity, amount) + .endingQuantity(getEndingQuantity()); + return builder; + } + + /** + * Class to build instances of {@link PricingTier}. + */ + public static class Builder { + private String startingQuantity; + private Money amount; + private String endingQuantity; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param startingQuantity String value for startingQuantity. + * @param amount Money value for amount. + */ + public Builder(String startingQuantity, Money amount) { + this.startingQuantity = startingQuantity; + this.amount = amount; + } + + /** + * Setter for startingQuantity. + * @param startingQuantity String value for startingQuantity. + * @return Builder + */ + public Builder startingQuantity(String startingQuantity) { + this.startingQuantity = startingQuantity; + return this; + } + + /** + * Setter for amount. + * @param amount Money value for amount. + * @return Builder + */ + public Builder amount(Money amount) { + this.amount = amount; + return this; + } + + /** + * Setter for endingQuantity. + * @param endingQuantity String value for endingQuantity. + * @return Builder + */ + public Builder endingQuantity(String endingQuantity) { + this.endingQuantity = endingQuantity; + return this; + } + + /** + * Builds a new {@link PricingTier} object using the set fields. + * @return {@link PricingTier} + */ + public PricingTier build() { + return new PricingTier(startingQuantity, amount, endingQuantity); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/PurchaseUnitRequest.java b/src/main/java/com/paypal/sdk/models/PurchaseUnitRequest.java index aa71c70..0019b17 100644 --- a/src/main/java/com/paypal/sdk/models/PurchaseUnitRequest.java +++ b/src/main/java/com/paypal/sdk/models/PurchaseUnitRequest.java @@ -23,7 +23,7 @@ public class PurchaseUnitRequest { private String customId; private String invoiceId; private String softDescriptor; - private List items; + private List items; private ShippingDetails shipping; private SupplementaryData supplementaryData; @@ -43,7 +43,7 @@ public PurchaseUnitRequest() { * @param customId String value for customId. * @param invoiceId String value for invoiceId. * @param softDescriptor String value for softDescriptor. - * @param items List of Item value for items. + * @param items List of ItemRequest value for items. * @param shipping ShippingDetails value for shipping. * @param supplementaryData SupplementaryData value for supplementaryData. */ @@ -56,7 +56,7 @@ public PurchaseUnitRequest( String customId, String invoiceId, String softDescriptor, - List items, + List items, ShippingDetails shipping, SupplementaryData supplementaryData) { this.referenceId = referenceId; @@ -175,10 +175,13 @@ public void setPaymentInstruction(PaymentInstruction paymentInstruction) { /** * Getter for Description. - * The purchase description. The maximum length of the character is dependent on the type of - * characters used. The character length is specified assuming a US ASCII character. Depending - * on type of character; (e.g. accented character, Japanese characters) the number of characters - * that that can be specified as input might not equal the permissible max length. + * This field supports up to 3,000 characters, but any content beyond 127 characters (including + * spaces) will be truncated. The 127 character limit is reflected in the response + * representation of this field. The purchase description. The maximum length of the character + * is dependent on the type of characters used. The character length is specified assuming a US + * ASCII character. Depending on type of character; (e.g. accented character, Japanese + * characters) the number of characters that that can be specified as input might not equal the + * permissible max length. * @return Returns the String */ @JsonGetter("description") @@ -189,10 +192,13 @@ public String getDescription() { /** * Setter for Description. - * The purchase description. The maximum length of the character is dependent on the type of - * characters used. The character length is specified assuming a US ASCII character. Depending - * on type of character; (e.g. accented character, Japanese characters) the number of characters - * that that can be specified as input might not equal the permissible max length. + * This field supports up to 3,000 characters, but any content beyond 127 characters (including + * spaces) will be truncated. The 127 character limit is reflected in the response + * representation of this field. The purchase description. The maximum length of the character + * is dependent on the type of characters used. The character length is specified assuming a US + * ASCII character. Depending on type of character; (e.g. accented character, Japanese + * characters) the number of characters that that can be specified as input might not equal the + * permissible max length. * @param description Value for String */ @JsonSetter("description") @@ -226,7 +232,11 @@ public void setCustomId(String customId) { /** * Getter for InvoiceId. * The API caller-provided external invoice number for this order. Appears in both the payer's - * transaction history and the emails that the payer receives. + * transaction history and the emails that the payer receives. invoice_id values are required to + * be unique within each merchant account by default. Although the uniqueness validation is + * configurable, disabling this behavior will remove the account's ability to use invoice_id in + * other APIs as an identifier. It is highly recommended to keep a unique invoice_id for each + * Order. * @return Returns the String */ @JsonGetter("invoice_id") @@ -238,7 +248,11 @@ public String getInvoiceId() { /** * Setter for InvoiceId. * The API caller-provided external invoice number for this order. Appears in both the payer's - * transaction history and the emails that the payer receives. + * transaction history and the emails that the payer receives. invoice_id values are required to + * be unique within each merchant account by default. Although the uniqueness validation is + * configurable, disabling this behavior will remove the account's ability to use invoice_id in + * other APIs as an identifier. It is highly recommended to keep a unique invoice_id for each + * Order. * @param invoiceId Value for String */ @JsonSetter("invoice_id") @@ -248,12 +262,14 @@ public void setInvoiceId(String invoiceId) { /** * Getter for SoftDescriptor. - * The soft descriptor is the dynamic text used to construct the statement descriptor that - * appears on a payer's card statement. If an Order is paid using the "PayPal Wallet", the - * statement descriptor will appear in following format on the payer's card statement: - * PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant - * descriptor is the descriptor of the merchant’s payment receiving preferences which can be - * seen by logging into the merchant account + * This field supports up to 127 characters, but any content beyond 22 characters (including + * spaces) will be truncated. The 22 character limit is reflected in the response representation + * of this field. The soft descriptor is the dynamic text used to construct the statement + * descriptor that appears on a payer's card statement. If an Order is paid using the "PayPal + * Wallet", the statement descriptor will appear in following format on the payer's card + * statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The + * merchant descriptor is the descriptor of the merchant’s payment receiving preferences which + * can be seen by logging into the merchant account * https://www.sandbox.paypal.com/businessprofile/settings/info/edit The PAYPAL prefix uses 8 * characters. Only the first 22 characters will be displayed in the statement. For example, if: * The PayPal prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. @@ -269,12 +285,14 @@ public String getSoftDescriptor() { /** * Setter for SoftDescriptor. - * The soft descriptor is the dynamic text used to construct the statement descriptor that - * appears on a payer's card statement. If an Order is paid using the "PayPal Wallet", the - * statement descriptor will appear in following format on the payer's card statement: - * PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant - * descriptor is the descriptor of the merchant’s payment receiving preferences which can be - * seen by logging into the merchant account + * This field supports up to 127 characters, but any content beyond 22 characters (including + * spaces) will be truncated. The 22 character limit is reflected in the response representation + * of this field. The soft descriptor is the dynamic text used to construct the statement + * descriptor that appears on a payer's card statement. If an Order is paid using the "PayPal + * Wallet", the statement descriptor will appear in following format on the payer's card + * statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The + * merchant descriptor is the descriptor of the merchant’s payment receiving preferences which + * can be seen by logging into the merchant account * https://www.sandbox.paypal.com/businessprofile/settings/info/edit The PAYPAL prefix uses 8 * characters. Only the first 22 characters will be displayed in the statement. For example, if: * The PayPal prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. @@ -290,21 +308,21 @@ public void setSoftDescriptor(String softDescriptor) { /** * Getter for Items. * An array of items that the customer purchases from the merchant. - * @return Returns the List of Item + * @return Returns the List of ItemRequest */ @JsonGetter("items") @JsonInclude(JsonInclude.Include.NON_NULL) - public List getItems() { + public List getItems() { return items; } /** * Setter for Items. * An array of items that the customer purchases from the merchant. - * @param items Value for List of Item + * @param items Value for List of ItemRequest */ @JsonSetter("items") - public void setItems(List items) { + public void setItems(List items) { this.items = items; } @@ -399,7 +417,7 @@ public static class Builder { private String customId; private String invoiceId; private String softDescriptor; - private List items; + private List items; private ShippingDetails shipping; private SupplementaryData supplementaryData; @@ -499,10 +517,10 @@ public Builder softDescriptor(String softDescriptor) { /** * Setter for items. - * @param items List of Item value for items. + * @param items List of ItemRequest value for items. * @return Builder */ - public Builder items(List items) { + public Builder items(List items) { this.items = items; return this; } diff --git a/src/main/java/com/paypal/sdk/models/ReasonCode.java b/src/main/java/com/paypal/sdk/models/ReasonCode.java new file mode 100644 index 0000000..4d8d26c --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ReasonCode.java @@ -0,0 +1,152 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * ReasonCode to be used. + */ +public enum ReasonCode { + /** + * PayPal declined the payment due to one or more customer issues. + */ + PAYMENT_DENIED, + + /** + * An internal server error has occurred. + */ + INTERNAL_SERVER_ERROR, + + /** + * The payee account is not in good standing and cannot receive payments. + */ + PAYEE_ACCOUNT_RESTRICTED, + + /** + * The payer account is not in good standing and cannot make payments. + */ + PAYER_ACCOUNT_RESTRICTED, + + /** + * Payer cannot pay for this transaction. + */ + PAYER_CANNOT_PAY, + + /** + * The transaction exceeds the payer's sending limit. + */ + SENDING_LIMIT_EXCEEDED, + + /** + * The transaction exceeds the receiver's receiving limit. + */ + TRANSACTION_RECEIVING_LIMIT_EXCEEDED, + + /** + * The transaction is declined due to a currency mismatch. + */ + CURRENCY_MISMATCH, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + PAYMENT_DENIED.value = "PAYMENT_DENIED"; + INTERNAL_SERVER_ERROR.value = "INTERNAL_SERVER_ERROR"; + PAYEE_ACCOUNT_RESTRICTED.value = "PAYEE_ACCOUNT_RESTRICTED"; + PAYER_ACCOUNT_RESTRICTED.value = "PAYER_ACCOUNT_RESTRICTED"; + PAYER_CANNOT_PAY.value = "PAYER_CANNOT_PAY"; + SENDING_LIMIT_EXCEEDED.value = "SENDING_LIMIT_EXCEEDED"; + TRANSACTION_RECEIVING_LIMIT_EXCEEDED.value = "TRANSACTION_RECEIVING_LIMIT_EXCEEDED"; + CURRENCY_MISMATCH.value = "CURRENCY_MISMATCH"; + _UNKNOWN.value = null; + + valueMap.put("PAYMENT_DENIED", PAYMENT_DENIED); + valueMap.put("INTERNAL_SERVER_ERROR", INTERNAL_SERVER_ERROR); + valueMap.put("PAYEE_ACCOUNT_RESTRICTED", PAYEE_ACCOUNT_RESTRICTED); + valueMap.put("PAYER_ACCOUNT_RESTRICTED", PAYER_ACCOUNT_RESTRICTED); + valueMap.put("PAYER_CANNOT_PAY", PAYER_CANNOT_PAY); + valueMap.put("SENDING_LIMIT_EXCEEDED", SENDING_LIMIT_EXCEEDED); + valueMap.put("TRANSACTION_RECEIVING_LIMIT_EXCEEDED", TRANSACTION_RECEIVING_LIMIT_EXCEEDED); + valueMap.put("CURRENCY_MISMATCH", CURRENCY_MISMATCH); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static ReasonCode constructFromString(String toConvert) throws IOException { + ReasonCode enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static ReasonCode fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of ReasonCode values to list of string values. + * @param toConvert The list of ReasonCode values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (ReasonCode enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/ReturnFlow.java b/src/main/java/com/paypal/sdk/models/ReturnFlow.java new file mode 100644 index 0000000..44e6b59 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ReturnFlow.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * ReturnFlow to be used. + */ +public enum ReturnFlow { + /** + * After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. + */ + AUTO, + + /** + * 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. + */ + MANUAL, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + AUTO.value = "AUTO"; + MANUAL.value = "MANUAL"; + _UNKNOWN.value = null; + + valueMap.put("AUTO", AUTO); + valueMap.put("MANUAL", MANUAL); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static ReturnFlow constructFromString(String toConvert) throws IOException { + ReturnFlow enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static ReturnFlow fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of ReturnFlow values to list of string values. + * @param toConvert The list of ReturnFlow values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (ReturnFlow enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/ReviseSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/ReviseSubscriptionInput.java new file mode 100644 index 0000000..79040af --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ReviseSubscriptionInput.java @@ -0,0 +1,183 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ReviseSubscriptionInput type. + */ +public class ReviseSubscriptionInput { + private String id; + private String contentType; + private ModifySubscriptionRequest body; + + /** + * Default constructor. + */ + public ReviseSubscriptionInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body ModifySubscriptionRequest value for body. + */ + public ReviseSubscriptionInput( + String id, + String contentType, + ModifySubscriptionRequest body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the ModifySubscriptionRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ModifySubscriptionRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for ModifySubscriptionRequest + */ + @JsonSetter("body") + public void setBody(ModifySubscriptionRequest body) { + this.body = body; + } + + /** + * Converts this ReviseSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ReviseSubscriptionInput [" + "id=" + id + ", contentType=" + contentType + ", body=" + + body + "]"; + } + + /** + * Builds a new {@link ReviseSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ReviseSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link ReviseSubscriptionInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private ModifySubscriptionRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body ModifySubscriptionRequest value for body. + * @return Builder + */ + public Builder body(ModifySubscriptionRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link ReviseSubscriptionInput} object using the set fields. + * @return {@link ReviseSubscriptionInput} + */ + public ReviseSubscriptionInput build() { + return new ReviseSubscriptionInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SearchBalancesInput.java b/src/main/java/com/paypal/sdk/models/SearchBalancesInput.java new file mode 100644 index 0000000..51d17c5 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SearchBalancesInput.java @@ -0,0 +1,143 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SearchBalancesInput type. + */ +public class SearchBalancesInput { + private String asOfTime; + private String currencyCode; + + /** + * Default constructor. + */ + public SearchBalancesInput() { + } + + /** + * Initialization constructor. + * @param asOfTime String value for asOfTime. + * @param currencyCode String value for currencyCode. + */ + public SearchBalancesInput( + String asOfTime, + String currencyCode) { + this.asOfTime = asOfTime; + this.currencyCode = currencyCode; + } + + /** + * Getter for AsOfTime. + * List balances in the response at the date time provided, will return the last refreshed + * balance in the system when not provided. + * @return Returns the String + */ + @JsonGetter("as_of_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAsOfTime() { + return asOfTime; + } + + /** + * Setter for AsOfTime. + * List balances in the response at the date time provided, will return the last refreshed + * balance in the system when not provided. + * @param asOfTime Value for String + */ + @JsonSetter("as_of_time") + public void setAsOfTime(String asOfTime) { + this.asOfTime = asOfTime; + } + + /** + * Getter for CurrencyCode. + * Filters the transactions in the response by a [three-character ISO-4217 currency + * code](/api/rest/reference/currency-codes/) for the PayPal transaction currency. + * @return Returns the String + */ + @JsonGetter("currency_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCurrencyCode() { + return currencyCode; + } + + /** + * Setter for CurrencyCode. + * Filters the transactions in the response by a [three-character ISO-4217 currency + * code](/api/rest/reference/currency-codes/) for the PayPal transaction currency. + * @param currencyCode Value for String + */ + @JsonSetter("currency_code") + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + /** + * Converts this SearchBalancesInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SearchBalancesInput [" + "asOfTime=" + asOfTime + ", currencyCode=" + currencyCode + + "]"; + } + + /** + * Builds a new {@link SearchBalancesInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SearchBalancesInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .asOfTime(getAsOfTime()) + .currencyCode(getCurrencyCode()); + return builder; + } + + /** + * Class to build instances of {@link SearchBalancesInput}. + */ + public static class Builder { + private String asOfTime; + private String currencyCode; + + + + /** + * Setter for asOfTime. + * @param asOfTime String value for asOfTime. + * @return Builder + */ + public Builder asOfTime(String asOfTime) { + this.asOfTime = asOfTime; + return this; + } + + /** + * Setter for currencyCode. + * @param currencyCode String value for currencyCode. + * @return Builder + */ + public Builder currencyCode(String currencyCode) { + this.currencyCode = currencyCode; + return this; + } + + /** + * Builds a new {@link SearchBalancesInput} object using the set fields. + * @return {@link SearchBalancesInput} + */ + public SearchBalancesInput build() { + return new SearchBalancesInput(asOfTime, currencyCode); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SearchResponse.java b/src/main/java/com/paypal/sdk/models/SearchResponse.java new file mode 100644 index 0000000..0a73d2a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SearchResponse.java @@ -0,0 +1,425 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for SearchResponse type. + */ +public class SearchResponse { + private List transactionDetails; + private String accountNumber; + private String startDate; + private String endDate; + private String lastRefreshedDatetime; + private Integer page; + private Integer totalItems; + private Integer totalPages; + private List links; + + /** + * Default constructor. + */ + public SearchResponse() { + } + + /** + * Initialization constructor. + * @param transactionDetails List of TransactionDetails value for transactionDetails. + * @param accountNumber String value for accountNumber. + * @param startDate String value for startDate. + * @param endDate String value for endDate. + * @param lastRefreshedDatetime String value for lastRefreshedDatetime. + * @param page Integer value for page. + * @param totalItems Integer value for totalItems. + * @param totalPages Integer value for totalPages. + * @param links List of LinkDescription value for links. + */ + public SearchResponse( + List transactionDetails, + String accountNumber, + String startDate, + String endDate, + String lastRefreshedDatetime, + Integer page, + Integer totalItems, + Integer totalPages, + List links) { + this.transactionDetails = transactionDetails; + this.accountNumber = accountNumber; + this.startDate = startDate; + this.endDate = endDate; + this.lastRefreshedDatetime = lastRefreshedDatetime; + this.page = page; + this.totalItems = totalItems; + this.totalPages = totalPages; + this.links = links; + } + + /** + * Getter for TransactionDetails. + * An array of transaction detail objects. + * @return Returns the List of TransactionDetails + */ + @JsonGetter("transaction_details") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTransactionDetails() { + return transactionDetails; + } + + /** + * Setter for TransactionDetails. + * An array of transaction detail objects. + * @param transactionDetails Value for List of TransactionDetails + */ + @JsonSetter("transaction_details") + public void setTransactionDetails(List transactionDetails) { + this.transactionDetails = transactionDetails; + } + + /** + * Getter for AccountNumber. + * The merchant account number. + * @return Returns the String + */ + @JsonGetter("account_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAccountNumber() { + return accountNumber; + } + + /** + * Setter for AccountNumber. + * The merchant account number. + * @param accountNumber Value for String + */ + @JsonSetter("account_number") + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + /** + * Getter for StartDate. + * 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. + * @return Returns the String + */ + @JsonGetter("start_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStartDate() { + return startDate; + } + + /** + * Setter for StartDate. + * 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. + * @param startDate Value for String + */ + @JsonSetter("start_date") + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + /** + * Getter for EndDate. + * 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. + * @return Returns the String + */ + @JsonGetter("end_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getEndDate() { + return endDate; + } + + /** + * Setter for EndDate. + * 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. + * @param endDate Value for String + */ + @JsonSetter("end_date") + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + /** + * Getter for LastRefreshedDatetime. + * 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. + * @return Returns the String + */ + @JsonGetter("last_refreshed_datetime") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLastRefreshedDatetime() { + return lastRefreshedDatetime; + } + + /** + * Setter for LastRefreshedDatetime. + * 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. + * @param lastRefreshedDatetime Value for String + */ + @JsonSetter("last_refreshed_datetime") + public void setLastRefreshedDatetime(String lastRefreshedDatetime) { + this.lastRefreshedDatetime = lastRefreshedDatetime; + } + + /** + * Getter for Page. + * A zero-relative index of transactions. + * @return Returns the Integer + */ + @JsonGetter("page") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPage() { + return page; + } + + /** + * Setter for Page. + * A zero-relative index of transactions. + * @param page Value for Integer + */ + @JsonSetter("page") + public void setPage(Integer page) { + this.page = page; + } + + /** + * Getter for TotalItems. + * The total number of transactions as an integer beginning with the specified `page` in the + * full result and not just in this response. + * @return Returns the Integer + */ + @JsonGetter("total_items") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalItems() { + return totalItems; + } + + /** + * Setter for TotalItems. + * The total number of transactions as an integer beginning with the specified `page` in the + * full result and not just in this response. + * @param totalItems Value for Integer + */ + @JsonSetter("total_items") + public void setTotalItems(Integer totalItems) { + this.totalItems = totalItems; + } + + /** + * Getter for TotalPages. + * The total number of pages, as an `integer`, when the `total_items` is divided into pages of + * the specified `page_size`. + * @return Returns the Integer + */ + @JsonGetter("total_pages") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalPages() { + return totalPages; + } + + /** + * Setter for TotalPages. + * The total number of pages, as an `integer`, when the `total_items` is divided into pages of + * the specified `page_size`. + * @param totalPages Value for Integer + */ + @JsonSetter("total_pages") + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this SearchResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SearchResponse [" + "transactionDetails=" + transactionDetails + ", accountNumber=" + + accountNumber + ", startDate=" + startDate + ", endDate=" + endDate + + ", lastRefreshedDatetime=" + lastRefreshedDatetime + ", page=" + page + + ", totalItems=" + totalItems + ", totalPages=" + totalPages + ", links=" + links + + "]"; + } + + /** + * Builds a new {@link SearchResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SearchResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .transactionDetails(getTransactionDetails()) + .accountNumber(getAccountNumber()) + .startDate(getStartDate()) + .endDate(getEndDate()) + .lastRefreshedDatetime(getLastRefreshedDatetime()) + .page(getPage()) + .totalItems(getTotalItems()) + .totalPages(getTotalPages()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link SearchResponse}. + */ + public static class Builder { + private List transactionDetails; + private String accountNumber; + private String startDate; + private String endDate; + private String lastRefreshedDatetime; + private Integer page; + private Integer totalItems; + private Integer totalPages; + private List links; + + + + /** + * Setter for transactionDetails. + * @param transactionDetails List of TransactionDetails value for transactionDetails. + * @return Builder + */ + public Builder transactionDetails(List transactionDetails) { + this.transactionDetails = transactionDetails; + return this; + } + + /** + * Setter for accountNumber. + * @param accountNumber String value for accountNumber. + * @return Builder + */ + public Builder accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * Setter for startDate. + * @param startDate String value for startDate. + * @return Builder + */ + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * Setter for endDate. + * @param endDate String value for endDate. + * @return Builder + */ + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + /** + * Setter for lastRefreshedDatetime. + * @param lastRefreshedDatetime String value for lastRefreshedDatetime. + * @return Builder + */ + public Builder lastRefreshedDatetime(String lastRefreshedDatetime) { + this.lastRefreshedDatetime = lastRefreshedDatetime; + return this; + } + + /** + * Setter for page. + * @param page Integer value for page. + * @return Builder + */ + public Builder page(Integer page) { + this.page = page; + return this; + } + + /** + * Setter for totalItems. + * @param totalItems Integer value for totalItems. + * @return Builder + */ + public Builder totalItems(Integer totalItems) { + this.totalItems = totalItems; + return this; + } + + /** + * Setter for totalPages. + * @param totalPages Integer value for totalPages. + * @return Builder + */ + public Builder totalPages(Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link SearchResponse} object using the set fields. + * @return {@link SearchResponse} + */ + public SearchResponse build() { + return new SearchResponse(transactionDetails, accountNumber, startDate, endDate, + lastRefreshedDatetime, page, totalItems, totalPages, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SearchTransactionsInput.java b/src/main/java/com/paypal/sdk/models/SearchTransactionsInput.java new file mode 100644 index 0000000..1d18853 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SearchTransactionsInput.java @@ -0,0 +1,702 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SearchTransactionsInput type. + */ +public class SearchTransactionsInput { + private String startDate; + private String endDate; + private String transactionId; + private String transactionType; + private String transactionStatus; + private String transactionAmount; + private String transactionCurrency; + private String paymentInstrumentType; + private String storeId; + private String terminalId; + private String fields; + private String balanceAffectingRecordsOnly; + private Integer pageSize; + private Integer page; + + /** + * Default constructor. + */ + public SearchTransactionsInput() { + fields = "transaction_info"; + balanceAffectingRecordsOnly = "Y"; + pageSize = 100; + page = 1; + } + + /** + * Initialization constructor. + * @param startDate String value for startDate. + * @param endDate String value for endDate. + * @param transactionId String value for transactionId. + * @param transactionType String value for transactionType. + * @param transactionStatus String value for transactionStatus. + * @param transactionAmount String value for transactionAmount. + * @param transactionCurrency String value for transactionCurrency. + * @param paymentInstrumentType String value for paymentInstrumentType. + * @param storeId String value for storeId. + * @param terminalId String value for terminalId. + * @param fields String value for fields. + * @param balanceAffectingRecordsOnly String value for balanceAffectingRecordsOnly. + * @param pageSize Integer value for pageSize. + * @param page Integer value for page. + */ + public SearchTransactionsInput( + String startDate, + String endDate, + String transactionId, + String transactionType, + String transactionStatus, + String transactionAmount, + String transactionCurrency, + String paymentInstrumentType, + String storeId, + String terminalId, + String fields, + String balanceAffectingRecordsOnly, + Integer pageSize, + Integer page) { + this.startDate = startDate; + this.endDate = endDate; + this.transactionId = transactionId; + this.transactionType = transactionType; + this.transactionStatus = transactionStatus; + this.transactionAmount = transactionAmount; + this.transactionCurrency = transactionCurrency; + this.paymentInstrumentType = paymentInstrumentType; + this.storeId = storeId; + this.terminalId = terminalId; + this.fields = fields; + this.balanceAffectingRecordsOnly = balanceAffectingRecordsOnly; + this.pageSize = pageSize; + this.page = page; + } + + /** + * Getter for StartDate. + * Filters the transactions in the response by a start date and time, in [Internet date and time + * format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional + * seconds are optional. + * @return Returns the String + */ + @JsonGetter("start_date") + public String getStartDate() { + return startDate; + } + + /** + * Setter for StartDate. + * Filters the transactions in the response by a start date and time, in [Internet date and time + * format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional + * seconds are optional. + * @param startDate Value for String + */ + @JsonSetter("start_date") + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + /** + * Getter for EndDate. + * Filters the transactions in the response by an end date and time, in [Internet date and time + * format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional + * seconds are optional. The maximum supported range is 31 days. + * @return Returns the String + */ + @JsonGetter("end_date") + public String getEndDate() { + return endDate; + } + + /** + * Setter for EndDate. + * Filters the transactions in the response by an end date and time, in [Internet date and time + * format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional + * seconds are optional. The maximum supported range is 31 days. + * @param endDate Value for String + */ + @JsonSetter("end_date") + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + /** + * Getter for TransactionId. + * Filters the transactions in the response by a PayPal transaction ID. A valid transaction ID + * is 17 characters long, except for an order ID, which is 19 characters long. Note: A + * transaction ID is not unique in the reporting system. The response can list two transactions + * with the same ID. One transaction can be balance affecting while the other is non-balance + * affecting. + * @return Returns the String + */ + @JsonGetter("transaction_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionId() { + return transactionId; + } + + /** + * Setter for TransactionId. + * Filters the transactions in the response by a PayPal transaction ID. A valid transaction ID + * is 17 characters long, except for an order ID, which is 19 characters long. Note: A + * transaction ID is not unique in the reporting system. The response can list two transactions + * with the same ID. One transaction can be balance affecting while the other is non-balance + * affecting. + * @param transactionId Value for String + */ + @JsonSetter("transaction_id") + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + /** + * Getter for TransactionType. + * Filters the transactions in the response by a PayPal transaction event code. See [Transaction + * event codes](/docs/integration/direct/transaction-search/transaction-event-codes/). + * @return Returns the String + */ + @JsonGetter("transaction_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionType() { + return transactionType; + } + + /** + * Setter for TransactionType. + * Filters the transactions in the response by a PayPal transaction event code. See [Transaction + * event codes](/docs/integration/direct/transaction-search/transaction-event-codes/). + * @param transactionType Value for String + */ + @JsonSetter("transaction_type") + public void setTransactionType(String transactionType) { + this.transactionType = transactionType; + } + + /** + * Getter for TransactionStatus. + * Filters the transactions in the response by a PayPal transaction status code. Value is: + * Status code Description D PayPal or merchant rules denied the transaction. P The transaction + * is pending. The transaction was created but waits for another payment process to complete, + * such as an ACH transaction, before the status changes to S. S The transaction successfully + * completed without a denial and after any pending statuses. V A successful transaction was + * reversed and funds were refunded to the original sender. + * @return Returns the String + */ + @JsonGetter("transaction_status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionStatus() { + return transactionStatus; + } + + /** + * Setter for TransactionStatus. + * Filters the transactions in the response by a PayPal transaction status code. Value is: + * Status code Description D PayPal or merchant rules denied the transaction. P The transaction + * is pending. The transaction was created but waits for another payment process to complete, + * such as an ACH transaction, before the status changes to S. S The transaction successfully + * completed without a denial and after any pending statuses. V A successful transaction was + * reversed and funds were refunded to the original sender. + * @param transactionStatus Value for String + */ + @JsonSetter("transaction_status") + public void setTransactionStatus(String transactionStatus) { + this.transactionStatus = transactionStatus; + } + + /** + * Getter for TransactionAmount. + * Filters the transactions in the response by a gross transaction amount range. Specify the + * range as ` TO `, where ` ` is the lower limit of the gross PayPal transaction amount and ` ` + * is the upper limit of the gross transaction amount. Specify the amounts in lower + * denominations. For example, to search for transactions from $5.00 to $10.05, specify `[500 TO + * 1005]`. Note:The values must be URL encoded. + * @return Returns the String + */ + @JsonGetter("transaction_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionAmount() { + return transactionAmount; + } + + /** + * Setter for TransactionAmount. + * Filters the transactions in the response by a gross transaction amount range. Specify the + * range as ` TO `, where ` ` is the lower limit of the gross PayPal transaction amount and ` ` + * is the upper limit of the gross transaction amount. Specify the amounts in lower + * denominations. For example, to search for transactions from $5.00 to $10.05, specify `[500 TO + * 1005]`. Note:The values must be URL encoded. + * @param transactionAmount Value for String + */ + @JsonSetter("transaction_amount") + public void setTransactionAmount(String transactionAmount) { + this.transactionAmount = transactionAmount; + } + + /** + * Getter for TransactionCurrency. + * Filters the transactions in the response by a [three-character ISO-4217 currency + * code](/api/rest/reference/currency-codes/) for the PayPal transaction currency. + * @return Returns the String + */ + @JsonGetter("transaction_currency") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionCurrency() { + return transactionCurrency; + } + + /** + * Setter for TransactionCurrency. + * Filters the transactions in the response by a [three-character ISO-4217 currency + * code](/api/rest/reference/currency-codes/) for the PayPal transaction currency. + * @param transactionCurrency Value for String + */ + @JsonSetter("transaction_currency") + public void setTransactionCurrency(String transactionCurrency) { + this.transactionCurrency = transactionCurrency; + } + + /** + * Getter for PaymentInstrumentType. + * Filters the transactions in the response by a payment instrument type. Value is either: + * CREDITCARD. Returns a direct credit card transaction with a corresponding value. DEBITCARD. + * Returns a debit card transaction with a corresponding value. If you omit this parameter, the + * API does not apply this filter. + * @return Returns the String + */ + @JsonGetter("payment_instrument_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaymentInstrumentType() { + return paymentInstrumentType; + } + + /** + * Setter for PaymentInstrumentType. + * Filters the transactions in the response by a payment instrument type. Value is either: + * CREDITCARD. Returns a direct credit card transaction with a corresponding value. DEBITCARD. + * Returns a debit card transaction with a corresponding value. If you omit this parameter, the + * API does not apply this filter. + * @param paymentInstrumentType Value for String + */ + @JsonSetter("payment_instrument_type") + public void setPaymentInstrumentType(String paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + } + + /** + * Getter for StoreId. + * Filters the transactions in the response by a store ID. + * @return Returns the String + */ + @JsonGetter("store_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStoreId() { + return storeId; + } + + /** + * Setter for StoreId. + * Filters the transactions in the response by a store ID. + * @param storeId Value for String + */ + @JsonSetter("store_id") + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + * Getter for TerminalId. + * Filters the transactions in the response by a terminal ID. + * @return Returns the String + */ + @JsonGetter("terminal_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTerminalId() { + return terminalId; + } + + /** + * Setter for TerminalId. + * Filters the transactions in the response by a terminal ID. + * @param terminalId Value for String + */ + @JsonSetter("terminal_id") + public void setTerminalId(String terminalId) { + this.terminalId = terminalId; + } + + /** + * Getter for Fields. + * Indicates which fields appear in the response. Value is a single field or a comma-separated + * list of fields. The transaction_info value returns only the transaction details in the + * response. To include all fields in the response, specify fields=all. Valid fields are: + * transaction_info. The transaction information. Includes the ID of the PayPal account of the + * payee, the PayPal-generated transaction ID, the PayPal-generated base ID, the PayPal + * reference ID type, the transaction event code, the date and time when the transaction was + * initiated and was last updated, the transaction amounts including the PayPal fee, any + * discounts, insurance, the transaction status, and other information about the transaction. + * payer_info. The payer information. Includes the PayPal customer account ID and the payer's + * email address, primary phone number, name, country code, address, and whether the payer is + * verified or unverified. shipping_info. The shipping information. Includes the recipient's + * name, the shipping method for this order, the shipping address for this order, and the + * secondary address associated with this order. auction_info. The auction information. Includes + * the name of the auction site, the auction site URL, the ID of the customer who makes the + * purchase in the auction, and the date and time when the auction closes. cart_info. The cart + * information. Includes an array of item details, whether the item amount or the shipping + * amount already includes tax, and the ID of the invoice for PayPal-generated invoices. + * incentive_info. An array of incentive detail objects. Each object includes the incentive, + * such as a special offer or coupon, the incentive amount, and the incentive program code that + * identifies a merchant loyalty or incentive program. store_info. The store information. + * Includes the ID of the merchant store and the terminal ID for the checkout stand in the + * merchant store. + * @return Returns the String + */ + @JsonGetter("fields") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFields() { + return fields; + } + + /** + * Setter for Fields. + * Indicates which fields appear in the response. Value is a single field or a comma-separated + * list of fields. The transaction_info value returns only the transaction details in the + * response. To include all fields in the response, specify fields=all. Valid fields are: + * transaction_info. The transaction information. Includes the ID of the PayPal account of the + * payee, the PayPal-generated transaction ID, the PayPal-generated base ID, the PayPal + * reference ID type, the transaction event code, the date and time when the transaction was + * initiated and was last updated, the transaction amounts including the PayPal fee, any + * discounts, insurance, the transaction status, and other information about the transaction. + * payer_info. The payer information. Includes the PayPal customer account ID and the payer's + * email address, primary phone number, name, country code, address, and whether the payer is + * verified or unverified. shipping_info. The shipping information. Includes the recipient's + * name, the shipping method for this order, the shipping address for this order, and the + * secondary address associated with this order. auction_info. The auction information. Includes + * the name of the auction site, the auction site URL, the ID of the customer who makes the + * purchase in the auction, and the date and time when the auction closes. cart_info. The cart + * information. Includes an array of item details, whether the item amount or the shipping + * amount already includes tax, and the ID of the invoice for PayPal-generated invoices. + * incentive_info. An array of incentive detail objects. Each object includes the incentive, + * such as a special offer or coupon, the incentive amount, and the incentive program code that + * identifies a merchant loyalty or incentive program. store_info. The store information. + * Includes the ID of the merchant store and the terminal ID for the checkout stand in the + * merchant store. + * @param fields Value for String + */ + @JsonSetter("fields") + public void setFields(String fields) { + this.fields = fields; + } + + /** + * Getter for BalanceAffectingRecordsOnly. + * Indicates whether the response includes only balance-impacting transactions or all + * transactions. Value is either: Y. The default. The response includes only balance + * transactions. N. The response includes all transactions. + * @return Returns the String + */ + @JsonGetter("balance_affecting_records_only") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getBalanceAffectingRecordsOnly() { + return balanceAffectingRecordsOnly; + } + + /** + * Setter for BalanceAffectingRecordsOnly. + * Indicates whether the response includes only balance-impacting transactions or all + * transactions. Value is either: Y. The default. The response includes only balance + * transactions. N. The response includes all transactions. + * @param balanceAffectingRecordsOnly Value for String + */ + @JsonSetter("balance_affecting_records_only") + public void setBalanceAffectingRecordsOnly(String balanceAffectingRecordsOnly) { + this.balanceAffectingRecordsOnly = balanceAffectingRecordsOnly; + } + + /** + * Getter for PageSize. + * The number of items to return in the response. So, the combination of `page=1` and + * `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` + * returns the next 20 items. + * @return Returns the Integer + */ + @JsonGetter("page_size") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPageSize() { + return pageSize; + } + + /** + * Setter for PageSize. + * The number of items to return in the response. So, the combination of `page=1` and + * `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` + * returns the next 20 items. + * @param pageSize Value for Integer + */ + @JsonSetter("page_size") + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + /** + * Getter for Page. + * The zero-relative start index of the entire list of items that are returned in the response. + * So, the combination of `page=1` and `page_size=20` returns the first 20 items. + * @return Returns the Integer + */ + @JsonGetter("page") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPage() { + return page; + } + + /** + * Setter for Page. + * The zero-relative start index of the entire list of items that are returned in the response. + * So, the combination of `page=1` and `page_size=20` returns the first 20 items. + * @param page Value for Integer + */ + @JsonSetter("page") + public void setPage(Integer page) { + this.page = page; + } + + /** + * Converts this SearchTransactionsInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SearchTransactionsInput [" + "startDate=" + startDate + ", endDate=" + endDate + + ", transactionId=" + transactionId + ", transactionType=" + transactionType + + ", transactionStatus=" + transactionStatus + ", transactionAmount=" + + transactionAmount + ", transactionCurrency=" + transactionCurrency + + ", paymentInstrumentType=" + paymentInstrumentType + ", storeId=" + storeId + + ", terminalId=" + terminalId + ", fields=" + fields + + ", balanceAffectingRecordsOnly=" + balanceAffectingRecordsOnly + ", pageSize=" + + pageSize + ", page=" + page + "]"; + } + + /** + * Builds a new {@link SearchTransactionsInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SearchTransactionsInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(startDate, endDate) + .transactionId(getTransactionId()) + .transactionType(getTransactionType()) + .transactionStatus(getTransactionStatus()) + .transactionAmount(getTransactionAmount()) + .transactionCurrency(getTransactionCurrency()) + .paymentInstrumentType(getPaymentInstrumentType()) + .storeId(getStoreId()) + .terminalId(getTerminalId()) + .fields(getFields()) + .balanceAffectingRecordsOnly(getBalanceAffectingRecordsOnly()) + .pageSize(getPageSize()) + .page(getPage()); + return builder; + } + + /** + * Class to build instances of {@link SearchTransactionsInput}. + */ + public static class Builder { + private String startDate; + private String endDate; + private String transactionId; + private String transactionType; + private String transactionStatus; + private String transactionAmount; + private String transactionCurrency; + private String paymentInstrumentType; + private String storeId; + private String terminalId; + private String fields = "transaction_info"; + private String balanceAffectingRecordsOnly = "Y"; + private Integer pageSize = 100; + private Integer page = 1; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param startDate String value for startDate. + * @param endDate String value for endDate. + */ + public Builder(String startDate, String endDate) { + this.startDate = startDate; + this.endDate = endDate; + } + + /** + * Setter for startDate. + * @param startDate String value for startDate. + * @return Builder + */ + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * Setter for endDate. + * @param endDate String value for endDate. + * @return Builder + */ + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + /** + * Setter for transactionId. + * @param transactionId String value for transactionId. + * @return Builder + */ + public Builder transactionId(String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Setter for transactionType. + * @param transactionType String value for transactionType. + * @return Builder + */ + public Builder transactionType(String transactionType) { + this.transactionType = transactionType; + return this; + } + + /** + * Setter for transactionStatus. + * @param transactionStatus String value for transactionStatus. + * @return Builder + */ + public Builder transactionStatus(String transactionStatus) { + this.transactionStatus = transactionStatus; + return this; + } + + /** + * Setter for transactionAmount. + * @param transactionAmount String value for transactionAmount. + * @return Builder + */ + public Builder transactionAmount(String transactionAmount) { + this.transactionAmount = transactionAmount; + return this; + } + + /** + * Setter for transactionCurrency. + * @param transactionCurrency String value for transactionCurrency. + * @return Builder + */ + public Builder transactionCurrency(String transactionCurrency) { + this.transactionCurrency = transactionCurrency; + return this; + } + + /** + * Setter for paymentInstrumentType. + * @param paymentInstrumentType String value for paymentInstrumentType. + * @return Builder + */ + public Builder paymentInstrumentType(String paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + return this; + } + + /** + * Setter for storeId. + * @param storeId String value for storeId. + * @return Builder + */ + public Builder storeId(String storeId) { + this.storeId = storeId; + return this; + } + + /** + * Setter for terminalId. + * @param terminalId String value for terminalId. + * @return Builder + */ + public Builder terminalId(String terminalId) { + this.terminalId = terminalId; + return this; + } + + /** + * Setter for fields. + * @param fields String value for fields. + * @return Builder + */ + public Builder fields(String fields) { + this.fields = fields; + return this; + } + + /** + * Setter for balanceAffectingRecordsOnly. + * @param balanceAffectingRecordsOnly String value for balanceAffectingRecordsOnly. + * @return Builder + */ + public Builder balanceAffectingRecordsOnly(String balanceAffectingRecordsOnly) { + this.balanceAffectingRecordsOnly = balanceAffectingRecordsOnly; + return this; + } + + /** + * Setter for pageSize. + * @param pageSize Integer value for pageSize. + * @return Builder + */ + public Builder pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Setter for page. + * @param page Integer value for page. + * @return Builder + */ + public Builder page(Integer page) { + this.page = page; + return this; + } + + /** + * Builds a new {@link SearchTransactionsInput} object using the set fields. + * @return {@link SearchTransactionsInput} + */ + public SearchTransactionsInput build() { + return new SearchTransactionsInput(startDate, endDate, transactionId, transactionType, + transactionStatus, transactionAmount, transactionCurrency, + paymentInstrumentType, storeId, terminalId, fields, balanceAffectingRecordsOnly, + pageSize, page); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SepaDebitExperienceContext.java b/src/main/java/com/paypal/sdk/models/SepaDebitExperienceContext.java new file mode 100644 index 0000000..6a4e1c4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SepaDebitExperienceContext.java @@ -0,0 +1,198 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SepaDebitExperienceContext type. + */ +public class SepaDebitExperienceContext { + private String locale; + private String returnUrl; + private String cancelUrl; + + /** + * Default constructor. + */ + public SepaDebitExperienceContext() { + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + * @param locale String value for locale. + */ + public SepaDebitExperienceContext( + String returnUrl, + String cancelUrl, + String locale) { + this.locale = locale; + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Getter for Locale. + * The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to + * localize the error-related strings, such as messages, issues, and suggested actions. The tag + * is made up of the [ISO 639-2 language + * code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 + * script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 + * country code](/api/rest/reference/country-codes/) or [M49 region + * code](https://unstats.un.org/unsd/methodology/m49/). + * @return Returns the String + */ + @JsonGetter("locale") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLocale() { + return locale; + } + + /** + * Setter for Locale. + * The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to + * localize the error-related strings, such as messages, issues, and suggested actions. The tag + * is made up of the [ISO 639-2 language + * code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 + * script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 + * country code](/api/rest/reference/country-codes/) or [M49 region + * code](https://unstats.un.org/unsd/methodology/m49/). + * @param locale Value for String + */ + @JsonSetter("locale") + public void setLocale(String locale) { + this.locale = locale; + } + + /** + * Getter for ReturnUrl. + * Describes the URL. + * @return Returns the String + */ + @JsonGetter("return_url") + public String getReturnUrl() { + return returnUrl; + } + + /** + * Setter for ReturnUrl. + * Describes the URL. + * @param returnUrl Value for String + */ + @JsonSetter("return_url") + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + } + + /** + * Getter for CancelUrl. + * Describes the URL. + * @return Returns the String + */ + @JsonGetter("cancel_url") + public String getCancelUrl() { + return cancelUrl; + } + + /** + * Setter for CancelUrl. + * Describes the URL. + * @param cancelUrl Value for String + */ + @JsonSetter("cancel_url") + public void setCancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + } + + /** + * Converts this SepaDebitExperienceContext into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SepaDebitExperienceContext [" + "returnUrl=" + returnUrl + ", cancelUrl=" + + cancelUrl + ", locale=" + locale + "]"; + } + + /** + * Builds a new {@link SepaDebitExperienceContext.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SepaDebitExperienceContext.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(returnUrl, cancelUrl) + .locale(getLocale()); + return builder; + } + + /** + * Class to build instances of {@link SepaDebitExperienceContext}. + */ + public static class Builder { + private String returnUrl; + private String cancelUrl; + private String locale; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + */ + public Builder(String returnUrl, String cancelUrl) { + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Setter for returnUrl. + * @param returnUrl String value for returnUrl. + * @return Builder + */ + public Builder returnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * Setter for cancelUrl. + * @param cancelUrl String value for cancelUrl. + * @return Builder + */ + public Builder cancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + return this; + } + + /** + * Setter for locale. + * @param locale String value for locale. + * @return Builder + */ + public Builder locale(String locale) { + this.locale = locale; + return this; + } + + /** + * Builds a new {@link SepaDebitExperienceContext} object using the set fields. + * @return {@link SepaDebitExperienceContext} + */ + public SepaDebitExperienceContext build() { + return new SepaDebitExperienceContext(returnUrl, cancelUrl, locale); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SepaDebitRequest.java b/src/main/java/com/paypal/sdk/models/SepaDebitRequest.java new file mode 100644 index 0000000..fe65612 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SepaDebitRequest.java @@ -0,0 +1,101 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SepaDebitRequest type. + */ +public class SepaDebitRequest { + private SepaDebitExperienceContext experienceContext; + + /** + * Default constructor. + */ + public SepaDebitRequest() { + } + + /** + * Initialization constructor. + * @param experienceContext SepaDebitExperienceContext value for experienceContext. + */ + public SepaDebitRequest( + SepaDebitExperienceContext experienceContext) { + this.experienceContext = experienceContext; + } + + /** + * Getter for ExperienceContext. + * Customizes the payer experience during the approval process for the SEPA Debit payment. + * @return Returns the SepaDebitExperienceContext + */ + @JsonGetter("experience_context") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SepaDebitExperienceContext getExperienceContext() { + return experienceContext; + } + + /** + * Setter for ExperienceContext. + * Customizes the payer experience during the approval process for the SEPA Debit payment. + * @param experienceContext Value for SepaDebitExperienceContext + */ + @JsonSetter("experience_context") + public void setExperienceContext(SepaDebitExperienceContext experienceContext) { + this.experienceContext = experienceContext; + } + + /** + * Converts this SepaDebitRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SepaDebitRequest [" + "experienceContext=" + experienceContext + "]"; + } + + /** + * Builds a new {@link SepaDebitRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SepaDebitRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .experienceContext(getExperienceContext()); + return builder; + } + + /** + * Class to build instances of {@link SepaDebitRequest}. + */ + public static class Builder { + private SepaDebitExperienceContext experienceContext; + + + + /** + * Setter for experienceContext. + * @param experienceContext SepaDebitExperienceContext value for experienceContext. + * @return Builder + */ + public Builder experienceContext(SepaDebitExperienceContext experienceContext) { + this.experienceContext = experienceContext; + return this; + } + + /** + * Builds a new {@link SepaDebitRequest} object using the set fields. + * @return {@link SepaDebitRequest} + */ + public SepaDebitRequest build() { + return new SepaDebitRequest(experienceContext); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SetupFeeFailureAction.java b/src/main/java/com/paypal/sdk/models/SetupFeeFailureAction.java new file mode 100644 index 0000000..da9368d --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SetupFeeFailureAction.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * SetupFeeFailureAction to be used. + */ +public enum SetupFeeFailureAction { + /** + * Continues the subscription if the initial payment for the setup fails. + */ + CONTINUE, + + /** + * Cancels the subscription if the initial payment for the setup fails. + */ + CANCEL, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CONTINUE.value = "CONTINUE"; + CANCEL.value = "CANCEL"; + _UNKNOWN.value = null; + + valueMap.put("CONTINUE", CONTINUE); + valueMap.put("CANCEL", CANCEL); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static SetupFeeFailureAction constructFromString(String toConvert) throws IOException { + SetupFeeFailureAction enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static SetupFeeFailureAction fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of SetupFeeFailureAction values to list of string values. + * @param toConvert The list of SetupFeeFailureAction values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (SetupFeeFailureAction enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/SetupTokenRequestCard.java b/src/main/java/com/paypal/sdk/models/SetupTokenRequestCard.java index 2939e39..8703248 100644 --- a/src/main/java/com/paypal/sdk/models/SetupTokenRequestCard.java +++ b/src/main/java/com/paypal/sdk/models/SetupTokenRequestCard.java @@ -21,7 +21,7 @@ public class SetupTokenRequestCard { private CardBrand brand; private Address billingAddress; private VaultCardVerificationMethod verificationMethod; - private SetupTokenCardExperienceContext experienceContext; + private VaultCardExperienceContext experienceContext; /** * Default constructor. @@ -38,7 +38,7 @@ public SetupTokenRequestCard() { * @param brand CardBrand value for brand. * @param billingAddress Address value for billingAddress. * @param verificationMethod VaultCardVerificationMethod value for verificationMethod. - * @param experienceContext SetupTokenCardExperienceContext value for experienceContext. + * @param experienceContext VaultCardExperienceContext value for experienceContext. */ public SetupTokenRequestCard( String name, @@ -48,7 +48,7 @@ public SetupTokenRequestCard( CardBrand brand, Address billingAddress, VaultCardVerificationMethod verificationMethod, - SetupTokenCardExperienceContext experienceContext) { + VaultCardExperienceContext experienceContext) { this.name = name; this.number = number; this.expiry = expiry; @@ -218,22 +218,22 @@ public void setVerificationMethod(VaultCardVerificationMethod verificationMethod /** * Getter for ExperienceContext. - * Customizes the Vault creation flow experience for your customers. - * @return Returns the SetupTokenCardExperienceContext + * A resource representing an experience context of vault a card. + * @return Returns the VaultCardExperienceContext */ @JsonGetter("experience_context") @JsonInclude(JsonInclude.Include.NON_NULL) - public SetupTokenCardExperienceContext getExperienceContext() { + public VaultCardExperienceContext getExperienceContext() { return experienceContext; } /** * Setter for ExperienceContext. - * Customizes the Vault creation flow experience for your customers. - * @param experienceContext Value for SetupTokenCardExperienceContext + * A resource representing an experience context of vault a card. + * @param experienceContext Value for VaultCardExperienceContext */ @JsonSetter("experience_context") - public void setExperienceContext(SetupTokenCardExperienceContext experienceContext) { + public void setExperienceContext(VaultCardExperienceContext experienceContext) { this.experienceContext = experienceContext; } @@ -278,7 +278,7 @@ public static class Builder { private CardBrand brand; private Address billingAddress; private VaultCardVerificationMethod verificationMethod; - private SetupTokenCardExperienceContext experienceContext; + private VaultCardExperienceContext experienceContext; @@ -354,10 +354,10 @@ public Builder verificationMethod(VaultCardVerificationMethod verificationMethod /** * Setter for experienceContext. - * @param experienceContext SetupTokenCardExperienceContext value for experienceContext. + * @param experienceContext VaultCardExperienceContext value for experienceContext. * @return Builder */ - public Builder experienceContext(SetupTokenCardExperienceContext experienceContext) { + public Builder experienceContext(VaultCardExperienceContext experienceContext) { this.experienceContext = experienceContext; return this; } diff --git a/src/main/java/com/paypal/sdk/models/SetupTokenRequestPaymentSource.java b/src/main/java/com/paypal/sdk/models/SetupTokenRequestPaymentSource.java index 7400bb3..017411c 100644 --- a/src/main/java/com/paypal/sdk/models/SetupTokenRequestPaymentSource.java +++ b/src/main/java/com/paypal/sdk/models/SetupTokenRequestPaymentSource.java @@ -17,7 +17,9 @@ public class SetupTokenRequestPaymentSource { private SetupTokenRequestCard card; private VaultPaypalWalletRequest paypal; private VaultVenmoRequest venmo; + private VaultApplePayRequest applePay; private VaultTokenRequest token; + private BankRequest bank; /** * Default constructor. @@ -30,17 +32,23 @@ public SetupTokenRequestPaymentSource() { * @param card SetupTokenRequestCard value for card. * @param paypal VaultPaypalWalletRequest value for paypal. * @param venmo VaultVenmoRequest value for venmo. + * @param applePay VaultApplePayRequest value for applePay. * @param token VaultTokenRequest value for token. + * @param bank BankRequest value for bank. */ public SetupTokenRequestPaymentSource( SetupTokenRequestCard card, VaultPaypalWalletRequest paypal, VaultVenmoRequest venmo, - VaultTokenRequest token) { + VaultApplePayRequest applePay, + VaultTokenRequest token, + BankRequest bank) { this.card = card; this.paypal = paypal; this.venmo = venmo; + this.applePay = applePay; this.token = token; + this.bank = bank; } /** @@ -87,6 +95,7 @@ public void setPaypal(VaultPaypalWalletRequest paypal) { /** * Getter for Venmo. + * A resource representing a request to vault Venmo. * @return Returns the VaultVenmoRequest */ @JsonGetter("venmo") @@ -97,6 +106,7 @@ public VaultVenmoRequest getVenmo() { /** * Setter for Venmo. + * A resource representing a request to vault Venmo. * @param venmo Value for VaultVenmoRequest */ @JsonSetter("venmo") @@ -104,6 +114,27 @@ public void setVenmo(VaultVenmoRequest venmo) { this.venmo = venmo; } + /** + * Getter for ApplePay. + * A resource representing a request to vault Apple Pay. + * @return Returns the VaultApplePayRequest + */ + @JsonGetter("apple_pay") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VaultApplePayRequest getApplePay() { + return applePay; + } + + /** + * Setter for ApplePay. + * A resource representing a request to vault Apple Pay. + * @param applePay Value for VaultApplePayRequest + */ + @JsonSetter("apple_pay") + public void setApplePay(VaultApplePayRequest applePay) { + this.applePay = applePay; + } + /** * Getter for Token. * The Tokenized Payment Source representing a Request to Vault a Token. @@ -125,6 +156,27 @@ public void setToken(VaultTokenRequest token) { this.token = token; } + /** + * Getter for Bank. + * A Resource representing a request to vault a Bank used for ACH Debit. + * @return Returns the BankRequest + */ + @JsonGetter("bank") + @JsonInclude(JsonInclude.Include.NON_NULL) + public BankRequest getBank() { + return bank; + } + + /** + * Setter for Bank. + * A Resource representing a request to vault a Bank used for ACH Debit. + * @param bank Value for BankRequest + */ + @JsonSetter("bank") + public void setBank(BankRequest bank) { + this.bank = bank; + } + /** * Converts this SetupTokenRequestPaymentSource into string format. * @return String representation of this class @@ -132,7 +184,8 @@ public void setToken(VaultTokenRequest token) { @Override public String toString() { return "SetupTokenRequestPaymentSource [" + "card=" + card + ", paypal=" + paypal - + ", venmo=" + venmo + ", token=" + token + "]"; + + ", venmo=" + venmo + ", applePay=" + applePay + ", token=" + token + ", bank=" + + bank + "]"; } /** @@ -145,7 +198,9 @@ public Builder toBuilder() { .card(getCard()) .paypal(getPaypal()) .venmo(getVenmo()) - .token(getToken()); + .applePay(getApplePay()) + .token(getToken()) + .bank(getBank()); return builder; } @@ -156,7 +211,9 @@ public static class Builder { private SetupTokenRequestCard card; private VaultPaypalWalletRequest paypal; private VaultVenmoRequest venmo; + private VaultApplePayRequest applePay; private VaultTokenRequest token; + private BankRequest bank; @@ -190,6 +247,16 @@ public Builder venmo(VaultVenmoRequest venmo) { return this; } + /** + * Setter for applePay. + * @param applePay VaultApplePayRequest value for applePay. + * @return Builder + */ + public Builder applePay(VaultApplePayRequest applePay) { + this.applePay = applePay; + return this; + } + /** * Setter for token. * @param token VaultTokenRequest value for token. @@ -200,12 +267,22 @@ public Builder token(VaultTokenRequest token) { return this; } + /** + * Setter for bank. + * @param bank BankRequest value for bank. + * @return Builder + */ + public Builder bank(BankRequest bank) { + this.bank = bank; + return this; + } + /** * Builds a new {@link SetupTokenRequestPaymentSource} object using the set fields. * @return {@link SetupTokenRequestPaymentSource} */ public SetupTokenRequestPaymentSource build() { - return new SetupTokenRequestPaymentSource(card, paypal, venmo, token); + return new SetupTokenRequestPaymentSource(card, paypal, venmo, applePay, token, bank); } } } diff --git a/src/main/java/com/paypal/sdk/models/SetupTokenResponse.java b/src/main/java/com/paypal/sdk/models/SetupTokenResponse.java index 76c209a..34e8eb9 100644 --- a/src/main/java/com/paypal/sdk/models/SetupTokenResponse.java +++ b/src/main/java/com/paypal/sdk/models/SetupTokenResponse.java @@ -51,7 +51,8 @@ public SetupTokenResponse( /** * Getter for Id. - * The PayPal-generated ID for the vault token. + * The PayPal-generated ID for the vaulted payment source. This ID should be stored on the + * merchant's server so the saved payment source can be used for future transactions. * @return Returns the String */ @JsonGetter("id") @@ -62,7 +63,8 @@ public String getId() { /** * Setter for Id. - * The PayPal-generated ID for the vault token. + * The PayPal-generated ID for the vaulted payment source. This ID should be stored on the + * merchant's server so the saved payment source can be used for future transactions. * @param id Value for String */ @JsonSetter("id") diff --git a/src/main/java/com/paypal/sdk/models/SetupTokenResponsePaymentSource.java b/src/main/java/com/paypal/sdk/models/SetupTokenResponsePaymentSource.java index 3a2ff2f..6d3bf03 100644 --- a/src/main/java/com/paypal/sdk/models/SetupTokenResponsePaymentSource.java +++ b/src/main/java/com/paypal/sdk/models/SetupTokenResponsePaymentSource.java @@ -60,6 +60,7 @@ public void setCard(SetupTokenResponseCard card) { /** * Getter for Paypal. + * Full representation of a PayPal Payment Token. * @return Returns the PaypalPaymentToken */ @JsonGetter("paypal") @@ -70,6 +71,7 @@ public PaypalPaymentToken getPaypal() { /** * Setter for Paypal. + * Full representation of a PayPal Payment Token. * @param paypal Value for PaypalPaymentToken */ @JsonSetter("paypal") @@ -79,6 +81,7 @@ public void setPaypal(PaypalPaymentToken paypal) { /** * Getter for Venmo. + * Full representation of a Venmo Payment Token. * @return Returns the VenmoPaymentToken */ @JsonGetter("venmo") @@ -89,6 +92,7 @@ public VenmoPaymentToken getVenmo() { /** * Setter for Venmo. + * Full representation of a Venmo Payment Token. * @param venmo Value for VenmoPaymentToken */ @JsonSetter("venmo") diff --git a/src/main/java/com/paypal/sdk/models/ShipmentCarrier.java b/src/main/java/com/paypal/sdk/models/ShipmentCarrier.java index 5824639..ec2a44c 100644 --- a/src/main/java/com/paypal/sdk/models/ShipmentCarrier.java +++ b/src/main/java/com/paypal/sdk/models/ShipmentCarrier.java @@ -6897,6 +6897,186 @@ public enum ShipmentCarrier { */ SPEDISCI, + /** + * Fourkites. + */ + FOURKITES, + + /** + * Etonas. + */ + ETONAS, + + /** + * Fin Mile. + */ + FINMILE, + + /** + * Uniuni. + */ + UNIUNI, + + /** + * Rodonaves. + */ + RODONAVES, + + /** + * Inpost Italy. + */ + INPOST_IT, + + /** + * Tforce Freight. + */ + TFORCE_FREIGHT, + + /** + * Rich Mom. + */ + RICHMOM, + + /** + * Corriere Franco. + */ + FRANCO, + + /** + * Ecparcel. + */ + ECPARCEL, + + /** + * Fedex China. + */ + FEDEX_CHINA, + + /** + * Gofo Express. + */ + GOFO_EXPRESS, + + /** + * Shipbob. + */ + SHIPBOB, + + /** + * Jersey Post Group. + */ + JERSEYPOST_ATLAS, + + /** + * Coretrails. + */ + CORETRAILS, + + /** + * Rhenus Logistics Italy. + */ + RHENUS_ITALY, + + /** + * Jadlog. + */ + JADLOG, + + /** + * Jitsu. + */ + JITSU, + + /** + * Yanwen Express. + */ + YANWEN_EXPRESS, + + /** + * Dashlink. + */ + DASHLINK, + + /** + * Seino Super Express. + */ + SEINO_SUPER_EXPRESS, + + /** + * Floship. + */ + FLOSHIP, + + /** + * Metro Supply Chain. + */ + METROSCG, + + /** + * Sendparcel. + */ + SENDPARCEL, + + /** + * P2p. + */ + P2P, + + /** + * Cn Express. + */ + CN_EXPRESS, + + /** + * Cirro Track. + */ + CIRROTRACK, + + /** + * Land Logistics. + */ + LAND_LOGISTICS, + + /** + * Veho. + */ + VEHO, + + /** + * Medline. + */ + MEDLINE, + + /** + * Vdtrack. + */ + VDTRACK, + + /** + * Sino Scm. + */ + SINO_SCM, + + /** + * 3pe Express. + */ + ENUM_3PE_EXPRESS, + + /** + * Swiftx. + */ + SWIFTX, + + /** + * Sfyd Express. + */ + SFYDEXPRESS, + + /** + * Toptrans. + */ + TOPTRANS, + /** * Unknown values will be mapped by this enum member */ @@ -8283,6 +8463,42 @@ public enum ShipmentCarrier { UPS_CHECKER.value = "UPS_CHECKER"; WINESHIPPING.value = "WINESHIPPING"; SPEDISCI.value = "SPEDISCI"; + FOURKITES.value = "FOURKITES"; + ETONAS.value = "ETONAS"; + FINMILE.value = "FINMILE"; + UNIUNI.value = "UNIUNI"; + RODONAVES.value = "RODONAVES"; + INPOST_IT.value = "INPOST_IT"; + TFORCE_FREIGHT.value = "TFORCE_FREIGHT"; + RICHMOM.value = "RICHMOM"; + FRANCO.value = "FRANCO"; + ECPARCEL.value = "ECPARCEL"; + FEDEX_CHINA.value = "FEDEX_CHINA"; + GOFO_EXPRESS.value = "GOFO_EXPRESS"; + SHIPBOB.value = "SHIPBOB"; + JERSEYPOST_ATLAS.value = "JERSEYPOST_ATLAS"; + CORETRAILS.value = "CORETRAILS"; + RHENUS_ITALY.value = "RHENUS_ITALY"; + JADLOG.value = "JADLOG"; + JITSU.value = "JITSU"; + YANWEN_EXPRESS.value = "YANWEN_EXPRESS"; + DASHLINK.value = "DASHLINK"; + SEINO_SUPER_EXPRESS.value = "SEINO_SUPER_EXPRESS"; + FLOSHIP.value = "FLOSHIP"; + METROSCG.value = "METROSCG"; + SENDPARCEL.value = "SENDPARCEL"; + P2P.value = "P2P"; + CN_EXPRESS.value = "CN_EXPRESS"; + CIRROTRACK.value = "CIRROTRACK"; + LAND_LOGISTICS.value = "LAND_LOGISTICS"; + VEHO.value = "VEHO"; + MEDLINE.value = "MEDLINE"; + VDTRACK.value = "VDTRACK"; + SINO_SCM.value = "SINO_SCM"; + ENUM_3PE_EXPRESS.value = "3PE_EXPRESS"; + SWIFTX.value = "SWIFTX"; + SFYDEXPRESS.value = "SFYDEXPRESS"; + TOPTRANS.value = "TOPTRANS"; _UNKNOWN.value = null; valueMap.put("DPD_RU", DPD_RU); @@ -9661,6 +9877,42 @@ public enum ShipmentCarrier { valueMap.put("UPS_CHECKER", UPS_CHECKER); valueMap.put("WINESHIPPING", WINESHIPPING); valueMap.put("SPEDISCI", SPEDISCI); + valueMap.put("FOURKITES", FOURKITES); + valueMap.put("ETONAS", ETONAS); + valueMap.put("FINMILE", FINMILE); + valueMap.put("UNIUNI", UNIUNI); + valueMap.put("RODONAVES", RODONAVES); + valueMap.put("INPOST_IT", INPOST_IT); + valueMap.put("TFORCE_FREIGHT", TFORCE_FREIGHT); + valueMap.put("RICHMOM", RICHMOM); + valueMap.put("FRANCO", FRANCO); + valueMap.put("ECPARCEL", ECPARCEL); + valueMap.put("FEDEX_CHINA", FEDEX_CHINA); + valueMap.put("GOFO_EXPRESS", GOFO_EXPRESS); + valueMap.put("SHIPBOB", SHIPBOB); + valueMap.put("JERSEYPOST_ATLAS", JERSEYPOST_ATLAS); + valueMap.put("CORETRAILS", CORETRAILS); + valueMap.put("RHENUS_ITALY", RHENUS_ITALY); + valueMap.put("JADLOG", JADLOG); + valueMap.put("JITSU", JITSU); + valueMap.put("YANWEN_EXPRESS", YANWEN_EXPRESS); + valueMap.put("DASHLINK", DASHLINK); + valueMap.put("SEINO_SUPER_EXPRESS", SEINO_SUPER_EXPRESS); + valueMap.put("FLOSHIP", FLOSHIP); + valueMap.put("METROSCG", METROSCG); + valueMap.put("SENDPARCEL", SENDPARCEL); + valueMap.put("P2P", P2P); + valueMap.put("CN_EXPRESS", CN_EXPRESS); + valueMap.put("CIRROTRACK", CIRROTRACK); + valueMap.put("LAND_LOGISTICS", LAND_LOGISTICS); + valueMap.put("VEHO", VEHO); + valueMap.put("MEDLINE", MEDLINE); + valueMap.put("VDTRACK", VDTRACK); + valueMap.put("SINO_SCM", SINO_SCM); + valueMap.put("3PE_EXPRESS", ENUM_3PE_EXPRESS); + valueMap.put("SWIFTX", SWIFTX); + valueMap.put("SFYDEXPRESS", SFYDEXPRESS); + valueMap.put("TOPTRANS", TOPTRANS); } /** diff --git a/src/main/java/com/paypal/sdk/models/ShippingInformation.java b/src/main/java/com/paypal/sdk/models/ShippingInformation.java new file mode 100644 index 0000000..9263425 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/ShippingInformation.java @@ -0,0 +1,220 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ShippingInformation type. + */ +public class ShippingInformation { + private String name; + private String method; + private SimplePostalAddressCoarseGrained address; + private SimplePostalAddressCoarseGrained secondaryShippingAddress; + + /** + * Default constructor. + */ + public ShippingInformation() { + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param method String value for method. + * @param address SimplePostalAddressCoarseGrained value for address. + * @param secondaryShippingAddress SimplePostalAddressCoarseGrained value for + * secondaryShippingAddress. + */ + public ShippingInformation( + String name, + String method, + SimplePostalAddressCoarseGrained address, + SimplePostalAddressCoarseGrained secondaryShippingAddress) { + this.name = name; + this.method = method; + this.address = address; + this.secondaryShippingAddress = secondaryShippingAddress; + } + + /** + * Getter for Name. + * The recipient's name. + * @return Returns the String + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getName() { + return name; + } + + /** + * Setter for Name. + * The recipient's name. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for Method. + * The shipping method that is associated with this order. + * @return Returns the String + */ + @JsonGetter("method") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getMethod() { + return method; + } + + /** + * Setter for Method. + * The shipping method that is associated with this order. + * @param method Value for String + */ + @JsonSetter("method") + public void setMethod(String method) { + this.method = method; + } + + /** + * Getter for Address. + * A simple postal address with coarse-grained fields. Do not use for an international address. + * Use for backward compatibility only. Does not contain phone. + * @return Returns the SimplePostalAddressCoarseGrained + */ + @JsonGetter("address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SimplePostalAddressCoarseGrained getAddress() { + return address; + } + + /** + * Setter for Address. + * A simple postal address with coarse-grained fields. Do not use for an international address. + * Use for backward compatibility only. Does not contain phone. + * @param address Value for SimplePostalAddressCoarseGrained + */ + @JsonSetter("address") + public void setAddress(SimplePostalAddressCoarseGrained address) { + this.address = address; + } + + /** + * Getter for SecondaryShippingAddress. + * A simple postal address with coarse-grained fields. Do not use for an international address. + * Use for backward compatibility only. Does not contain phone. + * @return Returns the SimplePostalAddressCoarseGrained + */ + @JsonGetter("secondary_shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SimplePostalAddressCoarseGrained getSecondaryShippingAddress() { + return secondaryShippingAddress; + } + + /** + * Setter for SecondaryShippingAddress. + * A simple postal address with coarse-grained fields. Do not use for an international address. + * Use for backward compatibility only. Does not contain phone. + * @param secondaryShippingAddress Value for SimplePostalAddressCoarseGrained + */ + @JsonSetter("secondary_shipping_address") + public void setSecondaryShippingAddress(SimplePostalAddressCoarseGrained secondaryShippingAddress) { + this.secondaryShippingAddress = secondaryShippingAddress; + } + + /** + * Converts this ShippingInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ShippingInformation [" + "name=" + name + ", method=" + method + ", address=" + + address + ", secondaryShippingAddress=" + secondaryShippingAddress + "]"; + } + + /** + * Builds a new {@link ShippingInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ShippingInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .name(getName()) + .method(getMethod()) + .address(getAddress()) + .secondaryShippingAddress(getSecondaryShippingAddress()); + return builder; + } + + /** + * Class to build instances of {@link ShippingInformation}. + */ + public static class Builder { + private String name; + private String method; + private SimplePostalAddressCoarseGrained address; + private SimplePostalAddressCoarseGrained secondaryShippingAddress; + + + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for method. + * @param method String value for method. + * @return Builder + */ + public Builder method(String method) { + this.method = method; + return this; + } + + /** + * Setter for address. + * @param address SimplePostalAddressCoarseGrained value for address. + * @return Builder + */ + public Builder address(SimplePostalAddressCoarseGrained address) { + this.address = address; + return this; + } + + /** + * Setter for secondaryShippingAddress. + * @param secondaryShippingAddress SimplePostalAddressCoarseGrained value for + * secondaryShippingAddress. + * @return Builder + */ + public Builder secondaryShippingAddress( + SimplePostalAddressCoarseGrained secondaryShippingAddress) { + this.secondaryShippingAddress = secondaryShippingAddress; + return this; + } + + /** + * Builds a new {@link ShippingInformation} object using the set fields. + * @return {@link ShippingInformation} + */ + public ShippingInformation build() { + return new ShippingInformation(name, method, address, secondaryShippingAddress); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/ShippingOptionsPurchaseUnit.java b/src/main/java/com/paypal/sdk/models/ShippingOptionsPurchaseUnit.java deleted file mode 100644 index 7d3ba6f..0000000 --- a/src/main/java/com/paypal/sdk/models/ShippingOptionsPurchaseUnit.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; -import java.util.List; - -/** - * This is a model class for ShippingOptionsPurchaseUnit type. - */ -public class ShippingOptionsPurchaseUnit { - private String referenceId; - private AmountWithBreakdown amount; - private List items; - private List shippingOptions; - - /** - * Default constructor. - */ - public ShippingOptionsPurchaseUnit() { - } - - /** - * Initialization constructor. - * @param referenceId String value for referenceId. - * @param amount AmountWithBreakdown value for amount. - * @param items List of Item value for items. - * @param shippingOptions List of ShippingOption value for shippingOptions. - */ - public ShippingOptionsPurchaseUnit( - String referenceId, - AmountWithBreakdown amount, - List items, - List shippingOptions) { - this.referenceId = referenceId; - this.amount = amount; - this.items = items; - this.shippingOptions = shippingOptions; - } - - /** - * Getter for ReferenceId. - * The API caller-provided external ID for the purchase unit. Required for multiple purchase - * units when you must update the order through `PATCH`. If you omit this value and the order - * contains only one purchase unit, PayPal sets this value to `default`. Note: If there are - * multiple purchase units, reference_id is required for each purchase unit. - * @return Returns the String - */ - @JsonGetter("reference_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getReferenceId() { - return referenceId; - } - - /** - * Setter for ReferenceId. - * The API caller-provided external ID for the purchase unit. Required for multiple purchase - * units when you must update the order through `PATCH`. If you omit this value and the order - * contains only one purchase unit, PayPal sets this value to `default`. Note: If there are - * multiple purchase units, reference_id is required for each purchase unit. - * @param referenceId Value for String - */ - @JsonSetter("reference_id") - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; - } - - /** - * Getter for Amount. - * The total order amount with an optional breakdown that provides details, such as the total - * item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you - * specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` - * plus `handling` plus `insurance` minus `shipping_discount` minus discount. The amount must be - * a positive number. For listed of supported currencies and decimal precision, see the PayPal - * REST APIs Currency Codes. - * @return Returns the AmountWithBreakdown - */ - @JsonGetter("amount") - @JsonInclude(JsonInclude.Include.NON_NULL) - public AmountWithBreakdown getAmount() { - return amount; - } - - /** - * Setter for Amount. - * The total order amount with an optional breakdown that provides details, such as the total - * item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you - * specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` - * plus `handling` plus `insurance` minus `shipping_discount` minus discount. The amount must be - * a positive number. For listed of supported currencies and decimal precision, see the PayPal - * REST APIs Currency Codes. - * @param amount Value for AmountWithBreakdown - */ - @JsonSetter("amount") - public void setAmount(AmountWithBreakdown amount) { - this.amount = amount; - } - - /** - * Getter for Items. - * An array of items that the customer purchases from the merchant. - * @return Returns the List of Item - */ - @JsonGetter("items") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getItems() { - return items; - } - - /** - * Setter for Items. - * An array of items that the customer purchases from the merchant. - * @param items Value for List of Item - */ - @JsonSetter("items") - public void setItems(List items) { - this.items = items; - } - - /** - * Getter for ShippingOptions. - * An array of shipping options that the payee or merchant offers to the payer to ship or pick - * up their items. - * @return Returns the List of ShippingOption - */ - @JsonGetter("shipping_options") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getShippingOptions() { - return shippingOptions; - } - - /** - * Setter for ShippingOptions. - * An array of shipping options that the payee or merchant offers to the payer to ship or pick - * up their items. - * @param shippingOptions Value for List of ShippingOption - */ - @JsonSetter("shipping_options") - public void setShippingOptions(List shippingOptions) { - this.shippingOptions = shippingOptions; - } - - /** - * Converts this ShippingOptionsPurchaseUnit into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "ShippingOptionsPurchaseUnit [" + "referenceId=" + referenceId + ", amount=" + amount - + ", items=" + items + ", shippingOptions=" + shippingOptions + "]"; - } - - /** - * Builds a new {@link ShippingOptionsPurchaseUnit.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link ShippingOptionsPurchaseUnit.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .referenceId(getReferenceId()) - .amount(getAmount()) - .items(getItems()) - .shippingOptions(getShippingOptions()); - return builder; - } - - /** - * Class to build instances of {@link ShippingOptionsPurchaseUnit}. - */ - public static class Builder { - private String referenceId; - private AmountWithBreakdown amount; - private List items; - private List shippingOptions; - - - - /** - * Setter for referenceId. - * @param referenceId String value for referenceId. - * @return Builder - */ - public Builder referenceId(String referenceId) { - this.referenceId = referenceId; - return this; - } - - /** - * Setter for amount. - * @param amount AmountWithBreakdown value for amount. - * @return Builder - */ - public Builder amount(AmountWithBreakdown amount) { - this.amount = amount; - return this; - } - - /** - * Setter for items. - * @param items List of Item value for items. - * @return Builder - */ - public Builder items(List items) { - this.items = items; - return this; - } - - /** - * Setter for shippingOptions. - * @param shippingOptions List of ShippingOption value for shippingOptions. - * @return Builder - */ - public Builder shippingOptions(List shippingOptions) { - this.shippingOptions = shippingOptions; - return this; - } - - /** - * Builds a new {@link ShippingOptionsPurchaseUnit} object using the set fields. - * @return {@link ShippingOptionsPurchaseUnit} - */ - public ShippingOptionsPurchaseUnit build() { - return new ShippingOptionsPurchaseUnit(referenceId, amount, items, shippingOptions); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/ShippingWithTrackingDetails.java b/src/main/java/com/paypal/sdk/models/ShippingWithTrackingDetails.java index 89c37d7..abf61e3 100644 --- a/src/main/java/com/paypal/sdk/models/ShippingWithTrackingDetails.java +++ b/src/main/java/com/paypal/sdk/models/ShippingWithTrackingDetails.java @@ -15,13 +15,13 @@ * This is a model class for ShippingWithTrackingDetails type. */ public class ShippingWithTrackingDetails { + private List trackers; private ShippingName name; private String emailAddress; - private PhoneNumberWithCountryCode phoneNumber; + private PhoneNumberWithOptionalCountryCode phoneNumber; private FulfillmentType type; private List options; private Address address; - private List trackers; /** * Default constructor. @@ -31,28 +31,49 @@ public ShippingWithTrackingDetails() { /** * Initialization constructor. + * @param trackers List of OrderTrackerResponse value for trackers. * @param name ShippingName value for name. * @param emailAddress String value for emailAddress. - * @param phoneNumber PhoneNumberWithCountryCode value for phoneNumber. + * @param phoneNumber PhoneNumberWithOptionalCountryCode value for phoneNumber. * @param type FulfillmentType value for type. * @param options List of ShippingOption value for options. * @param address Address value for address. - * @param trackers List of OrderTrackerResponse value for trackers. */ public ShippingWithTrackingDetails( + List trackers, ShippingName name, String emailAddress, - PhoneNumberWithCountryCode phoneNumber, + PhoneNumberWithOptionalCountryCode phoneNumber, FulfillmentType type, List options, - Address address, - List trackers) { + Address address) { + this.trackers = trackers; this.name = name; this.emailAddress = emailAddress; this.phoneNumber = phoneNumber; this.type = type; this.options = options; this.address = address; + } + + /** + * Getter for Trackers. + * An array of trackers for a transaction. + * @return Returns the List of OrderTrackerResponse + */ + @JsonGetter("trackers") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTrackers() { + return trackers; + } + + /** + * Setter for Trackers. + * An array of trackers for a transaction. + * @param trackers Value for List of OrderTrackerResponse + */ + @JsonSetter("trackers") + public void setTrackers(List trackers) { this.trackers = trackers; } @@ -106,11 +127,11 @@ public void setEmailAddress(String emailAddress) { * Getter for PhoneNumber. * The phone number in its canonical international [E.164 numbering plan * format](https://www.itu.int/rec/T-REC-E.164/en). - * @return Returns the PhoneNumberWithCountryCode + * @return Returns the PhoneNumberWithOptionalCountryCode */ @JsonGetter("phone_number") @JsonInclude(JsonInclude.Include.NON_NULL) - public PhoneNumberWithCountryCode getPhoneNumber() { + public PhoneNumberWithOptionalCountryCode getPhoneNumber() { return phoneNumber; } @@ -118,10 +139,10 @@ public PhoneNumberWithCountryCode getPhoneNumber() { * Setter for PhoneNumber. * The phone number in its canonical international [E.164 numbering plan * format](https://www.itu.int/rec/T-REC-E.164/en). - * @param phoneNumber Value for PhoneNumberWithCountryCode + * @param phoneNumber Value for PhoneNumberWithOptionalCountryCode */ @JsonSetter("phone_number") - public void setPhoneNumber(PhoneNumberWithCountryCode phoneNumber) { + public void setPhoneNumber(PhoneNumberWithOptionalCountryCode phoneNumber) { this.phoneNumber = phoneNumber; } @@ -198,36 +219,15 @@ public void setAddress(Address address) { this.address = address; } - /** - * Getter for Trackers. - * An array of trackers for a transaction. - * @return Returns the List of OrderTrackerResponse - */ - @JsonGetter("trackers") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getTrackers() { - return trackers; - } - - /** - * Setter for Trackers. - * An array of trackers for a transaction. - * @param trackers Value for List of OrderTrackerResponse - */ - @JsonSetter("trackers") - public void setTrackers(List trackers) { - this.trackers = trackers; - } - /** * Converts this ShippingWithTrackingDetails into string format. * @return String representation of this class */ @Override public String toString() { - return "ShippingWithTrackingDetails [" + "name=" + name + ", emailAddress=" + emailAddress - + ", phoneNumber=" + phoneNumber + ", type=" + type + ", options=" + options - + ", address=" + address + ", trackers=" + trackers + "]"; + return "ShippingWithTrackingDetails [" + "trackers=" + trackers + ", name=" + name + + ", emailAddress=" + emailAddress + ", phoneNumber=" + phoneNumber + ", type=" + + type + ", options=" + options + ", address=" + address + "]"; } /** @@ -237,13 +237,13 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder() + .trackers(getTrackers()) .name(getName()) .emailAddress(getEmailAddress()) .phoneNumber(getPhoneNumber()) .type(getType()) .options(getOptions()) - .address(getAddress()) - .trackers(getTrackers()); + .address(getAddress()); return builder; } @@ -251,16 +251,26 @@ public Builder toBuilder() { * Class to build instances of {@link ShippingWithTrackingDetails}. */ public static class Builder { + private List trackers; private ShippingName name; private String emailAddress; - private PhoneNumberWithCountryCode phoneNumber; + private PhoneNumberWithOptionalCountryCode phoneNumber; private FulfillmentType type; private List options; private Address address; - private List trackers; + /** + * Setter for trackers. + * @param trackers List of OrderTrackerResponse value for trackers. + * @return Builder + */ + public Builder trackers(List trackers) { + this.trackers = trackers; + return this; + } + /** * Setter for name. * @param name ShippingName value for name. @@ -283,10 +293,10 @@ public Builder emailAddress(String emailAddress) { /** * Setter for phoneNumber. - * @param phoneNumber PhoneNumberWithCountryCode value for phoneNumber. + * @param phoneNumber PhoneNumberWithOptionalCountryCode value for phoneNumber. * @return Builder */ - public Builder phoneNumber(PhoneNumberWithCountryCode phoneNumber) { + public Builder phoneNumber(PhoneNumberWithOptionalCountryCode phoneNumber) { this.phoneNumber = phoneNumber; return this; } @@ -321,23 +331,13 @@ public Builder address(Address address) { return this; } - /** - * Setter for trackers. - * @param trackers List of OrderTrackerResponse value for trackers. - * @return Builder - */ - public Builder trackers(List trackers) { - this.trackers = trackers; - return this; - } - /** * Builds a new {@link ShippingWithTrackingDetails} object using the set fields. * @return {@link ShippingWithTrackingDetails} */ public ShippingWithTrackingDetails build() { - return new ShippingWithTrackingDetails(name, emailAddress, phoneNumber, type, options, - address, trackers); + return new ShippingWithTrackingDetails(trackers, name, emailAddress, phoneNumber, type, + options, address); } } } diff --git a/src/main/java/com/paypal/sdk/models/SimplePostalAddressCoarseGrained.java b/src/main/java/com/paypal/sdk/models/SimplePostalAddressCoarseGrained.java new file mode 100644 index 0000000..fcf3ed7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SimplePostalAddressCoarseGrained.java @@ -0,0 +1,331 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SimplePostalAddressCoarseGrained type. + */ +public class SimplePostalAddressCoarseGrained { + private String line1; + private String line2; + private String city; + private String state; + private String countryCode; + private String postalCode; + + /** + * Default constructor. + */ + public SimplePostalAddressCoarseGrained() { + } + + /** + * Initialization constructor. + * @param line1 String value for line1. + * @param city String value for city. + * @param countryCode String value for countryCode. + * @param line2 String value for line2. + * @param state String value for state. + * @param postalCode String value for postalCode. + */ + public SimplePostalAddressCoarseGrained( + String line1, + String city, + String countryCode, + String line2, + String state, + String postalCode) { + this.line1 = line1; + this.line2 = line2; + this.city = city; + this.state = state; + this.countryCode = countryCode; + this.postalCode = postalCode; + } + + /** + * Getter for Line1. + * The first line of the address. For example, number or street. + * @return Returns the String + */ + @JsonGetter("line1") + public String getLine1() { + return line1; + } + + /** + * Setter for Line1. + * The first line of the address. For example, number or street. + * @param line1 Value for String + */ + @JsonSetter("line1") + public void setLine1(String line1) { + this.line1 = line1; + } + + /** + * Getter for Line2. + * The second line of the address. For example, suite or apartment number. + * @return Returns the String + */ + @JsonGetter("line2") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLine2() { + return line2; + } + + /** + * Setter for Line2. + * The second line of the address. For example, suite or apartment number. + * @param line2 Value for String + */ + @JsonSetter("line2") + public void setLine2(String line2) { + this.line2 = line2; + } + + /** + * Getter for City. + * The city name. + * @return Returns the String + */ + @JsonGetter("city") + public String getCity() { + return city; + } + + /** + * Setter for City. + * The city name. + * @param city Value for String + */ + @JsonSetter("city") + public void setCity(String city) { + this.city = city; + } + + /** + * Getter for State. + * The [code](/docs/api/reference/state-codes/) for a US state or the equivalent for other + * countries. Required for transactions if the address is in one of these countries: + * [Argentina](/docs/api/reference/state-codes/#argentina), + * [Brazil](/docs/api/reference/state-codes/#brazil), + * [Canada](/docs/api/reference/state-codes/#canada), + * [China](/docs/api/reference/state-codes/#china), + * [India](/docs/api/reference/state-codes/#india), + * [Italy](/docs/api/reference/state-codes/#italy), + * [Japan](/docs/api/reference/state-codes/#japan), + * [Mexico](/docs/api/reference/state-codes/#mexico), + * [Thailand](/docs/api/reference/state-codes/#thailand), or [United + * States](/docs/api/reference/state-codes/#usa). Maximum length is 40 single-byte characters. + * @return Returns the String + */ + @JsonGetter("state") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getState() { + return state; + } + + /** + * Setter for State. + * The [code](/docs/api/reference/state-codes/) for a US state or the equivalent for other + * countries. Required for transactions if the address is in one of these countries: + * [Argentina](/docs/api/reference/state-codes/#argentina), + * [Brazil](/docs/api/reference/state-codes/#brazil), + * [Canada](/docs/api/reference/state-codes/#canada), + * [China](/docs/api/reference/state-codes/#china), + * [India](/docs/api/reference/state-codes/#india), + * [Italy](/docs/api/reference/state-codes/#italy), + * [Japan](/docs/api/reference/state-codes/#japan), + * [Mexico](/docs/api/reference/state-codes/#mexico), + * [Thailand](/docs/api/reference/state-codes/#thailand), or [United + * States](/docs/api/reference/state-codes/#usa). Maximum length is 40 single-byte characters. + * @param state Value for String + */ + @JsonSetter("state") + public void setState(String state) { + this.state = state; + } + + /** + * Getter for CountryCode. + * 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. + * @return Returns the String + */ + @JsonGetter("country_code") + public String getCountryCode() { + return countryCode; + } + + /** + * Setter for CountryCode. + * 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. + * @param countryCode Value for String + */ + @JsonSetter("country_code") + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + /** + * Getter for PostalCode. + * 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). + * @return Returns the String + */ + @JsonGetter("postal_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPostalCode() { + return postalCode; + } + + /** + * Setter for PostalCode. + * 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). + * @param postalCode Value for String + */ + @JsonSetter("postal_code") + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + /** + * Converts this SimplePostalAddressCoarseGrained into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SimplePostalAddressCoarseGrained [" + "line1=" + line1 + ", city=" + city + + ", countryCode=" + countryCode + ", line2=" + line2 + ", state=" + state + + ", postalCode=" + postalCode + "]"; + } + + /** + * Builds a new {@link SimplePostalAddressCoarseGrained.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SimplePostalAddressCoarseGrained.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(line1, city, countryCode) + .line2(getLine2()) + .state(getState()) + .postalCode(getPostalCode()); + return builder; + } + + /** + * Class to build instances of {@link SimplePostalAddressCoarseGrained}. + */ + public static class Builder { + private String line1; + private String city; + private String countryCode; + private String line2; + private String state; + private String postalCode; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param line1 String value for line1. + * @param city String value for city. + * @param countryCode String value for countryCode. + */ + public Builder(String line1, String city, String countryCode) { + this.line1 = line1; + this.city = city; + this.countryCode = countryCode; + } + + /** + * Setter for line1. + * @param line1 String value for line1. + * @return Builder + */ + public Builder line1(String line1) { + this.line1 = line1; + return this; + } + + /** + * Setter for city. + * @param city String value for city. + * @return Builder + */ + public Builder city(String city) { + this.city = city; + return this; + } + + /** + * Setter for countryCode. + * @param countryCode String value for countryCode. + * @return Builder + */ + public Builder countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Setter for line2. + * @param line2 String value for line2. + * @return Builder + */ + public Builder line2(String line2) { + this.line2 = line2; + return this; + } + + /** + * Setter for state. + * @param state String value for state. + * @return Builder + */ + public Builder state(String state) { + this.state = state; + return this; + } + + /** + * Setter for postalCode. + * @param postalCode String value for postalCode. + * @return Builder + */ + public Builder postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Builds a new {@link SimplePostalAddressCoarseGrained} object using the set fields. + * @return {@link SimplePostalAddressCoarseGrained} + */ + public SimplePostalAddressCoarseGrained build() { + return new SimplePostalAddressCoarseGrained(line1, city, countryCode, line2, state, + postalCode); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/StoreInformation.java b/src/main/java/com/paypal/sdk/models/StoreInformation.java new file mode 100644 index 0000000..c3a6ece --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/StoreInformation.java @@ -0,0 +1,138 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for StoreInformation type. + */ +public class StoreInformation { + private String storeId; + private String terminalId; + + /** + * Default constructor. + */ + public StoreInformation() { + } + + /** + * Initialization constructor. + * @param storeId String value for storeId. + * @param terminalId String value for terminalId. + */ + public StoreInformation( + String storeId, + String terminalId) { + this.storeId = storeId; + this.terminalId = terminalId; + } + + /** + * Getter for StoreId. + * The ID of a store for a merchant in the system of record. + * @return Returns the String + */ + @JsonGetter("store_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStoreId() { + return storeId; + } + + /** + * Setter for StoreId. + * The ID of a store for a merchant in the system of record. + * @param storeId Value for String + */ + @JsonSetter("store_id") + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + * Getter for TerminalId. + * The terminal ID for the checkout stand in a merchant store. + * @return Returns the String + */ + @JsonGetter("terminal_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTerminalId() { + return terminalId; + } + + /** + * Setter for TerminalId. + * The terminal ID for the checkout stand in a merchant store. + * @param terminalId Value for String + */ + @JsonSetter("terminal_id") + public void setTerminalId(String terminalId) { + this.terminalId = terminalId; + } + + /** + * Converts this StoreInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "StoreInformation [" + "storeId=" + storeId + ", terminalId=" + terminalId + "]"; + } + + /** + * Builds a new {@link StoreInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link StoreInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .storeId(getStoreId()) + .terminalId(getTerminalId()); + return builder; + } + + /** + * Class to build instances of {@link StoreInformation}. + */ + public static class Builder { + private String storeId; + private String terminalId; + + + + /** + * Setter for storeId. + * @param storeId String value for storeId. + * @return Builder + */ + public Builder storeId(String storeId) { + this.storeId = storeId; + return this; + } + + /** + * Setter for terminalId. + * @param terminalId String value for terminalId. + * @return Builder + */ + public Builder terminalId(String terminalId) { + this.terminalId = terminalId; + return this; + } + + /** + * Builds a new {@link StoreInformation} object using the set fields. + * @return {@link StoreInformation} + */ + public StoreInformation build() { + return new StoreInformation(storeId, terminalId); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/StoredPaymentSource.java b/src/main/java/com/paypal/sdk/models/StoredPaymentSource.java index 503e699..c4a5476 100644 --- a/src/main/java/com/paypal/sdk/models/StoredPaymentSource.java +++ b/src/main/java/com/paypal/sdk/models/StoredPaymentSource.java @@ -17,7 +17,7 @@ public class StoredPaymentSource { private PaymentInitiator paymentInitiator; private StoredPaymentSourcePaymentType paymentType; private StoredPaymentSourceUsageType usage; - private NetworkTransactionReference previousNetworkTransactionReference; + private NetworkTransaction previousNetworkTransactionReference; /** * Default constructor. @@ -31,14 +31,14 @@ public StoredPaymentSource() { * @param paymentInitiator PaymentInitiator value for paymentInitiator. * @param paymentType StoredPaymentSourcePaymentType value for paymentType. * @param usage StoredPaymentSourceUsageType value for usage. - * @param previousNetworkTransactionReference NetworkTransactionReference value for + * @param previousNetworkTransactionReference NetworkTransaction value for * previousNetworkTransactionReference. */ public StoredPaymentSource( PaymentInitiator paymentInitiator, StoredPaymentSourcePaymentType paymentType, StoredPaymentSourceUsageType usage, - NetworkTransactionReference previousNetworkTransactionReference) { + NetworkTransaction previousNetworkTransactionReference) { this.paymentInitiator = paymentInitiator; this.paymentType = paymentType; this.usage = usage; @@ -111,21 +111,21 @@ public void setUsage(StoredPaymentSourceUsageType usage) { /** * Getter for PreviousNetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @return Returns the NetworkTransactionReference + * @return Returns the NetworkTransaction */ @JsonGetter("previous_network_transaction_reference") @JsonInclude(JsonInclude.Include.NON_NULL) - public NetworkTransactionReference getPreviousNetworkTransactionReference() { + public NetworkTransaction getPreviousNetworkTransactionReference() { return previousNetworkTransactionReference; } /** * Setter for PreviousNetworkTransactionReference. * Reference values used by the card network to identify a transaction. - * @param previousNetworkTransactionReference Value for NetworkTransactionReference + * @param previousNetworkTransactionReference Value for NetworkTransaction */ @JsonSetter("previous_network_transaction_reference") - public void setPreviousNetworkTransactionReference(NetworkTransactionReference previousNetworkTransactionReference) { + public void setPreviousNetworkTransactionReference(NetworkTransaction previousNetworkTransactionReference) { this.previousNetworkTransactionReference = previousNetworkTransactionReference; } @@ -159,7 +159,7 @@ public static class Builder { private PaymentInitiator paymentInitiator; private StoredPaymentSourcePaymentType paymentType; private StoredPaymentSourceUsageType usage = StoredPaymentSourceUsageType.DERIVED; - private NetworkTransactionReference previousNetworkTransactionReference; + private NetworkTransaction previousNetworkTransactionReference; /** * Initialization constructor. @@ -210,12 +210,12 @@ public Builder usage(StoredPaymentSourceUsageType usage) { /** * Setter for previousNetworkTransactionReference. - * @param previousNetworkTransactionReference NetworkTransactionReference value for + * @param previousNetworkTransactionReference NetworkTransaction value for * previousNetworkTransactionReference. * @return Builder */ public Builder previousNetworkTransactionReference( - NetworkTransactionReference previousNetworkTransactionReference) { + NetworkTransaction previousNetworkTransactionReference) { this.previousNetworkTransactionReference = previousNetworkTransactionReference; return this; } diff --git a/src/main/java/com/paypal/sdk/models/Subscriber.java b/src/main/java/com/paypal/sdk/models/Subscriber.java new file mode 100644 index 0000000..ade8005 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/Subscriber.java @@ -0,0 +1,176 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for Subscriber type. + */ +public class Subscriber { + private Name name; + private ShippingDetails shippingAddress; + private SubscriptionPaymentSourceResponse paymentSource; + + /** + * Default constructor. + */ + public Subscriber() { + } + + /** + * Initialization constructor. + * @param name Name value for name. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @param paymentSource SubscriptionPaymentSourceResponse value for paymentSource. + */ + public Subscriber( + Name name, + ShippingDetails shippingAddress, + SubscriptionPaymentSourceResponse paymentSource) { + this.name = name; + this.shippingAddress = shippingAddress; + this.paymentSource = paymentSource; + } + + /** + * Getter for Name. + * The name of the party. + * @return Returns the Name + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Name getName() { + return name; + } + + /** + * Setter for Name. + * The name of the party. + * @param name Value for Name + */ + @JsonSetter("name") + public void setName(Name name) { + this.name = name; + } + + /** + * Getter for ShippingAddress. + * The shipping details. + * @return Returns the ShippingDetails + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ShippingDetails getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * The shipping details. + * @param shippingAddress Value for ShippingDetails + */ + @JsonSetter("shipping_address") + public void setShippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for PaymentSource. + * The payment source used to fund the payment. + * @return Returns the SubscriptionPaymentSourceResponse + */ + @JsonGetter("payment_source") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPaymentSourceResponse getPaymentSource() { + return paymentSource; + } + + /** + * Setter for PaymentSource. + * The payment source used to fund the payment. + * @param paymentSource Value for SubscriptionPaymentSourceResponse + */ + @JsonSetter("payment_source") + public void setPaymentSource(SubscriptionPaymentSourceResponse paymentSource) { + this.paymentSource = paymentSource; + } + + /** + * Converts this Subscriber into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "Subscriber [" + "name=" + name + ", shippingAddress=" + shippingAddress + + ", paymentSource=" + paymentSource + "]"; + } + + /** + * Builds a new {@link Subscriber.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link Subscriber.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .name(getName()) + .shippingAddress(getShippingAddress()) + .paymentSource(getPaymentSource()); + return builder; + } + + /** + * Class to build instances of {@link Subscriber}. + */ + public static class Builder { + private Name name; + private ShippingDetails shippingAddress; + private SubscriptionPaymentSourceResponse paymentSource; + + + + /** + * Setter for name. + * @param name Name value for name. + * @return Builder + */ + public Builder name(Name name) { + this.name = name; + return this; + } + + /** + * Setter for shippingAddress. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @return Builder + */ + public Builder shippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Setter for paymentSource. + * @param paymentSource SubscriptionPaymentSourceResponse value for paymentSource. + * @return Builder + */ + public Builder paymentSource(SubscriptionPaymentSourceResponse paymentSource) { + this.paymentSource = paymentSource; + return this; + } + + /** + * Builds a new {@link Subscriber} object using the set fields. + * @return {@link Subscriber} + */ + public Subscriber build() { + return new Subscriber(name, shippingAddress, paymentSource); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriberRequest.java b/src/main/java/com/paypal/sdk/models/SubscriberRequest.java new file mode 100644 index 0000000..b58bbd9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriberRequest.java @@ -0,0 +1,217 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriberRequest type. + */ +public class SubscriberRequest { + private Name name; + private PhoneWithType phone; + private ShippingDetails shippingAddress; + private SubscriptionPaymentSource paymentSource; + + /** + * Default constructor. + */ + public SubscriberRequest() { + } + + /** + * Initialization constructor. + * @param name Name value for name. + * @param phone PhoneWithType value for phone. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @param paymentSource SubscriptionPaymentSource value for paymentSource. + */ + public SubscriberRequest( + Name name, + PhoneWithType phone, + ShippingDetails shippingAddress, + SubscriptionPaymentSource paymentSource) { + this.name = name; + this.phone = phone; + this.shippingAddress = shippingAddress; + this.paymentSource = paymentSource; + } + + /** + * Getter for Name. + * The name of the party. + * @return Returns the Name + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Name getName() { + return name; + } + + /** + * Setter for Name. + * The name of the party. + * @param name Value for Name + */ + @JsonSetter("name") + public void setName(Name name) { + this.name = name; + } + + /** + * Getter for Phone. + * The phone information. + * @return Returns the PhoneWithType + */ + @JsonGetter("phone") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PhoneWithType getPhone() { + return phone; + } + + /** + * Setter for Phone. + * The phone information. + * @param phone Value for PhoneWithType + */ + @JsonSetter("phone") + public void setPhone(PhoneWithType phone) { + this.phone = phone; + } + + /** + * Getter for ShippingAddress. + * The shipping details. + * @return Returns the ShippingDetails + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ShippingDetails getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * The shipping details. + * @param shippingAddress Value for ShippingDetails + */ + @JsonSetter("shipping_address") + public void setShippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for PaymentSource. + * 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. + * @return Returns the SubscriptionPaymentSource + */ + @JsonGetter("payment_source") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPaymentSource getPaymentSource() { + return paymentSource; + } + + /** + * Setter for PaymentSource. + * 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. + * @param paymentSource Value for SubscriptionPaymentSource + */ + @JsonSetter("payment_source") + public void setPaymentSource(SubscriptionPaymentSource paymentSource) { + this.paymentSource = paymentSource; + } + + /** + * Converts this SubscriberRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriberRequest [" + "name=" + name + ", phone=" + phone + ", shippingAddress=" + + shippingAddress + ", paymentSource=" + paymentSource + "]"; + } + + /** + * Builds a new {@link SubscriberRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriberRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .name(getName()) + .phone(getPhone()) + .shippingAddress(getShippingAddress()) + .paymentSource(getPaymentSource()); + return builder; + } + + /** + * Class to build instances of {@link SubscriberRequest}. + */ + public static class Builder { + private Name name; + private PhoneWithType phone; + private ShippingDetails shippingAddress; + private SubscriptionPaymentSource paymentSource; + + + + /** + * Setter for name. + * @param name Name value for name. + * @return Builder + */ + public Builder name(Name name) { + this.name = name; + return this; + } + + /** + * Setter for phone. + * @param phone PhoneWithType value for phone. + * @return Builder + */ + public Builder phone(PhoneWithType phone) { + this.phone = phone; + return this; + } + + /** + * Setter for shippingAddress. + * @param shippingAddress ShippingDetails value for shippingAddress. + * @return Builder + */ + public Builder shippingAddress(ShippingDetails shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Setter for paymentSource. + * @param paymentSource SubscriptionPaymentSource value for paymentSource. + * @return Builder + */ + public Builder paymentSource(SubscriptionPaymentSource paymentSource) { + this.paymentSource = paymentSource; + return this; + } + + /** + * Builds a new {@link SubscriberRequest} object using the set fields. + * @return {@link SubscriberRequest} + */ + public SubscriberRequest build() { + return new SubscriberRequest(name, phone, shippingAddress, paymentSource); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/Subscription.java b/src/main/java/com/paypal/sdk/models/Subscription.java new file mode 100644 index 0000000..a732814 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/Subscription.java @@ -0,0 +1,573 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for Subscription type. + */ +public class Subscription { + private String id; + private String planId; + private String startTime; + private String quantity; + private Money shippingAmount; + private Subscriber subscriber; + private SubscriptionBillingInformation billingInfo; + private String createTime; + private String updateTime; + private String customId; + private Boolean planOverridden; + private PlanDetails plan; + private List links; + + /** + * Default constructor. + */ + public Subscription() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param planId String value for planId. + * @param startTime String value for startTime. + * @param quantity String value for quantity. + * @param shippingAmount Money value for shippingAmount. + * @param subscriber Subscriber value for subscriber. + * @param billingInfo SubscriptionBillingInformation value for billingInfo. + * @param createTime String value for createTime. + * @param updateTime String value for updateTime. + * @param customId String value for customId. + * @param planOverridden Boolean value for planOverridden. + * @param plan PlanDetails value for plan. + * @param links List of LinkDescription value for links. + */ + public Subscription( + String id, + String planId, + String startTime, + String quantity, + Money shippingAmount, + Subscriber subscriber, + SubscriptionBillingInformation billingInfo, + String createTime, + String updateTime, + String customId, + Boolean planOverridden, + PlanDetails plan, + List links) { + this.id = id; + this.planId = planId; + this.startTime = startTime; + this.quantity = quantity; + this.shippingAmount = shippingAmount; + this.subscriber = subscriber; + this.billingInfo = billingInfo; + this.createTime = createTime; + this.updateTime = updateTime; + this.customId = customId; + this.planOverridden = planOverridden; + this.plan = plan; + this.links = links; + } + + /** + * Getter for Id. + * The PayPal-generated ID for the subscription. + * @return Returns the String + */ + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getId() { + return id; + } + + /** + * Setter for Id. + * The PayPal-generated ID for the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for PlanId. + * The ID of the plan. + * @return Returns the String + */ + @JsonGetter("plan_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPlanId() { + return planId; + } + + /** + * Setter for PlanId. + * The ID of the plan. + * @param planId Value for String + */ + @JsonSetter("plan_id") + public void setPlanId(String planId) { + this.planId = planId; + } + + /** + * Getter for StartTime. + * 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. + * @return Returns the String + */ + @JsonGetter("start_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getStartTime() { + return startTime; + } + + /** + * Setter for StartTime. + * 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. + * @param startTime Value for String + */ + @JsonSetter("start_time") + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + /** + * Getter for Quantity. + * The quantity of the product in the subscription. + * @return Returns the String + */ + @JsonGetter("quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The quantity of the product in the subscription. + * @param quantity Value for String + */ + @JsonSetter("quantity") + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + * Getter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingAmount() { + return shippingAmount; + } + + /** + * Setter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingAmount Value for Money + */ + @JsonSetter("shipping_amount") + public void setShippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + } + + /** + * Getter for Subscriber. + * The subscriber response information. + * @return Returns the Subscriber + */ + @JsonGetter("subscriber") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Subscriber getSubscriber() { + return subscriber; + } + + /** + * Setter for Subscriber. + * The subscriber response information. + * @param subscriber Value for Subscriber + */ + @JsonSetter("subscriber") + public void setSubscriber(Subscriber subscriber) { + this.subscriber = subscriber; + } + + /** + * Getter for BillingInfo. + * The billing details for the subscription. If the subscription was or is active, these fields + * are populated. + * @return Returns the SubscriptionBillingInformation + */ + @JsonGetter("billing_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionBillingInformation getBillingInfo() { + return billingInfo; + } + + /** + * Setter for BillingInfo. + * The billing details for the subscription. If the subscription was or is active, these fields + * are populated. + * @param billingInfo Value for SubscriptionBillingInformation + */ + @JsonSetter("billing_info") + public void setBillingInfo(SubscriptionBillingInformation billingInfo) { + this.billingInfo = billingInfo; + } + + /** + * Getter for CreateTime. + * 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. + * @return Returns the String + */ + @JsonGetter("create_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreateTime() { + return createTime; + } + + /** + * Setter for CreateTime. + * 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. + * @param createTime Value for String + */ + @JsonSetter("create_time") + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + /** + * Getter for UpdateTime. + * 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. + * @return Returns the String + */ + @JsonGetter("update_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUpdateTime() { + return updateTime; + } + + /** + * Setter for UpdateTime. + * 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. + * @param updateTime Value for String + */ + @JsonSetter("update_time") + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + /** + * Getter for CustomId. + * The custom id for the subscription. Can be invoice id. + * @return Returns the String + */ + @JsonGetter("custom_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCustomId() { + return customId; + } + + /** + * Setter for CustomId. + * The custom id for the subscription. Can be invoice id. + * @param customId Value for String + */ + @JsonSetter("custom_id") + public void setCustomId(String customId) { + this.customId = customId; + } + + /** + * Getter for PlanOverridden. + * Indicates whether the subscription has overridden any plan attributes. + * @return Returns the Boolean + */ + @JsonGetter("plan_overridden") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getPlanOverridden() { + return planOverridden; + } + + /** + * Setter for PlanOverridden. + * Indicates whether the subscription has overridden any plan attributes. + * @param planOverridden Value for Boolean + */ + @JsonSetter("plan_overridden") + public void setPlanOverridden(Boolean planOverridden) { + this.planOverridden = planOverridden; + } + + /** + * Getter for Plan. + * The plan details. + * @return Returns the PlanDetails + */ + @JsonGetter("plan") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PlanDetails getPlan() { + return plan; + } + + /** + * Setter for Plan. + * The plan details. + * @param plan Value for PlanDetails + */ + @JsonSetter("plan") + public void setPlan(PlanDetails plan) { + this.plan = plan; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this Subscription into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "Subscription [" + "id=" + id + ", planId=" + planId + ", startTime=" + startTime + + ", quantity=" + quantity + ", shippingAmount=" + shippingAmount + ", subscriber=" + + subscriber + ", billingInfo=" + billingInfo + ", createTime=" + createTime + + ", updateTime=" + updateTime + ", customId=" + customId + ", planOverridden=" + + planOverridden + ", plan=" + plan + ", links=" + links + "]"; + } + + /** + * Builds a new {@link Subscription.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link Subscription.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .id(getId()) + .planId(getPlanId()) + .startTime(getStartTime()) + .quantity(getQuantity()) + .shippingAmount(getShippingAmount()) + .subscriber(getSubscriber()) + .billingInfo(getBillingInfo()) + .createTime(getCreateTime()) + .updateTime(getUpdateTime()) + .customId(getCustomId()) + .planOverridden(getPlanOverridden()) + .plan(getPlan()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link Subscription}. + */ + public static class Builder { + private String id; + private String planId; + private String startTime; + private String quantity; + private Money shippingAmount; + private Subscriber subscriber; + private SubscriptionBillingInformation billingInfo; + private String createTime; + private String updateTime; + private String customId; + private Boolean planOverridden; + private PlanDetails plan; + private List links; + + + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for planId. + * @param planId String value for planId. + * @return Builder + */ + public Builder planId(String planId) { + this.planId = planId; + return this; + } + + /** + * Setter for startTime. + * @param startTime String value for startTime. + * @return Builder + */ + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Setter for quantity. + * @param quantity String value for quantity. + * @return Builder + */ + public Builder quantity(String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for shippingAmount. + * @param shippingAmount Money value for shippingAmount. + * @return Builder + */ + public Builder shippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + return this; + } + + /** + * Setter for subscriber. + * @param subscriber Subscriber value for subscriber. + * @return Builder + */ + public Builder subscriber(Subscriber subscriber) { + this.subscriber = subscriber; + return this; + } + + /** + * Setter for billingInfo. + * @param billingInfo SubscriptionBillingInformation value for billingInfo. + * @return Builder + */ + public Builder billingInfo(SubscriptionBillingInformation billingInfo) { + this.billingInfo = billingInfo; + return this; + } + + /** + * Setter for createTime. + * @param createTime String value for createTime. + * @return Builder + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + /** + * Setter for updateTime. + * @param updateTime String value for updateTime. + * @return Builder + */ + public Builder updateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Setter for customId. + * @param customId String value for customId. + * @return Builder + */ + public Builder customId(String customId) { + this.customId = customId; + return this; + } + + /** + * Setter for planOverridden. + * @param planOverridden Boolean value for planOverridden. + * @return Builder + */ + public Builder planOverridden(Boolean planOverridden) { + this.planOverridden = planOverridden; + return this; + } + + /** + * Setter for plan. + * @param plan PlanDetails value for plan. + * @return Builder + */ + public Builder plan(PlanDetails plan) { + this.plan = plan; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link Subscription} object using the set fields. + * @return {@link Subscription} + */ + public Subscription build() { + return new Subscription(id, planId, startTime, quantity, shippingAmount, subscriber, + billingInfo, createTime, updateTime, customId, planOverridden, plan, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionAmountWithBreakdown.java b/src/main/java/com/paypal/sdk/models/SubscriptionAmountWithBreakdown.java new file mode 100644 index 0000000..80fad26 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionAmountWithBreakdown.java @@ -0,0 +1,300 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionAmountWithBreakdown type. + */ +public class SubscriptionAmountWithBreakdown { + private Money grossAmount; + private Money totalItemAmount; + private Money feeAmount; + private Money shippingAmount; + private Money taxAmount; + private Money netAmount; + + /** + * Default constructor. + */ + public SubscriptionAmountWithBreakdown() { + } + + /** + * Initialization constructor. + * @param grossAmount Money value for grossAmount. + * @param totalItemAmount Money value for totalItemAmount. + * @param feeAmount Money value for feeAmount. + * @param shippingAmount Money value for shippingAmount. + * @param taxAmount Money value for taxAmount. + * @param netAmount Money value for netAmount. + */ + public SubscriptionAmountWithBreakdown( + Money grossAmount, + Money totalItemAmount, + Money feeAmount, + Money shippingAmount, + Money taxAmount, + Money netAmount) { + this.grossAmount = grossAmount; + this.totalItemAmount = totalItemAmount; + this.feeAmount = feeAmount; + this.shippingAmount = shippingAmount; + this.taxAmount = taxAmount; + this.netAmount = netAmount; + } + + /** + * Getter for GrossAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("gross_amount") + public Money getGrossAmount() { + return grossAmount; + } + + /** + * Setter for GrossAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param grossAmount Value for Money + */ + @JsonSetter("gross_amount") + public void setGrossAmount(Money grossAmount) { + this.grossAmount = grossAmount; + } + + /** + * Getter for TotalItemAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("total_item_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTotalItemAmount() { + return totalItemAmount; + } + + /** + * Setter for TotalItemAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param totalItemAmount Value for Money + */ + @JsonSetter("total_item_amount") + public void setTotalItemAmount(Money totalItemAmount) { + this.totalItemAmount = totalItemAmount; + } + + /** + * Getter for FeeAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("fee_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getFeeAmount() { + return feeAmount; + } + + /** + * Setter for FeeAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param feeAmount Value for Money + */ + @JsonSetter("fee_amount") + public void setFeeAmount(Money feeAmount) { + this.feeAmount = feeAmount; + } + + /** + * Getter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingAmount() { + return shippingAmount; + } + + /** + * Setter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingAmount Value for Money + */ + @JsonSetter("shipping_amount") + public void setShippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + } + + /** + * Getter for TaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("tax_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTaxAmount() { + return taxAmount; + } + + /** + * Setter for TaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param taxAmount Value for Money + */ + @JsonSetter("tax_amount") + public void setTaxAmount(Money taxAmount) { + this.taxAmount = taxAmount; + } + + /** + * Getter for NetAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("net_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getNetAmount() { + return netAmount; + } + + /** + * Setter for NetAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param netAmount Value for Money + */ + @JsonSetter("net_amount") + public void setNetAmount(Money netAmount) { + this.netAmount = netAmount; + } + + /** + * Converts this SubscriptionAmountWithBreakdown into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionAmountWithBreakdown [" + "grossAmount=" + grossAmount + + ", totalItemAmount=" + totalItemAmount + ", feeAmount=" + feeAmount + + ", shippingAmount=" + shippingAmount + ", taxAmount=" + taxAmount + ", netAmount=" + + netAmount + "]"; + } + + /** + * Builds a new {@link SubscriptionAmountWithBreakdown.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionAmountWithBreakdown.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(grossAmount) + .totalItemAmount(getTotalItemAmount()) + .feeAmount(getFeeAmount()) + .shippingAmount(getShippingAmount()) + .taxAmount(getTaxAmount()) + .netAmount(getNetAmount()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionAmountWithBreakdown}. + */ + public static class Builder { + private Money grossAmount; + private Money totalItemAmount; + private Money feeAmount; + private Money shippingAmount; + private Money taxAmount; + private Money netAmount; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param grossAmount Money value for grossAmount. + */ + public Builder(Money grossAmount) { + this.grossAmount = grossAmount; + } + + /** + * Setter for grossAmount. + * @param grossAmount Money value for grossAmount. + * @return Builder + */ + public Builder grossAmount(Money grossAmount) { + this.grossAmount = grossAmount; + return this; + } + + /** + * Setter for totalItemAmount. + * @param totalItemAmount Money value for totalItemAmount. + * @return Builder + */ + public Builder totalItemAmount(Money totalItemAmount) { + this.totalItemAmount = totalItemAmount; + return this; + } + + /** + * Setter for feeAmount. + * @param feeAmount Money value for feeAmount. + * @return Builder + */ + public Builder feeAmount(Money feeAmount) { + this.feeAmount = feeAmount; + return this; + } + + /** + * Setter for shippingAmount. + * @param shippingAmount Money value for shippingAmount. + * @return Builder + */ + public Builder shippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + return this; + } + + /** + * Setter for taxAmount. + * @param taxAmount Money value for taxAmount. + * @return Builder + */ + public Builder taxAmount(Money taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Setter for netAmount. + * @param netAmount Money value for netAmount. + * @return Builder + */ + public Builder netAmount(Money netAmount) { + this.netAmount = netAmount; + return this; + } + + /** + * Builds a new {@link SubscriptionAmountWithBreakdown} object using the set fields. + * @return {@link SubscriptionAmountWithBreakdown} + */ + public SubscriptionAmountWithBreakdown build() { + return new SubscriptionAmountWithBreakdown(grossAmount, totalItemAmount, feeAmount, + shippingAmount, taxAmount, netAmount); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionApplicationContext.java b/src/main/java/com/paypal/sdk/models/SubscriptionApplicationContext.java new file mode 100644 index 0000000..f723199 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionApplicationContext.java @@ -0,0 +1,349 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionApplicationContext type. + */ +public class SubscriptionApplicationContext { + private String brandName; + private String locale; + private ExperienceContextShippingPreference shippingPreference; + private ApplicationContextUserAction userAction; + private PaymentMethod paymentMethod; + private String returnUrl; + private String cancelUrl; + + /** + * Default constructor. + */ + public SubscriptionApplicationContext() { + shippingPreference = ExperienceContextShippingPreference.GET_FROM_FILE; + userAction = ApplicationContextUserAction.SUBSCRIBE_NOW; + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + * @param brandName String value for brandName. + * @param locale String value for locale. + * @param shippingPreference ExperienceContextShippingPreference value for shippingPreference. + * @param userAction ApplicationContextUserAction value for userAction. + * @param paymentMethod PaymentMethod value for paymentMethod. + */ + public SubscriptionApplicationContext( + String returnUrl, + String cancelUrl, + String brandName, + String locale, + ExperienceContextShippingPreference shippingPreference, + ApplicationContextUserAction userAction, + PaymentMethod paymentMethod) { + this.brandName = brandName; + this.locale = locale; + this.shippingPreference = shippingPreference; + this.userAction = userAction; + this.paymentMethod = paymentMethod; + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Getter for BrandName. + * The label that overrides the business name in the PayPal account on the PayPal site. + * @return Returns the String + */ + @JsonGetter("brand_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getBrandName() { + return brandName; + } + + /** + * Setter for BrandName. + * The label that overrides the business name in the PayPal account on the PayPal site. + * @param brandName Value for String + */ + @JsonSetter("brand_name") + public void setBrandName(String brandName) { + this.brandName = brandName; + } + + /** + * Getter for Locale. + * The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal + * supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, + * `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. + * @return Returns the String + */ + @JsonGetter("locale") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLocale() { + return locale; + } + + /** + * Setter for Locale. + * The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal + * supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, + * `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. + * @param locale Value for String + */ + @JsonSetter("locale") + public void setLocale(String locale) { + this.locale = locale; + } + + /** + * Getter for ShippingPreference. + * The location from which the shipping address is derived. + * @return Returns the ExperienceContextShippingPreference + */ + @JsonGetter("shipping_preference") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ExperienceContextShippingPreference getShippingPreference() { + return shippingPreference; + } + + /** + * Setter for ShippingPreference. + * The location from which the shipping address is derived. + * @param shippingPreference Value for ExperienceContextShippingPreference + */ + @JsonSetter("shipping_preference") + public void setShippingPreference(ExperienceContextShippingPreference shippingPreference) { + this.shippingPreference = shippingPreference; + } + + /** + * Getter for UserAction. + * Configures the label name to `Continue` or `Subscribe Now` for subscription consent + * experience. + * @return Returns the ApplicationContextUserAction + */ + @JsonGetter("user_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ApplicationContextUserAction getUserAction() { + return userAction; + } + + /** + * Setter for UserAction. + * Configures the label name to `Continue` or `Subscribe Now` for subscription consent + * experience. + * @param userAction Value for ApplicationContextUserAction + */ + @JsonSetter("user_action") + public void setUserAction(ApplicationContextUserAction userAction) { + this.userAction = userAction; + } + + /** + * Getter for PaymentMethod. + * The customer and merchant payment preferences. + * @return Returns the PaymentMethod + */ + @JsonGetter("payment_method") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + /** + * Setter for PaymentMethod. + * The customer and merchant payment preferences. + * @param paymentMethod Value for PaymentMethod + */ + @JsonSetter("payment_method") + public void setPaymentMethod(PaymentMethod paymentMethod) { + this.paymentMethod = paymentMethod; + } + + /** + * Getter for ReturnUrl. + * The URL where the customer is redirected after the customer approves the payment. + * @return Returns the String + */ + @JsonGetter("return_url") + public String getReturnUrl() { + return returnUrl; + } + + /** + * Setter for ReturnUrl. + * The URL where the customer is redirected after the customer approves the payment. + * @param returnUrl Value for String + */ + @JsonSetter("return_url") + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + } + + /** + * Getter for CancelUrl. + * The URL where the customer is redirected after the customer cancels the payment. + * @return Returns the String + */ + @JsonGetter("cancel_url") + public String getCancelUrl() { + return cancelUrl; + } + + /** + * Setter for CancelUrl. + * The URL where the customer is redirected after the customer cancels the payment. + * @param cancelUrl Value for String + */ + @JsonSetter("cancel_url") + public void setCancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + } + + /** + * Converts this SubscriptionApplicationContext into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionApplicationContext [" + "returnUrl=" + returnUrl + ", cancelUrl=" + + cancelUrl + ", brandName=" + brandName + ", locale=" + locale + + ", shippingPreference=" + shippingPreference + ", userAction=" + userAction + + ", paymentMethod=" + paymentMethod + "]"; + } + + /** + * Builds a new {@link SubscriptionApplicationContext.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionApplicationContext.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(returnUrl, cancelUrl) + .brandName(getBrandName()) + .locale(getLocale()) + .shippingPreference(getShippingPreference()) + .userAction(getUserAction()) + .paymentMethod(getPaymentMethod()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionApplicationContext}. + */ + public static class Builder { + private String returnUrl; + private String cancelUrl; + private String brandName; + private String locale; + private ExperienceContextShippingPreference shippingPreference = + ExperienceContextShippingPreference.GET_FROM_FILE; + private ApplicationContextUserAction userAction = + ApplicationContextUserAction.SUBSCRIBE_NOW; + private PaymentMethod paymentMethod; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + */ + public Builder(String returnUrl, String cancelUrl) { + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Setter for returnUrl. + * @param returnUrl String value for returnUrl. + * @return Builder + */ + public Builder returnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * Setter for cancelUrl. + * @param cancelUrl String value for cancelUrl. + * @return Builder + */ + public Builder cancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + return this; + } + + /** + * Setter for brandName. + * @param brandName String value for brandName. + * @return Builder + */ + public Builder brandName(String brandName) { + this.brandName = brandName; + return this; + } + + /** + * Setter for locale. + * @param locale String value for locale. + * @return Builder + */ + public Builder locale(String locale) { + this.locale = locale; + return this; + } + + /** + * Setter for shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for + * shippingPreference. + * @return Builder + */ + public Builder shippingPreference( + ExperienceContextShippingPreference shippingPreference) { + this.shippingPreference = shippingPreference; + return this; + } + + /** + * Setter for userAction. + * @param userAction ApplicationContextUserAction value for userAction. + * @return Builder + */ + public Builder userAction(ApplicationContextUserAction userAction) { + this.userAction = userAction; + return this; + } + + /** + * Setter for paymentMethod. + * @param paymentMethod PaymentMethod value for paymentMethod. + * @return Builder + */ + public Builder paymentMethod(PaymentMethod paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Builds a new {@link SubscriptionApplicationContext} object using the set fields. + * @return {@link SubscriptionApplicationContext} + */ + public SubscriptionApplicationContext build() { + return new SubscriptionApplicationContext(returnUrl, cancelUrl, brandName, locale, + shippingPreference, userAction, paymentMethod); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionBillingCycle.java b/src/main/java/com/paypal/sdk/models/SubscriptionBillingCycle.java new file mode 100644 index 0000000..767186d --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionBillingCycle.java @@ -0,0 +1,275 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionBillingCycle type. + */ +public class SubscriptionBillingCycle { + private SubscriptionPricingScheme pricingScheme; + private Frequency frequency; + private TenureType tenureType; + private int sequence; + private Integer totalCycles; + + /** + * Default constructor. + */ + public SubscriptionBillingCycle() { + totalCycles = 1; + } + + /** + * Initialization constructor. + * @param frequency Frequency value for frequency. + * @param tenureType TenureType value for tenureType. + * @param sequence int value for sequence. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + * @param totalCycles Integer value for totalCycles. + */ + public SubscriptionBillingCycle( + Frequency frequency, + TenureType tenureType, + int sequence, + SubscriptionPricingScheme pricingScheme, + Integer totalCycles) { + this.pricingScheme = pricingScheme; + this.frequency = frequency; + this.tenureType = tenureType; + this.sequence = sequence; + this.totalCycles = totalCycles; + } + + /** + * Getter for PricingScheme. + * The pricing scheme details. + * @return Returns the SubscriptionPricingScheme + */ + @JsonGetter("pricing_scheme") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPricingScheme getPricingScheme() { + return pricingScheme; + } + + /** + * Setter for PricingScheme. + * The pricing scheme details. + * @param pricingScheme Value for SubscriptionPricingScheme + */ + @JsonSetter("pricing_scheme") + public void setPricingScheme(SubscriptionPricingScheme pricingScheme) { + this.pricingScheme = pricingScheme; + } + + /** + * Getter for Frequency. + * The frequency of the billing cycle. + * @return Returns the Frequency + */ + @JsonGetter("frequency") + public Frequency getFrequency() { + return frequency; + } + + /** + * Setter for Frequency. + * The frequency of the billing cycle. + * @param frequency Value for Frequency + */ + @JsonSetter("frequency") + public void setFrequency(Frequency frequency) { + this.frequency = frequency; + } + + /** + * Getter for TenureType. + * The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial + * cycles are allowed per plan. + * @return Returns the TenureType + */ + @JsonGetter("tenure_type") + public TenureType getTenureType() { + return tenureType; + } + + /** + * Setter for TenureType. + * The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial + * cycles are allowed per plan. + * @param tenureType Value for TenureType + */ + @JsonSetter("tenure_type") + public void setTenureType(TenureType tenureType) { + this.tenureType = tenureType; + } + + /** + * Getter for Sequence. + * 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. + * @return Returns the int + */ + @JsonGetter("sequence") + public int getSequence() { + return sequence; + } + + /** + * Setter for Sequence. + * 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. + * @param sequence Value for int + */ + @JsonSetter("sequence") + public void setSequence(int sequence) { + this.sequence = sequence; + } + + /** + * Getter for TotalCycles. + * 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). + * @return Returns the Integer + */ + @JsonGetter("total_cycles") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalCycles() { + return totalCycles; + } + + /** + * Setter for TotalCycles. + * 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). + * @param totalCycles Value for Integer + */ + @JsonSetter("total_cycles") + public void setTotalCycles(Integer totalCycles) { + this.totalCycles = totalCycles; + } + + /** + * Converts this SubscriptionBillingCycle into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionBillingCycle [" + "frequency=" + frequency + ", tenureType=" + + tenureType + ", sequence=" + sequence + ", pricingScheme=" + pricingScheme + + ", totalCycles=" + totalCycles + "]"; + } + + /** + * Builds a new {@link SubscriptionBillingCycle.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionBillingCycle.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(frequency, tenureType, sequence) + .pricingScheme(getPricingScheme()) + .totalCycles(getTotalCycles()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionBillingCycle}. + */ + public static class Builder { + private Frequency frequency; + private TenureType tenureType; + private int sequence; + private SubscriptionPricingScheme pricingScheme; + private Integer totalCycles = 1; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param frequency Frequency value for frequency. + * @param tenureType TenureType value for tenureType. + * @param sequence int value for sequence. + */ + public Builder(Frequency frequency, TenureType tenureType, int sequence) { + this.frequency = frequency; + this.tenureType = tenureType; + this.sequence = sequence; + } + + /** + * Setter for frequency. + * @param frequency Frequency value for frequency. + * @return Builder + */ + public Builder frequency(Frequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Setter for tenureType. + * @param tenureType TenureType value for tenureType. + * @return Builder + */ + public Builder tenureType(TenureType tenureType) { + this.tenureType = tenureType; + return this; + } + + /** + * Setter for sequence. + * @param sequence int value for sequence. + * @return Builder + */ + public Builder sequence(int sequence) { + this.sequence = sequence; + return this; + } + + /** + * Setter for pricingScheme. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + * @return Builder + */ + public Builder pricingScheme(SubscriptionPricingScheme pricingScheme) { + this.pricingScheme = pricingScheme; + return this; + } + + /** + * Setter for totalCycles. + * @param totalCycles Integer value for totalCycles. + * @return Builder + */ + public Builder totalCycles(Integer totalCycles) { + this.totalCycles = totalCycles; + return this; + } + + /** + * Builds a new {@link SubscriptionBillingCycle} object using the set fields. + * @return {@link SubscriptionBillingCycle} + */ + public SubscriptionBillingCycle build() { + return new SubscriptionBillingCycle(frequency, tenureType, sequence, pricingScheme, + totalCycles); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionBillingInformation.java b/src/main/java/com/paypal/sdk/models/SubscriptionBillingInformation.java new file mode 100644 index 0000000..70675c6 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionBillingInformation.java @@ -0,0 +1,356 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for SubscriptionBillingInformation type. + */ +public class SubscriptionBillingInformation { + private Money outstandingBalance; + private List cycleExecutions; + private LastPaymentDetails lastPayment; + private String nextBillingTime; + private String finalPaymentTime; + private int failedPaymentsCount; + private FailedPaymentDetails lastFailedPayment; + + /** + * Default constructor. + */ + public SubscriptionBillingInformation() { + } + + /** + * Initialization constructor. + * @param outstandingBalance Money value for outstandingBalance. + * @param failedPaymentsCount int value for failedPaymentsCount. + * @param cycleExecutions List of CycleExecution value for cycleExecutions. + * @param lastPayment LastPaymentDetails value for lastPayment. + * @param nextBillingTime String value for nextBillingTime. + * @param finalPaymentTime String value for finalPaymentTime. + * @param lastFailedPayment FailedPaymentDetails value for lastFailedPayment. + */ + public SubscriptionBillingInformation( + Money outstandingBalance, + int failedPaymentsCount, + List cycleExecutions, + LastPaymentDetails lastPayment, + String nextBillingTime, + String finalPaymentTime, + FailedPaymentDetails lastFailedPayment) { + this.outstandingBalance = outstandingBalance; + this.cycleExecutions = cycleExecutions; + this.lastPayment = lastPayment; + this.nextBillingTime = nextBillingTime; + this.finalPaymentTime = finalPaymentTime; + this.failedPaymentsCount = failedPaymentsCount; + this.lastFailedPayment = lastFailedPayment; + } + + /** + * Getter for OutstandingBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("outstanding_balance") + public Money getOutstandingBalance() { + return outstandingBalance; + } + + /** + * Setter for OutstandingBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param outstandingBalance Value for Money + */ + @JsonSetter("outstanding_balance") + public void setOutstandingBalance(Money outstandingBalance) { + this.outstandingBalance = outstandingBalance; + } + + /** + * Getter for CycleExecutions. + * The trial and regular billing executions. + * @return Returns the List of CycleExecution + */ + @JsonGetter("cycle_executions") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getCycleExecutions() { + return cycleExecutions; + } + + /** + * Setter for CycleExecutions. + * The trial and regular billing executions. + * @param cycleExecutions Value for List of CycleExecution + */ + @JsonSetter("cycle_executions") + public void setCycleExecutions(List cycleExecutions) { + this.cycleExecutions = cycleExecutions; + } + + /** + * Getter for LastPayment. + * The details for the last payment. + * @return Returns the LastPaymentDetails + */ + @JsonGetter("last_payment") + @JsonInclude(JsonInclude.Include.NON_NULL) + public LastPaymentDetails getLastPayment() { + return lastPayment; + } + + /** + * Setter for LastPayment. + * The details for the last payment. + * @param lastPayment Value for LastPaymentDetails + */ + @JsonSetter("last_payment") + public void setLastPayment(LastPaymentDetails lastPayment) { + this.lastPayment = lastPayment; + } + + /** + * Getter for NextBillingTime. + * 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. + * @return Returns the String + */ + @JsonGetter("next_billing_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getNextBillingTime() { + return nextBillingTime; + } + + /** + * Setter for NextBillingTime. + * 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. + * @param nextBillingTime Value for String + */ + @JsonSetter("next_billing_time") + public void setNextBillingTime(String nextBillingTime) { + this.nextBillingTime = nextBillingTime; + } + + /** + * Getter for FinalPaymentTime. + * 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. + * @return Returns the String + */ + @JsonGetter("final_payment_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFinalPaymentTime() { + return finalPaymentTime; + } + + /** + * Setter for FinalPaymentTime. + * 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. + * @param finalPaymentTime Value for String + */ + @JsonSetter("final_payment_time") + public void setFinalPaymentTime(String finalPaymentTime) { + this.finalPaymentTime = finalPaymentTime; + } + + /** + * Getter for FailedPaymentsCount. + * 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. + * @return Returns the int + */ + @JsonGetter("failed_payments_count") + public int getFailedPaymentsCount() { + return failedPaymentsCount; + } + + /** + * Setter for FailedPaymentsCount. + * 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. + * @param failedPaymentsCount Value for int + */ + @JsonSetter("failed_payments_count") + public void setFailedPaymentsCount(int failedPaymentsCount) { + this.failedPaymentsCount = failedPaymentsCount; + } + + /** + * Getter for LastFailedPayment. + * The details for the failed payment of the subscription. + * @return Returns the FailedPaymentDetails + */ + @JsonGetter("last_failed_payment") + @JsonInclude(JsonInclude.Include.NON_NULL) + public FailedPaymentDetails getLastFailedPayment() { + return lastFailedPayment; + } + + /** + * Setter for LastFailedPayment. + * The details for the failed payment of the subscription. + * @param lastFailedPayment Value for FailedPaymentDetails + */ + @JsonSetter("last_failed_payment") + public void setLastFailedPayment(FailedPaymentDetails lastFailedPayment) { + this.lastFailedPayment = lastFailedPayment; + } + + /** + * Converts this SubscriptionBillingInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionBillingInformation [" + "outstandingBalance=" + outstandingBalance + + ", failedPaymentsCount=" + failedPaymentsCount + ", cycleExecutions=" + + cycleExecutions + ", lastPayment=" + lastPayment + ", nextBillingTime=" + + nextBillingTime + ", finalPaymentTime=" + finalPaymentTime + + ", lastFailedPayment=" + lastFailedPayment + "]"; + } + + /** + * Builds a new {@link SubscriptionBillingInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionBillingInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(outstandingBalance, failedPaymentsCount) + .cycleExecutions(getCycleExecutions()) + .lastPayment(getLastPayment()) + .nextBillingTime(getNextBillingTime()) + .finalPaymentTime(getFinalPaymentTime()) + .lastFailedPayment(getLastFailedPayment()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionBillingInformation}. + */ + public static class Builder { + private Money outstandingBalance; + private int failedPaymentsCount; + private List cycleExecutions; + private LastPaymentDetails lastPayment; + private String nextBillingTime; + private String finalPaymentTime; + private FailedPaymentDetails lastFailedPayment; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param outstandingBalance Money value for outstandingBalance. + * @param failedPaymentsCount int value for failedPaymentsCount. + */ + public Builder(Money outstandingBalance, int failedPaymentsCount) { + this.outstandingBalance = outstandingBalance; + this.failedPaymentsCount = failedPaymentsCount; + } + + /** + * Setter for outstandingBalance. + * @param outstandingBalance Money value for outstandingBalance. + * @return Builder + */ + public Builder outstandingBalance(Money outstandingBalance) { + this.outstandingBalance = outstandingBalance; + return this; + } + + /** + * Setter for failedPaymentsCount. + * @param failedPaymentsCount int value for failedPaymentsCount. + * @return Builder + */ + public Builder failedPaymentsCount(int failedPaymentsCount) { + this.failedPaymentsCount = failedPaymentsCount; + return this; + } + + /** + * Setter for cycleExecutions. + * @param cycleExecutions List of CycleExecution value for cycleExecutions. + * @return Builder + */ + public Builder cycleExecutions(List cycleExecutions) { + this.cycleExecutions = cycleExecutions; + return this; + } + + /** + * Setter for lastPayment. + * @param lastPayment LastPaymentDetails value for lastPayment. + * @return Builder + */ + public Builder lastPayment(LastPaymentDetails lastPayment) { + this.lastPayment = lastPayment; + return this; + } + + /** + * Setter for nextBillingTime. + * @param nextBillingTime String value for nextBillingTime. + * @return Builder + */ + public Builder nextBillingTime(String nextBillingTime) { + this.nextBillingTime = nextBillingTime; + return this; + } + + /** + * Setter for finalPaymentTime. + * @param finalPaymentTime String value for finalPaymentTime. + * @return Builder + */ + public Builder finalPaymentTime(String finalPaymentTime) { + this.finalPaymentTime = finalPaymentTime; + return this; + } + + /** + * Setter for lastFailedPayment. + * @param lastFailedPayment FailedPaymentDetails value for lastFailedPayment. + * @return Builder + */ + public Builder lastFailedPayment(FailedPaymentDetails lastFailedPayment) { + this.lastFailedPayment = lastFailedPayment; + return this; + } + + /** + * Builds a new {@link SubscriptionBillingInformation} object using the set fields. + * @return {@link SubscriptionBillingInformation} + */ + public SubscriptionBillingInformation build() { + return new SubscriptionBillingInformation(outstandingBalance, failedPaymentsCount, + cycleExecutions, lastPayment, nextBillingTime, finalPaymentTime, + lastFailedPayment); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionCardRequest.java b/src/main/java/com/paypal/sdk/models/SubscriptionCardRequest.java new file mode 100644 index 0000000..49cf625 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionCardRequest.java @@ -0,0 +1,373 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionCardRequest type. + */ +public class SubscriptionCardRequest { + private String name; + private String number; + private String expiry; + private String securityCode; + private CardType type; + private SubscriptionsCardBrand brand; + private Address billingAddress; + private SubscriptionsCardAttributes attributes; + + /** + * Default constructor. + */ + public SubscriptionCardRequest() { + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param number String value for number. + * @param expiry String value for expiry. + * @param securityCode String value for securityCode. + * @param type CardType value for type. + * @param brand SubscriptionsCardBrand value for brand. + * @param billingAddress Address value for billingAddress. + * @param attributes SubscriptionsCardAttributes value for attributes. + */ + public SubscriptionCardRequest( + String name, + String number, + String expiry, + String securityCode, + CardType type, + SubscriptionsCardBrand brand, + Address billingAddress, + SubscriptionsCardAttributes attributes) { + this.name = name; + this.number = number; + this.expiry = expiry; + this.securityCode = securityCode; + this.type = type; + this.brand = brand; + this.billingAddress = billingAddress; + this.attributes = attributes; + } + + /** + * Getter for Name. + * The card holder's name as it appears on the card. + * @return Returns the String + */ + @JsonGetter("name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getName() { + return name; + } + + /** + * Setter for Name. + * The card holder's name as it appears on the card. + * @param name Value for String + */ + @JsonSetter("name") + public void setName(String name) { + this.name = name; + } + + /** + * Getter for Number. + * The primary account number (PAN) for the payment card. + * @return Returns the String + */ + @JsonGetter("number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getNumber() { + return number; + } + + /** + * Setter for Number. + * The primary account number (PAN) for the payment card. + * @param number Value for String + */ + @JsonSetter("number") + public void setNumber(String number) { + this.number = number; + } + + /** + * Getter for Expiry. + * 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). + * @return Returns the String + */ + @JsonGetter("expiry") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getExpiry() { + return expiry; + } + + /** + * Setter for Expiry. + * 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). + * @param expiry Value for String + */ + @JsonSetter("expiry") + public void setExpiry(String expiry) { + this.expiry = expiry; + } + + /** + * Getter for SecurityCode. + * The three- or four-digit security code of the card. Also known as the CVV, CVC, CVN, CVE, or + * CID. This parameter cannot be present in the request when `payment_initiator=MERCHANT`. + * @return Returns the String + */ + @JsonGetter("security_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSecurityCode() { + return securityCode; + } + + /** + * Setter for SecurityCode. + * The three- or four-digit security code of the card. Also known as the CVV, CVC, CVN, CVE, or + * CID. This parameter cannot be present in the request when `payment_initiator=MERCHANT`. + * @param securityCode Value for String + */ + @JsonSetter("security_code") + public void setSecurityCode(String securityCode) { + this.securityCode = securityCode; + } + + /** + * Getter for Type. + * Type of card. i.e Credit, Debit and so on. + * @return Returns the CardType + */ + @JsonGetter("type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CardType getType() { + return type; + } + + /** + * Setter for Type. + * Type of card. i.e Credit, Debit and so on. + * @param type Value for CardType + */ + @JsonSetter("type") + public void setType(CardType type) { + this.type = type; + } + + /** + * Getter for Brand. + * The card network or brand. Applies to credit, debit, gift, and payment cards. + * @return Returns the SubscriptionsCardBrand + */ + @JsonGetter("brand") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionsCardBrand getBrand() { + return brand; + } + + /** + * Setter for Brand. + * The card network or brand. Applies to credit, debit, gift, and payment cards. + * @param brand Value for SubscriptionsCardBrand + */ + @JsonSetter("brand") + public void setBrand(SubscriptionsCardBrand brand) { + this.brand = brand; + } + + /** + * Getter for BillingAddress. + * The portable international postal address. Maps to + * [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) + * and HTML 5.1 [Autofilling form controls: the autocomplete + * attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). + * @return Returns the Address + */ + @JsonGetter("billing_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Address getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * 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). + * @param billingAddress Value for Address + */ + @JsonSetter("billing_address") + public void setBillingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Getter for Attributes. + * Additional attributes associated with the use of this card. + * @return Returns the SubscriptionsCardAttributes + */ + @JsonGetter("attributes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionsCardAttributes getAttributes() { + return attributes; + } + + /** + * Setter for Attributes. + * Additional attributes associated with the use of this card. + * @param attributes Value for SubscriptionsCardAttributes + */ + @JsonSetter("attributes") + public void setAttributes(SubscriptionsCardAttributes attributes) { + this.attributes = attributes; + } + + /** + * Converts this SubscriptionCardRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionCardRequest [" + "name=" + name + ", number=" + number + ", expiry=" + + expiry + ", securityCode=" + securityCode + ", type=" + type + ", brand=" + brand + + ", billingAddress=" + billingAddress + ", attributes=" + attributes + "]"; + } + + /** + * Builds a new {@link SubscriptionCardRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionCardRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .name(getName()) + .number(getNumber()) + .expiry(getExpiry()) + .securityCode(getSecurityCode()) + .type(getType()) + .brand(getBrand()) + .billingAddress(getBillingAddress()) + .attributes(getAttributes()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionCardRequest}. + */ + public static class Builder { + private String name; + private String number; + private String expiry; + private String securityCode; + private CardType type; + private SubscriptionsCardBrand brand; + private Address billingAddress; + private SubscriptionsCardAttributes attributes; + + + + /** + * Setter for name. + * @param name String value for name. + * @return Builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Setter for number. + * @param number String value for number. + * @return Builder + */ + public Builder number(String number) { + this.number = number; + return this; + } + + /** + * Setter for expiry. + * @param expiry String value for expiry. + * @return Builder + */ + public Builder expiry(String expiry) { + this.expiry = expiry; + return this; + } + + /** + * Setter for securityCode. + * @param securityCode String value for securityCode. + * @return Builder + */ + public Builder securityCode(String securityCode) { + this.securityCode = securityCode; + return this; + } + + /** + * Setter for type. + * @param type CardType value for type. + * @return Builder + */ + public Builder type(CardType type) { + this.type = type; + return this; + } + + /** + * Setter for brand. + * @param brand SubscriptionsCardBrand value for brand. + * @return Builder + */ + public Builder brand(SubscriptionsCardBrand brand) { + this.brand = brand; + return this; + } + + /** + * Setter for billingAddress. + * @param billingAddress Address value for billingAddress. + * @return Builder + */ + public Builder billingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + /** + * Setter for attributes. + * @param attributes SubscriptionsCardAttributes value for attributes. + * @return Builder + */ + public Builder attributes(SubscriptionsCardAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Builds a new {@link SubscriptionCardRequest} object using the set fields. + * @return {@link SubscriptionCardRequest} + */ + public SubscriptionCardRequest build() { + return new SubscriptionCardRequest(name, number, expiry, securityCode, type, brand, + billingAddress, attributes); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionCollection.java b/src/main/java/com/paypal/sdk/models/SubscriptionCollection.java new file mode 100644 index 0000000..a16eca4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionCollection.java @@ -0,0 +1,142 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for SubscriptionCollection type. + */ +public class SubscriptionCollection { + private List subscriptions; + private List links; + + /** + * Default constructor. + */ + public SubscriptionCollection() { + } + + /** + * Initialization constructor. + * @param subscriptions List of Subscription value for subscriptions. + * @param links List of LinkDescription value for links. + */ + public SubscriptionCollection( + List subscriptions, + List links) { + this.subscriptions = subscriptions; + this.links = links; + } + + /** + * Getter for Subscriptions. + * An array of subscriptions. + * @return Returns the List of Subscription + */ + @JsonGetter("subscriptions") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getSubscriptions() { + return subscriptions; + } + + /** + * Setter for Subscriptions. + * An array of subscriptions. + * @param subscriptions Value for List of Subscription + */ + @JsonSetter("subscriptions") + public void setSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this SubscriptionCollection into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionCollection [" + "subscriptions=" + subscriptions + ", links=" + links + + "]"; + } + + /** + * Builds a new {@link SubscriptionCollection.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionCollection.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .subscriptions(getSubscriptions()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionCollection}. + */ + public static class Builder { + private List subscriptions; + private List links; + + + + /** + * Setter for subscriptions. + * @param subscriptions List of Subscription value for subscriptions. + * @return Builder + */ + public Builder subscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link SubscriptionCollection} object using the set fields. + * @return {@link SubscriptionCollection} + */ + public SubscriptionCollection build() { + return new SubscriptionCollection(subscriptions, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionCustomerInformation.java b/src/main/java/com/paypal/sdk/models/SubscriptionCustomerInformation.java new file mode 100644 index 0000000..2de4b32 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionCustomerInformation.java @@ -0,0 +1,180 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionCustomerInformation type. + */ +public class SubscriptionCustomerInformation { + private String id; + private String emailAddress; + private PhoneWithType phone; + + /** + * Default constructor. + */ + public SubscriptionCustomerInformation() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param emailAddress String value for emailAddress. + * @param phone PhoneWithType value for phone. + */ + public SubscriptionCustomerInformation( + String id, + String emailAddress, + PhoneWithType phone) { + this.id = id; + this.emailAddress = emailAddress; + this.phone = phone; + } + + /** + * Getter for Id. + * The unique ID for a customer generated by PayPal. + * @return Returns the String + */ + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getId() { + return id; + } + + /** + * Setter for Id. + * The unique ID for a customer generated by PayPal. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @return Returns the String + */ + @JsonGetter("email_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getEmailAddress() { + return emailAddress; + } + + /** + * Setter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @param emailAddress Value for String + */ + @JsonSetter("email_address") + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + /** + * Getter for Phone. + * The phone information. + * @return Returns the PhoneWithType + */ + @JsonGetter("phone") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PhoneWithType getPhone() { + return phone; + } + + /** + * Setter for Phone. + * The phone information. + * @param phone Value for PhoneWithType + */ + @JsonSetter("phone") + public void setPhone(PhoneWithType phone) { + this.phone = phone; + } + + /** + * Converts this SubscriptionCustomerInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionCustomerInformation [" + "id=" + id + ", emailAddress=" + emailAddress + + ", phone=" + phone + "]"; + } + + /** + * Builds a new {@link SubscriptionCustomerInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionCustomerInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .id(getId()) + .emailAddress(getEmailAddress()) + .phone(getPhone()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionCustomerInformation}. + */ + public static class Builder { + private String id; + private String emailAddress; + private PhoneWithType phone; + + + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for emailAddress. + * @param emailAddress String value for emailAddress. + * @return Builder + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Setter for phone. + * @param phone PhoneWithType value for phone. + * @return Builder + */ + public Builder phone(PhoneWithType phone) { + this.phone = phone; + return this; + } + + /** + * Builds a new {@link SubscriptionCustomerInformation} object using the set fields. + * @return {@link SubscriptionCustomerInformation} + */ + public SubscriptionCustomerInformation build() { + return new SubscriptionCustomerInformation(id, emailAddress, phone); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPatchApplicationContext.java b/src/main/java/com/paypal/sdk/models/SubscriptionPatchApplicationContext.java new file mode 100644 index 0000000..67861d7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPatchApplicationContext.java @@ -0,0 +1,308 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionPatchApplicationContext type. + */ +public class SubscriptionPatchApplicationContext { + private String brandName; + private String locale; + private ExperienceContextShippingPreference shippingPreference; + private PaymentMethod paymentMethod; + private String returnUrl; + private String cancelUrl; + + /** + * Default constructor. + */ + public SubscriptionPatchApplicationContext() { + shippingPreference = ExperienceContextShippingPreference.GET_FROM_FILE; + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + * @param brandName String value for brandName. + * @param locale String value for locale. + * @param shippingPreference ExperienceContextShippingPreference value for shippingPreference. + * @param paymentMethod PaymentMethod value for paymentMethod. + */ + public SubscriptionPatchApplicationContext( + String returnUrl, + String cancelUrl, + String brandName, + String locale, + ExperienceContextShippingPreference shippingPreference, + PaymentMethod paymentMethod) { + this.brandName = brandName; + this.locale = locale; + this.shippingPreference = shippingPreference; + this.paymentMethod = paymentMethod; + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Getter for BrandName. + * The label that overrides the business name in the PayPal account on the PayPal site. + * @return Returns the String + */ + @JsonGetter("brand_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getBrandName() { + return brandName; + } + + /** + * Setter for BrandName. + * The label that overrides the business name in the PayPal account on the PayPal site. + * @param brandName Value for String + */ + @JsonSetter("brand_name") + public void setBrandName(String brandName) { + this.brandName = brandName; + } + + /** + * Getter for Locale. + * The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal + * supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, + * `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. + * @return Returns the String + */ + @JsonGetter("locale") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLocale() { + return locale; + } + + /** + * Setter for Locale. + * The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal + * supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, + * `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. + * @param locale Value for String + */ + @JsonSetter("locale") + public void setLocale(String locale) { + this.locale = locale; + } + + /** + * Getter for ShippingPreference. + * The location from which the shipping address is derived. + * @return Returns the ExperienceContextShippingPreference + */ + @JsonGetter("shipping_preference") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ExperienceContextShippingPreference getShippingPreference() { + return shippingPreference; + } + + /** + * Setter for ShippingPreference. + * The location from which the shipping address is derived. + * @param shippingPreference Value for ExperienceContextShippingPreference + */ + @JsonSetter("shipping_preference") + public void setShippingPreference(ExperienceContextShippingPreference shippingPreference) { + this.shippingPreference = shippingPreference; + } + + /** + * Getter for PaymentMethod. + * The customer and merchant payment preferences. + * @return Returns the PaymentMethod + */ + @JsonGetter("payment_method") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + /** + * Setter for PaymentMethod. + * The customer and merchant payment preferences. + * @param paymentMethod Value for PaymentMethod + */ + @JsonSetter("payment_method") + public void setPaymentMethod(PaymentMethod paymentMethod) { + this.paymentMethod = paymentMethod; + } + + /** + * Getter for ReturnUrl. + * The URL where the customer is redirected after the customer approves the payment. + * @return Returns the String + */ + @JsonGetter("return_url") + public String getReturnUrl() { + return returnUrl; + } + + /** + * Setter for ReturnUrl. + * The URL where the customer is redirected after the customer approves the payment. + * @param returnUrl Value for String + */ + @JsonSetter("return_url") + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + } + + /** + * Getter for CancelUrl. + * The URL where the customer is redirected after the customer cancels the payment. + * @return Returns the String + */ + @JsonGetter("cancel_url") + public String getCancelUrl() { + return cancelUrl; + } + + /** + * Setter for CancelUrl. + * The URL where the customer is redirected after the customer cancels the payment. + * @param cancelUrl Value for String + */ + @JsonSetter("cancel_url") + public void setCancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + } + + /** + * Converts this SubscriptionPatchApplicationContext into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionPatchApplicationContext [" + "returnUrl=" + returnUrl + ", cancelUrl=" + + cancelUrl + ", brandName=" + brandName + ", locale=" + locale + + ", shippingPreference=" + shippingPreference + ", paymentMethod=" + paymentMethod + + "]"; + } + + /** + * Builds a new {@link SubscriptionPatchApplicationContext.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionPatchApplicationContext.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(returnUrl, cancelUrl) + .brandName(getBrandName()) + .locale(getLocale()) + .shippingPreference(getShippingPreference()) + .paymentMethod(getPaymentMethod()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionPatchApplicationContext}. + */ + public static class Builder { + private String returnUrl; + private String cancelUrl; + private String brandName; + private String locale; + private ExperienceContextShippingPreference shippingPreference = + ExperienceContextShippingPreference.GET_FROM_FILE; + private PaymentMethod paymentMethod; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param returnUrl String value for returnUrl. + * @param cancelUrl String value for cancelUrl. + */ + public Builder(String returnUrl, String cancelUrl) { + this.returnUrl = returnUrl; + this.cancelUrl = cancelUrl; + } + + /** + * Setter for returnUrl. + * @param returnUrl String value for returnUrl. + * @return Builder + */ + public Builder returnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * Setter for cancelUrl. + * @param cancelUrl String value for cancelUrl. + * @return Builder + */ + public Builder cancelUrl(String cancelUrl) { + this.cancelUrl = cancelUrl; + return this; + } + + /** + * Setter for brandName. + * @param brandName String value for brandName. + * @return Builder + */ + public Builder brandName(String brandName) { + this.brandName = brandName; + return this; + } + + /** + * Setter for locale. + * @param locale String value for locale. + * @return Builder + */ + public Builder locale(String locale) { + this.locale = locale; + return this; + } + + /** + * Setter for shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for + * shippingPreference. + * @return Builder + */ + public Builder shippingPreference( + ExperienceContextShippingPreference shippingPreference) { + this.shippingPreference = shippingPreference; + return this; + } + + /** + * Setter for paymentMethod. + * @param paymentMethod PaymentMethod value for paymentMethod. + * @return Builder + */ + public Builder paymentMethod(PaymentMethod paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Builds a new {@link SubscriptionPatchApplicationContext} object using the set fields. + * @return {@link SubscriptionPatchApplicationContext} + */ + public SubscriptionPatchApplicationContext build() { + return new SubscriptionPatchApplicationContext(returnUrl, cancelUrl, brandName, locale, + shippingPreference, paymentMethod); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPayerName.java b/src/main/java/com/paypal/sdk/models/SubscriptionPayerName.java new file mode 100644 index 0000000..3b78e65 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPayerName.java @@ -0,0 +1,295 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionPayerName type. + */ +public class SubscriptionPayerName { + private String prefix; + private String givenName; + private String surname; + private String middleName; + private String suffix; + private String fullName; + + /** + * Default constructor. + */ + public SubscriptionPayerName() { + } + + /** + * Initialization constructor. + * @param prefix String value for prefix. + * @param givenName String value for givenName. + * @param surname String value for surname. + * @param middleName String value for middleName. + * @param suffix String value for suffix. + * @param fullName String value for fullName. + */ + public SubscriptionPayerName( + String prefix, + String givenName, + String surname, + String middleName, + String suffix, + String fullName) { + this.prefix = prefix; + this.givenName = givenName; + this.surname = surname; + this.middleName = middleName; + this.suffix = suffix; + this.fullName = fullName; + } + + /** + * Getter for Prefix. + * The prefix, or title, to the party's name. + * @return Returns the String + */ + @JsonGetter("prefix") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPrefix() { + return prefix; + } + + /** + * Setter for Prefix. + * The prefix, or title, to the party's name. + * @param prefix Value for String + */ + @JsonSetter("prefix") + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + /** + * Getter for GivenName. + * When the party is a person, the party's given, or first, name. + * @return Returns the String + */ + @JsonGetter("given_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getGivenName() { + return givenName; + } + + /** + * Setter for GivenName. + * When the party is a person, the party's given, or first, name. + * @param givenName Value for String + */ + @JsonSetter("given_name") + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + /** + * Getter for Surname. + * 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. + * @return Returns the String + */ + @JsonGetter("surname") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSurname() { + return surname; + } + + /** + * Setter for Surname. + * 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. + * @param surname Value for String + */ + @JsonSetter("surname") + public void setSurname(String surname) { + this.surname = surname; + } + + /** + * Getter for MiddleName. + * When the party is a person, the party's middle name. Use also to store multiple middle names + * including the patronymic, or father's, middle name. + * @return Returns the String + */ + @JsonGetter("middle_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getMiddleName() { + return middleName; + } + + /** + * Setter for MiddleName. + * When the party is a person, the party's middle name. Use also to store multiple middle names + * including the patronymic, or father's, middle name. + * @param middleName Value for String + */ + @JsonSetter("middle_name") + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + /** + * Getter for Suffix. + * The suffix for the party's name. + * @return Returns the String + */ + @JsonGetter("suffix") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSuffix() { + return suffix; + } + + /** + * Setter for Suffix. + * The suffix for the party's name. + * @param suffix Value for String + */ + @JsonSetter("suffix") + public void setSuffix(String suffix) { + this.suffix = suffix; + } + + /** + * Getter for FullName. + * When the party is a person, the party's full name. + * @return Returns the String + */ + @JsonGetter("full_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFullName() { + return fullName; + } + + /** + * Setter for FullName. + * When the party is a person, the party's full name. + * @param fullName Value for String + */ + @JsonSetter("full_name") + public void setFullName(String fullName) { + this.fullName = fullName; + } + + /** + * Converts this SubscriptionPayerName into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionPayerName [" + "prefix=" + prefix + ", givenName=" + givenName + + ", surname=" + surname + ", middleName=" + middleName + ", suffix=" + suffix + + ", fullName=" + fullName + "]"; + } + + /** + * Builds a new {@link SubscriptionPayerName.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionPayerName.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .prefix(getPrefix()) + .givenName(getGivenName()) + .surname(getSurname()) + .middleName(getMiddleName()) + .suffix(getSuffix()) + .fullName(getFullName()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionPayerName}. + */ + public static class Builder { + private String prefix; + private String givenName; + private String surname; + private String middleName; + private String suffix; + private String fullName; + + + + /** + * Setter for prefix. + * @param prefix String value for prefix. + * @return Builder + */ + public Builder prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Setter for givenName. + * @param givenName String value for givenName. + * @return Builder + */ + public Builder givenName(String givenName) { + this.givenName = givenName; + return this; + } + + /** + * Setter for surname. + * @param surname String value for surname. + * @return Builder + */ + public Builder surname(String surname) { + this.surname = surname; + return this; + } + + /** + * Setter for middleName. + * @param middleName String value for middleName. + * @return Builder + */ + public Builder middleName(String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Setter for suffix. + * @param suffix String value for suffix. + * @return Builder + */ + public Builder suffix(String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Setter for fullName. + * @param fullName String value for fullName. + * @return Builder + */ + public Builder fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Builds a new {@link SubscriptionPayerName} object using the set fields. + * @return {@link SubscriptionPayerName} + */ + public SubscriptionPayerName build() { + return new SubscriptionPayerName(prefix, givenName, surname, middleName, suffix, + fullName); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPaymentSource.java b/src/main/java/com/paypal/sdk/models/SubscriptionPaymentSource.java new file mode 100644 index 0000000..bff7576 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPaymentSource.java @@ -0,0 +1,101 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionPaymentSource type. + */ +public class SubscriptionPaymentSource { + private SubscriptionCardRequest card; + + /** + * Default constructor. + */ + public SubscriptionPaymentSource() { + } + + /** + * Initialization constructor. + * @param card SubscriptionCardRequest value for card. + */ + public SubscriptionPaymentSource( + SubscriptionCardRequest card) { + this.card = card; + } + + /** + * Getter for Card. + * The payment card to use to fund a payment. Can be a credit or debit card. + * @return Returns the SubscriptionCardRequest + */ + @JsonGetter("card") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionCardRequest getCard() { + return card; + } + + /** + * Setter for Card. + * The payment card to use to fund a payment. Can be a credit or debit card. + * @param card Value for SubscriptionCardRequest + */ + @JsonSetter("card") + public void setCard(SubscriptionCardRequest card) { + this.card = card; + } + + /** + * Converts this SubscriptionPaymentSource into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionPaymentSource [" + "card=" + card + "]"; + } + + /** + * Builds a new {@link SubscriptionPaymentSource.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionPaymentSource.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .card(getCard()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionPaymentSource}. + */ + public static class Builder { + private SubscriptionCardRequest card; + + + + /** + * Setter for card. + * @param card SubscriptionCardRequest value for card. + * @return Builder + */ + public Builder card(SubscriptionCardRequest card) { + this.card = card; + return this; + } + + /** + * Builds a new {@link SubscriptionPaymentSource} object using the set fields. + * @return {@link SubscriptionPaymentSource} + */ + public SubscriptionPaymentSource build() { + return new SubscriptionPaymentSource(card); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPaymentSourceResponse.java b/src/main/java/com/paypal/sdk/models/SubscriptionPaymentSourceResponse.java new file mode 100644 index 0000000..79be76c --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPaymentSourceResponse.java @@ -0,0 +1,101 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionPaymentSourceResponse type. + */ +public class SubscriptionPaymentSourceResponse { + private CardResponseWithBillingAddress card; + + /** + * Default constructor. + */ + public SubscriptionPaymentSourceResponse() { + } + + /** + * Initialization constructor. + * @param card CardResponseWithBillingAddress value for card. + */ + public SubscriptionPaymentSourceResponse( + CardResponseWithBillingAddress card) { + this.card = card; + } + + /** + * Getter for Card. + * The payment card used to fund the payment. Card can be a credit or debit card. + * @return Returns the CardResponseWithBillingAddress + */ + @JsonGetter("card") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CardResponseWithBillingAddress getCard() { + return card; + } + + /** + * Setter for Card. + * The payment card used to fund the payment. Card can be a credit or debit card. + * @param card Value for CardResponseWithBillingAddress + */ + @JsonSetter("card") + public void setCard(CardResponseWithBillingAddress card) { + this.card = card; + } + + /** + * Converts this SubscriptionPaymentSourceResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionPaymentSourceResponse [" + "card=" + card + "]"; + } + + /** + * Builds a new {@link SubscriptionPaymentSourceResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionPaymentSourceResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .card(getCard()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionPaymentSourceResponse}. + */ + public static class Builder { + private CardResponseWithBillingAddress card; + + + + /** + * Setter for card. + * @param card CardResponseWithBillingAddress value for card. + * @return Builder + */ + public Builder card(CardResponseWithBillingAddress card) { + this.card = card; + return this; + } + + /** + * Builds a new {@link SubscriptionPaymentSourceResponse} object using the set fields. + * @return {@link SubscriptionPaymentSourceResponse} + */ + public SubscriptionPaymentSourceResponse build() { + return new SubscriptionPaymentSourceResponse(card); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPlanStatus.java b/src/main/java/com/paypal/sdk/models/SubscriptionPlanStatus.java new file mode 100644 index 0000000..f3e47dc --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPlanStatus.java @@ -0,0 +1,117 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * SubscriptionPlanStatus to be used. + */ +public enum SubscriptionPlanStatus { + /** + * The plan was created. You cannot create subscriptions for a plan in this state. + */ + CREATED, + + /** + * The plan is inactive. + */ + INACTIVE, + + /** + * The plan is active. You can only create subscriptions for a plan in this state. + */ + ACTIVE, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CREATED.value = "CREATED"; + INACTIVE.value = "INACTIVE"; + ACTIVE.value = "ACTIVE"; + _UNKNOWN.value = null; + + valueMap.put("CREATED", CREATED); + valueMap.put("INACTIVE", INACTIVE); + valueMap.put("ACTIVE", ACTIVE); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static SubscriptionPlanStatus constructFromString(String toConvert) throws IOException { + SubscriptionPlanStatus enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static SubscriptionPlanStatus fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of SubscriptionPlanStatus values to list of string values. + * @param toConvert The list of SubscriptionPlanStatus values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (SubscriptionPlanStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPricingModel.java b/src/main/java/com/paypal/sdk/models/SubscriptionPricingModel.java new file mode 100644 index 0000000..22154e7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPricingModel.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * SubscriptionPricingModel to be used. + */ +public enum SubscriptionPricingModel { + /** + * A volume pricing model. + */ + VOLUME, + + /** + * A tiered pricing model. + */ + TIERED, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + VOLUME.value = "VOLUME"; + TIERED.value = "TIERED"; + _UNKNOWN.value = null; + + valueMap.put("VOLUME", VOLUME); + valueMap.put("TIERED", TIERED); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static SubscriptionPricingModel constructFromString(String toConvert) throws IOException { + SubscriptionPricingModel enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static SubscriptionPricingModel fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of SubscriptionPricingModel values to list of string values. + * @param toConvert The list of SubscriptionPricingModel values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (SubscriptionPricingModel enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionPricingScheme.java b/src/main/java/com/paypal/sdk/models/SubscriptionPricingScheme.java new file mode 100644 index 0000000..31bfef4 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionPricingScheme.java @@ -0,0 +1,304 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for SubscriptionPricingScheme type. + */ +public class SubscriptionPricingScheme { + private Integer version; + private Money fixedPrice; + private SubscriptionPricingModel pricingModel; + private List tiers; + private String createTime; + private String updateTime; + + /** + * Default constructor. + */ + public SubscriptionPricingScheme() { + } + + /** + * Initialization constructor. + * @param version Integer value for version. + * @param fixedPrice Money value for fixedPrice. + * @param pricingModel SubscriptionPricingModel value for pricingModel. + * @param tiers List of PricingTier value for tiers. + * @param createTime String value for createTime. + * @param updateTime String value for updateTime. + */ + public SubscriptionPricingScheme( + Integer version, + Money fixedPrice, + SubscriptionPricingModel pricingModel, + List tiers, + String createTime, + String updateTime) { + this.version = version; + this.fixedPrice = fixedPrice; + this.pricingModel = pricingModel; + this.tiers = tiers; + this.createTime = createTime; + this.updateTime = updateTime; + } + + /** + * Getter for Version. + * The version of the pricing scheme. + * @return Returns the Integer + */ + @JsonGetter("version") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getVersion() { + return version; + } + + /** + * Setter for Version. + * The version of the pricing scheme. + * @param version Value for Integer + */ + @JsonSetter("version") + public void setVersion(Integer version) { + this.version = version; + } + + /** + * Getter for FixedPrice. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("fixed_price") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getFixedPrice() { + return fixedPrice; + } + + /** + * Setter for FixedPrice. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param fixedPrice Value for Money + */ + @JsonSetter("fixed_price") + public void setFixedPrice(Money fixedPrice) { + this.fixedPrice = fixedPrice; + } + + /** + * Getter for PricingModel. + * The pricing model for tiered plan. The `tiers` parameter is required. + * @return Returns the SubscriptionPricingModel + */ + @JsonGetter("pricing_model") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPricingModel getPricingModel() { + return pricingModel; + } + + /** + * Setter for PricingModel. + * The pricing model for tiered plan. The `tiers` parameter is required. + * @param pricingModel Value for SubscriptionPricingModel + */ + @JsonSetter("pricing_model") + public void setPricingModel(SubscriptionPricingModel pricingModel) { + this.pricingModel = pricingModel; + } + + /** + * Getter for Tiers. + * An array of pricing tiers which are used for billing volume/tiered plans. pricing_model field + * has to be specified. + * @return Returns the List of PricingTier + */ + @JsonGetter("tiers") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTiers() { + return tiers; + } + + /** + * Setter for Tiers. + * An array of pricing tiers which are used for billing volume/tiered plans. pricing_model field + * has to be specified. + * @param tiers Value for List of PricingTier + */ + @JsonSetter("tiers") + public void setTiers(List tiers) { + this.tiers = tiers; + } + + /** + * Getter for CreateTime. + * 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. + * @return Returns the String + */ + @JsonGetter("create_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreateTime() { + return createTime; + } + + /** + * Setter for CreateTime. + * 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. + * @param createTime Value for String + */ + @JsonSetter("create_time") + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + /** + * Getter for UpdateTime. + * 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. + * @return Returns the String + */ + @JsonGetter("update_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUpdateTime() { + return updateTime; + } + + /** + * Setter for UpdateTime. + * 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. + * @param updateTime Value for String + */ + @JsonSetter("update_time") + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + /** + * Converts this SubscriptionPricingScheme into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionPricingScheme [" + "version=" + version + ", fixedPrice=" + fixedPrice + + ", pricingModel=" + pricingModel + ", tiers=" + tiers + ", createTime=" + + createTime + ", updateTime=" + updateTime + "]"; + } + + /** + * Builds a new {@link SubscriptionPricingScheme.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionPricingScheme.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .version(getVersion()) + .fixedPrice(getFixedPrice()) + .pricingModel(getPricingModel()) + .tiers(getTiers()) + .createTime(getCreateTime()) + .updateTime(getUpdateTime()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionPricingScheme}. + */ + public static class Builder { + private Integer version; + private Money fixedPrice; + private SubscriptionPricingModel pricingModel; + private List tiers; + private String createTime; + private String updateTime; + + + + /** + * Setter for version. + * @param version Integer value for version. + * @return Builder + */ + public Builder version(Integer version) { + this.version = version; + return this; + } + + /** + * Setter for fixedPrice. + * @param fixedPrice Money value for fixedPrice. + * @return Builder + */ + public Builder fixedPrice(Money fixedPrice) { + this.fixedPrice = fixedPrice; + return this; + } + + /** + * Setter for pricingModel. + * @param pricingModel SubscriptionPricingModel value for pricingModel. + * @return Builder + */ + public Builder pricingModel(SubscriptionPricingModel pricingModel) { + this.pricingModel = pricingModel; + return this; + } + + /** + * Setter for tiers. + * @param tiers List of PricingTier value for tiers. + * @return Builder + */ + public Builder tiers(List tiers) { + this.tiers = tiers; + return this; + } + + /** + * Setter for createTime. + * @param createTime String value for createTime. + * @return Builder + */ + public Builder createTime(String createTime) { + this.createTime = createTime; + return this; + } + + /** + * Setter for updateTime. + * @param updateTime String value for updateTime. + * @return Builder + */ + public Builder updateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Builds a new {@link SubscriptionPricingScheme} object using the set fields. + * @return {@link SubscriptionPricingScheme} + */ + public SubscriptionPricingScheme build() { + return new SubscriptionPricingScheme(version, fixedPrice, pricingModel, tiers, + createTime, updateTime); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionTransactionDetails.java b/src/main/java/com/paypal/sdk/models/SubscriptionTransactionDetails.java new file mode 100644 index 0000000..c551da7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionTransactionDetails.java @@ -0,0 +1,312 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionTransactionDetails type. + */ +public class SubscriptionTransactionDetails { + private CaptureStatus status; + private String id; + private SubscriptionAmountWithBreakdown amountWithBreakdown; + private SubscriptionPayerName payerName; + private String payerEmail; + private String time; + + /** + * Default constructor. + */ + public SubscriptionTransactionDetails() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param amountWithBreakdown SubscriptionAmountWithBreakdown value for amountWithBreakdown. + * @param time String value for time. + * @param status CaptureStatus value for status. + * @param payerName SubscriptionPayerName value for payerName. + * @param payerEmail String value for payerEmail. + */ + public SubscriptionTransactionDetails( + String id, + SubscriptionAmountWithBreakdown amountWithBreakdown, + String time, + CaptureStatus status, + SubscriptionPayerName payerName, + String payerEmail) { + this.status = status; + this.id = id; + this.amountWithBreakdown = amountWithBreakdown; + this.payerName = payerName; + this.payerEmail = payerEmail; + this.time = time; + } + + /** + * Getter for Status. + * The status of the captured payment. + * @return Returns the CaptureStatus + */ + @JsonGetter("status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CaptureStatus getStatus() { + return status; + } + + /** + * Setter for Status. + * The status of the captured payment. + * @param status Value for CaptureStatus + */ + @JsonSetter("status") + public void setStatus(CaptureStatus status) { + this.status = status; + } + + /** + * Getter for Id. + * The PayPal-generated transaction ID. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The PayPal-generated transaction ID. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for AmountWithBreakdown. + * The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. + * @return Returns the SubscriptionAmountWithBreakdown + */ + @JsonGetter("amount_with_breakdown") + public SubscriptionAmountWithBreakdown getAmountWithBreakdown() { + return amountWithBreakdown; + } + + /** + * Setter for AmountWithBreakdown. + * The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. + * @param amountWithBreakdown Value for SubscriptionAmountWithBreakdown + */ + @JsonSetter("amount_with_breakdown") + public void setAmountWithBreakdown(SubscriptionAmountWithBreakdown amountWithBreakdown) { + this.amountWithBreakdown = amountWithBreakdown; + } + + /** + * Getter for PayerName. + * The name of the party. + * @return Returns the SubscriptionPayerName + */ + @JsonGetter("payer_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionPayerName getPayerName() { + return payerName; + } + + /** + * Setter for PayerName. + * The name of the party. + * @param payerName Value for SubscriptionPayerName + */ + @JsonSetter("payer_name") + public void setPayerName(SubscriptionPayerName payerName) { + this.payerName = payerName; + } + + /** + * Getter for PayerEmail. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @return Returns the String + */ + @JsonGetter("payer_email") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPayerEmail() { + return payerEmail; + } + + /** + * Setter for PayerEmail. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @param payerEmail Value for String + */ + @JsonSetter("payer_email") + public void setPayerEmail(String payerEmail) { + this.payerEmail = payerEmail; + } + + /** + * Getter for Time. + * 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. + * @return Returns the String + */ + @JsonGetter("time") + public String getTime() { + return time; + } + + /** + * Setter for Time. + * 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. + * @param time Value for String + */ + @JsonSetter("time") + public void setTime(String time) { + this.time = time; + } + + /** + * Converts this SubscriptionTransactionDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionTransactionDetails [" + "id=" + id + ", amountWithBreakdown=" + + amountWithBreakdown + ", time=" + time + ", status=" + status + ", payerName=" + + payerName + ", payerEmail=" + payerEmail + "]"; + } + + /** + * Builds a new {@link SubscriptionTransactionDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionTransactionDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, amountWithBreakdown, time) + .status(getStatus()) + .payerName(getPayerName()) + .payerEmail(getPayerEmail()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionTransactionDetails}. + */ + public static class Builder { + private String id; + private SubscriptionAmountWithBreakdown amountWithBreakdown; + private String time; + private CaptureStatus status; + private SubscriptionPayerName payerName; + private String payerEmail; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param amountWithBreakdown SubscriptionAmountWithBreakdown value for + * amountWithBreakdown. + * @param time String value for time. + */ + public Builder(String id, SubscriptionAmountWithBreakdown amountWithBreakdown, + String time) { + this.id = id; + this.amountWithBreakdown = amountWithBreakdown; + this.time = time; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for amountWithBreakdown. + * @param amountWithBreakdown SubscriptionAmountWithBreakdown value for + * amountWithBreakdown. + * @return Builder + */ + public Builder amountWithBreakdown(SubscriptionAmountWithBreakdown amountWithBreakdown) { + this.amountWithBreakdown = amountWithBreakdown; + return this; + } + + /** + * Setter for time. + * @param time String value for time. + * @return Builder + */ + public Builder time(String time) { + this.time = time; + return this; + } + + /** + * Setter for status. + * @param status CaptureStatus value for status. + * @return Builder + */ + public Builder status(CaptureStatus status) { + this.status = status; + return this; + } + + /** + * Setter for payerName. + * @param payerName SubscriptionPayerName value for payerName. + * @return Builder + */ + public Builder payerName(SubscriptionPayerName payerName) { + this.payerName = payerName; + return this; + } + + /** + * Setter for payerEmail. + * @param payerEmail String value for payerEmail. + * @return Builder + */ + public Builder payerEmail(String payerEmail) { + this.payerEmail = payerEmail; + return this; + } + + /** + * Builds a new {@link SubscriptionTransactionDetails} object using the set fields. + * @return {@link SubscriptionTransactionDetails} + */ + public SubscriptionTransactionDetails build() { + return new SubscriptionTransactionDetails(id, amountWithBreakdown, time, status, + payerName, payerEmail); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionsCardAttributes.java b/src/main/java/com/paypal/sdk/models/SubscriptionsCardAttributes.java new file mode 100644 index 0000000..8e4a82c --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionsCardAttributes.java @@ -0,0 +1,180 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SubscriptionsCardAttributes type. + */ +public class SubscriptionsCardAttributes { + private CardCustomer customer; + private VaultInstructionBase vault; + private CardVerification verification; + + /** + * Default constructor. + */ + public SubscriptionsCardAttributes() { + } + + /** + * Initialization constructor. + * @param customer CardCustomer value for customer. + * @param vault VaultInstructionBase value for vault. + * @param verification CardVerification value for verification. + */ + public SubscriptionsCardAttributes( + CardCustomer customer, + VaultInstructionBase vault, + CardVerification verification) { + this.customer = customer; + this.vault = vault; + this.verification = verification; + } + + /** + * Getter for Customer. + * The details about a customer in PayPal's system of record. + * @return Returns the CardCustomer + */ + @JsonGetter("customer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CardCustomer getCustomer() { + return customer; + } + + /** + * Setter for Customer. + * The details about a customer in PayPal's system of record. + * @param customer Value for CardCustomer + */ + @JsonSetter("customer") + public void setCustomer(CardCustomer customer) { + this.customer = customer; + } + + /** + * Getter for Vault. + * Basic vault instruction specification that can be extended by specific payment sources that + * supports vaulting. + * @return Returns the VaultInstructionBase + */ + @JsonGetter("vault") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VaultInstructionBase getVault() { + return vault; + } + + /** + * Setter for Vault. + * Basic vault instruction specification that can be extended by specific payment sources that + * supports vaulting. + * @param vault Value for VaultInstructionBase + */ + @JsonSetter("vault") + public void setVault(VaultInstructionBase vault) { + this.vault = vault; + } + + /** + * Getter for Verification. + * The API caller can opt in to verify the card through PayPal offered verification services + * (e.g. Smart Dollar Auth, 3DS). + * @return Returns the CardVerification + */ + @JsonGetter("verification") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CardVerification getVerification() { + return verification; + } + + /** + * Setter for Verification. + * The API caller can opt in to verify the card through PayPal offered verification services + * (e.g. Smart Dollar Auth, 3DS). + * @param verification Value for CardVerification + */ + @JsonSetter("verification") + public void setVerification(CardVerification verification) { + this.verification = verification; + } + + /** + * Converts this SubscriptionsCardAttributes into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SubscriptionsCardAttributes [" + "customer=" + customer + ", vault=" + vault + + ", verification=" + verification + "]"; + } + + /** + * Builds a new {@link SubscriptionsCardAttributes.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SubscriptionsCardAttributes.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .customer(getCustomer()) + .vault(getVault()) + .verification(getVerification()); + return builder; + } + + /** + * Class to build instances of {@link SubscriptionsCardAttributes}. + */ + public static class Builder { + private CardCustomer customer; + private VaultInstructionBase vault; + private CardVerification verification; + + + + /** + * Setter for customer. + * @param customer CardCustomer value for customer. + * @return Builder + */ + public Builder customer(CardCustomer customer) { + this.customer = customer; + return this; + } + + /** + * Setter for vault. + * @param vault VaultInstructionBase value for vault. + * @return Builder + */ + public Builder vault(VaultInstructionBase vault) { + this.vault = vault; + return this; + } + + /** + * Setter for verification. + * @param verification CardVerification value for verification. + * @return Builder + */ + public Builder verification(CardVerification verification) { + this.verification = verification; + return this; + } + + /** + * Builds a new {@link SubscriptionsCardAttributes} object using the set fields. + * @return {@link SubscriptionsCardAttributes} + */ + public SubscriptionsCardAttributes build() { + return new SubscriptionsCardAttributes(customer, vault, verification); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SubscriptionsCardBrand.java b/src/main/java/com/paypal/sdk/models/SubscriptionsCardBrand.java new file mode 100644 index 0000000..37ae54f --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SubscriptionsCardBrand.java @@ -0,0 +1,271 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * SubscriptionsCardBrand to be used. + */ +public enum SubscriptionsCardBrand { + /** + * Visa card. + */ + VISA, + + /** + * Mastercard card. + */ + MASTERCARD, + + /** + * Discover card. + */ + DISCOVER, + + /** + * American Express card. + */ + AMEX, + + /** + * Solo debit card. + */ + SOLO, + + /** + * Japan Credit Bureau card. + */ + JCB, + + /** + * Military Star card. + */ + STAR, + + /** + * Delta Airlines card. + */ + DELTA, + + /** + * Switch credit card. + */ + SWITCH, + + /** + * Maestro credit card. + */ + MAESTRO, + + /** + * Carte Bancaire (CB) credit card. + */ + CB_NATIONALE, + + /** + * Configoga credit card. + */ + CONFIGOGA, + + /** + * Confidis credit card. + */ + CONFIDIS, + + /** + * Visa Electron credit card. + */ + ELECTRON, + + /** + * Cetelem credit card. + */ + CETELEM, + + /** + * China union pay credit card. + */ + CHINA_UNION_PAY, + + /** + * The Diners Club International banking and payment services capability network owned by Discover Financial Services (DFS), one of the most recognized brands in US financial services. + */ + DINERS, + + /** + * The Brazilian Elo card payment network. + */ + ELO, + + /** + * The Hiper - Ingenico ePayment network. + */ + HIPER, + + /** + * The Brazilian Hipercard payment network that's widely accepted in the retail market. + */ + HIPERCARD, + + /** + * The RuPay payment network. + */ + RUPAY, + + /** + * The GE Credit Union 3Point card payment network. + */ + GE, + + /** + * The Synchrony Financial (SYF) payment network. + */ + SYNCHRONY, + + /** + * The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. + */ + EFTPOS, + + /** + * UNKNOWN payment network. + */ + UNKNOWN, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + VISA.value = "VISA"; + MASTERCARD.value = "MASTERCARD"; + DISCOVER.value = "DISCOVER"; + AMEX.value = "AMEX"; + SOLO.value = "SOLO"; + JCB.value = "JCB"; + STAR.value = "STAR"; + DELTA.value = "DELTA"; + SWITCH.value = "SWITCH"; + MAESTRO.value = "MAESTRO"; + CB_NATIONALE.value = "CB_NATIONALE"; + CONFIGOGA.value = "CONFIGOGA"; + CONFIDIS.value = "CONFIDIS"; + ELECTRON.value = "ELECTRON"; + CETELEM.value = "CETELEM"; + CHINA_UNION_PAY.value = "CHINA_UNION_PAY"; + DINERS.value = "DINERS"; + ELO.value = "ELO"; + HIPER.value = "HIPER"; + HIPERCARD.value = "HIPERCARD"; + RUPAY.value = "RUPAY"; + GE.value = "GE"; + SYNCHRONY.value = "SYNCHRONY"; + EFTPOS.value = "EFTPOS"; + UNKNOWN.value = "UNKNOWN"; + _UNKNOWN.value = null; + + valueMap.put("VISA", VISA); + valueMap.put("MASTERCARD", MASTERCARD); + valueMap.put("DISCOVER", DISCOVER); + valueMap.put("AMEX", AMEX); + valueMap.put("SOLO", SOLO); + valueMap.put("JCB", JCB); + valueMap.put("STAR", STAR); + valueMap.put("DELTA", DELTA); + valueMap.put("SWITCH", SWITCH); + valueMap.put("MAESTRO", MAESTRO); + valueMap.put("CB_NATIONALE", CB_NATIONALE); + valueMap.put("CONFIGOGA", CONFIGOGA); + valueMap.put("CONFIDIS", CONFIDIS); + valueMap.put("ELECTRON", ELECTRON); + valueMap.put("CETELEM", CETELEM); + valueMap.put("CHINA_UNION_PAY", CHINA_UNION_PAY); + valueMap.put("DINERS", DINERS); + valueMap.put("ELO", ELO); + valueMap.put("HIPER", HIPER); + valueMap.put("HIPERCARD", HIPERCARD); + valueMap.put("RUPAY", RUPAY); + valueMap.put("GE", GE); + valueMap.put("SYNCHRONY", SYNCHRONY); + valueMap.put("EFTPOS", EFTPOS); + valueMap.put("UNKNOWN", UNKNOWN); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static SubscriptionsCardBrand constructFromString(String toConvert) throws IOException { + SubscriptionsCardBrand enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static SubscriptionsCardBrand fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of SubscriptionsCardBrand values to list of string values. + * @param toConvert The list of SubscriptionsCardBrand values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (SubscriptionsCardBrand enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/SupplementaryPurchaseData.java b/src/main/java/com/paypal/sdk/models/SupplementaryPurchaseData.java deleted file mode 100644 index 916120c..0000000 --- a/src/main/java/com/paypal/sdk/models/SupplementaryPurchaseData.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * PaypalServerSdkLib - * - * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.paypal.sdk.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for SupplementaryPurchaseData type. - */ -public class SupplementaryPurchaseData { - private String invoiceId; - private String noteToPayer; - - /** - * Default constructor. - */ - public SupplementaryPurchaseData() { - } - - /** - * Initialization constructor. - * @param invoiceId String value for invoiceId. - * @param noteToPayer String value for noteToPayer. - */ - public SupplementaryPurchaseData( - String invoiceId, - String noteToPayer) { - this.invoiceId = invoiceId; - this.noteToPayer = noteToPayer; - } - - /** - * Getter for InvoiceId. - * The API caller-provided external invoice number for this order. Appears in both the payer's - * transaction history and the emails that the payer receives. - * @return Returns the String - */ - @JsonGetter("invoice_id") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getInvoiceId() { - return invoiceId; - } - - /** - * Setter for InvoiceId. - * The API caller-provided external invoice number for this order. Appears in both the payer's - * transaction history and the emails that the payer receives. - * @param invoiceId Value for String - */ - @JsonSetter("invoice_id") - public void setInvoiceId(String invoiceId) { - this.invoiceId = invoiceId; - } - - /** - * Getter for NoteToPayer. - * An informational note about this settlement. Appears in both the payer's transaction history - * and the emails that the payer receives. - * @return Returns the String - */ - @JsonGetter("note_to_payer") - @JsonInclude(JsonInclude.Include.NON_NULL) - public String getNoteToPayer() { - return noteToPayer; - } - - /** - * Setter for NoteToPayer. - * An informational note about this settlement. Appears in both the payer's transaction history - * and the emails that the payer receives. - * @param noteToPayer Value for String - */ - @JsonSetter("note_to_payer") - public void setNoteToPayer(String noteToPayer) { - this.noteToPayer = noteToPayer; - } - - /** - * Converts this SupplementaryPurchaseData into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "SupplementaryPurchaseData [" + "invoiceId=" + invoiceId + ", noteToPayer=" - + noteToPayer + "]"; - } - - /** - * Builds a new {@link SupplementaryPurchaseData.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link SupplementaryPurchaseData.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .invoiceId(getInvoiceId()) - .noteToPayer(getNoteToPayer()); - return builder; - } - - /** - * Class to build instances of {@link SupplementaryPurchaseData}. - */ - public static class Builder { - private String invoiceId; - private String noteToPayer; - - - - /** - * Setter for invoiceId. - * @param invoiceId String value for invoiceId. - * @return Builder - */ - public Builder invoiceId(String invoiceId) { - this.invoiceId = invoiceId; - return this; - } - - /** - * Setter for noteToPayer. - * @param noteToPayer String value for noteToPayer. - * @return Builder - */ - public Builder noteToPayer(String noteToPayer) { - this.noteToPayer = noteToPayer; - return this; - } - - /** - * Builds a new {@link SupplementaryPurchaseData} object using the set fields. - * @return {@link SupplementaryPurchaseData} - */ - public SupplementaryPurchaseData build() { - return new SupplementaryPurchaseData(invoiceId, noteToPayer); - } - } -} diff --git a/src/main/java/com/paypal/sdk/models/SuspendSubscription.java b/src/main/java/com/paypal/sdk/models/SuspendSubscription.java new file mode 100644 index 0000000..6593e39 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SuspendSubscription.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SuspendSubscription type. + */ +public class SuspendSubscription { + private String reason; + + /** + * Default constructor. + */ + public SuspendSubscription() { + } + + /** + * Initialization constructor. + * @param reason String value for reason. + */ + public SuspendSubscription( + String reason) { + this.reason = reason; + } + + /** + * Getter for Reason. + * The reason for suspension of the Subscription. + * @return Returns the String + */ + @JsonGetter("reason") + public String getReason() { + return reason; + } + + /** + * Setter for Reason. + * The reason for suspension of the Subscription. + * @param reason Value for String + */ + @JsonSetter("reason") + public void setReason(String reason) { + this.reason = reason; + } + + /** + * Converts this SuspendSubscription into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SuspendSubscription [" + "reason=" + reason + "]"; + } + + /** + * Builds a new {@link SuspendSubscription.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SuspendSubscription.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(reason); + return builder; + } + + /** + * Class to build instances of {@link SuspendSubscription}. + */ + public static class Builder { + private String reason; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param reason String value for reason. + */ + public Builder(String reason) { + this.reason = reason; + } + + /** + * Setter for reason. + * @param reason String value for reason. + * @return Builder + */ + public Builder reason(String reason) { + this.reason = reason; + return this; + } + + /** + * Builds a new {@link SuspendSubscription} object using the set fields. + * @return {@link SuspendSubscription} + */ + public SuspendSubscription build() { + return new SuspendSubscription(reason); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SuspendSubscriptionInput.java b/src/main/java/com/paypal/sdk/models/SuspendSubscriptionInput.java new file mode 100644 index 0000000..92277a3 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/SuspendSubscriptionInput.java @@ -0,0 +1,183 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for SuspendSubscriptionInput type. + */ +public class SuspendSubscriptionInput { + private String id; + private String contentType; + private SuspendSubscription body; + + /** + * Default constructor. + */ + public SuspendSubscriptionInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body SuspendSubscription value for body. + */ + public SuspendSubscriptionInput( + String id, + String contentType, + SuspendSubscription body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID of the subscription. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID of the subscription. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the SuspendSubscription + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SuspendSubscription getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for SuspendSubscription + */ + @JsonSetter("body") + public void setBody(SuspendSubscription body) { + this.body = body; + } + + /** + * Converts this SuspendSubscriptionInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "SuspendSubscriptionInput [" + "id=" + id + ", contentType=" + contentType + + ", body=" + body + "]"; + } + + /** + * Builds a new {@link SuspendSubscriptionInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link SuspendSubscriptionInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link SuspendSubscriptionInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private SuspendSubscription body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body SuspendSubscription value for body. + * @return Builder + */ + public Builder body(SuspendSubscription body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link SuspendSubscriptionInput} object using the set fields. + * @return {@link SuspendSubscriptionInput} + */ + public SuspendSubscriptionInput build() { + return new SuspendSubscriptionInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/TaxAmount.java b/src/main/java/com/paypal/sdk/models/TaxAmount.java new file mode 100644 index 0000000..afab7f1 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/TaxAmount.java @@ -0,0 +1,101 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for TaxAmount type. + */ +public class TaxAmount { + private Money taxAmount; + + /** + * Default constructor. + */ + public TaxAmount() { + } + + /** + * Initialization constructor. + * @param taxAmount Money value for taxAmount. + */ + public TaxAmount( + Money taxAmount) { + this.taxAmount = taxAmount; + } + + /** + * Getter for TaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("tax_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTaxAmount() { + return taxAmount; + } + + /** + * Setter for TaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param taxAmount Value for Money + */ + @JsonSetter("tax_amount") + public void setTaxAmount(Money taxAmount) { + this.taxAmount = taxAmount; + } + + /** + * Converts this TaxAmount into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "TaxAmount [" + "taxAmount=" + taxAmount + "]"; + } + + /** + * Builds a new {@link TaxAmount.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link TaxAmount.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .taxAmount(getTaxAmount()); + return builder; + } + + /** + * Class to build instances of {@link TaxAmount}. + */ + public static class Builder { + private Money taxAmount; + + + + /** + * Setter for taxAmount. + * @param taxAmount Money value for taxAmount. + * @return Builder + */ + public Builder taxAmount(Money taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Builds a new {@link TaxAmount} object using the set fields. + * @return {@link TaxAmount} + */ + public TaxAmount build() { + return new TaxAmount(taxAmount); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/Taxes.java b/src/main/java/com/paypal/sdk/models/Taxes.java new file mode 100644 index 0000000..d030cb0 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/Taxes.java @@ -0,0 +1,151 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for Taxes type. + */ +public class Taxes { + private String percentage; + private Boolean inclusive; + + /** + * Default constructor. + */ + public Taxes() { + inclusive = true; + } + + /** + * Initialization constructor. + * @param percentage String value for percentage. + * @param inclusive Boolean value for inclusive. + */ + public Taxes( + String percentage, + Boolean inclusive) { + this.percentage = percentage; + this.inclusive = inclusive; + } + + /** + * Getter for Percentage. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @return Returns the String + */ + @JsonGetter("percentage") + public String getPercentage() { + return percentage; + } + + /** + * Setter for Percentage. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @param percentage Value for String + */ + @JsonSetter("percentage") + public void setPercentage(String percentage) { + this.percentage = percentage; + } + + /** + * Getter for Inclusive. + * Indicates whether the tax was already included in the billing amount. + * @return Returns the Boolean + */ + @JsonGetter("inclusive") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getInclusive() { + return inclusive; + } + + /** + * Setter for Inclusive. + * Indicates whether the tax was already included in the billing amount. + * @param inclusive Value for Boolean + */ + @JsonSetter("inclusive") + public void setInclusive(Boolean inclusive) { + this.inclusive = inclusive; + } + + /** + * Converts this Taxes into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "Taxes [" + "percentage=" + percentage + ", inclusive=" + inclusive + "]"; + } + + /** + * Builds a new {@link Taxes.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link Taxes.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(percentage) + .inclusive(getInclusive()); + return builder; + } + + /** + * Class to build instances of {@link Taxes}. + */ + public static class Builder { + private String percentage; + private Boolean inclusive = true; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param percentage String value for percentage. + */ + public Builder(String percentage) { + this.percentage = percentage; + } + + /** + * Setter for percentage. + * @param percentage String value for percentage. + * @return Builder + */ + public Builder percentage(String percentage) { + this.percentage = percentage; + return this; + } + + /** + * Setter for inclusive. + * @param inclusive Boolean value for inclusive. + * @return Builder + */ + public Builder inclusive(Boolean inclusive) { + this.inclusive = inclusive; + return this; + } + + /** + * Builds a new {@link Taxes} object using the set fields. + * @return {@link Taxes} + */ + public Taxes build() { + return new Taxes(percentage, inclusive); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/TaxesOverride.java b/src/main/java/com/paypal/sdk/models/TaxesOverride.java new file mode 100644 index 0000000..5824963 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/TaxesOverride.java @@ -0,0 +1,140 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for TaxesOverride type. + */ +public class TaxesOverride { + private String percentage; + private Boolean inclusive; + + /** + * Default constructor. + */ + public TaxesOverride() { + } + + /** + * Initialization constructor. + * @param percentage String value for percentage. + * @param inclusive Boolean value for inclusive. + */ + public TaxesOverride( + String percentage, + Boolean inclusive) { + this.percentage = percentage; + this.inclusive = inclusive; + } + + /** + * Getter for Percentage. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @return Returns the String + */ + @JsonGetter("percentage") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPercentage() { + return percentage; + } + + /** + * Setter for Percentage. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @param percentage Value for String + */ + @JsonSetter("percentage") + public void setPercentage(String percentage) { + this.percentage = percentage; + } + + /** + * Getter for Inclusive. + * Indicates whether the tax was already included in the billing amount. + * @return Returns the Boolean + */ + @JsonGetter("inclusive") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getInclusive() { + return inclusive; + } + + /** + * Setter for Inclusive. + * Indicates whether the tax was already included in the billing amount. + * @param inclusive Value for Boolean + */ + @JsonSetter("inclusive") + public void setInclusive(Boolean inclusive) { + this.inclusive = inclusive; + } + + /** + * Converts this TaxesOverride into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "TaxesOverride [" + "percentage=" + percentage + ", inclusive=" + inclusive + "]"; + } + + /** + * Builds a new {@link TaxesOverride.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link TaxesOverride.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .percentage(getPercentage()) + .inclusive(getInclusive()); + return builder; + } + + /** + * Class to build instances of {@link TaxesOverride}. + */ + public static class Builder { + private String percentage; + private Boolean inclusive; + + + + /** + * Setter for percentage. + * @param percentage String value for percentage. + * @return Builder + */ + public Builder percentage(String percentage) { + this.percentage = percentage; + return this; + } + + /** + * Setter for inclusive. + * @param inclusive Boolean value for inclusive. + * @return Builder + */ + public Builder inclusive(Boolean inclusive) { + this.inclusive = inclusive; + return this; + } + + /** + * Builds a new {@link TaxesOverride} object using the set fields. + * @return {@link TaxesOverride} + */ + public TaxesOverride build() { + return new TaxesOverride(percentage, inclusive); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/TransactionDetails.java b/src/main/java/com/paypal/sdk/models/TransactionDetails.java new file mode 100644 index 0000000..7d9a186 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/TransactionDetails.java @@ -0,0 +1,327 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for TransactionDetails type. + */ +public class TransactionDetails { + private TransactionInformation transactionInfo; + private PayerInformation payerInfo; + private ShippingInformation shippingInfo; + private CartInformation cartInfo; + private StoreInformation storeInfo; + private AuctionInformation auctionInfo; + private IncentiveInformation incentiveInfo; + + /** + * Default constructor. + */ + public TransactionDetails() { + } + + /** + * Initialization constructor. + * @param transactionInfo TransactionInformation value for transactionInfo. + * @param payerInfo PayerInformation value for payerInfo. + * @param shippingInfo ShippingInformation value for shippingInfo. + * @param cartInfo CartInformation value for cartInfo. + * @param storeInfo StoreInformation value for storeInfo. + * @param auctionInfo AuctionInformation value for auctionInfo. + * @param incentiveInfo IncentiveInformation value for incentiveInfo. + */ + public TransactionDetails( + TransactionInformation transactionInfo, + PayerInformation payerInfo, + ShippingInformation shippingInfo, + CartInformation cartInfo, + StoreInformation storeInfo, + AuctionInformation auctionInfo, + IncentiveInformation incentiveInfo) { + this.transactionInfo = transactionInfo; + this.payerInfo = payerInfo; + this.shippingInfo = shippingInfo; + this.cartInfo = cartInfo; + this.storeInfo = storeInfo; + this.auctionInfo = auctionInfo; + this.incentiveInfo = incentiveInfo; + } + + /** + * Getter for TransactionInfo. + * The transaction information. + * @return Returns the TransactionInformation + */ + @JsonGetter("transaction_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public TransactionInformation getTransactionInfo() { + return transactionInfo; + } + + /** + * Setter for TransactionInfo. + * The transaction information. + * @param transactionInfo Value for TransactionInformation + */ + @JsonSetter("transaction_info") + public void setTransactionInfo(TransactionInformation transactionInfo) { + this.transactionInfo = transactionInfo; + } + + /** + * Getter for PayerInfo. + * The payer information. + * @return Returns the PayerInformation + */ + @JsonGetter("payer_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PayerInformation getPayerInfo() { + return payerInfo; + } + + /** + * Setter for PayerInfo. + * The payer information. + * @param payerInfo Value for PayerInformation + */ + @JsonSetter("payer_info") + public void setPayerInfo(PayerInformation payerInfo) { + this.payerInfo = payerInfo; + } + + /** + * Getter for ShippingInfo. + * The shipping information. + * @return Returns the ShippingInformation + */ + @JsonGetter("shipping_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ShippingInformation getShippingInfo() { + return shippingInfo; + } + + /** + * Setter for ShippingInfo. + * The shipping information. + * @param shippingInfo Value for ShippingInformation + */ + @JsonSetter("shipping_info") + public void setShippingInfo(ShippingInformation shippingInfo) { + this.shippingInfo = shippingInfo; + } + + /** + * Getter for CartInfo. + * The cart information. + * @return Returns the CartInformation + */ + @JsonGetter("cart_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CartInformation getCartInfo() { + return cartInfo; + } + + /** + * Setter for CartInfo. + * The cart information. + * @param cartInfo Value for CartInformation + */ + @JsonSetter("cart_info") + public void setCartInfo(CartInformation cartInfo) { + this.cartInfo = cartInfo; + } + + /** + * Getter for StoreInfo. + * The store information. + * @return Returns the StoreInformation + */ + @JsonGetter("store_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public StoreInformation getStoreInfo() { + return storeInfo; + } + + /** + * Setter for StoreInfo. + * The store information. + * @param storeInfo Value for StoreInformation + */ + @JsonSetter("store_info") + public void setStoreInfo(StoreInformation storeInfo) { + this.storeInfo = storeInfo; + } + + /** + * Getter for AuctionInfo. + * The auction information. + * @return Returns the AuctionInformation + */ + @JsonGetter("auction_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public AuctionInformation getAuctionInfo() { + return auctionInfo; + } + + /** + * Setter for AuctionInfo. + * The auction information. + * @param auctionInfo Value for AuctionInformation + */ + @JsonSetter("auction_info") + public void setAuctionInfo(AuctionInformation auctionInfo) { + this.auctionInfo = auctionInfo; + } + + /** + * Getter for IncentiveInfo. + * The incentive details. + * @return Returns the IncentiveInformation + */ + @JsonGetter("incentive_info") + @JsonInclude(JsonInclude.Include.NON_NULL) + public IncentiveInformation getIncentiveInfo() { + return incentiveInfo; + } + + /** + * Setter for IncentiveInfo. + * The incentive details. + * @param incentiveInfo Value for IncentiveInformation + */ + @JsonSetter("incentive_info") + public void setIncentiveInfo(IncentiveInformation incentiveInfo) { + this.incentiveInfo = incentiveInfo; + } + + /** + * Converts this TransactionDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "TransactionDetails [" + "transactionInfo=" + transactionInfo + ", payerInfo=" + + payerInfo + ", shippingInfo=" + shippingInfo + ", cartInfo=" + cartInfo + + ", storeInfo=" + storeInfo + ", auctionInfo=" + auctionInfo + ", incentiveInfo=" + + incentiveInfo + "]"; + } + + /** + * Builds a new {@link TransactionDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link TransactionDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .transactionInfo(getTransactionInfo()) + .payerInfo(getPayerInfo()) + .shippingInfo(getShippingInfo()) + .cartInfo(getCartInfo()) + .storeInfo(getStoreInfo()) + .auctionInfo(getAuctionInfo()) + .incentiveInfo(getIncentiveInfo()); + return builder; + } + + /** + * Class to build instances of {@link TransactionDetails}. + */ + public static class Builder { + private TransactionInformation transactionInfo; + private PayerInformation payerInfo; + private ShippingInformation shippingInfo; + private CartInformation cartInfo; + private StoreInformation storeInfo; + private AuctionInformation auctionInfo; + private IncentiveInformation incentiveInfo; + + + + /** + * Setter for transactionInfo. + * @param transactionInfo TransactionInformation value for transactionInfo. + * @return Builder + */ + public Builder transactionInfo(TransactionInformation transactionInfo) { + this.transactionInfo = transactionInfo; + return this; + } + + /** + * Setter for payerInfo. + * @param payerInfo PayerInformation value for payerInfo. + * @return Builder + */ + public Builder payerInfo(PayerInformation payerInfo) { + this.payerInfo = payerInfo; + return this; + } + + /** + * Setter for shippingInfo. + * @param shippingInfo ShippingInformation value for shippingInfo. + * @return Builder + */ + public Builder shippingInfo(ShippingInformation shippingInfo) { + this.shippingInfo = shippingInfo; + return this; + } + + /** + * Setter for cartInfo. + * @param cartInfo CartInformation value for cartInfo. + * @return Builder + */ + public Builder cartInfo(CartInformation cartInfo) { + this.cartInfo = cartInfo; + return this; + } + + /** + * Setter for storeInfo. + * @param storeInfo StoreInformation value for storeInfo. + * @return Builder + */ + public Builder storeInfo(StoreInformation storeInfo) { + this.storeInfo = storeInfo; + return this; + } + + /** + * Setter for auctionInfo. + * @param auctionInfo AuctionInformation value for auctionInfo. + * @return Builder + */ + public Builder auctionInfo(AuctionInformation auctionInfo) { + this.auctionInfo = auctionInfo; + return this; + } + + /** + * Setter for incentiveInfo. + * @param incentiveInfo IncentiveInformation value for incentiveInfo. + * @return Builder + */ + public Builder incentiveInfo(IncentiveInformation incentiveInfo) { + this.incentiveInfo = incentiveInfo; + return this; + } + + /** + * Builds a new {@link TransactionDetails} object using the set fields. + * @return {@link TransactionDetails} + */ + public TransactionDetails build() { + return new TransactionDetails(transactionInfo, payerInfo, shippingInfo, cartInfo, + storeInfo, auctionInfo, incentiveInfo); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/TransactionInformation.java b/src/main/java/com/paypal/sdk/models/TransactionInformation.java new file mode 100644 index 0000000..e565e75 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/TransactionInformation.java @@ -0,0 +1,1411 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for TransactionInformation type. + */ +public class TransactionInformation { + private String paypalAccountId; + private String transactionId; + private String paypalReferenceId; + private PaypalReferenceIdType paypalReferenceIdType; + private String transactionEventCode; + private String transactionInitiationDate; + private String transactionUpdatedDate; + private Money transactionAmount; + private Money feeAmount; + private Money discountAmount; + private Money insuranceAmount; + private Money salesTaxAmount; + private Money shippingAmount; + private Money shippingDiscountAmount; + private Money shippingTaxAmount; + private Money otherAmount; + private Money tipAmount; + private String transactionStatus; + private String transactionSubject; + private String transactionNote; + private String paymentTrackingId; + private String bankReferenceId; + private Money endingBalance; + private Money availableBalance; + private String invoiceId; + private String customField; + private String protectionEligibility; + private String creditTerm; + private Money creditTransactionalFee; + private Money creditPromotionalFee; + private String annualPercentageRate; + private String paymentMethodType; + private String instrumentType; + private String instrumentSubType; + + /** + * Default constructor. + */ + public TransactionInformation() { + } + + /** + * Initialization constructor. + * @param paypalAccountId String value for paypalAccountId. + * @param transactionId String value for transactionId. + * @param paypalReferenceId String value for paypalReferenceId. + * @param paypalReferenceIdType PaypalReferenceIdType value for paypalReferenceIdType. + * @param transactionEventCode String value for transactionEventCode. + * @param transactionInitiationDate String value for transactionInitiationDate. + * @param transactionUpdatedDate String value for transactionUpdatedDate. + * @param transactionAmount Money value for transactionAmount. + * @param feeAmount Money value for feeAmount. + * @param discountAmount Money value for discountAmount. + * @param insuranceAmount Money value for insuranceAmount. + * @param salesTaxAmount Money value for salesTaxAmount. + * @param shippingAmount Money value for shippingAmount. + * @param shippingDiscountAmount Money value for shippingDiscountAmount. + * @param shippingTaxAmount Money value for shippingTaxAmount. + * @param otherAmount Money value for otherAmount. + * @param tipAmount Money value for tipAmount. + * @param transactionStatus String value for transactionStatus. + * @param transactionSubject String value for transactionSubject. + * @param transactionNote String value for transactionNote. + * @param paymentTrackingId String value for paymentTrackingId. + * @param bankReferenceId String value for bankReferenceId. + * @param endingBalance Money value for endingBalance. + * @param availableBalance Money value for availableBalance. + * @param invoiceId String value for invoiceId. + * @param customField String value for customField. + * @param protectionEligibility String value for protectionEligibility. + * @param creditTerm String value for creditTerm. + * @param creditTransactionalFee Money value for creditTransactionalFee. + * @param creditPromotionalFee Money value for creditPromotionalFee. + * @param annualPercentageRate String value for annualPercentageRate. + * @param paymentMethodType String value for paymentMethodType. + * @param instrumentType String value for instrumentType. + * @param instrumentSubType String value for instrumentSubType. + */ + public TransactionInformation( + String paypalAccountId, + String transactionId, + String paypalReferenceId, + PaypalReferenceIdType paypalReferenceIdType, + String transactionEventCode, + String transactionInitiationDate, + String transactionUpdatedDate, + Money transactionAmount, + Money feeAmount, + Money discountAmount, + Money insuranceAmount, + Money salesTaxAmount, + Money shippingAmount, + Money shippingDiscountAmount, + Money shippingTaxAmount, + Money otherAmount, + Money tipAmount, + String transactionStatus, + String transactionSubject, + String transactionNote, + String paymentTrackingId, + String bankReferenceId, + Money endingBalance, + Money availableBalance, + String invoiceId, + String customField, + String protectionEligibility, + String creditTerm, + Money creditTransactionalFee, + Money creditPromotionalFee, + String annualPercentageRate, + String paymentMethodType, + String instrumentType, + String instrumentSubType) { + this.paypalAccountId = paypalAccountId; + this.transactionId = transactionId; + this.paypalReferenceId = paypalReferenceId; + this.paypalReferenceIdType = paypalReferenceIdType; + this.transactionEventCode = transactionEventCode; + this.transactionInitiationDate = transactionInitiationDate; + this.transactionUpdatedDate = transactionUpdatedDate; + this.transactionAmount = transactionAmount; + this.feeAmount = feeAmount; + this.discountAmount = discountAmount; + this.insuranceAmount = insuranceAmount; + this.salesTaxAmount = salesTaxAmount; + this.shippingAmount = shippingAmount; + this.shippingDiscountAmount = shippingDiscountAmount; + this.shippingTaxAmount = shippingTaxAmount; + this.otherAmount = otherAmount; + this.tipAmount = tipAmount; + this.transactionStatus = transactionStatus; + this.transactionSubject = transactionSubject; + this.transactionNote = transactionNote; + this.paymentTrackingId = paymentTrackingId; + this.bankReferenceId = bankReferenceId; + this.endingBalance = endingBalance; + this.availableBalance = availableBalance; + this.invoiceId = invoiceId; + this.customField = customField; + this.protectionEligibility = protectionEligibility; + this.creditTerm = creditTerm; + this.creditTransactionalFee = creditTransactionalFee; + this.creditPromotionalFee = creditPromotionalFee; + this.annualPercentageRate = annualPercentageRate; + this.paymentMethodType = paymentMethodType; + this.instrumentType = instrumentType; + this.instrumentSubType = instrumentSubType; + } + + /** + * Getter for PaypalAccountId. + * The ID of the PayPal account of the counterparty. + * @return Returns the String + */ + @JsonGetter("paypal_account_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalAccountId() { + return paypalAccountId; + } + + /** + * Setter for PaypalAccountId. + * The ID of the PayPal account of the counterparty. + * @param paypalAccountId Value for String + */ + @JsonSetter("paypal_account_id") + public void setPaypalAccountId(String paypalAccountId) { + this.paypalAccountId = paypalAccountId; + } + + /** + * Getter for TransactionId. + * The PayPal-generated transaction ID. + * @return Returns the String + */ + @JsonGetter("transaction_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionId() { + return transactionId; + } + + /** + * Setter for TransactionId. + * The PayPal-generated transaction ID. + * @param transactionId Value for String + */ + @JsonSetter("transaction_id") + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + /** + * Getter for PaypalReferenceId. + * The PayPal-generated base ID. PayPal exclusive. Cannot be altered. Defined as a related, + * pre-existing transaction or event. + * @return Returns the String + */ + @JsonGetter("paypal_reference_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaypalReferenceId() { + return paypalReferenceId; + } + + /** + * Setter for PaypalReferenceId. + * The PayPal-generated base ID. PayPal exclusive. Cannot be altered. Defined as a related, + * pre-existing transaction or event. + * @param paypalReferenceId Value for String + */ + @JsonSetter("paypal_reference_id") + public void setPaypalReferenceId(String paypalReferenceId) { + this.paypalReferenceId = paypalReferenceId; + } + + /** + * Getter for PaypalReferenceIdType. + * The PayPal reference ID type. + * @return Returns the PaypalReferenceIdType + */ + @JsonGetter("paypal_reference_id_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public PaypalReferenceIdType getPaypalReferenceIdType() { + return paypalReferenceIdType; + } + + /** + * Setter for PaypalReferenceIdType. + * The PayPal reference ID type. + * @param paypalReferenceIdType Value for PaypalReferenceIdType + */ + @JsonSetter("paypal_reference_id_type") + public void setPaypalReferenceIdType(PaypalReferenceIdType paypalReferenceIdType) { + this.paypalReferenceIdType = paypalReferenceIdType; + } + + /** + * Getter for TransactionEventCode. + * A five-digit transaction event code that classifies the transaction type based on money + * movement and debit or credit. For example, T0001. See [Transaction event + * codes](/docs/integration/direct/transaction-search/transaction-event-codes/). + * @return Returns the String + */ + @JsonGetter("transaction_event_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionEventCode() { + return transactionEventCode; + } + + /** + * Setter for TransactionEventCode. + * A five-digit transaction event code that classifies the transaction type based on money + * movement and debit or credit. For example, T0001. See [Transaction event + * codes](/docs/integration/direct/transaction-search/transaction-event-codes/). + * @param transactionEventCode Value for String + */ + @JsonSetter("transaction_event_code") + public void setTransactionEventCode(String transactionEventCode) { + this.transactionEventCode = transactionEventCode; + } + + /** + * Getter for TransactionInitiationDate. + * 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. + * @return Returns the String + */ + @JsonGetter("transaction_initiation_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionInitiationDate() { + return transactionInitiationDate; + } + + /** + * Setter for TransactionInitiationDate. + * 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. + * @param transactionInitiationDate Value for String + */ + @JsonSetter("transaction_initiation_date") + public void setTransactionInitiationDate(String transactionInitiationDate) { + this.transactionInitiationDate = transactionInitiationDate; + } + + /** + * Getter for TransactionUpdatedDate. + * 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. + * @return Returns the String + */ + @JsonGetter("transaction_updated_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionUpdatedDate() { + return transactionUpdatedDate; + } + + /** + * Setter for TransactionUpdatedDate. + * 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. + * @param transactionUpdatedDate Value for String + */ + @JsonSetter("transaction_updated_date") + public void setTransactionUpdatedDate(String transactionUpdatedDate) { + this.transactionUpdatedDate = transactionUpdatedDate; + } + + /** + * Getter for TransactionAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("transaction_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTransactionAmount() { + return transactionAmount; + } + + /** + * Setter for TransactionAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param transactionAmount Value for Money + */ + @JsonSetter("transaction_amount") + public void setTransactionAmount(Money transactionAmount) { + this.transactionAmount = transactionAmount; + } + + /** + * Getter for FeeAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("fee_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getFeeAmount() { + return feeAmount; + } + + /** + * Setter for FeeAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param feeAmount Value for Money + */ + @JsonSetter("fee_amount") + public void setFeeAmount(Money feeAmount) { + this.feeAmount = feeAmount; + } + + /** + * Getter for DiscountAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("discount_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getDiscountAmount() { + return discountAmount; + } + + /** + * Setter for DiscountAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param discountAmount Value for Money + */ + @JsonSetter("discount_amount") + public void setDiscountAmount(Money discountAmount) { + this.discountAmount = discountAmount; + } + + /** + * Getter for InsuranceAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("insurance_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getInsuranceAmount() { + return insuranceAmount; + } + + /** + * Setter for InsuranceAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param insuranceAmount Value for Money + */ + @JsonSetter("insurance_amount") + public void setInsuranceAmount(Money insuranceAmount) { + this.insuranceAmount = insuranceAmount; + } + + /** + * Getter for SalesTaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("sales_tax_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getSalesTaxAmount() { + return salesTaxAmount; + } + + /** + * Setter for SalesTaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param salesTaxAmount Value for Money + */ + @JsonSetter("sales_tax_amount") + public void setSalesTaxAmount(Money salesTaxAmount) { + this.salesTaxAmount = salesTaxAmount; + } + + /** + * Getter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingAmount() { + return shippingAmount; + } + + /** + * Setter for ShippingAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingAmount Value for Money + */ + @JsonSetter("shipping_amount") + public void setShippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + } + + /** + * Getter for ShippingDiscountAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_discount_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingDiscountAmount() { + return shippingDiscountAmount; + } + + /** + * Setter for ShippingDiscountAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingDiscountAmount Value for Money + */ + @JsonSetter("shipping_discount_amount") + public void setShippingDiscountAmount(Money shippingDiscountAmount) { + this.shippingDiscountAmount = shippingDiscountAmount; + } + + /** + * Getter for ShippingTaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("shipping_tax_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getShippingTaxAmount() { + return shippingTaxAmount; + } + + /** + * Setter for ShippingTaxAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param shippingTaxAmount Value for Money + */ + @JsonSetter("shipping_tax_amount") + public void setShippingTaxAmount(Money shippingTaxAmount) { + this.shippingTaxAmount = shippingTaxAmount; + } + + /** + * Getter for OtherAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("other_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getOtherAmount() { + return otherAmount; + } + + /** + * Setter for OtherAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param otherAmount Value for Money + */ + @JsonSetter("other_amount") + public void setOtherAmount(Money otherAmount) { + this.otherAmount = otherAmount; + } + + /** + * Getter for TipAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("tip_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getTipAmount() { + return tipAmount; + } + + /** + * Setter for TipAmount. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param tipAmount Value for Money + */ + @JsonSetter("tip_amount") + public void setTipAmount(Money tipAmount) { + this.tipAmount = tipAmount; + } + + /** + * Getter for TransactionStatus. + * A code that indicates the transaction status. Value is: Status code Description D PayPal or + * merchant rules denied the transaction. P The transaction is pending. The transaction was + * created but waits for another payment process to complete, such as an ACH transaction, before + * the status changes to S. S The transaction successfully completed without a denial and after + * any pending statuses. V A successful transaction was fully reversed and funds were refunded + * to the original sender. + * @return Returns the String + */ + @JsonGetter("transaction_status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionStatus() { + return transactionStatus; + } + + /** + * Setter for TransactionStatus. + * A code that indicates the transaction status. Value is: Status code Description D PayPal or + * merchant rules denied the transaction. P The transaction is pending. The transaction was + * created but waits for another payment process to complete, such as an ACH transaction, before + * the status changes to S. S The transaction successfully completed without a denial and after + * any pending statuses. V A successful transaction was fully reversed and funds were refunded + * to the original sender. + * @param transactionStatus Value for String + */ + @JsonSetter("transaction_status") + public void setTransactionStatus(String transactionStatus) { + this.transactionStatus = transactionStatus; + } + + /** + * Getter for TransactionSubject. + * The subject of payment. The payer passes this value to the payee. The payer controls this + * data through the interface through which he or she sends the data. + * @return Returns the String + */ + @JsonGetter("transaction_subject") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionSubject() { + return transactionSubject; + } + + /** + * Setter for TransactionSubject. + * The subject of payment. The payer passes this value to the payee. The payer controls this + * data through the interface through which he or she sends the data. + * @param transactionSubject Value for String + */ + @JsonSetter("transaction_subject") + public void setTransactionSubject(String transactionSubject) { + this.transactionSubject = transactionSubject; + } + + /** + * Getter for TransactionNote. + * A special note that the payer passes to the payee. Might contain special customer requests, + * such as shipping instructions. + * @return Returns the String + */ + @JsonGetter("transaction_note") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTransactionNote() { + return transactionNote; + } + + /** + * Setter for TransactionNote. + * A special note that the payer passes to the payee. Might contain special customer requests, + * such as shipping instructions. + * @param transactionNote Value for String + */ + @JsonSetter("transaction_note") + public void setTransactionNote(String transactionNote) { + this.transactionNote = transactionNote; + } + + /** + * Getter for PaymentTrackingId. + * The payment tracking ID, which is a unique ID that partners specify to either get information + * about a payment or request a refund. + * @return Returns the String + */ + @JsonGetter("payment_tracking_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaymentTrackingId() { + return paymentTrackingId; + } + + /** + * Setter for PaymentTrackingId. + * The payment tracking ID, which is a unique ID that partners specify to either get information + * about a payment or request a refund. + * @param paymentTrackingId Value for String + */ + @JsonSetter("payment_tracking_id") + public void setPaymentTrackingId(String paymentTrackingId) { + this.paymentTrackingId = paymentTrackingId; + } + + /** + * Getter for BankReferenceId. + * The bank reference ID. The bank provides this value for an ACH transaction. + * @return Returns the String + */ + @JsonGetter("bank_reference_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getBankReferenceId() { + return bankReferenceId; + } + + /** + * Setter for BankReferenceId. + * The bank reference ID. The bank provides this value for an ACH transaction. + * @param bankReferenceId Value for String + */ + @JsonSetter("bank_reference_id") + public void setBankReferenceId(String bankReferenceId) { + this.bankReferenceId = bankReferenceId; + } + + /** + * Getter for EndingBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("ending_balance") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getEndingBalance() { + return endingBalance; + } + + /** + * Setter for EndingBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param endingBalance Value for Money + */ + @JsonSetter("ending_balance") + public void setEndingBalance(Money endingBalance) { + this.endingBalance = endingBalance; + } + + /** + * Getter for AvailableBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("available_balance") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getAvailableBalance() { + return availableBalance; + } + + /** + * Setter for AvailableBalance. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param availableBalance Value for Money + */ + @JsonSetter("available_balance") + public void setAvailableBalance(Money availableBalance) { + this.availableBalance = availableBalance; + } + + /** + * Getter for InvoiceId. + * The invoice ID that is sent by the merchant with the transaction. Note: If an invoice ID was + * sent with the capture request, the value is reported. Otherwise, the invoice ID of the + * authorizing transaction is reported. + * @return Returns the String + */ + @JsonGetter("invoice_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getInvoiceId() { + return invoiceId; + } + + /** + * Setter for InvoiceId. + * The invoice ID that is sent by the merchant with the transaction. Note: If an invoice ID was + * sent with the capture request, the value is reported. Otherwise, the invoice ID of the + * authorizing transaction is reported. + * @param invoiceId Value for String + */ + @JsonSetter("invoice_id") + public void setInvoiceId(String invoiceId) { + this.invoiceId = invoiceId; + } + + /** + * Getter for CustomField. + * The merchant-provided custom text. Note: Usually, this field includes the unique ID for + * payments made with MassPay type transaction. + * @return Returns the String + */ + @JsonGetter("custom_field") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCustomField() { + return customField; + } + + /** + * Setter for CustomField. + * The merchant-provided custom text. Note: Usually, this field includes the unique ID for + * payments made with MassPay type transaction. + * @param customField Value for String + */ + @JsonSetter("custom_field") + public void setCustomField(String customField) { + this.customField = customField; + } + + /** + * Getter for ProtectionEligibility. + * Indicates whether the transaction is eligible for protection. Value is: 01. Eligible. 02. Not + * eligible 03. Partially eligible. + * @return Returns the String + */ + @JsonGetter("protection_eligibility") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getProtectionEligibility() { + return protectionEligibility; + } + + /** + * Setter for ProtectionEligibility. + * Indicates whether the transaction is eligible for protection. Value is: 01. Eligible. 02. Not + * eligible 03. Partially eligible. + * @param protectionEligibility Value for String + */ + @JsonSetter("protection_eligibility") + public void setProtectionEligibility(String protectionEligibility) { + this.protectionEligibility = protectionEligibility; + } + + /** + * Getter for CreditTerm. + * The credit term. The time span covered by the installment payments as expressed in the term + * length plus the length time unit code. + * @return Returns the String + */ + @JsonGetter("credit_term") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreditTerm() { + return creditTerm; + } + + /** + * Setter for CreditTerm. + * The credit term. The time span covered by the installment payments as expressed in the term + * length plus the length time unit code. + * @param creditTerm Value for String + */ + @JsonSetter("credit_term") + public void setCreditTerm(String creditTerm) { + this.creditTerm = creditTerm; + } + + /** + * Getter for CreditTransactionalFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("credit_transactional_fee") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getCreditTransactionalFee() { + return creditTransactionalFee; + } + + /** + * Setter for CreditTransactionalFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param creditTransactionalFee Value for Money + */ + @JsonSetter("credit_transactional_fee") + public void setCreditTransactionalFee(Money creditTransactionalFee) { + this.creditTransactionalFee = creditTransactionalFee; + } + + /** + * Getter for CreditPromotionalFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @return Returns the Money + */ + @JsonGetter("credit_promotional_fee") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Money getCreditPromotionalFee() { + return creditPromotionalFee; + } + + /** + * Setter for CreditPromotionalFee. + * The currency and amount for a financial transaction, such as a balance or payment due. + * @param creditPromotionalFee Value for Money + */ + @JsonSetter("credit_promotional_fee") + public void setCreditPromotionalFee(Money creditPromotionalFee) { + this.creditPromotionalFee = creditPromotionalFee; + } + + /** + * Getter for AnnualPercentageRate. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @return Returns the String + */ + @JsonGetter("annual_percentage_rate") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAnnualPercentageRate() { + return annualPercentageRate; + } + + /** + * Setter for AnnualPercentageRate. + * The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% + * interest rate as `19.99`. + * @param annualPercentageRate Value for String + */ + @JsonSetter("annual_percentage_rate") + public void setAnnualPercentageRate(String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + } + + /** + * Getter for PaymentMethodType. + * The payment method that was used for a transaction. Value is PUI, installment, or mEFT. Note: + * Appears only for pay upon invoice (PUI), installment, and mEFT transactions. Merchants and + * partners in the EMEA region can use this attribute to note transactions that attract + * turn-over tax. + * @return Returns the String + */ + @JsonGetter("payment_method_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaymentMethodType() { + return paymentMethodType; + } + + /** + * Setter for PaymentMethodType. + * The payment method that was used for a transaction. Value is PUI, installment, or mEFT. Note: + * Appears only for pay upon invoice (PUI), installment, and mEFT transactions. Merchants and + * partners in the EMEA region can use this attribute to note transactions that attract + * turn-over tax. + * @param paymentMethodType Value for String + */ + @JsonSetter("payment_method_type") + public void setPaymentMethodType(String paymentMethodType) { + this.paymentMethodType = paymentMethodType; + } + + /** + * Getter for InstrumentType. + * 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). + * @return Returns the String + */ + @JsonGetter("instrument_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getInstrumentType() { + return instrumentType; + } + + /** + * Setter for InstrumentType. + * 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). + * @param instrumentType Value for String + */ + @JsonSetter("instrument_type") + public void setInstrumentType(String instrumentType) { + this.instrumentType = instrumentType; + } + + /** + * Getter for InstrumentSubType. + * 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. + * @return Returns the String + */ + @JsonGetter("instrument_sub_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getInstrumentSubType() { + return instrumentSubType; + } + + /** + * Setter for InstrumentSubType. + * 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. + * @param instrumentSubType Value for String + */ + @JsonSetter("instrument_sub_type") + public void setInstrumentSubType(String instrumentSubType) { + this.instrumentSubType = instrumentSubType; + } + + /** + * Converts this TransactionInformation into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "TransactionInformation [" + "paypalAccountId=" + paypalAccountId + + ", transactionId=" + transactionId + ", paypalReferenceId=" + paypalReferenceId + + ", paypalReferenceIdType=" + paypalReferenceIdType + ", transactionEventCode=" + + transactionEventCode + ", transactionInitiationDate=" + transactionInitiationDate + + ", transactionUpdatedDate=" + transactionUpdatedDate + ", transactionAmount=" + + transactionAmount + ", feeAmount=" + feeAmount + ", discountAmount=" + + discountAmount + ", insuranceAmount=" + insuranceAmount + ", salesTaxAmount=" + + salesTaxAmount + ", shippingAmount=" + shippingAmount + + ", shippingDiscountAmount=" + shippingDiscountAmount + ", shippingTaxAmount=" + + shippingTaxAmount + ", otherAmount=" + otherAmount + ", tipAmount=" + tipAmount + + ", transactionStatus=" + transactionStatus + ", transactionSubject=" + + transactionSubject + ", transactionNote=" + transactionNote + + ", paymentTrackingId=" + paymentTrackingId + ", bankReferenceId=" + + bankReferenceId + ", endingBalance=" + endingBalance + ", availableBalance=" + + availableBalance + ", invoiceId=" + invoiceId + ", customField=" + customField + + ", protectionEligibility=" + protectionEligibility + ", creditTerm=" + creditTerm + + ", creditTransactionalFee=" + creditTransactionalFee + ", creditPromotionalFee=" + + creditPromotionalFee + ", annualPercentageRate=" + annualPercentageRate + + ", paymentMethodType=" + paymentMethodType + ", instrumentType=" + instrumentType + + ", instrumentSubType=" + instrumentSubType + "]"; + } + + /** + * Builds a new {@link TransactionInformation.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link TransactionInformation.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .paypalAccountId(getPaypalAccountId()) + .transactionId(getTransactionId()) + .paypalReferenceId(getPaypalReferenceId()) + .paypalReferenceIdType(getPaypalReferenceIdType()) + .transactionEventCode(getTransactionEventCode()) + .transactionInitiationDate(getTransactionInitiationDate()) + .transactionUpdatedDate(getTransactionUpdatedDate()) + .transactionAmount(getTransactionAmount()) + .feeAmount(getFeeAmount()) + .discountAmount(getDiscountAmount()) + .insuranceAmount(getInsuranceAmount()) + .salesTaxAmount(getSalesTaxAmount()) + .shippingAmount(getShippingAmount()) + .shippingDiscountAmount(getShippingDiscountAmount()) + .shippingTaxAmount(getShippingTaxAmount()) + .otherAmount(getOtherAmount()) + .tipAmount(getTipAmount()) + .transactionStatus(getTransactionStatus()) + .transactionSubject(getTransactionSubject()) + .transactionNote(getTransactionNote()) + .paymentTrackingId(getPaymentTrackingId()) + .bankReferenceId(getBankReferenceId()) + .endingBalance(getEndingBalance()) + .availableBalance(getAvailableBalance()) + .invoiceId(getInvoiceId()) + .customField(getCustomField()) + .protectionEligibility(getProtectionEligibility()) + .creditTerm(getCreditTerm()) + .creditTransactionalFee(getCreditTransactionalFee()) + .creditPromotionalFee(getCreditPromotionalFee()) + .annualPercentageRate(getAnnualPercentageRate()) + .paymentMethodType(getPaymentMethodType()) + .instrumentType(getInstrumentType()) + .instrumentSubType(getInstrumentSubType()); + return builder; + } + + /** + * Class to build instances of {@link TransactionInformation}. + */ + public static class Builder { + private String paypalAccountId; + private String transactionId; + private String paypalReferenceId; + private PaypalReferenceIdType paypalReferenceIdType; + private String transactionEventCode; + private String transactionInitiationDate; + private String transactionUpdatedDate; + private Money transactionAmount; + private Money feeAmount; + private Money discountAmount; + private Money insuranceAmount; + private Money salesTaxAmount; + private Money shippingAmount; + private Money shippingDiscountAmount; + private Money shippingTaxAmount; + private Money otherAmount; + private Money tipAmount; + private String transactionStatus; + private String transactionSubject; + private String transactionNote; + private String paymentTrackingId; + private String bankReferenceId; + private Money endingBalance; + private Money availableBalance; + private String invoiceId; + private String customField; + private String protectionEligibility; + private String creditTerm; + private Money creditTransactionalFee; + private Money creditPromotionalFee; + private String annualPercentageRate; + private String paymentMethodType; + private String instrumentType; + private String instrumentSubType; + + + + /** + * Setter for paypalAccountId. + * @param paypalAccountId String value for paypalAccountId. + * @return Builder + */ + public Builder paypalAccountId(String paypalAccountId) { + this.paypalAccountId = paypalAccountId; + return this; + } + + /** + * Setter for transactionId. + * @param transactionId String value for transactionId. + * @return Builder + */ + public Builder transactionId(String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Setter for paypalReferenceId. + * @param paypalReferenceId String value for paypalReferenceId. + * @return Builder + */ + public Builder paypalReferenceId(String paypalReferenceId) { + this.paypalReferenceId = paypalReferenceId; + return this; + } + + /** + * Setter for paypalReferenceIdType. + * @param paypalReferenceIdType PaypalReferenceIdType value for paypalReferenceIdType. + * @return Builder + */ + public Builder paypalReferenceIdType(PaypalReferenceIdType paypalReferenceIdType) { + this.paypalReferenceIdType = paypalReferenceIdType; + return this; + } + + /** + * Setter for transactionEventCode. + * @param transactionEventCode String value for transactionEventCode. + * @return Builder + */ + public Builder transactionEventCode(String transactionEventCode) { + this.transactionEventCode = transactionEventCode; + return this; + } + + /** + * Setter for transactionInitiationDate. + * @param transactionInitiationDate String value for transactionInitiationDate. + * @return Builder + */ + public Builder transactionInitiationDate(String transactionInitiationDate) { + this.transactionInitiationDate = transactionInitiationDate; + return this; + } + + /** + * Setter for transactionUpdatedDate. + * @param transactionUpdatedDate String value for transactionUpdatedDate. + * @return Builder + */ + public Builder transactionUpdatedDate(String transactionUpdatedDate) { + this.transactionUpdatedDate = transactionUpdatedDate; + return this; + } + + /** + * Setter for transactionAmount. + * @param transactionAmount Money value for transactionAmount. + * @return Builder + */ + public Builder transactionAmount(Money transactionAmount) { + this.transactionAmount = transactionAmount; + return this; + } + + /** + * Setter for feeAmount. + * @param feeAmount Money value for feeAmount. + * @return Builder + */ + public Builder feeAmount(Money feeAmount) { + this.feeAmount = feeAmount; + return this; + } + + /** + * Setter for discountAmount. + * @param discountAmount Money value for discountAmount. + * @return Builder + */ + public Builder discountAmount(Money discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Setter for insuranceAmount. + * @param insuranceAmount Money value for insuranceAmount. + * @return Builder + */ + public Builder insuranceAmount(Money insuranceAmount) { + this.insuranceAmount = insuranceAmount; + return this; + } + + /** + * Setter for salesTaxAmount. + * @param salesTaxAmount Money value for salesTaxAmount. + * @return Builder + */ + public Builder salesTaxAmount(Money salesTaxAmount) { + this.salesTaxAmount = salesTaxAmount; + return this; + } + + /** + * Setter for shippingAmount. + * @param shippingAmount Money value for shippingAmount. + * @return Builder + */ + public Builder shippingAmount(Money shippingAmount) { + this.shippingAmount = shippingAmount; + return this; + } + + /** + * Setter for shippingDiscountAmount. + * @param shippingDiscountAmount Money value for shippingDiscountAmount. + * @return Builder + */ + public Builder shippingDiscountAmount(Money shippingDiscountAmount) { + this.shippingDiscountAmount = shippingDiscountAmount; + return this; + } + + /** + * Setter for shippingTaxAmount. + * @param shippingTaxAmount Money value for shippingTaxAmount. + * @return Builder + */ + public Builder shippingTaxAmount(Money shippingTaxAmount) { + this.shippingTaxAmount = shippingTaxAmount; + return this; + } + + /** + * Setter for otherAmount. + * @param otherAmount Money value for otherAmount. + * @return Builder + */ + public Builder otherAmount(Money otherAmount) { + this.otherAmount = otherAmount; + return this; + } + + /** + * Setter for tipAmount. + * @param tipAmount Money value for tipAmount. + * @return Builder + */ + public Builder tipAmount(Money tipAmount) { + this.tipAmount = tipAmount; + return this; + } + + /** + * Setter for transactionStatus. + * @param transactionStatus String value for transactionStatus. + * @return Builder + */ + public Builder transactionStatus(String transactionStatus) { + this.transactionStatus = transactionStatus; + return this; + } + + /** + * Setter for transactionSubject. + * @param transactionSubject String value for transactionSubject. + * @return Builder + */ + public Builder transactionSubject(String transactionSubject) { + this.transactionSubject = transactionSubject; + return this; + } + + /** + * Setter for transactionNote. + * @param transactionNote String value for transactionNote. + * @return Builder + */ + public Builder transactionNote(String transactionNote) { + this.transactionNote = transactionNote; + return this; + } + + /** + * Setter for paymentTrackingId. + * @param paymentTrackingId String value for paymentTrackingId. + * @return Builder + */ + public Builder paymentTrackingId(String paymentTrackingId) { + this.paymentTrackingId = paymentTrackingId; + return this; + } + + /** + * Setter for bankReferenceId. + * @param bankReferenceId String value for bankReferenceId. + * @return Builder + */ + public Builder bankReferenceId(String bankReferenceId) { + this.bankReferenceId = bankReferenceId; + return this; + } + + /** + * Setter for endingBalance. + * @param endingBalance Money value for endingBalance. + * @return Builder + */ + public Builder endingBalance(Money endingBalance) { + this.endingBalance = endingBalance; + return this; + } + + /** + * Setter for availableBalance. + * @param availableBalance Money value for availableBalance. + * @return Builder + */ + public Builder availableBalance(Money availableBalance) { + this.availableBalance = availableBalance; + return this; + } + + /** + * Setter for invoiceId. + * @param invoiceId String value for invoiceId. + * @return Builder + */ + public Builder invoiceId(String invoiceId) { + this.invoiceId = invoiceId; + return this; + } + + /** + * Setter for customField. + * @param customField String value for customField. + * @return Builder + */ + public Builder customField(String customField) { + this.customField = customField; + return this; + } + + /** + * Setter for protectionEligibility. + * @param protectionEligibility String value for protectionEligibility. + * @return Builder + */ + public Builder protectionEligibility(String protectionEligibility) { + this.protectionEligibility = protectionEligibility; + return this; + } + + /** + * Setter for creditTerm. + * @param creditTerm String value for creditTerm. + * @return Builder + */ + public Builder creditTerm(String creditTerm) { + this.creditTerm = creditTerm; + return this; + } + + /** + * Setter for creditTransactionalFee. + * @param creditTransactionalFee Money value for creditTransactionalFee. + * @return Builder + */ + public Builder creditTransactionalFee(Money creditTransactionalFee) { + this.creditTransactionalFee = creditTransactionalFee; + return this; + } + + /** + * Setter for creditPromotionalFee. + * @param creditPromotionalFee Money value for creditPromotionalFee. + * @return Builder + */ + public Builder creditPromotionalFee(Money creditPromotionalFee) { + this.creditPromotionalFee = creditPromotionalFee; + return this; + } + + /** + * Setter for annualPercentageRate. + * @param annualPercentageRate String value for annualPercentageRate. + * @return Builder + */ + public Builder annualPercentageRate(String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + return this; + } + + /** + * Setter for paymentMethodType. + * @param paymentMethodType String value for paymentMethodType. + * @return Builder + */ + public Builder paymentMethodType(String paymentMethodType) { + this.paymentMethodType = paymentMethodType; + return this; + } + + /** + * Setter for instrumentType. + * @param instrumentType String value for instrumentType. + * @return Builder + */ + public Builder instrumentType(String instrumentType) { + this.instrumentType = instrumentType; + return this; + } + + /** + * Setter for instrumentSubType. + * @param instrumentSubType String value for instrumentSubType. + * @return Builder + */ + public Builder instrumentSubType(String instrumentSubType) { + this.instrumentSubType = instrumentSubType; + return this; + } + + /** + * Builds a new {@link TransactionInformation} object using the set fields. + * @return {@link TransactionInformation} + */ + public TransactionInformation build() { + return new TransactionInformation(paypalAccountId, transactionId, paypalReferenceId, + paypalReferenceIdType, transactionEventCode, transactionInitiationDate, + transactionUpdatedDate, transactionAmount, feeAmount, discountAmount, + insuranceAmount, salesTaxAmount, shippingAmount, shippingDiscountAmount, + shippingTaxAmount, otherAmount, tipAmount, transactionStatus, + transactionSubject, transactionNote, paymentTrackingId, bankReferenceId, + endingBalance, availableBalance, invoiceId, customField, protectionEligibility, + creditTerm, creditTransactionalFee, creditPromotionalFee, annualPercentageRate, + paymentMethodType, instrumentType, instrumentSubType); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackErrorResponseDetails.java b/src/main/java/com/paypal/sdk/models/TransactionSearchErrorDetails.java similarity index 53% rename from src/main/java/com/paypal/sdk/models/OrderUpdateCallbackErrorResponseDetails.java rename to src/main/java/com/paypal/sdk/models/TransactionSearchErrorDetails.java index 62963c5..85b9947 100644 --- a/src/main/java/com/paypal/sdk/models/OrderUpdateCallbackErrorResponseDetails.java +++ b/src/main/java/com/paypal/sdk/models/TransactionSearchErrorDetails.java @@ -11,17 +11,20 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for OrderUpdateCallbackErrorResponseDetails type. + * This is a model class for TransactionSearchErrorDetails type. */ -public class OrderUpdateCallbackErrorResponseDetails { +public class TransactionSearchErrorDetails { private String field; private String value; + private String location; private String issue; + private String description; /** * Default constructor. */ - public OrderUpdateCallbackErrorResponseDetails() { + public TransactionSearchErrorDetails() { + location = "body"; } /** @@ -29,14 +32,20 @@ public OrderUpdateCallbackErrorResponseDetails() { * @param issue String value for issue. * @param field String value for field. * @param value String value for value. + * @param location String value for location. + * @param description String value for description. */ - public OrderUpdateCallbackErrorResponseDetails( + public TransactionSearchErrorDetails( String issue, String field, - String value) { + String value, + String location, + String description) { this.field = field; this.value = value; + this.location = location; this.issue = issue; + this.description = description; } /** @@ -83,6 +92,27 @@ public void setValue(String value) { this.value = value; } + /** + * Getter for Location. + * The location of the field that caused the error. Value is `body`, `path`, or `query`. + * @return Returns the String + */ + @JsonGetter("location") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getLocation() { + return location; + } + + /** + * Setter for Location. + * The location of the field that caused the error. Value is `body`, `path`, or `query`. + * @param location Value for String + */ + @JsonSetter("location") + public void setLocation(String location) { + this.location = location; + } + /** * Getter for Issue. * The unique, fine-grained application-level error code. @@ -104,34 +134,62 @@ public void setIssue(String issue) { } /** - * Converts this OrderUpdateCallbackErrorResponseDetails into string format. + * Getter for Description. + * 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. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * 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. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Converts this TransactionSearchErrorDetails into string format. * @return String representation of this class */ @Override public String toString() { - return "OrderUpdateCallbackErrorResponseDetails [" + "issue=" + issue + ", field=" + field - + ", value=" + value + "]"; + return "TransactionSearchErrorDetails [" + "issue=" + issue + ", field=" + field + + ", value=" + value + ", location=" + location + ", description=" + description + + "]"; } /** - * Builds a new {@link OrderUpdateCallbackErrorResponseDetails.Builder} object. + * Builds a new {@link TransactionSearchErrorDetails.Builder} object. * Creates the instance with the state of the current model. - * @return a new {@link OrderUpdateCallbackErrorResponseDetails.Builder} object + * @return a new {@link TransactionSearchErrorDetails.Builder} object */ public Builder toBuilder() { Builder builder = new Builder(issue) .field(getField()) - .value(getValue()); + .value(getValue()) + .location(getLocation()) + .description(getDescription()); return builder; } /** - * Class to build instances of {@link OrderUpdateCallbackErrorResponseDetails}. + * Class to build instances of {@link TransactionSearchErrorDetails}. */ public static class Builder { private String issue; private String field; private String value; + private String location = "body"; + private String description; /** * Initialization constructor. @@ -178,11 +236,31 @@ public Builder value(String value) { } /** - * Builds a new {@link OrderUpdateCallbackErrorResponseDetails} object using the set fields. - * @return {@link OrderUpdateCallbackErrorResponseDetails} + * Setter for location. + * @param location String value for location. + * @return Builder + */ + public Builder location(String location) { + this.location = location; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Builds a new {@link TransactionSearchErrorDetails} object using the set fields. + * @return {@link TransactionSearchErrorDetails} */ - public OrderUpdateCallbackErrorResponseDetails build() { - return new OrderUpdateCallbackErrorResponseDetails(issue, field, value); + public TransactionSearchErrorDetails build() { + return new TransactionSearchErrorDetails(issue, field, value, location, description); } } } diff --git a/src/main/java/com/paypal/sdk/models/TransactionsList.java b/src/main/java/com/paypal/sdk/models/TransactionsList.java new file mode 100644 index 0000000..35b0287 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/TransactionsList.java @@ -0,0 +1,216 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for TransactionsList type. + */ +public class TransactionsList { + private List transactions; + private Integer totalItems; + private Integer totalPages; + private List links; + + /** + * Default constructor. + */ + public TransactionsList() { + } + + /** + * Initialization constructor. + * @param transactions List of SubscriptionTransactionDetails value for transactions. + * @param totalItems Integer value for totalItems. + * @param totalPages Integer value for totalPages. + * @param links List of LinkDescription value for links. + */ + public TransactionsList( + List transactions, + Integer totalItems, + Integer totalPages, + List links) { + this.transactions = transactions; + this.totalItems = totalItems; + this.totalPages = totalPages; + this.links = links; + } + + /** + * Getter for Transactions. + * An array of transactions. + * @return Returns the List of SubscriptionTransactionDetails + */ + @JsonGetter("transactions") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTransactions() { + return transactions; + } + + /** + * Setter for Transactions. + * An array of transactions. + * @param transactions Value for List of SubscriptionTransactionDetails + */ + @JsonSetter("transactions") + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + /** + * Getter for TotalItems. + * The total number of items. + * @return Returns the Integer + */ + @JsonGetter("total_items") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalItems() { + return totalItems; + } + + /** + * Setter for TotalItems. + * The total number of items. + * @param totalItems Value for Integer + */ + @JsonSetter("total_items") + public void setTotalItems(Integer totalItems) { + this.totalItems = totalItems; + } + + /** + * Getter for TotalPages. + * The total number of pages. + * @return Returns the Integer + */ + @JsonGetter("total_pages") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalPages() { + return totalPages; + } + + /** + * Setter for TotalPages. + * The total number of pages. + * @param totalPages Value for Integer + */ + @JsonSetter("total_pages") + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + /** + * Getter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related [HATEOAS + * links](/docs/api/reference/api-responses/#hateoas-links). + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Converts this TransactionsList into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "TransactionsList [" + "transactions=" + transactions + ", totalItems=" + totalItems + + ", totalPages=" + totalPages + ", links=" + links + "]"; + } + + /** + * Builds a new {@link TransactionsList.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link TransactionsList.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .transactions(getTransactions()) + .totalItems(getTotalItems()) + .totalPages(getTotalPages()) + .links(getLinks()); + return builder; + } + + /** + * Class to build instances of {@link TransactionsList}. + */ + public static class Builder { + private List transactions; + private Integer totalItems; + private Integer totalPages; + private List links; + + + + /** + * Setter for transactions. + * @param transactions List of SubscriptionTransactionDetails value for transactions. + * @return Builder + */ + public Builder transactions(List transactions) { + this.transactions = transactions; + return this; + } + + /** + * Setter for totalItems. + * @param totalItems Integer value for totalItems. + * @return Builder + */ + public Builder totalItems(Integer totalItems) { + this.totalItems = totalItems; + return this; + } + + /** + * Setter for totalPages. + * @param totalPages Integer value for totalPages. + * @return Builder + */ + public Builder totalPages(Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Builds a new {@link TransactionsList} object using the set fields. + * @return {@link TransactionsList} + */ + public TransactionsList build() { + return new TransactionsList(transactions, totalItems, totalPages, links); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/UpdateBillingPlanPricingSchemesInput.java b/src/main/java/com/paypal/sdk/models/UpdateBillingPlanPricingSchemesInput.java new file mode 100644 index 0000000..005442d --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/UpdateBillingPlanPricingSchemesInput.java @@ -0,0 +1,183 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for UpdateBillingPlanPricingSchemesInput type. + */ +public class UpdateBillingPlanPricingSchemesInput { + private String id; + private String contentType; + private UpdatePricingSchemesRequest body; + + /** + * Default constructor. + */ + public UpdateBillingPlanPricingSchemesInput() { + contentType = "application/json"; + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + * @param body UpdatePricingSchemesRequest value for body. + */ + public UpdateBillingPlanPricingSchemesInput( + String id, + String contentType, + UpdatePricingSchemesRequest body) { + this.id = id; + this.contentType = contentType; + this.body = body; + } + + /** + * Getter for Id. + * The ID for the plan. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * The ID for the plan. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("Content-Type") + public String getContentType() { + return contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("Content-Type") + private void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Body. + * @return Returns the UpdatePricingSchemesRequest + */ + @JsonGetter("body") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdatePricingSchemesRequest getBody() { + return body; + } + + /** + * Setter for Body. + * @param body Value for UpdatePricingSchemesRequest + */ + @JsonSetter("body") + public void setBody(UpdatePricingSchemesRequest body) { + this.body = body; + } + + /** + * Converts this UpdateBillingPlanPricingSchemesInput into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UpdateBillingPlanPricingSchemesInput [" + "id=" + id + ", contentType=" + + contentType + ", body=" + body + "]"; + } + + /** + * Builds a new {@link UpdateBillingPlanPricingSchemesInput.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UpdateBillingPlanPricingSchemesInput.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(id, contentType) + .body(getBody()); + return builder; + } + + /** + * Class to build instances of {@link UpdateBillingPlanPricingSchemesInput}. + */ + public static class Builder { + private String id; + private String contentType = "application/json"; + private UpdatePricingSchemesRequest body; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param contentType String value for contentType. + */ + public Builder(String id, String contentType) { + this.id = id; + this.contentType = contentType; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for body. + * @param body UpdatePricingSchemesRequest value for body. + * @return Builder + */ + public Builder body(UpdatePricingSchemesRequest body) { + this.body = body; + return this; + } + + /** + * Builds a new {@link UpdateBillingPlanPricingSchemesInput} object using the set fields. + * @return {@link UpdateBillingPlanPricingSchemesInput} + */ + public UpdateBillingPlanPricingSchemesInput build() { + return new UpdateBillingPlanPricingSchemesInput(id, contentType, body); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/UpdatePricingScheme.java b/src/main/java/com/paypal/sdk/models/UpdatePricingScheme.java new file mode 100644 index 0000000..c15966e --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/UpdatePricingScheme.java @@ -0,0 +1,148 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for UpdatePricingScheme type. + */ +public class UpdatePricingScheme { + private int billingCycleSequence; + private SubscriptionPricingScheme pricingScheme; + + /** + * Default constructor. + */ + public UpdatePricingScheme() { + } + + /** + * Initialization constructor. + * @param billingCycleSequence int value for billingCycleSequence. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + */ + public UpdatePricingScheme( + int billingCycleSequence, + SubscriptionPricingScheme pricingScheme) { + this.billingCycleSequence = billingCycleSequence; + this.pricingScheme = pricingScheme; + } + + /** + * Getter for BillingCycleSequence. + * The billing cycle sequence. + * @return Returns the int + */ + @JsonGetter("billing_cycle_sequence") + public int getBillingCycleSequence() { + return billingCycleSequence; + } + + /** + * Setter for BillingCycleSequence. + * The billing cycle sequence. + * @param billingCycleSequence Value for int + */ + @JsonSetter("billing_cycle_sequence") + public void setBillingCycleSequence(int billingCycleSequence) { + this.billingCycleSequence = billingCycleSequence; + } + + /** + * Getter for PricingScheme. + * The pricing scheme details. + * @return Returns the SubscriptionPricingScheme + */ + @JsonGetter("pricing_scheme") + public SubscriptionPricingScheme getPricingScheme() { + return pricingScheme; + } + + /** + * Setter for PricingScheme. + * The pricing scheme details. + * @param pricingScheme Value for SubscriptionPricingScheme + */ + @JsonSetter("pricing_scheme") + public void setPricingScheme(SubscriptionPricingScheme pricingScheme) { + this.pricingScheme = pricingScheme; + } + + /** + * Converts this UpdatePricingScheme into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UpdatePricingScheme [" + "billingCycleSequence=" + billingCycleSequence + + ", pricingScheme=" + pricingScheme + "]"; + } + + /** + * Builds a new {@link UpdatePricingScheme.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UpdatePricingScheme.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(billingCycleSequence, pricingScheme); + return builder; + } + + /** + * Class to build instances of {@link UpdatePricingScheme}. + */ + public static class Builder { + private int billingCycleSequence; + private SubscriptionPricingScheme pricingScheme; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param billingCycleSequence int value for billingCycleSequence. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + */ + public Builder(int billingCycleSequence, SubscriptionPricingScheme pricingScheme) { + this.billingCycleSequence = billingCycleSequence; + this.pricingScheme = pricingScheme; + } + + /** + * Setter for billingCycleSequence. + * @param billingCycleSequence int value for billingCycleSequence. + * @return Builder + */ + public Builder billingCycleSequence(int billingCycleSequence) { + this.billingCycleSequence = billingCycleSequence; + return this; + } + + /** + * Setter for pricingScheme. + * @param pricingScheme SubscriptionPricingScheme value for pricingScheme. + * @return Builder + */ + public Builder pricingScheme(SubscriptionPricingScheme pricingScheme) { + this.pricingScheme = pricingScheme; + return this; + } + + /** + * Builds a new {@link UpdatePricingScheme} object using the set fields. + * @return {@link UpdatePricingScheme} + */ + public UpdatePricingScheme build() { + return new UpdatePricingScheme(billingCycleSequence, pricingScheme); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/UpdatePricingSchemesRequest.java b/src/main/java/com/paypal/sdk/models/UpdatePricingSchemesRequest.java new file mode 100644 index 0000000..8e8b31a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/UpdatePricingSchemesRequest.java @@ -0,0 +1,111 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for UpdatePricingSchemesRequest type. + */ +public class UpdatePricingSchemesRequest { + private List pricingSchemes; + + /** + * Default constructor. + */ + public UpdatePricingSchemesRequest() { + } + + /** + * Initialization constructor. + * @param pricingSchemes List of UpdatePricingScheme value for pricingSchemes. + */ + public UpdatePricingSchemesRequest( + List pricingSchemes) { + this.pricingSchemes = pricingSchemes; + } + + /** + * Getter for PricingSchemes. + * An array of pricing schemes. + * @return Returns the List of UpdatePricingScheme + */ + @JsonGetter("pricing_schemes") + public List getPricingSchemes() { + return pricingSchemes; + } + + /** + * Setter for PricingSchemes. + * An array of pricing schemes. + * @param pricingSchemes Value for List of UpdatePricingScheme + */ + @JsonSetter("pricing_schemes") + public void setPricingSchemes(List pricingSchemes) { + this.pricingSchemes = pricingSchemes; + } + + /** + * Converts this UpdatePricingSchemesRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UpdatePricingSchemesRequest [" + "pricingSchemes=" + pricingSchemes + "]"; + } + + /** + * Builds a new {@link UpdatePricingSchemesRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UpdatePricingSchemesRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(pricingSchemes); + return builder; + } + + /** + * Class to build instances of {@link UpdatePricingSchemesRequest}. + */ + public static class Builder { + private List pricingSchemes; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param pricingSchemes List of UpdatePricingScheme value for pricingSchemes. + */ + public Builder(List pricingSchemes) { + this.pricingSchemes = pricingSchemes; + } + + /** + * Setter for pricingSchemes. + * @param pricingSchemes List of UpdatePricingScheme value for pricingSchemes. + * @return Builder + */ + public Builder pricingSchemes(List pricingSchemes) { + this.pricingSchemes = pricingSchemes; + return this; + } + + /** + * Builds a new {@link UpdatePricingSchemesRequest} object using the set fields. + * @return {@link UpdatePricingSchemesRequest} + */ + public UpdatePricingSchemesRequest build() { + return new UpdatePricingSchemesRequest(pricingSchemes); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/VaultApplePayRequest.java b/src/main/java/com/paypal/sdk/models/VaultApplePayRequest.java new file mode 100644 index 0000000..e906db9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/VaultApplePayRequest.java @@ -0,0 +1,138 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for VaultApplePayRequest type. + */ +public class VaultApplePayRequest { + private String token; + private ApplePayRequestCard card; + + /** + * Default constructor. + */ + public VaultApplePayRequest() { + } + + /** + * Initialization constructor. + * @param token String value for token. + * @param card ApplePayRequestCard value for card. + */ + public VaultApplePayRequest( + String token, + ApplePayRequestCard card) { + this.token = token; + this.card = card; + } + + /** + * Getter for Token. + * Encrypted Apple Pay token, containing card information. This token would be base64 encoded. + * @return Returns the String + */ + @JsonGetter("token") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getToken() { + return token; + } + + /** + * Setter for Token. + * Encrypted Apple Pay token, containing card information. This token would be base64 encoded. + * @param token Value for String + */ + @JsonSetter("token") + public void setToken(String token) { + this.token = token; + } + + /** + * Getter for Card. + * The payment card to be used to fund a payment. Can be a credit or debit card. + * @return Returns the ApplePayRequestCard + */ + @JsonGetter("card") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ApplePayRequestCard getCard() { + return card; + } + + /** + * Setter for Card. + * The payment card to be used to fund a payment. Can be a credit or debit card. + * @param card Value for ApplePayRequestCard + */ + @JsonSetter("card") + public void setCard(ApplePayRequestCard card) { + this.card = card; + } + + /** + * Converts this VaultApplePayRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "VaultApplePayRequest [" + "token=" + token + ", card=" + card + "]"; + } + + /** + * Builds a new {@link VaultApplePayRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link VaultApplePayRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .token(getToken()) + .card(getCard()); + return builder; + } + + /** + * Class to build instances of {@link VaultApplePayRequest}. + */ + public static class Builder { + private String token; + private ApplePayRequestCard card; + + + + /** + * Setter for token. + * @param token String value for token. + * @return Builder + */ + public Builder token(String token) { + this.token = token; + return this; + } + + /** + * Setter for card. + * @param card ApplePayRequestCard value for card. + * @return Builder + */ + public Builder card(ApplePayRequestCard card) { + this.card = card; + return this; + } + + /** + * Builds a new {@link VaultApplePayRequest} object using the set fields. + * @return {@link VaultApplePayRequest} + */ + public VaultApplePayRequest build() { + return new VaultApplePayRequest(token, card); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/SetupTokenCardExperienceContext.java b/src/main/java/com/paypal/sdk/models/VaultCardExperienceContext.java similarity index 74% rename from src/main/java/com/paypal/sdk/models/SetupTokenCardExperienceContext.java rename to src/main/java/com/paypal/sdk/models/VaultCardExperienceContext.java index 0044c91..c734ef4 100644 --- a/src/main/java/com/paypal/sdk/models/SetupTokenCardExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/VaultCardExperienceContext.java @@ -11,20 +11,21 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for SetupTokenCardExperienceContext type. + * This is a model class for VaultCardExperienceContext type. */ -public class SetupTokenCardExperienceContext { +public class VaultCardExperienceContext { private String brandName; private String locale; private String returnUrl; private String cancelUrl; private VaultInstructionAction vaultInstruction; + private VaultUserAction userAction; /** * Default constructor. */ - public SetupTokenCardExperienceContext() { - vaultInstruction = VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS; + public VaultCardExperienceContext() { + userAction = VaultUserAction.CONTINUE; } /** @@ -34,18 +35,21 @@ public SetupTokenCardExperienceContext() { * @param returnUrl String value for returnUrl. * @param cancelUrl String value for cancelUrl. * @param vaultInstruction VaultInstructionAction value for vaultInstruction. + * @param userAction VaultUserAction value for userAction. */ - public SetupTokenCardExperienceContext( + public VaultCardExperienceContext( String brandName, String locale, String returnUrl, String cancelUrl, - VaultInstructionAction vaultInstruction) { + VaultInstructionAction vaultInstruction, + VaultUserAction userAction) { this.brandName = brandName; this.locale = locale; this.returnUrl = returnUrl; this.cancelUrl = cancelUrl; this.vaultInstruction = vaultInstruction; + this.userAction = userAction; } /** @@ -152,7 +156,7 @@ public void setCancelUrl(String cancelUrl) { /** * Getter for VaultInstruction. - * Vault Instruction on action to be performed after a successful payer approval. + * DEPRECATED. Vault Instruction on action to be performed after a successful payer approval. * @return Returns the VaultInstructionAction */ @JsonGetter("vault_instruction") @@ -163,7 +167,7 @@ public VaultInstructionAction getVaultInstruction() { /** * Setter for VaultInstruction. - * Vault Instruction on action to be performed after a successful payer approval. + * DEPRECATED. Vault Instruction on action to be performed after a successful payer approval. * @param vaultInstruction Value for VaultInstructionAction */ @JsonSetter("vault_instruction") @@ -172,20 +176,41 @@ public void setVaultInstruction(VaultInstructionAction vaultInstruction) { } /** - * Converts this SetupTokenCardExperienceContext into string format. + * Getter for UserAction. + * User Action on action to be performed after a successful payer approval. + * @return Returns the VaultUserAction + */ + @JsonGetter("user_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VaultUserAction getUserAction() { + return userAction; + } + + /** + * Setter for UserAction. + * User Action on action to be performed after a successful payer approval. + * @param userAction Value for VaultUserAction + */ + @JsonSetter("user_action") + public void setUserAction(VaultUserAction userAction) { + this.userAction = userAction; + } + + /** + * Converts this VaultCardExperienceContext into string format. * @return String representation of this class */ @Override public String toString() { - return "SetupTokenCardExperienceContext [" + "brandName=" + brandName + ", locale=" + locale + return "VaultCardExperienceContext [" + "brandName=" + brandName + ", locale=" + locale + ", returnUrl=" + returnUrl + ", cancelUrl=" + cancelUrl + ", vaultInstruction=" - + vaultInstruction + "]"; + + vaultInstruction + ", userAction=" + userAction + "]"; } /** - * Builds a new {@link SetupTokenCardExperienceContext.Builder} object. + * Builds a new {@link VaultCardExperienceContext.Builder} object. * Creates the instance with the state of the current model. - * @return a new {@link SetupTokenCardExperienceContext.Builder} object + * @return a new {@link VaultCardExperienceContext.Builder} object */ public Builder toBuilder() { Builder builder = new Builder() @@ -193,20 +218,21 @@ public Builder toBuilder() { .locale(getLocale()) .returnUrl(getReturnUrl()) .cancelUrl(getCancelUrl()) - .vaultInstruction(getVaultInstruction()); + .vaultInstruction(getVaultInstruction()) + .userAction(getUserAction()); return builder; } /** - * Class to build instances of {@link SetupTokenCardExperienceContext}. + * Class to build instances of {@link VaultCardExperienceContext}. */ public static class Builder { private String brandName; private String locale; private String returnUrl; private String cancelUrl; - private VaultInstructionAction vaultInstruction = - VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS; + private VaultInstructionAction vaultInstruction; + private VaultUserAction userAction = VaultUserAction.CONTINUE; @@ -261,12 +287,22 @@ public Builder vaultInstruction(VaultInstructionAction vaultInstruction) { } /** - * Builds a new {@link SetupTokenCardExperienceContext} object using the set fields. - * @return {@link SetupTokenCardExperienceContext} + * Setter for userAction. + * @param userAction VaultUserAction value for userAction. + * @return Builder + */ + public Builder userAction(VaultUserAction userAction) { + this.userAction = userAction; + return this; + } + + /** + * Builds a new {@link VaultCardExperienceContext} object using the set fields. + * @return {@link VaultCardExperienceContext} */ - public SetupTokenCardExperienceContext build() { - return new SetupTokenCardExperienceContext(brandName, locale, returnUrl, cancelUrl, - vaultInstruction); + public VaultCardExperienceContext build() { + return new VaultCardExperienceContext(brandName, locale, returnUrl, cancelUrl, + vaultInstruction, userAction); } } } diff --git a/src/main/java/com/paypal/sdk/models/VaultExperienceContext.java b/src/main/java/com/paypal/sdk/models/VaultExperienceContext.java index 77c657f..00f28c0 100644 --- a/src/main/java/com/paypal/sdk/models/VaultExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/VaultExperienceContext.java @@ -18,15 +18,17 @@ public class VaultExperienceContext { private String locale; private String returnUrl; private String cancelUrl; - private OrderApplicationContextShippingPreference shippingPreference; + private ExperienceContextShippingPreference shippingPreference; private VaultInstructionAction vaultInstruction; + private AppSwitchContext appSwitchContext; + private VaultUserAction userAction; /** * Default constructor. */ public VaultExperienceContext() { - shippingPreference = OrderApplicationContextShippingPreference.GET_FROM_FILE; - vaultInstruction = VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS; + shippingPreference = ExperienceContextShippingPreference.GET_FROM_FILE; + userAction = VaultUserAction.CONTINUE; } /** @@ -35,23 +37,28 @@ public VaultExperienceContext() { * @param locale String value for locale. * @param returnUrl String value for returnUrl. * @param cancelUrl String value for cancelUrl. - * @param shippingPreference OrderApplicationContextShippingPreference value for - * shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for shippingPreference. * @param vaultInstruction VaultInstructionAction value for vaultInstruction. + * @param appSwitchContext AppSwitchContext value for appSwitchContext. + * @param userAction VaultUserAction value for userAction. */ public VaultExperienceContext( String brandName, String locale, String returnUrl, String cancelUrl, - OrderApplicationContextShippingPreference shippingPreference, - VaultInstructionAction vaultInstruction) { + ExperienceContextShippingPreference shippingPreference, + VaultInstructionAction vaultInstruction, + AppSwitchContext appSwitchContext, + VaultUserAction userAction) { this.brandName = brandName; this.locale = locale; this.returnUrl = returnUrl; this.cancelUrl = cancelUrl; this.shippingPreference = shippingPreference; this.vaultInstruction = vaultInstruction; + this.appSwitchContext = appSwitchContext; + this.userAction = userAction; } /** @@ -159,27 +166,27 @@ public void setCancelUrl(String cancelUrl) { /** * Getter for ShippingPreference. * The shipping preference. This only applies to PayPal payment source. - * @return Returns the OrderApplicationContextShippingPreference + * @return Returns the ExperienceContextShippingPreference */ @JsonGetter("shipping_preference") @JsonInclude(JsonInclude.Include.NON_NULL) - public OrderApplicationContextShippingPreference getShippingPreference() { + public ExperienceContextShippingPreference getShippingPreference() { return shippingPreference; } /** * Setter for ShippingPreference. * The shipping preference. This only applies to PayPal payment source. - * @param shippingPreference Value for OrderApplicationContextShippingPreference + * @param shippingPreference Value for ExperienceContextShippingPreference */ @JsonSetter("shipping_preference") - public void setShippingPreference(OrderApplicationContextShippingPreference shippingPreference) { + public void setShippingPreference(ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; } /** * Getter for VaultInstruction. - * Vault Instruction on action to be performed after a successful payer approval. + * DEPRECATED. Vault Instruction on action to be performed after a successful payer approval. * @return Returns the VaultInstructionAction */ @JsonGetter("vault_instruction") @@ -190,7 +197,7 @@ public VaultInstructionAction getVaultInstruction() { /** * Setter for VaultInstruction. - * Vault Instruction on action to be performed after a successful payer approval. + * DEPRECATED. Vault Instruction on action to be performed after a successful payer approval. * @param vaultInstruction Value for VaultInstructionAction */ @JsonSetter("vault_instruction") @@ -198,6 +205,50 @@ public void setVaultInstruction(VaultInstructionAction vaultInstruction) { this.vaultInstruction = vaultInstruction; } + /** + * Getter for AppSwitchContext. + * Merchant provided details of the native app or mobile web browser to facilitate buyer's app + * switch to the PayPal consumer app. + * @return Returns the AppSwitchContext + */ + @JsonGetter("app_switch_context") + @JsonInclude(JsonInclude.Include.NON_NULL) + public AppSwitchContext getAppSwitchContext() { + return appSwitchContext; + } + + /** + * Setter for AppSwitchContext. + * Merchant provided details of the native app or mobile web browser to facilitate buyer's app + * switch to the PayPal consumer app. + * @param appSwitchContext Value for AppSwitchContext + */ + @JsonSetter("app_switch_context") + public void setAppSwitchContext(AppSwitchContext appSwitchContext) { + this.appSwitchContext = appSwitchContext; + } + + /** + * Getter for UserAction. + * User Action on action to be performed after a successful payer approval. + * @return Returns the VaultUserAction + */ + @JsonGetter("user_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VaultUserAction getUserAction() { + return userAction; + } + + /** + * Setter for UserAction. + * User Action on action to be performed after a successful payer approval. + * @param userAction Value for VaultUserAction + */ + @JsonSetter("user_action") + public void setUserAction(VaultUserAction userAction) { + this.userAction = userAction; + } + /** * Converts this VaultExperienceContext into string format. * @return String representation of this class @@ -206,7 +257,8 @@ public void setVaultInstruction(VaultInstructionAction vaultInstruction) { public String toString() { return "VaultExperienceContext [" + "brandName=" + brandName + ", locale=" + locale + ", returnUrl=" + returnUrl + ", cancelUrl=" + cancelUrl + ", shippingPreference=" - + shippingPreference + ", vaultInstruction=" + vaultInstruction + "]"; + + shippingPreference + ", vaultInstruction=" + vaultInstruction + + ", appSwitchContext=" + appSwitchContext + ", userAction=" + userAction + "]"; } /** @@ -221,7 +273,9 @@ public Builder toBuilder() { .returnUrl(getReturnUrl()) .cancelUrl(getCancelUrl()) .shippingPreference(getShippingPreference()) - .vaultInstruction(getVaultInstruction()); + .vaultInstruction(getVaultInstruction()) + .appSwitchContext(getAppSwitchContext()) + .userAction(getUserAction()); return builder; } @@ -233,10 +287,11 @@ public static class Builder { private String locale; private String returnUrl; private String cancelUrl; - private OrderApplicationContextShippingPreference shippingPreference = - OrderApplicationContextShippingPreference.GET_FROM_FILE; - private VaultInstructionAction vaultInstruction = - VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS; + private ExperienceContextShippingPreference shippingPreference = + ExperienceContextShippingPreference.GET_FROM_FILE; + private VaultInstructionAction vaultInstruction; + private AppSwitchContext appSwitchContext; + private VaultUserAction userAction = VaultUserAction.CONTINUE; @@ -282,12 +337,12 @@ public Builder cancelUrl(String cancelUrl) { /** * Setter for shippingPreference. - * @param shippingPreference OrderApplicationContextShippingPreference value for + * @param shippingPreference ExperienceContextShippingPreference value for * shippingPreference. * @return Builder */ public Builder shippingPreference( - OrderApplicationContextShippingPreference shippingPreference) { + ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; return this; } @@ -302,13 +357,33 @@ public Builder vaultInstruction(VaultInstructionAction vaultInstruction) { return this; } + /** + * Setter for appSwitchContext. + * @param appSwitchContext AppSwitchContext value for appSwitchContext. + * @return Builder + */ + public Builder appSwitchContext(AppSwitchContext appSwitchContext) { + this.appSwitchContext = appSwitchContext; + return this; + } + + /** + * Setter for userAction. + * @param userAction VaultUserAction value for userAction. + * @return Builder + */ + public Builder userAction(VaultUserAction userAction) { + this.userAction = userAction; + return this; + } + /** * Builds a new {@link VaultExperienceContext} object using the set fields. * @return {@link VaultExperienceContext} */ public VaultExperienceContext build() { return new VaultExperienceContext(brandName, locale, returnUrl, cancelUrl, - shippingPreference, vaultInstruction); + shippingPreference, vaultInstruction, appSwitchContext, userAction); } } } diff --git a/src/main/java/com/paypal/sdk/models/VaultPaypalWalletRequest.java b/src/main/java/com/paypal/sdk/models/VaultPaypalWalletRequest.java index 08af24e..0cdaed5 100644 --- a/src/main/java/com/paypal/sdk/models/VaultPaypalWalletRequest.java +++ b/src/main/java/com/paypal/sdk/models/VaultPaypalWalletRequest.java @@ -223,7 +223,7 @@ public void setBillingPlan(Plan billingPlan) { /** * Getter for ExperienceContext. - * Customizes the Vault creation flow experience for your customers. + * A resource representing an experience context of vault PayPal Wallet. * @return Returns the VaultExperienceContext */ @JsonGetter("experience_context") @@ -234,7 +234,7 @@ public VaultExperienceContext getExperienceContext() { /** * Setter for ExperienceContext. - * Customizes the Vault creation flow experience for your customers. + * A resource representing an experience context of vault PayPal Wallet. * @param experienceContext Value for VaultExperienceContext */ @JsonSetter("experience_context") diff --git a/src/main/java/com/paypal/sdk/models/VaultUserAction.java b/src/main/java/com/paypal/sdk/models/VaultUserAction.java new file mode 100644 index 0000000..2e997e9 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/VaultUserAction.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * VaultUserAction to be used. + */ +public enum VaultUserAction { + /** + * 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. + */ + SETUP_NOW, + + /** + * 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. + */ + CONTINUE, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + SETUP_NOW.value = "SETUP_NOW"; + CONTINUE.value = "CONTINUE"; + _UNKNOWN.value = null; + + valueMap.put("SETUP_NOW", SETUP_NOW); + valueMap.put("CONTINUE", CONTINUE); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static VaultUserAction constructFromString(String toConvert) throws IOException { + VaultUserAction enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static VaultUserAction fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of VaultUserAction values to list of string values. + * @param toConvert The list of VaultUserAction values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (VaultUserAction enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/VaultVenmoRequest.java b/src/main/java/com/paypal/sdk/models/VaultVenmoRequest.java index bcc19b1..4766f90 100644 --- a/src/main/java/com/paypal/sdk/models/VaultVenmoRequest.java +++ b/src/main/java/com/paypal/sdk/models/VaultVenmoRequest.java @@ -20,7 +20,7 @@ public class VaultVenmoRequest { private Boolean permitMultiplePaymentTokens; private PaypalPaymentTokenUsageType usageType; private PaypalPaymentTokenCustomerType customerType; - private VaultVenmoExperienceContext experienceContext; + private VenmoExperienceContext experienceContext; /** * Default constructor. @@ -37,7 +37,7 @@ public VaultVenmoRequest() { * @param permitMultiplePaymentTokens Boolean value for permitMultiplePaymentTokens. * @param usageType PaypalPaymentTokenUsageType value for usageType. * @param customerType PaypalPaymentTokenCustomerType value for customerType. - * @param experienceContext VaultVenmoExperienceContext value for experienceContext. + * @param experienceContext VenmoExperienceContext value for experienceContext. */ public VaultVenmoRequest( String description, @@ -46,7 +46,7 @@ public VaultVenmoRequest( Boolean permitMultiplePaymentTokens, PaypalPaymentTokenUsageType usageType, PaypalPaymentTokenCustomerType customerType, - VaultVenmoExperienceContext experienceContext) { + VenmoExperienceContext experienceContext) { this.description = description; this.usagePattern = usagePattern; this.shipping = shipping; @@ -198,22 +198,22 @@ public void setCustomerType(PaypalPaymentTokenCustomerType customerType) { /** * Getter for ExperienceContext. - * Customizes the Vault creation flow experience for your customers. - * @return Returns the VaultVenmoExperienceContext + * A resource representing an experience context of vault a venmo account. + * @return Returns the VenmoExperienceContext */ @JsonGetter("experience_context") @JsonInclude(JsonInclude.Include.NON_NULL) - public VaultVenmoExperienceContext getExperienceContext() { + public VenmoExperienceContext getExperienceContext() { return experienceContext; } /** * Setter for ExperienceContext. - * Customizes the Vault creation flow experience for your customers. - * @param experienceContext Value for VaultVenmoExperienceContext + * A resource representing an experience context of vault a venmo account. + * @param experienceContext Value for VenmoExperienceContext */ @JsonSetter("experience_context") - public void setExperienceContext(VaultVenmoExperienceContext experienceContext) { + public void setExperienceContext(VenmoExperienceContext experienceContext) { this.experienceContext = experienceContext; } @@ -256,7 +256,7 @@ public static class Builder { private Boolean permitMultiplePaymentTokens = false; private PaypalPaymentTokenUsageType usageType; private PaypalPaymentTokenCustomerType customerType; - private VaultVenmoExperienceContext experienceContext; + private VenmoExperienceContext experienceContext; @@ -322,10 +322,10 @@ public Builder customerType(PaypalPaymentTokenCustomerType customerType) { /** * Setter for experienceContext. - * @param experienceContext VaultVenmoExperienceContext value for experienceContext. + * @param experienceContext VenmoExperienceContext value for experienceContext. * @return Builder */ - public Builder experienceContext(VaultVenmoExperienceContext experienceContext) { + public Builder experienceContext(VenmoExperienceContext experienceContext) { this.experienceContext = experienceContext; return this; } diff --git a/src/main/java/com/paypal/sdk/models/VaultedDigitalWalletShippingDetails.java b/src/main/java/com/paypal/sdk/models/VaultedDigitalWalletShippingDetails.java index 0e50f47..cf603e2 100644 --- a/src/main/java/com/paypal/sdk/models/VaultedDigitalWalletShippingDetails.java +++ b/src/main/java/com/paypal/sdk/models/VaultedDigitalWalletShippingDetails.java @@ -15,6 +15,7 @@ */ public class VaultedDigitalWalletShippingDetails { private ShippingName name; + private String emailAddress; private PhoneNumberWithCountryCode phoneNumber; private FulfillmentType type; private Address address; @@ -28,16 +29,19 @@ public VaultedDigitalWalletShippingDetails() { /** * Initialization constructor. * @param name ShippingName value for name. + * @param emailAddress String value for emailAddress. * @param phoneNumber PhoneNumberWithCountryCode value for phoneNumber. * @param type FulfillmentType value for type. * @param address Address value for address. */ public VaultedDigitalWalletShippingDetails( ShippingName name, + String emailAddress, PhoneNumberWithCountryCode phoneNumber, FulfillmentType type, Address address) { this.name = name; + this.emailAddress = emailAddress; this.phoneNumber = phoneNumber; this.type = type; this.address = address; @@ -64,6 +68,31 @@ public void setName(ShippingName name) { this.name = name; } + /** + * Getter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @return Returns the String + */ + @JsonGetter("email_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getEmailAddress() { + return emailAddress; + } + + /** + * Setter for EmailAddress. + * The internationalized email address. Note: Up to 64 characters are allowed before and 255 + * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for + * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * @param emailAddress Value for String + */ + @JsonSetter("email_address") + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + /** * Getter for PhoneNumber. * The phone number, in its canonical international [E.164 numbering plan @@ -143,8 +172,9 @@ public void setAddress(Address address) { */ @Override public String toString() { - return "VaultedDigitalWalletShippingDetails [" + "name=" + name + ", phoneNumber=" - + phoneNumber + ", type=" + type + ", address=" + address + "]"; + return "VaultedDigitalWalletShippingDetails [" + "name=" + name + ", emailAddress=" + + emailAddress + ", phoneNumber=" + phoneNumber + ", type=" + type + ", address=" + + address + "]"; } /** @@ -155,6 +185,7 @@ public String toString() { public Builder toBuilder() { Builder builder = new Builder() .name(getName()) + .emailAddress(getEmailAddress()) .phoneNumber(getPhoneNumber()) .type(getType()) .address(getAddress()); @@ -166,6 +197,7 @@ public Builder toBuilder() { */ public static class Builder { private ShippingName name; + private String emailAddress; private PhoneNumberWithCountryCode phoneNumber; private FulfillmentType type; private Address address; @@ -182,6 +214,16 @@ public Builder name(ShippingName name) { return this; } + /** + * Setter for emailAddress. + * @param emailAddress String value for emailAddress. + * @return Builder + */ + public Builder emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + /** * Setter for phoneNumber. * @param phoneNumber PhoneNumberWithCountryCode value for phoneNumber. @@ -217,7 +259,8 @@ public Builder address(Address address) { * @return {@link VaultedDigitalWalletShippingDetails} */ public VaultedDigitalWalletShippingDetails build() { - return new VaultedDigitalWalletShippingDetails(name, phoneNumber, type, address); + return new VaultedDigitalWalletShippingDetails(name, emailAddress, phoneNumber, type, + address); } } } diff --git a/src/main/java/com/paypal/sdk/models/VaultVenmoExperienceContext.java b/src/main/java/com/paypal/sdk/models/VenmoExperienceContext.java similarity index 54% rename from src/main/java/com/paypal/sdk/models/VaultVenmoExperienceContext.java rename to src/main/java/com/paypal/sdk/models/VenmoExperienceContext.java index dde2979..f1909ba 100644 --- a/src/main/java/com/paypal/sdk/models/VaultVenmoExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/VenmoExperienceContext.java @@ -11,35 +11,38 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for VaultVenmoExperienceContext type. + * This is a model class for VenmoExperienceContext type. */ -public class VaultVenmoExperienceContext { +public class VenmoExperienceContext { private String brandName; - private OrderApplicationContextShippingPreference shippingPreference; + private ExperienceContextShippingPreference shippingPreference; private VaultInstructionAction vaultInstruction; + private VaultUserAction userAction; /** * Default constructor. */ - public VaultVenmoExperienceContext() { - shippingPreference = OrderApplicationContextShippingPreference.GET_FROM_FILE; - vaultInstruction = VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS; + public VenmoExperienceContext() { + shippingPreference = ExperienceContextShippingPreference.GET_FROM_FILE; + userAction = VaultUserAction.CONTINUE; } /** * Initialization constructor. * @param brandName String value for brandName. - * @param shippingPreference OrderApplicationContextShippingPreference value for - * shippingPreference. + * @param shippingPreference ExperienceContextShippingPreference value for shippingPreference. * @param vaultInstruction VaultInstructionAction value for vaultInstruction. + * @param userAction VaultUserAction value for userAction. */ - public VaultVenmoExperienceContext( + public VenmoExperienceContext( String brandName, - OrderApplicationContextShippingPreference shippingPreference, - VaultInstructionAction vaultInstruction) { + ExperienceContextShippingPreference shippingPreference, + VaultInstructionAction vaultInstruction, + VaultUserAction userAction) { this.brandName = brandName; this.shippingPreference = shippingPreference; this.vaultInstruction = vaultInstruction; + this.userAction = userAction; } /** @@ -68,27 +71,27 @@ public void setBrandName(String brandName) { /** * Getter for ShippingPreference. * The shipping preference. This only applies to PayPal payment source. - * @return Returns the OrderApplicationContextShippingPreference + * @return Returns the ExperienceContextShippingPreference */ @JsonGetter("shipping_preference") @JsonInclude(JsonInclude.Include.NON_NULL) - public OrderApplicationContextShippingPreference getShippingPreference() { + public ExperienceContextShippingPreference getShippingPreference() { return shippingPreference; } /** * Setter for ShippingPreference. * The shipping preference. This only applies to PayPal payment source. - * @param shippingPreference Value for OrderApplicationContextShippingPreference + * @param shippingPreference Value for ExperienceContextShippingPreference */ @JsonSetter("shipping_preference") - public void setShippingPreference(OrderApplicationContextShippingPreference shippingPreference) { + public void setShippingPreference(ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; } /** * Getter for VaultInstruction. - * Vault Instruction on action to be performed after a successful payer approval. + * DEPRECATED. Vault Instruction on action to be performed after a successful payer approval. * @return Returns the VaultInstructionAction */ @JsonGetter("vault_instruction") @@ -99,7 +102,7 @@ public VaultInstructionAction getVaultInstruction() { /** * Setter for VaultInstruction. - * Vault Instruction on action to be performed after a successful payer approval. + * DEPRECATED. Vault Instruction on action to be performed after a successful payer approval. * @param vaultInstruction Value for VaultInstructionAction */ @JsonSetter("vault_instruction") @@ -108,37 +111,60 @@ public void setVaultInstruction(VaultInstructionAction vaultInstruction) { } /** - * Converts this VaultVenmoExperienceContext into string format. + * Getter for UserAction. + * User Action on action to be performed after a successful payer approval. + * @return Returns the VaultUserAction + */ + @JsonGetter("user_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VaultUserAction getUserAction() { + return userAction; + } + + /** + * Setter for UserAction. + * User Action on action to be performed after a successful payer approval. + * @param userAction Value for VaultUserAction + */ + @JsonSetter("user_action") + public void setUserAction(VaultUserAction userAction) { + this.userAction = userAction; + } + + /** + * Converts this VenmoExperienceContext into string format. * @return String representation of this class */ @Override public String toString() { - return "VaultVenmoExperienceContext [" + "brandName=" + brandName + ", shippingPreference=" - + shippingPreference + ", vaultInstruction=" + vaultInstruction + "]"; + return "VenmoExperienceContext [" + "brandName=" + brandName + ", shippingPreference=" + + shippingPreference + ", vaultInstruction=" + vaultInstruction + ", userAction=" + + userAction + "]"; } /** - * Builds a new {@link VaultVenmoExperienceContext.Builder} object. + * Builds a new {@link VenmoExperienceContext.Builder} object. * Creates the instance with the state of the current model. - * @return a new {@link VaultVenmoExperienceContext.Builder} object + * @return a new {@link VenmoExperienceContext.Builder} object */ public Builder toBuilder() { Builder builder = new Builder() .brandName(getBrandName()) .shippingPreference(getShippingPreference()) - .vaultInstruction(getVaultInstruction()); + .vaultInstruction(getVaultInstruction()) + .userAction(getUserAction()); return builder; } /** - * Class to build instances of {@link VaultVenmoExperienceContext}. + * Class to build instances of {@link VenmoExperienceContext}. */ public static class Builder { private String brandName; - private OrderApplicationContextShippingPreference shippingPreference = - OrderApplicationContextShippingPreference.GET_FROM_FILE; - private VaultInstructionAction vaultInstruction = - VaultInstructionAction.ON_CREATE_PAYMENT_TOKENS; + private ExperienceContextShippingPreference shippingPreference = + ExperienceContextShippingPreference.GET_FROM_FILE; + private VaultInstructionAction vaultInstruction; + private VaultUserAction userAction = VaultUserAction.CONTINUE; @@ -154,12 +180,12 @@ public Builder brandName(String brandName) { /** * Setter for shippingPreference. - * @param shippingPreference OrderApplicationContextShippingPreference value for + * @param shippingPreference ExperienceContextShippingPreference value for * shippingPreference. * @return Builder */ public Builder shippingPreference( - OrderApplicationContextShippingPreference shippingPreference) { + ExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; return this; } @@ -175,11 +201,22 @@ public Builder vaultInstruction(VaultInstructionAction vaultInstruction) { } /** - * Builds a new {@link VaultVenmoExperienceContext} object using the set fields. - * @return {@link VaultVenmoExperienceContext} + * Setter for userAction. + * @param userAction VaultUserAction value for userAction. + * @return Builder + */ + public Builder userAction(VaultUserAction userAction) { + this.userAction = userAction; + return this; + } + + /** + * Builds a new {@link VenmoExperienceContext} object using the set fields. + * @return {@link VenmoExperienceContext} */ - public VaultVenmoExperienceContext build() { - return new VaultVenmoExperienceContext(brandName, shippingPreference, vaultInstruction); + public VenmoExperienceContext build() { + return new VenmoExperienceContext(brandName, shippingPreference, vaultInstruction, + userAction); } } } diff --git a/src/main/java/com/paypal/sdk/models/VenmoPaymentToken.java b/src/main/java/com/paypal/sdk/models/VenmoPaymentToken.java index 664b9d9..720f61f 100644 --- a/src/main/java/com/paypal/sdk/models/VenmoPaymentToken.java +++ b/src/main/java/com/paypal/sdk/models/VenmoPaymentToken.java @@ -218,9 +218,10 @@ public void setCustomerType(PaypalPaymentTokenCustomerType customerType) { /** * Getter for EmailAddress. - * The internationalized email address. Note: Up to 64 characters are allowed before and 255 - * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for - * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters + * are allowed before and 255 characters are allowed after the <code>{@literal @}</code> sign. However, the + * generally accepted maximum length for an email address is 254 characters. The pattern + * verifies that an unquoted <code>{@literal @}</code> sign exists.</blockquote> * @return Returns the String */ @JsonGetter("email_address") @@ -231,9 +232,10 @@ public String getEmailAddress() { /** * Setter for EmailAddress. - * The internationalized email address. Note: Up to 64 characters are allowed before and 255 - * characters are allowed after the {@literal @} sign. However, the generally accepted maximum length for - * an email address is 254 characters. The pattern verifies that an unquoted {@literal @} sign exists. + * The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters + * are allowed before and 255 characters are allowed after the <code>{@literal @}</code> sign. However, the + * generally accepted maximum length for an email address is 254 characters. The pattern + * verifies that an unquoted <code>{@literal @}</code> sign exists.</blockquote> * @param emailAddress Value for String */ @JsonSetter("email_address") diff --git a/src/main/java/com/paypal/sdk/models/VenmoVaultResponse.java b/src/main/java/com/paypal/sdk/models/VenmoVaultResponse.java new file mode 100644 index 0000000..d4cf6a7 --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/VenmoVaultResponse.java @@ -0,0 +1,216 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; + +/** + * This is a model class for VenmoVaultResponse type. + */ +public class VenmoVaultResponse { + private String id; + private VenmoVaultResponseStatus status; + private List links; + private CustomerInformation customer; + + /** + * Default constructor. + */ + public VenmoVaultResponse() { + } + + /** + * Initialization constructor. + * @param id String value for id. + * @param status VenmoVaultResponseStatus value for status. + * @param links List of LinkDescription value for links. + * @param customer CustomerInformation value for customer. + */ + public VenmoVaultResponse( + String id, + VenmoVaultResponseStatus status, + List links, + CustomerInformation customer) { + this.id = id; + this.status = status; + this.links = links; + this.customer = customer; + } + + /** + * Getter for Id. + * The PayPal-generated ID for the saved payment source. + * @return Returns the String + */ + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getId() { + return id; + } + + /** + * Setter for Id. + * The PayPal-generated ID for the saved payment source. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Getter for Status. + * The vault status. + * @return Returns the VenmoVaultResponseStatus + */ + @JsonGetter("status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VenmoVaultResponseStatus getStatus() { + return status; + } + + /** + * Setter for Status. + * The vault status. + * @param status Value for VenmoVaultResponseStatus + */ + @JsonSetter("status") + public void setStatus(VenmoVaultResponseStatus status) { + this.status = status; + } + + /** + * Getter for Links. + * An array of request-related HATEOAS links. + * @return Returns the List of LinkDescription + */ + @JsonGetter("links") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLinks() { + return links; + } + + /** + * Setter for Links. + * An array of request-related HATEOAS links. + * @param links Value for List of LinkDescription + */ + @JsonSetter("links") + public void setLinks(List links) { + this.links = links; + } + + /** + * Getter for Customer. + * This object represents a merchant’s customer, allowing them to store contact details, and + * track all payments associated with the same customer. + * @return Returns the CustomerInformation + */ + @JsonGetter("customer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CustomerInformation getCustomer() { + return customer; + } + + /** + * Setter for Customer. + * This object represents a merchant’s customer, allowing them to store contact details, and + * track all payments associated with the same customer. + * @param customer Value for CustomerInformation + */ + @JsonSetter("customer") + public void setCustomer(CustomerInformation customer) { + this.customer = customer; + } + + /** + * Converts this VenmoVaultResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "VenmoVaultResponse [" + "id=" + id + ", status=" + status + ", links=" + links + + ", customer=" + customer + "]"; + } + + /** + * Builds a new {@link VenmoVaultResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link VenmoVaultResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .id(getId()) + .status(getStatus()) + .links(getLinks()) + .customer(getCustomer()); + return builder; + } + + /** + * Class to build instances of {@link VenmoVaultResponse}. + */ + public static class Builder { + private String id; + private VenmoVaultResponseStatus status; + private List links; + private CustomerInformation customer; + + + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Setter for status. + * @param status VenmoVaultResponseStatus value for status. + * @return Builder + */ + public Builder status(VenmoVaultResponseStatus status) { + this.status = status; + return this; + } + + /** + * Setter for links. + * @param links List of LinkDescription value for links. + * @return Builder + */ + public Builder links(List links) { + this.links = links; + return this; + } + + /** + * Setter for customer. + * @param customer CustomerInformation value for customer. + * @return Builder + */ + public Builder customer(CustomerInformation customer) { + this.customer = customer; + return this; + } + + /** + * Builds a new {@link VenmoVaultResponse} object using the set fields. + * @return {@link VenmoVaultResponse} + */ + public VenmoVaultResponse build() { + return new VenmoVaultResponse(id, status, links, customer); + } + } +} diff --git a/src/main/java/com/paypal/sdk/models/VenmoVaultResponseStatus.java b/src/main/java/com/paypal/sdk/models/VenmoVaultResponseStatus.java new file mode 100644 index 0000000..21a250a --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/VenmoVaultResponseStatus.java @@ -0,0 +1,117 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * VenmoVaultResponseStatus to be used. + */ +public enum VenmoVaultResponseStatus { + /** + * The payment source has been saved in your customer's vault. This vault status reflects `/v3/vault` status. + */ + VAULTED, + + /** + * 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. + */ + CREATED, + + /** + * 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 + */ + APPROVED, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + VAULTED.value = "VAULTED"; + CREATED.value = "CREATED"; + APPROVED.value = "APPROVED"; + _UNKNOWN.value = null; + + valueMap.put("VAULTED", VAULTED); + valueMap.put("CREATED", CREATED); + valueMap.put("APPROVED", APPROVED); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static VenmoVaultResponseStatus constructFromString(String toConvert) throws IOException { + VenmoVaultResponseStatus enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static VenmoVaultResponseStatus fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of VenmoVaultResponseStatus values to list of string values. + * @param toConvert The list of VenmoVaultResponseStatus values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (VenmoVaultResponseStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/VenmoWalletAttributesResponse.java b/src/main/java/com/paypal/sdk/models/VenmoWalletAttributesResponse.java index b4312ed..dae2adc 100644 --- a/src/main/java/com/paypal/sdk/models/VenmoWalletAttributesResponse.java +++ b/src/main/java/com/paypal/sdk/models/VenmoWalletAttributesResponse.java @@ -14,7 +14,7 @@ * This is a model class for VenmoWalletAttributesResponse type. */ public class VenmoWalletAttributesResponse { - private VaultResponse vault; + private VenmoVaultResponse vault; /** * Default constructor. @@ -24,31 +24,31 @@ public VenmoWalletAttributesResponse() { /** * Initialization constructor. - * @param vault VaultResponse value for vault. + * @param vault VenmoVaultResponse value for vault. */ public VenmoWalletAttributesResponse( - VaultResponse vault) { + VenmoVaultResponse vault) { this.vault = vault; } /** * Getter for Vault. - * The details about a saved payment source. - * @return Returns the VaultResponse + * The details about a saved venmo payment source. + * @return Returns the VenmoVaultResponse */ @JsonGetter("vault") @JsonInclude(JsonInclude.Include.NON_NULL) - public VaultResponse getVault() { + public VenmoVaultResponse getVault() { return vault; } /** * Setter for Vault. - * The details about a saved payment source. - * @param vault Value for VaultResponse + * The details about a saved venmo payment source. + * @param vault Value for VenmoVaultResponse */ @JsonSetter("vault") - public void setVault(VaultResponse vault) { + public void setVault(VenmoVaultResponse vault) { this.vault = vault; } @@ -76,16 +76,16 @@ public Builder toBuilder() { * Class to build instances of {@link VenmoWalletAttributesResponse}. */ public static class Builder { - private VaultResponse vault; + private VenmoVaultResponse vault; /** * Setter for vault. - * @param vault VaultResponse value for vault. + * @param vault VenmoVaultResponse value for vault. * @return Builder */ - public Builder vault(VaultResponse vault) { + public Builder vault(VenmoVaultResponse vault) { this.vault = vault; return this; } diff --git a/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContext.java b/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContext.java index a439dbb..dd5b1f8 100644 --- a/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContext.java +++ b/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContext.java @@ -15,29 +15,35 @@ */ public class VenmoWalletExperienceContext { private String brandName; - private ShippingPreference shippingPreference; + private VenmoWalletExperienceContextShippingPreference shippingPreference; private CallbackConfiguration orderUpdateCallbackConfig; + private VenmoWalletExperienceContextUserAction userAction; /** * Default constructor. */ public VenmoWalletExperienceContext() { - shippingPreference = ShippingPreference.GET_FROM_FILE; + shippingPreference = VenmoWalletExperienceContextShippingPreference.GET_FROM_FILE; + userAction = VenmoWalletExperienceContextUserAction.CONTINUE; } /** * Initialization constructor. * @param brandName String value for brandName. - * @param shippingPreference ShippingPreference value for shippingPreference. + * @param shippingPreference VenmoWalletExperienceContextShippingPreference value for + * shippingPreference. * @param orderUpdateCallbackConfig CallbackConfiguration value for orderUpdateCallbackConfig. + * @param userAction VenmoWalletExperienceContextUserAction value for userAction. */ public VenmoWalletExperienceContext( String brandName, - ShippingPreference shippingPreference, - CallbackConfiguration orderUpdateCallbackConfig) { + VenmoWalletExperienceContextShippingPreference shippingPreference, + CallbackConfiguration orderUpdateCallbackConfig, + VenmoWalletExperienceContextUserAction userAction) { this.brandName = brandName; this.shippingPreference = shippingPreference; this.orderUpdateCallbackConfig = orderUpdateCallbackConfig; + this.userAction = userAction; } /** @@ -66,21 +72,21 @@ public void setBrandName(String brandName) { /** * Getter for ShippingPreference. * The location from which the shipping address is derived. - * @return Returns the ShippingPreference + * @return Returns the VenmoWalletExperienceContextShippingPreference */ @JsonGetter("shipping_preference") @JsonInclude(JsonInclude.Include.NON_NULL) - public ShippingPreference getShippingPreference() { + public VenmoWalletExperienceContextShippingPreference getShippingPreference() { return shippingPreference; } /** * Setter for ShippingPreference. * The location from which the shipping address is derived. - * @param shippingPreference Value for ShippingPreference + * @param shippingPreference Value for VenmoWalletExperienceContextShippingPreference */ @JsonSetter("shipping_preference") - public void setShippingPreference(ShippingPreference shippingPreference) { + public void setShippingPreference(VenmoWalletExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; } @@ -105,6 +111,27 @@ public void setOrderUpdateCallbackConfig(CallbackConfiguration orderUpdateCallba this.orderUpdateCallbackConfig = orderUpdateCallbackConfig; } + /** + * Getter for UserAction. + * Configures a Continue or Pay Now checkout flow. + * @return Returns the VenmoWalletExperienceContextUserAction + */ + @JsonGetter("user_action") + @JsonInclude(JsonInclude.Include.NON_NULL) + public VenmoWalletExperienceContextUserAction getUserAction() { + return userAction; + } + + /** + * Setter for UserAction. + * Configures a Continue or Pay Now checkout flow. + * @param userAction Value for VenmoWalletExperienceContextUserAction + */ + @JsonSetter("user_action") + public void setUserAction(VenmoWalletExperienceContextUserAction userAction) { + this.userAction = userAction; + } + /** * Converts this VenmoWalletExperienceContext into string format. * @return String representation of this class @@ -113,7 +140,7 @@ public void setOrderUpdateCallbackConfig(CallbackConfiguration orderUpdateCallba public String toString() { return "VenmoWalletExperienceContext [" + "brandName=" + brandName + ", shippingPreference=" + shippingPreference + ", orderUpdateCallbackConfig=" + orderUpdateCallbackConfig - + "]"; + + ", userAction=" + userAction + "]"; } /** @@ -125,7 +152,8 @@ public Builder toBuilder() { Builder builder = new Builder() .brandName(getBrandName()) .shippingPreference(getShippingPreference()) - .orderUpdateCallbackConfig(getOrderUpdateCallbackConfig()); + .orderUpdateCallbackConfig(getOrderUpdateCallbackConfig()) + .userAction(getUserAction()); return builder; } @@ -134,8 +162,11 @@ public Builder toBuilder() { */ public static class Builder { private String brandName; - private ShippingPreference shippingPreference = ShippingPreference.GET_FROM_FILE; + private VenmoWalletExperienceContextShippingPreference shippingPreference = + VenmoWalletExperienceContextShippingPreference.GET_FROM_FILE; private CallbackConfiguration orderUpdateCallbackConfig; + private VenmoWalletExperienceContextUserAction userAction = + VenmoWalletExperienceContextUserAction.CONTINUE; @@ -151,10 +182,12 @@ public Builder brandName(String brandName) { /** * Setter for shippingPreference. - * @param shippingPreference ShippingPreference value for shippingPreference. + * @param shippingPreference VenmoWalletExperienceContextShippingPreference value for + * shippingPreference. * @return Builder */ - public Builder shippingPreference(ShippingPreference shippingPreference) { + public Builder shippingPreference( + VenmoWalletExperienceContextShippingPreference shippingPreference) { this.shippingPreference = shippingPreference; return this; } @@ -171,13 +204,23 @@ public Builder orderUpdateCallbackConfig( return this; } + /** + * Setter for userAction. + * @param userAction VenmoWalletExperienceContextUserAction value for userAction. + * @return Builder + */ + public Builder userAction(VenmoWalletExperienceContextUserAction userAction) { + this.userAction = userAction; + return this; + } + /** * Builds a new {@link VenmoWalletExperienceContext} object using the set fields. * @return {@link VenmoWalletExperienceContext} */ public VenmoWalletExperienceContext build() { return new VenmoWalletExperienceContext(brandName, shippingPreference, - orderUpdateCallbackConfig); + orderUpdateCallbackConfig, userAction); } } } diff --git a/src/main/java/com/paypal/sdk/models/ShippingPreference.java b/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContextShippingPreference.java similarity index 75% rename from src/main/java/com/paypal/sdk/models/ShippingPreference.java rename to src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContextShippingPreference.java index 6be19e8..69d70a6 100644 --- a/src/main/java/com/paypal/sdk/models/ShippingPreference.java +++ b/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContextShippingPreference.java @@ -14,9 +14,9 @@ /** - * ShippingPreference to be used. + * VenmoWalletExperienceContextShippingPreference to be used. */ -public enum ShippingPreference { +public enum VenmoWalletExperienceContextShippingPreference { /** * Get the customer-provided shipping address on the PayPal site. */ @@ -38,7 +38,7 @@ public enum ShippingPreference { _UNKNOWN; - private static TreeMap valueMap = new TreeMap<>(); + private static TreeMap valueMap = new TreeMap<>(); private String value; static { @@ -59,8 +59,8 @@ public enum ShippingPreference { * @throws IOException when provided value is not mapped to any enum member. */ @JsonCreator - public static ShippingPreference constructFromString(String toConvert) throws IOException { - ShippingPreference enumValue = fromString(toConvert); + public static VenmoWalletExperienceContextShippingPreference constructFromString(String toConvert) throws IOException { + VenmoWalletExperienceContextShippingPreference enumValue = fromString(toConvert); if (enumValue == null) { throw new IOException("Unable to create enum instance with value: " + toConvert); } @@ -72,7 +72,7 @@ public static ShippingPreference constructFromString(String toConvert) throws IO * @param toConvert String value to get enum member. * @return The enum member against the given string value. */ - public static ShippingPreference fromString(String toConvert) { + public static VenmoWalletExperienceContextShippingPreference fromString(String toConvert) { if (!valueMap.containsKey(toConvert)) { return _UNKNOWN; } @@ -100,16 +100,16 @@ public String toString() { } /** - * Convert list of ShippingPreference values to list of string values. - * @param toConvert The list of ShippingPreference values to convert. + * Convert list of VenmoWalletExperienceContextShippingPreference values to list of string values. + * @param toConvert The list of VenmoWalletExperienceContextShippingPreference values to convert. * @return List of representative string values. */ - public static List toValue(List toConvert) { + public static List toValue(List toConvert) { if (toConvert == null) { return null; } List convertedValues = new ArrayList<>(); - for (ShippingPreference enumValue : toConvert) { + for (VenmoWalletExperienceContextShippingPreference enumValue : toConvert) { convertedValues.add(enumValue.value); } return convertedValues; diff --git a/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContextUserAction.java b/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContextUserAction.java new file mode 100644 index 0000000..f0833ae --- /dev/null +++ b/src/main/java/com/paypal/sdk/models/VenmoWalletExperienceContextUserAction.java @@ -0,0 +1,110 @@ +/* + * PaypalServerSdkLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.paypal.sdk.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * VenmoWalletExperienceContextUserAction to be used. + */ +public enum VenmoWalletExperienceContextUserAction { + /** + * 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. + */ + CONTINUE, + + /** + * 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. + */ + PAY_NOW, + + /** + * Unknown values will be mapped by this enum member + */ + _UNKNOWN; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CONTINUE.value = "CONTINUE"; + PAY_NOW.value = "PAY_NOW"; + _UNKNOWN.value = null; + + valueMap.put("CONTINUE", CONTINUE); + valueMap.put("PAY_NOW", PAY_NOW); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static VenmoWalletExperienceContextUserAction constructFromString(String toConvert) throws IOException { + VenmoWalletExperienceContextUserAction enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static VenmoWalletExperienceContextUserAction fromString(String toConvert) { + if (!valueMap.containsKey(toConvert)) { + return _UNKNOWN; + } + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + if (value == null) { + return null; + } + return value.toString(); + } + + /** + * Convert list of VenmoWalletExperienceContextUserAction values to list of string values. + * @param toConvert The list of VenmoWalletExperienceContextUserAction values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (VenmoWalletExperienceContextUserAction enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/paypal/sdk/models/VenmoWalletResponse.java b/src/main/java/com/paypal/sdk/models/VenmoWalletResponse.java index 38370fa..6933f3f 100644 --- a/src/main/java/com/paypal/sdk/models/VenmoWalletResponse.java +++ b/src/main/java/com/paypal/sdk/models/VenmoWalletResponse.java @@ -20,12 +20,14 @@ public class VenmoWalletResponse { private Name name; private PhoneNumber phoneNumber; private Address address; + private ReturnFlow returnFlow; private VenmoWalletAttributesResponse attributes; /** * Default constructor. */ public VenmoWalletResponse() { + returnFlow = ReturnFlow.AUTO; } /** @@ -36,6 +38,7 @@ public VenmoWalletResponse() { * @param name Name value for name. * @param phoneNumber PhoneNumber value for phoneNumber. * @param address Address value for address. + * @param returnFlow ReturnFlow value for returnFlow. * @param attributes VenmoWalletAttributesResponse value for attributes. */ public VenmoWalletResponse( @@ -45,6 +48,7 @@ public VenmoWalletResponse( Name name, PhoneNumber phoneNumber, Address address, + ReturnFlow returnFlow, VenmoWalletAttributesResponse attributes) { this.emailAddress = emailAddress; this.accountId = accountId; @@ -52,6 +56,7 @@ public VenmoWalletResponse( this.name = name; this.phoneNumber = phoneNumber; this.address = address; + this.returnFlow = returnFlow; this.attributes = attributes; } @@ -197,6 +202,29 @@ public void setAddress(Address address) { this.address = address; } + /** + * Getter for ReturnFlow. + * Merchant preference on how the buyer can navigate back to merchant website post approving the + * transaction on the Venmo App. + * @return Returns the ReturnFlow + */ + @JsonGetter("return_flow") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ReturnFlow getReturnFlow() { + return returnFlow; + } + + /** + * Setter for ReturnFlow. + * Merchant preference on how the buyer can navigate back to merchant website post approving the + * transaction on the Venmo App. + * @param returnFlow Value for ReturnFlow + */ + @JsonSetter("return_flow") + public void setReturnFlow(ReturnFlow returnFlow) { + this.returnFlow = returnFlow; + } + /** * Getter for Attributes. * Additional attributes associated with the use of a Venmo Wallet. @@ -226,7 +254,8 @@ public void setAttributes(VenmoWalletAttributesResponse attributes) { public String toString() { return "VenmoWalletResponse [" + "emailAddress=" + emailAddress + ", accountId=" + accountId + ", userName=" + userName + ", name=" + name + ", phoneNumber=" + phoneNumber - + ", address=" + address + ", attributes=" + attributes + "]"; + + ", address=" + address + ", returnFlow=" + returnFlow + ", attributes=" + + attributes + "]"; } /** @@ -242,6 +271,7 @@ public Builder toBuilder() { .name(getName()) .phoneNumber(getPhoneNumber()) .address(getAddress()) + .returnFlow(getReturnFlow()) .attributes(getAttributes()); return builder; } @@ -256,6 +286,7 @@ public static class Builder { private Name name; private PhoneNumber phoneNumber; private Address address; + private ReturnFlow returnFlow = ReturnFlow.AUTO; private VenmoWalletAttributesResponse attributes; @@ -320,6 +351,16 @@ public Builder address(Address address) { return this; } + /** + * Setter for returnFlow. + * @param returnFlow ReturnFlow value for returnFlow. + * @return Builder + */ + public Builder returnFlow(ReturnFlow returnFlow) { + this.returnFlow = returnFlow; + return this; + } + /** * Setter for attributes. * @param attributes VenmoWalletAttributesResponse value for attributes. @@ -336,7 +377,7 @@ public Builder attributes(VenmoWalletAttributesResponse attributes) { */ public VenmoWalletResponse build() { return new VenmoWalletResponse(emailAddress, accountId, userName, name, phoneNumber, - address, attributes); + address, returnFlow, attributes); } } }