From d93d210a35244274e31d2d3270a22a413635833c Mon Sep 17 00:00:00 2001 From: Dani Kirby <58542682+DPoplin@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:17:21 -0600 Subject: [PATCH] Automated commit message (#8) Co-authored-by: PayPalServerSDKs --- README.md | 34 +- doc/controllers/orders.md | 191 +++++----- doc/controllers/payments.md | 52 +-- doc/controllers/vault.md | 104 +++--- doc/models/card-verification-details.md | 1 + doc/models/confirm-order-request.md | 7 +- ...llfillment-type.md => fulfillment-type.md} | 4 +- doc/models/google-pay-card.md | 33 ++ doc/models/google-pay-decrypted-token-data.md | 8 + doc/models/google-pay-request.md | 7 + .../order-authorize-request-payment-source.md | 7 + doc/models/order-authorize-request.md | 7 + doc/models/order-authorize-response.md | 3 +- .../order-capture-request-payment-source.md | 7 + doc/models/order-capture-request.md | 7 + doc/models/order-tracker-request.md | 2 +- doc/models/order.md | 5 +- .../portable-postal-address-medium-grained.md | 33 ++ doc/models/processing-instruction.md | 16 - doc/models/shipment-carrier.md | 108 ++++++ doc/models/shipping-details.md | 2 +- doc/models/shipping-with-tracking-details.md | 2 +- ...vaulted-digital-wallet-shipping-details.md | 2 +- lib/paypal_server_sdk.rb | 296 +++++++-------- .../controllers/base_controller.rb | 2 +- .../controllers/orders_controller.rb | 345 ++++++++++-------- .../controllers/payments_controller.rb | 139 ++++--- .../controllers/vault_controller.rb | 100 ++--- .../models/card_verification_details.rb | 17 +- .../models/confirm_order_request.rb | 13 +- ...llfillment_type.rb => fulfillment_type.rb} | 4 +- .../models/google_pay_card.rb | 114 ++++++ .../models/google_pay_decrypted_token_data.rb | 13 +- lib/paypal_server_sdk/models/order.rb | 24 +- .../models/order_authorize_response.rb | 20 +- .../portable_postal_address_medium_grained.rb | 116 ++++++ .../models/processing_instruction.rb | 23 -- .../models/shipment_carrier.rb | 326 ++++++++++++++++- .../models/shipping_details.rb | 2 +- .../models/shipping_with_tracking_details.rb | 2 +- ...vaulted_digital_wallet_shipping_details.rb | 2 +- paypal_server_sdk.gemspec | 2 +- 42 files changed, 1515 insertions(+), 687 deletions(-) rename doc/models/{fullfillment-type.md => fulfillment-type.md} (88%) create mode 100644 doc/models/google-pay-card.md create mode 100644 doc/models/portable-postal-address-medium-grained.md delete mode 100644 doc/models/processing-instruction.md rename lib/paypal_server_sdk/models/{fullfillment_type.rb => fulfillment_type.rb} (94%) create mode 100644 lib/paypal_server_sdk/models/google_pay_card.rb create mode 100644 lib/paypal_server_sdk/models/portable_postal_address_medium_grained.rb delete mode 100644 lib/paypal_server_sdk/models/processing_instruction.rb diff --git a/README.md b/README.md index 09ef441..9a91bea 100644 --- a/README.md +++ b/README.md @@ -27,20 +27,20 @@ Find out more here: [https://developer.paypal.com/docs/api/orders/v2/](https://d Install the gem from the command line: ```ruby -gem install paypal-server-sdk -v 0.6.0 +gem install paypal-server-sdk -v 0.6.1 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'paypal-server-sdk', '0.6.0' +gem 'paypal-server-sdk', '0.6.1' ``` -For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/0.6.0). +For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/0.6.1). ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/client.md) The following parameters are configurable for the API Client: @@ -56,8 +56,8 @@ The following parameters are configurable for the API Client: | `retry_statuses` | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | | `retry_methods` | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | | `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| `logging_configuration` | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | -| `client_credentials_auth_credentials` | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | +| `logging_configuration` | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/logging-configuration.md) | The SDK logging configuration for API calls | +| `client_credentials_auth_credentials` | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | The API client can be initialized as follows: @@ -107,21 +107,21 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Ruby-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-Ruby-Server-SDK/tree/0.6.1/doc/auth/oauth-2-client-credentials-grant.md) ## List of APIs -* [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/controllers/orders.md) -* [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/controllers/payments.md) -* [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/controllers/vault.md) +* [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/controllers/orders.md) +* [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/controllers/payments.md) +* [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/controllers/vault.md) ## Classes Documentation -* [Utility Classes](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/utility-classes.md) -* [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/http-request.md) -* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/logging-configuration.md) -* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/request-logging-configuration.md) -* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/response-logging-configuration.md) -* [Abstract Logger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.0/doc/abstract-logger.md) +* [Utility Classes](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/utility-classes.md) +* [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/http-response.md) +* [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/http-request.md) +* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/logging-configuration.md) +* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/request-logging-configuration.md) +* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/response-logging-configuration.md) +* [Abstract Logger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/0.6.1/doc/abstract-logger.md) diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md index 0523bd5..ac8789e 100644 --- a/doc/controllers/orders.md +++ b/doc/controllers/orders.md @@ -12,48 +12,58 @@ orders_controller = client.orders ## Methods -* [Orders Authorize](../../doc/controllers/orders.md#orders-authorize) -* [Orders Track Create](../../doc/controllers/orders.md#orders-track-create) * [Orders Create](../../doc/controllers/orders.md#orders-create) -* [Orders Patch](../../doc/controllers/orders.md#orders-patch) -* [Orders Capture](../../doc/controllers/orders.md#orders-capture) * [Orders Get](../../doc/controllers/orders.md#orders-get) +* [Orders Patch](../../doc/controllers/orders.md#orders-patch) * [Orders Confirm](../../doc/controllers/orders.md#orders-confirm) +* [Orders Authorize](../../doc/controllers/orders.md#orders-authorize) +* [Orders Capture](../../doc/controllers/orders.md#orders-capture) +* [Orders Track Create](../../doc/controllers/orders.md#orders-track-create) * [Orders Trackers Patch](../../doc/controllers/orders.md#orders-trackers-patch) -# Orders Authorize +# Orders Create -Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response.
Note: For error handling and troubleshooting, see Orders v2 errors.
+Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.
Note: For error handling and troubleshooting, see Orders v2 errors.
```ruby -def orders_authorize(options = {}) +def orders_create(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to authorize.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | +| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | +| `paypal_partner_attribution_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_client_metadata_id` | `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:
**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | ## Response Type -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). +This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```ruby collect = { - 'id' => 'id0', + 'body' => OrderRequest.new( + intent: CheckoutPaymentIntent::CAPTURE, + purchase_units: [ + PurchaseUnitRequest.new( + amount: AmountWithBreakdown.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) + ] + ), 'prefer' => 'return=minimal' } -result = orders_controller.orders_authorize(collect) +result = orders_controller.orders_create(collect) ``` ## Errors @@ -62,28 +72,25 @@ result = orders_controller.orders_authorize(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Orders Track Create +# Orders Get -Adds tracking information for an Order. +Shows details for an order, by ID.
Note: For error handling and troubleshooting, see Orders v2 errors.
```ruby -def orders_track_create(options = {}) +def orders_get(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `body` | [`OrderTrackerRequest`](../../doc/models/order-tracker-request.md) | Body, Required | - | +| `id` | `String` | Template, Required | The ID of the order for which to show details.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `fields` | `String` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.
**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type @@ -93,69 +100,54 @@ This method returns a `ApiResponse` instance. The `data` property in this instan ```ruby collect = { - 'id' => 'id0', - 'body' => OrderTrackerRequest.new( - capture_id: 'capture_id8', - notify_payer: false - ) + 'id' => 'id0' } -result = orders_controller.orders_track_create(collect) +result = orders_controller.orders_get(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) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Orders Create +# Orders Patch -Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.
Note: For error handling and troubleshooting, see Orders v2 errors.
+Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

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

AttributeOpNotes
intentreplace
payerreplace, addUsing replace op for payer will replace the whole payer object with the value sent in request.
purchase_unitsreplace, add
purchase_units[].custom_idreplace, add, remove
purchase_units[].descriptionreplace, add, remove
purchase_units[].payee.emailreplace
purchase_units[].shipping.namereplace, add
purchase_units[].shipping.email_addressreplace, add
purchase_units[].shipping.phone_numberreplace, add
purchase_units[].shipping.optionsreplace, add
purchase_units[].shipping.addressreplace, add
purchase_units[].shipping.typereplace, add
purchase_units[].soft_descriptorreplace, remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, remove
purchase_units[].invoice_idreplace, add, remove
purchase_units[].payment_instructionreplace
purchase_units[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is INSTANT.
purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove
purchase_units[].payment_instruction.platform_feesreplace, add, remove
purchase_units[].supplementary_data.airlinereplace, add, remove
purchase_units[].supplementary_data.cardreplace, add, remove
application_context.client_configurationreplace, add
```ruby -def orders_create(options = {}) +def orders_patch(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | -| `paypal_partner_attribution_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `paypal_client_metadata_id` | `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:
**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | +| `id` | `String` | Template, Required | The ID of the order to update.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `body` | [`Array`](../../doc/models/patch.md) | Body, Optional | - | ## Response Type -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns a `ApiResponse` instance. ## Example Usage ```ruby collect = { - 'body' => OrderRequest.new( - intent: CheckoutPaymentIntent::CAPTURE, - purchase_units: [ - PurchaseUnitRequest.new( - amount: AmountWithBreakdown.new( - currency_code: 'currency_code6', - value: 'value0' - ) - ) - ] - ), - 'prefer' => 'return=minimal' + 'id' => 'id0', + 'body' => [ + Patch.new( + op: PatchOp::ADD + ) + ] } -result = orders_controller.orders_create(collect) +result = orders_controller.orders_patch(collect) ``` ## Errors @@ -164,42 +156,42 @@ result = orders_controller.orders_create(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Orders Patch +# Orders Confirm -Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

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

AttributeOpNotes
intentreplace
payerreplace, addUsing replace op for payer will replace the whole payer object with the value sent in request.
purchase_unitsreplace, add
purchase_units[].custom_idreplace, add, remove
purchase_units[].descriptionreplace, add, remove
purchase_units[].payee.emailreplace
purchase_units[].shipping.namereplace, add
purchase_units[].shipping.email_addressreplace, add
purchase_units[].shipping.phone_numberreplace, add
purchase_units[].shipping.optionsreplace, add
purchase_units[].shipping.addressreplace, add
purchase_units[].shipping.typereplace, add
purchase_units[].soft_descriptorreplace, remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, remove
purchase_units[].invoice_idreplace, add, remove
purchase_units[].payment_instructionreplace
purchase_units[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is INSTANT.
purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove
purchase_units[].payment_instruction.platform_feesreplace, add, remove
purchase_units[].supplementary_data.airlinereplace, add, remove
purchase_units[].supplementary_data.cardreplace, add, remove
application_context.client_configurationreplace, add
+Payer confirms their intent to pay for the the Order with the given payment source. ```ruby -def orders_patch(options = {}) +def orders_confirm(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order to update.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `body` | [`Array`](../../doc/models/patch.md) | Body, Optional | - | +| `id` | `String` | Template, Required | The ID of the order for which the payer confirms their intent to pay.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | +| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | ## Response Type -This method returns a `ApiResponse` instance. +This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```ruby collect = { 'id' => 'id0', - 'body' => [ - Patch.new( - op: PatchOp::ADD - ) - ] + 'prefer' => 'return=minimal' } -result = orders_controller.orders_patch(collect) +result = orders_controller.orders_confirm(collect) ``` ## Errors @@ -207,34 +199,34 @@ result = orders_controller.orders_patch(collect) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | -| 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) | +| 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 Capture +# Orders Authorize -Captures payment for an order. To successfully capture payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response.
Note: For error handling and troubleshooting, see Orders v2 errors.
+Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response.
Note: For error handling and troubleshooting, see Orders v2 errors.
```ruby -def orders_capture(options = {}) +def orders_authorize(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to capture a payment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | +| `id` | `String` | Template, Required | The ID of the order for which to authorize.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | | `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | | `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`OrderCaptureRequest`](../../doc/models/order-capture-request.md) | Body, Optional | - | +| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | ## Response Type -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). ## Example Usage @@ -244,7 +236,7 @@ collect = { 'prefer' => 'return=minimal' } -result = orders_controller.orders_capture(collect) +result = orders_controller.orders_authorize(collect) ``` ## Errors @@ -260,20 +252,24 @@ result = orders_controller.orders_capture(collect) | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Orders Get +# Orders Capture -Shows details for an order, by ID.
Note: For error handling and troubleshooting, see Orders v2 errors.
+Captures payment for an order. To successfully capture payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response.
Note: For error handling and troubleshooting, see Orders v2 errors.
```ruby -def orders_get(options = {}) +def orders_capture(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to show details.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `fields` | `String` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.
**Constraints**: *Pattern*: `^[a-z_]*$` | +| `id` | `String` | Template, Required | The ID of the order for which to capture a payment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | +| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `body` | [`OrderCaptureRequest`](../../doc/models/order-capture-request.md) | Body, Optional | - | ## Response Type @@ -283,37 +279,41 @@ This method returns a `ApiResponse` instance. The `data` property in this instan ```ruby collect = { - 'id' => 'id0' + 'id' => 'id0', + 'prefer' => 'return=minimal' } -result = orders_controller.orders_get(collect) +result = orders_controller.orders_capture(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 Confirm +# Orders Track Create -Payer confirms their intent to pay for the the Order with the given payment source. +Adds tracking information for an Order. ```ruby -def orders_confirm(options = {}) +def orders_track_create(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which the payer confirms their intent to pay.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | -| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | +| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `body` | [`OrderTrackerRequest`](../../doc/models/order-tracker-request.md) | Body, Required | - | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | ## Response Type @@ -324,14 +324,13 @@ This method returns a `ApiResponse` instance. The `data` property in this instan ```ruby collect = { 'id' => 'id0', - 'prefer' => 'return=minimal', - 'body' => ConfirmOrderRequest.new( - payment_source: PaymentSource.new, - processing_instruction: ProcessingInstruction::NO_INSTRUCTION + 'body' => OrderTrackerRequest.new( + capture_id: 'capture_id8', + notify_payer: false ) } -result = orders_controller.orders_confirm(collect) +result = orders_controller.orders_track_create(collect) ``` ## Errors @@ -340,6 +339,7 @@ result = orders_controller.orders_confirm(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -359,6 +359,7 @@ def orders_trackers_patch(options = {}) | --- | --- | --- | --- | | `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `tracker_id` | `String` | Template, Required | The order tracking ID.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | | `body` | [`Array`](../../doc/models/patch.md) | Body, Optional | - | ## Response Type diff --git a/doc/controllers/payments.md b/doc/controllers/payments.md index 94b5b75..7a843d6 100644 --- a/doc/controllers/payments.md +++ b/doc/controllers/payments.md @@ -14,8 +14,8 @@ payments_controller = client.payments * [Authorizations Get](../../doc/controllers/payments.md#authorizations-get) * [Authorizations Capture](../../doc/controllers/payments.md#authorizations-capture) -* [Authorizations Void](../../doc/controllers/payments.md#authorizations-void) * [Authorizations Reauthorize](../../doc/controllers/payments.md#authorizations-reauthorize) +* [Authorizations Void](../../doc/controllers/payments.md#authorizations-void) * [Captures Get](../../doc/controllers/payments.md#captures-get) * [Captures Refund](../../doc/controllers/payments.md#captures-refund) * [Refunds Get](../../doc/controllers/payments.md#refunds-get) @@ -26,7 +26,7 @@ payments_controller = client.payments Shows details for an authorized payment, by ID. ```ruby -def authorizations_get(authorization_id) +def authorizations_get(options = {}) ``` ## Parameters @@ -34,6 +34,7 @@ def authorizations_get(authorization_id) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `authorization_id` | `String` | Template, Required | The ID of the authorized payment for which to show details. | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).
Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
| ## Response Type @@ -42,9 +43,11 @@ This method returns a `ApiResponse` instance. The `data` property in this instan ## Example Usage ```ruby -authorization_id = 'authorization_id8' +collect = { + 'authorization_id' => 'authorization_id8' +} -result = payments_controller.authorizations_get(authorization_id) +result = payments_controller.authorizations_get(collect) ``` ## Errors @@ -52,7 +55,6 @@ result = payments_controller.authorizations_get(authorization_id) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `APIException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -73,6 +75,7 @@ def authorizations_capture(options = {}) | `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | | `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | | `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).
Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
| | `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type @@ -107,21 +110,23 @@ result = payments_controller.authorizations_capture(collect) | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Authorizations Void +# Authorizations Reauthorize -Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been fully captured. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires.

If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment.

A reauthorized payment itself has a new honor period of three days.

You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD.

Supports only the `amount` request parameter.
Note: This request is currently not supported for Partner use cases.
```ruby -def authorizations_void(options = {}) +def authorizations_reauthorize(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to void. | -| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).
Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
| +| `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to reauthorize. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | | `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).
Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
| +| `body` | [`ReauthorizeRequest`](../../doc/models/reauthorize-request.md) | Body, Optional | - | ## Response Type @@ -135,7 +140,7 @@ collect = { 'prefer' => 'return=minimal' } -result = payments_controller.authorizations_void(collect) +result = payments_controller.authorizations_reauthorize(collect) ``` ## Errors @@ -144,30 +149,28 @@ result = payments_controller.authorizations_void(collect) | --- | --- | --- | | 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 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 Void -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires.

If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment.

A reauthorized payment itself has a new honor period of three days.

You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD.

Supports only the `amount` request parameter.
Note: This request is currently not supported for Partner use cases.
+Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been fully captured. ```ruby -def authorizations_reauthorize(options = {}) +def authorizations_void(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to reauthorize. | +| `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to void. | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).
Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
| | `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | | `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is:
  • return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
  • return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | -| `body` | [`ReauthorizeRequest`](../../doc/models/reauthorize-request.md) | Body, Optional | - | ## Response Type @@ -181,17 +184,17 @@ collect = { 'prefer' => 'return=minimal' } -result = payments_controller.authorizations_reauthorize(collect) +result = payments_controller.authorizations_void(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) | @@ -286,7 +289,7 @@ result = payments_controller.captures_refund(collect) Shows details for a refund, by ID. ```ruby -def refunds_get(refund_id) +def refunds_get(options = {}) ``` ## Parameters @@ -294,6 +297,7 @@ def refunds_get(refund_id) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `refund_id` | `String` | Template, Required | The PayPal-generated ID for the refund for which to show details. | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).
Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.
| ## Response Type @@ -302,9 +306,11 @@ This method returns a `ApiResponse` instance. The `data` property in this instan ## Example Usage ```ruby -refund_id = 'refund_id4' +collect = { + 'refund_id' => 'refund_id4' +} -result = payments_controller.refunds_get(refund_id) +result = payments_controller.refunds_get(collect) ``` ## Errors diff --git a/doc/controllers/vault.md b/doc/controllers/vault.md index e7a5315..a37d336 100644 --- a/doc/controllers/vault.md +++ b/doc/controllers/vault.md @@ -12,14 +12,57 @@ vault_controller = client.vault ## Methods +* [Payment-Tokens Create](../../doc/controllers/vault.md#payment-tokens-create) * [Customer Payment-Tokens Get](../../doc/controllers/vault.md#customer-payment-tokens-get) * [Payment-Tokens Get](../../doc/controllers/vault.md#payment-tokens-get) -* [Payment-Tokens Create](../../doc/controllers/vault.md#payment-tokens-create) -* [Setup-Tokens Create](../../doc/controllers/vault.md#setup-tokens-create) * [Payment-Tokens Delete](../../doc/controllers/vault.md#payment-tokens-delete) +* [Setup-Tokens Create](../../doc/controllers/vault.md#setup-tokens-create) * [Setup-Tokens Get](../../doc/controllers/vault.md#setup-tokens-get) +# Payment-Tokens Create + +Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. + +```ruby +def payment_tokens_create(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paypal_request_id` | `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 `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). + +## Example Usage + +```ruby +collect = { + 'paypal_request_id' => 'PayPal-Request-Id6', + 'body' => PaymentTokenRequest.new( + payment_source: PaymentTokenRequestPaymentSource.new + ) +} + +result = vault_controller.payment_tokens_create(collect) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | + + # Customer Payment-Tokens Get Returns all payment tokens for a customer. @@ -99,36 +142,30 @@ result = vault_controller.payment_tokens_get(id) | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Payment-Tokens Create +# Payment-Tokens Delete -Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. +Delete the payment token associated with the payment token id. ```ruby -def payment_tokens_create(options = {}) +def payment_tokens_delete(id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `paypal_request_id` | `String` | Header, Required | The server stores keys for 3 hours. | -| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. | +| `id` | `String` | Template, Required | ID of the payment token.
**Constraints**: *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +This method returns a `ApiResponse` instance. ## Example Usage ```ruby -collect = { - 'paypal_request_id' => 'PayPal-Request-Id6', - 'body' => PaymentTokenRequest.new( - payment_source: PaymentTokenRequestPaymentSource.new - ) -} +id = 'id0' -result = vault_controller.payment_tokens_create(collect) +result = vault_controller.payment_tokens_delete(id) ``` ## Errors @@ -137,8 +174,6 @@ result = vault_controller.payment_tokens_create(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -184,41 +219,6 @@ result = vault_controller.setup_tokens_create(collect) | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Payment-Tokens Delete - -Delete the payment token associated with the payment token id. - -```ruby -def payment_tokens_delete(id) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the payment token.
**Constraints**: *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | - -## Response Type - -This method returns a `ApiResponse` instance. - -## Example Usage - -```ruby -id = 'id0' - -result = vault_controller.payment_tokens_delete(id) -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | - - # Setup-Tokens Get Returns a readable representation of temporarily vaulted payment source associated with the setup token id. diff --git a/doc/models/card-verification-details.md b/doc/models/card-verification-details.md index bb351b8..e4cb688 100644 --- a/doc/models/card-verification-details.md +++ b/doc/models/card-verification-details.md @@ -17,6 +17,7 @@ Card Verification details including the authorization details and 3D SECURE deta | `time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional.
Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `processor_response` | [`CardVerificationProcessorResponse`](../../doc/models/card-verification-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | +| `three_d_secure` | `Object` | 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. | ## Example (as JSON) diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md index 5b181f4..b503677 100644 --- a/doc/models/confirm-order-request.md +++ b/doc/models/confirm-order-request.md @@ -12,7 +12,7 @@ Payer confirms the intent to pay for the Order using the provided payment source | Name | Type | Tags | Description | | --- | --- | --- | --- | | `payment_source` | [`PaymentSource`](../../doc/models/payment-source.md) | Required | The payment source definition. | -| `processing_instruction` | [`ProcessingInstruction`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order.
**Default**: `ProcessingInstruction::NO_INSTRUCTION`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Z_]+$` | +| `processing_instruction` | `Object` | Optional | - | | `application_context` | [`OrderConfirmApplicationContext`](../../doc/models/order-confirm-application-context.md) | Optional | Customizes the payer confirmation experience. | ## Example (as JSON) @@ -86,7 +86,10 @@ Payer confirms the intent to pay for the Order using the provided payment source } } }, - "processing_instruction": "NO_INSTRUCTION", + "processing_instruction": { + "key1": "val1", + "key2": "val2" + }, "application_context": { "brand_name": "brand_name8", "locale": "locale2", diff --git a/doc/models/fullfillment-type.md b/doc/models/fulfillment-type.md similarity index 88% rename from doc/models/fullfillment-type.md rename to doc/models/fulfillment-type.md index 3c9598b..d8d0360 100644 --- a/doc/models/fullfillment-type.md +++ b/doc/models/fulfillment-type.md @@ -1,11 +1,11 @@ -# Fullfillment Type +# Fulfillment Type A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both. ## Enumeration -`FullfillmentType` +`FulfillmentType` ## Fields diff --git a/doc/models/google-pay-card.md b/doc/models/google-pay-card.md new file mode 100644 index 0000000..f9fafe3 --- /dev/null +++ b/doc/models/google-pay-card.md @@ -0,0 +1,33 @@ + +# Google Pay Card + +The payment card used to fund a Google Pay payment. Can be a credit or debit card. + +## Structure + +`GooglePayCard` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Optional | The card holder's name as it appears on the card.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.{1,300}$` | +| `number` | `String` | Optional | The primary account number (PAN) for the payment card.
**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | +| `expiry` | `String` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | +| `last_digits` | `String` | Optional | The last digits of the payment card.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `4`, *Pattern*: `^[0-9]{2,4}$` | +| `type` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `billing_address` | [`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). | + +## Example (as JSON) + +```json +{ + "name": "name4", + "number": "number2", + "expiry": "expiry2", + "last_digits": "last_digits8", + "type": "DEBIT" +} +``` + diff --git a/doc/models/google-pay-decrypted-token-data.md b/doc/models/google-pay-decrypted-token-data.md index 6ce3826..9a84591 100644 --- a/doc/models/google-pay-decrypted-token-data.md +++ b/doc/models/google-pay-decrypted-token-data.md @@ -14,6 +14,7 @@ Details shared by Google for the merchant to be shared with PayPal. This is requ | `message_id` | `String` | Optional | A unique ID that identifies the message in case it needs to be revoked or located at a later time.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250`, *Pattern*: `^.*$` | | `message_expiration` | `String` | Optional | Date and time at which the message expires as UTC milliseconds since epoch. Integrators should reject any message that's expired.
**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `\d{13}` | | `payment_method` | [`GooglePayPaymentMethod`](../../doc/models/google-pay-payment-method.md) | Required | The type of the payment credential. Currently, only CARD is supported.
**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4` | +| `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. | | `authentication_method` | [`GooglePayAuthenticationMethod`](../../doc/models/google-pay-authentication-method.md) | Required | Authentication Method which is used for the card transaction.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | | `cryptogram` | `String` | Optional | Base-64 cryptographic identifier used by card schemes to validate the token verification result. This is a conditionally required field if authentication_method is CRYPTOGRAM_3DS.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | | `eci_indicator` | `String` | Optional | Electronic Commerce Indicator may not always be present. It is only returned for tokens on the Visa card network. This value is passed through in the payment authorization request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | @@ -25,6 +26,13 @@ Details shared by Google for the merchant to be shared with PayPal. This is requ "message_id": "message_id4", "message_expiration": "message_expiration8", "payment_method": "CARD", + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "last_digits": "last_digits0", + "type": "UNKNOWN" + }, "authentication_method": "PAN_ONLY", "cryptogram": "cryptogram0", "eci_indicator": "eci_indicator4" diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md index 6c6d9c6..b36d616 100644 --- a/doc/models/google-pay-request.md +++ b/doc/models/google-pay-request.md @@ -46,6 +46,13 @@ Information needed to pay using Google Pay. "message_id": "message_id0", "message_expiration": "message_expiration2", "payment_method": "CARD", + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "last_digits": "last_digits0", + "type": "UNKNOWN" + }, "authentication_method": "PAN_ONLY", "cryptogram": "cryptogram6", "eci_indicator": "eci_indicator0" diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md index 08330b1..3d5ca5b 100644 --- a/doc/models/order-authorize-request-payment-source.md +++ b/doc/models/order-authorize-request-payment-source.md @@ -108,6 +108,13 @@ The payment source definition. "message_id": "message_id0", "message_expiration": "message_expiration2", "payment_method": "CARD", + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "last_digits": "last_digits0", + "type": "UNKNOWN" + }, "authentication_method": "PAN_ONLY", "cryptogram": "cryptogram6", "eci_indicator": "eci_indicator0" diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md index 6986661..b3f39c8 100644 --- a/doc/models/order-authorize-request.md +++ b/doc/models/order-authorize-request.md @@ -104,6 +104,13 @@ The authorization of an order request. "message_id": "message_id0", "message_expiration": "message_expiration2", "payment_method": "CARD", + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "last_digits": "last_digits0", + "type": "UNKNOWN" + }, "authentication_method": "PAN_ONLY", "cryptogram": "cryptogram6", "eci_indicator": "eci_indicator0" diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md index d8f44ef..cc0d87f 100644 --- a/doc/models/order-authorize-response.md +++ b/doc/models/order-authorize-response.md @@ -14,7 +14,7 @@ | `id` | `String` | Optional | The ID of the order. | | `payment_source` | [`OrderAuthorizeResponsePaymentSource`](../../doc/models/order-authorize-response-payment-source.md) | Optional | The payment source used to fund the payment. | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `processing_instruction` | [`ProcessingInstruction`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order.
**Default**: `ProcessingInstruction::NO_INSTRUCTION`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Z_]+$` | +| `processing_instruction` | `Object` | Optional | - | | `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | | `purchase_units` | [`Array`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | @@ -24,7 +24,6 @@ ```json { - "processing_instruction": "NO_INSTRUCTION", "create_time": "create_time0", "update_time": "update_time4", "id": "id4", diff --git a/doc/models/order-capture-request-payment-source.md b/doc/models/order-capture-request-payment-source.md index b4741c4..44661df 100644 --- a/doc/models/order-capture-request-payment-source.md +++ b/doc/models/order-capture-request-payment-source.md @@ -108,6 +108,13 @@ The payment source definition. "message_id": "message_id0", "message_expiration": "message_expiration2", "payment_method": "CARD", + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "last_digits": "last_digits0", + "type": "UNKNOWN" + }, "authentication_method": "PAN_ONLY", "cryptogram": "cryptogram6", "eci_indicator": "eci_indicator0" diff --git a/doc/models/order-capture-request.md b/doc/models/order-capture-request.md index edcce3a..9fedad1 100644 --- a/doc/models/order-capture-request.md +++ b/doc/models/order-capture-request.md @@ -104,6 +104,13 @@ Completes an capture payment for an order. "message_id": "message_id0", "message_expiration": "message_expiration2", "payment_method": "CARD", + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "last_digits": "last_digits0", + "type": "UNKNOWN" + }, "authentication_method": "PAN_ONLY", "cryptogram": "cryptogram6", "eci_indicator": "eci_indicator0" diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md index 2fd4c7e..dddf8eb 100644 --- a/doc/models/order-tracker-request.md +++ b/doc/models/order-tracker-request.md @@ -25,7 +25,7 @@ The tracking details of an order. "capture_id": "capture_id0", "notify_payer": false, "tracking_number": "tracking_number6", - "carrier": "SNTGLOBAL_API", + "carrier": "HOMERUNNER", "carrier_name_other": "carrier_name_other0", "items": [ { diff --git a/doc/models/order.md b/doc/models/order.md index d79aff7..8c122af 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -16,17 +16,16 @@ The order details. | `id` | `String` | Optional | The ID of the order. | | `payment_source` | [`PaymentSourceResponse`](../../doc/models/payment-source-response.md) | Optional | The payment source used to fund the payment. | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `processing_instruction` | [`ProcessingInstruction`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order.
**Default**: `ProcessingInstruction::NO_INSTRUCTION`
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Z_]+$` | +| `processing_instruction` | `Object` | Optional | - | | `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | | `purchase_units` | [`Array`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `links` | [`Array`](../../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. | +| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | ## Example (as JSON) ```json { - "processing_instruction": "NO_INSTRUCTION", "create_time": "create_time8", "update_time": "update_time4", "id": "id2", diff --git a/doc/models/portable-postal-address-medium-grained.md b/doc/models/portable-postal-address-medium-grained.md new file mode 100644 index 0000000..7fd82a7 --- /dev/null +++ b/doc/models/portable-postal-address-medium-grained.md @@ -0,0 +1,33 @@ + +# Portable Postal Address Medium Grained + +The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). + +## Structure + +`PortablePostalAddressMediumGrained` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `address_line_1` | `String` | Optional | The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for data entry, and Compliance and Risk checks. This field needs to pass the full address.
**Constraints**: *Maximum Length*: `300` | +| `address_line_2` | `String` | Optional | The second line of the address, for example, a suite or apartment number.
**Constraints**: *Maximum Length*: `300` | +| `admin_area_2` | `String` | Optional | A city, town, or village. Smaller than `admin_area_level_1`.
**Constraints**: *Maximum Length*: `120` | +| `admin_area_1` | `String` | Optional | The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`. Value, by country, is:
  • UK. A county.
  • US. A state.
  • Canada. A province.
  • Japan. A prefecture.
  • Switzerland. A *kanton*.

**Constraints**: *Maximum Length*: `300` | +| `postal_code` | `String` | Optional | The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).
**Constraints**: *Maximum Length*: `60` | +| `country_code` | `String` | Required | The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.
Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | + +## Example (as JSON) + +```json +{ + "address_line_1": "address_line_16", + "address_line_2": "address_line_24", + "admin_area_2": "admin_area_22", + "admin_area_1": "admin_area_10", + "postal_code": "postal_code6", + "country_code": "country_code6" +} +``` + diff --git a/doc/models/processing-instruction.md b/doc/models/processing-instruction.md deleted file mode 100644 index 1d19956..0000000 --- a/doc/models/processing-instruction.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Processing Instruction - -The instruction to process an order. - -## Enumeration - -`ProcessingInstruction` - -## Fields - -| Name | -| --- | -| `ORDER_COMPLETE_ON_PAYMENT_APPROVAL` | -| `NO_INSTRUCTION` | - diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md index 0e578dc..5aee941 100644 --- a/doc/models/shipment-carrier.md +++ b/doc/models/shipment-carrier.md @@ -1287,4 +1287,112 @@ The carrier for the shipment. Some carriers have a global version as well as loc | `LOGINEXT_WEBHOOK` | | `EMS` | | `SPEEDY` | +| `ZOOM_RED` | +| `NAVLUNGO` | +| `CASTLEPARCELS` | +| `WEEE` | +| `PACKALY` | +| `YUNHUIPOST` | +| `YOUPARCEL` | +| `LEMAN` | +| `MOOVIN` | +| `URB_IT` | +| `MULTIENTREGAPANAMA` | +| `JUSDASR` | +| `DISCOUNTPOST` | +| `RHENUS_UK` | +| `SWISHIP_JP` | +| `GLS_US` | +| `SMTL` | +| `EMEGA` | +| `EXPRESSONE_SV` | +| `HEPSIJET` | +| `WELIVERY` | +| `BRINGER` | +| `EASYROUTES` | +| `MRW` | +| `RPM` | +| `DPD_PRT` | +| `GLS_ROMANIA` | +| `LMPARCEL` | +| `GTAGSM` | +| `DOMINO` | +| `ESHIPPER` | +| `TRANSPAK` | +| `XINDUS` | +| `AOYUE` | +| `EASYPARCEL` | +| `EXPRESSONE` | +| `SENDEO_KARGO` | +| `SPEEDAF` | +| `ETOWER` | +| `GCX` | +| `NINJAVAN_VN` | +| `ALLEGRO` | +| `JUMPPOINT` | +| `SHIPGLOBAL_US` | +| `KINISI` | +| `OAKH` | +| `AWEST` | +| `BARSAN` | +| `ENERGOLOGISTIC` | +| `MADROOEX` | +| `GOBOLT` | +| `SWISS_UNIVERSAL_EXPRESS` | +| `IORDIRECT` | +| `XMSZM` | +| `GLS_HUN` | +| `SENDY` | +| `BRAUNSEXPRESS` | +| `GRANDSLAMEXPRESS` | +| `XGS` | +| `OTSCHILE` | +| `PACK_UP` | +| `PARCELSTARS` | +| `TEAMEXPRESSLLC` | +| `ASYADEXPRESS` | +| `TDN` | +| `EARLYBIRD` | +| `CACESA` | +| `PARCELJET` | +| `MNG_KARGO` | +| `SUPERPACKLINE` | +| `SPEEDX` | +| `VESYL` | +| `SKYKING` | +| `DIRMENSAJERIA` | +| `NETLOGIXGROUP` | +| `ZYOU` | +| `JAWAR` | +| `AGSYSTEMS` | +| `GPS` | +| `PTT_KARGO` | +| `MAERGO` | +| `ARIHANTCOURIER` | +| `VTFE` | +| `YUNANT` | +| `URBIFY` | +| `PACK_MAN` | +| `LIEFERGRUN` | +| `OBIBOX` | +| `PAIKEDA` | +| `SCOTTY` | +| `INTELCOM_CA` | +| `SWE` | +| `ASENDIA` | +| `DPD_AT` | +| `RELAY` | +| `ATA` | +| `SKYEXPRESS_INTERNATIONAL` | +| `SURAT_KARGO` | +| `SGLINK` | +| `FLEETOPTICSINC` | +| `SHOPLINE` | +| `PIGGYSHIP` | +| `LOGOIX` | +| `KOLAY_GELSIN` | +| `ASSOCIATED_COURIERS` | +| `UPS_CHECKER` | +| `WINESHIPPING` | +| `SPEDISCI` | diff --git a/doc/models/shipping-details.md b/doc/models/shipping-details.md index 046f5c6..942637d 100644 --- a/doc/models/shipping-details.md +++ b/doc/models/shipping-details.md @@ -13,7 +13,7 @@ The shipping details. | --- | --- | --- | --- | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | | `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | -| `type` | [`FullfillmentType`](../../doc/models/fullfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `type` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `options` | [`Array`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.
**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md index ac6bd3f..793da18 100644 --- a/doc/models/shipping-with-tracking-details.md +++ b/doc/models/shipping-with-tracking-details.md @@ -13,7 +13,7 @@ The order shipping details. | --- | --- | --- | --- | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | | `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | -| `type` | [`FullfillmentType`](../../doc/models/fullfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `type` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `options` | [`Array`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.
**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `trackers` | [`Array`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md index d36f226..a93d851 100644 --- a/doc/models/vaulted-digital-wallet-shipping-details.md +++ b/doc/models/vaulted-digital-wallet-shipping-details.md @@ -12,7 +12,7 @@ The shipping details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | -| `type` | [`FullfillmentType`](../../doc/models/fullfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `type` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | ## Example (as JSON) diff --git a/lib/paypal_server_sdk.rb b/lib/paypal_server_sdk.rb index 11c7f92..1f44ce4 100644 --- a/lib/paypal_server_sdk.rb +++ b/lib/paypal_server_sdk.rb @@ -32,263 +32,265 @@ # Models require_relative 'paypal_server_sdk/models/base_model' +require_relative 'paypal_server_sdk/models/activity_timestamps' +require_relative 'paypal_server_sdk/models/amount_breakdown' +require_relative 'paypal_server_sdk/models/amount_with_breakdown' require_relative 'paypal_server_sdk/models/apple_pay_payment_object' require_relative 'paypal_server_sdk/models/apple_pay_attributes' -require_relative 'paypal_server_sdk/models/assurance_details' -require_relative 'paypal_server_sdk/models/card_experience_context' -require_relative 'paypal_server_sdk/models/card_stored_credential' -require_relative 'paypal_server_sdk/models/card_verification' -require_relative 'paypal_server_sdk/models/exchange_rate' -require_relative 'paypal_server_sdk/models/apple_pay_card_response' -require_relative 'paypal_server_sdk/models/apple_pay_request' -require_relative 'paypal_server_sdk/models/link_description' -require_relative 'paypal_server_sdk/models/blik_payment_request' -require_relative 'paypal_server_sdk/models/blik_level0_payment_object' -require_relative 'paypal_server_sdk/models/card_attributes_response' -require_relative 'paypal_server_sdk/models/card_supplementary_data' -require_relative 'paypal_server_sdk/models/customer_information' -require_relative 'paypal_server_sdk/models/platform_fee' -require_relative 'paypal_server_sdk/models/experience_context' require_relative 'paypal_server_sdk/models/apple_pay_attributes_response' -require_relative 'paypal_server_sdk/models/activity_timestamps' +require_relative 'paypal_server_sdk/models/apple_pay_card_response' +require_relative 'paypal_server_sdk/models/apple_pay_decrypted_token_data' require_relative 'paypal_server_sdk/models/apple_pay_payment_data' +require_relative 'paypal_server_sdk/models/apple_pay_request' +require_relative 'paypal_server_sdk/models/assurance_details' require_relative 'paypal_server_sdk/models/authentication_response' +require_relative 'paypal_server_sdk/models/authorization' +require_relative 'paypal_server_sdk/models/link_description' +require_relative 'paypal_server_sdk/models/authorization_status_with_details' require_relative 'paypal_server_sdk/models/authorization_status_details' require_relative 'paypal_server_sdk/models/authorization_with_additional_data' require_relative 'paypal_server_sdk/models/bancontact_payment_object' require_relative 'paypal_server_sdk/models/bancontact_payment_request' +require_relative 'paypal_server_sdk/models/bin_details' +require_relative 'paypal_server_sdk/models/blik_payment_object' require_relative 'paypal_server_sdk/models/blik_experience_context' require_relative 'paypal_server_sdk/models/blik_one_click_payment_request' require_relative 'paypal_server_sdk/models/blik_one_click_payment_object' +require_relative 'paypal_server_sdk/models/blik_payment_request' +require_relative 'paypal_server_sdk/models/blik_level0_payment_object' require_relative 'paypal_server_sdk/models/capture' +require_relative 'paypal_server_sdk/models/capture_status_with_details' +require_relative 'paypal_server_sdk/models/capture_status_details' require_relative 'paypal_server_sdk/models/card_attributes' +require_relative 'paypal_server_sdk/models/card_attributes_response' require_relative 'paypal_server_sdk/models/card_customer_information' +require_relative 'paypal_server_sdk/models/card_experience_context' +require_relative 'paypal_server_sdk/models/card_from_request' +require_relative 'paypal_server_sdk/models/card_request' +require_relative 'paypal_server_sdk/models/card_response' +require_relative 'paypal_server_sdk/models/card_stored_credential' +require_relative 'paypal_server_sdk/models/card_supplementary_data' require_relative 'paypal_server_sdk/models/card_vault_response' +require_relative 'paypal_server_sdk/models/card_verification' +require_relative 'paypal_server_sdk/models/cobranded_card' require_relative 'paypal_server_sdk/models/confirm_order_request' +require_relative 'paypal_server_sdk/models/customer_information' +require_relative 'paypal_server_sdk/models/platform_fee' require_relative 'paypal_server_sdk/models/eps_payment_object' require_relative 'paypal_server_sdk/models/eps_payment_request' require_relative 'paypal_server_sdk/models/error_details' +require_relative 'paypal_server_sdk/models/exchange_rate' +require_relative 'paypal_server_sdk/models/experience_context' +require_relative 'paypal_server_sdk/models/giropay_payment_object' require_relative 'paypal_server_sdk/models/giropay_payment_request' require_relative 'paypal_server_sdk/models/google_pay_wallet_response' -require_relative 'paypal_server_sdk/models/amount_breakdown' -require_relative 'paypal_server_sdk/models/amount_with_breakdown' -require_relative 'paypal_server_sdk/models/apple_pay_decrypted_token_data' -require_relative 'paypal_server_sdk/models/authorization' -require_relative 'paypal_server_sdk/models/authorization_status_with_details' -require_relative 'paypal_server_sdk/models/bin_details' -require_relative 'paypal_server_sdk/models/blik_payment_object' -require_relative 'paypal_server_sdk/models/capture_status_with_details' -require_relative 'paypal_server_sdk/models/capture_status_details' -require_relative 'paypal_server_sdk/models/card_from_request' -require_relative 'paypal_server_sdk/models/card_request' -require_relative 'paypal_server_sdk/models/card_response' -require_relative 'paypal_server_sdk/models/cobranded_card' -require_relative 'paypal_server_sdk/models/giropay_payment_object' require_relative 'paypal_server_sdk/models/google_pay_card_response' -require_relative 'paypal_server_sdk/models/ideal_payment_object' -require_relative 'paypal_server_sdk/models/level3_card_processing_data' -require_relative 'paypal_server_sdk/models/network_transaction_reference' -require_relative 'paypal_server_sdk/models/order' -require_relative 'paypal_server_sdk/models/p24_payment_request' -require_relative 'paypal_server_sdk/models/payer_base' -require_relative 'paypal_server_sdk/models/payment_source_response' -require_relative 'paypal_server_sdk/models/paypal_wallet' -require_relative 'paypal_server_sdk/models/phone_number' -require_relative 'paypal_server_sdk/models/processor_response' -require_relative 'paypal_server_sdk/models/purchase_unit_request' +require_relative 'paypal_server_sdk/models/google_pay_decrypted_token_data' require_relative 'paypal_server_sdk/models/google_pay_request' +require_relative 'paypal_server_sdk/models/ideal_payment_object' +require_relative 'paypal_server_sdk/models/ideal_payment_request' require_relative 'paypal_server_sdk/models/item' +require_relative 'paypal_server_sdk/models/level2_card_processing_data' +require_relative 'paypal_server_sdk/models/level3_card_processing_data' +require_relative 'paypal_server_sdk/models/line_item' require_relative 'paypal_server_sdk/models/money' +require_relative 'paypal_server_sdk/models/mybank_payment_object' +require_relative 'paypal_server_sdk/models/mybank_payment_request' require_relative 'paypal_server_sdk/models/net_amount_breakdown_item' -require_relative 'paypal_server_sdk/models/order_application_context' -require_relative 'paypal_server_sdk/models/order_confirm_application_context' -require_relative 'paypal_server_sdk/models/order_tracker_request' -require_relative 'paypal_server_sdk/models/patch' -require_relative 'paypal_server_sdk/models/payee_base' -require_relative 'paypal_server_sdk/models/payer' -require_relative 'paypal_server_sdk/models/payment_collection' -require_relative 'paypal_server_sdk/models/phone_with_type' -require_relative 'paypal_server_sdk/models/purchase_unit' -require_relative 'paypal_server_sdk/models/google_pay_decrypted_token_data' -require_relative 'paypal_server_sdk/models/ideal_payment_request' require_relative 'paypal_server_sdk/models/network_token' +require_relative 'paypal_server_sdk/models/network_transaction_reference' +require_relative 'paypal_server_sdk/models/order' +require_relative 'paypal_server_sdk/models/order_application_context' require_relative 'paypal_server_sdk/models/order_authorize_request' require_relative 'paypal_server_sdk/models/order_authorize_response' require_relative 'paypal_server_sdk/models/order_capture_request' +require_relative 'paypal_server_sdk/models/order_confirm_application_context' require_relative 'paypal_server_sdk/models/order_request' -require_relative 'paypal_server_sdk/models/paypal_wallet_attributes' -require_relative 'paypal_server_sdk/models/paypal_wallet_experience_context' -require_relative 'paypal_server_sdk/models/paypal_wallet_vault_response' -require_relative 'paypal_server_sdk/models/level2_card_processing_data' -require_relative 'paypal_server_sdk/models/line_item' -require_relative 'paypal_server_sdk/models/mybank_payment_object' -require_relative 'paypal_server_sdk/models/mybank_payment_request' +require_relative 'paypal_server_sdk/models/order_tracker_request' require_relative 'paypal_server_sdk/models/p24_payment_object' +require_relative 'paypal_server_sdk/models/p24_payment_request' +require_relative 'paypal_server_sdk/models/patch' require_relative 'paypal_server_sdk/models/payee' +require_relative 'paypal_server_sdk/models/payee_base' +require_relative 'paypal_server_sdk/models/payer' +require_relative 'paypal_server_sdk/models/payer_base' +require_relative 'paypal_server_sdk/models/payment_collection' require_relative 'paypal_server_sdk/models/payment_instruction' require_relative 'paypal_server_sdk/models/payment_method_preference' require_relative 'paypal_server_sdk/models/payment_source' +require_relative 'paypal_server_sdk/models/payment_source_response' +require_relative 'paypal_server_sdk/models/paypal_wallet' +require_relative 'paypal_server_sdk/models/paypal_wallet_attributes' require_relative 'paypal_server_sdk/models/paypal_wallet_attributes_response' require_relative 'paypal_server_sdk/models/paypal_wallet_customer' +require_relative 'paypal_server_sdk/models/paypal_wallet_experience_context' require_relative 'paypal_server_sdk/models/paypal_wallet_response' +require_relative 'paypal_server_sdk/models/paypal_wallet_vault_response' +require_relative 'paypal_server_sdk/models/phone_number' +require_relative 'paypal_server_sdk/models/phone_with_type' +require_relative 'paypal_server_sdk/models/processor_response' +require_relative 'paypal_server_sdk/models/purchase_unit' +require_relative 'paypal_server_sdk/models/purchase_unit_request' require_relative 'paypal_server_sdk/models/refund' require_relative 'paypal_server_sdk/models/refund_status_with_details' -require_relative 'paypal_server_sdk/models/seller_receivable_breakdown' require_relative 'paypal_server_sdk/models/refund_status_details' require_relative 'paypal_server_sdk/models/seller_payable_breakdown' require_relative 'paypal_server_sdk/models/seller_protection' +require_relative 'paypal_server_sdk/models/seller_receivable_breakdown' require_relative 'paypal_server_sdk/models/shipping_details' require_relative 'paypal_server_sdk/models/shipping_option' +require_relative 'paypal_server_sdk/models/shipping_with_tracking_details' +require_relative 'paypal_server_sdk/models/sofort_payment_object' +require_relative 'paypal_server_sdk/models/sofort_payment_request' require_relative 'paypal_server_sdk/models/stored_payment_source' +require_relative 'paypal_server_sdk/models/supplementary_data' +require_relative 'paypal_server_sdk/models/tax_info' +require_relative 'paypal_server_sdk/models/' \ + 'three_d_secure_authentication_response' +require_relative 'paypal_server_sdk/models/token' +require_relative 'paypal_server_sdk/models/order_tracker_response' +require_relative 'paypal_server_sdk/models/order_tracker_item' +require_relative 'paypal_server_sdk/models/trustly_payment_object' +require_relative 'paypal_server_sdk/models/trustly_payment_request' +require_relative 'paypal_server_sdk/models/universal_product_code' require_relative 'paypal_server_sdk/models/vault_instruction' +require_relative 'paypal_server_sdk/models/vault_instruction_base' +require_relative 'paypal_server_sdk/models/vault_response' +require_relative 'paypal_server_sdk/models/venmo_wallet_vault_attributes' require_relative 'paypal_server_sdk/models/venmo_wallet_additional_attributes' +require_relative 'paypal_server_sdk/models/venmo_wallet_attributes_response' require_relative 'paypal_server_sdk/models/venmo_wallet_experience_context' require_relative 'paypal_server_sdk/models/venmo_wallet_request' require_relative 'paypal_server_sdk/models/venmo_wallet_response' +require_relative 'paypal_server_sdk/models/address' +require_relative 'paypal_server_sdk/models/apple_pay_tokenized_card' +require_relative 'paypal_server_sdk/models/google_pay_card' +require_relative 'paypal_server_sdk/models/google_pay_card_attributes' require_relative 'paypal_server_sdk/models/google_pay_request_card' require_relative 'paypal_server_sdk/models/name' +require_relative 'paypal_server_sdk/models/' \ + 'order_authorize_request_payment_source' require_relative 'paypal_server_sdk/models/' \ 'order_authorize_response_payment_source' require_relative 'paypal_server_sdk/models/order_capture_request_payment_source' -require_relative 'paypal_server_sdk/models/venmo_wallet_customer_information' -require_relative 'paypal_server_sdk/models/related_identifiers' -require_relative 'paypal_server_sdk/models/customer_request' -require_relative 'paypal_server_sdk/models/payment_token_request' -require_relative 'paypal_server_sdk/models/setup_token_request' -require_relative 'paypal_server_sdk/models/setup_token_response' -require_relative 'paypal_server_sdk/models/payment_token_request_card' -require_relative 'paypal_server_sdk/models/setup_token_card_experience_context' -require_relative 'paypal_server_sdk/models/shipping_with_tracking_details' -require_relative 'paypal_server_sdk/models/order_tracker_response' -require_relative 'paypal_server_sdk/models/order_tracker_item' -require_relative 'paypal_server_sdk/models/google_pay_card_attributes' +require_relative 'paypal_server_sdk/models/paypal_wallet_customer_request' +require_relative 'paypal_server_sdk/models/paypal_wallet_vault_instruction' require_relative 'paypal_server_sdk/models/phone_number_with_country_code' +require_relative 'paypal_server_sdk/models/' \ + 'portable_postal_address_medium_grained' +require_relative 'paypal_server_sdk/models/shipping_name' require_relative 'paypal_server_sdk/models/vault_customer' +require_relative 'paypal_server_sdk/models/venmo_wallet_customer_information' require_relative 'paypal_server_sdk/models/payment_authorization' require_relative 'paypal_server_sdk/models/captured_payment' require_relative 'paypal_server_sdk/models/capture_request' -require_relative 'paypal_server_sdk/models/apple_pay_payment_token' -require_relative 'paypal_server_sdk/models/card_verification_details' -require_relative 'paypal_server_sdk/models/' \ - 'customer_vault_payment_tokens_response' -require_relative 'paypal_server_sdk/models/vault_paypal_wallet_request' -require_relative 'paypal_server_sdk/models/phone' -require_relative 'paypal_server_sdk/models/apple_pay_card' -require_relative 'paypal_server_sdk/models/card_authentication_response' -require_relative 'paypal_server_sdk/models/card_verification_processor_response' -require_relative 'paypal_server_sdk/models/setup_token_request_card' -require_relative 'paypal_server_sdk/models/setup_token_response_payment_source' -require_relative 'paypal_server_sdk/models/sofort_payment_object' -require_relative 'paypal_server_sdk/models/' \ - 'three_d_secure_authentication_response' -require_relative 'paypal_server_sdk/models/trustly_payment_object' -require_relative 'paypal_server_sdk/models/trustly_payment_request' -require_relative 'paypal_server_sdk/models/vault_instruction_base' -require_relative 'paypal_server_sdk/models/vault_response' -require_relative 'paypal_server_sdk/models/venmo_wallet_vault_attributes' -require_relative 'paypal_server_sdk/models/address' -require_relative 'paypal_server_sdk/models/paypal_wallet_customer_request' -require_relative 'paypal_server_sdk/models/paypal_wallet_vault_instruction' require_relative 'paypal_server_sdk/models/refund_platform_fee' require_relative 'paypal_server_sdk/models/refund_payment_instruction' +require_relative 'paypal_server_sdk/models/reauthorize_request' require_relative 'paypal_server_sdk/models/refund_request' +require_relative 'paypal_server_sdk/models/related_identifiers' require_relative 'paypal_server_sdk/models/payment_supplementary_data' require_relative 'paypal_server_sdk/models/supplementary_purchase_data' +require_relative 'paypal_server_sdk/models/capture_payment_instruction' +require_relative 'paypal_server_sdk/models/address_details' +require_relative 'paypal_server_sdk/models/apple_pay_payment_token' require_relative 'paypal_server_sdk/models/card_payment_token' require_relative 'paypal_server_sdk/models/card_response_entity' -require_relative 'paypal_server_sdk/models/payment_token_request_payment_source' -require_relative 'paypal_server_sdk/models/network_transaction_reference_entity' -require_relative 'paypal_server_sdk/models/paypal_payment_token' -require_relative 'paypal_server_sdk/models/venmo_payment_token' -require_relative 'paypal_server_sdk/models/vaulted_digital_wallet' -require_relative 'paypal_server_sdk/models/' \ - 'vaulted_digital_wallet_shipping_details' -require_relative 'paypal_server_sdk/models/sofort_payment_request' -require_relative 'paypal_server_sdk/models/supplementary_data' -require_relative 'paypal_server_sdk/models/tax_info' -require_relative 'paypal_server_sdk/models/token' -require_relative 'paypal_server_sdk/models/universal_product_code' -require_relative 'paypal_server_sdk/models/venmo_wallet_attributes_response' -require_relative 'paypal_server_sdk/models/apple_pay_tokenized_card' +require_relative 'paypal_server_sdk/models/card_verification_details' +require_relative 'paypal_server_sdk/models/customer_request' require_relative 'paypal_server_sdk/models/' \ - 'order_authorize_request_payment_source' -require_relative 'paypal_server_sdk/models/shipping_name' -require_relative 'paypal_server_sdk/models/reauthorize_request' -require_relative 'paypal_server_sdk/models/capture_payment_instruction' -require_relative 'paypal_server_sdk/models/address_details' + 'customer_vault_payment_tokens_response' +require_relative 'paypal_server_sdk/models/payment_token_request_payment_source' require_relative 'paypal_server_sdk/models/vault_experience_context' +require_relative 'paypal_server_sdk/models/network_transaction_reference_entity' require_relative 'paypal_server_sdk/models/' \ 'payment_token_response_payment_source' +require_relative 'paypal_server_sdk/models/payment_token_request' require_relative 'paypal_server_sdk/models/payment_token_response' +require_relative 'paypal_server_sdk/models/vault_paypal_wallet_request' +require_relative 'paypal_server_sdk/models/paypal_payment_token' +require_relative 'paypal_server_sdk/models/phone' +require_relative 'paypal_server_sdk/models/setup_token_request' +require_relative 'paypal_server_sdk/models/setup_token_response' require_relative 'paypal_server_sdk/models/vault_token_request' require_relative 'paypal_server_sdk/models/vault_venmo_request' +require_relative 'paypal_server_sdk/models/venmo_payment_token' +require_relative 'paypal_server_sdk/models/vaulted_digital_wallet' +require_relative 'paypal_server_sdk/models/apple_pay_card' +require_relative 'paypal_server_sdk/models/card_authentication_response' +require_relative 'paypal_server_sdk/models/card_verification_processor_response' +require_relative 'paypal_server_sdk/models/payment_token_request_card' +require_relative 'paypal_server_sdk/models/setup_token_card_experience_context' +require_relative 'paypal_server_sdk/models/setup_token_request_card' require_relative 'paypal_server_sdk/models/setup_token_request_payment_source' require_relative 'paypal_server_sdk/models/setup_token_response_card' +require_relative 'paypal_server_sdk/models/setup_token_response_payment_source' require_relative 'paypal_server_sdk/models/vault_venmo_experience_context' +require_relative 'paypal_server_sdk/models/' \ + 'vaulted_digital_wallet_shipping_details' require_relative 'paypal_server_sdk/models/o_auth_token' -require_relative 'paypal_server_sdk/models/card_type' require_relative 'paypal_server_sdk/models/card_brand' +require_relative 'paypal_server_sdk/models/card_type' require_relative 'paypal_server_sdk/models/checkout_payment_intent' -require_relative 'paypal_server_sdk/models/eci_flag' -require_relative 'paypal_server_sdk/models/enrollment_status' require_relative 'paypal_server_sdk/models/disbursement_mode' require_relative 'paypal_server_sdk/models/dispute_category' +require_relative 'paypal_server_sdk/models/eci_flag' +require_relative 'paypal_server_sdk/models/enrollment_status' require_relative 'paypal_server_sdk/models/liability_shift_indicator' -require_relative 'paypal_server_sdk/models/phone_type' +require_relative 'paypal_server_sdk/models/order_status' require_relative 'paypal_server_sdk/models/pa_res_status' require_relative 'paypal_server_sdk/models/payee_payment_method_preference' -require_relative 'paypal_server_sdk/models/order_status' require_relative 'paypal_server_sdk/models/payment_initiator' -require_relative 'paypal_server_sdk/models/processing_instruction' +require_relative 'paypal_server_sdk/models/phone_type' require_relative 'paypal_server_sdk/models/shipment_carrier' +require_relative 'paypal_server_sdk/models/shipping_type' +require_relative 'paypal_server_sdk/models/store_in_vault_instruction' require_relative 'paypal_server_sdk/models/stored_payment_source_payment_type' +require_relative 'paypal_server_sdk/models/stored_payment_source_usage_type' +require_relative 'paypal_server_sdk/models/order_tracker_status' require_relative 'paypal_server_sdk/models/apple_pay_payment_data_type' +require_relative 'paypal_server_sdk/models/authorization_incomplete_reason' +require_relative 'paypal_server_sdk/models/authorization_status' +require_relative 'paypal_server_sdk/models/avs_code' require_relative 'paypal_server_sdk/models/capture_incomplete_reason' require_relative 'paypal_server_sdk/models/capture_status' require_relative 'paypal_server_sdk/models/card_verification_method' -require_relative 'paypal_server_sdk/models/fullfillment_type' +require_relative 'paypal_server_sdk/models/cvv_code' +require_relative 'paypal_server_sdk/models/fulfillment_type' require_relative 'paypal_server_sdk/models/google_pay_authentication_method' +require_relative 'paypal_server_sdk/models/google_pay_payment_method' require_relative 'paypal_server_sdk/models/item_category' +require_relative 'paypal_server_sdk/models/link_http_method' require_relative 'paypal_server_sdk/models/' \ 'order_application_context_landing_page' -require_relative 'paypal_server_sdk/models/' \ - 'paypal_wallet_account_verification_status' -require_relative 'paypal_server_sdk/models/upc_type' -require_relative 'paypal_server_sdk/models/venmo_payment_token_customer_type' -require_relative 'paypal_server_sdk/models/venmo_payment_token_usage_pattern' -require_relative 'paypal_server_sdk/models/venmo_payment_token_usage_type' -require_relative 'paypal_server_sdk/models/stored_payment_source_usage_type' -require_relative 'paypal_server_sdk/models/authorization_status' -require_relative 'paypal_server_sdk/models/link_http_method' require_relative 'paypal_server_sdk/models/' \ 'order_application_context_shipping_preference' require_relative 'paypal_server_sdk/models/' \ 'order_application_context_user_action' -require_relative 'paypal_server_sdk/models/paypal_payment_token_usage_type' -require_relative 'paypal_server_sdk/models/refund_incomplete_reason' -require_relative 'paypal_server_sdk/models/seller_protection_status' -require_relative 'paypal_server_sdk/models/shipping_preference' -require_relative 'paypal_server_sdk/models/token_type' -require_relative 'paypal_server_sdk/models/token_request_type' -require_relative 'paypal_server_sdk/models/shipping_type' require_relative 'paypal_server_sdk/models/patch_op' -require_relative 'paypal_server_sdk/models/paypal_experience_landing_page' -require_relative 'paypal_server_sdk/models/paypal_payment_token_usage_pattern' -require_relative 'paypal_server_sdk/models/paypal_wallet_vault_status' -require_relative 'paypal_server_sdk/models/refund_status' -require_relative 'paypal_server_sdk/models/vault_status' -require_relative 'paypal_server_sdk/models/store_in_vault_instruction' -require_relative 'paypal_server_sdk/models/order_tracker_status' -require_relative 'paypal_server_sdk/models/authorization_incomplete_reason' -require_relative 'paypal_server_sdk/models/avs_code' -require_relative 'paypal_server_sdk/models/cvv_code' -require_relative 'paypal_server_sdk/models/google_pay_payment_method' require_relative 'paypal_server_sdk/models/payment_advice_code' +require_relative 'paypal_server_sdk/models/paypal_experience_landing_page' require_relative 'paypal_server_sdk/models/paypal_experience_user_action' require_relative 'paypal_server_sdk/models/paypal_payment_token_customer_type' +require_relative 'paypal_server_sdk/models/paypal_payment_token_usage_pattern' +require_relative 'paypal_server_sdk/models/paypal_payment_token_usage_type' +require_relative 'paypal_server_sdk/models/' \ + 'paypal_wallet_account_verification_status' +require_relative 'paypal_server_sdk/models/paypal_wallet_vault_status' require_relative 'paypal_server_sdk/models/processor_response_code' +require_relative 'paypal_server_sdk/models/refund_incomplete_reason' +require_relative 'paypal_server_sdk/models/refund_status' +require_relative 'paypal_server_sdk/models/seller_protection_status' +require_relative 'paypal_server_sdk/models/shipping_preference' require_relative 'paypal_server_sdk/models/standard_entry_class_code' require_relative 'paypal_server_sdk/models/tax_id_type' +require_relative 'paypal_server_sdk/models/token_type' +require_relative 'paypal_server_sdk/models/upc_type' +require_relative 'paypal_server_sdk/models/vault_status' +require_relative 'paypal_server_sdk/models/venmo_payment_token_customer_type' +require_relative 'paypal_server_sdk/models/venmo_payment_token_usage_pattern' +require_relative 'paypal_server_sdk/models/venmo_payment_token_usage_type' +require_relative 'paypal_server_sdk/models/token_request_type' require_relative 'paypal_server_sdk/models/o_auth_provider_error' # Exceptions diff --git a/lib/paypal_server_sdk/controllers/base_controller.rb b/lib/paypal_server_sdk/controllers/base_controller.rb index ff44cb3..09f8266 100644 --- a/lib/paypal_server_sdk/controllers/base_controller.rb +++ b/lib/paypal_server_sdk/controllers/base_controller.rb @@ -10,7 +10,7 @@ class BaseController attr_accessor :config, :http_call_back def self.user_agent - 'PayPal REST API Ruby SDK, Version: 0.6.0, on OS {os-info}' + 'PayPal REST API Ruby SDK, Version: 0.6.1, on OS {os-info}' end def self.user_agent_parameters diff --git a/lib/paypal_server_sdk/controllers/orders_controller.rb b/lib/paypal_server_sdk/controllers/orders_controller.rb index 7d7a7f5..687a3bd 100644 --- a/lib/paypal_server_sdk/controllers/orders_controller.rb +++ b/lib/paypal_server_sdk/controllers/orders_controller.rb @@ -6,19 +6,26 @@ module PaypalServerSdk # OrdersController class OrdersController < BaseController - # Authorizes payment for an order. To successfully authorize payment for an - # order, the buyer must first approve the order or a valid payment_source - # must be provided in the request. A buyer can approve the order upon being - # redirected to the rel:approve URL that was returned in the HATEOAS links - # in the create order response.
Note: For error - # handling and troubleshooting, see Orders v2 errors.
- # @param [String] id Required parameter: The ID of the order for which to - # authorize. + # Creates an order. Merchants and partners can add Level 2 and 3 data to + # payments to reduce risk and payment processing costs. For more information + # about processing payments, see che + # ckout or multiparty checkout.
Note: For + # error handling and troubleshooting, see Orders v2 errors.
+ # @param [OrderRequest] body Required parameter: Example: # @param [String] paypal_request_id Optional parameter: 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. + # 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). + # @param [String] paypal_partner_attribution_id Optional parameter: + # Example: + # @param [String] paypal_client_metadata_id Optional parameter: Example: # @param [String] prefer Optional parameter: The preferred server response # upon successful completion of the request. Value # is:
  • return=minimal. The server returns a minimal @@ -27,33 +34,30 @@ class OrdersController < BaseController # HATEOAS links.
  • return=representation. The server # returns a complete resource representation, including the current state of # the resource.
- # @param [String] paypal_client_metadata_id Optional parameter: Example: # @param [String] paypal_auth_assertion Optional parameter: An # API-caller-provided JSON Web Token (JWT) assertion that identifies the # merchant. For details, see PayPal-Auth-Assertion. - # @param [OrderAuthorizeRequest] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. - def orders_authorize(options = {}) + def orders_create(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/authorize', + '/v2/checkout/orders', Server::DEFAULT) - .template_param(new_parameter(options['id'], key: 'id') - .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) - .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_partner_attribution_id'], key: 'PayPal-Partner-Attribution-Id')) .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) - .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(OrderAuthorizeResponse.method(:from_hash)) + .deserialize_into(Order.method(:from_hash)) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -63,131 +67,52 @@ def orders_authorize(options = {}) 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) - .local_error('403', - 'The authorized payment failed due to insufficient permissions'\ - '.', - ErrorException) - .local_error('404', - 'The specified resource does not exist.', - ErrorException) .local_error('422', 'The requested action could not be performed, semantically'\ ' incorrect, or failed business validation.', ErrorException) - .local_error('500', - 'An internal server error has occurred.', - ErrorException) .local_error('default', 'The error response.', ErrorException)) .execute end - # Adds tracking information for an Order. - # @param [String] id Required parameter: The ID of the order that the - # tracking information is associated with. - # @param [OrderTrackerRequest] body Required parameter: Example: + # Shows details for an order, by ID.
Note: For + # error handling and troubleshooting, see Orders v2 errors.
+ # @param [String] id Required parameter: The ID of the order for which to + # show details. # @param [String] paypal_auth_assertion Optional parameter: An # API-caller-provided JSON Web Token (JWT) assertion that identifies the # merchant. For details, see PayPal-Auth-Assertion. + # @param [String] fields Optional parameter: A comma-separated list of + # fields that should be returned for the order. Valid filter field is + # `payment_source`. # @return [ApiResponse] the complete http response with raw body and status code. - def orders_track_create(options = {}) + def orders_get(options = {}) new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/track', + .request(new_request_builder(HttpMethodEnum::GET, + '/v2/checkout/orders/{id}', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .query_param(new_parameter(options['fields'], key: 'fields')) .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) - .auth(Single.new('Oauth2'))) - .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(Order.method(:from_hash)) - .is_api_response(true) - .local_error('400', - 'Request is not well-formed, syntactically incorrect, or'\ - ' violates schema.', - ErrorException) - .local_error('403', - 'Authorization failed due to insufficient permissions.', - ErrorException) - .local_error('404', - 'The specified resource does not exist.', - ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', - ErrorException) - .local_error('500', - 'An internal server error has occurred.', - ErrorException) - .local_error('default', - 'The error response.', - ErrorException)) - .execute - end - - # 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 che - # ckout or multiparty checkout.
Note: For - # error handling and troubleshooting, see Orders v2 errors.
- # @param [OrderRequest] body Required parameter: Example: - # @param [String] paypal_request_id Optional parameter: 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. - # @param [String] paypal_partner_attribution_id Optional parameter: - # Example: - # @param [String] paypal_client_metadata_id Optional parameter: Example: - # @param [String] prefer Optional parameter: The preferred server response - # upon successful completion of the request. Value - # is:
  • return=minimal. The server returns a minimal - # response to optimize communication between the API caller and the server. - # A minimal response includes the id, status and - # HATEOAS links.
  • return=representation. The server - # returns a complete resource representation, including the current state of - # the resource.
- # @return [ApiResponse] the complete http response with raw body and status code. - def orders_create(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders', - Server::DEFAULT) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) - .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) - .header_param(new_parameter(options['paypal_partner_attribution_id'], key: 'PayPal-Partner-Attribution-Id')) - .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) - .header_param(new_parameter(options['prefer'], key: 'Prefer')) - .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Order.method(:from_hash)) .is_api_response(true) - .local_error('400', - 'Request is not well-formed, syntactically incorrect, or'\ - ' violates schema.', - ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', + .local_error('404', + 'The specified resource does not exist.', ErrorException) .local_error('default', 'The error response.', @@ -256,6 +181,11 @@ def orders_create(options = {}) # removeapplication_context.client_configur # ationreplace, add # @param [String] id Required parameter: The ID of the order to update. + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. # @param [Array[Patch]] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. def orders_patch(options = {}) @@ -266,6 +196,7 @@ def orders_patch(options = {}) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .body_param(new_parameter(options['body'])) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) @@ -293,19 +224,81 @@ def orders_patch(options = {}) .execute end - # Captures payment for an order. To successfully capture payment for an + # Payer confirms their intent to pay for the the Order with the given + # payment source. + # @param [String] id Required parameter: The ID of the order for which the + # payer confirms their intent to pay. + # @param [String] paypal_client_metadata_id Optional parameter: Example: + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. + # @param [String] prefer Optional parameter: The preferred server response + # upon successful completion of the request. Value + # is:
  • return=minimal. The server returns a minimal + # response to optimize communication between the API caller and the server. + # A minimal response includes the id, status and + # HATEOAS links.
  • return=representation. The server + # returns a complete resource representation, including the current state of + # the resource.
+ # @param [ConfirmOrderRequest] body Optional parameter: Example: + # @return [ApiResponse] the complete http response with raw body and status code. + def orders_confirm(options = {}) + new_api_call_builder + .request(new_request_builder(HttpMethodEnum::POST, + '/v2/checkout/orders/{id}/confirm-payment-source', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(Order.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + ErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) + .local_error('500', + 'An internal server error has occurred.', + ErrorException) + .local_error('default', + 'The error response.', + ErrorException)) + .execute + end + + # Authorizes payment for an order. To successfully authorize payment for an # order, the buyer must first approve the order or a valid payment_source # must be provided in the request. A buyer can approve the order upon being # redirected to the rel:approve URL that was returned in the HATEOAS links # in the create order response.
Note: For error # handling and troubleshooting, see Orders v2 errors.
+ # href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#au + # thorize-order">Orders v2 errors. # @param [String] id Required parameter: The ID of the order for which to - # capture a payment. + # authorize. # @param [String] paypal_request_id Optional parameter: 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. + # 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). # @param [String] prefer Optional parameter: The preferred server response # upon successful completion of the request. Value # is:
  • return=minimal. The server returns a minimal @@ -320,12 +313,12 @@ def orders_patch(options = {}) # merchant. For details, see PayPal-Auth-Assertion. - # @param [OrderCaptureRequest] body Optional parameter: Example: + # @param [OrderAuthorizeRequest] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. - def orders_capture(options = {}) + def orders_authorize(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/capture', + '/v2/checkout/orders/{id}/authorize', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) @@ -340,7 +333,7 @@ def orders_capture(options = {}) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(Order.method(:from_hash)) + .deserialize_into(OrderAuthorizeResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -370,69 +363,106 @@ def orders_capture(options = {}) .execute end - # Shows details for an order, by ID.
    Note: For - # error handling and troubleshooting, see Orders v2 errors.
    + # Captures payment for an order. To successfully capture payment for an + # order, the buyer must first approve the order or a valid payment_source + # must be provided in the request. A buyer can approve the order upon being + # redirected to the rel:approve URL that was returned in the HATEOAS links + # in the create order response.
    Note: For error + # handling and troubleshooting, see Orders v2 errors.
    # @param [String] id Required parameter: The ID of the order for which to - # show details. - # @param [String] fields Optional parameter: A comma-separated list of - # fields that should be returned for the order. Valid filter field is - # `payment_source`. + # capture a payment. + # @param [String] paypal_request_id Optional parameter: 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). + # @param [String] prefer Optional parameter: The preferred server response + # upon successful completion of the request. Value + # is:
    • return=minimal. The server returns a minimal + # response to optimize communication between the API caller and the server. + # A minimal response includes the id, status and + # HATEOAS links.
    • return=representation. The server + # returns a complete resource representation, including the current state of + # the resource.
    + # @param [String] paypal_client_metadata_id Optional parameter: Example: + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. + # @param [OrderCaptureRequest] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. - def orders_get(options = {}) + def orders_capture(options = {}) new_api_call_builder - .request(new_request_builder(HttpMethodEnum::GET, - '/v2/checkout/orders/{id}', + .request(new_request_builder(HttpMethodEnum::POST, + '/v2/checkout/orders/{id}/capture', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) - .query_param(new_parameter(options['fields'], key: 'fields')) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Order.method(:from_hash)) .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) + .local_error('403', + 'The authorized payment failed due to insufficient permissions'\ + '.', + ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) + .local_error('500', + 'An internal server error has occurred.', + ErrorException) .local_error('default', 'The error response.', ErrorException)) .execute end - # Payer confirms their intent to pay for the the Order with the given - # payment source. - # @param [String] id Required parameter: The ID of the order for which the - # payer confirms their intent to pay. - # @param [String] paypal_client_metadata_id Optional parameter: Example: - # @param [String] prefer Optional parameter: The preferred server response - # upon successful completion of the request. Value - # is:
    • return=minimal. The server returns a minimal - # response to optimize communication between the API caller and the server. - # A minimal response includes the id, status and - # HATEOAS links.
    • return=representation. The server - # returns a complete resource representation, including the current state of - # the resource.
    - # @param [ConfirmOrderRequest] body Optional parameter: Example: + # Adds tracking information for an Order. + # @param [String] id Required parameter: The ID of the order that the + # tracking information is associated with. + # @param [OrderTrackerRequest] body Required parameter: Example: + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. # @return [ApiResponse] the complete http response with raw body and status code. - def orders_confirm(options = {}) + def orders_track_create(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/confirm-payment-source', + '/v2/checkout/orders/{id}/track', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) - .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) - .header_param(new_parameter(options['prefer'], key: 'Prefer')) .body_param(new_parameter(options['body'])) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) @@ -447,6 +477,9 @@ def orders_confirm(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('404', + 'The specified resource does not exist.', + ErrorException) .local_error('422', 'The requested action could not be performed, semantically'\ ' incorrect, or failed business validation.', @@ -473,6 +506,11 @@ def orders_confirm(options = {}) # @param [String] id Required parameter: The ID of the order that the # tracking information is associated with. # @param [String] tracker_id Required parameter: The order tracking ID. + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. # @param [Array[Patch]] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. def orders_trackers_patch(options = {}) @@ -485,6 +523,7 @@ def orders_trackers_patch(options = {}) .template_param(new_parameter(options['tracker_id'], key: 'tracker_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .body_param(new_parameter(options['body'])) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) diff --git a/lib/paypal_server_sdk/controllers/payments_controller.rb b/lib/paypal_server_sdk/controllers/payments_controller.rb index bd08c68..d8a2dc0 100644 --- a/lib/paypal_server_sdk/controllers/payments_controller.rb +++ b/lib/paypal_server_sdk/controllers/payments_controller.rb @@ -9,14 +9,23 @@ class PaymentsController < BaseController # Shows details for an authorized payment, by ID. # @param [String] authorization_id Required parameter: The ID of the # authorized payment for which to show details. + # @param [String] paypal_auth_assertion Optional parameter: 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-asse + # rtion).
    Note:For three party transactions in + # which a partner is managing the API calls on behalf of a merchant, the + # partner must identify the merchant using either a PayPal-Auth-Assertion + # header or an access token with target_subject.
    # @return [ApiResponse] the complete http response with raw body and status code. - def authorizations_get(authorization_id) + def authorizations_get(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/payments/authorizations/{authorization_id}', Server::DEFAULT) - .template_param(new_parameter(authorization_id, key: 'authorization_id') + .template_param(new_parameter(options['authorization_id'], key: 'authorization_id') .should_encode(true)) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('Oauth2'))) .response(new_response_handler @@ -27,10 +36,6 @@ def authorizations_get(authorization_id) 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) - .local_error('403', - 'The request failed because the caller has insufficient'\ - ' permissions.', - ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) @@ -56,6 +61,14 @@ def authorizations_get(authorization_id) # HATEOAS links.
  • return=representation. The server # returns a complete resource representation, including the current state of # the resource.
+ # @param [String] paypal_auth_assertion Optional parameter: 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-asse + # rtion).
Note:For three party transactions in + # which a partner is managing the API calls on behalf of a merchant, the + # partner must identify the merchant using either a PayPal-Auth-Assertion + # header or an access token with target_subject.
# @param [CaptureRequest] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. def authorizations_capture(options = {}) @@ -68,6 +81,7 @@ def authorizations_capture(options = {}) .header_param(new_parameter('application/json', key: 'Content-Type')) .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) @@ -108,18 +122,24 @@ def authorizations_capture(options = {}) .execute end - # Voids, or cancels, an authorized payment, by ID. You cannot void an - # authorized payment that has been fully captured. + # Reauthorizes an authorized PayPal account payment, by ID. To ensure that + # funds are still available, reauthorize a payment after its initial + # three-day honor period expires. Within the 29-day authorization period, + # you can issue multiple re-authorizations after the honor period + # expires.

If 30 days have transpired since the date of the + # original authorization, you must create an authorized payment instead of + # reauthorizing the original authorized payment.

A reauthorized + # payment itself has a new honor period of three days.

You can + # reauthorize an authorized payment from 4 to 29 days after the 3-day honor + # period. The allowed amount depends on context and geography, for example + # in US it is up to 115% of the original authorized amount, not to exceed an + # increase of $75 USD.

Supports only the `amount` request + # parameter.
Note: This request is currently not + # supported for Partner use cases.
# @param [String] authorization_id Required parameter: The PayPal-generated - # ID for the authorized payment to void. - # @param [String] paypal_auth_assertion Optional parameter: 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-asse - # rtion).
Note:For three party transactions in - # which a partner is managing the API calls on behalf of a merchant, the - # partner must identify the merchant using either a PayPal-Auth-Assertion - # header or an access token with target_subject.
+ # ID for the authorized payment to reauthorize. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 45 days. # @param [String] prefer Optional parameter: The preferred server response # upon successful completion of the request. Value # is:
  • return=minimal. The server returns a minimal @@ -128,20 +148,32 @@ def authorizations_capture(options = {}) # HATEOAS links.
  • return=representation. The server # returns a complete resource representation, including the current state of # the resource.
+ # @param [String] paypal_auth_assertion Optional parameter: 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-asse + # rtion).
Note:For three party transactions in + # which a partner is managing the API calls on behalf of a merchant, the + # partner must identify the merchant using either a PayPal-Auth-Assertion + # header or an access token with target_subject.
+ # @param [ReauthorizeRequest] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. - def authorizations_void(options = {}) + def authorizations_reauthorize(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, - '/v2/payments/authorizations/{authorization_id}/void', + '/v2/payments/authorizations/{authorization_id}/reauthorize', Server::DEFAULT) .template_param(new_parameter(options['authorization_id'], key: 'authorization_id') .should_encode(true)) - .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler - .is_nullable_response(true) .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PaymentAuthorization.method(:from_hash)) .is_api_response(true) @@ -153,17 +185,9 @@ def authorizations_void(options = {}) 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) - .local_error('403', - 'The request failed because the caller has insufficient'\ - ' permissions.', - ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) - .local_error('409', - 'The request failed because a previous call for the given'\ - ' resource is in progress.', - ErrorException) .local_error('422', 'The request failed because it either is semantically incorrect'\ ' or failed business validation.', @@ -177,22 +201,18 @@ def authorizations_void(options = {}) .execute end - # Reauthorizes an authorized PayPal account payment, by ID. To ensure that - # funds are still available, reauthorize a payment after its initial - # three-day honor period expires. Within the 29-day authorization period, - # you can issue multiple re-authorizations after the honor period - # expires.

If 30 days have transpired since the date of the - # original authorization, you must create an authorized payment instead of - # reauthorizing the original authorized payment.

A reauthorized - # payment itself has a new honor period of three days.

You can - # reauthorize an authorized payment from 4 to 29 days after the 3-day honor - # period. The allowed amount depends on context and geography, for example - # in US it is up to 115% of the original authorized amount, not to exceed an - # increase of $75 USD.

Supports only the `amount` request - # parameter.
Note: This request is currently not - # supported for Partner use cases.
+ # Voids, or cancels, an authorized payment, by ID. You cannot void an + # authorized payment that has been fully captured. # @param [String] authorization_id Required parameter: The PayPal-generated - # ID for the authorized payment to reauthorize. + # ID for the authorized payment to void. + # @param [String] paypal_auth_assertion Optional parameter: 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-asse + # rtion).
Note:For three party transactions in + # which a partner is managing the API calls on behalf of a merchant, the + # partner must identify the merchant using either a PayPal-Auth-Assertion + # header or an access token with target_subject.
# @param [String] paypal_request_id Optional parameter: The server stores # keys for 45 days. # @param [String] prefer Optional parameter: The preferred server response @@ -203,30 +223,24 @@ def authorizations_void(options = {}) # HATEOAS links.
  • return=representation. The server # returns a complete resource representation, including the current state of # the resource.
  • - # @param [ReauthorizeRequest] body Optional parameter: Example: # @return [ApiResponse] the complete http response with raw body and status code. - def authorizations_reauthorize(options = {}) + def authorizations_void(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, - '/v2/payments/authorizations/{authorization_id}/reauthorize', + '/v2/payments/authorizations/{authorization_id}/void', Server::DEFAULT) .template_param(new_parameter(options['authorization_id'], key: 'authorization_id') .should_encode(true)) - .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) .header_param(new_parameter(options['prefer'], key: 'Prefer')) - .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler + .is_nullable_response(true) .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PaymentAuthorization.method(:from_hash)) .is_api_response(true) - .local_error('400', - 'The request failed because it is not well-formed or is'\ - ' syntactically incorrect or violates schema.', - ErrorException) .local_error('401', 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', @@ -238,6 +252,10 @@ def authorizations_reauthorize(options = {}) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) + .local_error('409', + 'The request failed because a previous call for the given'\ + ' resource is in progress.', + ErrorException) .local_error('422', 'The request failed because it either is semantically incorrect'\ ' or failed business validation.', @@ -367,14 +385,23 @@ def captures_refund(options = {}) # Shows details for a refund, by ID. # @param [String] refund_id Required parameter: The PayPal-generated ID for # the refund for which to show details. + # @param [String] paypal_auth_assertion Optional parameter: 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-asse + # rtion).
    Note:For three party transactions in + # which a partner is managing the API calls on behalf of a merchant, the + # partner must identify the merchant using either a PayPal-Auth-Assertion + # header or an access token with target_subject.
    # @return [ApiResponse] the complete http response with raw body and status code. - def refunds_get(refund_id) + def refunds_get(options = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/payments/refunds/{refund_id}', Server::DEFAULT) - .template_param(new_parameter(refund_id, key: 'refund_id') + .template_param(new_parameter(options['refund_id'], key: 'refund_id') .should_encode(true)) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('Oauth2'))) .response(new_response_handler diff --git a/lib/paypal_server_sdk/controllers/vault_controller.rb b/lib/paypal_server_sdk/controllers/vault_controller.rb index c063ef7..80dfc98 100644 --- a/lib/paypal_server_sdk/controllers/vault_controller.rb +++ b/lib/paypal_server_sdk/controllers/vault_controller.rb @@ -6,6 +6,48 @@ module PaypalServerSdk # VaultController class VaultController < BaseController + # Creates a Payment Token from the given payment source and adds it to the + # Vault of the associated customer. + # @param [String] paypal_request_id Required parameter: The server stores + # keys for 3 hours. + # @param [PaymentTokenRequest] body Required parameter: Payment Token + # creation with a financial instrument and an optional customer_id. + # @return [ApiResponse] the complete http response with raw body and status code. + def payment_tokens_create(options = {}) + new_api_call_builder + .request(new_request_builder(HttpMethodEnum::POST, + '/v3/vault/payment-tokens', + Server::DEFAULT) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(PaymentTokenResponse.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + ErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + ErrorException) + .local_error('404', + 'Request contains reference to resources that do not exist.', + ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) + .local_error('500', + 'An internal server error has occurred.', + ErrorException)) + .execute + end + # Returns all payment tokens for a customer. # @param [String] customer_id Required parameter: A unique identifier # representing a specific customer in merchant's/partner's system or @@ -79,27 +121,19 @@ def payment_tokens_get(id) .execute end - # Creates a Payment Token from the given payment source and adds it to the - # Vault of the associated customer. - # @param [String] paypal_request_id Required parameter: The server stores - # keys for 3 hours. - # @param [PaymentTokenRequest] body Required parameter: Payment Token - # creation with a financial instrument and an optional customer_id. + # Delete the payment token associated with the payment token id. + # @param [String] id Required parameter: ID of the payment token. # @return [ApiResponse] the complete http response with raw body and status code. - def payment_tokens_create(options = {}) + def payment_tokens_delete(id) new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v3/vault/payment-tokens', + .request(new_request_builder(HttpMethodEnum::DELETE, + '/v3/vault/payment-tokens/{id}', Server::DEFAULT) - .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) - .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) + .template_param(new_parameter(id, key: 'id') + .should_encode(true)) .auth(Single.new('Oauth2'))) .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(PaymentTokenResponse.method(:from_hash)) + .is_response_void(true) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -108,13 +142,6 @@ def payment_tokens_create(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('404', - 'Request contains reference to resources that do not exist.', - ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', - ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException)) @@ -161,33 +188,6 @@ def setup_tokens_create(options = {}) .execute end - # Delete the payment token associated with the payment token id. - # @param [String] id Required parameter: ID of the payment token. - # @return [ApiResponse] the complete http response with raw body and status code. - def payment_tokens_delete(id) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::DELETE, - '/v3/vault/payment-tokens/{id}', - Server::DEFAULT) - .template_param(new_parameter(id, key: 'id') - .should_encode(true)) - .auth(Single.new('Oauth2'))) - .response(new_response_handler - .is_response_void(true) - .is_api_response(true) - .local_error('400', - 'Request is not well-formed, syntactically incorrect, or'\ - ' violates schema.', - ErrorException) - .local_error('403', - 'Authorization failed due to insufficient permissions.', - ErrorException) - .local_error('500', - 'An internal server error has occurred.', - ErrorException)) - .execute - end - # Returns a readable representation of temporarily vaulted payment source # associated with the setup token id. # @param [String] id Required parameter: ID of the setup token. diff --git a/lib/paypal_server_sdk/models/card_verification_details.rb b/lib/paypal_server_sdk/models/card_verification_details.rb index 6d8b9a2..330f632 100644 --- a/lib/paypal_server_sdk/models/card_verification_details.rb +++ b/lib/paypal_server_sdk/models/card_verification_details.rb @@ -45,6 +45,12 @@ class CardVerificationDetails < BaseModel # @return [CardVerificationProcessorResponse] attr_accessor :processor_response + # 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 [Object] + attr_accessor :three_d_secure + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -54,6 +60,7 @@ def self.names @_hash['time'] = 'time' @_hash['amount'] = 'amount' @_hash['processor_response'] = 'processor_response' + @_hash['three_d_secure'] = 'three_d_secure' @_hash end @@ -66,6 +73,7 @@ def self.optionals time amount processor_response + three_d_secure ] end @@ -75,13 +83,15 @@ def self.nullables end def initialize(network_transaction_id: SKIP, date: SKIP, network: SKIP, - time: SKIP, amount: SKIP, processor_response: SKIP) + time: SKIP, amount: SKIP, processor_response: SKIP, + three_d_secure: SKIP) @network_transaction_id = network_transaction_id unless network_transaction_id == SKIP @date = date unless date == SKIP @network = network unless network == SKIP @time = time unless time == SKIP @amount = amount unless amount == SKIP @processor_response = processor_response unless processor_response == SKIP + @three_d_secure = three_d_secure unless three_d_secure == SKIP end # Creates an instance of the object from a hash. @@ -98,6 +108,8 @@ def self.from_hash(hash) if hash['processor_response'] processor_response = CardVerificationProcessorResponse.from_hash(hash['processor_response']) end + three_d_secure = + hash.key?('three_d_secure') ? hash['three_d_secure'] : SKIP # Create object from extracted values. CardVerificationDetails.new(network_transaction_id: network_transaction_id, @@ -105,7 +117,8 @@ def self.from_hash(hash) network: network, time: time, amount: amount, - processor_response: processor_response) + processor_response: processor_response, + three_d_secure: three_d_secure) end end end diff --git a/lib/paypal_server_sdk/models/confirm_order_request.rb b/lib/paypal_server_sdk/models/confirm_order_request.rb index bee9bfb..270421f 100644 --- a/lib/paypal_server_sdk/models/confirm_order_request.rb +++ b/lib/paypal_server_sdk/models/confirm_order_request.rb @@ -14,8 +14,8 @@ class ConfirmOrderRequest < BaseModel # @return [PaymentSource] attr_accessor :payment_source - # The instruction to process an order. - # @return [ProcessingInstruction] + # The payment source definition. + # @return [Object] attr_accessor :processing_instruction # Customizes the payer confirmation experience. @@ -44,11 +44,8 @@ def self.nullables [] end - def initialize( - payment_source:, - processing_instruction: ProcessingInstruction::NO_INSTRUCTION, - application_context: SKIP - ) + def initialize(payment_source:, processing_instruction: SKIP, + application_context: SKIP) @payment_source = payment_source @processing_instruction = processing_instruction unless processing_instruction == SKIP @application_context = application_context unless application_context == SKIP @@ -61,7 +58,7 @@ def self.from_hash(hash) # Extract variables from the hash. payment_source = PaymentSource.from_hash(hash['payment_source']) if hash['payment_source'] processing_instruction = - hash['processing_instruction'] ||= ProcessingInstruction::NO_INSTRUCTION + hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP application_context = OrderConfirmApplicationContext.from_hash(hash['application_context']) if hash['application_context'] diff --git a/lib/paypal_server_sdk/models/fullfillment_type.rb b/lib/paypal_server_sdk/models/fulfillment_type.rb similarity index 94% rename from lib/paypal_server_sdk/models/fullfillment_type.rb rename to lib/paypal_server_sdk/models/fulfillment_type.rb index 321cbde..3176b9f 100644 --- a/lib/paypal_server_sdk/models/fullfillment_type.rb +++ b/lib/paypal_server_sdk/models/fulfillment_type.rb @@ -7,8 +7,8 @@ module PaypalServerSdk # A classification for the method of purchase fulfillment (e.g shipping, # in-store pickup, etc). Either `type` or `options` may be present, but not # both. - class FullfillmentType - FULLFILLMENT_TYPE = [ + class FulfillmentType + FULFILLMENT_TYPE = [ # TODO: Write general description for SHIPPING SHIPPING = 'SHIPPING'.freeze, diff --git a/lib/paypal_server_sdk/models/google_pay_card.rb b/lib/paypal_server_sdk/models/google_pay_card.rb new file mode 100644 index 0000000..1523805 --- /dev/null +++ b/lib/paypal_server_sdk/models/google_pay_card.rb @@ -0,0 +1,114 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v2.0 +# ( https://apimatic.io ). + +module PaypalServerSdk + # The payment card used to fund a Google Pay payment. Can be a credit or debit + # card. + class GooglePayCard < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The card holder's name as it appears on the card. + # @return [String] + attr_accessor :name + + # The primary account number (PAN) for the payment card. + # @return [String] + attr_accessor :number + + # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date + # and time format](https://tools.ietf.org/html/rfc3339#section-5.6). + # @return [String] + attr_accessor :expiry + + # The last digits of the payment card. + # @return [String] + attr_accessor :last_digits + + # Type of card. i.e Credit, Debit and so on. + # @return [CardType] + attr_accessor :type + + # The card network or brand. Applies to credit, debit, gift, and payment + # cards. + # @return [CardBrand] + attr_accessor :brand + + # 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-co + # ntrols-the-autocomplete-attribute). + # @return [PortablePostalAddressMediumGrained] + attr_accessor :billing_address + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['number'] = 'number' + @_hash['expiry'] = 'expiry' + @_hash['last_digits'] = 'last_digits' + @_hash['type'] = 'type' + @_hash['brand'] = 'brand' + @_hash['billing_address'] = 'billing_address' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + name + number + expiry + last_digits + type + brand + billing_address + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name: SKIP, number: SKIP, expiry: SKIP, last_digits: SKIP, + type: SKIP, brand: SKIP, billing_address: SKIP) + @name = name unless name == SKIP + @number = number unless number == SKIP + @expiry = expiry unless expiry == SKIP + @last_digits = last_digits unless last_digits == SKIP + @type = type unless type == SKIP + @brand = brand unless brand == SKIP + @billing_address = billing_address unless billing_address == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = hash.key?('name') ? hash['name'] : SKIP + number = hash.key?('number') ? hash['number'] : SKIP + expiry = hash.key?('expiry') ? hash['expiry'] : SKIP + last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP + type = hash.key?('type') ? hash['type'] : SKIP + brand = hash.key?('brand') ? hash['brand'] : SKIP + billing_address = PortablePostalAddressMediumGrained.from_hash(hash['billing_address']) if + hash['billing_address'] + + # Create object from extracted values. + GooglePayCard.new(name: name, + number: number, + expiry: expiry, + last_digits: last_digits, + type: type, + brand: brand, + billing_address: billing_address) + end + end +end diff --git a/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb b/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb index 974d84f..850045e 100644 --- a/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +++ b/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb @@ -24,6 +24,11 @@ class GooglePayDecryptedTokenData < BaseModel # @return [GooglePayPaymentMethod] attr_accessor :payment_method + # The payment card used to fund a Google Pay payment. Can be a credit or + # debit card. + # @return [GooglePayCard] + attr_accessor :card + # Authentication Method which is used for the card transaction. # @return [GooglePayAuthenticationMethod] attr_accessor :authentication_method @@ -46,6 +51,7 @@ def self.names @_hash['message_id'] = 'message_id' @_hash['message_expiration'] = 'message_expiration' @_hash['payment_method'] = 'payment_method' + @_hash['card'] = 'card' @_hash['authentication_method'] = 'authentication_method' @_hash['cryptogram'] = 'cryptogram' @_hash['eci_indicator'] = 'eci_indicator' @@ -67,12 +73,13 @@ def self.nullables [] end - def initialize(payment_method:, authentication_method:, message_id: SKIP, - message_expiration: SKIP, cryptogram: SKIP, + def initialize(payment_method:, card:, authentication_method:, + message_id: SKIP, message_expiration: SKIP, cryptogram: SKIP, eci_indicator: SKIP) @message_id = message_id unless message_id == SKIP @message_expiration = message_expiration unless message_expiration == SKIP @payment_method = payment_method + @card = card @authentication_method = authentication_method @cryptogram = cryptogram unless cryptogram == SKIP @eci_indicator = eci_indicator unless eci_indicator == SKIP @@ -85,6 +92,7 @@ def self.from_hash(hash) # Extract variables from the hash. payment_method = hash.key?('payment_method') ? hash['payment_method'] : nil + card = GooglePayCard.from_hash(hash['card']) if hash['card'] authentication_method = hash.key?('authentication_method') ? hash['authentication_method'] : nil message_id = hash.key?('message_id') ? hash['message_id'] : SKIP @@ -95,6 +103,7 @@ def self.from_hash(hash) # Create object from extracted values. GooglePayDecryptedTokenData.new(payment_method: payment_method, + card: card, authentication_method: authentication_method, message_id: message_id, message_expiration: message_expiration, diff --git a/lib/paypal_server_sdk/models/order.rb b/lib/paypal_server_sdk/models/order.rb index cdb3ed2..74328b5 100644 --- a/lib/paypal_server_sdk/models/order.rb +++ b/lib/paypal_server_sdk/models/order.rb @@ -38,11 +38,13 @@ class Order < BaseModel # @return [CheckoutPaymentIntent] attr_accessor :intent - # The instruction to process an order. - # @return [ProcessingInstruction] + # The intent to either capture payment immediately or authorize a payment + # for an order after order creation. + # @return [Object] attr_accessor :processing_instruction - # The instruction to process an order. + # The intent to either capture payment immediately or authorize a payment + # for an order after order creation. # @return [Payer] attr_accessor :payer @@ -58,10 +60,10 @@ class Order < BaseModel attr_accessor :status # 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 + # 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 3 + # 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 @@ -108,12 +110,10 @@ def self.nullables [] end - def initialize( - create_time: SKIP, update_time: SKIP, id: SKIP, payment_source: SKIP, - intent: SKIP, - processing_instruction: ProcessingInstruction::NO_INSTRUCTION, - payer: SKIP, purchase_units: SKIP, status: SKIP, links: SKIP - ) + def initialize(create_time: SKIP, update_time: SKIP, id: SKIP, + payment_source: SKIP, intent: SKIP, + processing_instruction: SKIP, payer: SKIP, + purchase_units: SKIP, status: SKIP, links: SKIP) @create_time = create_time unless create_time == SKIP @update_time = update_time unless update_time == SKIP @id = id unless id == SKIP @@ -138,7 +138,7 @@ def self.from_hash(hash) hash['payment_source'] intent = hash.key?('intent') ? hash['intent'] : SKIP processing_instruction = - hash['processing_instruction'] ||= ProcessingInstruction::NO_INSTRUCTION + hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP payer = Payer.from_hash(hash['payer']) if hash['payer'] # Parameter is an array, so we need to iterate through it purchase_units = nil diff --git a/lib/paypal_server_sdk/models/order_authorize_response.rb b/lib/paypal_server_sdk/models/order_authorize_response.rb index b7319e2..135f314 100644 --- a/lib/paypal_server_sdk/models/order_authorize_response.rb +++ b/lib/paypal_server_sdk/models/order_authorize_response.rb @@ -38,11 +38,13 @@ class OrderAuthorizeResponse < BaseModel # @return [CheckoutPaymentIntent] attr_accessor :intent - # The instruction to process an order. - # @return [ProcessingInstruction] + # The intent to either capture payment immediately or authorize a payment + # for an order after order creation. + # @return [Object] attr_accessor :processing_instruction - # The instruction to process an order. + # The intent to either capture payment immediately or authorize a payment + # for an order after order creation. # @return [Payer] attr_accessor :payer @@ -101,12 +103,10 @@ def self.nullables [] end - def initialize( - create_time: SKIP, update_time: SKIP, id: SKIP, payment_source: SKIP, - intent: SKIP, - processing_instruction: ProcessingInstruction::NO_INSTRUCTION, - payer: SKIP, purchase_units: SKIP, status: SKIP, links: SKIP - ) + def initialize(create_time: SKIP, update_time: SKIP, id: SKIP, + payment_source: SKIP, intent: SKIP, + processing_instruction: SKIP, payer: SKIP, + purchase_units: SKIP, status: SKIP, links: SKIP) @create_time = create_time unless create_time == SKIP @update_time = update_time unless update_time == SKIP @id = id unless id == SKIP @@ -131,7 +131,7 @@ def self.from_hash(hash) hash['payment_source'] intent = hash.key?('intent') ? hash['intent'] : SKIP processing_instruction = - hash['processing_instruction'] ||= ProcessingInstruction::NO_INSTRUCTION + hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP payer = Payer.from_hash(hash['payer']) if hash['payer'] # Parameter is an array, so we need to iterate through it purchase_units = nil diff --git a/lib/paypal_server_sdk/models/portable_postal_address_medium_grained.rb b/lib/paypal_server_sdk/models/portable_postal_address_medium_grained.rb new file mode 100644 index 0000000..5e83bd3 --- /dev/null +++ b/lib/paypal_server_sdk/models/portable_postal_address_medium_grained.rb @@ -0,0 +1,116 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v2.0 +# ( https://apimatic.io ). + +module PaypalServerSdk + # The portable international postal address. Maps to + # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wi + # ki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the + # autocomplete + # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-cont + # rols-the-autocomplete-attribute). + class PortablePostalAddressMediumGrained < BaseModel + SKIP = Object.new + private_constant :SKIP + + # 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. + # @return [String] + attr_accessor :address_line_1 + + # The second line of the address, for example, a suite or apartment number. + # @return [String] + attr_accessor :address_line_2 + + # A city, town, or village. Smaller than `admin_area_level_1`. + # @return [String] + attr_accessor :admin_area_2 + + # The highest-level sub-division in a country, which is usually a province, + # state, or ISO-3166-2 subdivision. This data is formatted for postal + # delivery, for example, `CA` and not `California`. Value, by country, + # is:
    • UK. A county.
    • US. A state.
    • Canada. A + # province.
    • Japan. A prefecture.
    • Switzerland. A + # *kanton*.
    + # @return [String] + attr_accessor :admin_area_1 + + # The postal code, which is the ZIP code or equivalent. Typically required + # for countries with a postal code or an equivalent. See [postal + # code](https://en.wikipedia.org/wiki/Postal_code). + # @return [String] + attr_accessor :postal_code + + # The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that + # identifies the country or region.
    Note: The + # country code for Great Britain is GB and not UK + # as used in the top-level domain names for that country. Use the `C2` + # country code for China worldwide for comparable uncontrolled price (CUP) + # method, bank card, and cross-border transactions.
    + # @return [String] + attr_accessor :country_code + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['address_line_1'] = 'address_line_1' + @_hash['address_line_2'] = 'address_line_2' + @_hash['admin_area_2'] = 'admin_area_2' + @_hash['admin_area_1'] = 'admin_area_1' + @_hash['postal_code'] = 'postal_code' + @_hash['country_code'] = 'country_code' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + address_line_1 + address_line_2 + admin_area_2 + admin_area_1 + postal_code + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(country_code:, address_line_1: SKIP, address_line_2: SKIP, + admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP) + @address_line_1 = address_line_1 unless address_line_1 == SKIP + @address_line_2 = address_line_2 unless address_line_2 == SKIP + @admin_area_2 = admin_area_2 unless admin_area_2 == SKIP + @admin_area_1 = admin_area_1 unless admin_area_1 == SKIP + @postal_code = postal_code unless postal_code == SKIP + @country_code = country_code + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + country_code = hash.key?('country_code') ? hash['country_code'] : nil + address_line_1 = + hash.key?('address_line_1') ? hash['address_line_1'] : SKIP + address_line_2 = + hash.key?('address_line_2') ? hash['address_line_2'] : SKIP + admin_area_2 = hash.key?('admin_area_2') ? hash['admin_area_2'] : SKIP + admin_area_1 = hash.key?('admin_area_1') ? hash['admin_area_1'] : SKIP + postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP + + # Create object from extracted values. + PortablePostalAddressMediumGrained.new(country_code: country_code, + address_line_1: address_line_1, + address_line_2: address_line_2, + admin_area_2: admin_area_2, + admin_area_1: admin_area_1, + postal_code: postal_code) + end + end +end diff --git a/lib/paypal_server_sdk/models/processing_instruction.rb b/lib/paypal_server_sdk/models/processing_instruction.rb deleted file mode 100644 index 5880ef1..0000000 --- a/lib/paypal_server_sdk/models/processing_instruction.rb +++ /dev/null @@ -1,23 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The instruction to process an order. - class ProcessingInstruction - PROCESSING_INSTRUCTION = [ - # TODO: Write general description for ORDER_COMPLETE_ON_PAYMENT_APPROVAL - ORDER_COMPLETE_ON_PAYMENT_APPROVAL = 'ORDER_COMPLETE_ON_PAYMENT_APPROVAL'.freeze, - - # TODO: Write general description for NO_INSTRUCTION - NO_INSTRUCTION = 'NO_INSTRUCTION'.freeze - ].freeze - - def self.validate(value) - return false if value.nil? - - true - end - end -end diff --git a/lib/paypal_server_sdk/models/shipment_carrier.rb b/lib/paypal_server_sdk/models/shipment_carrier.rb index b995716..27b8e3b 100644 --- a/lib/paypal_server_sdk/models/shipment_carrier.rb +++ b/lib/paypal_server_sdk/models/shipment_carrier.rb @@ -3840,7 +3840,331 @@ class ShipmentCarrier EMS = 'EMS'.freeze, # TODO: Write general description for SPEEDY - SPEEDY = 'SPEEDY'.freeze + SPEEDY = 'SPEEDY'.freeze, + + # TODO: Write general description for ZOOM_RED + ZOOM_RED = 'ZOOM_RED'.freeze, + + # TODO: Write general description for NAVLUNGO + NAVLUNGO = 'NAVLUNGO'.freeze, + + # TODO: Write general description for CASTLEPARCELS + CASTLEPARCELS = 'CASTLEPARCELS'.freeze, + + # TODO: Write general description for WEEE + WEEE = 'WEEE'.freeze, + + # TODO: Write general description for PACKALY + PACKALY = 'PACKALY'.freeze, + + # TODO: Write general description for YUNHUIPOST + YUNHUIPOST = 'YUNHUIPOST'.freeze, + + # TODO: Write general description for YOUPARCEL + YOUPARCEL = 'YOUPARCEL'.freeze, + + # TODO: Write general description for LEMAN + LEMAN = 'LEMAN'.freeze, + + # TODO: Write general description for MOOVIN + MOOVIN = 'MOOVIN'.freeze, + + # TODO: Write general description for URB_IT + URB_IT = 'URB_IT'.freeze, + + # TODO: Write general description for MULTIENTREGAPANAMA + MULTIENTREGAPANAMA = 'MULTIENTREGAPANAMA'.freeze, + + # TODO: Write general description for JUSDASR + JUSDASR = 'JUSDASR'.freeze, + + # TODO: Write general description for DISCOUNTPOST + DISCOUNTPOST = 'DISCOUNTPOST'.freeze, + + # TODO: Write general description for RHENUS_UK + RHENUS_UK = 'RHENUS_UK'.freeze, + + # TODO: Write general description for SWISHIP_JP + SWISHIP_JP = 'SWISHIP_JP'.freeze, + + # TODO: Write general description for GLS_US + GLS_US = 'GLS_US'.freeze, + + # TODO: Write general description for SMTL + SMTL = 'SMTL'.freeze, + + # TODO: Write general description for EMEGA + EMEGA = 'EMEGA'.freeze, + + # TODO: Write general description for EXPRESSONE_SV + EXPRESSONE_SV = 'EXPRESSONE_SV'.freeze, + + # TODO: Write general description for HEPSIJET + HEPSIJET = 'HEPSIJET'.freeze, + + # TODO: Write general description for WELIVERY + WELIVERY = 'WELIVERY'.freeze, + + # TODO: Write general description for BRINGER + BRINGER = 'BRINGER'.freeze, + + # TODO: Write general description for EASYROUTES + EASYROUTES = 'EASYROUTES'.freeze, + + # TODO: Write general description for MRW + MRW = 'MRW'.freeze, + + # TODO: Write general description for RPM + RPM = 'RPM'.freeze, + + # TODO: Write general description for DPD_PRT + DPD_PRT = 'DPD_PRT'.freeze, + + # TODO: Write general description for GLS_ROMANIA + GLS_ROMANIA = 'GLS_ROMANIA'.freeze, + + # TODO: Write general description for LMPARCEL + LMPARCEL = 'LMPARCEL'.freeze, + + # TODO: Write general description for GTAGSM + GTAGSM = 'GTAGSM'.freeze, + + # TODO: Write general description for DOMINO + DOMINO = 'DOMINO'.freeze, + + # TODO: Write general description for ESHIPPER + ESHIPPER = 'ESHIPPER'.freeze, + + # TODO: Write general description for TRANSPAK + TRANSPAK = 'TRANSPAK'.freeze, + + # TODO: Write general description for XINDUS + XINDUS = 'XINDUS'.freeze, + + # TODO: Write general description for AOYUE + AOYUE = 'AOYUE'.freeze, + + # TODO: Write general description for EASYPARCEL + EASYPARCEL = 'EASYPARCEL'.freeze, + + # TODO: Write general description for EXPRESSONE + EXPRESSONE = 'EXPRESSONE'.freeze, + + # TODO: Write general description for SENDEO_KARGO + SENDEO_KARGO = 'SENDEO_KARGO'.freeze, + + # TODO: Write general description for SPEEDAF + SPEEDAF = 'SPEEDAF'.freeze, + + # TODO: Write general description for ETOWER + ETOWER = 'ETOWER'.freeze, + + # TODO: Write general description for GCX + GCX = 'GCX'.freeze, + + # TODO: Write general description for NINJAVAN_VN + NINJAVAN_VN = 'NINJAVAN_VN'.freeze, + + # TODO: Write general description for ALLEGRO + ALLEGRO = 'ALLEGRO'.freeze, + + # TODO: Write general description for JUMPPOINT + JUMPPOINT = 'JUMPPOINT'.freeze, + + # TODO: Write general description for SHIPGLOBAL_US + SHIPGLOBAL_US = 'SHIPGLOBAL_US'.freeze, + + # TODO: Write general description for KINISI + KINISI = 'KINISI'.freeze, + + # TODO: Write general description for OAKH + OAKH = 'OAKH'.freeze, + + # TODO: Write general description for AWEST + AWEST = 'AWEST'.freeze, + + # TODO: Write general description for BARSAN + BARSAN = 'BARSAN'.freeze, + + # TODO: Write general description for ENERGOLOGISTIC + ENERGOLOGISTIC = 'ENERGOLOGISTIC'.freeze, + + # TODO: Write general description for MADROOEX + MADROOEX = 'MADROOEX'.freeze, + + # TODO: Write general description for GOBOLT + GOBOLT = 'GOBOLT'.freeze, + + # TODO: Write general description for SWISS_UNIVERSAL_EXPRESS + SWISS_UNIVERSAL_EXPRESS = 'SWISS_UNIVERSAL_EXPRESS'.freeze, + + # TODO: Write general description for IORDIRECT + IORDIRECT = 'IORDIRECT'.freeze, + + # TODO: Write general description for XMSZM + XMSZM = 'XMSZM'.freeze, + + # TODO: Write general description for GLS_HUN + GLS_HUN = 'GLS_HUN'.freeze, + + # TODO: Write general description for SENDY + SENDY = 'SENDY'.freeze, + + # TODO: Write general description for BRAUNSEXPRESS + BRAUNSEXPRESS = 'BRAUNSEXPRESS'.freeze, + + # TODO: Write general description for GRANDSLAMEXPRESS + GRANDSLAMEXPRESS = 'GRANDSLAMEXPRESS'.freeze, + + # TODO: Write general description for XGS + XGS = 'XGS'.freeze, + + # TODO: Write general description for OTSCHILE + OTSCHILE = 'OTSCHILE'.freeze, + + # TODO: Write general description for PACK_UP + PACK_UP = 'PACK_UP'.freeze, + + # TODO: Write general description for PARCELSTARS + PARCELSTARS = 'PARCELSTARS'.freeze, + + # TODO: Write general description for TEAMEXPRESSLLC + TEAMEXPRESSLLC = 'TEAMEXPRESSLLC'.freeze, + + # TODO: Write general description for ASYADEXPRESS + ASYADEXPRESS = 'ASYADEXPRESS'.freeze, + + # TODO: Write general description for TDN + TDN = 'TDN'.freeze, + + # TODO: Write general description for EARLYBIRD + EARLYBIRD = 'EARLYBIRD'.freeze, + + # TODO: Write general description for CACESA + CACESA = 'CACESA'.freeze, + + # TODO: Write general description for PARCELJET + PARCELJET = 'PARCELJET'.freeze, + + # TODO: Write general description for MNG_KARGO + MNG_KARGO = 'MNG_KARGO'.freeze, + + # TODO: Write general description for SUPERPACKLINE + SUPERPACKLINE = 'SUPERPACKLINE'.freeze, + + # TODO: Write general description for SPEEDX + SPEEDX = 'SPEEDX'.freeze, + + # TODO: Write general description for VESYL + VESYL = 'VESYL'.freeze, + + # TODO: Write general description for SKYKING + SKYKING = 'SKYKING'.freeze, + + # TODO: Write general description for DIRMENSAJERIA + DIRMENSAJERIA = 'DIRMENSAJERIA'.freeze, + + # TODO: Write general description for NETLOGIXGROUP + NETLOGIXGROUP = 'NETLOGIXGROUP'.freeze, + + # TODO: Write general description for ZYOU + ZYOU = 'ZYOU'.freeze, + + # TODO: Write general description for JAWAR + JAWAR = 'JAWAR'.freeze, + + # TODO: Write general description for AGSYSTEMS + AGSYSTEMS = 'AGSYSTEMS'.freeze, + + # TODO: Write general description for GPS + GPS = 'GPS'.freeze, + + # TODO: Write general description for PTT_KARGO + PTT_KARGO = 'PTT_KARGO'.freeze, + + # TODO: Write general description for MAERGO + MAERGO = 'MAERGO'.freeze, + + # TODO: Write general description for ARIHANTCOURIER + ARIHANTCOURIER = 'ARIHANTCOURIER'.freeze, + + # TODO: Write general description for VTFE + VTFE = 'VTFE'.freeze, + + # TODO: Write general description for YUNANT + YUNANT = 'YUNANT'.freeze, + + # TODO: Write general description for URBIFY + URBIFY = 'URBIFY'.freeze, + + # TODO: Write general description for PACK_MAN + PACK_MAN = 'PACK_MAN'.freeze, + + # TODO: Write general description for LIEFERGRUN + LIEFERGRUN = 'LIEFERGRUN'.freeze, + + # TODO: Write general description for OBIBOX + OBIBOX = 'OBIBOX'.freeze, + + # TODO: Write general description for PAIKEDA + PAIKEDA = 'PAIKEDA'.freeze, + + # TODO: Write general description for SCOTTY + SCOTTY = 'SCOTTY'.freeze, + + # TODO: Write general description for INTELCOM_CA + INTELCOM_CA = 'INTELCOM_CA'.freeze, + + # TODO: Write general description for SWE + SWE = 'SWE'.freeze, + + # TODO: Write general description for ASENDIA + ASENDIA = 'ASENDIA'.freeze, + + # TODO: Write general description for DPD_AT + DPD_AT = 'DPD_AT'.freeze, + + # TODO: Write general description for RELAY + RELAY = 'RELAY'.freeze, + + # TODO: Write general description for ATA + ATA = 'ATA'.freeze, + + # TODO: Write general description for SKYEXPRESS_INTERNATIONAL + SKYEXPRESS_INTERNATIONAL = 'SKYEXPRESS_INTERNATIONAL'.freeze, + + # TODO: Write general description for SURAT_KARGO + SURAT_KARGO = 'SURAT_KARGO'.freeze, + + # TODO: Write general description for SGLINK + SGLINK = 'SGLINK'.freeze, + + # TODO: Write general description for FLEETOPTICSINC + FLEETOPTICSINC = 'FLEETOPTICSINC'.freeze, + + # TODO: Write general description for SHOPLINE + SHOPLINE = 'SHOPLINE'.freeze, + + # TODO: Write general description for PIGGYSHIP + PIGGYSHIP = 'PIGGYSHIP'.freeze, + + # TODO: Write general description for LOGOIX + LOGOIX = 'LOGOIX'.freeze, + + # TODO: Write general description for KOLAY_GELSIN + KOLAY_GELSIN = 'KOLAY_GELSIN'.freeze, + + # TODO: Write general description for ASSOCIATED_COURIERS + ASSOCIATED_COURIERS = 'ASSOCIATED_COURIERS'.freeze, + + # TODO: Write general description for UPS_CHECKER + UPS_CHECKER = 'UPS_CHECKER'.freeze, + + # TODO: Write general description for WINESHIPPING + WINESHIPPING = 'WINESHIPPING'.freeze, + + # TODO: Write general description for SPEDISCI + SPEDISCI = 'SPEDISCI'.freeze ].freeze def self.validate(value) diff --git a/lib/paypal_server_sdk/models/shipping_details.rb b/lib/paypal_server_sdk/models/shipping_details.rb index e3cac20..979c02f 100644 --- a/lib/paypal_server_sdk/models/shipping_details.rb +++ b/lib/paypal_server_sdk/models/shipping_details.rb @@ -21,7 +21,7 @@ class ShippingDetails < BaseModel # 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. - # @return [FullfillmentType] + # @return [FulfillmentType] attr_accessor :type # An array of shipping options that the payee or merchant offers to the diff --git a/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb b/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb index c0f2c09..2fad5c2 100644 --- a/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +++ b/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb @@ -21,7 +21,7 @@ class ShippingWithTrackingDetails < BaseModel # 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. - # @return [FullfillmentType] + # @return [FulfillmentType] attr_accessor :type # An array of shipping options that the payee or merchant offers to the diff --git a/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb b/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb index fcf6e90..650e04c 100644 --- a/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +++ b/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb @@ -16,7 +16,7 @@ class VaultedDigitalWalletShippingDetails < BaseModel # 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. - # @return [FullfillmentType] + # @return [FulfillmentType] attr_accessor :type # The portable international postal address. Maps to diff --git a/paypal_server_sdk.gemspec b/paypal_server_sdk.gemspec index eef0dd0..a706933 100644 --- a/paypal_server_sdk.gemspec +++ b/paypal_server_sdk.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'paypal-server-sdk' - s.version = '0.6.0' + s.version = '0.6.1' s.summary = 'PayPal\'s SDK for interacting with the REST APIs' s.description = '' s.authors = ['PayPal']