diff --git a/README.md b/README.md
index d725054..36764dc 100644
--- a/README.md
+++ b/README.md
@@ -27,23 +27,23 @@ Find out more here: [https://developer.paypal.com/docs/api/orders/v2/](https://d
Run the following command to install the package and automatically add the dependency to your composer.json file:
```php
-composer require "paypal/paypal-server-sdk:0.6.0"
+composer require "paypal/paypal-server-sdk:0.6.1"
```
Or add it to the composer.json file manually as given below:
```php
"require": {
- "paypal/paypal-server-sdk": "0.6.0"
+ "paypal/paypal-server-sdk": "0.6.1"
}
```
You can also view the package at:
-https://packagist.org/packages/paypal/paypal-server-sdk#0.6.0
+https://packagist.org/packages/paypal/paypal-server-sdk#0.6.1
## Initialize the API Client
-**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/client.md)
+**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/client.md)
The following parameters are configurable for the API Client:
@@ -59,8 +59,8 @@ The following parameters are configurable for the API Client:
| `retryOnTimeout` | `bool` | Whether to retry on request timeout.
*Default*: `true` |
| `httpStatusCodesToRetry` | `array` | Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` |
| `httpMethodsToRetry` | `array` | Http methods to retry against.
*Default*: `'GET', 'PUT'` |
-| `loggingConfiguration` | [`LoggingConfigurationBuilder`](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/logging-configuration-builder.md) | Represents the logging configurations for API calls |
-| `clientCredentialsAuth` | [`ClientCredentialsAuth`](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/auth/oauth-2-client-credentials-grant.md) | The Credentials Setter for OAuth 2 Client Credentials Grant |
+| `loggingConfiguration` | [`LoggingConfigurationBuilder`](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/logging-configuration-builder.md) | Represents the logging configurations for API calls |
+| `clientCredentialsAuth` | [`ClientCredentialsAuth`](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/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:
@@ -105,20 +105,20 @@ 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-PHP-Server-SDK/tree/0.6.0/doc/auth/oauth-2-client-credentials-grant.md)
+* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/auth/oauth-2-client-credentials-grant.md)
## List of APIs
-* [Orders](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/controllers/orders.md)
-* [Payments](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/controllers/payments.md)
-* [Vault](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/controllers/vault.md)
+* [Orders](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/controllers/orders.md)
+* [Payments](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/controllers/payments.md)
+* [Vault](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/controllers/vault.md)
## Classes Documentation
-* [ApiException](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/api-exception.md)
-* [HttpRequest](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/http-request.md)
-* [HttpResponse](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/http-response.md)
-* [LoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/logging-configuration-builder.md)
-* [RequestLoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/request-logging-configuration-builder.md)
-* [ResponseLoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/response-logging-configuration-builder.md)
+* [ApiException](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/api-exception.md)
+* [HttpRequest](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/http-request.md)
+* [HttpResponse](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/http-response.md)
+* [LoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/logging-configuration-builder.md)
+* [RequestLoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/request-logging-configuration-builder.md)
+* [ResponseLoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/response-logging-configuration-builder.md)
diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md
index d61158b..2993059 100644
--- a/doc/controllers/orders.md
+++ b/doc/controllers/orders.md
@@ -12,16 +12,199 @@ $ordersController = $client->getOrdersController();
## Methods
-* [Orders Authorize](../../doc/controllers/orders.md#orders-authorize)
-* [Orders Track Create](../../doc/controllers/orders.md#orders-track-create)
* [Orders Create](../../doc/controllers/orders.md#orders-create)
-* [Orders Patch](../../doc/controllers/orders.md#orders-patch)
-* [Orders Capture](../../doc/controllers/orders.md#orders-capture)
* [Orders Get](../../doc/controllers/orders.md#orders-get)
+* [Orders Patch](../../doc/controllers/orders.md#orders-patch)
* [Orders Confirm](../../doc/controllers/orders.md#orders-confirm)
+* [Orders Authorize](../../doc/controllers/orders.md#orders-authorize)
+* [Orders Capture](../../doc/controllers/orders.md#orders-capture)
+* [Orders Track Create](../../doc/controllers/orders.md#orders-track-create)
* [Orders Trackers Patch](../../doc/controllers/orders.md#orders-trackers-patch)
+# Orders Create
+
+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.
+
+```php
+function ordersCreate(array $options): ApiResponse
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - |
+| `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. |
+
+## Response Type
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
+
+## Example Usage
+
+```php
+$collect = [
+ 'body' => OrderRequestBuilder::init(
+ CheckoutPaymentIntent::CAPTURE,
+ [
+ PurchaseUnitRequestBuilder::init(
+ AmountWithBreakdownBuilder::init(
+ 'currency_code6',
+ 'value0'
+ )->build()
+ )->build()
+ ]
+ )->build(),
+ 'prefer' => 'return=minimal'
+];
+
+$apiResponse = $ordersController->ordersCreate($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 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) |
+
+
+# Orders Get
+
+Shows details for an order, by ID.Note: For error handling and troubleshooting, see Orders v2 errors.
+
+```php
+function ordersGet(array $options): ApiResponse
+```
+
+## 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]+$` |
+| `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
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
+
+## Example Usage
+
+```php
+$collect = [
+ 'id' => 'id0'
+];
+
+$apiResponse = $ordersController->ordersGet($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) |
+| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
+
+
+# Orders Patch
+
+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:
| Attribute | Op | Notes | intent | replace | |
payer | replace, add | Using replace op for payer will replace the whole payer object with the value sent in request. |
purchase_units | replace, add | |
purchase_units[].custom_id | replace, add, remove | |
purchase_units[].description | replace, add, remove | |
purchase_units[].payee.email | replace | |
purchase_units[].shipping.name | replace, add | |
purchase_units[].shipping.email_address | replace, add | |
purchase_units[].shipping.phone_number | replace, add | |
purchase_units[].shipping.options | replace, add | |
purchase_units[].shipping.address | replace, add | |
purchase_units[].shipping.type | replace, add | |
purchase_units[].soft_descriptor | replace, remove | |
purchase_units[].amount | replace | |
purchase_units[].items | replace, add, remove | |
purchase_units[].invoice_id | replace, add, remove | |
purchase_units[].payment_instruction | replace | |
purchase_units[].payment_instruction.disbursement_mode | replace | By default, disbursement_mode is INSTANT. |
purchase_units[].payment_instruction.payee_receivable_fx_rate_id | replace, add, remove | |
purchase_units[].payment_instruction.platform_fees | replace, add, remove | |
purchase_units[].supplementary_data.airline | replace, add, remove | |
purchase_units[].supplementary_data.card | replace, add, remove | |
application_context.client_configuration | replace, add | |
+
+```php
+function ordersPatch(array $options): ApiResponse
+```
+
+## 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]+$` |
+| `paypalAuthAssertion` | `?string` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. |
+| `body` | [`?(Patch[])`](../../doc/models/patch.md) | Body, Optional | - |
+
+## Response Type
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance.
+
+## Example Usage
+
+```php
+$collect = [
+ 'id' => 'id0',
+ 'body' => [
+ PatchBuilder::init(
+ PatchOp::ADD
+ )->build()
+ ]
+];
+
+$apiResponse = $ordersController->ordersPatch($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 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) |
+
+
+# Orders Confirm
+
+Payer confirms their intent to pay for the the Order with the given payment source.
+
+```php
+function ordersConfirm(array $options): ApiResponse
+```
+
+## 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` |
+| `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
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
+
+## Example Usage
+
+```php
+$collect = [
+ 'id' => 'id0',
+ 'prefer' => 'return=minimal'
+];
+
+$apiResponse = $ordersController->ordersConfirm($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 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) |
+| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
+
+
# Orders Authorize
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.
@@ -35,7 +218,7 @@ function ordersAuthorize(array $options): ApiResponse
| 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]+$` |
-| `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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` |
+| `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. |
@@ -69,6 +252,53 @@ $apiResponse = $ordersController->ordersAuthorize($collect);
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
+# Orders Capture
+
+Captures payment for an order. To successfully capture 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.
+
+```php
+function ordersCapture(array $options): ApiResponse
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `id` | `string` | Template, Required | The ID of the order for which to capture a payment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` |
+| `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` | [`?OrderCaptureRequest`](../../doc/models/order-capture-request.md) | Body, Optional | - |
+
+## Response Type
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
+
+## Example Usage
+
+```php
+$collect = [
+ 'id' => 'id0',
+ 'prefer' => 'return=minimal'
+];
+
+$apiResponse = $ordersController->ordersCapture($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) |
+| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
+
+
# Orders Track Create
Adds tracking information for an Order.
@@ -116,237 +346,6 @@ $apiResponse = $ordersController->ordersTrackCreate($collect);
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
-# Orders Create
-
-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.
-
-```php
-function ordersCreate(array $options): ApiResponse
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - |
-| `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.
**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=,-]*$` |
-
-## Response Type
-
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
-
-## Example Usage
-
-```php
-$collect = [
- 'body' => OrderRequestBuilder::init(
- CheckoutPaymentIntent::CAPTURE,
- [
- PurchaseUnitRequestBuilder::init(
- AmountWithBreakdownBuilder::init(
- 'currency_code6',
- 'value0'
- )->build()
- )->build()
- ]
- )->build(),
- 'prefer' => 'return=minimal'
-];
-
-$apiResponse = $ordersController->ordersCreate($collect);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 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) |
-
-
-# Orders Patch
-
-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:
| Attribute | Op | Notes | intent | replace | |
payer | replace, add | Using replace op for payer will replace the whole payer object with the value sent in request. |
purchase_units | replace, add | |
purchase_units[].custom_id | replace, add, remove | |
purchase_units[].description | replace, add, remove | |
purchase_units[].payee.email | replace | |
purchase_units[].shipping.name | replace, add | |
purchase_units[].shipping.email_address | replace, add | |
purchase_units[].shipping.phone_number | replace, add | |
purchase_units[].shipping.options | replace, add | |
purchase_units[].shipping.address | replace, add | |
purchase_units[].shipping.type | replace, add | |
purchase_units[].soft_descriptor | replace, remove | |
purchase_units[].amount | replace | |
purchase_units[].items | replace, add, remove | |
purchase_units[].invoice_id | replace, add, remove | |
purchase_units[].payment_instruction | replace | |
purchase_units[].payment_instruction.disbursement_mode | replace | By default, disbursement_mode is INSTANT. |
purchase_units[].payment_instruction.payee_receivable_fx_rate_id | replace, add, remove | |
purchase_units[].payment_instruction.platform_fees | replace, add, remove | |
purchase_units[].supplementary_data.airline | replace, add, remove | |
purchase_units[].supplementary_data.card | replace, add, remove | |
application_context.client_configuration | replace, add | |
-
-```php
-function ordersPatch(array $options): ApiResponse
-```
-
-## 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` | [`?(Patch[])`](../../doc/models/patch.md) | Body, Optional | - |
-
-## Response Type
-
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance.
-
-## Example Usage
-
-```php
-$collect = [
- 'id' => 'id0',
- 'body' => [
- PatchBuilder::init(
- PatchOp::ADD
- )->build()
- ]
-];
-
-$apiResponse = $ordersController->ordersPatch($collect);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 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) |
-
-
-# Orders Capture
-
-Captures payment for an order. To successfully capture 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.
-
-```php
-function ordersCapture(array $options): ApiResponse
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `id` | `string` | Template, Required | The ID of the order for which to capture a payment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` |
-| `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.
**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` | [`?OrderCaptureRequest`](../../doc/models/order-capture-request.md) | Body, Optional | - |
-
-## Response Type
-
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
-
-## Example Usage
-
-```php
-$collect = [
- 'id' => 'id0',
- 'prefer' => 'return=minimal'
-];
-
-$apiResponse = $ordersController->ordersCapture($collect);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) |
-| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
-
-
-# Orders Get
-
-Shows details for an order, by ID.Note: For error handling and troubleshooting, see Orders v2 errors.
-
-```php
-function ordersGet(array $options): ApiResponse
-```
-
-## 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]+$` |
-| `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 a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
-
-## Example Usage
-
-```php
-$collect = [
- 'id' => 'id0'
-];
-
-$apiResponse = $ordersController->ordersGet($collect);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) |
-| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
-
-
-# Orders Confirm
-
-Payer confirms their intent to pay for the the Order with the given payment source.
-
-```php
-function ordersConfirm(array $options): ApiResponse
-```
-
-## 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` |
-| `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
-
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`Order`](../../doc/models/order.md).
-
-## Example Usage
-
-```php
-$collect = [
- 'id' => 'id0',
- 'prefer' => 'return=minimal',
- 'body' => ConfirmOrderRequestBuilder::init(
- PaymentSourceBuilder::init()->build()
- )
- ->processingInstruction(ProcessingInstruction::NO_INSTRUCTION)
- ->build()
-];
-
-$apiResponse = $ordersController->ordersConfirm($collect);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 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) |
-| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
-
-
# Orders Trackers Patch
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. |
@@ -361,6 +360,7 @@ function ordersTrackersPatch(array $options): ApiResponse
| --- | --- | --- | --- |
| `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. |
| `body` | [`?(Patch[])`](../../doc/models/patch.md) | Body, Optional | - |
## Response Type
diff --git a/doc/controllers/payments.md b/doc/controllers/payments.md
index 4f31889..d391cdc 100644
--- a/doc/controllers/payments.md
+++ b/doc/controllers/payments.md
@@ -14,8 +14,8 @@ $paymentsController = $client->getPaymentsController();
* [Authorizations Get](../../doc/controllers/payments.md#authorizations-get)
* [Authorizations Capture](../../doc/controllers/payments.md#authorizations-capture)
-* [Authorizations Void](../../doc/controllers/payments.md#authorizations-void)
* [Authorizations Reauthorize](../../doc/controllers/payments.md#authorizations-reauthorize)
+* [Authorizations Void](../../doc/controllers/payments.md#authorizations-void)
* [Captures Get](../../doc/controllers/payments.md#captures-get)
* [Captures Refund](../../doc/controllers/payments.md#captures-refund)
* [Refunds Get](../../doc/controllers/payments.md#refunds-get)
@@ -26,7 +26,7 @@ $paymentsController = $client->getPaymentsController();
Shows details for an authorized payment, by ID.
```php
-function authorizationsGet(string $authorizationId): ApiResponse
+function authorizationsGet(array $options): ApiResponse
```
## Parameters
@@ -34,6 +34,7 @@ function authorizationsGet(string $authorizationId): ApiResponse
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `authorizationId` | `string` | Template, Required | The ID of the authorized payment for which to show details. |
+| `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.
|
## Response Type
@@ -42,9 +43,11 @@ This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getR
## Example Usage
```php
-$authorizationId = 'authorization_id8';
+$collect = [
+ 'authorizationId' => 'authorization_id8'
+];
-$apiResponse = $paymentsController->authorizationsGet($authorizationId);
+$apiResponse = $paymentsController->authorizationsGet($collect);
```
## Errors
@@ -52,7 +55,6 @@ $apiResponse = $paymentsController->authorizationsGet($authorizationId);
| 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) |
-| 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) |
| 500 | The request failed because an internal server error occurred. | `ApiException` |
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
@@ -73,6 +75,7 @@ function authorizationsCapture(array $options): ApiResponse
| `authorizationId` | `string` | Template, Required | The PayPal-generated ID for the authorized payment to capture. |
| `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
@@ -107,51 +110,6 @@ $apiResponse = $paymentsController->authorizationsCapture($collect);
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
-# Authorizations Void
-
-Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been fully captured.
-
-```php
-function authorizationsVoid(array $options): ApiResponse
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `authorizationId` | `string` | Template, Required | The PayPal-generated ID for the authorized payment to void. |
-| `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.
|
-| `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'` |
-
-## Response Type
-
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`?PaymentAuthorization`](../../doc/models/payment-authorization.md).
-
-## Example Usage
-
-```php
-$collect = [
- 'authorizationId' => 'authorization_id8',
- 'prefer' => 'return=minimal'
-];
-
-$apiResponse = $paymentsController->authorizationsVoid($collect);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 500 | The request failed because an internal server error occurred. | `ApiException` |
-| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
-
-
# Authorizations Reauthorize
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.
@@ -167,6 +125,7 @@ function authorizationsReauthorize(array $options): ApiResponse
| `authorizationId` | `string` | Template, Required | The PayPal-generated ID for the authorized payment to reauthorize. |
| `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` | [`?ReauthorizeRequest`](../../doc/models/reauthorize-request.md) | Body, Optional | - |
## Response Type
@@ -190,8 +149,52 @@ $apiResponse = $paymentsController->authorizationsReauthorize($collect);
| --- | --- | --- |
| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 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` |
+| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) |
+
+
+# Authorizations Void
+
+Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been fully captured.
+
+```php
+function authorizationsVoid(array $options): ApiResponse
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `authorizationId` | `string` | Template, Required | The PayPal-generated ID for the authorized payment to void. |
+| `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.
|
+| `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'` |
+
+## Response Type
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`?PaymentAuthorization`](../../doc/models/payment-authorization.md).
+
+## Example Usage
+
+```php
+$collect = [
+ 'authorizationId' => 'authorization_id8',
+ 'prefer' => 'return=minimal'
+];
+
+$apiResponse = $paymentsController->authorizationsVoid($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) |
| 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) |
@@ -286,7 +289,7 @@ $apiResponse = $paymentsController->capturesRefund($collect);
Shows details for a refund, by ID.
```php
-function refundsGet(string $refundId): ApiResponse
+function refundsGet(array $options): ApiResponse
```
## Parameters
@@ -294,6 +297,7 @@ function refundsGet(string $refundId): ApiResponse
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `refundId` | `string` | Template, Required | The PayPal-generated ID for the refund for which to show details. |
+| `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.
|
## Response Type
@@ -302,9 +306,11 @@ This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getR
## Example Usage
```php
-$refundId = 'refund_id4';
+$collect = [
+ 'refundId' => 'refund_id4'
+];
-$apiResponse = $paymentsController->refundsGet($refundId);
+$apiResponse = $paymentsController->refundsGet($collect);
```
## Errors
diff --git a/doc/controllers/vault.md b/doc/controllers/vault.md
index dd1caed..feb2743 100644
--- a/doc/controllers/vault.md
+++ b/doc/controllers/vault.md
@@ -12,14 +12,57 @@ $vaultController = $client->getVaultController();
## Methods
+* [Payment-Tokens Create](../../doc/controllers/vault.md#payment-tokens-create)
* [Customer Payment-Tokens Get](../../doc/controllers/vault.md#customer-payment-tokens-get)
* [Payment-Tokens Get](../../doc/controllers/vault.md#payment-tokens-get)
-* [Payment-Tokens Create](../../doc/controllers/vault.md#payment-tokens-create)
-* [Setup-Tokens Create](../../doc/controllers/vault.md#setup-tokens-create)
* [Payment-Tokens Delete](../../doc/controllers/vault.md#payment-tokens-delete)
+* [Setup-Tokens Create](../../doc/controllers/vault.md#setup-tokens-create)
* [Setup-Tokens Get](../../doc/controllers/vault.md#setup-tokens-get)
+# Payment-Tokens Create
+
+Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer.
+
+```php
+function paymentTokensCreate(array $options): ApiResponse
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `paypalRequestId` | `string` | Header, Required | The server stores keys for 3 hours. |
+| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. |
+
+## Response Type
+
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md).
+
+## Example Usage
+
+```php
+$collect = [
+ 'paypalRequestId' => 'PayPal-Request-Id6',
+ 'body' => PaymentTokenRequestBuilder::init(
+ PaymentTokenRequestPaymentSourceBuilder::init()->build()
+ )->build()
+];
+
+$apiResponse = $vaultController->paymentTokensCreate($collect);
+```
+
+## Errors
+
+| HTTP Status Code | Error Description | Exception Class |
+| --- | --- | --- |
+| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
+| 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) |
+
+
# Customer Payment-Tokens Get
Returns all payment tokens for a customer.
@@ -99,36 +142,30 @@ $apiResponse = $vaultController->paymentTokensGet($id);
| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) |
-# Payment-Tokens Create
+# Payment-Tokens Delete
-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.
```php
-function paymentTokensCreate(array $options): ApiResponse
+function paymentTokensDelete(string $id): ApiResponse
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `paypalRequestId` | `string` | Header, Required | The server stores keys for 3 hours. |
-| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. |
+| `id` | `string` | Template, Required | ID of the payment token.
**Constraints**: *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` |
## Response Type
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md).
+This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance.
## Example Usage
```php
-$collect = [
- 'paypalRequestId' => 'PayPal-Request-Id6',
- 'body' => PaymentTokenRequestBuilder::init(
- PaymentTokenRequestPaymentSourceBuilder::init()->build()
- )->build()
-];
+$id = 'id0';
-$apiResponse = $vaultController->paymentTokensCreate($collect);
+$apiResponse = $vaultController->paymentTokensDelete($id);
```
## Errors
@@ -137,8 +174,6 @@ $apiResponse = $vaultController->paymentTokensCreate($collect);
| --- | --- | --- |
| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) |
| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) |
@@ -184,41 +219,6 @@ $apiResponse = $vaultController->setupTokensCreate($collect);
| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) |
-# Payment-Tokens Delete
-
-Delete the payment token associated with the payment token id.
-
-```php
-function paymentTokensDelete(string $id): ApiResponse
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `id` | `string` | Template, Required | ID of the payment token.
**Constraints**: *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` |
-
-## Response Type
-
-This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance.
-
-## Example Usage
-
-```php
-$id = 'id0';
-
-$apiResponse = $vaultController->paymentTokensDelete($id);
-```
-
-## Errors
-
-| HTTP Status Code | Error Description | Exception Class |
-| --- | --- | --- |
-| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) |
-| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) |
-
-
# Setup-Tokens Get
Returns a readable representation of temporarily vaulted payment source associated with the setup token id.
diff --git a/doc/models/card-verification-details.md b/doc/models/card-verification-details.md
index b5f5352..81abf4a 100644
--- a/doc/models/card-verification-details.md
+++ b/doc/models/card-verification-details.md
@@ -17,6 +17,7 @@ Card Verification details including the authorization details and 3D SECURE deta
| `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})$` | getTime(): ?string | setTime(?string time): void |
| `amount` | [`?Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | getAmount(): ?Money | setAmount(?Money amount): void |
| `processorResponse` | [`?CardVerificationProcessorResponse`](../../doc/models/card-verification-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | getProcessorResponse(): ?CardVerificationProcessorResponse | setProcessorResponse(?CardVerificationProcessorResponse processorResponse): void |
+| `threeDSecure` | `mixed` | Optional | DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in 'three_d_secure' object under 'authentication_result' object instead of the 'verification' field. | getThreeDSecure(): | setThreeDSecure( threeDSecure): void |
## Example (as JSON)
diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md
index 9ab3538..11e6b4f 100644
--- a/doc/models/confirm-order-request.md
+++ b/doc/models/confirm-order-request.md
@@ -12,7 +12,7 @@ Payer confirms the intent to pay for the Order using the provided payment source
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `paymentSource` | [`PaymentSource`](../../doc/models/payment-source.md) | Required | The payment source definition. | getPaymentSource(): PaymentSource | setPaymentSource(PaymentSource paymentSource): void |
-| `processingInstruction` | [`?string(ProcessingInstruction)`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order.
**Default**: `ProcessingInstruction::NO_INSTRUCTION`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Z_]+$` | getProcessingInstruction(): ?string | setProcessingInstruction(?string processingInstruction): void |
+| `processingInstruction` | `mixed` | Optional | - | getProcessingInstruction(): | setProcessingInstruction( processingInstruction): void |
| `applicationContext` | [`?OrderConfirmApplicationContext`](../../doc/models/order-confirm-application-context.md) | Optional | Customizes the payer confirmation experience. | getApplicationContext(): ?OrderConfirmApplicationContext | setApplicationContext(?OrderConfirmApplicationContext applicationContext): void |
## Example (as JSON)
@@ -86,7 +86,10 @@ Payer confirms the intent to pay for the Order using the provided payment source
}
}
},
- "processing_instruction": "NO_INSTRUCTION",
+ "processing_instruction": {
+ "key1": "val1",
+ "key2": "val2"
+ },
"application_context": {
"brand_name": "brand_name8",
"locale": "locale2",
diff --git a/doc/models/fullfillment-type.md b/doc/models/fulfillment-type.md
similarity index 88%
rename from doc/models/fullfillment-type.md
rename to doc/models/fulfillment-type.md
index 3c9598b..d8d0360 100644
--- a/doc/models/fullfillment-type.md
+++ b/doc/models/fulfillment-type.md
@@ -1,11 +1,11 @@
-# Fullfillment Type
+# Fulfillment Type
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.
## Enumeration
-`FullfillmentType`
+`FulfillmentType`
## Fields
diff --git a/doc/models/google-pay-card.md b/doc/models/google-pay-card.md
new file mode 100644
index 0000000..0cdfb7e
--- /dev/null
+++ b/doc/models/google-pay-card.md
@@ -0,0 +1,33 @@
+
+# Google Pay Card
+
+The payment card used to fund a Google Pay payment. Can be a credit or debit card.
+
+## Structure
+
+`GooglePayCard`
+
+## 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}$` | getName(): ?string | setName(?string name): void |
+| `number` | `?string` | Optional | The primary account number (PAN) for the payment card.
**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | getNumber(): ?string | setNumber(?string number): void |
+| `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])$` | getExpiry(): ?string | setExpiry(?string expiry): void |
+| `lastDigits` | `?string` | Optional | The last digits of the payment card.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `4`, *Pattern*: `^[0-9]{2,4}$` | getLastDigits(): ?string | setLastDigits(?string lastDigits): void |
+| `type` | [`?string(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_]+$` | getType(): ?string | setType(?string type): void |
+| `brand` | [`?string(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_]+$` | getBrand(): ?string | setBrand(?string brand): void |
+| `billingAddress` | [`?PortablePostalAddressMediumGrained`](../../doc/models/portable-postal-address-medium-grained.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). | getBillingAddress(): ?PortablePostalAddressMediumGrained | setBillingAddress(?PortablePostalAddressMediumGrained billingAddress): void |
+
+## Example (as JSON)
+
+```json
+{
+ "name": "name4",
+ "number": "number2",
+ "expiry": "expiry2",
+ "last_digits": "last_digits8",
+ "type": "DEBIT"
+}
+```
+
diff --git a/doc/models/google-pay-decrypted-token-data.md b/doc/models/google-pay-decrypted-token-data.md
index 20a3832..2fd7694 100644
--- a/doc/models/google-pay-decrypted-token-data.md
+++ b/doc/models/google-pay-decrypted-token-data.md
@@ -14,6 +14,7 @@ Details shared by Google for the merchant to be shared with PayPal. This is requ
| `messageId` | `?string` | Optional | A unique ID that identifies the message in case it needs to be revoked or located at a later time.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250`, *Pattern*: `^.*$` | getMessageId(): ?string | setMessageId(?string messageId): void |
| `messageExpiration` | `?string` | Optional | Date and time at which the message expires as UTC milliseconds since epoch. Integrators should reject any message that's expired.
**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `\d{13}` | getMessageExpiration(): ?string | setMessageExpiration(?string messageExpiration): void |
| `paymentMethod` | [`string(GooglePayPaymentMethod)`](../../doc/models/google-pay-payment-method.md) | Required | The type of the payment credential. Currently, only CARD is supported.
**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4` | getPaymentMethod(): string | setPaymentMethod(string paymentMethod): void |
+| `card` | [`GooglePayCard`](../../doc/models/google-pay-card.md) | Required | The payment card used to fund a Google Pay payment. Can be a credit or debit card. | getCard(): GooglePayCard | setCard(GooglePayCard card): void |
| `authenticationMethod` | [`string(GooglePayAuthenticationMethod)`](../../doc/models/google-pay-authentication-method.md) | Required | Authentication Method which is used for the card transaction.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | getAuthenticationMethod(): string | setAuthenticationMethod(string authenticationMethod): void |
| `cryptogram` | `?string` | Optional | Base-64 cryptographic identifier used by card schemes to validate the token verification result. This is a conditionally required field if authentication_method is CRYPTOGRAM_3DS.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | getCryptogram(): ?string | setCryptogram(?string cryptogram): void |
| `eciIndicator` | `?string` | Optional | Electronic Commerce Indicator may not always be present. It is only returned for tokens on the Visa card network. This value is passed through in the payment authorization request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | getEciIndicator(): ?string | setEciIndicator(?string eciIndicator): void |
@@ -25,6 +26,13 @@ Details shared by Google for the merchant to be shared with PayPal. This is requ
"message_id": "message_id4",
"message_expiration": "message_expiration8",
"payment_method": "CARD",
+ "card": {
+ "name": "name6",
+ "number": "number6",
+ "expiry": "expiry4",
+ "last_digits": "last_digits0",
+ "type": "UNKNOWN"
+ },
"authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram0",
"eci_indicator": "eci_indicator4"
diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md
index aa6eed4..46d2dd6 100644
--- a/doc/models/google-pay-request.md
+++ b/doc/models/google-pay-request.md
@@ -46,6 +46,13 @@ Information needed to pay using Google Pay.
"message_id": "message_id0",
"message_expiration": "message_expiration2",
"payment_method": "CARD",
+ "card": {
+ "name": "name6",
+ "number": "number6",
+ "expiry": "expiry4",
+ "last_digits": "last_digits0",
+ "type": "UNKNOWN"
+ },
"authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0"
diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md
index c8ed07c..6e7a170 100644
--- a/doc/models/order-authorize-request-payment-source.md
+++ b/doc/models/order-authorize-request-payment-source.md
@@ -108,6 +108,13 @@ The payment source definition.
"message_id": "message_id0",
"message_expiration": "message_expiration2",
"payment_method": "CARD",
+ "card": {
+ "name": "name6",
+ "number": "number6",
+ "expiry": "expiry4",
+ "last_digits": "last_digits0",
+ "type": "UNKNOWN"
+ },
"authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0"
diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md
index 62c893c..3535e14 100644
--- a/doc/models/order-authorize-request.md
+++ b/doc/models/order-authorize-request.md
@@ -104,6 +104,13 @@ The authorization of an order request.
"message_id": "message_id0",
"message_expiration": "message_expiration2",
"payment_method": "CARD",
+ "card": {
+ "name": "name6",
+ "number": "number6",
+ "expiry": "expiry4",
+ "last_digits": "last_digits0",
+ "type": "UNKNOWN"
+ },
"authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0"
diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md
index b66e8de..603da86 100644
--- a/doc/models/order-authorize-response.md
+++ b/doc/models/order-authorize-response.md
@@ -14,7 +14,7 @@
| `id` | `?string` | Optional | The ID of the order. | getId(): ?string | setId(?string id): void |
| `paymentSource` | [`?OrderAuthorizeResponsePaymentSource`](../../doc/models/order-authorize-response-payment-source.md) | Optional | The payment source used to fund the payment. | getPaymentSource(): ?OrderAuthorizeResponsePaymentSource | setPaymentSource(?OrderAuthorizeResponsePaymentSource paymentSource): void |
| `intent` | [`?string(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. | getIntent(): ?string | setIntent(?string intent): void |
-| `processingInstruction` | [`?string(ProcessingInstruction)`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order.
**Default**: `ProcessingInstruction::NO_INSTRUCTION`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Z_]+$` | getProcessingInstruction(): ?string | setProcessingInstruction(?string processingInstruction): void |
+| `processingInstruction` | `mixed` | Optional | - | getProcessingInstruction(): | setProcessingInstruction( processingInstruction): void |
| `payer` | [`?Payer`](../../doc/models/payer.md) | Optional | - | getPayer(): ?Payer | setPayer(?Payer payer): void |
| `purchaseUnits` | [`?(PurchaseUnit[])`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | getPurchaseUnits(): ?array | setPurchaseUnits(?array purchaseUnits): void |
| `status` | [`?string(OrderStatus)`](../../doc/models/order-status.md) | Optional | The order status.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | getStatus(): ?string | setStatus(?string status): void |
@@ -24,7 +24,6 @@
```json
{
- "processing_instruction": "NO_INSTRUCTION",
"create_time": "create_time0",
"update_time": "update_time4",
"id": "id4",
diff --git a/doc/models/order-capture-request-payment-source.md b/doc/models/order-capture-request-payment-source.md
index 79983d6..6699f6e 100644
--- a/doc/models/order-capture-request-payment-source.md
+++ b/doc/models/order-capture-request-payment-source.md
@@ -108,6 +108,13 @@ The payment source definition.
"message_id": "message_id0",
"message_expiration": "message_expiration2",
"payment_method": "CARD",
+ "card": {
+ "name": "name6",
+ "number": "number6",
+ "expiry": "expiry4",
+ "last_digits": "last_digits0",
+ "type": "UNKNOWN"
+ },
"authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0"
diff --git a/doc/models/order-capture-request.md b/doc/models/order-capture-request.md
index cdd4e55..2cd8732 100644
--- a/doc/models/order-capture-request.md
+++ b/doc/models/order-capture-request.md
@@ -104,6 +104,13 @@ Completes an capture payment for an order.
"message_id": "message_id0",
"message_expiration": "message_expiration2",
"payment_method": "CARD",
+ "card": {
+ "name": "name6",
+ "number": "number6",
+ "expiry": "expiry4",
+ "last_digits": "last_digits0",
+ "type": "UNKNOWN"
+ },
"authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0"
diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md
index 6d651c6..5654811 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": "SNTGLOBAL_API",
+ "carrier": "HOMERUNNER",
"carrier_name_other": "carrier_name_other0",
"items": [
{
diff --git a/doc/models/order.md b/doc/models/order.md
index 27ead5f..c089bd9 100644
--- a/doc/models/order.md
+++ b/doc/models/order.md
@@ -16,17 +16,16 @@ The order details.
| `id` | `?string` | Optional | The ID of the order. | getId(): ?string | setId(?string id): void |
| `paymentSource` | [`?PaymentSourceResponse`](../../doc/models/payment-source-response.md) | Optional | The payment source used to fund the payment. | getPaymentSource(): ?PaymentSourceResponse | setPaymentSource(?PaymentSourceResponse paymentSource): void |
| `intent` | [`?string(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. | getIntent(): ?string | setIntent(?string intent): void |
-| `processingInstruction` | [`?string(ProcessingInstruction)`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order.
**Default**: `ProcessingInstruction::NO_INSTRUCTION`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Z_]+$` | getProcessingInstruction(): ?string | setProcessingInstruction(?string processingInstruction): void |
+| `processingInstruction` | `mixed` | Optional | - | getProcessingInstruction(): | setProcessingInstruction( processingInstruction): void |
| `payer` | [`?Payer`](../../doc/models/payer.md) | Optional | - | getPayer(): ?Payer | setPayer(?Payer payer): void |
| `purchaseUnits` | [`?(PurchaseUnit[])`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | getPurchaseUnits(): ?array | setPurchaseUnits(?array purchaseUnits): void |
| `status` | [`?string(OrderStatus)`](../../doc/models/order-status.md) | Optional | The order status.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | getStatus(): ?string | setStatus(?string status): void |
-| `links` | [`?(LinkDescription[])`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 3 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 3 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. | getLinks(): ?array | setLinks(?array links): void |
+| `links` | [`?(LinkDescription[])`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | getLinks(): ?array | setLinks(?array links): void |
## Example (as JSON)
```json
{
- "processing_instruction": "NO_INSTRUCTION",
"create_time": "create_time8",
"update_time": "update_time4",
"id": "id2",
diff --git a/doc/models/portable-postal-address-medium-grained.md b/doc/models/portable-postal-address-medium-grained.md
new file mode 100644
index 0000000..9018b91
--- /dev/null
+++ b/doc/models/portable-postal-address-medium-grained.md
@@ -0,0 +1,33 @@
+
+# Portable Postal Address Medium Grained
+
+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
+
+`PortablePostalAddressMediumGrained`
+
+## Fields
+
+| Name | Type | Tags | Description | Getter | Setter |
+| --- | --- | --- | --- | --- | --- |
+| `addressLine1` | `?string` | Optional | The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for data entry, and Compliance and Risk checks. This field needs to pass the full address.
**Constraints**: *Maximum Length*: `300` | getAddressLine1(): ?string | setAddressLine1(?string addressLine1): void |
+| `addressLine2` | `?string` | Optional | The second line of the address, for example, a suite or apartment number.
**Constraints**: *Maximum Length*: `300` | getAddressLine2(): ?string | setAddressLine2(?string addressLine2): void |
+| `adminArea2` | `?string` | Optional | A city, town, or village. Smaller than `admin_area_level_1`.
**Constraints**: *Maximum Length*: `120` | getAdminArea2(): ?string | setAdminArea2(?string adminArea2): void |
+| `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` | getAdminArea1(): ?string | setAdminArea1(?string adminArea1): void |
+| `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` | getPostalCode(): ?string | setPostalCode(?string postalCode): void |
+| `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)$` | getCountryCode(): string | setCountryCode(string countryCode): void |
+
+## Example (as JSON)
+
+```json
+{
+ "address_line_1": "address_line_16",
+ "address_line_2": "address_line_24",
+ "admin_area_2": "admin_area_22",
+ "admin_area_1": "admin_area_10",
+ "postal_code": "postal_code6",
+ "country_code": "country_code6"
+}
+```
+
diff --git a/doc/models/processing-instruction.md b/doc/models/processing-instruction.md
deleted file mode 100644
index 1d19956..0000000
--- a/doc/models/processing-instruction.md
+++ /dev/null
@@ -1,16 +0,0 @@
-
-# Processing Instruction
-
-The instruction to process an order.
-
-## Enumeration
-
-`ProcessingInstruction`
-
-## Fields
-
-| Name |
-| --- |
-| `ORDER_COMPLETE_ON_PAYMENT_APPROVAL` |
-| `NO_INSTRUCTION` |
-
diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md
index ecbf9ed..b5c1fae 100644
--- a/doc/models/shipment-carrier.md
+++ b/doc/models/shipment-carrier.md
@@ -1287,4 +1287,112 @@ The carrier for the shipment. Some carriers have a global version as well as loc
| `LOGINEXT_WEBHOOK` |
| `EMS` |
| `SPEEDY` |
+| `ZOOM_RED` |
+| `NAVLUNGO` |
+| `CASTLEPARCELS` |
+| `WEEE` |
+| `PACKALY` |
+| `YUNHUIPOST` |
+| `YOUPARCEL` |
+| `LEMAN` |
+| `MOOVIN` |
+| `URB_IT` |
+| `MULTIENTREGAPANAMA` |
+| `JUSDASR` |
+| `DISCOUNTPOST` |
+| `RHENUS_UK` |
+| `SWISHIP_JP` |
+| `GLS_US` |
+| `SMTL` |
+| `EMEGA` |
+| `EXPRESSONE_SV` |
+| `HEPSIJET` |
+| `WELIVERY` |
+| `BRINGER` |
+| `EASYROUTES` |
+| `MRW` |
+| `RPM` |
+| `DPD_PRT` |
+| `GLS_ROMANIA` |
+| `LMPARCEL` |
+| `GTAGSM` |
+| `DOMINO` |
+| `ESHIPPER` |
+| `TRANSPAK` |
+| `XINDUS` |
+| `AOYUE` |
+| `EASYPARCEL` |
+| `EXPRESSONE` |
+| `SENDEO_KARGO` |
+| `SPEEDAF` |
+| `ETOWER` |
+| `GCX` |
+| `NINJAVAN_VN` |
+| `ALLEGRO` |
+| `JUMPPOINT` |
+| `SHIPGLOBAL_US` |
+| `KINISI` |
+| `OAKH` |
+| `AWEST` |
+| `BARSAN` |
+| `ENERGOLOGISTIC` |
+| `MADROOEX` |
+| `GOBOLT` |
+| `SWISS_UNIVERSAL_EXPRESS` |
+| `IORDIRECT` |
+| `XMSZM` |
+| `GLS_HUN` |
+| `SENDY` |
+| `BRAUNSEXPRESS` |
+| `GRANDSLAMEXPRESS` |
+| `XGS` |
+| `OTSCHILE` |
+| `PACK_UP` |
+| `PARCELSTARS` |
+| `TEAMEXPRESSLLC` |
+| `ASYADEXPRESS` |
+| `TDN` |
+| `EARLYBIRD` |
+| `CACESA` |
+| `PARCELJET` |
+| `MNG_KARGO` |
+| `SUPERPACKLINE` |
+| `SPEEDX` |
+| `VESYL` |
+| `SKYKING` |
+| `DIRMENSAJERIA` |
+| `NETLOGIXGROUP` |
+| `ZYOU` |
+| `JAWAR` |
+| `AGSYSTEMS` |
+| `GPS` |
+| `PTT_KARGO` |
+| `MAERGO` |
+| `ARIHANTCOURIER` |
+| `VTFE` |
+| `YUNANT` |
+| `URBIFY` |
+| `PACK_MAN` |
+| `LIEFERGRUN` |
+| `OBIBOX` |
+| `PAIKEDA` |
+| `SCOTTY` |
+| `INTELCOM_CA` |
+| `SWE` |
+| `ASENDIA` |
+| `DPD_AT` |
+| `RELAY` |
+| `ATA` |
+| `SKYEXPRESS_INTERNATIONAL` |
+| `SURAT_KARGO` |
+| `SGLINK` |
+| `FLEETOPTICSINC` |
+| `SHOPLINE` |
+| `PIGGYSHIP` |
+| `LOGOIX` |
+| `KOLAY_GELSIN` |
+| `ASSOCIATED_COURIERS` |
+| `UPS_CHECKER` |
+| `WINESHIPPING` |
+| `SPEDISCI` |
diff --git a/doc/models/shipping-details.md b/doc/models/shipping-details.md
index 5f563f6..d67b937 100644
--- a/doc/models/shipping-details.md
+++ b/doc/models/shipping-details.md
@@ -13,7 +13,7 @@ The shipping details.
| --- | --- | --- | --- | --- | --- |
| `name` | [`?ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | getName(): ?ShippingName | setName(?ShippingName name): void |
| `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). | getPhoneNumber(): ?PhoneNumberWithCountryCode | setPhoneNumber(?PhoneNumberWithCountryCode phoneNumber): void |
-| `type` | [`?string(FullfillmentType)`](../../doc/models/fullfillment-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_]+$` | getType(): ?string | setType(?string type): void |
+| `type` | [`?string(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_]+$` | getType(): ?string | setType(?string type): void |
| `options` | [`?(ShippingOption[])`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.
**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | getOptions(): ?array | setOptions(?array options): void |
| `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). | getAddress(): ?Address | setAddress(?Address address): void |
diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md
index 4b1cbe5..da9957a 100644
--- a/doc/models/shipping-with-tracking-details.md
+++ b/doc/models/shipping-with-tracking-details.md
@@ -13,7 +13,7 @@ The order shipping details.
| --- | --- | --- | --- | --- | --- |
| `name` | [`?ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | getName(): ?ShippingName | setName(?ShippingName name): void |
| `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). | getPhoneNumber(): ?PhoneNumberWithCountryCode | setPhoneNumber(?PhoneNumberWithCountryCode phoneNumber): void |
-| `type` | [`?string(FullfillmentType)`](../../doc/models/fullfillment-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_]+$` | getType(): ?string | setType(?string type): void |
+| `type` | [`?string(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_]+$` | getType(): ?string | setType(?string type): void |
| `options` | [`?(ShippingOption[])`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.
**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | getOptions(): ?array | setOptions(?array options): void |
| `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). | getAddress(): ?Address | setAddress(?Address address): void |
| `trackers` | [`?(OrderTrackerResponse[])`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | getTrackers(): ?array | setTrackers(?array trackers): void |
diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md
index d2ba5c4..05dcb77 100644
--- a/doc/models/vaulted-digital-wallet-shipping-details.md
+++ b/doc/models/vaulted-digital-wallet-shipping-details.md
@@ -12,7 +12,7 @@ The shipping details.
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `name` | [`?ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | getName(): ?ShippingName | setName(?ShippingName name): void |
-| `type` | [`?string(FullfillmentType)`](../../doc/models/fullfillment-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_]+$` | getType(): ?string | setType(?string type): void |
+| `type` | [`?string(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_]+$` | getType(): ?string | setType(?string type): void |
| `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). | getAddress(): ?Address | setAddress(?Address address): void |
## Example (as JSON)
diff --git a/src/Controllers/OrdersController.php b/src/Controllers/OrdersController.php
index 614e8ec..54216b3 100644
--- a/src/Controllers/OrdersController.php
+++ b/src/Controllers/OrdersController.php
@@ -23,6 +23,238 @@ use PaypalServerSdkLib\Models\OrderAuthorizeResponse;
class OrdersController extends BaseController
{
+ /**
+ * 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 array $options Array with all options for search
+ *
+ * @return ApiResponse Response from the API call
+ */
+ public function ordersCreate(array $options): ApiResponse
+ {
+ $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders')
+ ->auth('Oauth2')
+ ->parameters(
+ HeaderParam::init('Content-Type', 'application/json'),
+ BodyParam::init($options)->extract('body'),
+ HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
+ HeaderParam::init('PayPal-Partner-Attribution-Id', $options)->extract('paypalPartnerAttributionId'),
+ HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('paypalClientMetadataId'),
+ HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion')
+ );
+
+ $_resHandler = $this->responseHandler()
+ ->throwErrorOn(
+ '400',
+ ErrorType::init(
+ 'Request is not well-formed, syntactically incorrect, or violates schema.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '401',
+ ErrorType::init(
+ 'Authentication failed due to missing authorization header, or invalid auth' .
+ 'entication credentials.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '422',
+ ErrorType::init(
+ 'The requested action could not be performed, semantically incorrect, or fa' .
+ 'iled business validation.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
+ ->type(Order::class)
+ ->returnApiResponse();
+
+ return $this->execute($_reqBuilder, $_resHandler);
+ }
+
+ /**
+ * Shows details for an order, by ID.Note: For error handling and
+ * troubleshooting, see Orders v2 errors.
+ *
+ * @param array $options Array with all options for search
+ *
+ * @return ApiResponse Response from the API call
+ */
+ public function ordersGet(array $options): ApiResponse
+ {
+ $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/checkout/orders/{id}')
+ ->auth('Oauth2')
+ ->parameters(
+ TemplateParam::init('id', $options)->extract('id'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
+ QueryParam::init('fields', $options)->extract('fields')
+ );
+
+ $_resHandler = $this->responseHandler()
+ ->throwErrorOn(
+ '401',
+ ErrorType::init(
+ 'Authentication failed due to missing authorization header, or invalid auth' .
+ 'entication credentials.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
+ ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
+ ->type(Order::class)
+ ->returnApiResponse();
+
+ return $this->execute($_reqBuilder, $_resHandler);
+ }
+
+ /**
+ * 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:
+ *
| Attribute | Op | Notes | inte
+ * nt | replace | |
payer | replace,
+ * add | Using replace op for payer will replace the whole payer object
+ * with the value sent in request. |
purchase_units | replace,
+ * add | |
purchase_units[].custom_id | replace, add,
+ * remove | |
purchase_units[].description | replace, add,
+ * remove | |
purchase_units[].payee.
+ * email | replace | |
purchase_units[].shipping.
+ * name | replace, add | |
purchase_units[].shipping.
+ * email_address | replace, add | |
purchase_units[].shipping.
+ * phone_number | replace, add | |
purchase_units[].shipping.
+ * options | replace, add | |
purchase_units[].shipping.
+ * address | replace, add | |
purchase_units[].shipping.
+ * type | replace, add | |
purchase_units[].
+ * soft_descriptor | replace, remove | |
purchase_units[].
+ * amount | replace | |
purchase_units[].
+ * items | replace, add, remove | |
purchase_units[].
+ * invoice_id | replace, add, remove | |
purchase_units[].
+ * payment_instruction | replace | |
purchase_units[].
+ * payment_instruction.disbursement_mode | replace | By default,
+ * disbursement_mode is INSTANT. |
purchase_units[].
+ * payment_instruction.payee_receivable_fx_rate_id | replace, add,
+ * remove | |
purchase_units[].payment_instruction.
+ * platform_fees | replace, add, remove | |
purchase_units[].
+ * supplementary_data.airline | replace, add,
+ * remove | |
purchase_units[].supplementary_data.
+ * card | replace, add, remove | |
application_context.
+ * client_configuration | replace, add | |
+ *
+ * @param array $options Array with all options for search
+ *
+ * @return ApiResponse Response from the API call
+ */
+ public function ordersPatch(array $options): ApiResponse
+ {
+ $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/v2/checkout/orders/{id}')
+ ->auth('Oauth2')
+ ->parameters(
+ TemplateParam::init('id', $options)->extract('id'),
+ HeaderParam::init('Content-Type', 'application/json'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
+ BodyParam::init($options)->extract('body')
+ );
+
+ $_resHandler = $this->responseHandler()
+ ->throwErrorOn(
+ '400',
+ ErrorType::init(
+ 'Request is not well-formed, syntactically incorrect, or violates schema.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '401',
+ ErrorType::init(
+ 'Authentication failed due to missing authorization header, or invalid auth' .
+ 'entication credentials.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
+ ->throwErrorOn(
+ '422',
+ ErrorType::init(
+ 'The requested action could not be performed, semantically incorrect, or fa' .
+ 'iled business validation.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
+ ->returnApiResponse();
+
+ return $this->execute($_reqBuilder, $_resHandler);
+ }
+
+ /**
+ * Payer confirms their intent to pay for the the Order with the given payment source.
+ *
+ * @param array $options Array with all options for search
+ *
+ * @return ApiResponse Response from the API call
+ */
+ public function ordersConfirm(array $options): ApiResponse
+ {
+ $_reqBuilder = $this->requestBuilder(
+ RequestMethod::POST,
+ '/v2/checkout/orders/{id}/confirm-payment-source'
+ )
+ ->auth('Oauth2')
+ ->parameters(
+ TemplateParam::init('id', $options)->extract('id'),
+ HeaderParam::init('Content-Type', 'application/json'),
+ HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('paypalClientMetadataId'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
+ HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
+ BodyParam::init($options)->extract('body')
+ );
+
+ $_resHandler = $this->responseHandler()
+ ->throwErrorOn(
+ '400',
+ ErrorType::init(
+ 'Request is not well-formed, syntactically incorrect, or violates schema.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '403',
+ ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
+ )
+ ->throwErrorOn(
+ '422',
+ ErrorType::init(
+ 'The requested action could not be performed, semantically incorrect, or fa' .
+ 'iled business validation.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
+ ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
+ ->type(Order::class)
+ ->returnApiResponse();
+
+ return $this->execute($_reqBuilder, $_resHandler);
+ }
+
/**
* 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
@@ -89,196 +321,6 @@ class OrdersController extends BaseController
return $this->execute($_reqBuilder, $_resHandler);
}
- /**
- * Adds tracking information for an Order.
- *
- * @param array $options Array with all options for search
- *
- * @return ApiResponse Response from the API call
- */
- public function ordersTrackCreate(array $options): ApiResponse
- {
- $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders/{id}/track')
- ->auth('Oauth2')
- ->parameters(
- TemplateParam::init('id', $options)->extract('id'),
- HeaderParam::init('Content-Type', 'application/json'),
- BodyParam::init($options)->extract('body'),
- HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion')
- );
-
- $_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '400',
- ErrorType::init(
- 'Request is not well-formed, syntactically incorrect, or violates schema.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '403',
- ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
- )
- ->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
- ->throwErrorOn(
- '422',
- ErrorType::init(
- 'The requested action could not be performed, semantically incorrect, or fa' .
- 'iled business validation.',
- ErrorException::class
- )
- )
- ->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
- ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
- ->type(Order::class)
- ->returnApiResponse();
-
- return $this->execute($_reqBuilder, $_resHandler);
- }
-
- /**
- * 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 array $options Array with all options for search
- *
- * @return ApiResponse Response from the API call
- */
- public function ordersCreate(array $options): ApiResponse
- {
- $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders')
- ->auth('Oauth2')
- ->parameters(
- HeaderParam::init('Content-Type', 'application/json'),
- BodyParam::init($options)->extract('body'),
- HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
- HeaderParam::init('PayPal-Partner-Attribution-Id', $options)->extract('paypalPartnerAttributionId'),
- HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('paypalClientMetadataId'),
- HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal')
- );
-
- $_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '400',
- ErrorType::init(
- 'Request is not well-formed, syntactically incorrect, or violates schema.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '401',
- ErrorType::init(
- 'Authentication failed due to missing authorization header, or invalid auth' .
- 'entication credentials.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '422',
- ErrorType::init(
- 'The requested action could not be performed, semantically incorrect, or fa' .
- 'iled business validation.',
- ErrorException::class
- )
- )
- ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
- ->type(Order::class)
- ->returnApiResponse();
-
- return $this->execute($_reqBuilder, $_resHandler);
- }
-
- /**
- * 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:
- *
| Attribute | Op | Notes | inte
- * nt | replace | |
payer | replace,
- * add | Using replace op for payer will replace the whole payer object
- * with the value sent in request. |
purchase_units | replace,
- * add | |
purchase_units[].custom_id | replace, add,
- * remove | |
purchase_units[].description | replace, add,
- * remove | |
purchase_units[].payee.
- * email | replace | |
purchase_units[].shipping.
- * name | replace, add | |
purchase_units[].shipping.
- * email_address | replace, add | |
purchase_units[].shipping.
- * phone_number | replace, add | |
purchase_units[].shipping.
- * options | replace, add | |
purchase_units[].shipping.
- * address | replace, add | |
purchase_units[].shipping.
- * type | replace, add | |
purchase_units[].
- * soft_descriptor | replace, remove | |
purchase_units[].
- * amount | replace | |
purchase_units[].
- * items | replace, add, remove | |
purchase_units[].
- * invoice_id | replace, add, remove | |
purchase_units[].
- * payment_instruction | replace | |
purchase_units[].
- * payment_instruction.disbursement_mode | replace | By default,
- * disbursement_mode is INSTANT. |
purchase_units[].
- * payment_instruction.payee_receivable_fx_rate_id | replace, add,
- * remove | |
purchase_units[].payment_instruction.
- * platform_fees | replace, add, remove | |
purchase_units[].
- * supplementary_data.airline | replace, add,
- * remove | |
purchase_units[].supplementary_data.
- * card | replace, add, remove | |
application_context.
- * client_configuration | replace, add | |
- *
- * @param array $options Array with all options for search
- *
- * @return ApiResponse Response from the API call
- */
- public function ordersPatch(array $options): ApiResponse
- {
- $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/v2/checkout/orders/{id}')
- ->auth('Oauth2')
- ->parameters(
- TemplateParam::init('id', $options)->extract('id'),
- HeaderParam::init('Content-Type', 'application/json'),
- BodyParam::init($options)->extract('body')
- );
-
- $_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '400',
- ErrorType::init(
- 'Request is not well-formed, syntactically incorrect, or violates schema.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '401',
- ErrorType::init(
- 'Authentication failed due to missing authorization header, or invalid auth' .
- 'entication credentials.',
- ErrorException::class
- )
- )
- ->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
- ->throwErrorOn(
- '422',
- ErrorType::init(
- 'The requested action could not be performed, semantically incorrect, or fa' .
- 'iled business validation.',
- ErrorException::class
- )
- )
- ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
- ->returnApiResponse();
-
- return $this->execute($_reqBuilder, $_resHandler);
- }
-
/**
* Captures payment for an order. To successfully capture 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
@@ -346,60 +388,21 @@ class OrdersController extends BaseController
}
/**
- * Shows details for an order, by ID.Note: For error handling and
- * troubleshooting, see Orders v2 errors.
+ * Adds tracking information for an Order.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
- public function ordersGet(array $options): ApiResponse
+ public function ordersTrackCreate(array $options): ApiResponse
{
- $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/checkout/orders/{id}')
- ->auth('Oauth2')
- ->parameters(
- TemplateParam::init('id', $options)->extract('id'),
- QueryParam::init('fields', $options)->extract('fields')
- );
-
- $_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '401',
- ErrorType::init(
- 'Authentication failed due to missing authorization header, or invalid auth' .
- 'entication credentials.',
- ErrorException::class
- )
- )
- ->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
- ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
- ->type(Order::class)
- ->returnApiResponse();
-
- return $this->execute($_reqBuilder, $_resHandler);
- }
-
- /**
- * Payer confirms their intent to pay for the the Order with the given payment source.
- *
- * @param array $options Array with all options for search
- *
- * @return ApiResponse Response from the API call
- */
- public function ordersConfirm(array $options): ApiResponse
- {
- $_reqBuilder = $this->requestBuilder(
- RequestMethod::POST,
- '/v2/checkout/orders/{id}/confirm-payment-source'
- )
+ $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders/{id}/track')
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'),
- HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('paypalClientMetadataId'),
- HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
- BodyParam::init($options)->extract('body')
+ BodyParam::init($options)->extract('body'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion')
);
$_resHandler = $this->responseHandler()
@@ -414,6 +417,7 @@ class OrdersController extends BaseController
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
+ ->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
@@ -455,6 +459,7 @@ class OrdersController extends BaseController
TemplateParam::init('id', $options)->extract('id'),
TemplateParam::init('tracker_id', $options)->extract('trackerId'),
HeaderParam::init('Content-Type', 'application/json'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
BodyParam::init($options)->extract('body')
);
diff --git a/src/Controllers/PaymentsController.php b/src/Controllers/PaymentsController.php
index 59b4b34..17a46ff 100644
--- a/src/Controllers/PaymentsController.php
+++ b/src/Controllers/PaymentsController.php
@@ -26,15 +26,18 @@ class PaymentsController extends BaseController
/**
* Shows details for an authorized payment, by ID.
*
- * @param string $authorizationId The ID of the authorized payment for which to show details.
+ * @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
- public function authorizationsGet(string $authorizationId): ApiResponse
+ public function authorizationsGet(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/authorizations/{authorization_id}')
->auth('Oauth2')
- ->parameters(TemplateParam::init('authorization_id', $authorizationId));
+ ->parameters(
+ TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion')
+ );
$_resHandler = $this->responseHandler()
->throwErrorOn(
@@ -45,13 +48,6 @@ class PaymentsController extends BaseController
ErrorException::class
)
)
- ->throwErrorOn(
- '403',
- ErrorType::init(
- 'The request failed because the caller has insufficient permissions.',
- ErrorException::class
- )
- )
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
@@ -83,6 +79,7 @@ class PaymentsController extends BaseController
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
BodyParam::init($options)->extract('body')
);
@@ -136,6 +133,76 @@ class PaymentsController extends BaseController
return $this->execute($_reqBuilder, $_resHandler);
}
+ /**
+ * 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.
+ *
+ *
+ * @param array $options Array with all options for search
+ *
+ * @return ApiResponse Response from the API call
+ */
+ public function authorizationsReauthorize(array $options): ApiResponse
+ {
+ $_reqBuilder = $this->requestBuilder(
+ RequestMethod::POST,
+ '/v2/payments/authorizations/{authorization_id}/reauthorize'
+ )
+ ->auth('Oauth2')
+ ->parameters(
+ TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
+ HeaderParam::init('Content-Type', 'application/json'),
+ HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
+ HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
+ BodyParam::init($options)->extract('body')
+ );
+
+ $_resHandler = $this->responseHandler()
+ ->throwErrorOn(
+ '400',
+ ErrorType::init(
+ 'The request failed because it is not well-formed or is syntactically incor' .
+ 'rect or violates schema.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '401',
+ ErrorType::init(
+ 'Authentication failed due to missing authorization header, or invalid auth' .
+ 'entication credentials.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '404',
+ ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
+ )
+ ->throwErrorOn(
+ '422',
+ ErrorType::init(
+ 'The request failed because it either is semantically incorrect or failed b' .
+ 'usiness validation.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
+ ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
+ ->type(PaymentAuthorization::class)
+ ->returnApiResponse();
+
+ return $this->execute($_reqBuilder, $_resHandler);
+ }
+
/**
* Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been
* fully captured.
@@ -154,18 +221,11 @@ class PaymentsController extends BaseController
->parameters(
TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
+ HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal')
);
$_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '400',
- ErrorType::init(
- 'The request failed because it is not well-formed or is syntactically incor' .
- 'rect or violates schema.',
- ErrorException::class
- )
- )
->throwErrorOn(
'401',
ErrorType::init(
@@ -209,82 +269,6 @@ class PaymentsController extends BaseController
return $this->execute($_reqBuilder, $_resHandler);
}
- /**
- * 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.
- *
- *
- * @param array $options Array with all options for search
- *
- * @return ApiResponse Response from the API call
- */
- public function authorizationsReauthorize(array $options): ApiResponse
- {
- $_reqBuilder = $this->requestBuilder(
- RequestMethod::POST,
- '/v2/payments/authorizations/{authorization_id}/reauthorize'
- )
- ->auth('Oauth2')
- ->parameters(
- TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
- HeaderParam::init('Content-Type', 'application/json'),
- HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
- HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
- BodyParam::init($options)->extract('body')
- );
-
- $_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '400',
- ErrorType::init(
- 'The request failed because it is not well-formed or is syntactically incor' .
- 'rect or violates schema.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '401',
- ErrorType::init(
- 'Authentication failed due to missing authorization header, or invalid auth' .
- 'entication credentials.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '403',
- ErrorType::init(
- 'The request failed because the caller has insufficient permissions.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '404',
- ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
- )
- ->throwErrorOn(
- '422',
- ErrorType::init(
- 'The request failed because it either is semantically incorrect or failed b' .
- 'usiness validation.',
- ErrorException::class
- )
- )
- ->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
- ->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
- ->type(PaymentAuthorization::class)
- ->returnApiResponse();
-
- return $this->execute($_reqBuilder, $_resHandler);
- }
-
/**
* Shows details for a captured payment, by ID.
*
@@ -402,15 +386,18 @@ class PaymentsController extends BaseController
/**
* Shows details for a refund, by ID.
*
- * @param string $refundId The PayPal-generated ID for the refund for which to show details.
+ * @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
- public function refundsGet(string $refundId): ApiResponse
+ public function refundsGet(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/refunds/{refund_id}')
->auth('Oauth2')
- ->parameters(TemplateParam::init('refund_id', $refundId));
+ ->parameters(
+ TemplateParam::init('refund_id', $options)->extract('refundId'),
+ HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion')
+ );
$_resHandler = $this->responseHandler()
->throwErrorOn(
diff --git a/src/Controllers/VaultController.php b/src/Controllers/VaultController.php
index b7eba3c..738c23a 100644
--- a/src/Controllers/VaultController.php
+++ b/src/Controllers/VaultController.php
@@ -24,6 +24,58 @@ use PaypalServerSdkLib\Models\SetupTokenResponse;
class VaultController extends BaseController
{
+ /**
+ * Creates a Payment Token from the given payment source and adds it to the Vault of the associated
+ * customer.
+ *
+ * @param array $options Array with all options for search
+ *
+ * @return ApiResponse Response from the API call
+ */
+ public function paymentTokensCreate(array $options): ApiResponse
+ {
+ $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v3/vault/payment-tokens')
+ ->auth('Oauth2')
+ ->parameters(
+ HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
+ HeaderParam::init('Content-Type', 'application/json'),
+ BodyParam::init($options)->extract('body')
+ );
+
+ $_resHandler = $this->responseHandler()
+ ->throwErrorOn(
+ '400',
+ ErrorType::init(
+ 'Request is not well-formed, syntactically incorrect, or violates schema.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '403',
+ ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
+ )
+ ->throwErrorOn(
+ '404',
+ ErrorType::init(
+ 'Request contains reference to resources that do not exist.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn(
+ '422',
+ ErrorType::init(
+ 'The requested action could not be performed, semantically incorrect, or fa' .
+ 'iled business validation.',
+ ErrorException::class
+ )
+ )
+ ->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
+ ->type(PaymentTokenResponse::class)
+ ->returnApiResponse();
+
+ return $this->execute($_reqBuilder, $_resHandler);
+ }
+
/**
* Returns all payment tokens for a customer.
*
@@ -96,22 +148,17 @@ class VaultController extends BaseController
}
/**
- * 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.
*
- * @param array $options Array with all options for search
+ * @param string $id ID of the payment token.
*
* @return ApiResponse Response from the API call
*/
- public function paymentTokensCreate(array $options): ApiResponse
+ public function paymentTokensDelete(string $id): ApiResponse
{
- $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v3/vault/payment-tokens')
+ $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v3/vault/payment-tokens/{id}')
->auth('Oauth2')
- ->parameters(
- HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
- HeaderParam::init('Content-Type', 'application/json'),
- BodyParam::init($options)->extract('body')
- );
+ ->parameters(TemplateParam::init('id', $id));
$_resHandler = $this->responseHandler()
->throwErrorOn(
@@ -125,23 +172,7 @@ class VaultController extends BaseController
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
- ->throwErrorOn(
- '404',
- ErrorType::init(
- 'Request contains reference to resources that do not exist.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '422',
- ErrorType::init(
- 'The requested action could not be performed, semantically incorrect, or fa' .
- 'iled business validation.',
- ErrorException::class
- )
- )
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
- ->type(PaymentTokenResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
@@ -192,37 +223,6 @@ class VaultController extends BaseController
return $this->execute($_reqBuilder, $_resHandler);
}
- /**
- * Delete the payment token associated with the payment token id.
- *
- * @param string $id ID of the payment token.
- *
- * @return ApiResponse Response from the API call
- */
- public function paymentTokensDelete(string $id): ApiResponse
- {
- $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v3/vault/payment-tokens/{id}')
- ->auth('Oauth2')
- ->parameters(TemplateParam::init('id', $id));
-
- $_resHandler = $this->responseHandler()
- ->throwErrorOn(
- '400',
- ErrorType::init(
- 'Request is not well-formed, syntactically incorrect, or violates schema.',
- ErrorException::class
- )
- )
- ->throwErrorOn(
- '403',
- ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
- )
- ->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
- ->returnApiResponse();
-
- return $this->execute($_reqBuilder, $_resHandler);
- }
-
/**
* Returns a readable representation of temporarily vaulted payment source associated with the setup
* token id.
diff --git a/src/Models/Builders/CardVerificationDetailsBuilder.php b/src/Models/Builders/CardVerificationDetailsBuilder.php
index 6c663bb..33e6f09 100644
--- a/src/Models/Builders/CardVerificationDetailsBuilder.php
+++ b/src/Models/Builders/CardVerificationDetailsBuilder.php
@@ -94,6 +94,15 @@ class CardVerificationDetailsBuilder
return $this;
}
+ /**
+ * Sets three d secure field.
+ */
+ public function threeDSecure($value): self
+ {
+ $this->instance->setThreeDSecure($value);
+ return $this;
+ }
+
/**
* Initializes a new card verification details object.
*/
diff --git a/src/Models/Builders/ConfirmOrderRequestBuilder.php b/src/Models/Builders/ConfirmOrderRequestBuilder.php
index c906952..a58856f 100644
--- a/src/Models/Builders/ConfirmOrderRequestBuilder.php
+++ b/src/Models/Builders/ConfirmOrderRequestBuilder.php
@@ -43,7 +43,7 @@ class ConfirmOrderRequestBuilder
/**
* Sets processing instruction field.
*/
- public function processingInstruction(?string $value): self
+ public function processingInstruction($value): self
{
$this->instance->setProcessingInstruction($value);
return $this;
diff --git a/src/Models/Builders/GooglePayCardBuilder.php b/src/Models/Builders/GooglePayCardBuilder.php
new file mode 100644
index 0000000..1413d56
--- /dev/null
+++ b/src/Models/Builders/GooglePayCardBuilder.php
@@ -0,0 +1,112 @@
+instance = $instance;
+ }
+
+ /**
+ * Initializes a new google pay card Builder object.
+ */
+ public static function init(): self
+ {
+ return new self(new GooglePayCard());
+ }
+
+ /**
+ * Sets name field.
+ */
+ public function name(?string $value): self
+ {
+ $this->instance->setName($value);
+ return $this;
+ }
+
+ /**
+ * Sets number field.
+ */
+ public function number(?string $value): self
+ {
+ $this->instance->setNumber($value);
+ return $this;
+ }
+
+ /**
+ * Sets expiry field.
+ */
+ public function expiry(?string $value): self
+ {
+ $this->instance->setExpiry($value);
+ return $this;
+ }
+
+ /**
+ * Sets last digits field.
+ */
+ public function lastDigits(?string $value): self
+ {
+ $this->instance->setLastDigits($value);
+ return $this;
+ }
+
+ /**
+ * Sets type field.
+ */
+ public function type(?string $value): self
+ {
+ $this->instance->setType($value);
+ return $this;
+ }
+
+ /**
+ * Sets brand field.
+ */
+ public function brand(?string $value): self
+ {
+ $this->instance->setBrand($value);
+ return $this;
+ }
+
+ /**
+ * Sets billing address field.
+ */
+ public function billingAddress(?PortablePostalAddressMediumGrained $value): self
+ {
+ $this->instance->setBillingAddress($value);
+ return $this;
+ }
+
+ /**
+ * Initializes a new google pay card object.
+ */
+ public function build(): GooglePayCard
+ {
+ return CoreHelper::clone($this->instance);
+ }
+}
diff --git a/src/Models/Builders/GooglePayDecryptedTokenDataBuilder.php b/src/Models/Builders/GooglePayDecryptedTokenDataBuilder.php
index 974223e..4d46394 100644
--- a/src/Models/Builders/GooglePayDecryptedTokenDataBuilder.php
+++ b/src/Models/Builders/GooglePayDecryptedTokenDataBuilder.php
@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace PaypalServerSdkLib\Models\Builders;
use Core\Utils\CoreHelper;
+use PaypalServerSdkLib\Models\GooglePayCard;
use PaypalServerSdkLib\Models\GooglePayDecryptedTokenData;
/**
@@ -33,9 +34,9 @@ class GooglePayDecryptedTokenDataBuilder
/**
* Initializes a new google pay decrypted token data Builder object.
*/
- public static function init(string $paymentMethod, string $authenticationMethod): self
+ public static function init(string $paymentMethod, GooglePayCard $card, string $authenticationMethod): self
{
- return new self(new GooglePayDecryptedTokenData($paymentMethod, $authenticationMethod));
+ return new self(new GooglePayDecryptedTokenData($paymentMethod, $card, $authenticationMethod));
}
/**
diff --git a/src/Models/Builders/OrderAuthorizeResponseBuilder.php b/src/Models/Builders/OrderAuthorizeResponseBuilder.php
index e3face0..7bd11a3 100644
--- a/src/Models/Builders/OrderAuthorizeResponseBuilder.php
+++ b/src/Models/Builders/OrderAuthorizeResponseBuilder.php
@@ -88,7 +88,7 @@ class OrderAuthorizeResponseBuilder
/**
* Sets processing instruction field.
*/
- public function processingInstruction(?string $value): self
+ public function processingInstruction($value): self
{
$this->instance->setProcessingInstruction($value);
return $this;
diff --git a/src/Models/Builders/OrderBuilder.php b/src/Models/Builders/OrderBuilder.php
index 3819fd4..8a85b1b 100644
--- a/src/Models/Builders/OrderBuilder.php
+++ b/src/Models/Builders/OrderBuilder.php
@@ -88,7 +88,7 @@ class OrderBuilder
/**
* Sets processing instruction field.
*/
- public function processingInstruction(?string $value): self
+ public function processingInstruction($value): self
{
$this->instance->setProcessingInstruction($value);
return $this;
diff --git a/src/Models/Builders/PortablePostalAddressMediumGrainedBuilder.php b/src/Models/Builders/PortablePostalAddressMediumGrainedBuilder.php
new file mode 100644
index 0000000..cf5a606
--- /dev/null
+++ b/src/Models/Builders/PortablePostalAddressMediumGrainedBuilder.php
@@ -0,0 +1,93 @@
+instance = $instance;
+ }
+
+ /**
+ * Initializes a new portable postal address medium grained Builder object.
+ */
+ public static function init(string $countryCode): self
+ {
+ return new self(new PortablePostalAddressMediumGrained($countryCode));
+ }
+
+ /**
+ * Sets address line 1 field.
+ */
+ public function addressLine1(?string $value): self
+ {
+ $this->instance->setAddressLine1($value);
+ return $this;
+ }
+
+ /**
+ * Sets address line 2 field.
+ */
+ public function addressLine2(?string $value): self
+ {
+ $this->instance->setAddressLine2($value);
+ return $this;
+ }
+
+ /**
+ * Sets admin area 2 field.
+ */
+ public function adminArea2(?string $value): self
+ {
+ $this->instance->setAdminArea2($value);
+ return $this;
+ }
+
+ /**
+ * Sets admin area 1 field.
+ */
+ public function adminArea1(?string $value): self
+ {
+ $this->instance->setAdminArea1($value);
+ return $this;
+ }
+
+ /**
+ * Sets postal code field.
+ */
+ public function postalCode(?string $value): self
+ {
+ $this->instance->setPostalCode($value);
+ return $this;
+ }
+
+ /**
+ * Initializes a new portable postal address medium grained object.
+ */
+ public function build(): PortablePostalAddressMediumGrained
+ {
+ return CoreHelper::clone($this->instance);
+ }
+}
diff --git a/src/Models/CardVerificationDetails.php b/src/Models/CardVerificationDetails.php
index 0bf9107..a0a75f1 100644
--- a/src/Models/CardVerificationDetails.php
+++ b/src/Models/CardVerificationDetails.php
@@ -47,6 +47,11 @@ class CardVerificationDetails implements \JsonSerializable
*/
private $processorResponse;
+ /**
+ * @var mixed
+ */
+ private $threeDSecure;
+
/**
* Returns Network Transaction Id.
* Transaction Identifier as given by the network to indicate a previously executed CIT authorization.
@@ -175,6 +180,32 @@ class CardVerificationDetails implements \JsonSerializable
$this->processorResponse = $processorResponse;
}
+ /**
+ * Returns Three D Secure.
+ * DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in
+ * 'three_d_secure' object under 'authentication_result' object instead of the 'verification' field.
+ *
+ * @return mixed
+ */
+ public function getThreeDSecure()
+ {
+ return $this->threeDSecure;
+ }
+
+ /**
+ * Sets Three D Secure.
+ * DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in
+ * 'three_d_secure' object under 'authentication_result' object instead of the 'verification' field.
+ *
+ * @maps three_d_secure
+ *
+ * @param mixed $threeDSecure
+ */
+ public function setThreeDSecure($threeDSecure): void
+ {
+ $this->threeDSecure = $threeDSecure;
+ }
+
/**
* Encode this object to JSON
*
@@ -205,6 +236,9 @@ class CardVerificationDetails implements \JsonSerializable
if (isset($this->processorResponse)) {
$json['processor_response'] = $this->processorResponse;
}
+ if (isset($this->threeDSecure)) {
+ $json['three_d_secure'] = $this->threeDSecure;
+ }
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
diff --git a/src/Models/ConfirmOrderRequest.php b/src/Models/ConfirmOrderRequest.php
index 8db5733..2eec226 100644
--- a/src/Models/ConfirmOrderRequest.php
+++ b/src/Models/ConfirmOrderRequest.php
@@ -23,9 +23,9 @@ class ConfirmOrderRequest implements \JsonSerializable
private $paymentSource;
/**
- * @var string|null
+ * @var mixed
*/
- private $processingInstruction = ProcessingInstruction::NO_INSTRUCTION;
+ private $processingInstruction;
/**
* @var OrderConfirmApplicationContext|null
@@ -63,20 +63,22 @@ class ConfirmOrderRequest implements \JsonSerializable
/**
* Returns Processing Instruction.
- * The instruction to process an order.
+ *
+ * @return mixed
*/
- public function getProcessingInstruction(): ?string
+ public function getProcessingInstruction()
{
return $this->processingInstruction;
}
/**
* Sets Processing Instruction.
- * The instruction to process an order.
*
* @maps processing_instruction
+ *
+ * @param mixed $processingInstruction
*/
- public function setProcessingInstruction(?string $processingInstruction): void
+ public function setProcessingInstruction($processingInstruction): void
{
$this->processingInstruction = $processingInstruction;
}
@@ -115,7 +117,7 @@ class ConfirmOrderRequest implements \JsonSerializable
$json = [];
$json['payment_source'] = $this->paymentSource;
if (isset($this->processingInstruction)) {
- $json['processing_instruction'] = ProcessingInstruction::checkValue($this->processingInstruction);
+ $json['processing_instruction'] = $this->processingInstruction;
}
if (isset($this->applicationContext)) {
$json['application_context'] = $this->applicationContext;
diff --git a/src/Models/FullfillmentType.php b/src/Models/FulfillmentType.php
similarity index 93%
rename from src/Models/FullfillmentType.php
rename to src/Models/FulfillmentType.php
index 14b151f..f2ec753 100644
--- a/src/Models/FullfillmentType.php
+++ b/src/Models/FulfillmentType.php
@@ -18,7 +18,7 @@ use stdClass;
* 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.
*/
-class FullfillmentType
+class FulfillmentType
{
public const SHIPPING = 'SHIPPING';
@@ -46,6 +46,6 @@ class FullfillmentType
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value;
}
- throw new Exception("$value is invalid for FullfillmentType.");
+ throw new Exception("$value is invalid for FulfillmentType.");
}
}
diff --git a/src/Models/GooglePayCard.php b/src/Models/GooglePayCard.php
new file mode 100644
index 0000000..0b33213
--- /dev/null
+++ b/src/Models/GooglePayCard.php
@@ -0,0 +1,239 @@
+name;
+ }
+
+ /**
+ * Sets Name.
+ * The card holder's name as it appears on the card.
+ *
+ * @maps name
+ */
+ public function setName(?string $name): void
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns Number.
+ * The primary account number (PAN) for the payment card.
+ */
+ public function getNumber(): ?string
+ {
+ return $this->number;
+ }
+
+ /**
+ * Sets Number.
+ * The primary account number (PAN) for the payment card.
+ *
+ * @maps number
+ */
+ public function setNumber(?string $number): void
+ {
+ $this->number = $number;
+ }
+
+ /**
+ * Returns 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).
+ */
+ public function getExpiry(): ?string
+ {
+ return $this->expiry;
+ }
+
+ /**
+ * Sets 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).
+ *
+ * @maps expiry
+ */
+ public function setExpiry(?string $expiry): void
+ {
+ $this->expiry = $expiry;
+ }
+
+ /**
+ * Returns Last Digits.
+ * The last digits of the payment card.
+ */
+ public function getLastDigits(): ?string
+ {
+ return $this->lastDigits;
+ }
+
+ /**
+ * Sets Last Digits.
+ * The last digits of the payment card.
+ *
+ * @maps last_digits
+ */
+ public function setLastDigits(?string $lastDigits): void
+ {
+ $this->lastDigits = $lastDigits;
+ }
+
+ /**
+ * Returns Type.
+ * Type of card. i.e Credit, Debit and so on.
+ */
+ public function getType(): ?string
+ {
+ return $this->type;
+ }
+
+ /**
+ * Sets Type.
+ * Type of card. i.e Credit, Debit and so on.
+ *
+ * @maps type
+ */
+ public function setType(?string $type): void
+ {
+ $this->type = $type;
+ }
+
+ /**
+ * Returns Brand.
+ * The card network or brand. Applies to credit, debit, gift, and payment cards.
+ */
+ public function getBrand(): ?string
+ {
+ return $this->brand;
+ }
+
+ /**
+ * Sets Brand.
+ * The card network or brand. Applies to credit, debit, gift, and payment cards.
+ *
+ * @maps brand
+ */
+ public function setBrand(?string $brand): void
+ {
+ $this->brand = $brand;
+ }
+
+ /**
+ * Returns Billing 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).
+ */
+ public function getBillingAddress(): ?PortablePostalAddressMediumGrained
+ {
+ return $this->billingAddress;
+ }
+
+ /**
+ * Sets Billing 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).
+ *
+ * @maps billing_address
+ */
+ public function setBillingAddress(?PortablePostalAddressMediumGrained $billingAddress): void
+ {
+ $this->billingAddress = $billingAddress;
+ }
+
+ /**
+ * Encode this object to JSON
+ *
+ * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
+ * are set. (default: false)
+ *
+ * @return array|stdClass
+ */
+ #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
+ public function jsonSerialize(bool $asArrayWhenEmpty = false)
+ {
+ $json = [];
+ if (isset($this->name)) {
+ $json['name'] = $this->name;
+ }
+ if (isset($this->number)) {
+ $json['number'] = $this->number;
+ }
+ if (isset($this->expiry)) {
+ $json['expiry'] = $this->expiry;
+ }
+ if (isset($this->lastDigits)) {
+ $json['last_digits'] = $this->lastDigits;
+ }
+ if (isset($this->type)) {
+ $json['type'] = CardType::checkValue($this->type);
+ }
+ if (isset($this->brand)) {
+ $json['brand'] = CardBrand::checkValue($this->brand);
+ }
+ if (isset($this->billingAddress)) {
+ $json['billing_address'] = $this->billingAddress;
+ }
+
+ return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
+ }
+}
diff --git a/src/Models/GooglePayDecryptedTokenData.php b/src/Models/GooglePayDecryptedTokenData.php
index 719cf57..6e76815 100644
--- a/src/Models/GooglePayDecryptedTokenData.php
+++ b/src/Models/GooglePayDecryptedTokenData.php
@@ -33,6 +33,11 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
*/
private $paymentMethod;
+ /**
+ * @var GooglePayCard
+ */
+ private $card;
+
/**
* @var string
*/
@@ -50,11 +55,13 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
/**
* @param string $paymentMethod
+ * @param GooglePayCard $card
* @param string $authenticationMethod
*/
- public function __construct(string $paymentMethod, string $authenticationMethod)
+ public function __construct(string $paymentMethod, GooglePayCard $card, string $authenticationMethod)
{
$this->paymentMethod = $paymentMethod;
+ $this->card = $card;
$this->authenticationMethod = $authenticationMethod;
}
@@ -121,6 +128,27 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
$this->paymentMethod = $paymentMethod;
}
+ /**
+ * Returns Card.
+ * The payment card used to fund a Google Pay payment. Can be a credit or debit card.
+ */
+ public function getCard(): GooglePayCard
+ {
+ return $this->card;
+ }
+
+ /**
+ * Sets Card.
+ * The payment card used to fund a Google Pay payment. Can be a credit or debit card.
+ *
+ * @required
+ * @maps card
+ */
+ public function setCard(GooglePayCard $card): void
+ {
+ $this->card = $card;
+ }
+
/**
* Returns Authentication Method.
* Authentication Method which is used for the card transaction.
@@ -205,6 +233,7 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
$json['message_expiration'] = $this->messageExpiration;
}
$json['payment_method'] = GooglePayPaymentMethod::checkValue($this->paymentMethod);
+ $json['card'] = $this->card;
$json['authentication_method'] = GooglePayAuthenticationMethod::checkValue($this->authenticationMethod);
if (isset($this->cryptogram)) {
$json['cryptogram'] = $this->cryptogram;
diff --git a/src/Models/Order.php b/src/Models/Order.php
index a38ef4e..99b453d 100644
--- a/src/Models/Order.php
+++ b/src/Models/Order.php
@@ -43,9 +43,9 @@ class Order implements \JsonSerializable
private $intent;
/**
- * @var string|null
+ * @var mixed
*/
- private $processingInstruction = ProcessingInstruction::NO_INSTRUCTION;
+ private $processingInstruction;
/**
* @var Payer|null
@@ -179,20 +179,22 @@ class Order implements \JsonSerializable
/**
* Returns Processing Instruction.
- * The instruction to process an order.
+ *
+ * @return mixed
*/
- public function getProcessingInstruction(): ?string
+ public function getProcessingInstruction()
{
return $this->processingInstruction;
}
/**
* Sets Processing Instruction.
- * The instruction to process an order.
*
* @maps processing_instruction
+ *
+ * @param mixed $processingInstruction
*/
- public function setProcessingInstruction(?string $processingInstruction): void
+ public function setProcessingInstruction($processingInstruction): void
{
$this->processingInstruction = $processingInstruction;
}
@@ -266,9 +268,9 @@ class Order implements \JsonSerializable
/**
* Returns Links.
* An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to
- * redirect the payer. The API caller has 3 hours (default setting, this which can be changed by your
+ * 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 3 hours for the payer to approve the
+ * 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
@@ -284,9 +286,9 @@ class Order implements \JsonSerializable
/**
* Sets Links.
* An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to
- * redirect the payer. The API caller has 3 hours (default setting, this which can be changed by your
+ * 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 3 hours for the payer to approve the
+ * 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
@@ -329,7 +331,7 @@ class Order implements \JsonSerializable
$json['intent'] = CheckoutPaymentIntent::checkValue($this->intent);
}
if (isset($this->processingInstruction)) {
- $json['processing_instruction'] = ProcessingInstruction::checkValue($this->processingInstruction);
+ $json['processing_instruction'] = $this->processingInstruction;
}
if (isset($this->payer)) {
$json['payer'] = $this->payer;
diff --git a/src/Models/OrderAuthorizeResponse.php b/src/Models/OrderAuthorizeResponse.php
index 9db8410..5a79916 100644
--- a/src/Models/OrderAuthorizeResponse.php
+++ b/src/Models/OrderAuthorizeResponse.php
@@ -40,9 +40,9 @@ class OrderAuthorizeResponse implements \JsonSerializable
private $intent;
/**
- * @var string|null
+ * @var mixed
*/
- private $processingInstruction = ProcessingInstruction::NO_INSTRUCTION;
+ private $processingInstruction;
/**
* @var Payer|null
@@ -176,20 +176,22 @@ class OrderAuthorizeResponse implements \JsonSerializable
/**
* Returns Processing Instruction.
- * The instruction to process an order.
+ *
+ * @return mixed
*/
- public function getProcessingInstruction(): ?string
+ public function getProcessingInstruction()
{
return $this->processingInstruction;
}
/**
* Sets Processing Instruction.
- * The instruction to process an order.
*
* @maps processing_instruction
+ *
+ * @param mixed $processingInstruction
*/
- public function setProcessingInstruction(?string $processingInstruction): void
+ public function setProcessingInstruction($processingInstruction): void
{
$this->processingInstruction = $processingInstruction;
}
@@ -314,7 +316,7 @@ class OrderAuthorizeResponse implements \JsonSerializable
$json['intent'] = CheckoutPaymentIntent::checkValue($this->intent);
}
if (isset($this->processingInstruction)) {
- $json['processing_instruction'] = ProcessingInstruction::checkValue($this->processingInstruction);
+ $json['processing_instruction'] = $this->processingInstruction;
}
if (isset($this->payer)) {
$json['payer'] = $this->payer;
diff --git a/src/Models/PortablePostalAddressMediumGrained.php b/src/Models/PortablePostalAddressMediumGrained.php
new file mode 100644
index 0000000..a7e8d28
--- /dev/null
+++ b/src/Models/PortablePostalAddressMediumGrained.php
@@ -0,0 +1,231 @@
+countryCode = $countryCode;
+ }
+
+ /**
+ * Returns Address Line 1.
+ * The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for
+ * data entry, and Compliance and Risk checks. This field needs to pass the full address.
+ */
+ public function getAddressLine1(): ?string
+ {
+ return $this->addressLine1;
+ }
+
+ /**
+ * Sets Address Line 1.
+ * The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for
+ * data entry, and Compliance and Risk checks. This field needs to pass the full address.
+ *
+ * @maps address_line_1
+ */
+ public function setAddressLine1(?string $addressLine1): void
+ {
+ $this->addressLine1 = $addressLine1;
+ }
+
+ /**
+ * Returns Address Line 2.
+ * The second line of the address, for example, a suite or apartment number.
+ */
+ public function getAddressLine2(): ?string
+ {
+ return $this->addressLine2;
+ }
+
+ /**
+ * Sets Address Line 2.
+ * The second line of the address, for example, a suite or apartment number.
+ *
+ * @maps address_line_2
+ */
+ public function setAddressLine2(?string $addressLine2): void
+ {
+ $this->addressLine2 = $addressLine2;
+ }
+
+ /**
+ * Returns Admin Area 2.
+ * A city, town, or village. Smaller than `admin_area_level_1`.
+ */
+ public function getAdminArea2(): ?string
+ {
+ return $this->adminArea2;
+ }
+
+ /**
+ * Sets Admin Area 2.
+ * A city, town, or village. Smaller than `admin_area_level_1`.
+ *
+ * @maps admin_area_2
+ */
+ public function setAdminArea2(?string $adminArea2): void
+ {
+ $this->adminArea2 = $adminArea2;
+ }
+
+ /**
+ * Returns Admin Area 1.
+ * 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*.
+ */
+ public function getAdminArea1(): ?string
+ {
+ return $this->adminArea1;
+ }
+
+ /**
+ * Sets Admin Area 1.
+ * 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*.
+ *
+ * @maps admin_area_1
+ */
+ public function setAdminArea1(?string $adminArea1): void
+ {
+ $this->adminArea1 = $adminArea1;
+ }
+
+ /**
+ * Returns Postal Code.
+ * 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).
+ */
+ public function getPostalCode(): ?string
+ {
+ return $this->postalCode;
+ }
+
+ /**
+ * Sets Postal Code.
+ * 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).
+ *
+ * @maps postal_code
+ */
+ public function setPostalCode(?string $postalCode): void
+ {
+ $this->postalCode = $postalCode;
+ }
+
+ /**
+ * Returns Country Code.
+ * 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.
+ */
+ public function getCountryCode(): string
+ {
+ return $this->countryCode;
+ }
+
+ /**
+ * Sets Country Code.
+ * 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.
+ *
+ * @required
+ * @maps country_code
+ */
+ public function setCountryCode(string $countryCode): void
+ {
+ $this->countryCode = $countryCode;
+ }
+
+ /**
+ * Encode this object to JSON
+ *
+ * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
+ * are set. (default: false)
+ *
+ * @return array|stdClass
+ */
+ #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
+ public function jsonSerialize(bool $asArrayWhenEmpty = false)
+ {
+ $json = [];
+ if (isset($this->addressLine1)) {
+ $json['address_line_1'] = $this->addressLine1;
+ }
+ if (isset($this->addressLine2)) {
+ $json['address_line_2'] = $this->addressLine2;
+ }
+ if (isset($this->adminArea2)) {
+ $json['admin_area_2'] = $this->adminArea2;
+ }
+ if (isset($this->adminArea1)) {
+ $json['admin_area_1'] = $this->adminArea1;
+ }
+ if (isset($this->postalCode)) {
+ $json['postal_code'] = $this->postalCode;
+ }
+ $json['country_code'] = $this->countryCode;
+
+ return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
+ }
+}
diff --git a/src/Models/ProcessingInstruction.php b/src/Models/ProcessingInstruction.php
deleted file mode 100644
index 3131b5d..0000000
--- a/src/Models/ProcessingInstruction.php
+++ /dev/null
@@ -1,45 +0,0 @@
-phoneNumber;
}
if (isset($this->type)) {
- $json['type'] = FullfillmentType::checkValue($this->type);
+ $json['type'] = FulfillmentType::checkValue($this->type);
}
if (isset($this->options)) {
$json['options'] = $this->options;
diff --git a/src/Models/ShippingWithTrackingDetails.php b/src/Models/ShippingWithTrackingDetails.php
index d621c64..072d79a 100644
--- a/src/Models/ShippingWithTrackingDetails.php
+++ b/src/Models/ShippingWithTrackingDetails.php
@@ -206,7 +206,7 @@ class ShippingWithTrackingDetails implements \JsonSerializable
$json['phone_number'] = $this->phoneNumber;
}
if (isset($this->type)) {
- $json['type'] = FullfillmentType::checkValue($this->type);
+ $json['type'] = FulfillmentType::checkValue($this->type);
}
if (isset($this->options)) {
$json['options'] = $this->options;
diff --git a/src/Models/VaultedDigitalWalletShippingDetails.php b/src/Models/VaultedDigitalWalletShippingDetails.php
index 5fe12a2..b8c5c4b 100644
--- a/src/Models/VaultedDigitalWalletShippingDetails.php
+++ b/src/Models/VaultedDigitalWalletShippingDetails.php
@@ -116,7 +116,7 @@ class VaultedDigitalWalletShippingDetails implements \JsonSerializable
$json['name'] = $this->name;
}
if (isset($this->type)) {
- $json['type'] = FullfillmentType::checkValue($this->type);
+ $json['type'] = FulfillmentType::checkValue($this->type);
}
if (isset($this->address)) {
$json['address'] = $this->address;
diff --git a/src/PaypalServerSdkClient.php b/src/PaypalServerSdkClient.php
index 0b08c06..83a1df3 100644
--- a/src/PaypalServerSdkClient.php
+++ b/src/PaypalServerSdkClient.php
@@ -62,7 +62,7 @@ class PaypalServerSdkClient implements ConfigurationInterface
->converter(new CompatibilityConverter())
->jsonHelper(ApiHelper::getJsonHelper())
->apiCallback($this->config['httpCallback'] ?? null)
- ->userAgent('PayPal REST API PHP SDK, Version: 0.6.0, on OS {os-info}')
+ ->userAgent('PayPal REST API PHP SDK, Version: 0.6.1, on OS {os-info}')
->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_)
->authManagers(['Oauth2' => $this->clientCredentialsAuthManager])
->loggingConfiguration($loggingConfiguration)