1
0

2 Commits
2.1.0 ... 0.6.1

Author SHA1 Message Date
PayPalServerSDKs
b26f3e7dcd Automated commit message 2024-11-21 20:04:48 +00:00
PayPalServerSDKs
00fde18df4 Automated commit message 2024-11-21 17:43:29 +00:00
47 changed files with 2091 additions and 857 deletions

View File

@@ -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: Run the following command to install the package and automatically add the dependency to your composer.json file:
```php ```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: Or add it to the composer.json file manually as given below:
```php ```php
"require": { "require": {
"paypal/paypal-server-sdk": "0.6.0" "paypal/paypal-server-sdk": "0.6.1"
} }
``` ```
You can also view the package at: 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 ## 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: 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.<br>*Default*: `true` | | `retryOnTimeout` | `bool` | Whether to retry on request timeout.<br>*Default*: `true` |
| `httpStatusCodesToRetry` | `array` | Http status codes to retry against.<br>*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` | | `httpStatusCodesToRetry` | `array` | Http status codes to retry against.<br>*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` |
| `httpMethodsToRetry` | `array` | Http methods to retry against.<br>*Default*: `'GET', 'PUT'` | | `httpMethodsToRetry` | `array` | Http methods to retry against.<br>*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 | | `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.0/doc/auth/oauth-2-client-credentials-grant.md) | The Credentials Setter for OAuth 2 Client Credentials Grant | | `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: 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. 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 ## List of APIs
* [Orders](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/controllers/orders.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.0/doc/controllers/payments.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.0/doc/controllers/vault.md) * [Vault](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/controllers/vault.md)
## Classes Documentation ## Classes Documentation
* [ApiException](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0/doc/api-exception.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.0/doc/http-request.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.0/doc/http-response.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.0/doc/logging-configuration-builder.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.0/doc/request-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.0/doc/response-logging-configuration-builder.md) * [ResponseLoggingConfigurationBuilder](https://www.github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.1/doc/response-logging-configuration-builder.md)

View File

@@ -12,16 +12,199 @@ $ordersController = $client->getOrdersController();
## Methods ## 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 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 Get](../../doc/controllers/orders.md#orders-get)
* [Orders Patch](../../doc/controllers/orders.md#orders-patch)
* [Orders Confirm](../../doc/controllers/orders.md#orders-confirm) * [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 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 <a href="https://developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https://developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#create-order">Orders v2 errors</a>.</blockquote>
```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).<br>**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:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
## 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.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#get-order">Orders v2 errors</a>.</blockquote>
```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.<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
| `fields` | `?string` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.<br>**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.<br/><br/>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: <code>\"/purchase_units/@reference_id=='default'/{attribute-or-object}\"</code>. 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 <a href="https://developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https://developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#patch-order">Orders v2 errors</a>.</blockquote>Patchable attributes or objects:<br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody><tr><td><code>intent</code></td><td>replace</td><td></td></tr><tr><td><code>payer</code></td><td>replace, add</td><td>Using replace op for <code>payer</code> will replace the whole <code>payer</code> object with the value sent in request.</td></tr><tr><td><code>purchase_units</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].custom_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].description</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].payee.email</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].shipping.name</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.email_address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.phone_number</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.options</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.type</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].soft_descriptor</code></td><td>replace, remove</td><td></td></tr><tr><td><code>purchase_units[].amount</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].items</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].invoice_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.disbursement_mode</code></td><td>replace</td><td>By default, <code>disbursement_mode</code> is <code>INSTANT</code>.</td></tr><tr><td><code>purchase_units[].payment_instruction.payee_receivable_fx_rate_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.platform_fees</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.airline</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.card</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>application_context.client_configuration</code></td><td>replace, add</td><td></td></tr></tbody></table>
```php
function ordersPatch(array $options): ApiResponse
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `id` | `string` | Template, Required | The ID of the order to update.<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
| `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.<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
| `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**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 # 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.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#authorize-order">Orders v2 errors</a>.</blockquote> 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.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#authorize-order">Orders v2 errors</a>.</blockquote>
@@ -35,7 +218,7 @@ function ordersAuthorize(array $options): ApiResponse
| Parameter | Type | Tags | Description | | Parameter | Type | Tags | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `id` | `string` | Template, Required | The ID of the order for which to authorize.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `id` | `string` | Template, Required | The ID of the order for which to authorize.<br>**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.<br>**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).<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` |
| `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | | `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` |
| `paypalClientMetadataId` | `?string` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. | | `paypalAuthAssertion` | `?string` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
@@ -69,6 +252,53 @@ $apiResponse = $ordersController->ordersAuthorize($collect);
| Default | The error response. | [`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.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#capture-order">Orders v2 errors</a>.</blockquote>
```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.<br>**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).<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` |
| `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
| `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 # Orders Track Create
Adds tracking information for an Order. Adds tracking information for an Order.
@@ -116,237 +346,6 @@ $apiResponse = $ordersController->ordersTrackCreate($collect);
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | | 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 <a href="https://developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https://developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#create-order">Orders v2 errors</a>.</blockquote>
```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.<br>**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:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**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.<br/><br/>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: <code>\"/purchase_units/@reference_id=='default'/{attribute-or-object}\"</code>. 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 <a href="https://developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https://developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#patch-order">Orders v2 errors</a>.</blockquote>Patchable attributes or objects:<br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody><tr><td><code>intent</code></td><td>replace</td><td></td></tr><tr><td><code>payer</code></td><td>replace, add</td><td>Using replace op for <code>payer</code> will replace the whole <code>payer</code> object with the value sent in request.</td></tr><tr><td><code>purchase_units</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].custom_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].description</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].payee.email</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].shipping.name</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.email_address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.phone_number</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.options</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.type</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].soft_descriptor</code></td><td>replace, remove</td><td></td></tr><tr><td><code>purchase_units[].amount</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].items</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].invoice_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.disbursement_mode</code></td><td>replace</td><td>By default, <code>disbursement_mode</code> is <code>INSTANT</code>.</td></tr><tr><td><code>purchase_units[].payment_instruction.payee_receivable_fx_rate_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.platform_fees</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.airline</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.card</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>application_context.client_configuration</code></td><td>replace, add</td><td></td></tr></tbody></table>
```php
function ordersPatch(array $options): ApiResponse
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `id` | `string` | Template, Required | The ID of the order to update.<br>**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.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#capture-order">Orders v2 errors</a>.</blockquote>
```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.<br>**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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` |
| `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
| `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.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#get-order">Orders v2 errors</a>.</blockquote>
```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.<br>**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`.<br>**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.<br>**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:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'`<br>**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 # Orders Trackers Patch
Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects:<br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody></tr><tr><td><code>items</code></td><td>replace</td><td>Using replace op for <code>items</code> will replace the entire <code>items</code> object with the value sent in request.</td></tr><tr><td><code>notify_payer</code></td><td>replace, add</td><td></td></tr><tr><td><code>status</code></td><td>replace</td><td>Only patching status to CANCELLED is currently supported.</td></tr></tbody></table> Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects:<br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody></tr><tr><td><code>items</code></td><td>replace</td><td>Using replace op for <code>items</code> will replace the entire <code>items</code> object with the value sent in request.</td></tr><tr><td><code>notify_payer</code></td><td>replace, add</td><td></td></tr><tr><td><code>status</code></td><td>replace</td><td>Only patching status to CANCELLED is currently supported.</td></tr></tbody></table>
@@ -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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `id` | `string` | Template, Required | The ID of the order that the tracking information is associated with.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` |
| `trackerId` | `string` | Template, Required | The order tracking ID.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `trackerId` | `string` | Template, Required | The order tracking ID.<br>**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 <a href="https://developer.paypal.com/api/rest/requests/#paypal-auth-assertion">PayPal-Auth-Assertion</a>. |
| `body` | [`?(Patch[])`](../../doc/models/patch.md) | Body, Optional | - | | `body` | [`?(Patch[])`](../../doc/models/patch.md) | Body, Optional | - |
## Response Type ## Response Type

View File

@@ -14,8 +14,8 @@ $paymentsController = $client->getPaymentsController();
* [Authorizations Get](../../doc/controllers/payments.md#authorizations-get) * [Authorizations Get](../../doc/controllers/payments.md#authorizations-get)
* [Authorizations Capture](../../doc/controllers/payments.md#authorizations-capture) * [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 Reauthorize](../../doc/controllers/payments.md#authorizations-reauthorize)
* [Authorizations Void](../../doc/controllers/payments.md#authorizations-void)
* [Captures Get](../../doc/controllers/payments.md#captures-get) * [Captures Get](../../doc/controllers/payments.md#captures-get)
* [Captures Refund](../../doc/controllers/payments.md#captures-refund) * [Captures Refund](../../doc/controllers/payments.md#captures-refund)
* [Refunds Get](../../doc/controllers/payments.md#refunds-get) * [Refunds Get](../../doc/controllers/payments.md#refunds-get)
@@ -26,7 +26,7 @@ $paymentsController = $client->getPaymentsController();
Shows details for an authorized payment, by ID. Shows details for an authorized payment, by ID.
```php ```php
function authorizationsGet(string $authorizationId): ApiResponse function authorizationsGet(array $options): ApiResponse
``` ```
## Parameters ## Parameters
@@ -34,6 +34,7 @@ function authorizationsGet(string $authorizationId): ApiResponse
| Parameter | Type | Tags | Description | | Parameter | Type | Tags | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `authorizationId` | `string` | Template, Required | The ID of the authorized payment for which to show details. | | `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).<blockquote><strong>Note:</strong>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.</blockquote> |
## Response Type ## Response Type
@@ -42,9 +43,11 @@ This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getR
## Example Usage ## Example Usage
```php ```php
$authorizationId = 'authorization_id8'; $collect = [
'authorizationId' => 'authorization_id8'
];
$apiResponse = $paymentsController->authorizationsGet($authorizationId); $apiResponse = $paymentsController->authorizationsGet($collect);
``` ```
## Errors ## Errors
@@ -52,7 +55,6 @@ $apiResponse = $paymentsController->authorizationsGet($authorizationId);
| HTTP Status Code | Error Description | Exception Class | | 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) | | 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) | | 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` | | 500 | The request failed because an internal server error occurred. | `ApiException` |
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | | 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. | | `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. | | `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:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'` | | `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**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).<blockquote><strong>Note:</strong>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.</blockquote> |
| `body` | [`?CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | | `body` | [`?CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - |
## Response Type ## Response Type
@@ -107,51 +110,6 @@ $apiResponse = $paymentsController->authorizationsCapture($collect);
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | | 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).<blockquote><strong>Note:</strong>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.</blockquote> |
| `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**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 # 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.<br/><br/>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.<br/><br/>A reauthorized payment itself has a new honor period of three days.<br/><br/>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.<br/><br/>Supports only the `amount` request parameter.<blockquote><strong>Note:</strong> This request is currently not supported for Partner use cases.</blockquote> 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.<br/><br/>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.<br/><br/>A reauthorized payment itself has a new honor period of three days.<br/><br/>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.<br/><br/>Supports only the `amount` request parameter.<blockquote><strong>Note:</strong> This request is currently not supported for Partner use cases.</blockquote>
@@ -167,6 +125,7 @@ function authorizationsReauthorize(array $options): ApiResponse
| `authorizationId` | `string` | Template, Required | The PayPal-generated ID for the authorized payment to reauthorize. | | `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. | | `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:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**Default**: `'return=minimal'` | | `prefer` | `?string` | Header, Optional | The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**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).<blockquote><strong>Note:</strong>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.</blockquote> |
| `body` | [`?ReauthorizeRequest`](../../doc/models/reauthorize-request.md) | Body, Optional | - | | `body` | [`?ReauthorizeRequest`](../../doc/models/reauthorize-request.md) | Body, Optional | - |
## Response Type ## 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) | | 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) | | 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).<blockquote><strong>Note:</strong>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.</blockquote> |
| `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:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul><br>**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) | | 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) | | 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) | | 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` | | 500 | The request failed because an internal server error occurred. | `ApiException` |
| Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | | 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. Shows details for a refund, by ID.
```php ```php
function refundsGet(string $refundId): ApiResponse function refundsGet(array $options): ApiResponse
``` ```
## Parameters ## Parameters
@@ -294,6 +297,7 @@ function refundsGet(string $refundId): ApiResponse
| Parameter | Type | Tags | Description | | Parameter | Type | Tags | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `refundId` | `string` | Template, Required | The PayPal-generated ID for the refund for which to show details. | | `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).<blockquote><strong>Note:</strong>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.</blockquote> |
## Response Type ## Response Type
@@ -302,9 +306,11 @@ This method returns a `PaypalServerSdkLib\Utils\ApiResponse` instance. The `getR
## Example Usage ## Example Usage
```php ```php
$refundId = 'refund_id4'; $collect = [
'refundId' => 'refund_id4'
];
$apiResponse = $paymentsController->refundsGet($refundId); $apiResponse = $paymentsController->refundsGet($collect);
``` ```
## Errors ## Errors

View File

@@ -12,14 +12,57 @@ $vaultController = $client->getVaultController();
## Methods ## Methods
* [Payment-Tokens Create](../../doc/controllers/vault.md#payment-tokens-create)
* [Customer Payment-Tokens Get](../../doc/controllers/vault.md#customer-payment-tokens-get) * [Customer Payment-Tokens Get](../../doc/controllers/vault.md#customer-payment-tokens-get)
* [Payment-Tokens Get](../../doc/controllers/vault.md#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) * [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) * [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 # Customer Payment-Tokens Get
Returns all payment tokens for a customer. 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) | | 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 ```php
function paymentTokensCreate(array $options): ApiResponse function paymentTokensDelete(string $id): ApiResponse
``` ```
## Parameters ## Parameters
| Parameter | Type | Tags | Description | | Parameter | Type | Tags | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `paypalRequestId` | `string` | Header, Required | The server stores keys for 3 hours. | | `id` | `string` | Template, Required | ID of the payment token.<br>**Constraints**: *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` |
| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. |
## Response Type ## 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 ## Example Usage
```php ```php
$collect = [ $id = 'id0';
'paypalRequestId' => 'PayPal-Request-Id6',
'body' => PaymentTokenRequestBuilder::init(
PaymentTokenRequestPaymentSourceBuilder::init()->build()
)->build()
];
$apiResponse = $vaultController->paymentTokensCreate($collect); $apiResponse = $vaultController->paymentTokensDelete($id);
``` ```
## Errors ## 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) | | 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) | | 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) | | 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) | | 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.<br>**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 # Setup-Tokens Get
Returns a readable representation of temporarily vaulted payment source associated with the setup token id. Returns a readable representation of temporarily vaulted payment source associated with the setup token id.

View File

@@ -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.<blockquote><strong>Note:</strong> The regular expression provides guidance but does not reject all invalid dates.</blockquote><br>**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 | | `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.<blockquote><strong>Note:</strong> The regular expression provides guidance but does not reject all invalid dates.</blockquote><br>**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 | | `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 | | `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) ## Example (as JSON)

View File

@@ -12,7 +12,7 @@ Payer confirms the intent to pay for the Order using the provided payment source
| Name | Type | Tags | Description | Getter | Setter | | Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- |
| `paymentSource` | [`PaymentSource`](../../doc/models/payment-source.md) | Required | The payment source definition. | getPaymentSource(): PaymentSource | setPaymentSource(PaymentSource paymentSource): void | | `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.<br>**Default**: `ProcessingInstruction::NO_INSTRUCTION`<br>**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 | | `applicationContext` | [`?OrderConfirmApplicationContext`](../../doc/models/order-confirm-application-context.md) | Optional | Customizes the payer confirmation experience. | getApplicationContext(): ?OrderConfirmApplicationContext | setApplicationContext(?OrderConfirmApplicationContext applicationContext): void |
## Example (as JSON) ## 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": { "application_context": {
"brand_name": "brand_name8", "brand_name": "brand_name8",
"locale": "locale2", "locale": "locale2",

View File

@@ -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. 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 ## Enumeration
`FullfillmentType` `FulfillmentType`
## Fields ## Fields

View File

@@ -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.<br>**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.<br>**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).<br>**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.<br>**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.<br>**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.<br>**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"
}
```

View File

@@ -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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250`, *Pattern*: `^.*$` | getMessageId(): ?string | setMessageId(?string messageId): void | | `messageId` | `?string` | Optional | A unique ID that identifies the message in case it needs to be revoked or located at a later time.<br>**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.<br>**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `\d{13}` | getMessageExpiration(): ?string | setMessageExpiration(?string messageExpiration): 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.<br>**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.<br>**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4` | getPaymentMethod(): string | setPaymentMethod(string paymentMethod): void | | `paymentMethod` | [`string(GooglePayPaymentMethod)`](../../doc/models/google-pay-payment-method.md) | Required | The type of the payment credential. Currently, only CARD is supported.<br>**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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | getAuthenticationMethod(): string | setAuthenticationMethod(string authenticationMethod): void | | `authenticationMethod` | [`string(GooglePayAuthenticationMethod)`](../../doc/models/google-pay-authentication-method.md) | Required | Authentication Method which is used for the card transaction.<br>**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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | getCryptogram(): ?string | setCryptogram(?string cryptogram): 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.<br>**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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | getEciIndicator(): ?string | setEciIndicator(?string eciIndicator): 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.<br>**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_id": "message_id4",
"message_expiration": "message_expiration8", "message_expiration": "message_expiration8",
"payment_method": "CARD", "payment_method": "CARD",
"card": {
"name": "name6",
"number": "number6",
"expiry": "expiry4",
"last_digits": "last_digits0",
"type": "UNKNOWN"
},
"authentication_method": "PAN_ONLY", "authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram0", "cryptogram": "cryptogram0",
"eci_indicator": "eci_indicator4" "eci_indicator": "eci_indicator4"

View File

@@ -46,6 +46,13 @@ Information needed to pay using Google Pay.
"message_id": "message_id0", "message_id": "message_id0",
"message_expiration": "message_expiration2", "message_expiration": "message_expiration2",
"payment_method": "CARD", "payment_method": "CARD",
"card": {
"name": "name6",
"number": "number6",
"expiry": "expiry4",
"last_digits": "last_digits0",
"type": "UNKNOWN"
},
"authentication_method": "PAN_ONLY", "authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6", "cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0" "eci_indicator": "eci_indicator0"

View File

@@ -108,6 +108,13 @@ The payment source definition.
"message_id": "message_id0", "message_id": "message_id0",
"message_expiration": "message_expiration2", "message_expiration": "message_expiration2",
"payment_method": "CARD", "payment_method": "CARD",
"card": {
"name": "name6",
"number": "number6",
"expiry": "expiry4",
"last_digits": "last_digits0",
"type": "UNKNOWN"
},
"authentication_method": "PAN_ONLY", "authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6", "cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0" "eci_indicator": "eci_indicator0"

View File

@@ -104,6 +104,13 @@ The authorization of an order request.
"message_id": "message_id0", "message_id": "message_id0",
"message_expiration": "message_expiration2", "message_expiration": "message_expiration2",
"payment_method": "CARD", "payment_method": "CARD",
"card": {
"name": "name6",
"number": "number6",
"expiry": "expiry4",
"last_digits": "last_digits0",
"type": "UNKNOWN"
},
"authentication_method": "PAN_ONLY", "authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6", "cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0" "eci_indicator": "eci_indicator0"

View File

@@ -14,7 +14,7 @@
| `id` | `?string` | Optional | The ID of the order. | getId(): ?string | setId(?string id): void | | `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 | | `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 | | `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.<br>**Default**: `ProcessingInstruction::NO_INSTRUCTION`<br>**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 | | `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.<br>**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | getPurchaseUnits(): ?array | setPurchaseUnits(?array purchaseUnits): 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.<br>**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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | getStatus(): ?string | setStatus(?string status): void | | `status` | [`?string(OrderStatus)`](../../doc/models/order-status.md) | Optional | The order status.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | getStatus(): ?string | setStatus(?string status): void |
@@ -24,7 +24,6 @@
```json ```json
{ {
"processing_instruction": "NO_INSTRUCTION",
"create_time": "create_time0", "create_time": "create_time0",
"update_time": "update_time4", "update_time": "update_time4",
"id": "id4", "id": "id4",

View File

@@ -108,6 +108,13 @@ The payment source definition.
"message_id": "message_id0", "message_id": "message_id0",
"message_expiration": "message_expiration2", "message_expiration": "message_expiration2",
"payment_method": "CARD", "payment_method": "CARD",
"card": {
"name": "name6",
"number": "number6",
"expiry": "expiry4",
"last_digits": "last_digits0",
"type": "UNKNOWN"
},
"authentication_method": "PAN_ONLY", "authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6", "cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0" "eci_indicator": "eci_indicator0"

View File

@@ -104,6 +104,13 @@ Completes an capture payment for an order.
"message_id": "message_id0", "message_id": "message_id0",
"message_expiration": "message_expiration2", "message_expiration": "message_expiration2",
"payment_method": "CARD", "payment_method": "CARD",
"card": {
"name": "name6",
"number": "number6",
"expiry": "expiry4",
"last_digits": "last_digits0",
"type": "UNKNOWN"
},
"authentication_method": "PAN_ONLY", "authentication_method": "PAN_ONLY",
"cryptogram": "cryptogram6", "cryptogram": "cryptogram6",
"eci_indicator": "eci_indicator0" "eci_indicator": "eci_indicator0"

View File

@@ -25,7 +25,7 @@ The tracking details of an order.
"capture_id": "capture_id0", "capture_id": "capture_id0",
"notify_payer": false, "notify_payer": false,
"tracking_number": "tracking_number6", "tracking_number": "tracking_number6",
"carrier": "SNTGLOBAL_API", "carrier": "HOMERUNNER",
"carrier_name_other": "carrier_name_other0", "carrier_name_other": "carrier_name_other0",
"items": [ "items": [
{ {

View File

@@ -16,17 +16,16 @@ The order details.
| `id` | `?string` | Optional | The ID of the order. | getId(): ?string | setId(?string id): void | | `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 | | `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 | | `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.<br>**Default**: `ProcessingInstruction::NO_INSTRUCTION`<br>**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 | | `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.<br>**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | getPurchaseUnits(): ?array | setPurchaseUnits(?array purchaseUnits): 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.<br>**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.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | getStatus(): ?string | setStatus(?string status): void | | `status` | [`?string(OrderStatus)`](../../doc/models/order-status.md) | Optional | The order status.<br>**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) ## Example (as JSON)
```json ```json
{ {
"processing_instruction": "NO_INSTRUCTION",
"create_time": "create_time8", "create_time": "create_time8",
"update_time": "update_time4", "update_time": "update_time4",
"id": "id2", "id": "id2",

View File

@@ -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.<br>**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.<br>**Constraints**: *Maximum Length*: `300` | getAddressLine2(): ?string | setAddressLine2(?string addressLine2): void |
| `adminArea2` | `?string` | Optional | A city, town, or village. Smaller than `admin_area_level_1`.<br>**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:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.</li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul><br>**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).<br>**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.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and not <code>UK</code> 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.</blockquote><br>**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"
}
```

View File

@@ -1,16 +0,0 @@
# Processing Instruction
The instruction to process an order.
## Enumeration
`ProcessingInstruction`
## Fields
| Name |
| --- |
| `ORDER_COMPLETE_ON_PAYMENT_APPROVAL` |
| `NO_INSTRUCTION` |

View File

@@ -1287,4 +1287,112 @@ The carrier for the shipment. Some carriers have a global version as well as loc
| `LOGINEXT_WEBHOOK` | | `LOGINEXT_WEBHOOK` |
| `EMS` | | `EMS` |
| `SPEEDY` | | `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` |

View File

@@ -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 | | `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 | | `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.<br>**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.<br>**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.<br>**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | getOptions(): ?array | setOptions(?array options): 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.<br>**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 | | `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 |

View File

@@ -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 | | `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 | | `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.<br>**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.<br>**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.<br>**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | getOptions(): ?array | setOptions(?array options): 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.<br>**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 | | `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 | | `trackers` | [`?(OrderTrackerResponse[])`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | getTrackers(): ?array | setTrackers(?array trackers): void |

View File

@@ -12,7 +12,7 @@ The shipping details.
| Name | Type | Tags | Description | Getter | Setter | | 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 | | `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.<br>**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.<br>**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 | | `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) ## Example (as JSON)

View File

@@ -23,6 +23,238 @@ use PaypalServerSdkLib\Models\OrderAuthorizeResponse;
class OrdersController extends BaseController 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 <a href="https:
* //developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https:
* //developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.
* <blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https:
* //developer.paypal.com/api/rest/reference/orders/v2/errors/#create-order">Orders v2 errors</a>.
* </blockquote>
*
* @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.<blockquote><strong>Note:</strong> For error handling and
* troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#get-
* order">Orders v2 errors</a>.</blockquote>
*
* @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.<br/><br/>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: <code>\"/purchase_units/@reference_id=='default'/{attribute-or-
* object}\"</code>. 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 <a href="https:
* //developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https:
* //developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.
* <blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https:
* //developer.paypal.com/api/rest/reference/orders/v2/errors/#patch-order">Orders v2 errors</a>.
* </blockquote>Patchable attributes or objects:
* <br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody><tr><td><code>inte
* nt</code></td><td>replace</td><td></td></tr><tr><td><code>payer</code></td><td>replace,
* add</td><td>Using replace op for <code>payer</code> will replace the whole <code>payer</code> object
* with the value sent in request.</td></tr><tr><td><code>purchase_units</code></td><td>replace,
* add</td><td></td></tr><tr><td><code>purchase_units[].custom_id</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].description</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].payee.
* email</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* name</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* email_address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* phone_number</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* options</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* type</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].
* soft_descriptor</code></td><td>replace, remove</td><td></td></tr><tr><td><code>purchase_units[].
* amount</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].
* items</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* invoice_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* payment_instruction</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].
* payment_instruction.disbursement_mode</code></td><td>replace</td><td>By default,
* <code>disbursement_mode</code> is <code>INSTANT</code>.</td></tr><tr><td><code>purchase_units[].
* payment_instruction.payee_receivable_fx_rate_id</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.
* platform_fees</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* supplementary_data.airline</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.
* card</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>application_context.
* client_configuration</code></td><td>replace, add</td><td></td></tr></tbody></table>
*
* @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 * 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 * 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); 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 <a href="https:
* //developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https:
* //developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.
* <blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https:
* //developer.paypal.com/api/rest/reference/orders/v2/errors/#create-order">Orders v2 errors</a>.
* </blockquote>
*
* @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.<br/><br/>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: <code>\"/purchase_units/@reference_id=='default'/{attribute-or-
* object}\"</code>. 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 <a href="https:
* //developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https:
* //developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.
* <blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https:
* //developer.paypal.com/api/rest/reference/orders/v2/errors/#patch-order">Orders v2 errors</a>.
* </blockquote>Patchable attributes or objects:
* <br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody><tr><td><code>inte
* nt</code></td><td>replace</td><td></td></tr><tr><td><code>payer</code></td><td>replace,
* add</td><td>Using replace op for <code>payer</code> will replace the whole <code>payer</code> object
* with the value sent in request.</td></tr><tr><td><code>purchase_units</code></td><td>replace,
* add</td><td></td></tr><tr><td><code>purchase_units[].custom_id</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].description</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].payee.
* email</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* name</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* email_address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* phone_number</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* options</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* type</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].
* soft_descriptor</code></td><td>replace, remove</td><td></td></tr><tr><td><code>purchase_units[].
* amount</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].
* items</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* invoice_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* payment_instruction</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].
* payment_instruction.disbursement_mode</code></td><td>replace</td><td>By default,
* <code>disbursement_mode</code> is <code>INSTANT</code>.</td></tr><tr><td><code>purchase_units[].
* payment_instruction.payee_receivable_fx_rate_id</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.
* platform_fees</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* supplementary_data.airline</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.
* card</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>application_context.
* client_configuration</code></td><td>replace, add</td><td></td></tr></tbody></table>
*
* @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 * 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 * 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.<blockquote><strong>Note:</strong> For error handling and * Adds tracking information for an Order.
* troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#get-
* order">Orders v2 errors</a>.</blockquote>
* *
* @param array $options Array with all options for search * @param array $options Array with all options for search
* *
* @return ApiResponse Response from the API call * @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}') $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders/{id}/track')
->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'
)
->auth('Oauth2') ->auth('Oauth2')
->parameters( ->parameters(
TemplateParam::init('id', $options)->extract('id'), TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'), HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('paypalClientMetadataId'), BodyParam::init($options)->extract('body'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'), HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion')
BodyParam::init($options)->extract('body')
); );
$_resHandler = $this->responseHandler() $_resHandler = $this->responseHandler()
@@ -414,6 +417,7 @@ class OrdersController extends BaseController
'403', '403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class) ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
) )
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn( ->throwErrorOn(
'422', '422',
ErrorType::init( ErrorType::init(
@@ -455,6 +459,7 @@ class OrdersController extends BaseController
TemplateParam::init('id', $options)->extract('id'), TemplateParam::init('id', $options)->extract('id'),
TemplateParam::init('tracker_id', $options)->extract('trackerId'), TemplateParam::init('tracker_id', $options)->extract('trackerId'),
HeaderParam::init('Content-Type', 'application/json'), HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
BodyParam::init($options)->extract('body') BodyParam::init($options)->extract('body')
); );

View File

@@ -26,15 +26,18 @@ class PaymentsController extends BaseController
/** /**
* Shows details for an authorized payment, by ID. * 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 * @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}') $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/authorizations/{authorization_id}')
->auth('Oauth2') ->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() $_resHandler = $this->responseHandler()
->throwErrorOn( ->throwErrorOn(
@@ -45,13 +48,6 @@ class PaymentsController extends BaseController
ErrorException::class ErrorException::class
) )
) )
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn( ->throwErrorOn(
'404', '404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class) 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('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'), HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'), HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
BodyParam::init($options)->extract('body') BodyParam::init($options)->extract('body')
); );
@@ -136,6 +133,76 @@ class PaymentsController extends BaseController
return $this->execute($_reqBuilder, $_resHandler); 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.
* <br/><br/>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.<br/><br/>A
* reauthorized payment itself has a new honor period of three days.<br/><br/>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.<br/><br/>Supports only the `amount` request parameter.
* <blockquote><strong>Note:</strong> This request is currently not supported for Partner use cases.
* </blockquote>
*
* @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 * Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been
* fully captured. * fully captured.
@@ -154,18 +221,11 @@ class PaymentsController extends BaseController
->parameters( ->parameters(
TemplateParam::init('authorization_id', $options)->extract('authorizationId'), TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'), HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('paypalAuthAssertion'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal') HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal')
); );
$_resHandler = $this->responseHandler() $_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( ->throwErrorOn(
'401', '401',
ErrorType::init( ErrorType::init(
@@ -209,82 +269,6 @@ class PaymentsController extends BaseController
return $this->execute($_reqBuilder, $_resHandler); 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.
* <br/><br/>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.<br/><br/>A
* reauthorized payment itself has a new honor period of three days.<br/><br/>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.<br/><br/>Supports only the `amount` request parameter.
* <blockquote><strong>Note:</strong> This request is currently not supported for Partner use cases.
* </blockquote>
*
* @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. * Shows details for a captured payment, by ID.
* *
@@ -402,15 +386,18 @@ class PaymentsController extends BaseController
/** /**
* Shows details for a refund, by ID. * 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 * @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}') $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/refunds/{refund_id}')
->auth('Oauth2') ->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() $_resHandler = $this->responseHandler()
->throwErrorOn( ->throwErrorOn(

View File

@@ -24,6 +24,58 @@ use PaypalServerSdkLib\Models\SetupTokenResponse;
class VaultController extends BaseController 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. * 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 * Delete the payment token associated with the payment token id.
* customer.
* *
* @param array $options Array with all options for search * @param string $id ID of the payment token.
* *
* @return ApiResponse Response from the API call * @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') ->auth('Oauth2')
->parameters( ->parameters(TemplateParam::init('id', $id));
HeaderParam::init('PayPal-Request-Id', $options)->extract('paypalRequestId'),
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler() $_resHandler = $this->responseHandler()
->throwErrorOn( ->throwErrorOn(
@@ -125,23 +172,7 @@ class VaultController extends BaseController
'403', '403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class) 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)) ->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->type(PaymentTokenResponse::class)
->returnApiResponse(); ->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler); return $this->execute($_reqBuilder, $_resHandler);
@@ -192,37 +223,6 @@ class VaultController extends BaseController
return $this->execute($_reqBuilder, $_resHandler); 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 * Returns a readable representation of temporarily vaulted payment source associated with the setup
* token id. * token id.

View File

@@ -94,6 +94,15 @@ class CardVerificationDetailsBuilder
return $this; 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. * Initializes a new card verification details object.
*/ */

View File

@@ -43,7 +43,7 @@ class ConfirmOrderRequestBuilder
/** /**
* Sets processing instruction field. * Sets processing instruction field.
*/ */
public function processingInstruction(?string $value): self public function processingInstruction($value): self
{ {
$this->instance->setProcessingInstruction($value); $this->instance->setProcessingInstruction($value);
return $this; return $this;

View File

@@ -0,0 +1,112 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSdkLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSdkLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSdkLib\Models\GooglePayCard;
use PaypalServerSdkLib\Models\PortablePostalAddressMediumGrained;
/**
* Builder for model GooglePayCard
*
* @see GooglePayCard
*/
class GooglePayCardBuilder
{
/**
* @var GooglePayCard
*/
private $instance;
private function __construct(GooglePayCard $instance)
{
$this->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);
}
}

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace PaypalServerSdkLib\Models\Builders; namespace PaypalServerSdkLib\Models\Builders;
use Core\Utils\CoreHelper; use Core\Utils\CoreHelper;
use PaypalServerSdkLib\Models\GooglePayCard;
use PaypalServerSdkLib\Models\GooglePayDecryptedTokenData; use PaypalServerSdkLib\Models\GooglePayDecryptedTokenData;
/** /**
@@ -33,9 +34,9 @@ class GooglePayDecryptedTokenDataBuilder
/** /**
* Initializes a new google pay decrypted token data Builder object. * 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));
} }
/** /**

View File

@@ -88,7 +88,7 @@ class OrderAuthorizeResponseBuilder
/** /**
* Sets processing instruction field. * Sets processing instruction field.
*/ */
public function processingInstruction(?string $value): self public function processingInstruction($value): self
{ {
$this->instance->setProcessingInstruction($value); $this->instance->setProcessingInstruction($value);
return $this; return $this;

View File

@@ -88,7 +88,7 @@ class OrderBuilder
/** /**
* Sets processing instruction field. * Sets processing instruction field.
*/ */
public function processingInstruction(?string $value): self public function processingInstruction($value): self
{ {
$this->instance->setProcessingInstruction($value); $this->instance->setProcessingInstruction($value);
return $this; return $this;

View File

@@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSdkLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSdkLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSdkLib\Models\PortablePostalAddressMediumGrained;
/**
* Builder for model PortablePostalAddressMediumGrained
*
* @see PortablePostalAddressMediumGrained
*/
class PortablePostalAddressMediumGrainedBuilder
{
/**
* @var PortablePostalAddressMediumGrained
*/
private $instance;
private function __construct(PortablePostalAddressMediumGrained $instance)
{
$this->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);
}
}

View File

@@ -47,6 +47,11 @@ class CardVerificationDetails implements \JsonSerializable
*/ */
private $processorResponse; private $processorResponse;
/**
* @var mixed
*/
private $threeDSecure;
/** /**
* Returns Network Transaction Id. * Returns Network Transaction Id.
* Transaction Identifier as given by the network to indicate a previously executed CIT authorization. * 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; $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 * Encode this object to JSON
* *
@@ -205,6 +236,9 @@ class CardVerificationDetails implements \JsonSerializable
if (isset($this->processorResponse)) { if (isset($this->processorResponse)) {
$json['processor_response'] = $this->processorResponse; $json['processor_response'] = $this->processorResponse;
} }
if (isset($this->threeDSecure)) {
$json['three_d_secure'] = $this->threeDSecure;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
} }

View File

@@ -23,9 +23,9 @@ class ConfirmOrderRequest implements \JsonSerializable
private $paymentSource; private $paymentSource;
/** /**
* @var string|null * @var mixed
*/ */
private $processingInstruction = ProcessingInstruction::NO_INSTRUCTION; private $processingInstruction;
/** /**
* @var OrderConfirmApplicationContext|null * @var OrderConfirmApplicationContext|null
@@ -63,20 +63,22 @@ class ConfirmOrderRequest implements \JsonSerializable
/** /**
* Returns Processing Instruction. * Returns Processing Instruction.
* The instruction to process an order. *
* @return mixed
*/ */
public function getProcessingInstruction(): ?string public function getProcessingInstruction()
{ {
return $this->processingInstruction; return $this->processingInstruction;
} }
/** /**
* Sets Processing Instruction. * Sets Processing Instruction.
* The instruction to process an order.
* *
* @maps processing_instruction * @maps processing_instruction
*
* @param mixed $processingInstruction
*/ */
public function setProcessingInstruction(?string $processingInstruction): void public function setProcessingInstruction($processingInstruction): void
{ {
$this->processingInstruction = $processingInstruction; $this->processingInstruction = $processingInstruction;
} }
@@ -115,7 +117,7 @@ class ConfirmOrderRequest implements \JsonSerializable
$json = []; $json = [];
$json['payment_source'] = $this->paymentSource; $json['payment_source'] = $this->paymentSource;
if (isset($this->processingInstruction)) { if (isset($this->processingInstruction)) {
$json['processing_instruction'] = ProcessingInstruction::checkValue($this->processingInstruction); $json['processing_instruction'] = $this->processingInstruction;
} }
if (isset($this->applicationContext)) { if (isset($this->applicationContext)) {
$json['application_context'] = $this->applicationContext; $json['application_context'] = $this->applicationContext;

View File

@@ -18,7 +18,7 @@ use stdClass;
* A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either * 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. * `type` or `options` may be present, but not both.
*/ */
class FullfillmentType class FulfillmentType
{ {
public const SHIPPING = 'SHIPPING'; public const SHIPPING = 'SHIPPING';
@@ -46,6 +46,6 @@ class FullfillmentType
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) { if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value; return $value;
} }
throw new Exception("$value is invalid for FullfillmentType."); throw new Exception("$value is invalid for FulfillmentType.");
} }
} }

View File

@@ -0,0 +1,239 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSdkLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSdkLib\Models;
use stdClass;
/**
* The payment card used to fund a Google Pay payment. Can be a credit or debit card.
*/
class GooglePayCard implements \JsonSerializable
{
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $number;
/**
* @var string|null
*/
private $expiry;
/**
* @var string|null
*/
private $lastDigits;
/**
* @var string|null
*/
private $type;
/**
* @var string|null
*/
private $brand;
/**
* @var PortablePostalAddressMediumGrained|null
*/
private $billingAddress;
/**
* Returns Name.
* The card holder's name as it appears on the card.
*/
public function getName(): ?string
{
return $this->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;
}
}

View File

@@ -33,6 +33,11 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
*/ */
private $paymentMethod; private $paymentMethod;
/**
* @var GooglePayCard
*/
private $card;
/** /**
* @var string * @var string
*/ */
@@ -50,11 +55,13 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
/** /**
* @param string $paymentMethod * @param string $paymentMethod
* @param GooglePayCard $card
* @param string $authenticationMethod * @param string $authenticationMethod
*/ */
public function __construct(string $paymentMethod, string $authenticationMethod) public function __construct(string $paymentMethod, GooglePayCard $card, string $authenticationMethod)
{ {
$this->paymentMethod = $paymentMethod; $this->paymentMethod = $paymentMethod;
$this->card = $card;
$this->authenticationMethod = $authenticationMethod; $this->authenticationMethod = $authenticationMethod;
} }
@@ -121,6 +128,27 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
$this->paymentMethod = $paymentMethod; $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. * Returns Authentication Method.
* Authentication Method which is used for the card transaction. * Authentication Method which is used for the card transaction.
@@ -205,6 +233,7 @@ class GooglePayDecryptedTokenData implements \JsonSerializable
$json['message_expiration'] = $this->messageExpiration; $json['message_expiration'] = $this->messageExpiration;
} }
$json['payment_method'] = GooglePayPaymentMethod::checkValue($this->paymentMethod); $json['payment_method'] = GooglePayPaymentMethod::checkValue($this->paymentMethod);
$json['card'] = $this->card;
$json['authentication_method'] = GooglePayAuthenticationMethod::checkValue($this->authenticationMethod); $json['authentication_method'] = GooglePayAuthenticationMethod::checkValue($this->authenticationMethod);
if (isset($this->cryptogram)) { if (isset($this->cryptogram)) {
$json['cryptogram'] = $this->cryptogram; $json['cryptogram'] = $this->cryptogram;

View File

@@ -43,9 +43,9 @@ class Order implements \JsonSerializable
private $intent; private $intent;
/** /**
* @var string|null * @var mixed
*/ */
private $processingInstruction = ProcessingInstruction::NO_INSTRUCTION; private $processingInstruction;
/** /**
* @var Payer|null * @var Payer|null
@@ -179,20 +179,22 @@ class Order implements \JsonSerializable
/** /**
* Returns Processing Instruction. * Returns Processing Instruction.
* The instruction to process an order. *
* @return mixed
*/ */
public function getProcessingInstruction(): ?string public function getProcessingInstruction()
{ {
return $this->processingInstruction; return $this->processingInstruction;
} }
/** /**
* Sets Processing Instruction. * Sets Processing Instruction.
* The instruction to process an order.
* *
* @maps processing_instruction * @maps processing_instruction
*
* @param mixed $processingInstruction
*/ */
public function setProcessingInstruction(?string $processingInstruction): void public function setProcessingInstruction($processingInstruction): void
{ {
$this->processingInstruction = $processingInstruction; $this->processingInstruction = $processingInstruction;
} }
@@ -266,9 +268,9 @@ class Order implements \JsonSerializable
/** /**
* Returns Links. * Returns Links.
* An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to * 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, * 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 * 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 * 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 * 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. * Sets Links.
* An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to * 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, * 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 * 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 * 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 * 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); $json['intent'] = CheckoutPaymentIntent::checkValue($this->intent);
} }
if (isset($this->processingInstruction)) { if (isset($this->processingInstruction)) {
$json['processing_instruction'] = ProcessingInstruction::checkValue($this->processingInstruction); $json['processing_instruction'] = $this->processingInstruction;
} }
if (isset($this->payer)) { if (isset($this->payer)) {
$json['payer'] = $this->payer; $json['payer'] = $this->payer;

View File

@@ -40,9 +40,9 @@ class OrderAuthorizeResponse implements \JsonSerializable
private $intent; private $intent;
/** /**
* @var string|null * @var mixed
*/ */
private $processingInstruction = ProcessingInstruction::NO_INSTRUCTION; private $processingInstruction;
/** /**
* @var Payer|null * @var Payer|null
@@ -176,20 +176,22 @@ class OrderAuthorizeResponse implements \JsonSerializable
/** /**
* Returns Processing Instruction. * Returns Processing Instruction.
* The instruction to process an order. *
* @return mixed
*/ */
public function getProcessingInstruction(): ?string public function getProcessingInstruction()
{ {
return $this->processingInstruction; return $this->processingInstruction;
} }
/** /**
* Sets Processing Instruction. * Sets Processing Instruction.
* The instruction to process an order.
* *
* @maps processing_instruction * @maps processing_instruction
*
* @param mixed $processingInstruction
*/ */
public function setProcessingInstruction(?string $processingInstruction): void public function setProcessingInstruction($processingInstruction): void
{ {
$this->processingInstruction = $processingInstruction; $this->processingInstruction = $processingInstruction;
} }
@@ -314,7 +316,7 @@ class OrderAuthorizeResponse implements \JsonSerializable
$json['intent'] = CheckoutPaymentIntent::checkValue($this->intent); $json['intent'] = CheckoutPaymentIntent::checkValue($this->intent);
} }
if (isset($this->processingInstruction)) { if (isset($this->processingInstruction)) {
$json['processing_instruction'] = ProcessingInstruction::checkValue($this->processingInstruction); $json['processing_instruction'] = $this->processingInstruction;
} }
if (isset($this->payer)) { if (isset($this->payer)) {
$json['payer'] = $this->payer; $json['payer'] = $this->payer;

View File

@@ -0,0 +1,231 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSdkLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSdkLib\Models;
use stdClass;
/**
* 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).
*/
class PortablePostalAddressMediumGrained implements \JsonSerializable
{
/**
* @var string|null
*/
private $addressLine1;
/**
* @var string|null
*/
private $addressLine2;
/**
* @var string|null
*/
private $adminArea2;
/**
* @var string|null
*/
private $adminArea1;
/**
* @var string|null
*/
private $postalCode;
/**
* @var string
*/
private $countryCode;
/**
* @param string $countryCode
*/
public function __construct(string $countryCode)
{
$this->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:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.
* </li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>
*/
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:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.
* </li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>
*
* @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.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and
* not <code>UK</code> 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.</blockquote>
*/
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.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and
* not <code>UK</code> 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.</blockquote>
*
* @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;
}
}

View File

@@ -1,45 +0,0 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSdkLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSdkLib\Models;
use Core\Utils\CoreHelper;
use Exception;
use stdClass;
/**
* The instruction to process an order.
*/
class ProcessingInstruction
{
public const ORDER_COMPLETE_ON_PAYMENT_APPROVAL = 'ORDER_COMPLETE_ON_PAYMENT_APPROVAL';
public const NO_INSTRUCTION = 'NO_INSTRUCTION';
private const _ALL_VALUES = [self::ORDER_COMPLETE_ON_PAYMENT_APPROVAL, self::NO_INSTRUCTION];
/**
* Ensures that all the given values are present in this Enum.
*
* @param array|stdClass|null|string $value Value or a list/map of values to be checked
*
* @return array|null|string Input value(s), if all are a part of this Enum
*
* @throws Exception Throws exception if any given value is not in this Enum
*/
public static function checkValue($value)
{
$value = json_decode(json_encode($value), true); // converts stdClass into array
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value;
}
throw new Exception("$value is invalid for ProcessingInstruction.");
}
}

View File

@@ -2576,6 +2576,222 @@ class ShipmentCarrier
public const SPEEDY = 'SPEEDY'; public const SPEEDY = 'SPEEDY';
public const ZOOM_RED = 'ZOOM_RED';
public const NAVLUNGO = 'NAVLUNGO';
public const CASTLEPARCELS = 'CASTLEPARCELS';
public const WEEE = 'WEEE';
public const PACKALY = 'PACKALY';
public const YUNHUIPOST = 'YUNHUIPOST';
public const YOUPARCEL = 'YOUPARCEL';
public const LEMAN = 'LEMAN';
public const MOOVIN = 'MOOVIN';
public const URB_IT = 'URB_IT';
public const MULTIENTREGAPANAMA = 'MULTIENTREGAPANAMA';
public const JUSDASR = 'JUSDASR';
public const DISCOUNTPOST = 'DISCOUNTPOST';
public const RHENUS_UK = 'RHENUS_UK';
public const SWISHIP_JP = 'SWISHIP_JP';
public const GLS_US = 'GLS_US';
public const SMTL = 'SMTL';
public const EMEGA = 'EMEGA';
public const EXPRESSONE_SV = 'EXPRESSONE_SV';
public const HEPSIJET = 'HEPSIJET';
public const WELIVERY = 'WELIVERY';
public const BRINGER = 'BRINGER';
public const EASYROUTES = 'EASYROUTES';
public const MRW = 'MRW';
public const RPM = 'RPM';
public const DPD_PRT = 'DPD_PRT';
public const GLS_ROMANIA = 'GLS_ROMANIA';
public const LMPARCEL = 'LMPARCEL';
public const GTAGSM = 'GTAGSM';
public const DOMINO = 'DOMINO';
public const ESHIPPER = 'ESHIPPER';
public const TRANSPAK = 'TRANSPAK';
public const XINDUS = 'XINDUS';
public const AOYUE = 'AOYUE';
public const EASYPARCEL = 'EASYPARCEL';
public const EXPRESSONE = 'EXPRESSONE';
public const SENDEO_KARGO = 'SENDEO_KARGO';
public const SPEEDAF = 'SPEEDAF';
public const ETOWER = 'ETOWER';
public const GCX = 'GCX';
public const NINJAVAN_VN = 'NINJAVAN_VN';
public const ALLEGRO = 'ALLEGRO';
public const JUMPPOINT = 'JUMPPOINT';
public const SHIPGLOBAL_US = 'SHIPGLOBAL_US';
public const KINISI = 'KINISI';
public const OAKH = 'OAKH';
public const AWEST = 'AWEST';
public const BARSAN = 'BARSAN';
public const ENERGOLOGISTIC = 'ENERGOLOGISTIC';
public const MADROOEX = 'MADROOEX';
public const GOBOLT = 'GOBOLT';
public const SWISS_UNIVERSAL_EXPRESS = 'SWISS_UNIVERSAL_EXPRESS';
public const IORDIRECT = 'IORDIRECT';
public const XMSZM = 'XMSZM';
public const GLS_HUN = 'GLS_HUN';
public const SENDY = 'SENDY';
public const BRAUNSEXPRESS = 'BRAUNSEXPRESS';
public const GRANDSLAMEXPRESS = 'GRANDSLAMEXPRESS';
public const XGS = 'XGS';
public const OTSCHILE = 'OTSCHILE';
public const PACK_UP = 'PACK_UP';
public const PARCELSTARS = 'PARCELSTARS';
public const TEAMEXPRESSLLC = 'TEAMEXPRESSLLC';
public const ASYADEXPRESS = 'ASYADEXPRESS';
public const TDN = 'TDN';
public const EARLYBIRD = 'EARLYBIRD';
public const CACESA = 'CACESA';
public const PARCELJET = 'PARCELJET';
public const MNG_KARGO = 'MNG_KARGO';
public const SUPERPACKLINE = 'SUPERPACKLINE';
public const SPEEDX = 'SPEEDX';
public const VESYL = 'VESYL';
public const SKYKING = 'SKYKING';
public const DIRMENSAJERIA = 'DIRMENSAJERIA';
public const NETLOGIXGROUP = 'NETLOGIXGROUP';
public const ZYOU = 'ZYOU';
public const JAWAR = 'JAWAR';
public const AGSYSTEMS = 'AGSYSTEMS';
public const GPS = 'GPS';
public const PTT_KARGO = 'PTT_KARGO';
public const MAERGO = 'MAERGO';
public const ARIHANTCOURIER = 'ARIHANTCOURIER';
public const VTFE = 'VTFE';
public const YUNANT = 'YUNANT';
public const URBIFY = 'URBIFY';
public const PACK_MAN = 'PACK_MAN';
public const LIEFERGRUN = 'LIEFERGRUN';
public const OBIBOX = 'OBIBOX';
public const PAIKEDA = 'PAIKEDA';
public const SCOTTY = 'SCOTTY';
public const INTELCOM_CA = 'INTELCOM_CA';
public const SWE = 'SWE';
public const ASENDIA = 'ASENDIA';
public const DPD_AT = 'DPD_AT';
public const RELAY = 'RELAY';
public const ATA = 'ATA';
public const SKYEXPRESS_INTERNATIONAL = 'SKYEXPRESS_INTERNATIONAL';
public const SURAT_KARGO = 'SURAT_KARGO';
public const SGLINK = 'SGLINK';
public const FLEETOPTICSINC = 'FLEETOPTICSINC';
public const SHOPLINE = 'SHOPLINE';
public const PIGGYSHIP = 'PIGGYSHIP';
public const LOGOIX = 'LOGOIX';
public const KOLAY_GELSIN = 'KOLAY_GELSIN';
public const ASSOCIATED_COURIERS = 'ASSOCIATED_COURIERS';
public const UPS_CHECKER = 'UPS_CHECKER';
public const WINESHIPPING = 'WINESHIPPING';
public const SPEDISCI = 'SPEDISCI';
private const _ALL_VALUES = [ private const _ALL_VALUES = [
self::DPD_RU, self::DPD_RU,
self::BG_BULGARIAN_POST, self::BG_BULGARIAN_POST,
@@ -3852,7 +4068,115 @@ class ShipmentCarrier
self::MOBI_BR, self::MOBI_BR,
self::LOGINEXT_WEBHOOK, self::LOGINEXT_WEBHOOK,
self::EMS, self::EMS,
self::SPEEDY self::SPEEDY,
self::ZOOM_RED,
self::NAVLUNGO,
self::CASTLEPARCELS,
self::WEEE,
self::PACKALY,
self::YUNHUIPOST,
self::YOUPARCEL,
self::LEMAN,
self::MOOVIN,
self::URB_IT,
self::MULTIENTREGAPANAMA,
self::JUSDASR,
self::DISCOUNTPOST,
self::RHENUS_UK,
self::SWISHIP_JP,
self::GLS_US,
self::SMTL,
self::EMEGA,
self::EXPRESSONE_SV,
self::HEPSIJET,
self::WELIVERY,
self::BRINGER,
self::EASYROUTES,
self::MRW,
self::RPM,
self::DPD_PRT,
self::GLS_ROMANIA,
self::LMPARCEL,
self::GTAGSM,
self::DOMINO,
self::ESHIPPER,
self::TRANSPAK,
self::XINDUS,
self::AOYUE,
self::EASYPARCEL,
self::EXPRESSONE,
self::SENDEO_KARGO,
self::SPEEDAF,
self::ETOWER,
self::GCX,
self::NINJAVAN_VN,
self::ALLEGRO,
self::JUMPPOINT,
self::SHIPGLOBAL_US,
self::KINISI,
self::OAKH,
self::AWEST,
self::BARSAN,
self::ENERGOLOGISTIC,
self::MADROOEX,
self::GOBOLT,
self::SWISS_UNIVERSAL_EXPRESS,
self::IORDIRECT,
self::XMSZM,
self::GLS_HUN,
self::SENDY,
self::BRAUNSEXPRESS,
self::GRANDSLAMEXPRESS,
self::XGS,
self::OTSCHILE,
self::PACK_UP,
self::PARCELSTARS,
self::TEAMEXPRESSLLC,
self::ASYADEXPRESS,
self::TDN,
self::EARLYBIRD,
self::CACESA,
self::PARCELJET,
self::MNG_KARGO,
self::SUPERPACKLINE,
self::SPEEDX,
self::VESYL,
self::SKYKING,
self::DIRMENSAJERIA,
self::NETLOGIXGROUP,
self::ZYOU,
self::JAWAR,
self::AGSYSTEMS,
self::GPS,
self::PTT_KARGO,
self::MAERGO,
self::ARIHANTCOURIER,
self::VTFE,
self::YUNANT,
self::URBIFY,
self::PACK_MAN,
self::LIEFERGRUN,
self::OBIBOX,
self::PAIKEDA,
self::SCOTTY,
self::INTELCOM_CA,
self::SWE,
self::ASENDIA,
self::DPD_AT,
self::RELAY,
self::ATA,
self::SKYEXPRESS_INTERNATIONAL,
self::SURAT_KARGO,
self::SGLINK,
self::FLEETOPTICSINC,
self::SHOPLINE,
self::PIGGYSHIP,
self::LOGOIX,
self::KOLAY_GELSIN,
self::ASSOCIATED_COURIERS,
self::UPS_CHECKER,
self::WINESHIPPING,
self::SPEDISCI
]; ];
/** /**

View File

@@ -177,7 +177,7 @@ class ShippingDetails implements \JsonSerializable
$json['phone_number'] = $this->phoneNumber; $json['phone_number'] = $this->phoneNumber;
} }
if (isset($this->type)) { if (isset($this->type)) {
$json['type'] = FullfillmentType::checkValue($this->type); $json['type'] = FulfillmentType::checkValue($this->type);
} }
if (isset($this->options)) { if (isset($this->options)) {
$json['options'] = $this->options; $json['options'] = $this->options;

View File

@@ -206,7 +206,7 @@ class ShippingWithTrackingDetails implements \JsonSerializable
$json['phone_number'] = $this->phoneNumber; $json['phone_number'] = $this->phoneNumber;
} }
if (isset($this->type)) { if (isset($this->type)) {
$json['type'] = FullfillmentType::checkValue($this->type); $json['type'] = FulfillmentType::checkValue($this->type);
} }
if (isset($this->options)) { if (isset($this->options)) {
$json['options'] = $this->options; $json['options'] = $this->options;

View File

@@ -116,7 +116,7 @@ class VaultedDigitalWalletShippingDetails implements \JsonSerializable
$json['name'] = $this->name; $json['name'] = $this->name;
} }
if (isset($this->type)) { if (isset($this->type)) {
$json['type'] = FullfillmentType::checkValue($this->type); $json['type'] = FulfillmentType::checkValue($this->type);
} }
if (isset($this->address)) { if (isset($this->address)) {
$json['address'] = $this->address; $json['address'] = $this->address;

View File

@@ -62,7 +62,7 @@ class PaypalServerSdkClient implements ConfigurationInterface
->converter(new CompatibilityConverter()) ->converter(new CompatibilityConverter())
->jsonHelper(ApiHelper::getJsonHelper()) ->jsonHelper(ApiHelper::getJsonHelper())
->apiCallback($this->config['httpCallback'] ?? null) ->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_) ->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_)
->authManagers(['Oauth2' => $this->clientCredentialsAuthManager]) ->authManagers(['Oauth2' => $this->clientCredentialsAuthManager])
->loggingConfiguration($loggingConfiguration) ->loggingConfiguration($loggingConfiguration)