diff --git a/.rubocop.yml b/.rubocop.yml index b563c46..7e659c7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,10 @@ Metrics/PerceivedComplexity: Layout/EndOfLine: Enabled: false + +Layout/EmptyLines: + Enabled: false + Lint/UnderscorePrefixedVariableName: Enabled: false diff --git a/README.md b/README.md index 1b1f13f..e28815f 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,16 @@ The PayPal Server SDK provides integration access to the PayPal REST APIs. The A Install the gem from the command line: ```bash -gem install paypal-server-sdk -v 2.3.0 +gem install paypal-server-sdk -v 2.4.0 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'paypal-server-sdk', '2.3.0' +gem 'paypal-server-sdk', '2.4.0' ``` -For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/2.3.0). +For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/2.4.0). ## IRB Console Usage @@ -70,13 +70,13 @@ ruby bin/console ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| environment | [`Environment`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/README.md#environments) | The API environment.
**Default: `Environment.SANDBOX`** | +| environment | [`Environment`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/README.md#environments) | The API environment.
**Default: `Environment.SANDBOX`** | | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | | timeout | `Float` | The value to use for connection timeout.
**Default: 60** | @@ -86,9 +86,9 @@ 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. | -| proxy_settings | [`ProxySettings`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | -| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | -| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | +| proxy_settings | [`ProxySettings`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | +| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | The API client can be initialized as follows: @@ -126,7 +126,7 @@ include PaypalServerSdk client = Client.from_env ``` -See the [`Environment-Based Client Initialization`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/environment-based-client-initialization.md) section for details. +See the [`Environment-Based Client Initialization`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -143,35 +143,35 @@ 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/2.3.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/2.4.0/doc/auth/oauth-2-client-credentials-grant.md) ## List of APIs -* [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/controllers/orders.md) -* [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/controllers/payments.md) -* [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/controllers/vault.md) -* [Transaction Search](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/controllers/transaction-search.md) -* [Subscriptions](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/controllers/subscriptions.md) +* [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/controllers/orders.md) +* [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/controllers/payments.md) +* [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/controllers/vault.md) +* [Transaction Search](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/controllers/transaction-search.md) +* [Subscriptions](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/controllers/subscriptions.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/environment-based-client-initialization.md) -* [AbstractLogger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/abstract-logger.md) -* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/logging-configuration.md) -* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/request-logging-configuration.md) -* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/response-logging-configuration.md) +* [ProxySettings](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/environment-based-client-initialization.md) +* [AbstractLogger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/abstract-logger.md) +* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/logging-configuration.md) +* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/request-logging-configuration.md) +* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/response-logging-configuration.md) ### HTTP -* [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/http-request.md) ### Utilities -* [ApiResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/api-response.md) -* [ApiHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/api-helper.md) -* [DateTimeHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.3.0/doc/date-time-helper.md) +* [ApiResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/api-response.md) +* [ApiHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/api-helper.md) +* [DateTimeHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/doc/date-time-helper.md) diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index 07277fa..8fc59c4 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -13,11 +13,11 @@ The activate subscription request details. | --- | --- | --- | --- | | `reason` | `String` | Optional | The reason for activation of a subscription. Required to reactivate the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason4" -} +```ruby +activate_subscription_request = ActivateSubscriptionRequest.new( + reason: 'reason4' +) ``` diff --git a/doc/models/activity-timestamps.md b/doc/models/activity-timestamps.md index bca4da7..f87bf72 100644 --- a/doc/models/activity-timestamps.md +++ b/doc/models/activity-timestamps.md @@ -14,12 +14,12 @@ The date and time stamps that are common to authorized payment, captured payment | `create_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})$` | | `update_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})$` | -## Example (as JSON) +## Example -```json -{ - "create_time": "create_time2", - "update_time": "update_time2" -} +```ruby +activity_timestamps = ActivityTimestamps.new( + create_time: 'create_time8', + update_time: 'update_time4' +) ``` diff --git a/doc/models/address.md b/doc/models/address.md index 782b3a7..59a7641 100644 --- a/doc/models/address.md +++ b/doc/models/address.md @@ -18,16 +18,16 @@ The portable international postal address. Maps to [AddressValidationMetadata](h | `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](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

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

**Constraints**: *Maximum Length*: `32`, *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | | `breakdown` | [`AmountBreakdown`](../../doc/models/amount-breakdown.md) | Optional | The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. | -## Example (as JSON) - -```json -{ - "currency_code": "currency_code4", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } -} +## Example + +```ruby +amount_with_breakdown = AmountWithBreakdown.new( + currency_code: 'currency_code0', + value: 'value6', + breakdown: AmountBreakdown.new( + item_total: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + shipping: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + handling: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + tax_total: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + insurance: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) + ) +) ``` diff --git a/doc/models/app-switch-context.md b/doc/models/app-switch-context.md index 6d273d6..1643cf8 100644 --- a/doc/models/app-switch-context.md +++ b/doc/models/app-switch-context.md @@ -14,18 +14,14 @@ Merchant provided details of the native app or mobile web browser to facilitate | `native_app` | [`NativeAppContext`](../../doc/models/native-app-context.md) | Optional | Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. | | `mobile_web` | [`MobileWebContext`](../../doc/models/mobile-web-context.md) | Optional | Buyer's mobile web browser context to app switch to the PayPal consumer app. | -## Example (as JSON) - -```json -{ - "native_app": { - "os_type": "IOS", - "os_version": "os_version0" - }, - "mobile_web": { - "return_flow": "AUTO", - "buyer_user_agent": "buyer_user_agent8" - } -} +## Example + +```ruby +app_switch_context = AppSwitchContext.new( + native_app: NativeAppContext.new, + mobile_web: MobileWebContext.new( + buyer_user_agent: 'buyer_user_agent8' + ) +) ``` diff --git a/doc/models/apple-pay-attributes-response.md b/doc/models/apple-pay-attributes-response.md index f0f3930..30507c6 100644 --- a/doc/models/apple-pay-attributes-response.md +++ b/doc/models/apple-pay-attributes-response.md @@ -13,28 +13,21 @@ Additional attributes associated with the use of Apple Pay. | --- | --- | --- | --- | | `vault` | [`VaultResponse`](../../doc/models/vault-response.md) | Optional | The details about a saved payment source. | -## Example (as JSON) - -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] - } -} +## Example + +```ruby +apple_pay_attributes_response = ApplePayAttributesResponse.new( + vault: VaultResponse.new( + id: 'id6', + status: VaultStatus::APPROVED, + customer: VaultCustomer.new( + id: 'id0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ) + ) +) ``` diff --git a/doc/models/apple-pay-attributes.md b/doc/models/apple-pay-attributes.md index 796357d..ad7663a 100644 --- a/doc/models/apple-pay-attributes.md +++ b/doc/models/apple-pay-attributes.md @@ -14,27 +14,27 @@ Additional attributes associated with apple pay. | `customer` | [`CustomerInformation`](../../doc/models/customer-information.md) | Optional | This object represents a merchant’s customer, allowing them to store contact details, and track all payments associated with the same customer. | | `vault` | [`VaultInstruction`](../../doc/models/vault-instruction.md) | Optional | Base vaulting specification. The object can be extended for specific use cases within each payment_source that supports vaulting. | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "vault": { - "store_in_vault": "ON_SUCCESS" - } -} +## Example + +```ruby +apple_pay_attributes = ApplePayAttributes.new( + customer: CustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ), + vault: VaultInstruction.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS + ) +) ``` diff --git a/doc/models/apple-pay-card-response.md b/doc/models/apple-pay-card-response.md index a697544..0e2398d 100644 --- a/doc/models/apple-pay-card-response.md +++ b/doc/models/apple-pay-card-response.md @@ -25,17 +25,13 @@ The Card from Apple Pay Wallet used to fund the payment. | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `country_code` | `String` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | -## Example (as JSON) - -```json -{ - "name": "name4", - "last_digits": "last_digits8", - "brand": "ACCEL", - "available_networks": [ - "STAR_ACCESS" - ], - "type": "DEBIT" -} +## Example + +```ruby +apple_pay_card_response = ApplePayCardResponse.new( + name: 'name0', + brand: CardBrand::CARTE_BANCAIRE, + type: CardType::CREDIT +) ``` diff --git a/doc/models/apple-pay-card.md b/doc/models/apple-pay-card.md index b6b788c..0696619 100644 --- a/doc/models/apple-pay-card.md +++ b/doc/models/apple-pay-card.md @@ -17,22 +17,21 @@ The payment card to be used to fund a payment. Can be a credit or debit card. | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "name": "name4", - "last_digits": "last_digits8", - "type": "UNKNOWN", - "brand": "SWITCH", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } -} +## Example + +```ruby +apple_pay_card = ApplePayCard.new( + name: 'name6', + type: CardType::DEBIT, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) +) ``` diff --git a/doc/models/apple-pay-decrypted-token-data.md b/doc/models/apple-pay-decrypted-token-data.md index 154601c..72efd4a 100644 --- a/doc/models/apple-pay-decrypted-token-data.md +++ b/doc/models/apple-pay-decrypted-token-data.md @@ -17,29 +17,28 @@ Information about the Payment data obtained by decrypting Apple Pay token. | `payment_data_type` | [`ApplePayPaymentDataType`](../../doc/models/apple-pay-payment-data-type.md) | Optional | Indicates the type of payment data passed, in case of Non China the payment data is 3DSECURE and for China it is EMV.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" -} +## Example + +```ruby +apple_pay_payment_data = ApplePayPaymentData.new( + cryptogram: 'cryptogram2', + eci_indicator: 'eci_indicator6', + emv_data: 'emv_data6', + pin: 'pin0' +) ``` diff --git a/doc/models/apple-pay-payment-object.md b/doc/models/apple-pay-payment-object.md index d976219..f5e6708 100644 --- a/doc/models/apple-pay-payment-object.md +++ b/doc/models/apple-pay-payment-object.md @@ -20,17 +20,17 @@ Information needed to pay using ApplePay. | `attributes` | [`ApplePayAttributesResponse`](../../doc/models/apple-pay-attributes-response.md) | Optional | Additional attributes associated with the use of Apple Pay. | | `stored_credential` | [`CardStoredCredential`](../../doc/models/card-stored-credential.md) | Optional | Provides additional details to process a payment using a `card` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. | -## Example (as JSON) - -```json -{ - "id": "id6", - "token": "token0", - "name": "name6", - "email_address": "email_address4", - "phone_number": { - "national_number": "national_number6" - } -} +## Example + +```ruby +apple_pay_payment_object = ApplePayPaymentObject.new( + id: 'id0', + token: 'token6', + name: 'name0', + email_address: 'email_address2', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ) +) ``` diff --git a/doc/models/apple-pay-payment-token.md b/doc/models/apple-pay-payment-token.md index 6acc8bc..57e101a 100644 --- a/doc/models/apple-pay-payment-token.md +++ b/doc/models/apple-pay-payment-token.md @@ -13,24 +13,23 @@ A resource representing a response for Apple Pay. | --- | --- | --- | --- | | `card` | [`ApplePayCard`](../../doc/models/apple-pay-card.md) | Optional | The payment card to be used to fund a payment. Can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } -} +## Example + +```ruby +apple_pay_payment_token = ApplePayPaymentToken.new( + card: ApplePayCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) +) ``` diff --git a/doc/models/apple-pay-request-card.md b/doc/models/apple-pay-request-card.md index 3c5b0fa..e104f87 100644 --- a/doc/models/apple-pay-request-card.md +++ b/doc/models/apple-pay-request-card.md @@ -15,20 +15,20 @@ The payment card to be used to fund a payment. Can be a credit or debit card. | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "type": "PREPAID", - "brand": "PULSE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } -} +## Example + +```ruby +apple_pay_request_card = ApplePayRequestCard.new( + type: CardType::DEBIT, + brand: CardBrand::SWITCH, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) +) ``` diff --git a/doc/models/apple-pay-request.md b/doc/models/apple-pay-request.md index ea54d1a..15ce5d3 100644 --- a/doc/models/apple-pay-request.md +++ b/doc/models/apple-pay-request.md @@ -21,37 +21,36 @@ Information needed to pay using ApplePay. | `attributes` | [`ApplePayAttributes`](../../doc/models/apple-pay-attributes.md) | Optional | Additional attributes associated with apple pay. | | `experience_context` | [`ApplePayExperienceContext`](../../doc/models/apple-pay-experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "id": "id6", - "name": "name6", - "email_address": "email_address4", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } -} +## Example + +```ruby +apple_pay_request = ApplePayRequest.new( + id: 'id0', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + decrypted_token: ApplePayDecryptedTokenData.new( + tokenized_card: ApplePayTokenizedCard.new( + name: 'name4', + number: 'number2', + expiry: 'expiry2', + type: CardType::UNKNOWN + ), + transaction_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + device_manufacturer_id: 'device_manufacturer_id6', + payment_data_type: ApplePayPaymentDataType::ENUM_3DSECURE, + payment_data: ApplePayPaymentData.new( + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0', + emv_data: 'emv_data0', + pin: 'pin4' + ) + ) +) ``` diff --git a/doc/models/apple-pay-tokenized-card.md b/doc/models/apple-pay-tokenized-card.md index fae5eae..bf1be62 100644 --- a/doc/models/apple-pay-tokenized-card.md +++ b/doc/models/apple-pay-tokenized-card.md @@ -19,15 +19,14 @@ The payment card to use to fund a payment. Can be a credit or debit card. | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "name": "name8", - "number": "number6", - "expiry": "expiry6", - "card_type": "SOLO", - "type": "STORE" -} +## Example + +```ruby +apple_pay_tokenized_card = ApplePayTokenizedCard.new( + name: 'name2', + number: 'number0', + expiry: 'expiry0', + type: CardType::STORE +) ``` diff --git a/doc/models/application-context-user-action.md b/doc/models/application-context-user-action.md index f6595f7..d02f879 100644 --- a/doc/models/application-context-user-action.md +++ b/doc/models/application-context-user-action.md @@ -14,3 +14,9 @@ Configures the label name to `Continue` or `Subscribe Now` for subscription cons | `CONTINUE` | After you redirect the customer to the PayPal subscription consent page, a Continue button appears. Use this option when you want to control the activation of the subscription and do not want PayPal to activate the subscription. | | `SUBSCRIBE_NOW` | After you redirect the customer to the PayPal subscription consent page, a Subscribe Now button appears. Use this option when you want PayPal to activate the subscription. | +## Example + +```ruby +application_context_user_action = ApplicationContextUserAction::CONTINUE +``` + diff --git a/doc/models/assurance-details.md b/doc/models/assurance-details.md index 21730c1..b961501 100644 --- a/doc/models/assurance-details.md +++ b/doc/models/assurance-details.md @@ -14,12 +14,12 @@ Information about cardholder possession validation and cardholder identification | `account_verified` | `TrueClass \| FalseClass` | Optional | If true, indicates that Cardholder possession validation has been performed on returned payment credential.

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

**Default**: `false` | -## Example (as JSON) +## Example -```json -{ - "account_verified": false, - "card_holder_authenticated": false -} +```ruby +assurance_details = AssuranceDetails.new( + account_verified: false, + card_holder_authenticated: false +) ``` diff --git a/doc/models/auction-information.md b/doc/models/auction-information.md index 3b9c239..e5b42e1 100644 --- a/doc/models/auction-information.md +++ b/doc/models/auction-information.md @@ -16,14 +16,14 @@ The auction information. | `auction_buyer_id` | `String` | Optional | The ID of the buyer who makes the purchase in the auction. This ID might be different from the payer ID provided for the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | | `auction_closing_date` | `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})$` | -## Example (as JSON) - -```json -{ - "auction_site": "auction_site6", - "auction_item_site": "auction_item_site8", - "auction_buyer_id": "auction_buyer_id0", - "auction_closing_date": "auction_closing_date0" -} +## Example + +```ruby +auction_information = AuctionInformation.new( + auction_site: 'auction_site0', + auction_item_site: 'auction_item_site2', + auction_buyer_id: 'auction_buyer_id4', + auction_closing_date: 'auction_closing_date6' +) ``` diff --git a/doc/models/authentication-response.md b/doc/models/authentication-response.md index 97ba9d9..20310da 100644 --- a/doc/models/authentication-response.md +++ b/doc/models/authentication-response.md @@ -14,15 +14,15 @@ Results of Authentication such as 3D Secure. | `liability_shift` | [`LiabilityShiftIndicator`](../../doc/models/liability-shift-indicator.md) | Optional | Liability shift indicator. The outcome of the issuer's authentication.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "reason": "PENDING_REVIEW" -} +```ruby +authorization_status_details = AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW +) ``` diff --git a/doc/models/authorization-status-with-details.md b/doc/models/authorization-status-with-details.md index 4d43b9d..78dfd06 100644 --- a/doc/models/authorization-status-with-details.md +++ b/doc/models/authorization-status-with-details.md @@ -14,14 +14,13 @@ The status fields and status details for an authorized payment. | `status` | [`AuthorizationStatus`](../../doc/models/authorization-status.md) | Optional, Read-only | The status for the authorized payment. | | `status_details` | [`AuthorizationStatusDetails`](../../doc/models/authorization-status-details.md) | Optional | The details of the authorized payment status. | -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "status_details": { - "reason": "PENDING_REVIEW" - } -} +## Example + +```ruby +authorization_status_with_details = AuthorizationStatusWithDetails.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ) +) ``` diff --git a/doc/models/authorization-status.md b/doc/models/authorization-status.md index 3f9fe70..adff44a 100644 --- a/doc/models/authorization-status.md +++ b/doc/models/authorization-status.md @@ -18,3 +18,9 @@ The status for the authorized payment. | `VOIDED` | The authorized payment was voided. No more captured payments can be made against this authorized payment. | | `PENDING` | The created authorization is in pending state. For more information, see status.details. | +## Example + +```ruby +authorization_status = AuthorizationStatus::VOIDED +``` + diff --git a/doc/models/authorization-with-additional-data.md b/doc/models/authorization-with-additional-data.md index 2c478f8..580fdc6 100644 --- a/doc/models/authorization-with-additional-data.md +++ b/doc/models/authorization-with-additional-data.md @@ -25,20 +25,17 @@ The authorization with additional payment details, such as risk assessment and p | `update_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})$` | | `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id6" -} +## Example + +```ruby +authorization_with_additional_data = AuthorizationWithAdditionalData.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/authorization.md b/doc/models/authorization.md index dbf1228..e7ffaa9 100644 --- a/doc/models/authorization.md +++ b/doc/models/authorization.md @@ -24,20 +24,17 @@ The authorized payment transaction. | `create_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})$` | | `update_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})$` | -## Example (as JSON) - -```json -{ - "status": "CREATED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id8", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id8" -} +## Example + +```ruby +authorization = Authorization.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/avs-code.md b/doc/models/avs-code.md index b2d176c..462af80 100644 --- a/doc/models/avs-code.md +++ b/doc/models/avs-code.md @@ -36,3 +36,9 @@ The address verification code for Visa, Discover, Mastercard, or American Expres | `AVS_3` | For Maestro, the merchant did not provide AVS information. It was not processed. | | `AVS_4` | For Maestro, the address was not checked or the acquirer had no response. The service is not available. | +## Example + +```ruby +avs_code = AvsCode::AVS_W +``` + diff --git a/doc/models/balance-information.md b/doc/models/balance-information.md index 26a1ffb..780a1e8 100644 --- a/doc/models/balance-information.md +++ b/doc/models/balance-information.md @@ -17,24 +17,24 @@ The Balance information. | `available_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `withheld_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "currency": "currency4", - "primary": false, - "total_balance": { - "currency_code": "currency_code6", - "value": "value2" - }, - "available_balance": { - "currency_code": "currency_code8", - "value": "value4" - }, - "withheld_balance": { - "currency_code": "currency_code2", - "value": "value8" - } -} +## Example + +```ruby +balance_information = BalanceInformation.new( + currency: 'currency8', + total_balance: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + primary: false, + available_balance: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + withheld_balance: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) +) ``` diff --git a/doc/models/balances-response.md b/doc/models/balances-response.md index c03b085..b381a9a 100644 --- a/doc/models/balances-response.md +++ b/doc/models/balances-response.md @@ -16,63 +16,47 @@ The balances response information. | `as_of_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})$` | | `last_refresh_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})$` | -## Example (as JSON) - -```json -{ - "balances": [ - { - "currency": "currency0", - "primary": false, - "total_balance": { - "currency_code": "currency_code6", - "value": "value2" - }, - "available_balance": { - "currency_code": "currency_code8", - "value": "value4" - }, - "withheld_balance": { - "currency_code": "currency_code2", - "value": "value8" - } - }, - { - "currency": "currency0", - "primary": false, - "total_balance": { - "currency_code": "currency_code6", - "value": "value2" - }, - "available_balance": { - "currency_code": "currency_code8", - "value": "value4" - }, - "withheld_balance": { - "currency_code": "currency_code2", - "value": "value8" - } - }, - { - "currency": "currency0", - "primary": false, - "total_balance": { - "currency_code": "currency_code6", - "value": "value2" - }, - "available_balance": { - "currency_code": "currency_code8", - "value": "value4" - }, - "withheld_balance": { - "currency_code": "currency_code2", - "value": "value8" - } - } +## Example + +```ruby +balances_response = BalancesResponse.new( + balances: [ + BalanceInformation.new( + currency: 'currency0', + total_balance: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + primary: false, + available_balance: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + withheld_balance: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) + ), + BalanceInformation.new( + currency: 'currency0', + total_balance: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + primary: false, + available_balance: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + withheld_balance: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) + ) ], - "account_id": "account_id0", - "as_of_time": "as_of_time2", - "last_refresh_time": "last_refresh_time0" -} + account_id: 'account_id2', + as_of_time: 'as_of_time0', + last_refresh_time: 'last_refresh_time2' +) ``` diff --git a/doc/models/bancontact-payment-object.md b/doc/models/bancontact-payment-object.md index 057cee2..8f7cf42 100644 --- a/doc/models/bancontact-payment-object.md +++ b/doc/models/bancontact-payment-object.md @@ -17,15 +17,15 @@ Information used to pay Bancontact. | `iban_last_chars` | `String` | Optional | The last characters of the IBAN used to pay.

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

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +bancontact_payment_request = BancontactPaymentRequest.new( + name: 'name6', + country_code: 'country_code6', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/bank-request.md b/doc/models/bank-request.md index 2b4e789..e4194e7 100644 --- a/doc/models/bank-request.md +++ b/doc/models/bank-request.md @@ -14,21 +14,18 @@ A Resource representing a request to vault a Bank used for ACH Debit. | `ach_debit` | `Object` | Optional | A Resource representing a request to vault a ACH Debit. | | `sepa_debit` | [`SepaDebitRequest`](../../doc/models/sepa-debit-request.md) | Optional | An API resource denoting a request to securely store a SEPA Debit. | -## Example (as JSON) - -```json -{ - "ach_debit": { - "key1": "val1", - "key2": "val2" - }, - "sepa_debit": { - "experience_context": { - "locale": "locale6", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - } -} +## Example + +```ruby +bank_request = BankRequest.new( + ach_debit: JSON.parse('{"key1":"val1","key2":"val2"}'), + sepa_debit: SepaDebitRequest.new( + experience_context: SepaDebitExperienceContext.new( + return_url: 'return_url4', + cancel_url: 'cancel_url6', + locale: 'locale6' + ) + ) +) ``` diff --git a/doc/models/billing-cycle-override.md b/doc/models/billing-cycle-override.md index e863aa4..35aeb19 100644 --- a/doc/models/billing-cycle-override.md +++ b/doc/models/billing-cycle-override.md @@ -15,47 +15,46 @@ The billing cycle details to override at subscription level. The subscription bi | `sequence` | `Integer` | Required | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Constraints**: `>= 1`, `<= 99` | | `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Constraints**: `>= 0`, `<= 999` | -## Example (as JSON) - -```json -{ - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +## Example + +```ruby +billing_cycle_override = BillingCycleOverride.new( + sequence: 99, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - }, - "sequence": 58, - "total_cycles": 248 -} + create_time: 'create_time4' + ), + total_cycles: 118 +) ``` diff --git a/doc/models/billing-cycle.md b/doc/models/billing-cycle.md index a6348fb..bec4fec 100644 --- a/doc/models/billing-cycle.md +++ b/doc/models/billing-cycle.md @@ -16,26 +16,31 @@ The billing cycle providing details of the billing frequency, amount, duration a | `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | | `sequence` | `Integer` | Optional | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Default**: `1`

**Constraints**: `>= 1`, `<= 3` | | `start_date` | `String` | Optional | The stand-alone date, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard `date_time` type. This regular expression does not validate all dates. For example, February 31 is valid and nothing is known about leap years.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `10`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])$` | - -## Example (as JSON) - -```json -{ - "tenure_type": "REGULAR", - "total_cycles": 1, - "sequence": 1, - "pricing_scheme": { - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "AUTO_RELOAD", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - "start_date": "start_date0" -} +| `frequency` | [`CycleFrequency`](../../doc/models/cycle-frequency.md) | Optional | The frequency of the terms reset cycle. | + +## Example + +```ruby +billing_cycle = BillingCycle.new( + tenure_type: TenureType::REGULAR, + pricing_scheme: PricingScheme.new( + pricing_model: PricingModel::AUTO_RELOAD, + price: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + reload_threshold_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ) + ), + total_cycles: 1, + sequence: 1, + start_date: 'start_date2', + frequency: CycleFrequency.new( + interval_unit: FrequencyIntervalUnit::LIFETIME, + interval_count: 94 + ) +) ``` diff --git a/doc/models/billing-plan.md b/doc/models/billing-plan.md index a606382..cb798fb 100644 --- a/doc/models/billing-plan.md +++ b/doc/models/billing-plan.md @@ -25,16 +25,15 @@ The plan details. | `update_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})$` | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "quantity_supported": false, - "id": "id0", - "product_id": "product_id4", - "name": "name0", - "status": "CREATED", - "description": "description0" -} +## Example + +```ruby +billing_plan = BillingPlan.new( + product_id: 'product_id4', + name: 'name8', + status: SubscriptionPlanStatus::CREATED, + description: 'description8', + quantity_supported: false +) ``` diff --git a/doc/models/bin-details.md b/doc/models/bin-details.md index 21b9b95..0203501 100644 --- a/doc/models/bin-details.md +++ b/doc/models/bin-details.md @@ -16,18 +16,16 @@ Bank Identification Number (BIN) details used to fund a payment. | `bin_country_code` | `String` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255` | -## Example (as JSON) - -```json -{ - "bin": "bin0", - "issuing_bank": "issuing_bank0", - "bin_country_code": "bin_country_code4", - "products": [ - "products8", - "products9", - "products0" +## Example + +```ruby +bin_details = BinDetails.new( + bin: 'bin4', + issuing_bank: 'issuing_bank4', + bin_country_code: 'bin_country_code8', + products: [ + 'products2' ] -} +) ``` diff --git a/doc/models/blik-experience-context.md b/doc/models/blik-experience-context.md index 73e363e..02689c0 100644 --- a/doc/models/blik-experience-context.md +++ b/doc/models/blik-experience-context.md @@ -19,15 +19,15 @@ Customizes the payer experience during the approval process for the BLIK payment | `consumer_ip` | `String` | Optional | An Internet Protocol address (IP address). This address assigns a numerical label to each device that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6 addresses.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `39`, *Pattern*: `^(([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])\.){3}([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])$\|^(([a-zA-Z]\|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]\|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$\|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}\|:))\|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}\|((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})\|:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})\|((:[0-9A-Fa-f]{1,4})?:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})\|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})\|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})\|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(:(((:[0-9A-Fa-f]{1,4}){1,7})\|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:)))(%.+)?\s*$` | | `consumer_user_agent` | `String` | Optional | The payer's User Agent. For example, Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0).

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

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `19`, *Pattern*: `^[0-9]+$` | -## Example (as JSON) - -```json -{ - "auth_code": "auth_code8", - "consumer_reference": "consumer_reference6", - "alias_label": "alias_label2", - "alias_key": "alias_key6" -} +## Example + +```ruby +blik_one_click_payment_request = BlikOneClickPaymentRequest.new( + consumer_reference: 'consumer_reference6', + auth_code: 'auth_code8', + alias_label: 'alias_label2', + alias_key: 'alias_key6' +) ``` diff --git a/doc/models/blik-payment-object.md b/doc/models/blik-payment-object.md index 13e7193..cf6c080 100644 --- a/doc/models/blik-payment-object.md +++ b/doc/models/blik-payment-object.md @@ -16,16 +16,16 @@ Information used to pay using BLIK. | `email` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | | `one_click` | [`BlikOneClickPaymentObject`](../../doc/models/blik-one-click-payment-object.md) | Optional | Information used to pay using BLIK one-click flow. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "email": "email8", - "one_click": { - "consumer_reference": "consumer_reference2" - } -} +## Example + +```ruby +blik_payment_object = BlikPaymentObject.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + one_click: BlikOneClickPaymentObject.new( + consumer_reference: 'consumer_reference2' + ) +) ``` diff --git a/doc/models/blik-payment-request.md b/doc/models/blik-payment-request.md index fddf29c..cf0e2e4 100644 --- a/doc/models/blik-payment-request.md +++ b/doc/models/blik-payment-request.md @@ -18,29 +18,29 @@ Information needed to pay using BLIK. | `level_0` | [`BlikLevel0PaymentObject`](../../doc/models/blik-level-0-payment-object.md) | Optional | Information used to pay using BLIK level_0 flow. | | `one_click` | [`BlikOneClickPaymentRequest`](../../doc/models/blik-one-click-payment-request.md) | Optional | Information used to pay using BLIK one-click flow. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "email": "email8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } -} +## Example + +```ruby +blik_payment_request = BlikPaymentRequest.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + experience_context: BlikExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ), + level_0: BlikLevel0PaymentObject.new( + auth_code: 'auth_code8' + ), + one_click: BlikOneClickPaymentRequest.new( + consumer_reference: 'consumer_reference2', + auth_code: 'auth_code0', + alias_label: 'alias_label6', + alias_key: 'alias_key4' + ) +) ``` diff --git a/doc/models/callback-configuration.md b/doc/models/callback-configuration.md index 47e9256..ecea078 100644 --- a/doc/models/callback-configuration.md +++ b/doc/models/callback-configuration.md @@ -14,16 +14,16 @@ CallBack Configuration that the merchant can provide to PayPal/Venmo. | `callback_events` | [`Array[CallbackEvents]`](../../doc/models/callback-events.md) | Required | An array of callback events merchant can subscribe to for the corresponding callback url.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason8" -} +```ruby +cancel_subscription_request = CancelSubscriptionRequest.new( + reason: 'reason8' +) ``` diff --git a/doc/models/capture-incomplete-reason.md b/doc/models/capture-incomplete-reason.md index bd464ed..29c5177 100644 --- a/doc/models/capture-incomplete-reason.md +++ b/doc/models/capture-incomplete-reason.md @@ -24,3 +24,9 @@ The reason why the captured payment status is `PENDING` or `DENIED`. | `VERIFICATION_REQUIRED` | The payee's PayPal account is not verified. | | `DECLINED_BY_RISK_FRAUD_FILTERS` | Risk Filter set by the payee failed for the transaction. | +## Example + +```ruby +capture_incomplete_reason = CaptureIncompleteReason::VERIFICATION_REQUIRED +``` + diff --git a/doc/models/capture-payment-instruction.md b/doc/models/capture-payment-instruction.md index ba6afd4..a8a1f89 100644 --- a/doc/models/capture-payment-instruction.md +++ b/doc/models/capture-payment-instruction.md @@ -15,34 +15,44 @@ Any additional payment instructions to be consider during payment processing. Th | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `DisbursementMode::INSTANT`

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "disbursement_mode": "INSTANT", - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } +## Example + +```ruby +capture_payment_instruction = CapturePaymentInstruction.new( + platform_fees: [ + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ) ], - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id8" -} + disbursement_mode: DisbursementMode::INSTANT, + payee_receivable_fx_rate_id: 'payee_receivable_fx_rate_id8' +) ``` diff --git a/doc/models/capture-request.md b/doc/models/capture-request.md index d88ef6c..109e872 100644 --- a/doc/models/capture-request.md +++ b/doc/models/capture-request.md @@ -18,53 +18,53 @@ Captures either a portion or the full authorized amount of an authorized payment | `note_to_payer` | `String` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Maximum Length*: `255` | | `soft_descriptor` | `String` | Optional | The payment descriptor on the payer's account statement.

**Constraints**: *Maximum Length*: `22` | -## Example (as JSON) +## Example -```json -{ - "final_capture": false, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4", - "payment_instruction": { - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } +```ruby +capture_request = CaptureRequest.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + invoice_id: 'invoice_id6', + final_capture: false, + payment_instruction: CapturePaymentInstruction.new( + platform_fees: [ + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ) ], - "disbursement_mode": "INSTANT", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - }, - "note_to_payer": "note_to_payer6" -} + disbursement_mode: DisbursementMode::INSTANT, + payee_receivable_fx_rate_id: 'payee_receivable_fx_rate_id0' + ), + note_to_payer: 'note_to_payer8' +) ``` diff --git a/doc/models/capture-status-details.md b/doc/models/capture-status-details.md index ae3a21d..80978b3 100644 --- a/doc/models/capture-status-details.md +++ b/doc/models/capture-status-details.md @@ -13,11 +13,11 @@ The details of the captured payment status. | --- | --- | --- | --- | | `reason` | [`CaptureIncompleteReason`](../../doc/models/capture-incomplete-reason.md) | Optional | The reason why the captured payment status is `PENDING` or `DENIED`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "reason": "BUYER_COMPLAINT" -} +```ruby +capture_status_details = CaptureStatusDetails.new( + reason: CaptureIncompleteReason::OTHER +) ``` diff --git a/doc/models/capture-status-with-details.md b/doc/models/capture-status-with-details.md index d7b2e65..9348525 100644 --- a/doc/models/capture-status-with-details.md +++ b/doc/models/capture-status-with-details.md @@ -14,14 +14,13 @@ The status and status details of a captured payment. | `status` | [`CaptureStatus`](../../doc/models/capture-status.md) | Optional, Read-only | The status of the captured payment. | | `status_details` | [`CaptureStatusDetails`](../../doc/models/capture-status-details.md) | Optional | The details of the captured payment status. | -## Example (as JSON) - -```json -{ - "status": "COMPLETED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - } -} +## Example + +```ruby +capture_status_with_details = CaptureStatusWithDetails.new( + status_details: CaptureStatusDetails.new( + reason: CaptureIncompleteReason::VERIFICATION_REQUIRED + ) +) ``` diff --git a/doc/models/capture-status.md b/doc/models/capture-status.md index d5f1886..c0a11e5 100644 --- a/doc/models/capture-status.md +++ b/doc/models/capture-status.md @@ -18,3 +18,9 @@ The status of the captured payment. | `REFUNDED` | An amount greater than or equal to this captured payment's amount was refunded to the payer. | | `FAILED` | There was an error while capturing payment. | +## Example + +```ruby +capture_status = CaptureStatus::COMPLETED +``` + diff --git a/doc/models/capture-subscription-request.md b/doc/models/capture-subscription-request.md index 460ede7..02e6b67 100644 --- a/doc/models/capture-subscription-request.md +++ b/doc/models/capture-subscription-request.md @@ -15,16 +15,16 @@ The charge amount from the subscriber. | `capture_type` | [`CaptureType`](../../doc/models/capture-type.md) | Required | The type of capture.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "note": "note4", - "capture_type": "OUTSTANDING_BALANCE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```ruby +capture_subscription_request = CaptureSubscriptionRequest.new( + note: 'note8', + capture_type: CaptureType::OUTSTANDING_BALANCE, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/capture-type.md b/doc/models/capture-type.md index 4739ebd..f6dc12f 100644 --- a/doc/models/capture-type.md +++ b/doc/models/capture-type.md @@ -13,3 +13,9 @@ The type of capture. | --- | --- | | `OUTSTANDING_BALANCE` | The outstanding balance that the subscriber must clear. | +## Example + +```ruby +capture_type = CaptureType::OUTSTANDING_BALANCE +``` + diff --git a/doc/models/captured-payment.md b/doc/models/captured-payment.md index c159a26..d9cb80d 100644 --- a/doc/models/captured-payment.md +++ b/doc/models/captured-payment.md @@ -29,22 +29,19 @@ A captured payment. | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -## Example (as JSON) - -```json -{ - "final_capture": false, - "disbursement_mode": "INSTANT", - "status": "PARTIALLY_REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4" -} +## Example + +```ruby +captured_payment = CapturedPayment.new( + status_details: CaptureStatusDetails.new( + reason: CaptureIncompleteReason::VERIFICATION_REQUIRED + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + final_capture: false, + disbursement_mode: DisbursementMode::INSTANT +) ``` diff --git a/doc/models/card-attributes-response.md b/doc/models/card-attributes-response.md index 428f00a..b7a87bf 100644 --- a/doc/models/card-attributes-response.md +++ b/doc/models/card-attributes-response.md @@ -13,36 +13,29 @@ Additional attributes associated with the use of this card. | --- | --- | --- | --- | | `vault` | [`CardVaultResponse`](../../doc/models/card-vault-response.md) | Optional | The details about a saved Card payment source. | -## Example (as JSON) - -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - } - } -} +## Example + +```ruby +card_attributes_response = CardAttributesResponse.new( + vault: CardVaultResponse.new( + id: 'id6', + status: VaultStatus::APPROVED, + customer: CardCustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id2' + ) + ) +) ``` diff --git a/doc/models/card-attributes.md b/doc/models/card-attributes.md index 051e9bd..306448a 100644 --- a/doc/models/card-attributes.md +++ b/doc/models/card-attributes.md @@ -15,31 +15,31 @@ Additional attributes associated with the use of this card. | `vault` | [`VaultInstructionBase`](../../doc/models/vault-instruction-base.md) | Optional | Basic vault instruction specification that can be extended by specific payment sources that supports vaulting. | | `verification` | [`CardVerification`](../../doc/models/card-verification.md) | Optional | The API caller can opt in to verify the card through PayPal offered verification services (e.g. Smart Dollar Auth, 3DS). | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - }, - "vault": { - "store_in_vault": "ON_SUCCESS" - }, - "verification": { - "method": "3D_SECURE" - } -} +## Example + +```ruby +card_attributes = CardAttributes.new( + customer: CardCustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id2' + ), + vault: VaultInstructionBase.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS + ), + verification: CardVerification.new( + method: OrdersCardVerificationMethod::ENUM_3D_SECURE + ) +) ``` diff --git a/doc/models/card-authentication-response.md b/doc/models/card-authentication-response.md index a21b2d1..e68e2be 100644 --- a/doc/models/card-authentication-response.md +++ b/doc/models/card-authentication-response.md @@ -13,15 +13,15 @@ Results of Authentication such as 3D Secure. | --- | --- | --- | --- | | `three_d_secure` | [`ThreeDSecureCardAuthenticationResponse`](../../doc/models/three-d-secure-card-authentication-response.md) | Optional | Results of 3D Secure Authentication. | -## Example (as JSON) - -```json -{ - "three_d_secure": { - "authentication_status": "C", - "enrollment_status": "Y", - "authentication_id": "authentication_id6" - } -} +## Example + +```ruby +card_authentication_response = CardAuthenticationResponse.new( + three_d_secure: ThreeDSecureCardAuthenticationResponse.new( + authentication_status: PaResStatus::CHALLENGEREQUIRED, + enrollment_status: EnrollmentStatus::ENROLLED, + authentication_id: 'authentication_id6' + ) +) ``` diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md index d02e168..c61c376 100644 --- a/doc/models/card-brand.md +++ b/doc/models/card-brand.md @@ -42,3 +42,9 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `ACCEL` | The Accel payment network. | | `UNKNOWN` | UNKNOWN payment network. | +## Example + +```ruby +card_brand = CardBrand::STAR +``` + diff --git a/doc/models/card-customer-information.md b/doc/models/card-customer-information.md index 602e6ea..7df56ce 100644 --- a/doc/models/card-customer-information.md +++ b/doc/models/card-customer-information.md @@ -17,23 +17,23 @@ The details about a customer in PayPal's system of record. | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -## Example (as JSON) - -```json -{ - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" -} +## Example + +```ruby +card_customer_information = CardCustomerInformation.new( + id: 'id6', + email_address: 'email_address6', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id8' +) ``` diff --git a/doc/models/card-customer.md b/doc/models/card-customer.md index fbebde2..9419792 100644 --- a/doc/models/card-customer.md +++ b/doc/models/card-customer.md @@ -16,19 +16,19 @@ The details about a customer in PayPal's system of record. | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -## Example (as JSON) - -```json -{ - "id": "id2", - "email_address": "email_address0", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "merchant_customer_id": "merchant_customer_id4" -} +## Example + +```ruby +card_customer = CardCustomer.new( + id: 'id2', + email_address: 'email_address0', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + merchant_customer_id: 'merchant_customer_id4' +) ``` diff --git a/doc/models/card-experience-context.md b/doc/models/card-experience-context.md index 5247a36..f2fa894 100644 --- a/doc/models/card-experience-context.md +++ b/doc/models/card-experience-context.md @@ -14,12 +14,12 @@ Customizes the payer experience during the 3DS Approval for payment. | `return_url` | `String` | Optional | Describes the URL. | | `cancel_url` | `String` | Optional | Describes the URL. | -## Example (as JSON) +## Example -```json -{ - "return_url": "return_url2", - "cancel_url": "cancel_url0" -} +```ruby +card_experience_context = CardExperienceContext.new( + return_url: 'return_url2', + cancel_url: 'cancel_url4' +) ``` diff --git a/doc/models/card-from-request.md b/doc/models/card-from-request.md index 0a12656..c4f5ed9 100644 --- a/doc/models/card-from-request.md +++ b/doc/models/card-from-request.md @@ -14,12 +14,11 @@ Representation of card details as received in the request. | `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, Read-only | The last digits of the payment card.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9A-Za-z-_]+$` | -## Example (as JSON) - -```json -{ - "address_line_1": "address_line_12", - "address_line_2": "address_line_22", - "admin_area_2": "admin_area_26", - "admin_area_1": "admin_area_18", - "postal_code": "postal_code4", - "country_code": "country_code2" -} +## Example + +```ruby +card_response_address = CardResponseAddress.new( + country_code: 'country_code2', + address_line_1: 'address_line_18', + address_line_2: 'address_line_22', + admin_area_2: 'admin_area_26', + admin_area_1: 'admin_area_18', + postal_code: 'postal_code4' +) ``` diff --git a/doc/models/card-response-with-billing-address.md b/doc/models/card-response-with-billing-address.md index 96e5a09..84b94e4 100644 --- a/doc/models/card-response-with-billing-address.md +++ b/doc/models/card-response-with-billing-address.md @@ -16,21 +16,21 @@ The payment card used to fund the payment. Card can be a credit or debit card. | `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])$` | | `currency_code` | `String` | Optional | The [three-character ISO-4217 currency code](https://developer.paypal.com/api/rest/reference/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | -## Example (as JSON) - -```json -{ - "name": "name0", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - }, - "expiry": "expiry8", - "currency_code": "currency_code4" -} +## Example + +```ruby +card_response_with_billing_address = CardResponseWithBillingAddress.new( + name: 'name8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ), + expiry: 'expiry6', + currency_code: 'currency_code4' +) ``` diff --git a/doc/models/card-response.md b/doc/models/card-response.md index 03e4a3f..5df23d3 100644 --- a/doc/models/card-response.md +++ b/doc/models/card-response.md @@ -23,19 +23,13 @@ The payment card to use to fund a payment. Card can be a credit or debit card. | `bin_details` | [`BinDetails`](../../doc/models/bin-details.md) | Optional | Bank Identification Number (BIN) details used to fund a payment. | | `stored_credential` | [`CardStoredCredential`](../../doc/models/card-stored-credential.md) | Optional | Provides additional details to process a payment using a `card` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. | -## Example (as JSON) - -```json -{ - "name": "name0", - "last_digits": "last_digits4", - "brand": "CARTE_BANCAIRE", - "available_networks": [ - "ELO", - "DINERS", - "CHINA_UNION_PAY" - ], - "type": "CREDIT" -} +## Example + +```ruby +card_response = CardResponse.new( + name: 'name6', + brand: CardBrand::RUPAY, + type: CardType::UNKNOWN +) ``` diff --git a/doc/models/card-stored-credential.md b/doc/models/card-stored-credential.md index 2613cff..2602fec 100644 --- a/doc/models/card-stored-credential.md +++ b/doc/models/card-stored-credential.md @@ -16,19 +16,19 @@ Provides additional details to process a payment using a `card` that has been st | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `StoredPaymentSourceUsageType::DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `previous_network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | -## Example (as JSON) - -```json -{ - "payment_initiator": "CUSTOMER", - "payment_type": "ONE_TIME", - "usage": "DERIVED", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } -} +## Example + +```ruby +card_stored_credential = CardStoredCredential.new( + payment_initiator: PaymentInitiator::CUSTOMER, + payment_type: StoredPaymentSourcePaymentType::ONE_TIME, + usage: StoredPaymentSourceUsageType::DERIVED, + previous_network_transaction_reference: NetworkTransaction.new( + id: 'id6', + date: 'date2', + network: CardBrand::CONFIDIS, + acquirer_reference_number: 'acquirer_reference_number8' + ) +) ``` diff --git a/doc/models/card-supplementary-data.md b/doc/models/card-supplementary-data.md index 0df3f95..7670c20 100644 --- a/doc/models/card-supplementary-data.md +++ b/doc/models/card-supplementary-data.md @@ -14,40 +14,40 @@ Merchants and partners can add Level 2 and 3 data to payments to reduce risk and | `level_2` | [`Level2CardProcessingData`](../../doc/models/level-2-card-processing-data.md) | Optional | The level 2 card processing data collections. If your merchant account has been configured for Level 2 processing this field will be passed to the processor on your behalf. Please contact your PayPal Technical Account Manager to define level 2 data for your business. | | `level_3` | [`Level3CardProcessingData`](../../doc/models/level-3-card-processing-data.md) | Optional | The level 3 card processing data collections, If your merchant account has been configured for Level 3 processing this field will be passed to the processor on your behalf. Please contact your PayPal Technical Account Manager to define level 3 data for your business. | -## Example (as JSON) - -```json -{ - "level_2": { - "invoice_id": "invoice_id4", - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - } - }, - "level_3": { - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "duty_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "discount_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "shipping_address": { - "address_line_1": "address_line_10", - "address_line_2": "address_line_20", - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "ships_from_postal_code": "ships_from_postal_code4" - } -} +## Example + +```ruby +card_supplementary_data = CardSupplementaryData.new( + level_2: Level2CardProcessingData.new( + invoice_id: 'invoice_id4', + tax_total: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ) + ), + level_3: Level3CardProcessingData.new( + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + duty_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + discount_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + shipping_address: Address.new( + country_code: 'country_code0', + address_line_1: 'address_line_10', + address_line_2: 'address_line_20', + admin_area_2: 'admin_area_24', + admin_area_1: 'admin_area_16', + postal_code: 'postal_code2' + ), + ships_from_postal_code: 'ships_from_postal_code4' + ) +) ``` diff --git a/doc/models/card-type.md b/doc/models/card-type.md index e347e60..584c9f9 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -17,3 +17,9 @@ Type of card. i.e Credit, Debit and so on. | `STORE` | A store card. | | `UNKNOWN` | Card type cannot be determined. | +## Example + +```ruby +card_type = CardType::UNKNOWN +``` + diff --git a/doc/models/card-vault-response.md b/doc/models/card-vault-response.md index cdf9ac9..46bf0e6 100644 --- a/doc/models/card-vault-response.md +++ b/doc/models/card-vault-response.md @@ -16,39 +16,27 @@ The details about a saved Card payment source. | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`CardCustomerInformation`](../../doc/models/card-customer-information.md) | Optional | The details about a customer in PayPal's system of record. | -## Example (as JSON) - -```json -{ - "id": "id6", - "status": "VAULTED", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - } -} +## Example + +```ruby +card_vault_response = CardVaultResponse.new( + id: 'id0', + status: VaultStatus::APPROVED, + customer: CardCustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id2' + ) +) ``` diff --git a/doc/models/card-verification-details.md b/doc/models/card-verification-details.md index 0dfcdc4..2b0ca1b 100644 --- a/doc/models/card-verification-details.md +++ b/doc/models/card-verification-details.md @@ -19,18 +19,17 @@ Card Verification details including the authorization details and 3D SECURE deta | `processor_response` | [`CardVerificationProcessorResponse`](../../doc/models/card-verification-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `three_d_secure` | `Object` | Optional | DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in the 'three_d_secure' object under the 'authentication_result' object instead of the 'verification' object. | -## Example (as JSON) - -```json -{ - "network_transaction_id": "network_transaction_id4", - "date": "date8", - "network": "ACCEL", - "time": "time2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```ruby +card_verification_details = CardVerificationDetails.new( + network_transaction_id: 'network_transaction_id4', + date: 'date8', + network: CardBrand::ACCEL, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/card-verification-processor-response.md b/doc/models/card-verification-processor-response.md index 6a9104d..1a600e1 100644 --- a/doc/models/card-verification-processor-response.md +++ b/doc/models/card-verification-processor-response.md @@ -14,12 +14,9 @@ The processor response information for payment requests, such as direct credit c | `avs_code` | [`AvsCode`](../../doc/models/avs-code.md) | Optional, Read-only | The address verification code for Visa, Discover, Mastercard, or American Express transactions. | | `cvv_code` | [`CvvCode`](../../doc/models/cvv-code.md) | Optional, Read-only | The card verification value code for for Visa, Discover, Mastercard, or American Express. | -## Example (as JSON) +## Example -```json -{ - "avs_code": "E", - "cvv_code": "All others" -} +```ruby +card_verification_processor_response = CardVerificationProcessorResponse.new ``` diff --git a/doc/models/card-verification-status.md b/doc/models/card-verification-status.md index 3069681..855e022 100644 --- a/doc/models/card-verification-status.md +++ b/doc/models/card-verification-status.md @@ -14,3 +14,9 @@ Verification status of Card. | `VERIFIED` | Card has been verified | | `FAILED` | Card verification has failed | +## Example + +```ruby +card_verification_status = CardVerificationStatus::VERIFIED +``` + diff --git a/doc/models/card-verification.md b/doc/models/card-verification.md index 450d93e..749db48 100644 --- a/doc/models/card-verification.md +++ b/doc/models/card-verification.md @@ -13,11 +13,11 @@ The API caller can opt in to verify the card through PayPal offered verification | --- | --- | --- | --- | | `method` | [`OrdersCardVerificationMethod`](../../doc/models/orders-card-verification-method.md) | Optional | The method used for card verification.

**Default**: `OrdersCardVerificationMethod::SCA_WHEN_REQUIRED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "method": "SCA_WHEN_REQUIRED" -} +```ruby +card_verification = CardVerification.new( + method: OrdersCardVerificationMethod::SCA_WHEN_REQUIRED +) ``` diff --git a/doc/models/cart-information.md b/doc/models/cart-information.md index eacb824..9a93bb4 100644 --- a/doc/models/cart-information.md +++ b/doc/models/cart-information.md @@ -15,21 +15,35 @@ The cart information. | `tax_inclusive` | `TrueClass \| FalseClass` | Optional | Indicates whether the item amount or the shipping amount already includes tax.

**Default**: `false` | | `paypal_invoice_id` | `String` | Optional | The ID of the invoice. Appears for only PayPal-generated invoices.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | -## Example (as JSON) - -```json -{ - "tax_inclusive": false, - "item_details": [ - { - "item_code": "item_code0", - "item_name": "item_name8", - "item_description": "item_description4", - "item_options": "item_options2", - "item_quantity": "item_quantity2" - } +## Example + +```ruby +cart_information = CartInformation.new( + item_details: [ + ItemDetails.new( + item_code: 'item_code0', + item_name: 'item_name8', + item_description: 'item_description4', + item_options: 'item_options2', + item_quantity: 'item_quantity2' + ), + ItemDetails.new( + item_code: 'item_code0', + item_name: 'item_name8', + item_description: 'item_description4', + item_options: 'item_options2', + item_quantity: 'item_quantity2' + ), + ItemDetails.new( + item_code: 'item_code0', + item_name: 'item_name8', + item_description: 'item_description4', + item_options: 'item_options2', + item_quantity: 'item_quantity2' + ) ], - "paypal_invoice_id": "paypal_invoice_id2" -} + tax_inclusive: false, + paypal_invoice_id: 'paypal_invoice_id4' +) ``` diff --git a/doc/models/checkout-option.md b/doc/models/checkout-option.md index ba15cf8..e6fb171 100644 --- a/doc/models/checkout-option.md +++ b/doc/models/checkout-option.md @@ -14,12 +14,12 @@ A checkout option as a name-and-value pair. | `checkout_option_name` | `String` | Optional | The checkout option name, such as `color` or `texture`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | | `checkout_option_value` | `String` | Optional | The checkout option value. For example, the checkout option `color` might be `blue` or `red` while the checkout option `texture` might be `smooth` or `rippled`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | -## Example (as JSON) +## Example -```json -{ - "checkout_option_name": "checkout_option_name6", - "checkout_option_value": "checkout_option_value0" -} +```ruby +checkout_option = CheckoutOption.new( + checkout_option_name: 'checkout_option_name6', + checkout_option_value: 'checkout_option_value2' +) ``` diff --git a/doc/models/checkout-payment-intent.md b/doc/models/checkout-payment-intent.md index 313c7bf..b293769 100644 --- a/doc/models/checkout-payment-intent.md +++ b/doc/models/checkout-payment-intent.md @@ -14,3 +14,9 @@ The intent to either capture payment immediately or authorize a payment for an o | `CAPTURE` | The merchant intends to capture payment immediately after the customer makes a payment. | | `AUTHORIZE` | The merchant intends to authorize a payment and place funds on hold after the customer makes a payment. Authorized payments are best captured within three days of authorization but are available to capture for up to 29 days. After the three-day honor period, the original authorized payment expires and you must re-authorize the payment. You must make a separate request to capture payments on demand. This intent is not supported when you have more than one `purchase_unit` within your order. | +## Example + +```ruby +checkout_payment_intent = CheckoutPaymentIntent::CAPTURE +``` + diff --git a/doc/models/cobranded-card.md b/doc/models/cobranded-card.md index 406c555..6d919cb 100644 --- a/doc/models/cobranded-card.md +++ b/doc/models/cobranded-card.md @@ -15,22 +15,23 @@ Details about the merchant cobranded card used for order purchase. | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "labels": [ - "labels2", - "labels3" +## Example + +```ruby +cobranded_card = CobrandedCard.new( + labels: [ + 'labels0', + 'labels1', + 'labels2' ], - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md index 7440f73..a13e0f6 100644 --- a/doc/models/confirm-order-request.md +++ b/doc/models/confirm-order-request.md @@ -15,95 +15,95 @@ Payer confirms the intent to pay for the Order using the provided payment source | `processing_instruction` | [`ProcessingInstruction`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order. | | `application_context` | [`OrderConfirmApplicationContext`](../../doc/models/order-confirm-application-context.md) | Optional | Customizes the payer confirmation experience. | -## Example (as JSON) +## Example -```json -{ - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } - } - }, - "processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL", - "application_context": { - "brand_name": "brand_name8", - "locale": "locale2", - "return_url": "return_url0", - "cancel_url": "cancel_url2", - "stored_payment_source": { - "payment_initiator": "CUSTOMER", - "payment_type": "RECURRING", - "usage": "FIRST", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } - } - } -} +```ruby +confirm_order_request = ConfirmOrderRequest.new( + payment_source: PaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + bancontact: BancontactPaymentRequest.new( + name: 'name0', + country_code: 'country_code0', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) + ), + blik: BlikPaymentRequest.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + experience_context: BlikExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ), + level_0: BlikLevel0PaymentObject.new( + auth_code: 'auth_code8' + ), + one_click: BlikOneClickPaymentRequest.new( + consumer_reference: 'consumer_reference2', + auth_code: 'auth_code0', + alias_label: 'alias_label6', + alias_key: 'alias_key4' + ) + ) + ), + processing_instruction: ProcessingInstruction::ORDER_COMPLETE_ON_PAYMENT_APPROVAL, + application_context: OrderConfirmApplicationContext.new( + brand_name: 'brand_name8', + locale: 'locale2', + return_url: 'return_url0', + cancel_url: 'cancel_url2', + stored_payment_source: StoredPaymentSource.new( + payment_initiator: PaymentInitiator::CUSTOMER, + payment_type: StoredPaymentSourcePaymentType::RECURRING, + usage: StoredPaymentSourceUsageType::FIRST, + previous_network_transaction_reference: NetworkTransaction.new( + id: 'id6', + date: 'date2', + network: CardBrand::CONFIDIS, + acquirer_reference_number: 'acquirer_reference_number8' + ) + ) + ) +) ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index dd7c92e..929f232 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -21,58 +21,58 @@ The create subscription request details. | `custom_id` | `String` | Optional | The custom id for the subscription. Can be invoice id.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\x20-\x7E]+` | | `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | -## Example (as JSON) +## Example -```json -{ - "plan_id": "plan_id8", - "auto_renewal": false, - "start_time": "start_time0", - "quantity": "quantity2", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "subscriber": { - "email_address": "email_address8", - "payer_id": "payer_id8", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "shipping_address": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address8", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } +```ruby +create_subscription_request = CreateSubscriptionRequest.new( + plan_id: 'plan_id6', + start_time: 'start_time8', + quantity: 'quantity0', + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + subscriber: SubscriberRequest.new( + email_address: 'email_address8', + payer_id: 'payer_id8', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + shipping_address: ShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address8', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::PICKUP_IN_STORE, + options: [ + ShippingOption.new( + id: 'id2', + label: 'label2', + selected: false, + type: ShippingType::SHIPPING, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "type": "UNKNOWN" - } - } - } -} + ), + payment_source: SubscriptionPaymentSource.new( + card: SubscriptionCardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + type: CardType::UNKNOWN + ) + ) + ), + auto_renewal: false +) ``` diff --git a/doc/models/customer-information.md b/doc/models/customer-information.md index a043f49..46b72f3 100644 --- a/doc/models/customer-information.md +++ b/doc/models/customer-information.md @@ -16,22 +16,22 @@ This object represents a merchant’s customer, allowing them to store contact d | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "id": "id6", - "email_address": "email_address4", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```ruby +customer_information = CustomerInformation.new( + id: 'id8', + email_address: 'email_address6', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) +) ``` diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 3f9e42c..fbf6ba2 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -14,12 +14,12 @@ Customer in merchant's or partner's system of records. | `id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -## Example (as JSON) +## Example -```json -{ - "id": "id4", - "merchant_customer_id": "merchant_customer_id6" -} +```ruby +customer_response = CustomerResponse.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' +) ``` diff --git a/doc/models/customer-vault-payment-tokens-response.md b/doc/models/customer-vault-payment-tokens-response.md index 61ef600..896d75f 100644 --- a/doc/models/customer-vault-payment-tokens-response.md +++ b/doc/models/customer-vault-payment-tokens-response.md @@ -17,242 +17,92 @@ Collection of payment tokens saved for a given customer. | `payment_tokens` | [`Array[PaymentTokenResponse]`](../../doc/models/payment-token-response.md) | Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `64` | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | -## Example (as JSON) +## Example -```json -{ - "total_items": 50, - "total_pages": 10, - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2", - "links": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } - ] - }, - "payment_tokens": [ - { - "id": "id4", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] - }, - { - "id": "id4", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } +```ruby +customer_vault_payment_tokens_response = CustomerVaultPaymentTokensResponse.new( + total_items: 42, + total_pages: 10, + customer: VaultResponseCustomer.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ), + payment_tokens: [ + PaymentTokenResponse.new( + id: 'id4', + customer: CustomerResponse.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ), + payment_source: PaymentTokenResponsePaymentSource.new( + card: CardPaymentTokenEntity.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + expiry: 'expiry4', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + apple_pay: ApplePayPaymentToken.new( + card: ApplePayCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ) + ) + ), + PaymentTokenResponse.new( + id: 'id4', + customer: CustomerResponse.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ), + payment_source: PaymentTokenResponsePaymentSource.new( + card: CardPaymentTokenEntity.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + expiry: 'expiry4', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + apple_pay: ApplePayPaymentToken.new( + card: ApplePayCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ) + ) + ) ] -} +) ``` diff --git a/doc/models/customer.md b/doc/models/customer.md index 9eed14b..93c5271 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -14,12 +14,12 @@ This object defines a customer in your system. Use it to manage customer profile | `id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -## Example (as JSON) +## Example -```json -{ - "id": "id8", - "merchant_customer_id": "merchant_customer_id0" -} +```ruby +customer = Customer.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' +) ``` diff --git a/doc/models/cvv-code.md b/doc/models/cvv-code.md index 1eff57c..621f556 100644 --- a/doc/models/cvv-code.md +++ b/doc/models/cvv-code.md @@ -26,3 +26,9 @@ The card verification value code for for Visa, Discover, Mastercard, or American | `CVV_3` | For Maestro, the merchant has indicated that CVV2 is not present on card. | | `CVV_4` | For Maestro, the service is not available. | +## Example + +```ruby +cvv_code = CvvCode::ENUM_ALL_OTHERS +``` + diff --git a/doc/models/cycle-execution.md b/doc/models/cycle-execution.md index 2978145..40b1019 100644 --- a/doc/models/cycle-execution.md +++ b/doc/models/cycle-execution.md @@ -18,16 +18,13 @@ The regular and trial execution details for a billing cycle. | `current_pricing_scheme_version` | `Integer` | Optional, Read-only | The active pricing scheme version for the billing cycle.

**Constraints**: `>= 1`, `<= 99` | | `total_cycles` | `Integer` | Optional, Read-only | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Constraints**: `>= 0`, `<= 999` | -## Example (as JSON) - -```json -{ - "tenure_type": "REGULAR", - "sequence": 99, - "cycles_completed": 172, - "cycles_remaining": 208, - "current_pricing_scheme_version": 99, - "total_cycles": 60 -} +## Example + +```ruby +cycle_execution = CycleExecution.new( + tenure_type: envrr, + sequence: 99, + cycles_completed: nil +) ``` diff --git a/doc/models/cycle-frequency.md b/doc/models/cycle-frequency.md new file mode 100644 index 0000000..e205b3a --- /dev/null +++ b/doc/models/cycle-frequency.md @@ -0,0 +1,25 @@ + +# Cycle Frequency + +The frequency of the terms reset cycle. + +## Structure + +`CycleFrequency` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `interval_unit` | [`FrequencyIntervalUnit`](../../doc/models/frequency-interval-unit.md) | Required | The interval unit at which the the usage limits will be reset.

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

**Default**: `1`

**Constraints**: `>= 1`, `<= 365` | + +## Example + +```ruby +cycle_frequency = CycleFrequency.new( + interval_unit: FrequencyIntervalUnit::MONTH, + interval_count: 1 +) +``` + diff --git a/doc/models/default-error-exception.md b/doc/models/default-error-exception.md index a2081ce..9a52285 100644 --- a/doc/models/default-error-exception.md +++ b/doc/models/default-error-exception.md @@ -18,30 +18,13 @@ The error details. | `details` | [`Array[TransactionSearchErrorDetails]`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -## Example (as JSON) - -```json -{ - "name": "name2", - "message": "message2", - "debug_id": "debug_id8", - "information_link": "information_link4", - "details": [ - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "description": "description0" - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue DefaultErrorException => e + puts "Caught DefaultErrorException: #{e.message}" +end ``` diff --git a/doc/models/disbursement-mode.md b/doc/models/disbursement-mode.md index 3334301..6757743 100644 --- a/doc/models/disbursement-mode.md +++ b/doc/models/disbursement-mode.md @@ -14,3 +14,9 @@ The funds that are held on behalf of the merchant. | `INSTANT` | The funds are released to the merchant immediately. | | `DELAYED` | The funds are held for a finite number of days. The actual duration depends on the region and type of integration. You can release the funds through a referenced payout. Otherwise, the funds disbursed automatically after the specified duration. | +## Example + +```ruby +disbursement_mode = DisbursementMode::INSTANT +``` + diff --git a/doc/models/dispute-category.md b/doc/models/dispute-category.md index e718cb0..5b9e622 100644 --- a/doc/models/dispute-category.md +++ b/doc/models/dispute-category.md @@ -14,3 +14,9 @@ The condition that is covered for the transaction. | `ITEM_NOT_RECEIVED` | The payer paid for an item that they did not receive. | | `UNAUTHORIZED_TRANSACTION` | The payer did not authorize the payment. | +## Example + +```ruby +dispute_category = DisputeCategory::ITEM_NOT_RECEIVED +``` + diff --git a/doc/models/eci-flag.md b/doc/models/eci-flag.md index acfe45a..a105494 100644 --- a/doc/models/eci-flag.md +++ b/doc/models/eci-flag.md @@ -18,3 +18,9 @@ Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data element | `ATTEMPTED_AUTHENTICATION_TRANSACTION` | VISA, AMEX, JCB, DINERS CLUB attempted authentication transaction. | | `NON_3D_SECURE_TRANSACTION` | VISA, AMEX, JCB, DINERS CLUB non-3-D Secure transaction. | +## Example + +```ruby +eci_flag = EciFlag::ATTEMPTED_AUTHENTICATION_TRANSACTION +``` + diff --git a/doc/models/enrollment-status.md b/doc/models/enrollment-status.md index d85271d..72e2d4b 100644 --- a/doc/models/enrollment-status.md +++ b/doc/models/enrollment-status.md @@ -16,3 +16,9 @@ Status of Authentication eligibility. | `UNAVAILABLE` | Unavailable. The DS or ACS is not available for authentication at the time of the request. | | `BYPASS` | Bypass. The merchant authentication rule is triggered to bypass authentication. | +## Example + +```ruby +enrollment_status = EnrollmentStatus::ENROLLED +``` + diff --git a/doc/models/eps-payment-object.md b/doc/models/eps-payment-object.md index 393e634..56230fd 100644 --- a/doc/models/eps-payment-object.md +++ b/doc/models/eps-payment-object.md @@ -15,13 +15,13 @@ Information used to pay using eps. | `country_code` | `String` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

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

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code2", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +eps_payment_request = EpsPaymentRequest.new( + name: 'name6', + country_code: 'country_code6', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/error-details.md b/doc/models/error-details.md index 7a9817a..1455953 100644 --- a/doc/models/error-details.md +++ b/doc/models/error-details.md @@ -18,27 +18,15 @@ The error details. Required for client-side `4XX` errors. | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas-links) that are either relevant to the issue by providing additional information or offering potential resolutions.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `4` | | `description` | `String` | Optional | The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value. | -## Example (as JSON) - -```json -{ - "location": "body", - "issue": "issue8", - "field": "field0", - "value": "value8", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description4" -} +## Example + +```ruby +error_details = ErrorDetails.new( + issue: 'issue0', + field: 'field8', + value: 'value6', + location: 'body', + description: 'description4' +) ``` diff --git a/doc/models/error-exception.md b/doc/models/error-exception.md index 11685fb..3466d0b 100644 --- a/doc/models/error-exception.md +++ b/doc/models/error-exception.md @@ -17,65 +17,13 @@ The error details. | `details` | [`Array[ErrorDetails]`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas-links). | -## Example (as JSON) - -```json -{ - "name": "name4", - "message": "message4", - "debug_id": "debug_id0", - "details": [ - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description0" - }, - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description0" - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue ErrorException => e + puts "Caught ErrorException: #{e.message}" +end ``` diff --git a/doc/models/exchange-rate.md b/doc/models/exchange-rate.md index a0de1e8..eb6abd8 100644 --- a/doc/models/exchange-rate.md +++ b/doc/models/exchange-rate.md @@ -15,13 +15,13 @@ The exchange rate that determines the amount to convert from one currency to ano | `target_currency` | `String` | Optional | The [three-character ISO-4217 currency code](https://developer.paypal.com/api/rest/reference/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | | `value` | `String` | Optional | The target currency amount. Equivalent to one unit of the source currency. Formatted as integer or decimal value with one to 15 digits to the right of the decimal point. | -## Example (as JSON) - -```json -{ - "source_currency": "source_currency0", - "target_currency": "target_currency2", - "value": "value2" -} +## Example + +```ruby +exchange_rate = ExchangeRate.new( + source_currency: 'source_currency4', + target_currency: 'target_currency6', + value: 'value6' +) ``` diff --git a/doc/models/experience-context-shipping-preference.md b/doc/models/experience-context-shipping-preference.md index 7faad7c..5ebd26f 100644 --- a/doc/models/experience-context-shipping-preference.md +++ b/doc/models/experience-context-shipping-preference.md @@ -15,3 +15,9 @@ The location from which the shipping address is derived., The shipping preferenc | `NO_SHIPPING` | Redacts the shipping address from the PayPal site. Recommended for digital goods. | | `SET_PROVIDED_ADDRESS` | Merchant sends the shipping address using purchase_units.shipping.address. The customer cannot change this address on the PayPal site. | +## Example + +```ruby +experience_context_shipping_preference = ExperienceContextShippingPreference::NO_SHIPPING +``` + diff --git a/doc/models/experience-context.md b/doc/models/experience-context.md index aea1322..287e3a2 100644 --- a/doc/models/experience-context.md +++ b/doc/models/experience-context.md @@ -17,15 +17,15 @@ Customizes the payer experience during the approval process for the payment. | `return_url` | `String` | Optional | Describes the URL. | | `cancel_url` | `String` | Optional | Describes the URL. | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "brand_name": "brand_name0", - "locale": "locale4", - "return_url": "return_url2", - "cancel_url": "cancel_url4" -} +## Example + +```ruby +experience_context = ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + return_url: 'return_url4', + cancel_url: 'cancel_url6' +) ``` diff --git a/doc/models/experience-status.md b/doc/models/experience-status.md index 65f589a..8c3e2f5 100644 --- a/doc/models/experience-status.md +++ b/doc/models/experience-status.md @@ -16,3 +16,9 @@ This field indicates the status of PayPal's Checkout experience throughout the o | `CANCELED` | PayPal checkout is canceled (by closing the checkout window or clicking cancel) before the order approval. | | `APPROVED` | Order is approved. User has completed the checkout process. | +## Example + +```ruby +experience_status = ExperienceStatus::CANCELED +``` + diff --git a/doc/models/failed-payment-details.md b/doc/models/failed-payment-details.md index 1ef6904..4d28e78 100644 --- a/doc/models/failed-payment-details.md +++ b/doc/models/failed-payment-details.md @@ -16,17 +16,16 @@ The details for the failed payment of the subscription. | `reason_code` | [`ReasonCode`](../../doc/models/reason-code.md) | Optional, Read-only | The reason code for the payment failure.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `120`, *Pattern*: `^[A-Z_]+$` | | `next_payment_retry_time` | `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})$` | -## Example (as JSON) - -```json -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "time": "time6", - "reason_code": "TRANSACTION_RECEIVING_LIMIT_EXCEEDED", - "next_payment_retry_time": "next_payment_retry_time6" -} +## Example + +```ruby +failed_payment_details = FailedPaymentDetails.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + time: 'time2', + next_payment_retry_time: 'next_payment_retry_time2' +) ``` diff --git a/doc/models/frequency-interval-unit.md b/doc/models/frequency-interval-unit.md new file mode 100644 index 0000000..0b24fd4 --- /dev/null +++ b/doc/models/frequency-interval-unit.md @@ -0,0 +1,25 @@ + +# Frequency Interval Unit + +The interval unit at which the the usage limits will be reset. + +## Enumeration + +`FrequencyIntervalUnit` + +## Fields + +| Name | Description | +| --- | --- | +| `DAY` | A daily cycle. | +| `WEEK` | A weekly cycle. | +| `MONTH` | A monthly cycle. | +| `YEAR` | A yearly cycle. | +| `LIFETIME` | The lifetime of the BA translates to 1 cycle | + +## Example + +```ruby +frequency_interval_unit = FrequencyIntervalUnit::WEEK +``` + diff --git a/doc/models/frequency.md b/doc/models/frequency.md index d46be79..418e546 100644 --- a/doc/models/frequency.md +++ b/doc/models/frequency.md @@ -14,12 +14,12 @@ The frequency of the billing cycle. | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | The interval at which the subscription is charged or billed.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `interval_count` | `Integer` | Optional | The number of intervals after which a subscriber is billed. For example, if the `interval_unit` is `DAY` with an `interval_count` of `2`, the subscription is billed once every two days. The following table lists the maximum allowed values for the `interval_count` for each `interval_unit`: Interval unit Maximum interval count DAY 365 WEEK 52 MONTH 12 YEAR 1

**Default**: `1`

**Constraints**: `>= 1`, `<= 365` | -## Example (as JSON) +## Example -```json -{ - "interval_unit": "DAY", - "interval_count": 1 -} +```ruby +frequency = Frequency.new( + interval_unit: IntervalUnit::DAY, + interval_count: 1 +) ``` diff --git a/doc/models/fulfillment-type.md b/doc/models/fulfillment-type.md index b4430b7..4d6c1d2 100644 --- a/doc/models/fulfillment-type.md +++ b/doc/models/fulfillment-type.md @@ -16,3 +16,9 @@ A classification for the method of purchase fulfillment (e.g shipping, in-store | `PICKUP_IN_STORE` | The payer intends to pick up the item(s) from the payee's physical store. Also termed as BOPIS, "Buy Online, Pick-up in Store". Seller protection is provided with this option. | | `PICKUP_FROM_PERSON` | The payer intends to pick up the item(s) from the payee in person. Also termed as BOPIP, "Buy Online, Pick-up in Person". Seller protection is not available, since the payer is receiving the item from the payee in person, and can validate the item prior to payment. | +## Example + +```ruby +fulfillment_type = FulfillmentType::SHIPPING +``` + diff --git a/doc/models/giropay-payment-object.md b/doc/models/giropay-payment-object.md index ab643a6..8f8879e 100644 --- a/doc/models/giropay-payment-object.md +++ b/doc/models/giropay-payment-object.md @@ -15,13 +15,13 @@ Information needed to pay using giropay. | `country_code` | `String` | Optional | The [two-character ISO 3166-1 code](https://developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

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

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name8", - "country_code": "country_code8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +giropay_payment_request = GiropayPaymentRequest.new( + name: 'name0', + country_code: 'country_code0', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/google-pay-authentication-method.md b/doc/models/google-pay-authentication-method.md index afdf2e5..ac66d28 100644 --- a/doc/models/google-pay-authentication-method.md +++ b/doc/models/google-pay-authentication-method.md @@ -14,3 +14,9 @@ Authentication Method which is used for the card transaction. | `PAN_ONLY` | This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes primary account number (PAN) with the expiration month and the expiration year. | | `CRYPTOGRAM_3DS` | Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device. -> If authentication_method=CRYPTOGRAM, it is required that 'cryptogram' parameter in the request has a valid 3-D Secure (3DS) cryptogram generated on the device. | +## Example + +```ruby +google_pay_authentication_method = GooglePayAuthenticationMethod::PAN_ONLY +``` + diff --git a/doc/models/google-pay-card-response.md b/doc/models/google-pay-card-response.md index d542fa8..5058dd9 100644 --- a/doc/models/google-pay-card-response.md +++ b/doc/models/google-pay-card-response.md @@ -18,22 +18,21 @@ The payment card to use to fund a Google Pay payment response. Can be a credit o | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `authentication_result` | [`AuthenticationResponse`](../../doc/models/authentication-response.md) | Optional | Results of Authentication such as 3D Secure. | -## Example (as JSON) - -```json -{ - "name": "name4", - "last_digits": "last_digits8", - "type": "DEBIT", - "brand": "ACCEL", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } -} +## Example + +```ruby +google_pay_card_response = GooglePayCardResponse.new( + name: 'name0', + type: CardType::CREDIT, + brand: CardBrand::CETELEM, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) +) ``` diff --git a/doc/models/google-pay-card.md b/doc/models/google-pay-card.md index 2740817..0f44ea7 100644 --- a/doc/models/google-pay-card.md +++ b/doc/models/google-pay-card.md @@ -19,15 +19,14 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "last_digits": "last_digits8", - "type": "DEBIT" -} +## Example + +```ruby +google_pay_card = GooglePayCard.new( + name: 'name4', + number: 'number2', + expiry: 'expiry2', + type: CardType::DEBIT +) ``` diff --git a/doc/models/google-pay-decrypted-token-data.md b/doc/models/google-pay-decrypted-token-data.md index 2f7974c..d8f49d1 100644 --- a/doc/models/google-pay-decrypted-token-data.md +++ b/doc/models/google-pay-decrypted-token-data.md @@ -19,23 +19,22 @@ Details shared by Google for the merchant to be shared with PayPal. This is requ | `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*: `^.*$` | -## Example (as JSON) - -```json -{ - "message_id": "message_id4", - "message_expiration": "message_expiration8", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram0", - "eci_indicator": "eci_indicator4" -} +## Example + +```ruby +google_pay_decrypted_token_data = GooglePayDecryptedTokenData.new( + payment_method: GooglePayPaymentMethod::CARD, + card: GooglePayCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + type: CardType::UNKNOWN + ), + authentication_method: GooglePayAuthenticationMethod::PAN_ONLY, + message_id: 'message_id2', + message_expiration: 'message_expiration0', + cryptogram: 'cryptogram8', + eci_indicator: 'eci_indicator2' +) ``` diff --git a/doc/models/google-pay-experience-context.md b/doc/models/google-pay-experience-context.md index e668a96..b9e0fa2 100644 --- a/doc/models/google-pay-experience-context.md +++ b/doc/models/google-pay-experience-context.md @@ -14,12 +14,12 @@ Customizes the payer experience during the approval process for the payment. | `return_url` | `String` | Required | Describes the URL. | | `cancel_url` | `String` | Required | Describes the URL. | -## Example (as JSON) +## Example -```json -{ - "return_url": "return_url6", - "cancel_url": "cancel_url8" -} +```ruby +google_pay_experience_context = GooglePayExperienceContext.new( + return_url: 'return_url0', + cancel_url: 'cancel_url2' +) ``` diff --git a/doc/models/google-pay-payment-method.md b/doc/models/google-pay-payment-method.md index 435e7ee..5c646b8 100644 --- a/doc/models/google-pay-payment-method.md +++ b/doc/models/google-pay-payment-method.md @@ -13,3 +13,9 @@ The type of the payment credential. Currently, only CARD is supported. | --- | --- | | `CARD` | CARD is the only value that Google Pay accepts. | +## Example + +```ruby +google_pay_payment_method = GooglePayPaymentMethod::CARD +``` + diff --git a/doc/models/google-pay-request-card.md b/doc/models/google-pay-request-card.md index 2023561..40e187d 100644 --- a/doc/models/google-pay-request-card.md +++ b/doc/models/google-pay-request-card.md @@ -16,21 +16,21 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "name": "name8", - "type": "STORE", - "brand": "CONFIDIS", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } -} +## Example + +```ruby +google_pay_request_card = GooglePayRequestCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::VISA, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) +) ``` diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md index f6748b2..5da458c 100644 --- a/doc/models/google-pay-request.md +++ b/doc/models/google-pay-request.md @@ -19,44 +19,43 @@ Information needed to pay using Google Pay. | `assurance_details` | [`AssuranceDetails`](../../doc/models/assurance-details.md) | Optional | Information about cardholder possession validation and cardholder identification and verifications (ID&V). | | `experience_context` | [`GooglePayExperienceContext`](../../doc/models/google-pay-experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name4", - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } -} +## Example + +```ruby +google_pay_request = GooglePayRequest.new( + name: 'name6', + email_address: 'email_address4', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayRequestCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + decrypted_token: GooglePayDecryptedTokenData.new( + payment_method: GooglePayPaymentMethod::CARD, + card: GooglePayCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + type: CardType::UNKNOWN + ), + authentication_method: GooglePayAuthenticationMethod::PAN_ONLY, + message_id: 'message_id0', + message_expiration: 'message_expiration2', + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0' + ) +) ``` diff --git a/doc/models/google-pay-wallet-response.md b/doc/models/google-pay-wallet-response.md index 87d57a1..f2111bb 100644 --- a/doc/models/google-pay-wallet-response.md +++ b/doc/models/google-pay-wallet-response.md @@ -16,30 +16,29 @@ Google Pay Wallet payment data. | `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `card` | [`GooglePayCardResponse`](../../doc/models/google-pay-card-response.md) | Optional | The payment card to use to fund a Google Pay payment response. Can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "name": "name0", - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } -} +## Example + +```ruby +google_pay_wallet_response = GooglePayWalletResponse.new( + name: 'name6', + email_address: 'email_address4', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayCardResponse.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) +) ``` diff --git a/doc/models/ideal-payment-object.md b/doc/models/ideal-payment-object.md index 847aba7..45b1931 100644 --- a/doc/models/ideal-payment-object.md +++ b/doc/models/ideal-payment-object.md @@ -16,14 +16,14 @@ Information used to pay using iDEAL. | `bic` | `String` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

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

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

**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Z-a-z0-9]{4}[A-Z-a-z]{2}[A-Z-a-z0-9]{2}([A-Z-a-z0-9]{3})?$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code4", - "bic": "bic8", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +ideal_payment_request = IdealPaymentRequest.new( + name: 'name0', + country_code: 'country_code0', + bic: 'bic2', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/incentive-details.md b/doc/models/incentive-details.md index 963c6b8..73abea7 100644 --- a/doc/models/incentive-details.md +++ b/doc/models/incentive-details.md @@ -16,17 +16,17 @@ The incentive details. | `incentive_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `incentive_program_code` | `String` | Optional | The incentive program code that identifies a merchant loyalty or incentive program.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | -## Example (as JSON) - -```json -{ - "incentive_type": "incentive_type4", - "incentive_code": "incentive_code0", - "incentive_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "incentive_program_code": "incentive_program_code4" -} +## Example + +```ruby +incentive_details = IncentiveDetails.new( + incentive_type: 'incentive_type4', + incentive_code: 'incentive_code0', + incentive_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + incentive_program_code: 'incentive_program_code4' +) ``` diff --git a/doc/models/incentive-information.md b/doc/models/incentive-information.md index 75eb98e..9d80f69 100644 --- a/doc/models/incentive-information.md +++ b/doc/models/incentive-information.md @@ -13,39 +13,39 @@ The incentive details. | --- | --- | --- | --- | | `incentive_details` | [`Array[IncentiveDetails]`](../../doc/models/incentive-details.md) | Optional | An array of incentive details.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | -## Example (as JSON) - -```json -{ - "incentive_details": [ - { - "incentive_type": "incentive_type4", - "incentive_code": "incentive_code0", - "incentive_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "incentive_program_code": "incentive_program_code4" - }, - { - "incentive_type": "incentive_type4", - "incentive_code": "incentive_code0", - "incentive_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "incentive_program_code": "incentive_program_code4" - }, - { - "incentive_type": "incentive_type4", - "incentive_code": "incentive_code0", - "incentive_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "incentive_program_code": "incentive_program_code4" - } +## Example + +```ruby +incentive_information = IncentiveInformation.new( + incentive_details: [ + IncentiveDetails.new( + incentive_type: 'incentive_type4', + incentive_code: 'incentive_code0', + incentive_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + incentive_program_code: 'incentive_program_code4' + ), + IncentiveDetails.new( + incentive_type: 'incentive_type4', + incentive_code: 'incentive_code0', + incentive_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + incentive_program_code: 'incentive_program_code4' + ), + IncentiveDetails.new( + incentive_type: 'incentive_type4', + incentive_code: 'incentive_code0', + incentive_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + incentive_program_code: 'incentive_program_code4' + ) ] -} +) ``` diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index df7ce04..77dc096 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -16,3 +16,9 @@ The interval at which the subscription is charged or billed. | `MONTH` | A monthly billing cycle. | | `YEAR` | A yearly billing cycle. | +## Example + +```ruby +interval_unit = IntervalUnit::DAY +``` + diff --git a/doc/models/item-category.md b/doc/models/item-category.md index abe258c..5ede905 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -15,3 +15,9 @@ The item category type. | `PHYSICAL_GOODS` | A tangible item that can be shipped with proof of delivery. | | `DONATION` | A contribution or gift for which no good or service is exchanged, usually to a not for profit organization. | +## Example + +```ruby +item_category = ItemCategory::PHYSICAL_GOODS +``` + diff --git a/doc/models/item-details.md b/doc/models/item-details.md index 4a76f96..69b76e9 100644 --- a/doc/models/item-details.md +++ b/doc/models/item-details.md @@ -31,15 +31,15 @@ The item details. | `invoice_number` | `String` | Optional | The invoice number. An alphanumeric string that identifies a billing for a merchant.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | | `checkout_options` | [`Array[CheckoutOption]`](../../doc/models/checkout-option.md) | Optional | An array of checkout options. Each option has a name and value.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | -## Example (as JSON) - -```json -{ - "item_code": "item_code4", - "item_name": "item_name2", - "item_description": "item_description0", - "item_options": "item_options4", - "item_quantity": "item_quantity4" -} +## Example + +```ruby +item_details = ItemDetails.new( + item_code: 'item_code0', + item_name: 'item_name8', + item_description: 'item_description4', + item_options: 'item_options2', + item_quantity: 'item_quantity2' +) ``` diff --git a/doc/models/item-request.md b/doc/models/item-request.md index b2c6c13..0e33b3f 100644 --- a/doc/models/item-request.md +++ b/doc/models/item-request.md @@ -23,24 +23,24 @@ The details for the items to be purchased. | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | | `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | -## Example (as JSON) - -```json -{ - "name": "name0", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity6", - "description": "description0", - "sku": "sku6", - "url": "url4", - "category": "DIGITAL_GOODS" -} +## Example + +```ruby +item_request = ItemRequest.new( + name: 'name6', + unit_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + quantity: 'quantity2', + tax: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + description: 'description6', + sku: 'sku2', + url: 'url0', + category: ItemCategory::PHYSICAL_GOODS +) ``` diff --git a/doc/models/item.md b/doc/models/item.md index 6af8a75..69504c7 100644 --- a/doc/models/item.md +++ b/doc/models/item.md @@ -23,24 +23,24 @@ The details for the items to be purchased. | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | | `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | -## Example (as JSON) - -```json -{ - "name": "name2", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity8", - "description": "description2", - "sku": "sku8", - "url": "url6", - "category": "DIGITAL_GOODS" -} +## Example + +```ruby +item = Item.new( + name: 'name2', + unit_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + quantity: 'quantity8', + tax: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + description: 'description2', + sku: 'sku8', + url: 'url6', + category: ItemCategory::DONATION +) ``` diff --git a/doc/models/last-payment-details.md b/doc/models/last-payment-details.md index 1ca974c..8e77884 100644 --- a/doc/models/last-payment-details.md +++ b/doc/models/last-payment-details.md @@ -12,15 +12,15 @@ | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `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})$` | -## Example (as JSON) - -```json -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "time": "time0" -} +## Example + +```ruby +last_payment_details = LastPaymentDetails.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + time: 'time6' +) ``` diff --git a/doc/models/level-2-card-processing-data.md b/doc/models/level-2-card-processing-data.md index 5339db0..3b92472 100644 --- a/doc/models/level-2-card-processing-data.md +++ b/doc/models/level-2-card-processing-data.md @@ -14,15 +14,15 @@ The level 2 card processing data collections. If your merchant account has been | `invoice_id` | `String` | Optional | Use this field to pass a purchase identification value of up to 127 ASCII characters. The length of this field will be adjusted to meet network specifications (25chars for Visa and Mastercard, 17chars for Amex), and the original invoice ID will still be displayed in your existing reports.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\w‘\-.,":;\!?]*$` | | `tax_total` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id8", - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - } -} +## Example + +```ruby +level_2_card_processing_data = Level2CardProcessingData.new( + invoice_id: 'invoice_id2', + tax_total: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ) +) ``` diff --git a/doc/models/level-3-card-processing-data.md b/doc/models/level-3-card-processing-data.md index 92e0005..5f0d4fd 100644 --- a/doc/models/level-3-card-processing-data.md +++ b/doc/models/level-3-card-processing-data.md @@ -18,31 +18,31 @@ The level 3 card processing data collections, If your merchant account has been | `ships_from_postal_code` | `String` | Optional | Use this field to specify the postal code of the shipping location.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12`, *Pattern*: `^[a-zA-Z0-9_'.-]*$` | -## Example (as JSON) - -```json -{ - "name": "name8", - "quantity": "quantity4", - "description": "description8", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4", - "upc": { - "type": "UPC-B", - "code": "code0" - } -} +## Example + +```ruby +line_item = LineItem.new( + name: 'name6', + quantity: 'quantity2', + description: 'description6', + sku: 'sku2', + url: 'url0', + image_url: 'image_url2', + upc: UniversalProductCode.new( + type: UpcType::UPC_B, + code: 'code0' + ) +) ``` diff --git a/doc/models/link-description.md b/doc/models/link-description.md index 2eb7ce1..150933d 100644 --- a/doc/models/link-description.md +++ b/doc/models/link-description.md @@ -15,13 +15,13 @@ The request-related [HATEOAS link](https://developer.paypal.com/api/rest/respons | `rel` | `String` | Required | The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml). | | `method` | [`LinkHttpMethod`](../../doc/models/link-http-method.md) | Optional | The HTTP method required to make the related call. | -## Example (as JSON) - -```json -{ - "href": "href2", - "rel": "rel6", - "method": "PUT" -} +## Example + +```ruby +link_description = LinkDescription.new( + href: 'href4', + rel: 'rel8', + method: LinkHttpMethod::HEAD +) ``` diff --git a/doc/models/link-http-method.md b/doc/models/link-http-method.md index 4e22f23..8383de0 100644 --- a/doc/models/link-http-method.md +++ b/doc/models/link-http-method.md @@ -20,3 +20,9 @@ The HTTP method required to make the related call. | `OPTIONS` | The HTTP OPTIONS method. | | `PATCH` | The HTTP PATCH method. | +## Example + +```ruby +link_http_method = LinkHttpMethod::HEAD +``` + diff --git a/doc/models/merchant-preferences.md b/doc/models/merchant-preferences.md index fd11119..8b5cc12 100644 --- a/doc/models/merchant-preferences.md +++ b/doc/models/merchant-preferences.md @@ -14,12 +14,12 @@ The merchant preferences for a subscription. | `return_url` | `String` | Optional | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | | `cancel_url` | `String` | Optional | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | -## Example (as JSON) +## Example -```json -{ - "return_url": "return_url8", - "cancel_url": "cancel_url0" -} +```ruby +merchant_preferences = MerchantPreferences.new( + return_url: 'return_url4', + cancel_url: 'cancel_url6' +) ``` diff --git a/doc/models/mobile-return-flow.md b/doc/models/mobile-return-flow.md index 4236a9b..48018e7 100644 --- a/doc/models/mobile-return-flow.md +++ b/doc/models/mobile-return-flow.md @@ -14,3 +14,9 @@ Merchant preference on how the buyer can navigate back to merchant website post | `AUTO` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | | `MANUAL` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | +## Example + +```ruby +mobile_return_flow = MobileReturnFlow::AUTO +``` + diff --git a/doc/models/mobile-web-context.md b/doc/models/mobile-web-context.md index 50cc036..7769359 100644 --- a/doc/models/mobile-web-context.md +++ b/doc/models/mobile-web-context.md @@ -14,12 +14,12 @@ Buyer's mobile web browser context to app switch to the PayPal consumer app. | `return_flow` | [`MobileReturnFlow`](../../doc/models/mobile-return-flow.md) | Optional, Read-only | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the PayPal App.

**Default**: `MobileReturnFlow::AUTO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | | `buyer_user_agent` | `String` | Optional | User agent from the request originating from the buyer's device. This will be used to identify the buyer's operating system and browser versions. NOTE: Merchants must not alter or modify the buyer's device user agent.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `512`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "return_flow": "AUTO", - "buyer_user_agent": "buyer_user_agent8" -} +```ruby +mobile_web_context = MobileWebContext.new( + return_flow: MobileReturnFlow::AUTO, + buyer_user_agent: 'buyer_user_agent4' +) ``` diff --git a/doc/models/modify-subscription-request.md b/doc/models/modify-subscription-request.md index b6dfa65..ae83e82 100644 --- a/doc/models/modify-subscription-request.md +++ b/doc/models/modify-subscription-request.md @@ -18,49 +18,49 @@ The request to update the quantity of the product or service in a subscription. | `application_context` | [`SubscriptionPatchApplicationContext`](../../doc/models/subscription-patch-application-context.md) | Optional | The application context, which customizes the payer experience during the subscription approval process with PayPal. | | `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | -## Example (as JSON) +## Example -```json -{ - "plan_id": "plan_id6", - "quantity": "quantity0", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping_address": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address8", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } +```ruby +modify_subscription_request = ModifySubscriptionRequest.new( + plan_id: 'plan_id8', + quantity: 'quantity2', + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + shipping_address: ShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address8', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::PICKUP_IN_STORE, + options: [ + ShippingOption.new( + id: 'id2', + label: 'label2', + selected: false, + type: ShippingType::SHIPPING, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] - }, - "application_context": { - "brand_name": "brand_name8", - "locale": "locale2", - "shipping_preference": "SET_PROVIDED_ADDRESS", - "payment_method": { - "payee_preferred": "UNRESTRICTED" - }, - "return_url": "return_url0", - "cancel_url": "cancel_url2" - } -} + ), + application_context: SubscriptionPatchApplicationContext.new( + return_url: 'return_url0', + cancel_url: 'cancel_url2', + brand_name: 'brand_name8', + locale: 'locale2', + shipping_preference: ExperienceContextShippingPreference::SET_PROVIDED_ADDRESS, + payment_method: PaymentMethod.new( + payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED + ) + ) +) ``` diff --git a/doc/models/modify-subscription-response.md b/doc/models/modify-subscription-response.md index e3f2272..f6de554 100644 --- a/doc/models/modify-subscription-response.md +++ b/doc/models/modify-subscription-response.md @@ -19,134 +19,132 @@ The response to a request to update the quantity of the product or service in a | `plan_overridden` | `TrueClass \| FalseClass` | Optional, Read-only | Indicates whether the subscription has overridden any plan attributes. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -## Example (as JSON) +## Example -```json -{ - "plan_id": "plan_id6", - "quantity": "quantity0", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping_address": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address8", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } +```ruby +modify_subscription_response = ModifySubscriptionResponse.new( + plan_id: 'plan_id8', + quantity: 'quantity2', + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + shipping_address: ShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address8', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::PICKUP_IN_STORE, + options: [ + ShippingOption.new( + id: 'id2', + label: 'label2', + selected: false, + type: ShippingType::SHIPPING, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] - }, - "plan": { - "billing_cycles": [ - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } + ), + plan: PlanOverride.new( + billing_cycles: [ + BillingCycleOverride.new( + sequence: 8, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - }, - "sequence": 8, - "total_cycles": 198 - }, - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } + create_time: 'create_time4' + ), + total_cycles: 198 + ), + BillingCycleOverride.new( + sequence: 8, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - }, - "sequence": 8, - "total_cycles": 198 - } + create_time: 'create_time4' + ), + total_cycles: 198 + ) ], - "payment_preferences": { - "auto_bill_outstanding": false, - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "setup_fee_failure_action": "CONTINUE", - "payment_failure_threshold": 104 - }, - "taxes": { - "percentage": "percentage8", - "inclusive": false - } - } -} + payment_preferences: PaymentPreferencesOverride.new( + auto_bill_outstanding: false, + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + setup_fee_failure_action: SetupFeeFailureAction::CONTINUE, + payment_failure_threshold: 104 + ), + taxes: TaxesOverride.new( + percentage: 'percentage8', + inclusive: false + ) + ) +) ``` diff --git a/doc/models/money.md b/doc/models/money.md index 5531a1e..164c31a 100644 --- a/doc/models/money.md +++ b/doc/models/money.md @@ -14,12 +14,12 @@ The currency and amount for a financial transaction, such as a balance or paymen | `currency_code` | `String` | Required | The [three-character ISO-4217 currency code](https://developer.paypal.com/api/rest/reference/currency-codes/) that identifies the currency.

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

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

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

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +mybank_payment_request = MybankPaymentRequest.new( + name: 'name2', + country_code: 'country_code2', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/name.md b/doc/models/name.md index c0e03e6..aee7fdb 100644 --- a/doc/models/name.md +++ b/doc/models/name.md @@ -14,12 +14,12 @@ The name of the party. | `given_name` | `String` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | | `surname` | `String` | Optional | When the party is a person, the party's surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother's, surname.

**Constraints**: *Maximum Length*: `140` | -## Example (as JSON) +## Example -```json -{ - "given_name": "given_name2", - "surname": "surname8" -} +```ruby +name = Name.new( + given_name: 'given_name2', + surname: 'surname8' +) ``` diff --git a/doc/models/native-app-context.md b/doc/models/native-app-context.md index d6bffc5..8db7d5b 100644 --- a/doc/models/native-app-context.md +++ b/doc/models/native-app-context.md @@ -14,12 +14,9 @@ Merchant provided, buyer's native app preferences to app switch to the PayPal co | `os_type` | [`OsType`](../../doc/models/os-type.md) | Optional, Read-only | Operating System type of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `7`, *Pattern*: `^[A-Z_]+$` | | `os_version` | `String` | Optional, Read-only | Operating System version of the device that the buyer is using.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `11`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) - -```json -{ - "number": "number0", - "expiry": "expiry0", - "cryptogram": "cryptogram2", - "eci_flag": "ATTEMPTED_AUTHENTICATION_TRANSACTION", - "token_requestor_id": "token_requestor_id8" -} +## Example + +```ruby +network_token = NetworkToken.new( + number: 'number0', + expiry: 'expiry0', + cryptogram: 'cryptogram2', + eci_flag: EciFlag::MASTERCARD_NON_3D_SECURE_TRANSACTION, + token_requestor_id: 'token_requestor_id8' +) ``` diff --git a/doc/models/network-transaction-reference-entity.md b/doc/models/network-transaction-reference-entity.md index 98c27cd..7307846 100644 --- a/doc/models/network-transaction-reference-entity.md +++ b/doc/models/network-transaction-reference-entity.md @@ -16,14 +16,14 @@ Previous network transaction reference including id and network. | `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `time` | `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})$` | -## Example (as JSON) - -```json -{ - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "time": "time6" -} +## Example + +```ruby +network_transaction_reference_entity = NetworkTransactionReferenceEntity.new( + id: 'id2', + date: 'date2', + network: CardBrand::HIPER, + time: 'time8' +) ``` diff --git a/doc/models/network-transaction.md b/doc/models/network-transaction.md index 7370a74..853c5f5 100644 --- a/doc/models/network-transaction.md +++ b/doc/models/network-transaction.md @@ -16,14 +16,14 @@ Reference values used by the card network to identify a transaction. | `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `acquirer_reference_number` | `String` | Optional | Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9]+$` | -## Example (as JSON) - -```json -{ - "id": "id0", - "date": "date4", - "network": "CETELEM", - "acquirer_reference_number": "acquirer_reference_number8" -} +## Example + +```ruby +network_transaction = NetworkTransaction.new( + id: 'id6', + date: 'date2', + network: CardBrand::CONFIDIS, + acquirer_reference_number: 'acquirer_reference_number2' +) ``` diff --git a/doc/models/o-auth-provider-error.md b/doc/models/o-auth-provider-error.md index ab73f72..5ea1812 100644 --- a/doc/models/o-auth-provider-error.md +++ b/doc/models/o-auth-provider-error.md @@ -18,3 +18,9 @@ OAuth 2 Authorization error codes | `UNSUPPORTED_GRANT_TYPE` | The authorization grant type is not supported by the authorization server. | | `INVALID_SCOPE` | The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner. | +## Example + +```ruby +o_auth_provider_error = OAuthProviderError::INVALID_REQUEST +``` + diff --git a/doc/models/o-auth-provider-exception.md b/doc/models/o-auth-provider-exception.md index 92f220d..89c466c 100644 --- a/doc/models/o-auth-provider-exception.md +++ b/doc/models/o-auth-provider-exception.md @@ -15,13 +15,13 @@ OAuth 2 Authorization endpoint exception. | `error_description` | `String` | Optional | Gets or sets human-readable text providing additional information on error.
Used to assist the client developer in understanding the error that occurred. | | `error_uri` | `String` | Optional | Gets or sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. | -## Example (as JSON) - -```json -{ - "error": "unsupported_grant_type", - "error_description": "error_description8", - "error_uri": "error_uri8" -} +## Example + +```ruby +begin + # make the API call +rescue OAuthProviderException => e + puts "Caught OAuthProviderException: #{e.message}" +end ``` diff --git a/doc/models/o-auth-token.md b/doc/models/o-auth-token.md index 1e1c481..8a4e728 100644 --- a/doc/models/o-auth-token.md +++ b/doc/models/o-auth-token.md @@ -19,17 +19,17 @@ OAuth 2 Authorization endpoint response | `refresh_token` | `String` | Optional | Refresh token
Used to get a new access token when it expires. | | `id_token` | `String` | Optional | An ID token response type is of JSON Web Token (JWT) that contains claims about the identity of the authenticated user. | -## Example (as JSON) - -```json -{ - "access_token": "access_token4", - "token_type": "token_type6", - "expires_in": 74, - "scope": "scope6", - "expiry": 88, - "refresh_token": "refresh_token6", - "id_token": "id_token6" -} +## Example + +```ruby +o_auth_token = OAuthToken.new( + access_token: 'access_token4', + token_type: 'token_type4', + expires_in: 80, + scope: 'scope4', + expiry: 242, + refresh_token: 'refresh_token6', + id_token: 'id_token4' +) ``` diff --git a/doc/models/one-time-charge.md b/doc/models/one-time-charge.md index 8687f14..2156958 100644 --- a/doc/models/one-time-charge.md +++ b/doc/models/one-time-charge.md @@ -18,34 +18,34 @@ The one-time charge info at the time of checkout. | `subtotal` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `total_amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "taxes": { - "currency_code": "currency_code6", - "value": "value2" - }, - "product_price": { - "currency_code": "currency_code6", - "value": "value2" - }, - "subtotal": { - "currency_code": "currency_code2", - "value": "value8" - }, - "total_amount": { - "currency_code": "currency_code2", - "value": "value8" - } -} +## Example + +```ruby +one_time_charge = OneTimeCharge.new( + total_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + taxes: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + product_price: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + subtotal: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) +) ``` diff --git a/doc/models/order-application-context-landing-page.md b/doc/models/order-application-context-landing-page.md index 8b90ce5..de9827a 100644 --- a/doc/models/order-application-context-landing-page.md +++ b/doc/models/order-application-context-landing-page.md @@ -15,3 +15,9 @@ DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for | `BILLING` | When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. | | `NO_PREFERENCE` | When the customer clicks PayPal Checkout, the customer is redirected to either a page to log in to PayPal and approve the payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase, depending on their previous interaction with PayPal. | +## Example + +```ruby +order_application_context_landing_page = OrderApplicationContextLandingPage::LOGIN +``` + diff --git a/doc/models/order-application-context-shipping-preference.md b/doc/models/order-application-context-shipping-preference.md index 407668d..eac4a1a 100644 --- a/doc/models/order-application-context-shipping-preference.md +++ b/doc/models/order-application-context-shipping-preference.md @@ -15,3 +15,9 @@ DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address t | `NO_SHIPPING` | Redact the shipping address from the PayPal site. Recommended for digital goods. | | `SET_PROVIDED_ADDRESS` | Use the merchant-provided address. The customer cannot change this address on the PayPal site. | +## Example + +```ruby +order_application_context_shipping_preference = OrderApplicationContextShippingPreference::GET_FROM_FILE +``` + diff --git a/doc/models/order-application-context-user-action.md b/doc/models/order-application-context-user-action.md index 79b8008..d095b8c 100644 --- a/doc/models/order-application-context-user-action.md +++ b/doc/models/order-application-context-user-action.md @@ -14,3 +14,9 @@ DEPRECATED. Configures a Continue or Pay Now checkout flow. The fields in `appl | `CONTINUE` | After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when the final amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant page without processing the payment. | | `PAY_NOW` | After you redirect the customer to the PayPal payment page, a Pay Now button appears. Use this option when the final amount is known when the checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. | +## Example + +```ruby +order_application_context_user_action = OrderApplicationContextUserAction::CONTINUE +``` + diff --git a/doc/models/order-application-context.md b/doc/models/order-application-context.md index 0d3b2cd..d20de4d 100644 --- a/doc/models/order-application-context.md +++ b/doc/models/order-application-context.md @@ -21,15 +21,15 @@ Customizes the payer experience during the approval process for the payment with | `cancel_url` | `String` | Optional | DEPRECATED. The URL where the customer is redirected after the customer cancels the payment. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.cancel_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. | | `stored_payment_source` | [`StoredPaymentSource`](../../doc/models/stored-payment-source.md) | Optional | DEPRECATED. Provides additional details to process a payment using a `payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. . The fields in `stored_payment_source` are now available in the `stored_credential` object under the `payment_source` which supports them (eg. `payment_source.card.stored_credential.payment_initiator`). Please specify this field in the `payment_source` object instead of the `application_context` object. | -## Example (as JSON) - -```json -{ - "landing_page": "NO_PREFERENCE", - "shipping_preference": "GET_FROM_FILE", - "user_action": "CONTINUE", - "brand_name": "brand_name2", - "locale": "locale6" -} +## Example + +```ruby +order_application_context = OrderApplicationContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + landing_page: OrderApplicationContextLandingPage::NO_PREFERENCE, + shipping_preference: OrderApplicationContextShippingPreference::GET_FROM_FILE, + user_action: OrderApplicationContextUserAction::CONTINUE +) ``` diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md index 3834c7b..a802fb0 100644 --- a/doc/models/order-authorize-request-payment-source.md +++ b/doc/models/order-authorize-request-payment-source.md @@ -18,108 +18,106 @@ The payment source definition. | `google_pay` | [`GooglePayRequest`](../../doc/models/google-pay-request.md) | Optional | Information needed to pay using Google Pay. | | `venmo` | [`VenmoWalletRequest`](../../doc/models/venmo-wallet-request.md) | Optional | Information needed to pay using Venmo. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } -} +```ruby +order_authorize_request_payment_source = OrderAuthorizeRequestPaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + apple_pay: ApplePayRequest.new( + id: 'id0', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + decrypted_token: ApplePayDecryptedTokenData.new( + tokenized_card: ApplePayTokenizedCard.new( + name: 'name4', + number: 'number2', + expiry: 'expiry2', + type: CardType::UNKNOWN + ), + transaction_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + device_manufacturer_id: 'device_manufacturer_id6', + payment_data_type: ApplePayPaymentDataType::ENUM_3DSECURE, + payment_data: ApplePayPaymentData.new( + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0', + emv_data: 'emv_data0', + pin: 'pin4' + ) + ) + ), + google_pay: GooglePayRequest.new( + name: 'name8', + email_address: 'email_address6', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayRequestCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + decrypted_token: GooglePayDecryptedTokenData.new( + payment_method: GooglePayPaymentMethod::CARD, + card: GooglePayCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + type: CardType::UNKNOWN + ), + authentication_method: GooglePayAuthenticationMethod::PAN_ONLY, + message_id: 'message_id0', + message_expiration: 'message_expiration2', + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0' + ) + ) +) ``` diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md index 331a5ca..3d37df2 100644 --- a/doc/models/order-authorize-request.md +++ b/doc/models/order-authorize-request.md @@ -13,110 +13,108 @@ The authorization of an order request. | --- | --- | --- | --- | | `payment_source` | [`OrderAuthorizeRequestPaymentSource`](../../doc/models/order-authorize-request-payment-source.md) | Optional | The payment source definition. | -## Example (as JSON) +## Example -```json -{ - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } - } -} +```ruby +order_authorize_request = OrderAuthorizeRequest.new( + payment_source: OrderAuthorizeRequestPaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + apple_pay: ApplePayRequest.new( + id: 'id0', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + decrypted_token: ApplePayDecryptedTokenData.new( + tokenized_card: ApplePayTokenizedCard.new( + name: 'name4', + number: 'number2', + expiry: 'expiry2', + type: CardType::UNKNOWN + ), + transaction_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + device_manufacturer_id: 'device_manufacturer_id6', + payment_data_type: ApplePayPaymentDataType::ENUM_3DSECURE, + payment_data: ApplePayPaymentData.new( + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0', + emv_data: 'emv_data0', + pin: 'pin4' + ) + ) + ), + google_pay: GooglePayRequest.new( + name: 'name8', + email_address: 'email_address6', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayRequestCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + decrypted_token: GooglePayDecryptedTokenData.new( + payment_method: GooglePayPaymentMethod::CARD, + card: GooglePayCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + type: CardType::UNKNOWN + ), + authentication_method: GooglePayAuthenticationMethod::PAN_ONLY, + message_id: 'message_id0', + message_expiration: 'message_expiration2', + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0' + ) + ) + ) +) ``` diff --git a/doc/models/order-authorize-response-payment-source.md b/doc/models/order-authorize-response-payment-source.md index 94a9e35..a8892b7 100644 --- a/doc/models/order-authorize-response-payment-source.md +++ b/doc/models/order-authorize-response-payment-source.md @@ -17,72 +17,66 @@ The payment source used to fund the payment. | `google_pay` | [`GooglePayWalletResponse`](../../doc/models/google-pay-wallet-response.md) | Optional | Google Pay Wallet payment data. | | `venmo` | [`VenmoWalletResponse`](../../doc/models/venmo-wallet-response.md) | Optional | Venmo wallet response. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "apple_pay": { - "id": "id0", - "token": "token6", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - }, - "venmo": { - "email_address": "email_address4", - "account_id": "account_id8", - "user_name": "user_name2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_number": { - "national_number": "national_number6" - } - } -} +```ruby +order_authorize_response_payment_source = OrderAuthorizeResponsePaymentSource.new( + card: CardResponse.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + type: CardType::UNKNOWN + ), + paypal: PaypalWalletResponse.new( + email_address: 'email_address0', + account_id: 'account_id4', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_type: PhoneType::FAX + ), + apple_pay: ApplePayPaymentObject.new( + id: 'id0', + token: 'token6', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ) + ), + google_pay: GooglePayWalletResponse.new( + name: 'name8', + email_address: 'email_address6', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayCardResponse.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ), + venmo: VenmoWalletResponse.new( + email_address: 'email_address4', + account_id: 'account_id8', + user_name: 'user_name2', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ) + ) +) ``` diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md index 3841a89..2f83de4 100644 --- a/doc/models/order-authorize-response.md +++ b/doc/models/order-authorize-response.md @@ -22,78 +22,71 @@ The order authorize response. | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | -## Example (as JSON) +## Example -```json -{ - "create_time": "create_time0", - "update_time": "update_time4", - "id": "id4", - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "apple_pay": { - "id": "id0", - "token": "token6", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - }, - "venmo": { - "email_address": "email_address4", - "account_id": "account_id8", - "user_name": "user_name2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_number": { - "national_number": "national_number6" - } - } - }, - "intent": "CAPTURE" -} +```ruby +order_authorize_response = OrderAuthorizeResponse.new( + create_time: 'create_time6', + update_time: 'update_time2', + payment_source: OrderAuthorizeResponsePaymentSource.new( + card: CardResponse.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + type: CardType::UNKNOWN + ), + paypal: PaypalWalletResponse.new( + email_address: 'email_address0', + account_id: 'account_id4', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_type: PhoneType::FAX + ), + apple_pay: ApplePayPaymentObject.new( + id: 'id0', + token: 'token6', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ) + ), + google_pay: GooglePayWalletResponse.new( + name: 'name8', + email_address: 'email_address6', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayCardResponse.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ), + venmo: VenmoWalletResponse.new( + email_address: 'email_address4', + account_id: 'account_id8', + user_name: 'user_name2', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ) + ) + ), + intent: CheckoutPaymentIntent::CAPTURE +) ``` diff --git a/doc/models/order-billing-plan.md b/doc/models/order-billing-plan.md index 34ac242..168fb93 100644 --- a/doc/models/order-billing-plan.md +++ b/doc/models/order-billing-plan.md @@ -15,34 +15,38 @@ Metadata for merchant-managed recurring billing plans. Valid only during the sav | `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `name` | `String` | Optional | Name of the recurring plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[A-Za-z0-9() +',.:-]+$` | -## Example (as JSON) - -```json -{ - "billing_cycles": [ - { - "tenure_type": "REGULAR", - "total_cycles": 1, - "sequence": 1, - "pricing_scheme": { - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "AUTO_RELOAD", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - "start_date": "start_date6" - } +## Example + +```ruby +order_billing_plan = OrderBillingPlan.new( + billing_cycles: [ + BillingCycle.new( + tenure_type: TenureType::REGULAR, + pricing_scheme: PricingScheme.new( + pricing_model: PricingModel::AUTO_RELOAD, + price: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + reload_threshold_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ) + ), + total_cycles: 1, + sequence: 1, + start_date: 'start_date6', + frequency: CycleFrequency.new( + interval_unit: FrequencyIntervalUnit::LIFETIME, + interval_count: 94 + ) + ) ], - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "name": "name4" -} + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + name: 'name4' +) ``` diff --git a/doc/models/order-capture-request-payment-source.md b/doc/models/order-capture-request-payment-source.md index 4fde855..de56145 100644 --- a/doc/models/order-capture-request-payment-source.md +++ b/doc/models/order-capture-request-payment-source.md @@ -18,108 +18,106 @@ The payment source definition. | `google_pay` | [`GooglePayRequest`](../../doc/models/google-pay-request.md) | Optional | Information needed to pay using Google Pay. | | `venmo` | [`VenmoWalletRequest`](../../doc/models/venmo-wallet-request.md) | Optional | Information needed to pay using Venmo. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } -} +```ruby +order_capture_request_payment_source = OrderCaptureRequestPaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + apple_pay: ApplePayRequest.new( + id: 'id0', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + decrypted_token: ApplePayDecryptedTokenData.new( + tokenized_card: ApplePayTokenizedCard.new( + name: 'name4', + number: 'number2', + expiry: 'expiry2', + type: CardType::UNKNOWN + ), + transaction_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + device_manufacturer_id: 'device_manufacturer_id6', + payment_data_type: ApplePayPaymentDataType::ENUM_3DSECURE, + payment_data: ApplePayPaymentData.new( + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0', + emv_data: 'emv_data0', + pin: 'pin4' + ) + ) + ), + google_pay: GooglePayRequest.new( + name: 'name8', + email_address: 'email_address6', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayRequestCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + decrypted_token: GooglePayDecryptedTokenData.new( + payment_method: GooglePayPaymentMethod::CARD, + card: GooglePayCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + type: CardType::UNKNOWN + ), + authentication_method: GooglePayAuthenticationMethod::PAN_ONLY, + message_id: 'message_id0', + message_expiration: 'message_expiration2', + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0' + ) + ) +) ``` diff --git a/doc/models/order-capture-request.md b/doc/models/order-capture-request.md index 0c73415..4748315 100644 --- a/doc/models/order-capture-request.md +++ b/doc/models/order-capture-request.md @@ -13,110 +13,108 @@ Completes an capture payment for an order. | --- | --- | --- | --- | | `payment_source` | [`OrderCaptureRequestPaymentSource`](../../doc/models/order-capture-request-payment-source.md) | Optional | The payment source definition. | -## Example (as JSON) +## Example -```json -{ - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "apple_pay": { - "id": "id0", - "name": "name0", - "email_address": "email_address8", - "phone_number": { - "national_number": "national_number6" - }, - "decrypted_token": { - "transaction_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "tokenized_card": { - "name": "name4", - "number": "number2", - "expiry": "expiry2", - "card_type": "VISA", - "type": "UNKNOWN" - }, - "device_manufacturer_id": "device_manufacturer_id6", - "payment_data_type": "3DSECURE", - "payment_data": { - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0", - "emv_data": "emv_data0", - "pin": "pin4" - } - } - }, - "google_pay": { - "name": "name8", - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "card": { - "name": "name6", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "decrypted_token": { - "message_id": "message_id0", - "message_expiration": "message_expiration2", - "payment_method": "CARD", - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "last_digits": "last_digits0", - "type": "UNKNOWN" - }, - "authentication_method": "PAN_ONLY", - "cryptogram": "cryptogram6", - "eci_indicator": "eci_indicator0" - } - } - } -} +```ruby +order_capture_request = OrderCaptureRequest.new( + payment_source: OrderCaptureRequestPaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + apple_pay: ApplePayRequest.new( + id: 'id0', + name: 'name0', + email_address: 'email_address8', + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + decrypted_token: ApplePayDecryptedTokenData.new( + tokenized_card: ApplePayTokenizedCard.new( + name: 'name4', + number: 'number2', + expiry: 'expiry2', + type: CardType::UNKNOWN + ), + transaction_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + device_manufacturer_id: 'device_manufacturer_id6', + payment_data_type: ApplePayPaymentDataType::ENUM_3DSECURE, + payment_data: ApplePayPaymentData.new( + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0', + emv_data: 'emv_data0', + pin: 'pin4' + ) + ) + ), + google_pay: GooglePayRequest.new( + name: 'name8', + email_address: 'email_address6', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + card: GooglePayRequestCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + decrypted_token: GooglePayDecryptedTokenData.new( + payment_method: GooglePayPaymentMethod::CARD, + card: GooglePayCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + type: CardType::UNKNOWN + ), + authentication_method: GooglePayAuthenticationMethod::PAN_ONLY, + message_id: 'message_id0', + message_expiration: 'message_expiration2', + cryptogram: 'cryptogram6', + eci_indicator: 'eci_indicator0' + ) + ) + ) +) ``` diff --git a/doc/models/order-confirm-application-context.md b/doc/models/order-confirm-application-context.md index 81f1290..12c6c8e 100644 --- a/doc/models/order-confirm-application-context.md +++ b/doc/models/order-confirm-application-context.md @@ -17,25 +17,25 @@ Customizes the payer confirmation experience. | `cancel_url` | `String` | Optional | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | | `stored_payment_source` | [`StoredPaymentSource`](../../doc/models/stored-payment-source.md) | Optional | Provides additional details to process a payment using a `payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. | -## Example (as JSON) - -```json -{ - "brand_name": "brand_name6", - "locale": "locale0", - "return_url": "return_url8", - "cancel_url": "cancel_url0", - "stored_payment_source": { - "payment_initiator": "CUSTOMER", - "payment_type": "RECURRING", - "usage": "FIRST", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } - } -} +## Example + +```ruby +order_confirm_application_context = OrderConfirmApplicationContext.new( + brand_name: 'brand_name2', + locale: 'locale2', + return_url: 'return_url0', + cancel_url: 'cancel_url2', + stored_payment_source: StoredPaymentSource.new( + payment_initiator: PaymentInitiator::CUSTOMER, + payment_type: StoredPaymentSourcePaymentType::RECURRING, + usage: StoredPaymentSourceUsageType::FIRST, + previous_network_transaction_reference: NetworkTransaction.new( + id: 'id6', + date: 'date2', + network: CardBrand::CONFIDIS, + acquirer_reference_number: 'acquirer_reference_number8' + ) + ) +) ``` diff --git a/doc/models/order-request.md b/doc/models/order-request.md index d396b0b..4f8753a 100644 --- a/doc/models/order-request.md +++ b/doc/models/order-request.md @@ -18,175 +18,175 @@ The order request details. | `payment_source` | [`PaymentSource`](../../doc/models/payment-source.md) | Optional | The payment source definition. | | `application_context` | [`OrderApplicationContext`](../../doc/models/order-application-context.md) | Optional | Customizes the payer experience during the approval process for the payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values. | -## Example (as JSON) +## Example -```json -{ - "intent": "CAPTURE", - "purchase_units": [ - { - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "payment_instruction": { - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } +```ruby +order_request = OrderRequest.new( + intent: CheckoutPaymentIntent::CAPTURE, + purchase_units: [ + PurchaseUnitRequest.new( + amount: AmountWithBreakdown.new( + currency_code: 'currency_code6', + value: 'value0', + breakdown: AmountBreakdown.new( + item_total: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + shipping: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + handling: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + tax_total: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + insurance: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) + ) + ), + reference_id: 'reference_id4', + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ), + payment_instruction: PaymentInstruction.new( + platform_fees: [ + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ) ], - "disbursement_mode": "INSTANT", - "payee_pricing_tier_id": "payee_pricing_tier_id2", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - }, - "description": "description6", - "custom_id": "custom_id4" - } + disbursement_mode: DisbursementMode::INSTANT, + payee_pricing_tier_id: 'payee_pricing_tier_id2', + payee_receivable_fx_rate_id: 'payee_receivable_fx_rate_id0' + ), + description: 'description6', + custom_id: 'custom_id4' + ) ], - "processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL", - "payer": { - "email_address": "email_address6", - "payer_id": "payer_id6", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date4" - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } - } - }, - "application_context": { - "brand_name": "brand_name8", - "locale": "locale2", - "landing_page": "BILLING", - "shipping_preference": "SET_PROVIDED_ADDRESS", - "user_action": "CONTINUE" - } -} + processing_instruction: ProcessingInstruction::ORDER_COMPLETE_ON_PAYMENT_APPROVAL, + payer: Payer.new( + email_address: 'email_address6', + payer_id: 'payer_id6', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date4' + ), + payment_source: PaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + bancontact: BancontactPaymentRequest.new( + name: 'name0', + country_code: 'country_code0', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) + ), + blik: BlikPaymentRequest.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + experience_context: BlikExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ), + level_0: BlikLevel0PaymentObject.new( + auth_code: 'auth_code8' + ), + one_click: BlikOneClickPaymentRequest.new( + consumer_reference: 'consumer_reference2', + auth_code: 'auth_code0', + alias_label: 'alias_label6', + alias_key: 'alias_key4' + ) + ) + ), + application_context: OrderApplicationContext.new( + brand_name: 'brand_name8', + locale: 'locale2', + landing_page: OrderApplicationContextLandingPage::BILLING, + shipping_preference: OrderApplicationContextShippingPreference::SET_PROVIDED_ADDRESS, + user_action: OrderApplicationContextUserAction::CONTINUE + ) +) ``` diff --git a/doc/models/order-status.md b/doc/models/order-status.md index e2f2a0e..b75f7b8 100644 --- a/doc/models/order-status.md +++ b/doc/models/order-status.md @@ -18,3 +18,9 @@ The order status. | `COMPLETED` | The intent of the order was completed and a `payments` resource was created. Important: Check the payment status in `purchase_units[].payments.captures[].status` before fulfilling the order. A completed order can indicate a payment was authorized, an authorized payment was captured, or a payment was declined. | | `PAYER_ACTION_REQUIRED` | The order requires an action from the payer (e.g. 3DS authentication). Redirect the payer to the "rel":"payer-action" HATEOAS link returned as part of the response prior to authorizing or capturing the order. Some payment sources may not return a payer-action HATEOAS link (eg. MB WAY). For these payment sources the payer-action is managed by the scheme itself (eg. through SMS, email, in-app notification, etc). | +## Example + +```ruby +order_status = OrderStatus::COMPLETED +``` + diff --git a/doc/models/order-tracker-item.md b/doc/models/order-tracker-item.md index 4042abe..17e1ce4 100644 --- a/doc/models/order-tracker-item.md +++ b/doc/models/order-tracker-item.md @@ -18,15 +18,15 @@ The details of the items in the shipment. | `image_url` | `String` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | -## Example (as JSON) - -```json -{ - "name": "name6", - "quantity": "quantity2", - "sku": "sku2", - "url": "url0", - "image_url": "image_url2" -} +## Example + +```ruby +order_tracker_item = OrderTrackerItem.new( + name: 'name2', + quantity: 'quantity8', + sku: 'sku8', + url: 'url6', + image_url: 'image_url8' +) ``` diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md index 2add137..c5bb5be 100644 --- a/doc/models/order-tracker-request.md +++ b/doc/models/order-tracker-request.md @@ -18,31 +18,24 @@ The tracking details of an order. | `notify_payer` | `TrueClass \| FalseClass` | Optional | If true, PayPal will send an email notification to the payer of the PayPal transaction. The email contains the tracking details provided through the Orders tracking API request. Independent of any value passed for `notify_payer`, the payer may receive tracking notifications within the PayPal app, based on the user's notification preferences.

**Default**: `false` | | `items` | [`Array[OrderTrackerItem]`](../../doc/models/order-tracker-item.md) | Optional | An array of details of items in the shipment. | -## Example (as JSON) - -```json -{ - "capture_id": "capture_id0", - "notify_payer": false, - "tracking_number": "tracking_number6", - "carrier": "ACS_GR", - "carrier_name_other": "carrier_name_other0", - "items": [ - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - }, - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - } +## Example + +```ruby +order_tracker_request = OrderTrackerRequest.new( + capture_id: 'capture_id8', + tracking_number: 'tracking_number4', + carrier: ShipmentCarrier::IBVENTURE_WEBHOOK, + carrier_name_other: 'carrier_name_other8', + notify_payer: false, + items: [ + OrderTrackerItem.new( + name: 'name8', + quantity: 'quantity4', + sku: 'sku6', + url: 'url2', + image_url: 'image_url4' + ) ] -} +) ``` diff --git a/doc/models/order-tracker-response.md b/doc/models/order-tracker-response.md index 91d5b06..4dbcab6 100644 --- a/doc/models/order-tracker-response.md +++ b/doc/models/order-tracker-response.md @@ -18,46 +18,28 @@ The tracking response on creation of tracker. | `create_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})$` | | `update_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})$` | -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "CANCELLED", - "items": [ - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - }, - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - } +## Example + +```ruby +order_tracker_response = OrderTrackerResponse.new( + status: OrderTrackerStatus::CANCELLED, + items: [ + OrderTrackerItem.new( + name: 'name8', + quantity: 'quantity4', + sku: 'sku6', + url: 'url2', + image_url: 'image_url4' + ), + OrderTrackerItem.new( + name: 'name8', + quantity: 'quantity4', + sku: 'sku6', + url: 'url2', + image_url: 'image_url4' + ) ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "create_time": "create_time8" -} + create_time: 'create_time0' +) ``` diff --git a/doc/models/order-tracker-status.md b/doc/models/order-tracker-status.md index 57a4c73..566e204 100644 --- a/doc/models/order-tracker-status.md +++ b/doc/models/order-tracker-status.md @@ -14,3 +14,9 @@ The status of the item shipment. | `CANCELLED` | The shipment was cancelled and the tracking number no longer applies. | | `SHIPPED` | The merchant has assigned a tracking number to the items being shipped from the Order. This does not correspond to the carrier's actual status for the shipment. The latest status of the parcel must be retrieved from the carrier. | +## Example + +```ruby +order_tracker_status = OrderTrackerStatus::CANCELLED +``` + diff --git a/doc/models/order.md b/doc/models/order.md index 372905b..5e46ac7 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -22,55 +22,49 @@ The order details. | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | -## Example (as JSON) +## Example -```json -{ - "create_time": "create_time8", - "update_time": "update_time4", - "id": "id2", - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "bic": "bic2", - "iban_last_chars": "iban_last_chars8", - "card_last_digits": "card_last_digits4" - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "one_click": { - "consumer_reference": "consumer_reference2" - } - }, - "eps": { - "name": "name6", - "country_code": "country_code6", - "bic": "bic8" - } - }, - "intent": "CAPTURE" -} +```ruby +order = Order.new( + create_time: 'create_time2', + update_time: 'update_time8', + payment_source: PaymentSourceResponse.new( + card: CardResponse.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + type: CardType::UNKNOWN + ), + paypal: PaypalWalletResponse.new( + email_address: 'email_address0', + account_id: 'account_id4', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_type: PhoneType::FAX + ), + bancontact: BancontactPaymentObject.new( + name: 'name0', + country_code: 'country_code0', + bic: 'bic2', + iban_last_chars: 'iban_last_chars8', + card_last_digits: 'card_last_digits4' + ), + blik: BlikPaymentObject.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + one_click: BlikOneClickPaymentObject.new( + consumer_reference: 'consumer_reference2' + ) + ), + eps: EpsPaymentObject.new( + name: 'name6', + country_code: 'country_code6', + bic: 'bic8' + ) + ), + intent: CheckoutPaymentIntent::CAPTURE +) ``` diff --git a/doc/models/orders-capture.md b/doc/models/orders-capture.md index 6bcf8cf..d7587bd 100644 --- a/doc/models/orders-capture.md +++ b/doc/models/orders-capture.md @@ -27,22 +27,19 @@ A captured payment. | `create_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})$` | | `update_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})$` | -## Example (as JSON) - -```json -{ - "final_capture": false, - "disbursement_mode": "INSTANT", - "status": "REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" -} +## Example + +```ruby +orders_capture = OrdersCapture.new( + status_details: CaptureStatusDetails.new( + reason: CaptureIncompleteReason::VERIFICATION_REQUIRED + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + final_capture: false, + disbursement_mode: DisbursementMode::INSTANT +) ``` diff --git a/doc/models/orders-card-verification-method.md b/doc/models/orders-card-verification-method.md index 6e03873..81495e7 100644 --- a/doc/models/orders-card-verification-method.md +++ b/doc/models/orders-card-verification-method.md @@ -16,3 +16,9 @@ The method used for card verification. | `ENUM_3D_SECURE` | The contingency surfaced as an additional security layer that helps prevent unauthorized card-not-present transactions and protects the merchant from exposure to fraud. | | `AVS_CVV` | Places a temporary hold on the card to ensure its validity. This process protects the merchant from exposure to fraud. This verification method will confirm that the address information or CVV included matches what the issuing bank has on file for the associated card, ensuring that only authorized card users are able to make purchases from you. | +## Example + +```ruby +orders_card_verification_method = OrdersCardVerificationMethod::ENUM_3D_SECURE +``` + diff --git a/doc/models/os-type.md b/doc/models/os-type.md index 75d9fb7..09bdb44 100644 --- a/doc/models/os-type.md +++ b/doc/models/os-type.md @@ -15,3 +15,9 @@ Operating System type of the device that the buyer is using. | `IOS` | Apple OS typically found in Apple mobile devices. | | `OTHER` | Any other OS type. | +## Example + +```ruby +os_type = OsType::IOS +``` + diff --git a/doc/models/p24-payment-object.md b/doc/models/p24-payment-object.md index 198439e..3c0aad2 100644 --- a/doc/models/p24-payment-object.md +++ b/doc/models/p24-payment-object.md @@ -18,15 +18,15 @@ Information used to pay using P24(Przelewy24). | `method_id` | `String` | Optional | Numeric identifier of the payment scheme or bank used for the payment.

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

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name6", - "email": "email0", - "country_code": "country_code6", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +p24_payment_request = P24PaymentRequest.new( + name: 'name0', + email: 'email6', + country_code: 'country_code0', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/pa-res-status.md b/doc/models/pa-res-status.md index 5f5de32..844629c 100644 --- a/doc/models/pa-res-status.md +++ b/doc/models/pa-res-status.md @@ -20,3 +20,9 @@ Transactions status result identifier. The outcome of the issuer's authenticatio | `DECOUPLEDAUTHENTICATION` | Challenge required; decoupled authentication confirmed. | | `INFORMATIONALONLY` | Informational only; 3DS requestor challenge preference acknowledged. | +## Example + +```ruby +pa_res_status = PaResStatus::DECOUPLEDAUTHENTICATION +``` + diff --git a/doc/models/participant-metadata.md b/doc/models/participant-metadata.md index d995e93..1bfbde5 100644 --- a/doc/models/participant-metadata.md +++ b/doc/models/participant-metadata.md @@ -13,11 +13,11 @@ Profile information of the sender or receiver. | --- | --- | --- | --- | | `ip_address` | `String` | Optional | An Internet Protocol address (IP address). This address assigns a numerical label to each device that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6 addresses.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `39`, *Pattern*: `^(([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])\.){3}([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])$\|^(([a-zA-Z]\|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]\|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$\|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}\|:))\|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}\|((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})\|:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})\|((:[0-9A-Fa-f]{1,4})?:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})\|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})\|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})\|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(:(((:[0-9A-Fa-f]{1,4}){1,7})\|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:)))(%.+)?\s*$` | -## Example (as JSON) +## Example -```json -{ - "ip_address": "ip_address2" -} +```ruby +participant_metadata = ParticipantMetadata.new( + ip_address: 'ip_address4' +) ``` diff --git a/doc/models/patch-op.md b/doc/models/patch-op.md index 2aded25..a50fd37 100644 --- a/doc/models/patch-op.md +++ b/doc/models/patch-op.md @@ -18,3 +18,9 @@ The operation. | `COPY` | Copies the value at a specified location to the target location. The operation object must contain a from parameter, which is a string that contains a JSON pointer value that references the location in the target document from which to copy the value. For the operation to succeed, the from location must exist. For more information, see 4.5. copy. | | `TEST` | Tests that a value at the target location is equal to a specified value. The operation object must contain a value parameter that defines the value to compare to the target location's value. For the operation to succeed, the target location must be equal to the value value. For test, equal indicates that the value at the target location and the value that value defines are of the same JSON type. The data type of the value determines how equality is defined: Type Considered equal if both values strings Contain the same number of Unicode characters and their code points are byte-by-byte equal. numbers Are numerically equal. arrays Contain the same number of values, and each value is equal to the value at the corresponding position in the other array, by using these type-specific rules. objects Contain the same number of parameters, and each parameter is equal to a parameter in the other object, by comparing their keys (as strings) and their values (by using these type-specific rules). literals (false, true, and null) Are the same. The comparison is a logical comparison. For example, whitespace between the parameter values of an array is not significant. Also, ordering of the serialization of object parameters is not significant. For more information, see 4.6. test. | +## Example + +```ruby +patch_op = PatchOp::ADD +``` + diff --git a/doc/models/patch.md b/doc/models/patch.md index 7002744..50920bd 100644 --- a/doc/models/patch.md +++ b/doc/models/patch.md @@ -16,17 +16,14 @@ The JSON patch object to apply partial updates to resources. | `value` | `Object` | Optional | The value to apply. The remove, copy, and move operations do not require a value. Since JSON Patch allows any type for value, the type property is not specified. | | `from` | `String` | Optional | The JSON Pointer to the target document location from which to move the value. Required for the move operation. | -## Example (as JSON) - -```json -{ - "op": "add", - "path": "path6", - "value": { - "key1": "val1", - "key2": "val2" - }, - "from": "from0" -} +## Example + +```ruby +patch = Patch.new( + op: PatchOp::COPY, + path: 'path4', + value: JSON.parse('{"key1":"val1","key2":"val2"}'), + from: 'from2' +) ``` diff --git a/doc/models/payee-base.md b/doc/models/payee-base.md index 57ef39d..4386482 100644 --- a/doc/models/payee-base.md +++ b/doc/models/payee-base.md @@ -14,12 +14,12 @@ The details for the merchant who receives the funds and fulfills the order. The | `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `merchant_id` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address0", - "merchant_id": "merchant_id2" -} +```ruby +payee_base = PayeeBase.new( + email_address: 'email_address6', + merchant_id: 'merchant_id8' +) ``` diff --git a/doc/models/payee-payment-method-preference.md b/doc/models/payee-payment-method-preference.md index 526c1ed..b73b303 100644 --- a/doc/models/payee-payment-method-preference.md +++ b/doc/models/payee-payment-method-preference.md @@ -14,3 +14,9 @@ The merchant-preferred payment methods. | `UNRESTRICTED` | Accepts any type of payment from the customer. | | `IMMEDIATE_PAYMENT_REQUIRED` | Accepts only immediate payment from the customer. For example, credit card, PayPal balance, or instant ACH. Ensures that at the time of capture, the payment does not have the `pending` status. | +## Example + +```ruby +payee_payment_method_preference = PayeePaymentMethodPreference::UNRESTRICTED +``` + diff --git a/doc/models/payer-base.md b/doc/models/payer-base.md index d53c5ef..d7654a7 100644 --- a/doc/models/payer-base.md +++ b/doc/models/payer-base.md @@ -14,12 +14,12 @@ The customer who approves and pays for the order. The customer is also known as | `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `payer_id` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address2", - "payer_id": "payer_id2" -} +```ruby +payer_base = PayerBase.new( + email_address: 'email_address8', + payer_id: 'payer_id8' +) ``` diff --git a/doc/models/payer-information.md b/doc/models/payer-information.md index 9d8ffbf..8820547 100644 --- a/doc/models/payer-information.md +++ b/doc/models/payer-information.md @@ -20,19 +20,19 @@ The payer information. | `country_code` | `String` | Optional | The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | -## Example (as JSON) - -```json -{ - "account_id": "account_id6", - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6", - "extension_number": "extension_number8" - }, - "address_status": "address_status2", - "payer_status": "payer_status8" -} +## Example + +```ruby +payer_information = PayerInformation.new( + account_id: 'account_id2', + email_address: 'email_address8', + phone_number: Phone.new( + country_code: 'country_code2', + national_number: 'national_number6', + extension_number: 'extension_number8' + ), + address_status: 'address_status8', + payer_status: 'payer_status2' +) ``` diff --git a/doc/models/payer-name.md b/doc/models/payer-name.md index 202fce3..40be978 100644 --- a/doc/models/payer-name.md +++ b/doc/models/payer-name.md @@ -19,15 +19,15 @@ The name of the party. | `alternate_full_name` | `String` | Optional | DEPRECATED. The party's alternate name. Can be a business name, nickname, or any other name that cannot be split into first, last name. Required when the party is a business.

**Constraints**: *Maximum Length*: `300` | | `full_name` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | -## Example (as JSON) - -```json -{ - "prefix": "prefix4", - "given_name": "given_name8", - "surname": "surname8", - "middle_name": "middle_name6", - "suffix": "suffix6" -} +## Example + +```ruby +payer_name = PayerName.new( + prefix: 'prefix8', + given_name: 'given_name2', + surname: 'surname8', + middle_name: 'middle_name0', + suffix: 'suffix0' +) ``` diff --git a/doc/models/payer.md b/doc/models/payer.md index 6119ec7..aae0800 100644 --- a/doc/models/payer.md +++ b/doc/models/payer.md @@ -19,23 +19,23 @@ The customer who approves and pays for the order. The customer is also known as | `tax_info` | [`TaxInfo`](../../doc/models/tax-info.md) | Optional | The tax ID of the customer. The customer is also known as the payer. Both `tax_id` and `tax_id_type` are required. | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "email_address": "email_address8", - "payer_id": "payer_id8", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date6" -} +## Example + +```ruby +payer = Payer.new( + email_address: 'email_address6', + payer_id: 'payer_id6', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date4' +) ``` diff --git a/doc/models/payment-advice-code.md b/doc/models/payment-advice-code.md index 8f087ed..3d4942c 100644 --- a/doc/models/payment-advice-code.md +++ b/doc/models/payment-advice-code.md @@ -27,3 +27,9 @@ The declined payment transactions might have payment advice codes. The card netw | `PAYMENTADVICE_40` | For Mastercard, consumer non-reloadable prepaid card. | | `PAYMENTADVICE_43` | For Mastercard, consumer multi-use virtual card number. | +## Example + +```ruby +payment_advice_code = PaymentAdviceCode::PAYMENTADVICE_43 +``` + diff --git a/doc/models/payment-authorization.md b/doc/models/payment-authorization.md index 82abb11..6d16ad4 100644 --- a/doc/models/payment-authorization.md +++ b/doc/models/payment-authorization.md @@ -26,20 +26,17 @@ The authorized payment transaction. | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -## Example (as JSON) - -```json -{ - "status": "VOIDED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id0", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id0" -} +## Example + +```ruby +payment_authorization = PaymentAuthorization.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/payment-collection.md b/doc/models/payment-collection.md index f2ef89b..ab600cb 100644 --- a/doc/models/payment-collection.md +++ b/doc/models/payment-collection.md @@ -15,100 +15,79 @@ The collection of payments, or transactions, for a purchase unit in an order. Fo | `captures` | [`Array[OrdersCapture]`](../../doc/models/orders-capture.md) | Optional | An array of captured payments for a purchase unit. A purchase unit can have zero or more captured payments. | | `refunds` | [`Array[Refund]`](../../doc/models/refund.md) | Optional | An array of refunds for a purchase unit. A purchase unit can have zero or more refunds. | -## Example (as JSON) +## Example -```json -{ - "authorizations": [ - { - "status": "DENIED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" - }, - { - "status": "DENIED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" - }, - { - "status": "DENIED", - "status_details": { - "reason": "PENDING_REVIEW" - }, - "id": "id2", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id2" - } +```ruby +payment_collection = PaymentCollection.new( + authorizations: [ + AuthorizationWithAdditionalData.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + AuthorizationWithAdditionalData.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + AuthorizationWithAdditionalData.new( + status_details: AuthorizationStatusDetails.new( + reason: AuthorizationIncompleteReason::PENDING_REVIEW + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ], - "captures": [ - { - "status": "REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4" - }, - { - "status": "REFUNDED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id4" - } + captures: [ + OrdersCapture.new( + status_details: CaptureStatusDetails.new( + reason: CaptureIncompleteReason::VERIFICATION_REQUIRED + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + OrdersCapture.new( + status_details: CaptureStatusDetails.new( + reason: CaptureIncompleteReason::VERIFICATION_REQUIRED + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ], - "refunds": [ - { - "status": "CANCELLED", - "status_details": { - "reason": "ECHECK" - }, - "id": "id8", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id8" - }, - { - "status": "CANCELLED", - "status_details": { - "reason": "ECHECK" - }, - "id": "id8", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id8" - } + refunds: [ + Refund.new( + status_details: RefundStatusDetails.new( + reason: RefundIncompleteReason::ECHECK + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + Refund.new( + status_details: RefundStatusDetails.new( + reason: RefundIncompleteReason::ECHECK + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] -} +) ``` diff --git a/doc/models/payment-initiator.md b/doc/models/payment-initiator.md index 034bc3b..cf500ee 100644 --- a/doc/models/payment-initiator.md +++ b/doc/models/payment-initiator.md @@ -14,3 +14,9 @@ The person or party who initiated or triggered the payment. | `CUSTOMER` | Payment is initiated with the active engagement of the customer. e.g. a customer checking out on a merchant website. | | `MERCHANT` | Payment is initiated by merchant on behalf of the customer without the active engagement of customer. e.g. a merchant charging the monthly payment of a subscription to the customer. | +## Example + +```ruby +payment_initiator = PaymentInitiator::CUSTOMER +``` + diff --git a/doc/models/payment-instruction.md b/doc/models/payment-instruction.md index cc1f53e..f358b9f 100644 --- a/doc/models/payment-instruction.md +++ b/doc/models/payment-instruction.md @@ -16,25 +16,45 @@ Any additional payment instructions to be consider during payment processing. Th | `payee_pricing_tier_id` | `String` | Optional | This field is only enabled for selected merchants/partners to use and provides the ability to trigger a specific pricing rate/plan for a payment transaction. The list of eligible 'payee_pricing_tier_id' would be provided to you by your Account Manager. Specifying values other than the one provided to you by your account manager would result in an error.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^.*$` | -## Example (as JSON) - -```json -{ - "disbursement_mode": "INSTANT", - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } +## Example + +```ruby +payment_instruction = PaymentInstruction.new( + platform_fees: [ + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ) ], - "payee_pricing_tier_id": "payee_pricing_tier_id6", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id4" -} + disbursement_mode: DisbursementMode::INSTANT, + payee_pricing_tier_id: 'payee_pricing_tier_id2', + payee_receivable_fx_rate_id: 'payee_receivable_fx_rate_id0' +) ``` diff --git a/doc/models/payment-method-preference.md b/doc/models/payment-method-preference.md index 557fce1..5380cbf 100644 --- a/doc/models/payment-method-preference.md +++ b/doc/models/payment-method-preference.md @@ -14,12 +14,12 @@ The customer and merchant payment preferences. | `payee_preferred` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `PayeePaymentMethodPreference::UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `standard_entry_class_code` | [`StandardEntryClassCode`](../../doc/models/standard-entry-class-code.md) | Optional | NACHA (the regulatory body governing the ACH network) requires that API callers (merchants, partners) obtain the consumer’s explicit authorization before initiating a transaction. To stay compliant, you’ll need to make sure that you retain a compliant authorization for each transaction that you originate to the ACH Network using this API. ACH transactions are categorized (using SEC codes) by how you capture authorization from the Receiver (the person whose bank account is being debited or credited). PayPal supports the following SEC codes.

**Default**: `StandardEntryClassCode::WEB`

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `255` | -## Example (as JSON) +## Example -```json -{ - "payee_preferred": "UNRESTRICTED", - "standard_entry_class_code": "WEB" -} +```ruby +payment_method_preference = PaymentMethodPreference.new( + payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED, + standard_entry_class_code: StandardEntryClassCode::WEB +) ``` diff --git a/doc/models/payment-method.md b/doc/models/payment-method.md index e732384..7a7a9eb 100644 --- a/doc/models/payment-method.md +++ b/doc/models/payment-method.md @@ -13,11 +13,11 @@ The customer and merchant payment preferences. | --- | --- | --- | --- | | `payee_preferred` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `PayeePaymentMethodPreference::UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "payee_preferred": "UNRESTRICTED" -} +```ruby +payment_method = PaymentMethod.new( + payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED +) ``` diff --git a/doc/models/payment-preferences-override.md b/doc/models/payment-preferences-override.md index 1541a42..c6efcc8 100644 --- a/doc/models/payment-preferences-override.md +++ b/doc/models/payment-preferences-override.md @@ -16,17 +16,17 @@ The payment preferences to override at subscription level. | `setup_fee_failure_action` | [`SetupFeeFailureAction`](../../doc/models/setup-fee-failure-action.md) | Optional | The action to take on the subscription if the initial payment for the setup fails.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `payment_failure_threshold` | `Integer` | Optional | The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.

**Constraints**: `>= 0`, `<= 999` | -## Example (as JSON) - -```json -{ - "auto_bill_outstanding": false, - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "setup_fee_failure_action": "CONTINUE", - "payment_failure_threshold": 80 -} +## Example + +```ruby +payment_preferences_override = PaymentPreferencesOverride.new( + auto_bill_outstanding: false, + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + setup_fee_failure_action: SetupFeeFailureAction::CONTINUE, + payment_failure_threshold: 78 +) ``` diff --git a/doc/models/payment-preferences.md b/doc/models/payment-preferences.md index 1d4532c..8df84a2 100644 --- a/doc/models/payment-preferences.md +++ b/doc/models/payment-preferences.md @@ -16,17 +16,17 @@ The payment preferences for a subscription. | `setup_fee_failure_action` | [`SetupFeeFailureAction`](../../doc/models/setup-fee-failure-action.md) | Optional | The action to take on the subscription if the initial payment for the setup fails.

**Default**: `SetupFeeFailureAction::CANCEL`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `payment_failure_threshold` | `Integer` | Optional | The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.

**Default**: `0`

**Constraints**: `>= 0`, `<= 999` | -## Example (as JSON) - -```json -{ - "auto_bill_outstanding": true, - "setup_fee_failure_action": "CANCEL", - "payment_failure_threshold": 0, - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - } -} +## Example + +```ruby +payment_preferences = PaymentPreferences.new( + auto_bill_outstanding: true, + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + setup_fee_failure_action: SetupFeeFailureAction::CANCEL, + payment_failure_threshold: 0 +) ``` diff --git a/doc/models/payment-source-response.md b/doc/models/payment-source-response.md index e413435..375372b 100644 --- a/doc/models/payment-source-response.md +++ b/doc/models/payment-source-response.md @@ -26,49 +26,44 @@ The payment source used to fund the payment. | `google_pay` | [`GooglePayWalletResponse`](../../doc/models/google-pay-wallet-response.md) | Optional | Google Pay Wallet payment data. | | `venmo` | [`VenmoWalletResponse`](../../doc/models/venmo-wallet-response.md) | Optional | Venmo wallet response. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "available_networks": [ - "DELTA" - ], - "type": "UNKNOWN" - }, - "paypal": { - "email_address": "email_address0", - "account_id": "account_id4", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "FAX" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "bic": "bic2", - "iban_last_chars": "iban_last_chars8", - "card_last_digits": "card_last_digits4" - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "one_click": { - "consumer_reference": "consumer_reference2" - } - }, - "eps": { - "name": "name6", - "country_code": "country_code6", - "bic": "bic8" - } -} +```ruby +payment_source_response = PaymentSourceResponse.new( + card: CardResponse.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + type: CardType::UNKNOWN + ), + paypal: PaypalWalletResponse.new( + email_address: 'email_address0', + account_id: 'account_id4', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_type: PhoneType::FAX + ), + bancontact: BancontactPaymentObject.new( + name: 'name0', + country_code: 'country_code0', + bic: 'bic2', + iban_last_chars: 'iban_last_chars8', + card_last_digits: 'card_last_digits4' + ), + blik: BlikPaymentObject.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + one_click: BlikOneClickPaymentObject.new( + consumer_reference: 'consumer_reference2' + ) + ), + eps: EpsPaymentObject.new( + name: 'name6', + country_code: 'country_code6', + bic: 'bic8' + ) +) ``` diff --git a/doc/models/payment-source.md b/doc/models/payment-source.md index 46b63b8..ec88824 100644 --- a/doc/models/payment-source.md +++ b/doc/models/payment-source.md @@ -27,75 +27,75 @@ The payment source definition. | `google_pay` | [`GooglePayRequest`](../../doc/models/google-pay-request.md) | Optional | Information needed to pay using Google Pay. | | `venmo` | [`VenmoWalletRequest`](../../doc/models/venmo-wallet-request.md) | Optional | Information needed to pay using Venmo. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "token": { - "id": "id6", - "type": "BILLING_AGREEMENT" - }, - "paypal": { - "vault_id": "vault_id0", - "email_address": "email_address0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date8" - }, - "bancontact": { - "name": "name0", - "country_code": "country_code0", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } - }, - "blik": { - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "level_0": { - "auth_code": "auth_code8" - }, - "one_click": { - "auth_code": "auth_code0", - "consumer_reference": "consumer_reference2", - "alias_label": "alias_label6", - "alias_key": "alias_key4" - } - } -} +```ruby +payment_source = PaymentSource.new( + card: CardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + token: Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT + ), + paypal: PaypalWallet.new( + vault_id: 'vault_id0', + email_address: 'email_address0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date8' + ), + bancontact: BancontactPaymentRequest.new( + name: 'name0', + country_code: 'country_code0', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) + ), + blik: BlikPaymentRequest.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + experience_context: BlikExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ), + level_0: BlikLevel0PaymentObject.new( + auth_code: 'auth_code8' + ), + one_click: BlikOneClickPaymentRequest.new( + consumer_reference: 'consumer_reference2', + auth_code: 'auth_code0', + alias_label: 'alias_label6', + alias_key: 'alias_key4' + ) + ) +) ``` diff --git a/doc/models/payment-supplementary-data.md b/doc/models/payment-supplementary-data.md index 7889100..a6bbc65 100644 --- a/doc/models/payment-supplementary-data.md +++ b/doc/models/payment-supplementary-data.md @@ -13,15 +13,15 @@ The supplementary data. | --- | --- | --- | --- | | `related_ids` | [`RelatedIdentifiers`](../../doc/models/related-identifiers.md) | Optional | Identifiers related to a specific resource. | -## Example (as JSON) - -```json -{ - "related_ids": { - "order_id": "order_id2", - "authorization_id": "authorization_id0", - "capture_id": "capture_id0" - } -} +## Example + +```ruby +payment_supplementary_data = PaymentSupplementaryData.new( + related_ids: RelatedIdentifiers.new( + order_id: 'order_id2', + authorization_id: 'authorization_id0', + capture_id: 'capture_id0' + ) +) ``` diff --git a/doc/models/payment-token-request-card.md b/doc/models/payment-token-request-card.md index a069904..41699a4 100644 --- a/doc/models/payment-token-request-card.md +++ b/doc/models/payment-token-request-card.md @@ -18,15 +18,15 @@ A Resource representing a request to vault a Card. | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "name": "name4", - "number": "number8", - "expiry": "expiry2", - "security_code": "security_code6", - "brand": "HIPER" -} +## Example + +```ruby +payment_token_request_card = PaymentTokenRequestCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + brand: CardBrand::RUPAY +) ``` diff --git a/doc/models/payment-token-request-payment-source.md b/doc/models/payment-token-request-payment-source.md index b7d8b30..4e00292 100644 --- a/doc/models/payment-token-request-payment-source.md +++ b/doc/models/payment-token-request-payment-source.md @@ -14,21 +14,21 @@ The payment method to vault with the instrument details. | `card` | [`PaymentTokenRequestCard`](../../doc/models/payment-token-request-card.md) | Optional | A Resource representing a request to vault a Card. | | `token` | [`VaultTokenRequest`](../../doc/models/vault-token-request.md) | Optional | The Tokenized Payment Source representing a Request to Vault a Token. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "token": { - "id": "id6", - "type": "SETUP_TOKEN" - } -} +## Example + +```ruby +payment_token_request_payment_source = PaymentTokenRequestPaymentSource.new( + card: PaymentTokenRequestCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + brand: CardBrand::CB_NATIONALE + ), + token: VaultTokenRequest.new( + id: 'id6', + type: VaultTokenRequestType::SETUP_TOKEN + ) +) ``` diff --git a/doc/models/payment-token-request.md b/doc/models/payment-token-request.md index 6354de7..a8a554c 100644 --- a/doc/models/payment-token-request.md +++ b/doc/models/payment-token-request.md @@ -14,27 +14,27 @@ Payment Token Request where the `source` defines the type of instrument to be st | `customer` | [`Customer`](../../doc/models/customer.md) | Optional | This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. | | `payment_source` | [`PaymentTokenRequestPaymentSource`](../../doc/models/payment-token-request-payment-source.md) | Required | The payment method to vault with the instrument details. | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "token": { - "id": "id6", - "type": "SETUP_TOKEN" - } - } -} +## Example + +```ruby +payment_token_request = PaymentTokenRequest.new( + payment_source: PaymentTokenRequestPaymentSource.new( + card: PaymentTokenRequestCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + brand: CardBrand::CB_NATIONALE + ), + token: VaultTokenRequest.new( + id: 'id6', + type: VaultTokenRequestType::SETUP_TOKEN + ) + ), + customer: Customer.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ) +) ``` diff --git a/doc/models/payment-token-response-payment-source.md b/doc/models/payment-token-response-payment-source.md index 2880cf6..3ba1fba 100644 --- a/doc/models/payment-token-response-payment-source.md +++ b/doc/models/payment-token-response-payment-source.md @@ -16,90 +16,38 @@ The vaulted payment method details. | `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional, Read-only | Full representation of a Venmo Payment Token. | | `apple_pay` | [`ApplePayPaymentToken`](../../doc/models/apple-pay-payment-token.md) | Optional | A resource representing a response for Apple Pay. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - } -} +## Example + +```ruby +payment_token_response_payment_source = PaymentTokenResponsePaymentSource.new( + card: CardPaymentTokenEntity.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + expiry: 'expiry4', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + apple_pay: ApplePayPaymentToken.new( + card: ApplePayCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ) +) ``` diff --git a/doc/models/payment-token-response.md b/doc/models/payment-token-response.md index b2b8f47..f5ccc52 100644 --- a/doc/models/payment-token-response.md +++ b/doc/models/payment-token-response.md @@ -16,109 +16,45 @@ Full representation of a saved payment token. | `payment_source` | [`PaymentTokenResponsePaymentSource`](../../doc/models/payment-token-response-payment-source.md) | Optional | The vaulted payment method details. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | -## Example (as JSON) - -```json -{ - "id": "id0", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```ruby +payment_token_response = PaymentTokenResponse.new( + id: 'id6', + customer: CustomerResponse.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ), + payment_source: PaymentTokenResponsePaymentSource.new( + card: CardPaymentTokenEntity.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + expiry: 'expiry4', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ), + apple_pay: ApplePayPaymentToken.new( + card: ApplePayCard.new( + name: 'name6', + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ) + ) +) ``` diff --git a/doc/models/payment-token-status.md b/doc/models/payment-token-status.md index 6b70b87..2f229ae 100644 --- a/doc/models/payment-token-status.md +++ b/doc/models/payment-token-status.md @@ -17,3 +17,9 @@ The status of the payment token. | `VAULTED` | The payment token has been vaulted. | | `TOKENIZED` | A vaulted payment method token has been tokenized for short term (one time) use. | +## Example + +```ruby +payment_token_status = PaymentTokenStatus::PAYER_ACTION_REQUIRED +``` + diff --git a/doc/models/payments-capture.md b/doc/models/payments-capture.md index 4dad9f8..7a4b1c6 100644 --- a/doc/models/payments-capture.md +++ b/doc/models/payments-capture.md @@ -27,22 +27,19 @@ A captured payment. | `create_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})$` | | `update_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})$` | -## Example (as JSON) - -```json -{ - "final_capture": false, - "disbursement_mode": "INSTANT", - "status": "COMPLETED", - "status_details": { - "reason": "VERIFICATION_REQUIRED" - }, - "id": "id0", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "invoice_id": "invoice_id0" -} +## Example + +```ruby +payments_capture = PaymentsCapture.new( + status_details: CaptureStatusDetails.new( + reason: CaptureIncompleteReason::VERIFICATION_REQUIRED + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + final_capture: false, + disbursement_mode: DisbursementMode::INSTANT +) ``` diff --git a/doc/models/paypal-experience-landing-page.md b/doc/models/paypal-experience-landing-page.md index 1936c28..b7374a1 100644 --- a/doc/models/paypal-experience-landing-page.md +++ b/doc/models/paypal-experience-landing-page.md @@ -16,3 +16,9 @@ The type of landing page to show on the PayPal site for customer checkout. | `NO_PREFERENCE` | When the customer clicks PayPal Checkout, the customer is redirected to either a page to log in to PayPal and approve the payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase, depending on their previous interaction with PayPal. | | `BILLING` | DEPRECATED - please use GUEST_CHECKOUT. All implementations of 'BILLING' will be routed to 'GUEST_CHECKOUT'. When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. | +## Example + +```ruby +paypal_experience_landing_page = PaypalExperienceLandingPage::NO_PREFERENCE +``` + diff --git a/doc/models/paypal-experience-user-action.md b/doc/models/paypal-experience-user-action.md index 1923b1f..1a06fa7 100644 --- a/doc/models/paypal-experience-user-action.md +++ b/doc/models/paypal-experience-user-action.md @@ -14,3 +14,9 @@ Configures a Continue or Pay Now checkout flow. | `CONTINUE` | After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when the final amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant page without processing the payment. | | `PAY_NOW` | After you redirect the customer to the PayPal payment page, a Pay Now button appears. Use this option when the final amount is known when the checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. | +## Example + +```ruby +paypal_experience_user_action = PaypalExperienceUserAction::CONTINUE +``` + diff --git a/doc/models/paypal-payment-token-customer-type.md b/doc/models/paypal-payment-token-customer-type.md index 81e62b3..de147fc 100644 --- a/doc/models/paypal-payment-token-customer-type.md +++ b/doc/models/paypal-payment-token-customer-type.md @@ -14,3 +14,9 @@ The customer type associated with the PayPal payment token. This is to indicate | `CONSUMER` | The customer vaulting the PayPal payment token is a consumer on the merchant / platform. | | `BUSINESS` | The customer vaulting the PayPal payment token is a business on merchant / platform. | +## Example + +```ruby +paypal_payment_token_customer_type = PaypalPaymentTokenCustomerType::CONSUMER +``` + diff --git a/doc/models/paypal-payment-token-usage-type.md b/doc/models/paypal-payment-token-usage-type.md index 0430527..3b7ead4 100644 --- a/doc/models/paypal-payment-token-usage-type.md +++ b/doc/models/paypal-payment-token-usage-type.md @@ -14,3 +14,9 @@ The usage type associated with the PayPal payment token., The usage type associa | `MERCHANT` | The PayPal Payment Token will be used for future transaction directly with a merchant. | | `PLATFORM` | The PayPal Payment Token will be used for future transaction on a platform. A platform is typically a marketplace or a channel that a payer can purchase goods and services from multiple merchants. | +## Example + +```ruby +paypal_payment_token_usage_type = PaypalPaymentTokenUsageType::MERCHANT +``` + diff --git a/doc/models/paypal-payment-token.md b/doc/models/paypal-payment-token.md index 9fe0ab8..a0db94f 100644 --- a/doc/models/paypal-payment-token.md +++ b/doc/models/paypal-payment-token.md @@ -25,33 +25,33 @@ Full representation of a PayPal Payment Token. | `account_id` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `phone_number` | [`Phone`](../../doc/models/phone.md) | Optional | The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description6", - "usage_pattern": "RECURRING_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```ruby +paypal_payment_token = PaypalPaymentToken.new( + description: 'description0', + usage_pattern: UsagePattern::RECURRING_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT +) ``` diff --git a/doc/models/paypal-reference-id-type.md b/doc/models/paypal-reference-id-type.md index dacdea4..a364cff 100644 --- a/doc/models/paypal-reference-id-type.md +++ b/doc/models/paypal-reference-id-type.md @@ -16,3 +16,9 @@ The PayPal reference ID type. | `SUB` | A subscription ID. | | `PAP` | A pre-approved payment ID. | +## Example + +```ruby +paypal_reference_id_type = PaypalReferenceIdType::ODR +``` + diff --git a/doc/models/paypal-wallet-account-verification-status.md b/doc/models/paypal-wallet-account-verification-status.md index fd04006..57edc90 100644 --- a/doc/models/paypal-wallet-account-verification-status.md +++ b/doc/models/paypal-wallet-account-verification-status.md @@ -14,3 +14,9 @@ The account status indicates whether the buyer has verified the financial detail | `VERIFIED` | The buyer has completed the verification of the financial details associated with this PayPal account. For example: confirming their bank account. | | `UNVERIFIED` | The buyer has not completed the verification of the financial details associated with this PayPal account. For example: confirming their bank account. | +## Example + +```ruby +paypal_wallet_account_verification_status = PaypalWalletAccountVerificationStatus::VERIFIED +``` + diff --git a/doc/models/paypal-wallet-attributes-response.md b/doc/models/paypal-wallet-attributes-response.md index a1199c1..1043ea9 100644 --- a/doc/models/paypal-wallet-attributes-response.md +++ b/doc/models/paypal-wallet-attributes-response.md @@ -14,66 +14,59 @@ Additional attributes associated with the use of a PayPal Wallet. | `vault` | [`PaypalWalletVaultResponse`](../../doc/models/paypal-wallet-vault-response.md) | Optional | The details about a saved PayPal Wallet payment source. | | `cobranded_cards` | [`Array[CobrandedCard]`](../../doc/models/cobranded-card.md) | Optional | An array of merchant cobranded cards used by buyer to complete an order. This array will be present if a merchant has onboarded their cobranded card with PayPal and provided corresponding label(s).

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `25` | -## Example (as JSON) +## Example -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - } - }, - "cobranded_cards": [ - { - "labels": [ - "labels4", - "labels3" +```ruby +paypal_wallet_attributes_response = PaypalWalletAttributesResponse.new( + vault: PaypalWalletVaultResponse.new( + id: 'id6', + status: PaypalWalletVaultStatus::APPROVED, + customer: PaypalWalletCustomer.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id2' + ) + ), + cobranded_cards: [ + CobrandedCard.new( + labels: [ + 'labels4', + 'labels3' ], - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "labels": [ - "labels4", - "labels3" + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + CobrandedCard.new( + labels: [ + 'labels4', + 'labels3' ], - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ), + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] -} +) ``` diff --git a/doc/models/paypal-wallet-attributes.md b/doc/models/paypal-wallet-attributes.md index b9270f5..0776ff9 100644 --- a/doc/models/paypal-wallet-attributes.md +++ b/doc/models/paypal-wallet-attributes.md @@ -14,33 +14,33 @@ Additional attributes associated with the use of this PayPal Wallet. | `customer` | [`PaypalWalletCustomerRequest`](../../doc/models/paypal-wallet-customer-request.md) | Optional | - | | `vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | - | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - }, - "vault": { - "store_in_vault": "ON_SUCCESS", - "description": "description6", - "usage_pattern": "THRESHOLD_PREPAID", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false - } -} +## Example + +```ruby +paypal_wallet_attributes = PaypalWalletAttributes.new( + customer: PaypalWalletCustomerRequest.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id2' + ), + vault: PaypalWalletVaultInstruction.new( + usage_type: PaypalPaymentTokenUsageType::MERCHANT, + store_in_vault: StoreInVaultInstruction::ON_SUCCESS, + description: 'description6', + usage_pattern: UsagePattern::THRESHOLD_PREPAID, + customer_type: PaypalPaymentTokenCustomerType::CONSUMER, + permit_multiple_payment_tokens: false + ) +) ``` diff --git a/doc/models/paypal-wallet-contact-preference.md b/doc/models/paypal-wallet-contact-preference.md index 7d508a6..e4e8e3a 100644 --- a/doc/models/paypal-wallet-contact-preference.md +++ b/doc/models/paypal-wallet-contact-preference.md @@ -15,3 +15,9 @@ The preference to display the contact information (buyer’s shipping email & ph | `UPDATE_CONTACT_INFO` | The merchant allows buyer to add or update shipping contact information on the PayPal checkout. Please ensure to use this updated information returned in shipping.email_address and shipping.phone_number to contact your buyers. | | `RETAIN_CONTACT_INFO` | The buyer can only see but can not override merchant passed contact information (shipping.email_address and shipping.phone_number) on PayPal checkout. NOTE: If you don't pass the contact information, the behavior is the same as NO_CONTACT_INFO preference. | +## Example + +```ruby +paypal_wallet_contact_preference = PaypalWalletContactPreference::NO_CONTACT_INFO +``` + diff --git a/doc/models/paypal-wallet-context-shipping-preference.md b/doc/models/paypal-wallet-context-shipping-preference.md index ef424af..95f9a94 100644 --- a/doc/models/paypal-wallet-context-shipping-preference.md +++ b/doc/models/paypal-wallet-context-shipping-preference.md @@ -15,3 +15,9 @@ The location from which the shipping address is derived. | `NO_SHIPPING` | Removes the shipping address information from the API response and the Paypal site. However, the shipping.phone_number and shipping.email_address fields will still be returned to allow for digital goods delivery. | | `SET_PROVIDED_ADDRESS` | Get the merchant-provided address. The customer cannot change this address on the PayPal site. If merchant does not pass an address, customer can choose the address on PayPal pages. | +## Example + +```ruby +paypal_wallet_context_shipping_preference = PaypalWalletContextShippingPreference::GET_FROM_FILE +``` + diff --git a/doc/models/paypal-wallet-customer-request.md b/doc/models/paypal-wallet-customer-request.md index 8c93f9e..e38c168 100644 --- a/doc/models/paypal-wallet-customer-request.md +++ b/doc/models/paypal-wallet-customer-request.md @@ -15,23 +15,23 @@ | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -## Example (as JSON) - -```json -{ - "id": "id2", - "email_address": "email_address0", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id4" -} +## Example + +```ruby +paypal_wallet_customer_request = PaypalWalletCustomerRequest.new( + id: 'id8', + email_address: 'email_address6', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id0' +) ``` diff --git a/doc/models/paypal-wallet-customer.md b/doc/models/paypal-wallet-customer.md index 384dad3..54d6416 100644 --- a/doc/models/paypal-wallet-customer.md +++ b/doc/models/paypal-wallet-customer.md @@ -17,23 +17,23 @@ The details about a customer in PayPal's system of record. | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -## Example (as JSON) - -```json -{ - "id": "id8", - "email_address": "email_address4", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id0" -} +## Example + +```ruby +paypal_wallet_customer = PaypalWalletCustomer.new( + id: 'id6', + email_address: 'email_address4', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id8' +) ``` diff --git a/doc/models/paypal-wallet-experience-context.md b/doc/models/paypal-wallet-experience-context.md index f547550..bf54588 100644 --- a/doc/models/paypal-wallet-experience-context.md +++ b/doc/models/paypal-wallet-experience-context.md @@ -23,18 +23,18 @@ Customizes the payer experience during the approval process for payment with Pay | `payment_method_preference` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `PayeePaymentMethodPreference::UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `order_update_callback_config` | [`CallbackConfiguration`](../../doc/models/callback-configuration.md) | Optional | CallBack Configuration that the merchant can provide to PayPal/Venmo. | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "contact_preference": "NO_CONTACT_INFO", - "landing_page": "NO_PREFERENCE", - "user_action": "CONTINUE", - "payment_method_preference": "UNRESTRICTED", - "brand_name": "brand_name6", - "locale": "locale0", - "return_url": "return_url8" -} +## Example + +```ruby +paypal_wallet_experience_context = PaypalWalletExperienceContext.new( + brand_name: 'brand_name0', + locale: 'locale4', + shipping_preference: PaypalWalletContextShippingPreference::GET_FROM_FILE, + contact_preference: PaypalWalletContactPreference::NO_CONTACT_INFO, + return_url: 'return_url2', + landing_page: PaypalExperienceLandingPage::NO_PREFERENCE, + user_action: PaypalExperienceUserAction::CONTINUE, + payment_method_preference: PayeePaymentMethodPreference::UNRESTRICTED +) ``` diff --git a/doc/models/paypal-wallet-response.md b/doc/models/paypal-wallet-response.md index de02341..7809a7b 100644 --- a/doc/models/paypal-wallet-response.md +++ b/doc/models/paypal-wallet-response.md @@ -25,18 +25,17 @@ The PayPal Wallet response. | `stored_credential` | [`PaypalWalletStoredCredential`](../../doc/models/paypal-wallet-stored-credential.md) | Optional | Provides additional details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored. | | `experience_status` | [`ExperienceStatus`](../../doc/models/experience-status.md) | Optional, Read-only | This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) - -```json -{ - "email_address": "email_address8", - "account_id": "account_id2", - "account_status": "VERIFIED", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_type": "OTHER" -} +## Example + +```ruby +paypal_wallet_response = PaypalWalletResponse.new( + email_address: 'email_address2', + account_id: 'account_id6', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_type: PhoneType::MOBILE +) ``` diff --git a/doc/models/paypal-wallet-stored-credential.md b/doc/models/paypal-wallet-stored-credential.md index feab88a..c454d75 100644 --- a/doc/models/paypal-wallet-stored-credential.md +++ b/doc/models/paypal-wallet-stored-credential.md @@ -16,14 +16,14 @@ Provides additional details to process a payment using the PayPal wallet billing | `usage_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `StoredPaymentSourceUsageType::DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) - -```json -{ - "payment_initiator": "CUSTOMER", - "usage": "DERIVED", - "charge_pattern": "IMMEDIATE", - "usage_pattern": "IMMEDIATE" -} +## Example + +```ruby +paypal_wallet_stored_credential = PaypalWalletStoredCredential.new( + payment_initiator: PaymentInitiator::CUSTOMER, + charge_pattern: UsagePattern::UNSCHEDULED_PREPAID, + usage_pattern: UsagePattern::UNSCHEDULED_PREPAID, + usage: StoredPaymentSourceUsageType::DERIVED +) ``` diff --git a/doc/models/paypal-wallet-vault-base.md b/doc/models/paypal-wallet-vault-base.md index 68dc427..2fd4e30 100644 --- a/doc/models/paypal-wallet-vault-base.md +++ b/doc/models/paypal-wallet-vault-base.md @@ -18,16 +18,16 @@ Resource consolidating common request and response attributes for vaulting PayPa | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with the PayPal payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Default**: `PaypalPaymentTokenCustomerType::CONSUMER`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `permit_multiple_payment_tokens` | `TrueClass \| FalseClass` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `false` | -## Example (as JSON) - -```json -{ - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", - "description": "description0", - "usage_pattern": "RECURRING_PREPAID", - "usage_type": "MERCHANT" -} +## Example + +```ruby +paypal_wallet_vault_base = PaypalWalletVaultBase.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS, + description: 'description2', + usage_pattern: UsagePattern::SUBSCRIPTION_PREPAID, + usage_type: UsageType::MERCHANT, + customer_type: PaypalPaymentTokenCustomerType::CONSUMER, + permit_multiple_payment_tokens: false +) ``` diff --git a/doc/models/paypal-wallet-vault-instruction.md b/doc/models/paypal-wallet-vault-instruction.md index dbb0390..4e9b98d 100644 --- a/doc/models/paypal-wallet-vault-instruction.md +++ b/doc/models/paypal-wallet-vault-instruction.md @@ -16,16 +16,16 @@ | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with the PayPal payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Default**: `PaypalPaymentTokenCustomerType::CONSUMER`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `permit_multiple_payment_tokens` | `TrueClass \| FalseClass` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `false` | -## Example (as JSON) - -```json -{ - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", - "description": "description4", - "usage_pattern": "UNSCHEDULED_PREPAID" -} +## Example + +```ruby +paypal_wallet_vault_instruction = PaypalWalletVaultInstruction.new( + usage_type: PaypalPaymentTokenUsageType::MERCHANT, + store_in_vault: StoreInVaultInstruction::ON_SUCCESS, + description: 'description4', + usage_pattern: UsagePattern::IMMEDIATE, + customer_type: PaypalPaymentTokenCustomerType::CONSUMER, + permit_multiple_payment_tokens: false +) ``` diff --git a/doc/models/paypal-wallet-vault-response.md b/doc/models/paypal-wallet-vault-response.md index 2d744b8..5877167 100644 --- a/doc/models/paypal-wallet-vault-response.md +++ b/doc/models/paypal-wallet-vault-response.md @@ -16,34 +16,27 @@ The details about a saved PayPal Wallet payment source. | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`PaypalWalletCustomer`](../../doc/models/paypal-wallet-customer.md) | Optional | The details about a customer in PayPal's system of record. | -## Example (as JSON) - -```json -{ - "id": "id0", - "status": "CREATED", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "merchant_customer_id": "merchant_customer_id2" - } -} +## Example + +```ruby +paypal_wallet_vault_response = PaypalWalletVaultResponse.new( + id: 'id6', + status: PaypalWalletVaultStatus::CREATED, + customer: PaypalWalletCustomer.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + merchant_customer_id: 'merchant_customer_id2' + ) +) ``` diff --git a/doc/models/paypal-wallet-vault-status.md b/doc/models/paypal-wallet-vault-status.md index a9aa363..eac92a3 100644 --- a/doc/models/paypal-wallet-vault-status.md +++ b/doc/models/paypal-wallet-vault-status.md @@ -15,3 +15,9 @@ The vault status. | `CREATED` | DEPRECATED. The payment source has been saved in your customer's vault. This status applies to deprecated integration patterns and will not be returned for v3/vault integrations. | | `APPROVED` | Customer has approved the action of saving the specified payment_source into their vault. Use v3/vault/payment-tokens with given setup_token to save the payment source in the vault | +## Example + +```ruby +paypal_wallet_vault_status = PaypalWalletVaultStatus::APPROVED +``` + diff --git a/doc/models/paypal-wallet.md b/doc/models/paypal-wallet.md index 2349eb0..53d816f 100644 --- a/doc/models/paypal-wallet.md +++ b/doc/models/paypal-wallet.md @@ -23,23 +23,23 @@ A resource that identifies a PayPal Wallet is used for payment. | `billing_agreement_id` | `String` | Optional | The PayPal billing agreement ID. References an approved recurring payment for goods or services.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `128`, *Pattern*: `^[a-zA-Z0-9-]+$` | | `stored_credential` | [`PaypalWalletStoredCredential`](../../doc/models/paypal-wallet-stored-credential.md) | Optional | Provides additional details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored. | -## Example (as JSON) - -```json -{ - "vault_id": "vault_id8", - "email_address": "email_address8", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "birth_date": "birth_date4" -} +## Example + +```ruby +paypal_wallet = PaypalWallet.new( + vault_id: 'vault_id6', + email_address: 'email_address6', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + birth_date: 'birth_date6' +) ``` diff --git a/doc/models/phone-number-with-country-code.md b/doc/models/phone-number-with-country-code.md index ef5dff8..c34e3a3 100644 --- a/doc/models/phone-number-with-country-code.md +++ b/doc/models/phone-number-with-country-code.md @@ -14,12 +14,12 @@ The phone number in its canonical international [E.164 numbering plan format](ht | `country_code` | `String` | Required | The country calling code (CC), in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the CC and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `3`, *Pattern*: `^[0-9]{1,3}?$` | | `national_number` | `String` | Required | The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[0-9]{1,14}?$` | -## Example (as JSON) +## Example -```json -{ - "country_code": "country_code4", - "national_number": "national_number8" -} +```ruby +phone_number_with_country_code = PhoneNumberWithCountryCode.new( + country_code: 'country_code0', + national_number: 'national_number4' +) ``` diff --git a/doc/models/phone-number-with-optional-country-code.md b/doc/models/phone-number-with-optional-country-code.md index 85d953f..7b39dc4 100644 --- a/doc/models/phone-number-with-optional-country-code.md +++ b/doc/models/phone-number-with-optional-country-code.md @@ -14,12 +14,12 @@ The phone number in its canonical international [E.164 numbering plan format](ht | `country_code` | `String` | Optional | The country calling code (CC), in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the CC and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `3`, *Pattern*: `^[0-9]{1,3}?$` | | `national_number` | `String` | Required | The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[0-9]{1,14}?$` | -## Example (as JSON) +## Example -```json -{ - "country_code": "country_code6", - "national_number": "national_number0" -} +```ruby +phone_number_with_optional_country_code = PhoneNumberWithOptionalCountryCode.new( + national_number: 'national_number2', + country_code: 'country_code8' +) ``` diff --git a/doc/models/phone-number.md b/doc/models/phone-number.md index 5857391..679ed6b 100644 --- a/doc/models/phone-number.md +++ b/doc/models/phone-number.md @@ -13,11 +13,11 @@ The phone number in its canonical international [E.164 numbering plan format](ht | --- | --- | --- | --- | | `national_number` | `String` | Required | The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[0-9]{1,14}?$` | -## Example (as JSON) +## Example -```json -{ - "national_number": "national_number8" -} +```ruby +phone_number = PhoneNumber.new( + national_number: 'national_number6' +) ``` diff --git a/doc/models/phone-type.md b/doc/models/phone-type.md index a289eb6..3e31694 100644 --- a/doc/models/phone-type.md +++ b/doc/models/phone-type.md @@ -17,3 +17,9 @@ The phone type. | `OTHER` | Other phone number. | | `PAGER` | Pager number. | +## Example + +```ruby +phone_type = PhoneType::OTHER +``` + diff --git a/doc/models/phone-with-type.md b/doc/models/phone-with-type.md index 881261e..4b9ad2b 100644 --- a/doc/models/phone-with-type.md +++ b/doc/models/phone-with-type.md @@ -14,14 +14,14 @@ The phone information. | `phone_type` | [`PhoneType`](../../doc/models/phone-type.md) | Optional | The phone type. | | `phone_number` | [`PhoneNumber`](../../doc/models/phone-number.md) | Required | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | -## Example (as JSON) - -```json -{ - "phone_type": "PAGER", - "phone_number": { - "national_number": "national_number6" - } -} +## Example + +```ruby +phone_with_type = PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::PAGER +) ``` diff --git a/doc/models/phone.md b/doc/models/phone.md index 3fd0204..a6ec9a5 100644 --- a/doc/models/phone.md +++ b/doc/models/phone.md @@ -15,13 +15,13 @@ The phone number, in its canonical international [E.164 numbering plan format](h | `national_number` | `String` | Required | The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[0-9]{1,14}?$` | | `extension_number` | `String` | Optional | The extension number.

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

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "plans": [ - { - "id": "id4", - "product_id": "product_id0", - "name": "name4", - "status": "INACTIVE", - "description": "description4" - } +## Example + +```ruby +plan_collection = PlanCollection.new( + plans: [ + BillingPlan.new( + product_id: 'product_id0', + name: 'name4', + status: SubscriptionPlanStatus::INACTIVE, + description: 'description4' + ), + BillingPlan.new( + product_id: 'product_id0', + name: 'name4', + status: SubscriptionPlanStatus::INACTIVE, + description: 'description4' + ) ], - "total_items": 158, - "total_pages": 194, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} + total_items: 68, + total_pages: 104 +) ``` diff --git a/doc/models/plan-details.md b/doc/models/plan-details.md index 1e46256..4c240b5 100644 --- a/doc/models/plan-details.md +++ b/doc/models/plan-details.md @@ -20,157 +20,111 @@ The plan details. | `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | | `quantity_supported` | `TrueClass \| FalseClass` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `false` | -## Example (as JSON) +## Example -```json -{ - "quantity_supported": false, - "product_id": "product_id6", - "name": "name8", - "description": "description2", - "billing_cycles": [ - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +```ruby +plan_details = PlanDetails.new( + product_id: 'product_id6', + name: 'name0', + description: 'description0', + billing_cycles: [ + SubscriptionBillingCycle.new( + frequency: Frequency.new( + interval_unit: IntervalUnit::DAY, + interval_count: 94 + ), + tenure_type: TenureType::REGULAR, + sequence: 8, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - }, - "frequency": { - "interval_unit": "DAY", - "interval_count": 94 - }, - "tenure_type": "REGULAR", - "sequence": 8, - "total_cycles": 198 - }, - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } + create_time: 'create_time4' + ), + total_cycles: 198 + ), + SubscriptionBillingCycle.new( + frequency: Frequency.new( + interval_unit: IntervalUnit::DAY, + interval_count: 94 + ), + tenure_type: TenureType::REGULAR, + sequence: 8, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - }, - "frequency": { - "interval_unit": "DAY", - "interval_count": 94 - }, - "tenure_type": "REGULAR", - "sequence": 8, - "total_cycles": 198 - }, - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } - ], - "create_time": "create_time4" - }, - "frequency": { - "interval_unit": "DAY", - "interval_count": 94 - }, - "tenure_type": "REGULAR", - "sequence": 8, - "total_cycles": 198 - } + create_time: 'create_time4' + ), + total_cycles: 198 + ) ], - "payment_preferences": { - "auto_bill_outstanding": false, - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "setup_fee_failure_action": "CONTINUE", - "payment_failure_threshold": 104 - } -} + payment_preferences: PaymentPreferences.new( + auto_bill_outstanding: false, + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + setup_fee_failure_action: SetupFeeFailureAction::CONTINUE, + payment_failure_threshold: 104 + ), + quantity_supported: false +) ``` diff --git a/doc/models/plan-override.md b/doc/models/plan-override.md index 6a80616..d908d0e 100644 --- a/doc/models/plan-override.md +++ b/doc/models/plan-override.md @@ -15,142 +15,63 @@ An inline plan object to customise the subscription. You can override plan level | `payment_preferences` | [`PaymentPreferencesOverride`](../../doc/models/payment-preferences-override.md) | Optional | The payment preferences to override at subscription level. | | `taxes` | [`TaxesOverride`](../../doc/models/taxes-override.md) | Optional | The tax details. | -## Example (as JSON) +## Example -```json -{ - "billing_cycles": [ - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +```ruby +plan_override = PlanOverride.new( + billing_cycles: [ + BillingCycleOverride.new( + sequence: 8, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - }, - "sequence": 8, - "total_cycles": 198 - }, - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } - ], - "create_time": "create_time4" - }, - "sequence": 8, - "total_cycles": 198 - }, - { - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } - ], - "create_time": "create_time4" - }, - "sequence": 8, - "total_cycles": 198 - } + create_time: 'create_time4' + ), + total_cycles: 198 + ) ], - "payment_preferences": { - "auto_bill_outstanding": false, - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "setup_fee_failure_action": "CONTINUE", - "payment_failure_threshold": 104 - }, - "taxes": { - "percentage": "percentage8", - "inclusive": false - } -} + payment_preferences: PaymentPreferencesOverride.new( + auto_bill_outstanding: false, + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + setup_fee_failure_action: SetupFeeFailureAction::CONTINUE, + payment_failure_threshold: 104 + ), + taxes: TaxesOverride.new( + percentage: 'percentage8', + inclusive: false + ) +) ``` diff --git a/doc/models/plan-request-status.md b/doc/models/plan-request-status.md index ec9a2a0..45792ea 100644 --- a/doc/models/plan-request-status.md +++ b/doc/models/plan-request-status.md @@ -15,3 +15,9 @@ The initial state of the plan. Allowed input values are CREATED and ACTIVE. | `INACTIVE` | The plan is inactive. | | `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | +## Example + +```ruby +plan_request_status = PlanRequestStatus::ACTIVE +``` + diff --git a/doc/models/plan-request.md b/doc/models/plan-request.md index fa3fece..9381cd7 100644 --- a/doc/models/plan-request.md +++ b/doc/models/plan-request.md @@ -21,78 +21,77 @@ The create plan request details. | `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | | `quantity_supported` | `TrueClass \| FalseClass` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `false` | -## Example (as JSON) +## Example -```json -{ - "product_id": "product_id2", - "name": "name2", - "status": "ACTIVE", - "billing_cycles": [ - { - "frequency": { - "interval_unit": "DAY", - "interval_count": 1 - }, - "tenure_type": "REGULAR", - "sequence": 8, - "total_cycles": 1, - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +```ruby +plan_request = PlanRequest.new( + product_id: 'product_id8', + name: 'name2', + billing_cycles: [ + SubscriptionBillingCycle.new( + frequency: Frequency.new( + interval_unit: IntervalUnit::DAY, + interval_count: 1 + ), + tenure_type: TenureType::REGULAR, + sequence: 8, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - } - } + create_time: 'create_time4' + ), + total_cycles: 1 + ) ], - "payment_preferences": { - "auto_bill_outstanding": true, - "setup_fee_failure_action": "CANCEL", - "payment_failure_threshold": 0, - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - } - }, - "quantity_supported": false, - "description": "description8", - "merchant_preferences": { - "return_url": "return_url4", - "cancel_url": "cancel_url6" - }, - "taxes": { - "percentage": "percentage8", - "inclusive": false - } -} + payment_preferences: PaymentPreferences.new( + auto_bill_outstanding: true, + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + setup_fee_failure_action: SetupFeeFailureAction::CANCEL, + payment_failure_threshold: 0 + ), + status: PlanRequestStatus::ACTIVE, + description: 'description2', + merchant_preferences: MerchantPreferences.new( + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ), + taxes: Taxes.new( + percentage: 'percentage8', + inclusive: false + ), + quantity_supported: false +) ``` diff --git a/doc/models/plan.md b/doc/models/plan.md index 51577a8..07bdef2 100644 --- a/doc/models/plan.md +++ b/doc/models/plan.md @@ -15,56 +15,60 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. | `one_time_charges` | [`OneTimeCharge`](../../doc/models/one-time-charge.md) | Required | The one-time charge info at the time of checkout. | | `name` | `String` | Optional | Name of the recurring plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[A-Za-z0-9() +',.:-]+$` | -## Example (as JSON) +## Example -```json -{ - "billing_cycles": [ - { - "tenure_type": "REGULAR", - "total_cycles": 1, - "sequence": 1, - "pricing_scheme": { - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "AUTO_RELOAD", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - "start_date": "start_date6" - } +```ruby +plan = Plan.new( + billing_cycles: [ + BillingCycle.new( + tenure_type: TenureType::REGULAR, + pricing_scheme: PricingScheme.new( + pricing_model: PricingModel::AUTO_RELOAD, + price: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + reload_threshold_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ) + ), + total_cycles: 1, + sequence: 1, + start_date: 'start_date6', + frequency: CycleFrequency.new( + interval_unit: FrequencyIntervalUnit::LIFETIME, + interval_count: 94 + ) + ) ], - "one_time_charges": { - "setup_fee": { - "currency_code": "currency_code8", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "taxes": { - "currency_code": "currency_code6", - "value": "value2" - }, - "product_price": { - "currency_code": "currency_code6", - "value": "value2" - }, - "subtotal": { - "currency_code": "currency_code2", - "value": "value8" - }, - "total_amount": { - "currency_code": "currency_code2", - "value": "value8" - } - }, - "name": "name8" -} + one_time_charges: OneTimeCharge.new( + total_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + setup_fee: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + taxes: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + product_price: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + subtotal: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) + ), + name: 'name4' +) ``` diff --git a/doc/models/platform-fee.md b/doc/models/platform-fee.md index 7c684f5..c54cd9b 100644 --- a/doc/models/platform-fee.md +++ b/doc/models/platform-fee.md @@ -14,18 +14,18 @@ The platform or partner fee, commission, or brokerage fee that is associated wit | `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -## Example (as JSON) - -```json -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } -} +## Example + +```ruby +platform_fee = PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) +) ``` diff --git a/doc/models/pricing-model.md b/doc/models/pricing-model.md index 71f612e..0e4f370 100644 --- a/doc/models/pricing-model.md +++ b/doc/models/pricing-model.md @@ -15,3 +15,9 @@ The pricing model for the billing cycle. | `VARIABLE` | A variable pricing scheme where the customer is charged a variable amount. | | `AUTO_RELOAD` | A auto-reload pricing scheme where the customer is charged a fixed amount for reload. | +## Example + +```ruby +pricing_model = PricingModel::AUTO_RELOAD +``` + diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 7754c0a..0e210d8 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -15,19 +15,19 @@ The pricing scheme details. | `pricing_model` | [`PricingModel`](../../doc/models/pricing-model.md) | Required | The pricing model for the billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `reload_threshold_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "price": { - "currency_code": "currency_code8", - "value": "value4" - }, - "pricing_model": "FIXED", - "reload_threshold_amount": { - "currency_code": "currency_code0", - "value": "value6" - } -} +## Example + +```ruby +pricing_scheme = PricingScheme.new( + pricing_model: PricingModel::AUTO_RELOAD, + price: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + reload_threshold_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ) +) ``` diff --git a/doc/models/pricing-tier.md b/doc/models/pricing-tier.md index bfdc56d..02ec95b 100644 --- a/doc/models/pricing-tier.md +++ b/doc/models/pricing-tier.md @@ -15,16 +15,16 @@ The pricing tier details. | `ending_quantity` | `String` | Optional | The ending quantity for the tier. Optional for the last tier.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | | `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "starting_quantity": "starting_quantity4", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```ruby +pricing_tier = PricingTier.new( + starting_quantity: 'starting_quantity0', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity2' +) ``` diff --git a/doc/models/processing-instruction.md b/doc/models/processing-instruction.md index 5a53086..cc37a3a 100644 --- a/doc/models/processing-instruction.md +++ b/doc/models/processing-instruction.md @@ -13,3 +13,9 @@ The instruction to process an order. | --- | --- | | `ORDER_COMPLETE_ON_PAYMENT_APPROVAL` | API Caller expects the Order to be auto completed (i.e. for PayPal to authorize or capture depending on the intent) on completion of payer approval. This option is not relevant for payment_source that typically do not require a payer approval or interaction. This option is currently only available for the following payment_source: Alipay, BANCOMAT Pay, Bancontact, BLIK, boletobancario, eps, giropay, GrabPay, iDEAL, MB WAY Multibanco, MyBank, OXXO, P24, PayU, PUI, SafetyPay, SatisPay, Swish, Sofort, Trustly, Verkkopankki, WeChat Pay | +## Example + +```ruby +processing_instruction = ProcessingInstruction::ORDER_COMPLETE_ON_PAYMENT_APPROVAL +``` + diff --git a/doc/models/processor-response-code.md b/doc/models/processor-response-code.md index 99709b0..375c1f1 100644 --- a/doc/models/processor-response-code.md +++ b/doc/models/processor-response-code.md @@ -166,3 +166,9 @@ Processor response code for the non-PayPal payment processor errors. | `RESPONSE_PPVE` | VALIDATION_ERROR. | | `RESPONSE_PPVT` | VIRTUAL_TERMINAL_UNSUPPORTED. | +## Example + +```ruby +processor_response_code = ProcessorResponseCode::RESPONSE_PPCO +``` + diff --git a/doc/models/processor-response.md b/doc/models/processor-response.md index b1a6327..96de938 100644 --- a/doc/models/processor-response.md +++ b/doc/models/processor-response.md @@ -16,14 +16,9 @@ The processor response information for payment requests, such as direct credit c | `response_code` | [`ProcessorResponseCode`](../../doc/models/processor-response-code.md) | Optional, Read-only | Processor response code for the non-PayPal payment processor errors. | | `payment_advice_code` | [`PaymentAdviceCode`](../../doc/models/payment-advice-code.md) | Optional, Read-only | The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. | -## Example (as JSON) - -```json -{ - "avs_code": "M", - "cvv_code": "U", - "response_code": "PPII", - "payment_advice_code": "03" -} +## Example + +```ruby +processor_response = ProcessorResponse.new ``` diff --git a/doc/models/purchase-unit-request.md b/doc/models/purchase-unit-request.md index 134e621..83e68d3 100644 --- a/doc/models/purchase-unit-request.md +++ b/doc/models/purchase-unit-request.md @@ -23,80 +23,80 @@ The purchase unit request. Includes required information for the payment contrac | `shipping` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | | `supplementary_data` | [`SupplementaryData`](../../doc/models/supplementary-data.md) | Optional | Supplementary data about a payment. This object passes information that can be used to improve risk assessments and processing costs, for example, by providing Level 2 and Level 3 payment data. | -## Example (as JSON) +## Example -```json -{ - "reference_id": "reference_id6", - "amount": { - "currency_code": "currency_code6", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "payment_instruction": { - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } +```ruby +purchase_unit_request = PurchaseUnitRequest.new( + amount: AmountWithBreakdown.new( + currency_code: 'currency_code6', + value: 'value0', + breakdown: AmountBreakdown.new( + item_total: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + shipping: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + handling: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + tax_total: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + insurance: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) + ) + ), + reference_id: 'reference_id4', + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ), + payment_instruction: PaymentInstruction.new( + platform_fees: [ + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ), + PlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + payee: PayeeBase.new( + email_address: 'email_address4', + merchant_id: 'merchant_id6' + ) + ) ], - "disbursement_mode": "INSTANT", - "payee_pricing_tier_id": "payee_pricing_tier_id2", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - }, - "description": "description6", - "custom_id": "custom_id4" -} + disbursement_mode: DisbursementMode::INSTANT, + payee_pricing_tier_id: 'payee_pricing_tier_id2', + payee_receivable_fx_rate_id: 'payee_receivable_fx_rate_id0' + ), + description: 'description2', + custom_id: 'custom_id6' +) ``` diff --git a/doc/models/purchase-unit.md b/doc/models/purchase-unit.md index af15450..99f21b0 100644 --- a/doc/models/purchase-unit.md +++ b/doc/models/purchase-unit.md @@ -26,79 +26,79 @@ The purchase unit details. Used to capture required information for the payment | `payments` | [`PaymentCollection`](../../doc/models/payment-collection.md) | Optional | The collection of payments, or transactions, for a purchase unit in an order. For example, authorized payments, captured payments, and refunds. | | `most_recent_errors` | `Array[Object]` | Optional | The error reason code and description that are the reason for the most recent order decline.

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

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | -## Example (as JSON) - -```json -{ - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +## Example + +```ruby +refund_payment_instruction = RefundPaymentInstruction.new( + platform_fees: [ + RefundPlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + RefundPlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ), + RefundPlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] -} +) ``` diff --git a/doc/models/refund-platform-fee.md b/doc/models/refund-platform-fee.md index 9922f31..06dbb7f 100644 --- a/doc/models/refund-platform-fee.md +++ b/doc/models/refund-platform-fee.md @@ -13,14 +13,14 @@ The platform or partner fee, commission, or brokerage fee that is associated wit | --- | --- | --- | --- | | `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} +## Example + +```ruby +refund_platform_fee = RefundPlatformFee.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/refund-request.md b/doc/models/refund-request.md index 77400a2..9306b89 100644 --- a/doc/models/refund-request.md +++ b/doc/models/refund-request.md @@ -17,39 +17,39 @@ Refunds a captured payment, by ID. For a full refund, include an empty request b | `note_to_payer` | `String` | Optional | The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives. The pattern is defined by an external party and supports Unicode.

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[A-Z0-9]+$` | -## Example (as JSON) - -```json -{ - "order_id": "order_id0", - "authorization_id": "authorization_id8", - "capture_id": "capture_id8" -} +## Example + +```ruby +related_identifiers = RelatedIdentifiers.new( + order_id: 'order_id4', + authorization_id: 'authorization_id8', + capture_id: 'capture_id2' +) ``` diff --git a/doc/models/return-flow.md b/doc/models/return-flow.md index f717f6c..67b03b6 100644 --- a/doc/models/return-flow.md +++ b/doc/models/return-flow.md @@ -14,3 +14,9 @@ Merchant preference on how the buyer can navigate back to merchant website post | `AUTO` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | | `MANUAL` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | +## Example + +```ruby +return_flow = ReturnFlow::AUTO +``` + diff --git a/doc/models/risk-supplementary-data.md b/doc/models/risk-supplementary-data.md index 0b397c9..c3c9c9e 100644 --- a/doc/models/risk-supplementary-data.md +++ b/doc/models/risk-supplementary-data.md @@ -13,13 +13,13 @@ Additional information necessary to evaluate the risk profile of a transaction. | --- | --- | --- | --- | | `customer` | [`ParticipantMetadata`](../../doc/models/participant-metadata.md) | Optional | Profile information of the sender or receiver. | -## Example (as JSON) - -```json -{ - "customer": { - "ip_address": "ip_address0" - } -} +## Example + +```ruby +risk_supplementary_data = RiskSupplementaryData.new( + customer: ParticipantMetadata.new( + ip_address: 'ip_address0' + ) +) ``` diff --git a/doc/models/search-error-exception.md b/doc/models/search-error-exception.md index 7a5a128..3f2e612 100644 --- a/doc/models/search-error-exception.md +++ b/doc/models/search-error-exception.md @@ -20,32 +20,13 @@ The error details. | `total_items` | `Integer` | Optional | The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | | `maximum_items` | `Integer` | Optional | The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | -## Example (as JSON) - -```json -{ - "name": "name8", - "message": "message8", - "debug_id": "debug_id6", - "information_link": "information_link0", - "details": [ - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "description": "description0" - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "total_items": 20, - "maximum_items": 206 -} +## Example + +```ruby +begin + # make the API call +rescue SearchErrorException => e + puts "Caught SearchErrorException: #{e.message}" +end ``` diff --git a/doc/models/search-response.md b/doc/models/search-response.md index 66ccf4d..72423a4 100644 --- a/doc/models/search-response.md +++ b/doc/models/search-response.md @@ -21,208 +21,79 @@ The search response information. | `total_pages` | `Integer` | Optional | The total number of pages, as an `integer`, when the `total_items` is divided into pages of the specified `page_size`.

**Constraints**: `>= 0`, `<= 2147483647` | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas-links).

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

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | -## Example (as JSON) - -```json -{ - "gross_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "paypal_fee": { - "currency_code": "currency_code4", - "value": "value2" - }, - "paypal_fee_in_receivable_currency": { - "currency_code": "currency_code2", - "value": "value8" - }, - "net_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "receivable_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "exchange_rate": { - "source_currency": "source_currency4", - "target_currency": "target_currency6", - "value": "value6" - } -} +## Example + +```ruby +seller_receivable_breakdown = SellerReceivableBreakdown.new( + gross_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + paypal_fee: Money.new( + currency_code: 'currency_code4', + value: 'value2' + ), + paypal_fee_in_receivable_currency: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + net_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + receivable_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) +) ``` diff --git a/doc/models/sepa-debit-experience-context.md b/doc/models/sepa-debit-experience-context.md index ec65c0c..ed65cd2 100644 --- a/doc/models/sepa-debit-experience-context.md +++ b/doc/models/sepa-debit-experience-context.md @@ -15,13 +15,13 @@ Customizes the payer experience during the approval process for the SEPA Debit p | `return_url` | `String` | Required | Describes the URL. | | `cancel_url` | `String` | Required | Describes the URL. | -## Example (as JSON) - -```json -{ - "locale": "locale8", - "return_url": "return_url6", - "cancel_url": "cancel_url8" -} +## Example + +```ruby +sepa_debit_experience_context = SepaDebitExperienceContext.new( + return_url: 'return_url6', + cancel_url: 'cancel_url8', + locale: 'locale8' +) ``` diff --git a/doc/models/sepa-debit-request.md b/doc/models/sepa-debit-request.md index 74109fa..e1719cc 100644 --- a/doc/models/sepa-debit-request.md +++ b/doc/models/sepa-debit-request.md @@ -13,15 +13,15 @@ An API resource denoting a request to securely store a SEPA Debit. | --- | --- | --- | --- | | `experience_context` | [`SepaDebitExperienceContext`](../../doc/models/sepa-debit-experience-context.md) | Optional | Customizes the payer experience during the approval process for the SEPA Debit payment. | -## Example (as JSON) - -```json -{ - "experience_context": { - "locale": "locale6", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +sepa_debit_request = SepaDebitRequest.new( + experience_context: SepaDebitExperienceContext.new( + return_url: 'return_url4', + cancel_url: 'cancel_url6', + locale: 'locale6' + ) +) ``` diff --git a/doc/models/setup-fee-failure-action.md b/doc/models/setup-fee-failure-action.md index 714e6e7..3887893 100644 --- a/doc/models/setup-fee-failure-action.md +++ b/doc/models/setup-fee-failure-action.md @@ -14,3 +14,9 @@ The action to take on the subscription if the initial payment for the setup fail | `CONTINUE` | Continues the subscription if the initial payment for the setup fails. | | `CANCEL` | Cancels the subscription if the initial payment for the setup fails. | +## Example + +```ruby +setup_fee_failure_action = SetupFeeFailureAction::CONTINUE +``` + diff --git a/doc/models/setup-token-request-card.md b/doc/models/setup-token-request-card.md index 5a067ad..bc87755 100644 --- a/doc/models/setup-token-request-card.md +++ b/doc/models/setup-token-request-card.md @@ -20,15 +20,15 @@ A Resource representing a request to vault a Card. | `verification_method` | [`VaultCardVerificationMethod`](../../doc/models/vault-card-verification-method.md) | Optional | The verification method of the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `experience_context` | [`VaultCardExperienceContext`](../../doc/models/vault-card-experience-context.md) | Optional | A resource representing an experience context of vault a card. | -## Example (as JSON) - -```json -{ - "name": "name2", - "number": "number0", - "expiry": "expiry0", - "security_code": "security_code4", - "brand": "STAR" -} +## Example + +```ruby +setup_token_request_card = SetupTokenRequestCard.new( + name: 'name2', + number: 'number0', + expiry: 'expiry0', + security_code: 'security_code4', + brand: CardBrand::STAR +) ``` diff --git a/doc/models/setup-token-request-payment-source.md b/doc/models/setup-token-request-payment-source.md index c08c413..ff6dc51 100644 --- a/doc/models/setup-token-request-payment-source.md +++ b/doc/models/setup-token-request-payment-source.md @@ -18,86 +18,86 @@ The payment method to vault with the instrument details. | `token` | [`VaultTokenRequest`](../../doc/models/vault-token-request.md) | Optional | The Tokenized Payment Source representing a Request to Vault a Token. | | `bank` | [`BankRequest`](../../doc/models/bank-request.md) | Optional | A Resource representing a request to vault a Bank used for ACH Debit. | -## Example (as JSON) +## Example -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "token": "token6", - "card": { - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - }, - "token": { - "id": "id6", - "type": "SETUP_TOKEN" - } -} +```ruby +setup_token_request_payment_source = SetupTokenRequestPaymentSource.new( + card: SetupTokenRequestCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + brand: CardBrand::CB_NATIONALE + ), + paypal: VaultPaypalWalletRequest.new( + description: 'description2', + usage_pattern: UsagePattern::THRESHOLD_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT + ), + venmo: VaultVenmoRequest.new( + description: 'description6', + usage_pattern: UsagePattern::UNSCHEDULED_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT + ), + apple_pay: VaultApplePayRequest.new( + token: 'token6', + card: ApplePayRequestCard.new( + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ), + token: VaultTokenRequest.new( + id: 'id6', + type: VaultTokenRequestType::SETUP_TOKEN + ) +) ``` diff --git a/doc/models/setup-token-request.md b/doc/models/setup-token-request.md index af4a46e..863d33c 100644 --- a/doc/models/setup-token-request.md +++ b/doc/models/setup-token-request.md @@ -14,92 +14,92 @@ Setup Token Request where the `source` defines the type of instrument to be stor | `customer` | [`Customer`](../../doc/models/customer.md) | Optional | This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. | | `payment_source` | [`SetupTokenRequestPaymentSource`](../../doc/models/setup-token-request-payment-source.md) | Required | The payment method to vault with the instrument details. | -## Example (as JSON) +## Example -```json -{ - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "brand": "CB_NATIONALE" - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "apple_pay": { - "token": "token6", - "card": { - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } - }, - "token": { - "id": "id6", - "type": "SETUP_TOKEN" - } - } -} +```ruby +setup_token_request = SetupTokenRequest.new( + payment_source: SetupTokenRequestPaymentSource.new( + card: SetupTokenRequestCard.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + brand: CardBrand::CB_NATIONALE + ), + paypal: VaultPaypalWalletRequest.new( + description: 'description2', + usage_pattern: UsagePattern::THRESHOLD_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT + ), + venmo: VaultVenmoRequest.new( + description: 'description6', + usage_pattern: UsagePattern::UNSCHEDULED_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT + ), + apple_pay: VaultApplePayRequest.new( + token: 'token6', + card: ApplePayRequestCard.new( + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ), + token: VaultTokenRequest.new( + id: 'id6', + type: VaultTokenRequestType::SETUP_TOKEN + ) + ), + customer: Customer.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ) +) ``` diff --git a/doc/models/setup-token-response-card.md b/doc/models/setup-token-response-card.md index e767147..3b534f9 100644 --- a/doc/models/setup-token-response-card.md +++ b/doc/models/setup-token-response-card.md @@ -21,22 +21,21 @@ | `bin_details` | [`BinDetails`](../../doc/models/bin-details.md) | Optional | Bank Identification Number (BIN) details used to fund a payment. | | `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_]+$` | -## Example (as JSON) - -```json -{ - "name": "name8", - "last_digits": "last_digits2", - "brand": "DISCOVER", - "expiry": "expiry6", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } -} +## Example + +```ruby +setup_token_response_card = SetupTokenResponseCard.new( + name: 'name8', + brand: CardBrand::DISCOVER, + expiry: 'expiry6', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) +) ``` diff --git a/doc/models/setup-token-response-payment-source.md b/doc/models/setup-token-response-payment-source.md index 34c9dfd..d57fb3e 100644 --- a/doc/models/setup-token-response-payment-source.md +++ b/doc/models/setup-token-response-payment-source.md @@ -15,74 +15,23 @@ The setup payment method details. | `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional, Read-only | Full representation of a PayPal Payment Token. | | `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional, Read-only | Full representation of a Venmo Payment Token. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - } -} +## Example + +```ruby +setup_token_response_payment_source = SetupTokenResponsePaymentSource.new( + card: SetupTokenResponseCard.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + expiry: 'expiry4', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) +) ``` diff --git a/doc/models/setup-token-response.md b/doc/models/setup-token-response.md index 4af2d6b..cc289f0 100644 --- a/doc/models/setup-token-response.md +++ b/doc/models/setup-token-response.md @@ -17,89 +17,31 @@ Minimal representation of a cached setup token. | `payment_source` | [`SetupTokenResponsePaymentSource`](../../doc/models/setup-token-response-payment-source.md) | Optional | The setup payment method details. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | -## Example (as JSON) - -```json -{ - "status": "CREATED", - "id": "id6", - "customer": { - "id": "id0", - "merchant_customer_id": "merchant_customer_id2" - }, - "payment_source": { - "card": { - "name": "name6", - "last_digits": "last_digits0", - "brand": "CB_NATIONALE", - "expiry": "expiry4", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - }, - "paypal": { - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - }, - "venmo": { - "description": "description6", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "permit_multiple_payment_tokens": false, - "usage_type": "MERCHANT" - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```ruby +setup_token_response = SetupTokenResponse.new( + id: 'id0', + customer: Customer.new( + id: 'id0', + merchant_customer_id: 'merchant_customer_id2' + ), + status: PaymentTokenStatus::CREATED, + payment_source: SetupTokenResponsePaymentSource.new( + card: SetupTokenResponseCard.new( + name: 'name6', + brand: CardBrand::CB_NATIONALE, + expiry: 'expiry4', + billing_address: CardResponseAddress.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) + ) +) ``` diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md index db4cdcb..fbc37b7 100644 --- a/doc/models/shipment-carrier.md +++ b/doc/models/shipment-carrier.md @@ -1425,3 +1425,9 @@ The carrier for the shipment. Some carriers have a global version as well as loc | `TOPTRANS` | Toptrans. | | `OTHER` | Other. | +## Example + +```ruby +shipment_carrier = ShipmentCarrier::GBA +``` + diff --git a/doc/models/shipping-details.md b/doc/models/shipping-details.md index 529ce46..4237c7a 100644 --- a/doc/models/shipping-details.md +++ b/doc/models/shipping-details.md @@ -18,51 +18,31 @@ The shipping details. | `options` | [`Array[ShippingOption]`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) - -```json -{ - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } +## Example + +```ruby +shipping_details = ShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + options: [ + ShippingOption.new( + id: 'id2', + label: 'label2', + selected: false, + type: ShippingType::SHIPPING, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] -} +) ``` diff --git a/doc/models/shipping-information.md b/doc/models/shipping-information.md index 5b04dfe..5ce56f2 100644 --- a/doc/models/shipping-information.md +++ b/doc/models/shipping-information.md @@ -16,28 +16,28 @@ The shipping information. | `address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | | `secondary_shipping_address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | -## Example (as JSON) - -```json -{ - "name": "name8", - "method": "method2", - "address": { - "line1": "line18", - "line2": "line20", - "city": "city6", - "state": "state2", - "country_code": "country_code6", - "postal_code": "postal_code8" - }, - "secondary_shipping_address": { - "line1": "line16", - "line2": "line28", - "city": "city4", - "state": "state0", - "country_code": "country_code4", - "postal_code": "postal_code6" - } -} +## Example + +```ruby +shipping_information = ShippingInformation.new( + name: 'name4', + method: 'method8', + address: SimplePostalAddressCoarseGrained.new( + line1: 'line18', + city: 'city6', + country_code: 'country_code6', + line2: 'line20', + state: 'state2', + postal_code: 'postal_code8' + ), + secondary_shipping_address: SimplePostalAddressCoarseGrained.new( + line1: 'line16', + city: 'city4', + country_code: 'country_code4', + line2: 'line28', + state: 'state0', + postal_code: 'postal_code6' + ) +) ``` diff --git a/doc/models/shipping-name.md b/doc/models/shipping-name.md index f20a5c4..5cd3c66 100644 --- a/doc/models/shipping-name.md +++ b/doc/models/shipping-name.md @@ -13,11 +13,11 @@ The name of the party. | --- | --- | --- | --- | | `full_name` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | -## Example (as JSON) +## Example -```json -{ - "full_name": "full_name6" -} +```ruby +shipping_name = ShippingName.new( + full_name: 'full_name6' +) ``` diff --git a/doc/models/shipping-option.md b/doc/models/shipping-option.md index e2c86b2..84fecd1 100644 --- a/doc/models/shipping-option.md +++ b/doc/models/shipping-option.md @@ -17,18 +17,18 @@ The options that the payee or merchant offers to the payer to ship or pick up th | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `selected` | `TrueClass \| FalseClass` | Required | If the API request sets `selected = true`, it represents the shipping option that the payee or merchant expects to be pre-selected for the payer when they first view the `shipping.options` in the PayPal Checkout experience. As part of the response if a `shipping.option` contains `selected=true`, it represents the shipping option that the payer selected during the course of checkout with PayPal. Only one `shipping.option` can be set to `selected=true`. | -## Example (as JSON) - -```json -{ - "id": "id4", - "label": "label4", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false -} +## Example + +```ruby +shipping_option = ShippingOption.new( + id: 'id4', + label: 'label4', + selected: false, + type: ShippingType::PICKUP_IN_STORE, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) +) ``` diff --git a/doc/models/shipping-type.md b/doc/models/shipping-type.md index 5ce3cac..5f52f02 100644 --- a/doc/models/shipping-type.md +++ b/doc/models/shipping-type.md @@ -16,3 +16,9 @@ A classification for the method of purchase fulfillment. | `PICKUP_IN_STORE` | The payer intends to pick up the item(s) from the payee's physical store. Also termed as BOPIS, "Buy Online, Pick-up in Store". Seller protection is provided with this option. | | `PICKUP_FROM_PERSON` | The payer intends to pick up the item(s) from the payee in person. Also termed as BOPIP, "Buy Online, Pick-up in Person". Seller protection is not available, since the payer is receiving the item from the payee in person, and can validate the item prior to payment. | +## Example + +```ruby +shipping_type = ShippingType::PICKUP_IN_STORE +``` + diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md index a33a324..2e292b8 100644 --- a/doc/models/shipping-with-tracking-details.md +++ b/doc/models/shipping-with-tracking-details.md @@ -17,73 +17,60 @@ | `options` | [`Array[ShippingOption]`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -## Example (as JSON) +## Example -```json -{ - "trackers": [ - { - "id": "id2", - "status": "CANCELLED", - "items": [ - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - } +```ruby +shipping_with_tracking_details = ShippingWithTrackingDetails.new( + trackers: [ + OrderTrackerResponse.new( + status: OrderTrackerStatus::CANCELLED, + items: [ + OrderTrackerItem.new( + name: 'name8', + quantity: 'quantity4', + sku: 'sku6', + url: 'url2', + image_url: 'image_url4' + ) ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } + create_time: 'create_time8' + ), + OrderTrackerResponse.new( + status: OrderTrackerStatus::CANCELLED, + items: [ + OrderTrackerItem.new( + name: 'name8', + quantity: 'quantity4', + sku: 'sku6', + url: 'url2', + image_url: 'image_url4' + ) ], - "create_time": "create_time8" - }, - { - "id": "id2", - "status": "CANCELLED", - "items": [ - { - "name": "name8", - "quantity": "quantity4", - "sku": "sku6", - "url": "url2", - "image_url": "image_url4" - } + create_time: 'create_time8' + ), + OrderTrackerResponse.new( + status: OrderTrackerStatus::CANCELLED, + items: [ + OrderTrackerItem.new( + name: 'name8', + quantity: 'quantity4', + sku: 'sku6', + url: 'url2', + image_url: 'image_url4' + ) ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "create_time": "create_time8" - } + create_time: 'create_time8' + ) ], - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING" -} + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address8', + phone_number: PhoneNumberWithOptionalCountryCode.new( + national_number: 'national_number6', + country_code: 'country_code2' + ), + type: FulfillmentType::SHIPPING +) ``` diff --git a/doc/models/simple-postal-address-coarse-grained.md b/doc/models/simple-postal-address-coarse-grained.md index 341225c..fc13462 100644 --- a/doc/models/simple-postal-address-coarse-grained.md +++ b/doc/models/simple-postal-address-coarse-grained.md @@ -18,16 +18,16 @@ A simple postal address with coarse-grained fields. Do not use for an internatio | `country_code` | `String` | Required | The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `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). | -## Example (as JSON) - -```json -{ - "line1": "line14", - "line2": "line26", - "city": "city2", - "state": "state8", - "country_code": "country_code2", - "postal_code": "postal_code4" -} +## Example + +```ruby +simple_postal_address_coarse_grained = SimplePostalAddressCoarseGrained.new( + line1: 'line12', + city: 'city0', + country_code: 'country_code0', + line2: 'line24', + state: 'state6', + postal_code: 'postal_code2' +) ``` diff --git a/doc/models/sofort-payment-object.md b/doc/models/sofort-payment-object.md index abd8363..ebfddd6 100644 --- a/doc/models/sofort-payment-object.md +++ b/doc/models/sofort-payment-object.md @@ -16,14 +16,14 @@ Information used to pay using Sofort. | `bic` | `String` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

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

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

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name4", - "country_code": "country_code4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +sofort_payment_request = SofortPaymentRequest.new( + name: 'name4', + country_code: 'country_code4', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/standard-entry-class-code.md b/doc/models/standard-entry-class-code.md index a27f248..5562f35 100644 --- a/doc/models/standard-entry-class-code.md +++ b/doc/models/standard-entry-class-code.md @@ -16,3 +16,9 @@ NACHA (the regulatory body governing the ACH network) requires that API callers | `CCD` | Cash concentration and disbursement for corporate debit transaction. Used to disburse or consolidate funds. Entries are usually Optional high-dollar, low-volume, and time-critical. (e.g. intra-company transfers or invoice payments to suppliers). | | `PPD` | Prearranged payment and deposit entries. Used for debit payments authorized by a consumer account holder, and usually initiated by a company. These are usually recurring debits (such as insurance premiums). | +## Example + +```ruby +standard_entry_class_code = StandardEntryClassCode::TEL +``` + diff --git a/doc/models/store-in-vault-instruction.md b/doc/models/store-in-vault-instruction.md index e1a0ee1..c5a1bb5 100644 --- a/doc/models/store-in-vault-instruction.md +++ b/doc/models/store-in-vault-instruction.md @@ -13,3 +13,9 @@ Defines how and when the payment source gets vaulted. | --- | --- | | `ON_SUCCESS` | Defines that the payment_source will be vaulted only when at least one authorization or capture using that payment_source is successful. | +## Example + +```ruby +store_in_vault_instruction = StoreInVaultInstruction::ON_SUCCESS +``` + diff --git a/doc/models/store-information.md b/doc/models/store-information.md index 74313bd..d183458 100644 --- a/doc/models/store-information.md +++ b/doc/models/store-information.md @@ -14,12 +14,12 @@ The store information. | `store_id` | `String` | Optional | The ID of a store for a merchant in the system of record.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100`, *Pattern*: `^[a-zA-Z0-9]*$` | | `terminal_id` | `String` | Optional | The terminal ID for the checkout stand in a merchant store.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9]*$` | -## Example (as JSON) +## Example -```json -{ - "store_id": "store_id6", - "terminal_id": "terminal_id0" -} +```ruby +store_information = StoreInformation.new( + store_id: 'store_id6', + terminal_id: 'terminal_id0' +) ``` diff --git a/doc/models/stored-payment-source-payment-type.md b/doc/models/stored-payment-source-payment-type.md index c173a12..b3bbb1c 100644 --- a/doc/models/stored-payment-source-payment-type.md +++ b/doc/models/stored-payment-source-payment-type.md @@ -15,3 +15,9 @@ Indicates the type of the stored payment_source payment. | `RECURRING` | Payment which is part of a series of payments with fixed or variable amounts, following a fixed time interval. (e.g. Subscription payments). | | `UNSCHEDULED` | Payment which is part of a series of payments that occur on a non-fixed schedule and/or have variable amounts. (e.g. Account Topup payments). | +## Example + +```ruby +stored_payment_source_payment_type = StoredPaymentSourcePaymentType::RECURRING +``` + diff --git a/doc/models/stored-payment-source-usage-type.md b/doc/models/stored-payment-source-usage-type.md index fd25db6..6e59022 100644 --- a/doc/models/stored-payment-source-usage-type.md +++ b/doc/models/stored-payment-source-usage-type.md @@ -15,3 +15,9 @@ Indicates if this is a `first` or `subsequent` payment using a stored payment so | `SUBSEQUENT` | Indicates a payment using a stored payment_source which has been successfully used previously for a payment. | | `DERIVED` | Indicates that PayPal will derive the value of `FIRST` or `SUBSEQUENT` based on data available to PayPal. | +## Example + +```ruby +stored_payment_source_usage_type = StoredPaymentSourceUsageType::SUBSEQUENT +``` + diff --git a/doc/models/stored-payment-source.md b/doc/models/stored-payment-source.md index f1bdaf2..af668a3 100644 --- a/doc/models/stored-payment-source.md +++ b/doc/models/stored-payment-source.md @@ -16,19 +16,19 @@ Provides additional details to process a payment using a `payment_source` that h | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `StoredPaymentSourceUsageType::DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `previous_network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | -## Example (as JSON) - -```json -{ - "payment_initiator": "CUSTOMER", - "payment_type": "RECURRING", - "usage": "DERIVED", - "previous_network_transaction_reference": { - "id": "id6", - "date": "date2", - "network": "CONFIDIS", - "acquirer_reference_number": "acquirer_reference_number8" - } -} +## Example + +```ruby +stored_payment_source = StoredPaymentSource.new( + payment_initiator: PaymentInitiator::CUSTOMER, + payment_type: StoredPaymentSourcePaymentType::RECURRING, + usage: StoredPaymentSourceUsageType::DERIVED, + previous_network_transaction_reference: NetworkTransaction.new( + id: 'id6', + date: 'date2', + network: CardBrand::CONFIDIS, + acquirer_reference_number: 'acquirer_reference_number8' + ) +) ``` diff --git a/doc/models/subscriber-request.md b/doc/models/subscriber-request.md index 2fd4b53..cf24a20 100644 --- a/doc/models/subscriber-request.md +++ b/doc/models/subscriber-request.md @@ -18,48 +18,48 @@ The subscriber request information . | `payment_source` | [`SubscriptionPaymentSource`](../../doc/models/subscription-payment-source.md) | Optional | The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions. | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address0", - "payer_id": "payer_id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "shipping_address": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address8", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } +```ruby +subscriber_request = SubscriberRequest.new( + email_address: 'email_address6', + payer_id: 'payer_id6', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + shipping_address: ShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address8', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::PICKUP_IN_STORE, + options: [ + ShippingOption.new( + id: 'id2', + label: 'label2', + selected: false, + type: ShippingType::SHIPPING, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] - }, - "payment_source": { - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "type": "UNKNOWN" - } - } -} + ), + payment_source: SubscriptionPaymentSource.new( + card: SubscriptionCardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + type: CardType::UNKNOWN + ) + ) +) ``` diff --git a/doc/models/subscriber.md b/doc/models/subscriber.md index 8a732fa..ed7dd42 100644 --- a/doc/models/subscriber.md +++ b/doc/models/subscriber.md @@ -17,54 +17,54 @@ The subscriber response information. | `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | | `payment_source` | [`SubscriptionPaymentSourceResponse`](../../doc/models/subscription-payment-source-response.md) | Optional | The payment source used to fund the payment. | -## Example (as JSON) +## Example -```json -{ - "email_address": "email_address2", - "payer_id": "payer_id2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "shipping_address": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address8", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } +```ruby +subscriber = Subscriber.new( + email_address: 'email_address8', + payer_id: 'payer_id8', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + shipping_address: ShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address8', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::PICKUP_IN_STORE, + options: [ + ShippingOption.new( + id: 'id2', + label: 'label2', + selected: false, + type: ShippingType::SHIPPING, + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) ] - }, - "payment_source": { - "card": { - "name": "name6", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - }, - "expiry": "expiry4", - "currency_code": "currency_code2" - } - } -} + ), + payment_source: SubscriptionPaymentSourceResponse.new( + card: CardResponseWithBillingAddress.new( + name: 'name6', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ), + expiry: 'expiry4', + currency_code: 'currency_code2' + ) + ) +) ``` diff --git a/doc/models/subscription-amount-with-breakdown.md b/doc/models/subscription-amount-with-breakdown.md index 0447f8e..ef0bd22 100644 --- a/doc/models/subscription-amount-with-breakdown.md +++ b/doc/models/subscription-amount-with-breakdown.md @@ -18,34 +18,34 @@ The breakdown details for the amount. Includes the gross, tax, fee, and shipping | `tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `net_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "gross_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "total_item_amount": { - "currency_code": "currency_code8", - "value": "value4" - }, - "fee_amount": { - "currency_code": "currency_code2", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "tax_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "net_amount": { - "currency_code": "currency_code6", - "value": "value2" - } -} +## Example + +```ruby +subscription_amount_with_breakdown = SubscriptionAmountWithBreakdown.new( + gross_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + total_item_amount: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + fee_amount: Money.new( + currency_code: 'currency_code2', + value: 'value4' + ), + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + tax_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + net_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ) +) ``` diff --git a/doc/models/subscription-application-context.md b/doc/models/subscription-application-context.md index f4cbf8d..2ac06a0 100644 --- a/doc/models/subscription-application-context.md +++ b/doc/models/subscription-application-context.md @@ -19,19 +19,19 @@ The application context, which customizes the payer experience during the subscr | `return_url` | `String` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | | `cancel_url` | `String` | Required | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "user_action": "SUBSCRIBE_NOW", - "return_url": "return_url0", - "cancel_url": "cancel_url2", - "brand_name": "brand_name8", - "locale": "locale2", - "payment_method": { - "payee_preferred": "UNRESTRICTED" - } -} +## Example + +```ruby +subscription_application_context = SubscriptionApplicationContext.new( + return_url: 'return_url4', + cancel_url: 'cancel_url6', + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + user_action: ApplicationContextUserAction::SUBSCRIBE_NOW, + payment_method: PaymentMethod.new( + payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED + ) +) ``` diff --git a/doc/models/subscription-billing-cycle.md b/doc/models/subscription-billing-cycle.md index ccede75..4638e64 100644 --- a/doc/models/subscription-billing-cycle.md +++ b/doc/models/subscription-billing-cycle.md @@ -17,52 +17,51 @@ The billing cycle details. | `sequence` | `Integer` | Required | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Constraints**: `>= 1`, `<= 99` | | `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | -## Example (as JSON) +## Example -```json -{ - "frequency": { - "interval_unit": "DAY", - "interval_count": 1 - }, - "tenure_type": "REGULAR", - "sequence": 30, - "total_cycles": 1, - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +```ruby +subscription_billing_cycle = SubscriptionBillingCycle.new( + frequency: Frequency.new( + interval_unit: IntervalUnit::DAY, + interval_count: 1 + ), + tenure_type: TenureType::REGULAR, + sequence: 30, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - } -} + create_time: 'create_time4' + ), + total_cycles: 1 +) ``` diff --git a/doc/models/subscription-billing-information.md b/doc/models/subscription-billing-information.md index d62fa6b..aa1e560 100644 --- a/doc/models/subscription-billing-information.md +++ b/doc/models/subscription-billing-information.md @@ -19,51 +19,32 @@ The billing details for the subscription. If the subscription was or is active, | `failed_payments_count` | `Integer` | Required, Read-only | The number of consecutive payment failures. Resets to `0` after a successful payment. If this reaches the `payment_failure_threshold` value, the subscription updates to the `SUSPENDED` state.

**Constraints**: `>= 0`, `<= 999` | | `last_failed_payment` | [`FailedPaymentDetails`](../../doc/models/failed-payment-details.md) | Optional | The details for the failed payment of the subscription. | -## Example (as JSON) - -```json -{ - "outstanding_balance": { - "currency_code": "currency_code8", - "value": "value4" - }, - "cycle_executions": [ - { - "tenure_type": "REGULAR", - "sequence": 64, - "cycles_completed": 110, - "cycles_remaining": 14, - "current_pricing_scheme_version": 99, - "total_cycles": 254 - }, - { - "tenure_type": "REGULAR", - "sequence": 64, - "cycles_completed": 110, - "cycles_remaining": 14, - "current_pricing_scheme_version": 99, - "total_cycles": 254 - } - ], - "last_payment": { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "time": "time2" - }, - "next_billing_time": "next_billing_time0", - "final_payment_time": "final_payment_time4", - "failed_payments_count": 70, - "last_failed_payment": { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "time": "time4", - "reason_code": "PAYER_CANNOT_PAY", - "next_payment_retry_time": "next_payment_retry_time6" - } -} +## Example + +```ruby +subscription_billing_information = SubscriptionBillingInformation.new( + outstanding_balance: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + failed_payments_count: nil, + last_payment: LastPaymentDetails.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + time: 'time2' + ), + next_billing_time: 'next_billing_time2', + final_payment_time: 'final_payment_time6', + last_failed_payment: FailedPaymentDetails.new( + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + time: 'time4', + next_payment_retry_time: 'next_payment_retry_time6' + ) +) ``` diff --git a/doc/models/subscription-card-request.md b/doc/models/subscription-card-request.md index bd44c46..3a2c097 100644 --- a/doc/models/subscription-card-request.md +++ b/doc/models/subscription-card-request.md @@ -20,15 +20,15 @@ The payment card to use to fund a payment. Can be a credit or debit card. | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `attributes` | [`SubscriptionsCardAttributes`](../../doc/models/subscriptions-card-attributes.md) | Optional | Additional attributes associated with the use of this card. | -## Example (as JSON) - -```json -{ - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "type": "UNKNOWN" -} +## Example + +```ruby +subscription_card_request = SubscriptionCardRequest.new( + name: 'name2', + number: 'number0', + expiry: 'expiry0', + security_code: 'security_code4', + type: CardType::STORE +) ``` diff --git a/doc/models/subscription-collection.md b/doc/models/subscription-collection.md index 2db5444..7a8da7b 100644 --- a/doc/models/subscription-collection.md +++ b/doc/models/subscription-collection.md @@ -14,39 +14,21 @@ The list of subscriptions. | `subscriptions` | [`Array[Subscription]`](../../doc/models/subscription.md) | Optional | An array of subscriptions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "subscriptions": [ - { - "id": "id6", - "plan_id": "plan_id8", - "start_time": "start_time0", - "quantity": "quantity2", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - }, - { - "id": "id6", - "plan_id": "plan_id8", - "start_time": "start_time0", - "quantity": "quantity2", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - } - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } +## Example + +```ruby +subscription_collection = SubscriptionCollection.new( + subscriptions: [ + Subscription.new( + plan_id: 'plan_id8', + start_time: 'start_time0', + quantity: 'quantity2', + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ) + ) ] -} +) ``` diff --git a/doc/models/subscription-customer-information.md b/doc/models/subscription-customer-information.md index 8388ac4..1d5d03a 100644 --- a/doc/models/subscription-customer-information.md +++ b/doc/models/subscription-customer-information.md @@ -15,18 +15,18 @@ The details about a customer in PayPal's system of record. | `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | -## Example (as JSON) - -```json -{ - "id": "id2", - "email_address": "email_address0", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - } -} +## Example + +```ruby +subscription_customer_information = SubscriptionCustomerInformation.new( + id: 'id2', + email_address: 'email_address0', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ) +) ``` diff --git a/doc/models/subscription-error-exception.md b/doc/models/subscription-error-exception.md index c1fb358..5e04753 100644 --- a/doc/models/subscription-error-exception.md +++ b/doc/models/subscription-error-exception.md @@ -18,90 +18,13 @@ The error details. | `details` | [`Array[ErrorDetails]`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](https://developer.paypal.com/api/rest/responses/#hateoas-links). | -## Example (as JSON) - -```json -{ - "name": "name0", - "message": "message0", - "debug_id": "debug_id4", - "information_link": "information_link8", - "details": [ - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description0" - }, - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description0" - }, - { - "field": "field4", - "value": "value2", - "location": "location4", - "issue": "issue6", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "description": "description0" - } - ], - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionErrorException => e + puts "Caught SubscriptionErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-patch-application-context.md b/doc/models/subscription-patch-application-context.md index 89a0352..eff8c40 100644 --- a/doc/models/subscription-patch-application-context.md +++ b/doc/models/subscription-patch-application-context.md @@ -18,18 +18,18 @@ The application context, which customizes the payer experience during the subscr | `return_url` | `String` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | | `cancel_url` | `String` | Required | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "return_url": "return_url4", - "cancel_url": "cancel_url8", - "brand_name": "brand_name4", - "locale": "locale8", - "payment_method": { - "payee_preferred": "UNRESTRICTED" - } -} +## Example + +```ruby +subscription_patch_application_context = SubscriptionPatchApplicationContext.new( + return_url: 'return_url6', + cancel_url: 'cancel_url6', + brand_name: 'brand_name8', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + payment_method: PaymentMethod.new( + payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED + ) +) ``` diff --git a/doc/models/subscription-payer-name.md b/doc/models/subscription-payer-name.md index 3278bc6..59eb63a 100644 --- a/doc/models/subscription-payer-name.md +++ b/doc/models/subscription-payer-name.md @@ -18,15 +18,15 @@ The name of the party. | `suffix` | `String` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | | `full_name` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | -## Example (as JSON) - -```json -{ - "prefix": "prefix4", - "given_name": "given_name8", - "surname": "surname2", - "middle_name": "middle_name4", - "suffix": "suffix4" -} +## Example + +```ruby +subscription_payer_name = SubscriptionPayerName.new( + prefix: 'prefix4', + given_name: 'given_name8', + surname: 'surname2', + middle_name: 'middle_name6', + suffix: 'suffix6' +) ``` diff --git a/doc/models/subscription-payer.md b/doc/models/subscription-payer.md index b8ab5bd..d7aa555 100644 --- a/doc/models/subscription-payer.md +++ b/doc/models/subscription-payer.md @@ -15,16 +15,16 @@ The customer who approves and pays for the order. The customer is also known as | `payer_id` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "email_address": "email_address4", - "payer_id": "payer_id4", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```ruby +subscription_payer = SubscriptionPayer.new( + email_address: 'email_address6', + payer_id: 'payer_id4', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) +) ``` diff --git a/doc/models/subscription-payment-source-response.md b/doc/models/subscription-payment-source-response.md index 6c72045..7e831c2 100644 --- a/doc/models/subscription-payment-source-response.md +++ b/doc/models/subscription-payment-source-response.md @@ -13,23 +13,23 @@ The payment source used to fund the payment. | --- | --- | --- | --- | | `card` | [`CardResponseWithBillingAddress`](../../doc/models/card-response-with-billing-address.md) | Optional | The payment card used to fund the payment. Card can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - }, - "expiry": "expiry4", - "currency_code": "currency_code2" - } -} +## Example + +```ruby +subscription_payment_source_response = SubscriptionPaymentSourceResponse.new( + card: CardResponseWithBillingAddress.new( + name: 'name6', + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ), + expiry: 'expiry4', + currency_code: 'currency_code2' + ) +) ``` diff --git a/doc/models/subscription-payment-source.md b/doc/models/subscription-payment-source.md index 7a8781c..c88078a 100644 --- a/doc/models/subscription-payment-source.md +++ b/doc/models/subscription-payment-source.md @@ -13,17 +13,17 @@ The payment source definition. To be eligible to create subscription using debit | --- | --- | --- | --- | | `card` | [`SubscriptionCardRequest`](../../doc/models/subscription-card-request.md) | Optional | The payment card to use to fund a payment. Can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "card": { - "name": "name6", - "number": "number6", - "expiry": "expiry4", - "security_code": "security_code8", - "type": "UNKNOWN" - } -} +## Example + +```ruby +subscription_payment_source = SubscriptionPaymentSource.new( + card: SubscriptionCardRequest.new( + name: 'name6', + number: 'number6', + expiry: 'expiry4', + security_code: 'security_code8', + type: CardType::UNKNOWN + ) +) ``` diff --git a/doc/models/subscription-plan-status.md b/doc/models/subscription-plan-status.md index 2f4e757..f0afa25 100644 --- a/doc/models/subscription-plan-status.md +++ b/doc/models/subscription-plan-status.md @@ -15,3 +15,9 @@ The plan status. | `INACTIVE` | The plan is inactive. | | `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | +## Example + +```ruby +subscription_plan_status = SubscriptionPlanStatus::INACTIVE +``` + diff --git a/doc/models/subscription-pricing-model.md b/doc/models/subscription-pricing-model.md index a76c322..3a42663 100644 --- a/doc/models/subscription-pricing-model.md +++ b/doc/models/subscription-pricing-model.md @@ -14,3 +14,9 @@ The pricing model for tiered plan. The `tiers` parameter is required. | `VOLUME` | A volume pricing model. | | `TIERED` | A tiered pricing model. | +## Example + +```ruby +subscription_pricing_model = SubscriptionPricingModel::VOLUME +``` + diff --git a/doc/models/subscription-pricing-scheme.md b/doc/models/subscription-pricing-scheme.md index 73495ca..8f281fb 100644 --- a/doc/models/subscription-pricing-scheme.md +++ b/doc/models/subscription-pricing-scheme.md @@ -18,43 +18,42 @@ The pricing scheme details. | `create_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})$` | | `update_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})$` | -## Example (as JSON) - -```json -{ - "version": 172, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +## Example + +```ruby +subscription_pricing_scheme = SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time2" -} + create_time: 'create_time4' +) ``` diff --git a/doc/models/subscription-status.md b/doc/models/subscription-status.md new file mode 100644 index 0000000..f77fc62 --- /dev/null +++ b/doc/models/subscription-status.md @@ -0,0 +1,26 @@ + +# Subscription Status + +The status of the subscription. + +## Enumeration + +`SubscriptionStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `APPROVAL_PENDING` | The subscription is created but not yet approved by the buyer. | +| `APPROVED` | The buyer has approved the subscription. | +| `ACTIVE` | The subscription is active. | +| `SUSPENDED` | The subscription is suspended. | +| `CANCELLED` | The subscription is cancelled. | +| `EXPIRED` | The subscription is expired. | + +## Example + +```ruby +subscription_status = SubscriptionStatus::ACTIVE +``` + diff --git a/doc/models/subscription-transaction-details.md b/doc/models/subscription-transaction-details.md index 61bd8ee..bff5e3d 100644 --- a/doc/models/subscription-transaction-details.md +++ b/doc/models/subscription-transaction-details.md @@ -18,47 +18,46 @@ The transaction details. | `payer_email` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | | `time` | `String` | Required | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | -## Example (as JSON) - -```json -{ - "status": "REFUNDED", - "id": "id4", - "amount_with_breakdown": { - "gross_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "total_item_amount": { - "currency_code": "currency_code8", - "value": "value4" - }, - "fee_amount": { - "currency_code": "currency_code2", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "tax_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "net_amount": { - "currency_code": "currency_code6", - "value": "value2" - } - }, - "payer_name": { - "prefix": "prefix8", - "given_name": "given_name2", - "surname": "surname8", - "middle_name": "middle_name0", - "suffix": "suffix0" - }, - "payer_email": "payer_email2", - "time": "time4" -} +## Example + +```ruby +subscription_transaction_details = SubscriptionTransactionDetails.new( + id: nil, + amount_with_breakdown: SubscriptionAmountWithBreakdown.new( + gross_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + total_item_amount: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + fee_amount: Money.new( + currency_code: 'currency_code2', + value: 'value4' + ), + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + tax_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + net_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ) + ), + time: 'time0', + payer_name: SubscriptionPayerName.new( + prefix: 'prefix8', + given_name: 'given_name2', + surname: 'surname8', + middle_name: 'middle_name0', + suffix: 'suffix0' + ), + payer_email: 'payer_email8' +) ``` diff --git a/doc/models/subscription.md b/doc/models/subscription.md index c3b1e5e..088e879 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -24,19 +24,21 @@ The subscription details. | `plan_overridden` | `TrueClass \| FalseClass` | Optional, Read-only | Indicates whether the subscription has overridden any plan attributes. | | `plan` | [`PlanDetails`](../../doc/models/plan-details.md) | Optional | The plan details. | | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | - -## Example (as JSON) - -```json -{ - "id": "id4", - "plan_id": "plan_id6", - "start_time": "start_time8", - "quantity": "quantity0", - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - } -} +| `status` | [`SubscriptionStatus`](../../doc/models/subscription-status.md) | Optional | The status of the subscription. | +| `status_change_note` | `String` | Optional | The reason or notes for the status of the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | +| `status_update_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})$` | + +## Example + +```ruby +subscription = Subscription.new( + plan_id: 'plan_id6', + start_time: 'start_time8', + quantity: 'quantity0', + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ) +) ``` diff --git a/doc/models/subscriptions-card-attributes.md b/doc/models/subscriptions-card-attributes.md index 078ac81..0a845c6 100644 --- a/doc/models/subscriptions-card-attributes.md +++ b/doc/models/subscriptions-card-attributes.md @@ -15,27 +15,27 @@ Additional attributes associated with the use of this card. | `vault` | [`VaultInstructionBase`](../../doc/models/vault-instruction-base.md) | Optional | Basic vault instruction specification that can be extended by specific payment sources that supports vaulting. | | `verification` | [`CardVerification`](../../doc/models/card-verification.md) | Optional | The API caller can opt in to verify the card through PayPal offered verification services (e.g. Smart Dollar Auth, 3DS). | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "merchant_customer_id": "merchant_customer_id2" - }, - "vault": { - "store_in_vault": "ON_SUCCESS" - }, - "verification": { - "method": "3D_SECURE" - } -} +## Example + +```ruby +subscriptions_card_attributes = SubscriptionsCardAttributes.new( + customer: CardCustomer.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + merchant_customer_id: 'merchant_customer_id2' + ), + vault: VaultInstructionBase.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS + ), + verification: CardVerification.new( + method: OrdersCardVerificationMethod::ENUM_3D_SECURE + ) +) ``` diff --git a/doc/models/subscriptions-card-brand.md b/doc/models/subscriptions-card-brand.md index 2289cd9..e9d362e 100644 --- a/doc/models/subscriptions-card-brand.md +++ b/doc/models/subscriptions-card-brand.md @@ -37,3 +37,9 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `EFTPOS` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | | `UNKNOWN` | UNKNOWN payment network. | +## Example + +```ruby +subscriptions_card_brand = SubscriptionsCardBrand::STAR +``` + diff --git a/doc/models/supplementary-data.md b/doc/models/supplementary-data.md index d4cfa6f..46e8ee1 100644 --- a/doc/models/supplementary-data.md +++ b/doc/models/supplementary-data.md @@ -14,47 +14,47 @@ Supplementary data about a payment. This object passes information that can be u | `card` | [`CardSupplementaryData`](../../doc/models/card-supplementary-data.md) | Optional | Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. | | `risk` | [`RiskSupplementaryData`](../../doc/models/risk-supplementary-data.md) | Optional | Additional information necessary to evaluate the risk profile of a transaction. | -## Example (as JSON) - -```json -{ - "card": { - "level_2": { - "invoice_id": "invoice_id4", - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - } - }, - "level_3": { - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "duty_amount": { - "currency_code": "currency_code6", - "value": "value2" - }, - "discount_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "shipping_address": { - "address_line_1": "address_line_10", - "address_line_2": "address_line_20", - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "ships_from_postal_code": "ships_from_postal_code4" - } - }, - "risk": { - "customer": { - "ip_address": "ip_address0" - } - } -} +## Example + +```ruby +supplementary_data = SupplementaryData.new( + card: CardSupplementaryData.new( + level_2: Level2CardProcessingData.new( + invoice_id: 'invoice_id4', + tax_total: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ) + ), + level_3: Level3CardProcessingData.new( + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + duty_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ), + discount_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + shipping_address: Address.new( + country_code: 'country_code0', + address_line_1: 'address_line_10', + address_line_2: 'address_line_20', + admin_area_2: 'admin_area_24', + admin_area_1: 'admin_area_16', + postal_code: 'postal_code2' + ), + ships_from_postal_code: 'ships_from_postal_code4' + ) + ), + risk: RiskSupplementaryData.new( + customer: ParticipantMetadata.new( + ip_address: 'ip_address0' + ) + ) +) ``` diff --git a/doc/models/suspend-subscription.md b/doc/models/suspend-subscription.md index eedf865..9eb405a 100644 --- a/doc/models/suspend-subscription.md +++ b/doc/models/suspend-subscription.md @@ -13,11 +13,11 @@ The suspend subscription request details. | --- | --- | --- | --- | | `reason` | `String` | Required | The reason for suspension of the Subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason4" -} +```ruby +suspend_subscription = SuspendSubscription.new( + reason: 'reason2' +) ``` diff --git a/doc/models/tax-amount.md b/doc/models/tax-amount.md index d6a7f82..063fa72 100644 --- a/doc/models/tax-amount.md +++ b/doc/models/tax-amount.md @@ -13,14 +13,14 @@ The tax levied by a government on the purchase of goods or services. | --- | --- | --- | --- | | `tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -## Example (as JSON) - -```json -{ - "tax_amount": { - "currency_code": "currency_code2", - "value": "value8" - } -} +## Example + +```ruby +tax_amount = TaxAmount.new( + tax_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ) +) ``` diff --git a/doc/models/tax-id-type.md b/doc/models/tax-id-type.md index 0a5ac02..b73676e 100644 --- a/doc/models/tax-id-type.md +++ b/doc/models/tax-id-type.md @@ -14,3 +14,9 @@ The customer's tax ID type. | `BR_CPF` | The individual tax ID type, typically is 11 characters long. | | `BR_CNPJ` | The business tax ID type, typically is 14 characters long. | +## Example + +```ruby +tax_id_type = TaxIdType::BR_CPF +``` + diff --git a/doc/models/tax-info.md b/doc/models/tax-info.md index aea00bd..15c7dd3 100644 --- a/doc/models/tax-info.md +++ b/doc/models/tax-info.md @@ -14,12 +14,12 @@ The tax ID of the customer. The customer is also known as the payer. Both `tax_i | `tax_id` | `String` | Required | The customer's tax ID value.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[A-Z0-9_]+$` | -## Example (as JSON) +## Example -```json -{ - "tax_id": "tax_id0", - "tax_id_type": "BR_CPF" -} +```ruby +tax_info = TaxInfo.new( + tax_id: 'tax_id4', + tax_id_type: TaxIdType::BR_CPF +) ``` diff --git a/doc/models/taxes-override.md b/doc/models/taxes-override.md index fb97cbc..0514c9a 100644 --- a/doc/models/taxes-override.md +++ b/doc/models/taxes-override.md @@ -14,12 +14,12 @@ The tax details. | `percentage` | `String` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | | `inclusive` | `TrueClass \| FalseClass` | Optional | Indicates whether the tax was already included in the billing amount. | -## Example (as JSON) +## Example -```json -{ - "percentage": "percentage8", - "inclusive": false -} +```ruby +taxes_override = TaxesOverride.new( + percentage: 'percentage2', + inclusive: false +) ``` diff --git a/doc/models/taxes.md b/doc/models/taxes.md index 7300659..5a467d6 100644 --- a/doc/models/taxes.md +++ b/doc/models/taxes.md @@ -14,12 +14,12 @@ The tax details. | `percentage` | `String` | Required | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | | `inclusive` | `TrueClass \| FalseClass` | Optional | Indicates whether the tax was already included in the billing amount.

**Default**: `true` | -## Example (as JSON) +## Example -```json -{ - "percentage": "percentage6", - "inclusive": true -} +```ruby +taxes = Taxes.new( + percentage: 'percentage8', + inclusive: true +) ``` diff --git a/doc/models/tenure-type.md b/doc/models/tenure-type.md index 4da9e8a..e11e4a6 100644 --- a/doc/models/tenure-type.md +++ b/doc/models/tenure-type.md @@ -14,3 +14,9 @@ The tenure type of the billing cycle identifies if the billing cycle is a trial( | `REGULAR` | A regular billing cycle to identify recurring charges for the billing agreement. | | `TRIAL` | A trial billing cycle to identify free or discounted charge for the billing agreement. Free trails will not have a price object in pricing scheme where as a discounted trial would have a discounted price compared to regular billing cycle. | +## Example + +```ruby +tenure_type = TenureType::REGULAR +``` + diff --git a/doc/models/three-d-secure-authentication-response.md b/doc/models/three-d-secure-authentication-response.md index 3ebf6b0..f9c1267 100644 --- a/doc/models/three-d-secure-authentication-response.md +++ b/doc/models/three-d-secure-authentication-response.md @@ -14,12 +14,12 @@ Results of 3D Secure Authentication. | `authentication_status` | [`PaResStatus`](../../doc/models/pa-res-status.md) | Optional | Transactions status result identifier. The outcome of the issuer's authentication.

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

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

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

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

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_-]+$` | -## Example (as JSON) +## Example -```json -{ - "id": "id6", - "type": "BILLING_AGREEMENT" -} +```ruby +token = Token.new( + id: 'id6', + type: TokenType::BILLING_AGREEMENT +) ``` diff --git a/doc/models/transaction-details.md b/doc/models/transaction-details.md index 484e1ad..350ba0f 100644 --- a/doc/models/transaction-details.md +++ b/doc/models/transaction-details.md @@ -19,72 +19,71 @@ The transaction details. | `auction_info` | [`AuctionInformation`](../../doc/models/auction-information.md) | Optional | The auction information. | | `incentive_info` | [`IncentiveInformation`](../../doc/models/incentive-information.md) | Optional | The incentive details. | -## Example (as JSON) +## Example -```json -{ - "transaction_info": { - "paypal_account_id": "paypal_account_id4", - "transaction_id": "transaction_id0", - "paypal_reference_id": "paypal_reference_id2", - "paypal_reference_id_type": "ODR", - "transaction_event_code": "transaction_event_code6" - }, - "payer_info": { - "account_id": "account_id2", - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6", - "extension_number": "extension_number8" - }, - "address_status": "address_status2", - "payer_status": "payer_status2" - }, - "shipping_info": { - "name": "name0", - "method": "method4", - "address": { - "line1": "line18", - "line2": "line20", - "city": "city6", - "state": "state2", - "country_code": "country_code6", - "postal_code": "postal_code8" - }, - "secondary_shipping_address": { - "line1": "line16", - "line2": "line28", - "city": "city4", - "state": "state0", - "country_code": "country_code4", - "postal_code": "postal_code6" - } - }, - "cart_info": { - "item_details": [ - { - "item_code": "item_code0", - "item_name": "item_name8", - "item_description": "item_description4", - "item_options": "item_options2", - "item_quantity": "item_quantity2" - }, - { - "item_code": "item_code0", - "item_name": "item_name8", - "item_description": "item_description4", - "item_options": "item_options2", - "item_quantity": "item_quantity2" - } +```ruby +transaction_details = TransactionDetails.new( + transaction_info: TransactionInformation.new( + paypal_account_id: 'paypal_account_id4', + paypal_reference_id: 'paypal_reference_id2', + paypal_reference_id_type: PaypalReferenceIdType::ODR, + transaction_event_code: 'transaction_event_code6' + ), + payer_info: PayerInformation.new( + account_id: 'account_id2', + email_address: 'email_address2', + phone_number: Phone.new( + country_code: 'country_code2', + national_number: 'national_number6', + extension_number: 'extension_number8' + ), + address_status: 'address_status2', + payer_status: 'payer_status2' + ), + shipping_info: ShippingInformation.new( + name: 'name0', + method: 'method4', + address: SimplePostalAddressCoarseGrained.new( + line1: 'line18', + city: 'city6', + country_code: 'country_code6', + line2: 'line20', + state: 'state2', + postal_code: 'postal_code8' + ), + secondary_shipping_address: SimplePostalAddressCoarseGrained.new( + line1: 'line16', + city: 'city4', + country_code: 'country_code4', + line2: 'line28', + state: 'state0', + postal_code: 'postal_code6' + ) + ), + cart_info: CartInformation.new( + item_details: [ + ItemDetails.new( + item_code: 'item_code0', + item_name: 'item_name8', + item_description: 'item_description4', + item_options: 'item_options2', + item_quantity: 'item_quantity2' + ), + ItemDetails.new( + item_code: 'item_code0', + item_name: 'item_name8', + item_description: 'item_description4', + item_options: 'item_options2', + item_quantity: 'item_quantity2' + ) ], - "tax_inclusive": false, - "paypal_invoice_id": "paypal_invoice_id6" - }, - "store_info": { - "store_id": "store_id2", - "terminal_id": "terminal_id6" - } -} + tax_inclusive: false, + paypal_invoice_id: 'paypal_invoice_id6' + ), + store_info: StoreInformation.new( + store_id: 'store_id2', + terminal_id: 'terminal_id6' + ) +) ``` diff --git a/doc/models/transaction-information.md b/doc/models/transaction-information.md index a3e86d0..25a8627 100644 --- a/doc/models/transaction-information.md +++ b/doc/models/transaction-information.md @@ -46,15 +46,14 @@ The transaction information. | `instrument_type` | `String` | Optional | A high-level classification of the type of financial instrument that was used to fund a payment. The pattern is not provided because the value is defined by an external party. E.g. PAYPAL, CREDIT_CARD, DEBIT_CARD, APPLE_PAY, BANK , VENMO ,Pay Upon Invoice, Pay Later or Alternative Payment Methods (APM).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | | `instrument_sub_type` | `String` | Optional | A finer-grained classification of the financial instrument that was used to fund a payment. For example, `Visa card` or a `Mastercard` for a credit card, BANKCARD ,DISCOVER etc. The pattern is not provided because the value is defined by an external party.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | -## Example (as JSON) - -```json -{ - "paypal_account_id": "paypal_account_id6", - "transaction_id": "transaction_id2", - "paypal_reference_id": "paypal_reference_id4", - "paypal_reference_id_type": "ODR", - "transaction_event_code": "transaction_event_code8" -} +## Example + +```ruby +transaction_information = TransactionInformation.new( + paypal_account_id: 'paypal_account_id0', + paypal_reference_id: 'paypal_reference_id8', + paypal_reference_id_type: PaypalReferenceIdType::ODR, + transaction_event_code: 'transaction_event_code2' +) ``` diff --git a/doc/models/transaction-search-error-details.md b/doc/models/transaction-search-error-details.md index 7cf9707..24833c7 100644 --- a/doc/models/transaction-search-error-details.md +++ b/doc/models/transaction-search-error-details.md @@ -17,15 +17,15 @@ The error details. Required for client-side `4XX` errors. | `issue` | `String` | Required | The unique, fine-grained application-level error code. | | `description` | `String` | Optional | The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value. | -## Example (as JSON) - -```json -{ - "location": "body", - "issue": "issue2", - "field": "field0", - "value": "value8", - "description": "description6" -} +## Example + +```ruby +transaction_search_error_details = TransactionSearchErrorDetails.new( + issue: 'issue2', + field: 'field6', + value: 'value4', + location: 'body', + description: 'description8' +) ``` diff --git a/doc/models/transactions-list.md b/doc/models/transactions-list.md index 56ba029..8811b54 100644 --- a/doc/models/transactions-list.md +++ b/doc/models/transactions-list.md @@ -16,65 +16,90 @@ The list transactions for a subscription request details. | `total_pages` | `Integer` | Optional | The total number of pages.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) +## Example -```json -{ - "transactions": [ - { - "status": "PARTIALLY_REFUNDED", - "id": "id8", - "amount_with_breakdown": { - "gross_amount": { - "currency_code": "currency_code4", - "value": "value0" - }, - "total_item_amount": { - "currency_code": "currency_code8", - "value": "value4" - }, - "fee_amount": { - "currency_code": "currency_code2", - "value": "value4" - }, - "shipping_amount": { - "currency_code": "currency_code0", - "value": "value6" - }, - "tax_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "net_amount": { - "currency_code": "currency_code6", - "value": "value2" - } - }, - "payer_name": { - "prefix": "prefix8", - "given_name": "given_name2", - "surname": "surname8", - "middle_name": "middle_name0", - "suffix": "suffix0" - }, - "payer_email": "payer_email6", - "time": "time8" - } +```ruby +transactions_list = TransactionsList.new( + transactions: [ + SubscriptionTransactionDetails.new( + id: nil, + amount_with_breakdown: SubscriptionAmountWithBreakdown.new( + gross_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + total_item_amount: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + fee_amount: Money.new( + currency_code: 'currency_code2', + value: 'value4' + ), + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + tax_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + net_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ) + ), + time: 'time8', + payer_name: SubscriptionPayerName.new( + prefix: 'prefix8', + given_name: 'given_name2', + surname: 'surname8', + middle_name: 'middle_name0', + suffix: 'suffix0' + ), + payer_email: 'payer_email6' + ), + SubscriptionTransactionDetails.new( + id: nil, + amount_with_breakdown: SubscriptionAmountWithBreakdown.new( + gross_amount: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + total_item_amount: Money.new( + currency_code: 'currency_code8', + value: 'value4' + ), + fee_amount: Money.new( + currency_code: 'currency_code2', + value: 'value4' + ), + shipping_amount: Money.new( + currency_code: 'currency_code0', + value: 'value6' + ), + tax_amount: Money.new( + currency_code: 'currency_code2', + value: 'value8' + ), + net_amount: Money.new( + currency_code: 'currency_code6', + value: 'value2' + ) + ), + time: 'time8', + payer_name: SubscriptionPayerName.new( + prefix: 'prefix8', + given_name: 'given_name2', + surname: 'surname8', + middle_name: 'middle_name0', + suffix: 'suffix0' + ), + payer_email: 'payer_email6' + ) ], - "total_items": 254, - "total_pages": 34, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} + total_items: 8, + total_pages: 44 +) ``` diff --git a/doc/models/trustly-payment-object.md b/doc/models/trustly-payment-object.md index fc6a3be..9b095b9 100644 --- a/doc/models/trustly-payment-object.md +++ b/doc/models/trustly-payment-object.md @@ -17,15 +17,15 @@ Information needed to pay using Trustly. | `bic` | `String` | Optional | The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

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

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `34`, *Pattern*: `[a-zA-Z0-9]{4}` | -## Example (as JSON) - -```json -{ - "name": "name6", - "country_code": "country_code6", - "email": "email0", - "bic": "bic8", - "iban_last_chars": "iban_last_chars4" -} +## Example + +```ruby +trustly_payment_object = TrustlyPaymentObject.new( + name: 'name2', + country_code: 'country_code2', + email: 'email4', + bic: 'bic4', + iban_last_chars: 'iban_last_chars0' +) ``` diff --git a/doc/models/trustly-payment-request.md b/doc/models/trustly-payment-request.md index b6cad2f..095d946 100644 --- a/doc/models/trustly-payment-request.md +++ b/doc/models/trustly-payment-request.md @@ -16,20 +16,20 @@ Information needed to pay using Trustly. | `email` | `String` | Required | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | | `experience_context` | [`ExperienceContext`](../../doc/models/experience-context.md) | Optional | Customizes the payer experience during the approval process for the payment. | -## Example (as JSON) - -```json -{ - "name": "name2", - "country_code": "country_code2", - "email": "email4", - "experience_context": { - "brand_name": "brand_name2", - "locale": "locale6", - "shipping_preference": "NO_SHIPPING", - "return_url": "return_url4", - "cancel_url": "cancel_url6" - } -} +## Example + +```ruby +trustly_payment_request = TrustlyPaymentRequest.new( + name: 'name4', + country_code: 'country_code6', + email: 'email2', + experience_context: ExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + shipping_preference: ExperienceContextShippingPreference::NO_SHIPPING, + return_url: 'return_url4', + cancel_url: 'cancel_url6' + ) +) ``` diff --git a/doc/models/universal-product-code.md b/doc/models/universal-product-code.md index b792ba7..e85ae87 100644 --- a/doc/models/universal-product-code.md +++ b/doc/models/universal-product-code.md @@ -14,12 +14,12 @@ The Universal Product Code of the item. | `type` | [`UpcType`](../../doc/models/upc-type.md) | Required | The Universal Product Code type.

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

**Constraints**: *Minimum Length*: `6`, *Maximum Length*: `17`, *Pattern*: `^[0-9]{0,17}$` | -## Example (as JSON) +## Example -```json -{ - "type": "UPC-E", - "code": "code2" -} +```ruby +universal_product_code = UniversalProductCode.new( + type: UpcType::UPC_5, + code: 'code2' +) ``` diff --git a/doc/models/upc-type.md b/doc/models/upc-type.md index 6557796..9455575 100644 --- a/doc/models/upc-type.md +++ b/doc/models/upc-type.md @@ -19,3 +19,9 @@ The Universal Product Code type. | `UPC_2` | | `UPC_5` | +## Example + +```ruby +upc_type = UpcType::UPC_E +``` + diff --git a/doc/models/update-pricing-scheme.md b/doc/models/update-pricing-scheme.md index 9298ec6..2276dcf 100644 --- a/doc/models/update-pricing-scheme.md +++ b/doc/models/update-pricing-scheme.md @@ -14,46 +14,45 @@ The update pricing scheme request details. | `billing_cycle_sequence` | `Integer` | Required | The billing cycle sequence.

**Constraints**: `>= 1`, `<= 99` | | `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Required | The pricing scheme details. | -## Example (as JSON) - -```json -{ - "billing_cycle_sequence": 99, - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +## Example + +```ruby +update_pricing_scheme = UpdatePricingScheme.new( + billing_cycle_sequence: 99, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - } -} + create_time: 'create_time4' + ) +) ``` diff --git a/doc/models/update-pricing-schemes-request.md b/doc/models/update-pricing-schemes-request.md index fa22541..60d4c95 100644 --- a/doc/models/update-pricing-schemes-request.md +++ b/doc/models/update-pricing-schemes-request.md @@ -13,50 +13,49 @@ The update pricing scheme request details. | --- | --- | --- | --- | | `pricing_schemes` | [`Array[UpdatePricingScheme]`](../../doc/models/update-pricing-scheme.md) | Required | An array of pricing schemes.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `99` | -## Example (as JSON) - -```json -{ - "pricing_schemes": [ - { - "billing_cycle_sequence": 34, - "pricing_scheme": { - "version": 10, - "fixed_price": { - "currency_code": "currency_code4", - "value": "value0" - }, - "pricing_model": "VOLUME", - "tiers": [ - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - }, - { - "starting_quantity": "starting_quantity8", - "ending_quantity": "ending_quantity6", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } +## Example + +```ruby +update_pricing_schemes_request = UpdatePricingSchemesRequest.new( + pricing_schemes: [ + UpdatePricingScheme.new( + billing_cycle_sequence: 34, + pricing_scheme: SubscriptionPricingScheme.new( + fixed_price: Money.new( + currency_code: 'currency_code4', + value: 'value0' + ), + pricing_model: SubscriptionPricingModel::VOLUME, + tiers: [ + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ), + PricingTier.new( + starting_quantity: 'starting_quantity8', + amount: Money.new( + currency_code: 'currency_code6', + value: 'value0' + ), + ending_quantity: 'ending_quantity6' + ) ], - "create_time": "create_time4" - } - } + create_time: 'create_time4' + ) + ) ] -} +) ``` diff --git a/doc/models/usage-pattern.md b/doc/models/usage-pattern.md index ee8ca28..c0f02fc 100644 --- a/doc/models/usage-pattern.md +++ b/doc/models/usage-pattern.md @@ -24,3 +24,9 @@ Expected business/pricing model for the billing agreement., Expected business/ch | `INSTALLMENT_PREPAID` | Merchant-managed installment plan when the "amount" to be paid and the "billing frequency" are fixed, but there is a defined number of payments with the payment due before the good/service is delivered. | | `INSTALLMENT_POSTPAID` | Merchant-managed installment plan when the "amount" to be paid and the "billing frequency" are fixed, but there is a defined number of payments with the payment due after the goods/services are delivered. | +## Example + +```ruby +usage_pattern = UsagePattern::IMMEDIATE +``` + diff --git a/doc/models/usage-type.md b/doc/models/usage-type.md index 42be9d7..04d6644 100644 --- a/doc/models/usage-type.md +++ b/doc/models/usage-type.md @@ -14,3 +14,9 @@ The usage type associated with the PayPal payment token. | `MERCHANT` | The PayPal Payment Token will be used for future transaction directly with a merchant. | | `PLATFORM` | The PayPal Payment Token will be used for future transaction on a platform. A platform is typically a marketplace or a channel that a payer can purchase goods and services from multiple merchants. | +## Example + +```ruby +usage_type = UsageType::MERCHANT +``` + diff --git a/doc/models/vault-apple-pay-request.md b/doc/models/vault-apple-pay-request.md index 9547d08..55bc075 100644 --- a/doc/models/vault-apple-pay-request.md +++ b/doc/models/vault-apple-pay-request.md @@ -14,23 +14,23 @@ A resource representing a request to vault Apple Pay. | `token` | `String` | Optional | Encrypted Apple Pay token, containing card information. This token would be base64 encoded.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | | `card` | [`ApplePayRequestCard`](../../doc/models/apple-pay-request-card.md) | Optional | The payment card to be used to fund a payment. Can be a credit or debit card. | -## Example (as JSON) - -```json -{ - "token": "token4", - "card": { - "type": "UNKNOWN", - "brand": "CB_NATIONALE", - "billing_address": { - "address_line_1": "address_line_12", - "address_line_2": "address_line_28", - "admin_area_2": "admin_area_28", - "admin_area_1": "admin_area_14", - "postal_code": "postal_code0", - "country_code": "country_code8" - } - } -} +## Example + +```ruby +vault_apple_pay_request = VaultApplePayRequest.new( + token: 'token8', + card: ApplePayRequestCard.new( + type: CardType::UNKNOWN, + brand: CardBrand::CB_NATIONALE, + billing_address: Address.new( + country_code: 'country_code8', + address_line_1: 'address_line_12', + address_line_2: 'address_line_28', + admin_area_2: 'admin_area_28', + admin_area_1: 'admin_area_14', + postal_code: 'postal_code0' + ) + ) +) ``` diff --git a/doc/models/vault-card-experience-context.md b/doc/models/vault-card-experience-context.md index 30a6250..52ddabe 100644 --- a/doc/models/vault-card-experience-context.md +++ b/doc/models/vault-card-experience-context.md @@ -18,16 +18,16 @@ A resource representing an experience context of vault a card. | `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) - -```json -{ - "user_action": "CONTINUE", - "brand_name": "brand_name4", - "locale": "locale8", - "return_url": "return_url4", - "cancel_url": "cancel_url8", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" -} +## Example + +```ruby +vault_card_experience_context = VaultCardExperienceContext.new( + brand_name: 'brand_name2', + locale: 'locale6', + return_url: 'return_url4', + cancel_url: 'cancel_url6', + vault_instruction: VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS, + user_action: VaultUserAction::CONTINUE +) ``` diff --git a/doc/models/vault-card-verification-method.md b/doc/models/vault-card-verification-method.md index 2a7a90f..a308993 100644 --- a/doc/models/vault-card-verification-method.md +++ b/doc/models/vault-card-verification-method.md @@ -14,3 +14,9 @@ The verification method of the card. | `SCA_WHEN_REQUIRED` | When an authorization or transaction is attempted this option will return a contingency and HATEOAS link only when local regulations require strong customer authentication, (e.g. 3DS in countries and use cases where it is mandated). The API caller should redirect the payer to the link so that they can authenticate themselves. In all cases, when an authorization is requested the AVS/CVV results will be returned in the response. | | `SCA_ALWAYS` | Selecting this option will attempt to force a strong customer authentication for the authorization/transaction. In countries where SCA has been defined and implemented it will result in a contingency and HATEOAS link being returned. The API caller should redirect the payer to that link so that they can authenticate themselves against their issuing bank or other entity. As noted, the HATEOAS link is only available in all regions where strong authentication is supported, (e.g. in European countries where 3DS is live). Merchants can use this setting as an additional layer of security if they choose to. In all cases, when an authorization is requested the AVS/CVV results will be returned in the response. | +## Example + +```ruby +vault_card_verification_method = VaultCardVerificationMethod::SCA_WHEN_REQUIRED +``` + diff --git a/doc/models/vault-customer.md b/doc/models/vault-customer.md index 59bd7b8..fe72ca4 100644 --- a/doc/models/vault-customer.md +++ b/doc/models/vault-customer.md @@ -14,15 +14,15 @@ This object represents a merchant’s customer, allowing them to store contact d | `id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "id": "id2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```ruby +vault_customer = VaultCustomer.new( + id: 'id2', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) +) ``` diff --git a/doc/models/vault-experience-context.md b/doc/models/vault-experience-context.md index b8a4773..3080725 100644 --- a/doc/models/vault-experience-context.md +++ b/doc/models/vault-experience-context.md @@ -20,16 +20,16 @@ Customizes the Vault creation flow experience for your customers. | `app_switch_context` | [`AppSwitchContext`](../../doc/models/app-switch-context.md) | Optional | Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. | | `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "user_action": "CONTINUE", - "brand_name": "brand_name0", - "locale": "locale4", - "return_url": "return_url2", - "cancel_url": "cancel_url4" -} +## Example + +```ruby +vault_experience_context = VaultExperienceContext.new( + brand_name: 'brand_name0', + locale: 'locale4', + return_url: 'return_url2', + cancel_url: 'cancel_url4', + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + user_action: VaultUserAction::CONTINUE +) ``` diff --git a/doc/models/vault-instruction-action.md b/doc/models/vault-instruction-action.md index a11f117..39d55a8 100644 --- a/doc/models/vault-instruction-action.md +++ b/doc/models/vault-instruction-action.md @@ -14,3 +14,9 @@ Vault Instruction on action to be performed after a successful payer approval. | `ON_CREATE_PAYMENT_TOKENS` | Vault the payment method after API caller performs a successful POST on Payment Tokens. | | `ON_PAYER_APPROVAL` | Vault the payment method on successful payer authentication and approval. | +## Example + +```ruby +vault_instruction_action = VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS +``` + diff --git a/doc/models/vault-instruction-base.md b/doc/models/vault-instruction-base.md index cb7b10a..7738249 100644 --- a/doc/models/vault-instruction-base.md +++ b/doc/models/vault-instruction-base.md @@ -13,11 +13,11 @@ Basic vault instruction specification that can be extended by specific payment s | --- | --- | --- | --- | | `store_in_vault` | [`StoreInVaultInstruction`](../../doc/models/store-in-vault-instruction.md) | Optional | Defines how and when the payment source gets vaulted.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "store_in_vault": "ON_SUCCESS" -} +```ruby +vault_instruction_base = VaultInstructionBase.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS +) ``` diff --git a/doc/models/vault-instruction.md b/doc/models/vault-instruction.md index 2ea341a..7cb3b5b 100644 --- a/doc/models/vault-instruction.md +++ b/doc/models/vault-instruction.md @@ -13,11 +13,11 @@ Base vaulting specification. The object can be extended for specific use cases w | --- | --- | --- | --- | | `store_in_vault` | [`StoreInVaultInstruction`](../../doc/models/store-in-vault-instruction.md) | Required | Defines how and when the payment source gets vaulted.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) +## Example -```json -{ - "store_in_vault": "ON_SUCCESS" -} +```ruby +vault_instruction = VaultInstruction.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS +) ``` diff --git a/doc/models/vault-paypal-wallet-request.md b/doc/models/vault-paypal-wallet-request.md index e50e949..4ce6606 100644 --- a/doc/models/vault-paypal-wallet-request.md +++ b/doc/models/vault-paypal-wallet-request.md @@ -20,33 +20,33 @@ A resource representing a request to vault PayPal Wallet. | `billing_plan` | [`Plan`](../../doc/models/plan.md) | Optional | The merchant level Recurring Billing plan metadata for the Billing Agreement. | | `experience_context` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | A resource representing an experience context of vault PayPal Wallet. | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description0", - "usage_pattern": "INSTALLMENT_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```ruby +vault_paypal_wallet_request = VaultPaypalWalletRequest.new( + description: 'description0', + usage_pattern: UsagePattern::RECURRING_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT +) ``` diff --git a/doc/models/vault-response-customer.md b/doc/models/vault-response-customer.md index 675c47c..6a565e8 100644 --- a/doc/models/vault-response-customer.md +++ b/doc/models/vault-response-customer.md @@ -15,22 +15,12 @@ This object defines a customer in your system. Use it to manage customer profile | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | | `links` | `Array[Object]` | Optional, Read-only | DEPRECATED. This field is DEPRECATED.

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

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "CREATED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ] -} +## Example + +```ruby +vault_response = VaultResponse.new( + id: 'id8', + status: VaultStatus::VAULTED, + customer: VaultCustomer.new( + id: 'id0', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ) +) ``` diff --git a/doc/models/vault-status.md b/doc/models/vault-status.md index aa7e1ee..d1fef99 100644 --- a/doc/models/vault-status.md +++ b/doc/models/vault-status.md @@ -15,3 +15,9 @@ The vault status. | `CREATED` | DEPRECATED. The payment source has been saved in your customer's vault. This status applies to deprecated integration patterns and will not be returned for v3/vault integrations. | | `APPROVED` | Customer has approved the action of saving the specified payment_source into their vault. Use v3/vault/payment-tokens with given setup_token to save the payment source in the vault | +## Example + +```ruby +vault_status = VaultStatus::APPROVED +``` + diff --git a/doc/models/vault-token-request-type.md b/doc/models/vault-token-request-type.md index 235563b..ebf9bc5 100644 --- a/doc/models/vault-token-request-type.md +++ b/doc/models/vault-token-request-type.md @@ -13,3 +13,9 @@ The tokenization method that generated the ID. | --- | --- | | `SETUP_TOKEN` | The setup token, which is a temporary reference to payment source. | +## Example + +```ruby +vault_token_request_type = VaultTokenRequestType::SETUP_TOKEN +``` + diff --git a/doc/models/vault-token-request.md b/doc/models/vault-token-request.md index d2a02d6..6784f84 100644 --- a/doc/models/vault-token-request.md +++ b/doc/models/vault-token-request.md @@ -14,12 +14,12 @@ The Tokenized Payment Source representing a Request to Vault a Token. | `id` | `String` | Required | The PayPal-generated ID for the token.

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

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_-]+$` | -## Example (as JSON) +## Example -```json -{ - "id": "id8", - "type": "SETUP_TOKEN" -} +```ruby +vault_token_request = VaultTokenRequest.new( + id: 'id2', + type: VaultTokenRequestType::SETUP_TOKEN +) ``` diff --git a/doc/models/vault-user-action.md b/doc/models/vault-user-action.md index a7d5044..dd972b1 100644 --- a/doc/models/vault-user-action.md +++ b/doc/models/vault-user-action.md @@ -14,3 +14,9 @@ User Action on action to be performed after a successful payer approval. | `SETUP_NOW` | After you redirect the customer to the PayPal payment page, a Setup Now button appears. Use this option when no additional inputs are needed from merchant site and to create the billing agreement immediately when the customer clicks Setup Now. | | `CONTINUE` | After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when you want to redirect the customer from the completed payment page to the merchant site for additional inputs without immediately creating the billing agreement. | +## Example + +```ruby +vault_user_action = VaultUserAction::SETUP_NOW +``` + diff --git a/doc/models/vault-venmo-request.md b/doc/models/vault-venmo-request.md index 3b351b3..3dc1897 100644 --- a/doc/models/vault-venmo-request.md +++ b/doc/models/vault-venmo-request.md @@ -19,33 +19,33 @@ A resource representing a request to vault Venmo. | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `experience_context` | [`VenmoExperienceContext`](../../doc/models/venmo-experience-context.md) | Optional | A resource representing an experience context of vault a venmo account. | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description0", - "usage_pattern": "UNSCHEDULED_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```ruby +vault_venmo_request = VaultVenmoRequest.new( + description: 'description0', + usage_pattern: UsagePattern::SUBSCRIPTION_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT +) ``` diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md index fc1b188..2d17138 100644 --- a/doc/models/vaulted-digital-wallet-shipping-details.md +++ b/doc/models/vaulted-digital-wallet-shipping-details.md @@ -17,27 +17,27 @@ The shipping details. | `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) - -```json -{ - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address6", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "PICKUP_IN_STORE", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } -} +## Example + +```ruby +vaulted_digital_wallet_shipping_details = VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address0', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::PICKUP_IN_STORE, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) +) ``` diff --git a/doc/models/vaulted-digital-wallet.md b/doc/models/vaulted-digital-wallet.md index 16c2c3e..21f6a95 100644 --- a/doc/models/vaulted-digital-wallet.md +++ b/doc/models/vaulted-digital-wallet.md @@ -18,33 +18,33 @@ Resource consolidating common request and response attributes for vaulting a Dig | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description2", - "usage_pattern": "THRESHOLD_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```ruby +vaulted_digital_wallet = VaultedDigitalWallet.new( + description: 'description8', + usage_pattern: UsagePattern::INSTALLMENT_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT +) ``` diff --git a/doc/models/venmo-experience-context.md b/doc/models/venmo-experience-context.md index 8f36068..ab3eb7f 100644 --- a/doc/models/venmo-experience-context.md +++ b/doc/models/venmo-experience-context.md @@ -16,14 +16,14 @@ A resource representing an experience context of vault a venmo account. | `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "user_action": "CONTINUE", - "brand_name": "brand_name0", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" -} +## Example + +```ruby +venmo_experience_context = VenmoExperienceContext.new( + brand_name: 'brand_name0', + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + vault_instruction: VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS, + user_action: VaultUserAction::CONTINUE +) ``` diff --git a/doc/models/venmo-payment-token-customer-type.md b/doc/models/venmo-payment-token-customer-type.md index e0aa988..88c6c66 100644 --- a/doc/models/venmo-payment-token-customer-type.md +++ b/doc/models/venmo-payment-token-customer-type.md @@ -14,3 +14,9 @@ The customer type associated with the Venmo payment token. This is to indicate w | `CONSUMER` | The customer vaulting the Venmo payment token is a consumer on the merchant / platform. | | `BUSINESS` | The customer vaulting the Venmo payment token is a business on merchant / platform. | +## Example + +```ruby +venmo_payment_token_customer_type = VenmoPaymentTokenCustomerType::CONSUMER +``` + diff --git a/doc/models/venmo-payment-token-usage-pattern.md b/doc/models/venmo-payment-token-usage-pattern.md index 473c156..923086d 100644 --- a/doc/models/venmo-payment-token-usage-pattern.md +++ b/doc/models/venmo-payment-token-usage-pattern.md @@ -18,3 +18,9 @@ Expected business/pricing model for the billing agreement. | `THRESHOLD_PREPAID` | Charge payer when the set amount is reached or monthly billing cycle, whichever comes first, before the goods/service is delivered. | | `THRESHOLD_POSTPAID` | Charge payer when the set amount is reached or monthly billing cycle, whichever comes first, after the goods/service is delivered. | +## Example + +```ruby +venmo_payment_token_usage_pattern = VenmoPaymentTokenUsagePattern::THRESHOLD_PREPAID +``` + diff --git a/doc/models/venmo-payment-token-usage-type.md b/doc/models/venmo-payment-token-usage-type.md index 3c080b4..6e34044 100644 --- a/doc/models/venmo-payment-token-usage-type.md +++ b/doc/models/venmo-payment-token-usage-type.md @@ -14,3 +14,9 @@ The usage type associated with the Venmo payment token. | `MERCHANT` | The Venmo Payment Token will be used for future transaction directly with a merchant. | | `PLATFORM` | The Venmo Payment Token will be used for future transaction on a platform. A platform is typically a marketplace or a channel that a payer can purchase goods and services from multiple merchants. | +## Example + +```ruby +venmo_payment_token_usage_type = VenmoPaymentTokenUsageType::MERCHANT +``` + diff --git a/doc/models/venmo-payment-token.md b/doc/models/venmo-payment-token.md index a438ae4..29f68b7 100644 --- a/doc/models/venmo-payment-token.md +++ b/doc/models/venmo-payment-token.md @@ -24,33 +24,33 @@ Full representation of a Venmo Payment Token. | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `user_name` | `String` | Optional | The Venmo username, as chosen by the user.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50`, *Pattern*: `^[-a-zA-Z0-9_]*$` | -## Example (as JSON) - -```json -{ - "permit_multiple_payment_tokens": false, - "description": "description4", - "usage_pattern": "INSTALLMENT_PREPAID", - "shipping": { - "name": { - "full_name": "full_name6" - }, - "email_address": "email_address2", - "phone_number": { - "country_code": "country_code2", - "national_number": "national_number6" - }, - "type": "SHIPPING", - "address": { - "address_line_1": "address_line_16", - "address_line_2": "address_line_26", - "admin_area_2": "admin_area_20", - "admin_area_1": "admin_area_12", - "postal_code": "postal_code8", - "country_code": "country_code6" - } - }, - "usage_type": "MERCHANT" -} +## Example + +```ruby +venmo_payment_token = VenmoPaymentToken.new( + description: 'description2', + usage_pattern: UsagePattern::UNSCHEDULED_PREPAID, + shipping: VaultedDigitalWalletShippingDetails.new( + name: ShippingName.new( + full_name: 'full_name6' + ), + email_address: 'email_address2', + phone_number: PhoneNumberWithCountryCode.new( + country_code: 'country_code2', + national_number: 'national_number6' + ), + type: FulfillmentType::SHIPPING, + address: Address.new( + country_code: 'country_code6', + address_line_1: 'address_line_16', + address_line_2: 'address_line_26', + admin_area_2: 'admin_area_20', + admin_area_1: 'admin_area_12', + postal_code: 'postal_code8' + ) + ), + permit_multiple_payment_tokens: false, + usage_type: PaypalPaymentTokenUsageType::MERCHANT +) ``` diff --git a/doc/models/venmo-vault-response-status.md b/doc/models/venmo-vault-response-status.md index e5371c0..0108dbd 100644 --- a/doc/models/venmo-vault-response-status.md +++ b/doc/models/venmo-vault-response-status.md @@ -15,3 +15,9 @@ The vault status. | `CREATED` | DEPRECATED. The payment source has been saved in your customer's vault. This status applies to deprecated integration patterns and will not be returned for v3/vault integrations. | | `APPROVED` | Customer has approved the action of saving the specified payment_source into their vault. Use v3/vault/payment-tokens with given setup_token to save the payment source in the vault | +## Example + +```ruby +venmo_vault_response_status = VenmoVaultResponseStatus::VAULTED +``` + diff --git a/doc/models/venmo-vault-response.md b/doc/models/venmo-vault-response.md index e418d4c..5bc7b74 100644 --- a/doc/models/venmo-vault-response.md +++ b/doc/models/venmo-vault-response.md @@ -16,43 +16,26 @@ The details about a saved venmo payment source. | `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional, Read-only | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`CustomerInformation`](../../doc/models/customer-information.md) | Optional | This object represents a merchant’s customer, allowing them to store contact details, and track all payments associated with the same customer. | -## Example (as JSON) - -```json -{ - "id": "id2", - "status": "CREATED", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - }, - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - } -} +## Example + +```ruby +venmo_vault_response = VenmoVaultResponse.new( + id: 'id6', + status: VenmoVaultResponseStatus::APPROVED, + customer: CustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ) +) ``` diff --git a/doc/models/venmo-wallet-additional-attributes.md b/doc/models/venmo-wallet-additional-attributes.md index 8d4d8f1..1acdcd6 100644 --- a/doc/models/venmo-wallet-additional-attributes.md +++ b/doc/models/venmo-wallet-additional-attributes.md @@ -14,32 +14,32 @@ Additional attributes associated with the use of this Venmo Wallet. | `customer` | [`VenmoWalletCustomerInformation`](../../doc/models/venmo-wallet-customer-information.md) | Optional | The details about a customer in PayPal's system of record. | | `vault` | [`VenmoWalletVaultAttributes`](../../doc/models/venmo-wallet-vault-attributes.md) | Optional | Resource consolidating common request and response attirbutes for vaulting Venmo Wallet. | -## Example (as JSON) - -```json -{ - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "vault": { - "store_in_vault": "ON_SUCCESS", - "description": "description6", - "usage_pattern": "THRESHOLD_PREPAID", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false - } -} +## Example + +```ruby +venmo_wallet_additional_attributes = VenmoWalletAdditionalAttributes.new( + customer: VenmoWalletCustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ), + vault: VenmoWalletVaultAttributes.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS, + usage_type: VenmoPaymentTokenUsageType::MERCHANT, + description: 'description6', + usage_pattern: VenmoPaymentTokenUsagePattern::THRESHOLD_PREPAID, + customer_type: VenmoPaymentTokenCustomerType::CONSUMER, + permit_multiple_payment_tokens: false + ) +) ``` diff --git a/doc/models/venmo-wallet-attributes-response.md b/doc/models/venmo-wallet-attributes-response.md index 17faf29..7e01710 100644 --- a/doc/models/venmo-wallet-attributes-response.md +++ b/doc/models/venmo-wallet-attributes-response.md @@ -13,35 +13,28 @@ Additional attributes associated with the use of a Venmo Wallet. | --- | --- | --- | --- | | `vault` | [`VenmoVaultResponse`](../../doc/models/venmo-vault-response.md) | Optional | The details about a saved venmo payment source. | -## Example (as JSON) - -```json -{ - "vault": { - "id": "id6", - "status": "APPROVED", - "links": [ - { - "href": "href6", - "rel": "rel0", - "method": "HEAD" - } - ], - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - } - } -} +## Example + +```ruby +venmo_wallet_attributes_response = VenmoWalletAttributesResponse.new( + vault: VenmoVaultResponse.new( + id: 'id6', + status: VenmoVaultResponseStatus::APPROVED, + customer: CustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ) + ) +) ``` diff --git a/doc/models/venmo-wallet-customer-information.md b/doc/models/venmo-wallet-customer-information.md index 9fbf0b0..7c07314 100644 --- a/doc/models/venmo-wallet-customer-information.md +++ b/doc/models/venmo-wallet-customer-information.md @@ -16,22 +16,22 @@ The details about a customer in PayPal's system of record. | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | -## Example (as JSON) - -```json -{ - "id": "id4", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } -} +## Example + +```ruby +venmo_wallet_customer_information = VenmoWalletCustomerInformation.new( + id: 'id4', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) +) ``` diff --git a/doc/models/venmo-wallet-experience-context-shipping-preference.md b/doc/models/venmo-wallet-experience-context-shipping-preference.md index f1c53d2..9c3db4c 100644 --- a/doc/models/venmo-wallet-experience-context-shipping-preference.md +++ b/doc/models/venmo-wallet-experience-context-shipping-preference.md @@ -15,3 +15,9 @@ The location from which the shipping address is derived. | `NO_SHIPPING` | Redacts the shipping address from the PayPal site. Recommended for digital goods. | | `SET_PROVIDED_ADDRESS` | Get the merchant-provided address. The customer cannot change this address on the PayPal site. If merchant does not pass an address, customer can choose the address on PayPal pages. | +## Example + +```ruby +venmo_wallet_experience_context_shipping_preference = VenmoWalletExperienceContextShippingPreference::SET_PROVIDED_ADDRESS +``` + diff --git a/doc/models/venmo-wallet-experience-context-user-action.md b/doc/models/venmo-wallet-experience-context-user-action.md index 7f111b4..54ee162 100644 --- a/doc/models/venmo-wallet-experience-context-user-action.md +++ b/doc/models/venmo-wallet-experience-context-user-action.md @@ -14,3 +14,9 @@ Configures a Continue or Pay Now checkout flow. | `CONTINUE` | After you redirect the customer to the Venmo payment page, a Continue button appears. Use this option when the final amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant page without processing the payment. | | `PAY_NOW` | After you redirect the customer to the Venmo payment page, a Pay Now button appears. Use this option when the final amount is known when the checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. | +## Example + +```ruby +venmo_wallet_experience_context_user_action = VenmoWalletExperienceContextUserAction::CONTINUE +``` + diff --git a/doc/models/venmo-wallet-experience-context.md b/doc/models/venmo-wallet-experience-context.md index 2c68cb3..e195cef 100644 --- a/doc/models/venmo-wallet-experience-context.md +++ b/doc/models/venmo-wallet-experience-context.md @@ -16,21 +16,21 @@ Customizes the buyer experience during the approval process for payment with Ven | `order_update_callback_config` | [`CallbackConfiguration`](../../doc/models/callback-configuration.md) | Optional | CallBack Configuration that the merchant can provide to PayPal/Venmo. | | `user_action` | [`VenmoWalletExperienceContextUserAction`](../../doc/models/venmo-wallet-experience-context-user-action.md) | Optional | Configures a Continue or Pay Now checkout flow.

**Default**: `VenmoWalletExperienceContextUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "user_action": "CONTINUE", - "brand_name": "brand_name6", - "order_update_callback_config": { - "callback_events": [ - "SHIPPING_OPTIONS", - "SHIPPING_ADDRESS", - "SHIPPING_OPTIONS" +## Example + +```ruby +venmo_wallet_experience_context = VenmoWalletExperienceContext.new( + brand_name: 'brand_name2', + shipping_preference: VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE, + order_update_callback_config: CallbackConfiguration.new( + callback_events: [ + CallbackEvents::SHIPPING_OPTIONS, + CallbackEvents::SHIPPING_ADDRESS, + CallbackEvents::SHIPPING_OPTIONS ], - "callback_url": "callback_url6" - } -} + callback_url: 'callback_url6' + ), + user_action: VenmoWalletExperienceContextUserAction::CONTINUE +) ``` diff --git a/doc/models/venmo-wallet-request.md b/doc/models/venmo-wallet-request.md index de24bca..12cdc4f 100644 --- a/doc/models/venmo-wallet-request.md +++ b/doc/models/venmo-wallet-request.md @@ -16,49 +16,49 @@ Information needed to pay using Venmo. | `experience_context` | [`VenmoWalletExperienceContext`](../../doc/models/venmo-wallet-experience-context.md) | Optional | Customizes the buyer experience during the approval process for payment with Venmo. Note: Partners and Marketplaces might configure shipping_preference during partner account setup, which overrides the request values. | | `attributes` | [`VenmoWalletAdditionalAttributes`](../../doc/models/venmo-wallet-additional-attributes.md) | Optional | Additional attributes associated with the use of this Venmo Wallet. | -## Example (as JSON) +## Example -```json -{ - "vault_id": "vault_id2", - "email_address": "email_address2", - "experience_context": { - "brand_name": "brand_name2", - "shipping_preference": "NO_SHIPPING", - "order_update_callback_config": { - "callback_events": [ - "SHIPPING_OPTIONS", - "SHIPPING_ADDRESS", - "SHIPPING_OPTIONS" +```ruby +venmo_wallet_request = VenmoWalletRequest.new( + vault_id: 'vault_id6', + email_address: 'email_address6', + experience_context: VenmoWalletExperienceContext.new( + brand_name: 'brand_name2', + shipping_preference: VenmoWalletExperienceContextShippingPreference::NO_SHIPPING, + order_update_callback_config: CallbackConfiguration.new( + callback_events: [ + CallbackEvents::SHIPPING_OPTIONS, + CallbackEvents::SHIPPING_ADDRESS, + CallbackEvents::SHIPPING_OPTIONS ], - "callback_url": "callback_url6" - }, - "user_action": "CONTINUE" - }, - "attributes": { - "customer": { - "id": "id0", - "email_address": "email_address2", - "phone": { - "phone_type": "OTHER", - "phone_number": { - "national_number": "national_number6" - } - }, - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, - "vault": { - "store_in_vault": "ON_SUCCESS", - "description": "description6", - "usage_pattern": "THRESHOLD_PREPAID", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false - } - } -} + callback_url: 'callback_url6' + ), + user_action: VenmoWalletExperienceContextUserAction::CONTINUE + ), + attributes: VenmoWalletAdditionalAttributes.new( + customer: VenmoWalletCustomerInformation.new( + id: 'id0', + email_address: 'email_address2', + phone: PhoneWithType.new( + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + phone_type: PhoneType::OTHER + ), + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ) + ), + vault: VenmoWalletVaultAttributes.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS, + usage_type: VenmoPaymentTokenUsageType::MERCHANT, + description: 'description6', + usage_pattern: VenmoPaymentTokenUsagePattern::THRESHOLD_PREPAID, + customer_type: VenmoPaymentTokenCustomerType::CONSUMER, + permit_multiple_payment_tokens: false + ) + ) +) ``` diff --git a/doc/models/venmo-wallet-response.md b/doc/models/venmo-wallet-response.md index 8efbaea..d3a8cd3 100644 --- a/doc/models/venmo-wallet-response.md +++ b/doc/models/venmo-wallet-response.md @@ -20,21 +20,21 @@ Venmo wallet response. | `return_flow` | [`ReturnFlow`](../../doc/models/return-flow.md) | Optional, Read-only | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App.

**Default**: `ReturnFlow::AUTO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | | `attributes` | [`VenmoWalletAttributesResponse`](../../doc/models/venmo-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a Venmo Wallet. | -## Example (as JSON) - -```json -{ - "return_flow": "AUTO", - "email_address": "email_address6", - "account_id": "account_id8", - "user_name": "user_name2", - "name": { - "given_name": "given_name2", - "surname": "surname8" - }, - "phone_number": { - "national_number": "national_number6" - } -} +## Example + +```ruby +venmo_wallet_response = VenmoWalletResponse.new( + email_address: 'email_address4', + account_id: 'account_id8', + user_name: 'user_name2', + name: Name.new( + given_name: 'given_name2', + surname: 'surname8' + ), + phone_number: PhoneNumber.new( + national_number: 'national_number6' + ), + return_flow: ReturnFlow::AUTO +) ``` diff --git a/doc/models/venmo-wallet-vault-attributes.md b/doc/models/venmo-wallet-vault-attributes.md index d2caf73..6c3f397 100644 --- a/doc/models/venmo-wallet-vault-attributes.md +++ b/doc/models/venmo-wallet-vault-attributes.md @@ -18,16 +18,16 @@ Resource consolidating common request and response attirbutes for vaulting Venmo | `customer_type` | [`VenmoPaymentTokenCustomerType`](../../doc/models/venmo-payment-token-customer-type.md) | Optional | The customer type associated with the Venmo payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Default**: `VenmoPaymentTokenCustomerType::CONSUMER`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `permit_multiple_payment_tokens` | `TrueClass \| FalseClass` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same Venmo account.

**Default**: `false` | -## Example (as JSON) - -```json -{ - "store_in_vault": "ON_SUCCESS", - "usage_type": "MERCHANT", - "customer_type": "CONSUMER", - "permit_multiple_payment_tokens": false, - "description": "description6", - "usage_pattern": "RECURRING_PREPAID" -} +## Example + +```ruby +venmo_wallet_vault_attributes = VenmoWalletVaultAttributes.new( + store_in_vault: StoreInVaultInstruction::ON_SUCCESS, + usage_type: VenmoPaymentTokenUsageType::MERCHANT, + description: 'description2', + usage_pattern: VenmoPaymentTokenUsagePattern::THRESHOLD_PREPAID, + customer_type: VenmoPaymentTokenCustomerType::CONSUMER, + permit_multiple_payment_tokens: false +) ``` diff --git a/lib/paypal_server_sdk.rb b/lib/paypal_server_sdk.rb index e525c7c..c2a3b41 100644 --- a/lib/paypal_server_sdk.rb +++ b/lib/paypal_server_sdk.rb @@ -177,6 +177,7 @@ require_relative 'paypal_server_sdk/models/venmo_wallet_response' require_relative 'paypal_server_sdk/models/payer_base' require_relative 'paypal_server_sdk/models/paypal_wallet_vault_base' +require_relative 'paypal_server_sdk/models/cycle_frequency' 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' @@ -352,6 +353,7 @@ require_relative 'paypal_server_sdk/models/' \ 'experience_context_shipping_preference' require_relative 'paypal_server_sdk/models/experience_status' +require_relative 'paypal_server_sdk/models/frequency_interval_unit' 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' @@ -415,6 +417,7 @@ require_relative 'paypal_server_sdk/models/setup_fee_failure_action' require_relative 'paypal_server_sdk/models/subscription_plan_status' require_relative 'paypal_server_sdk/models/subscription_pricing_model' +require_relative 'paypal_server_sdk/models/subscription_status' 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 3b4d23e..2677bd4 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: 2.3.0, on OS {os-info}' + 'PayPal REST API Ruby SDK, Version: 2.4.0, on OS {os-info}' end def self.user_agent_parameters diff --git a/lib/paypal_server_sdk/models/billing_cycle.rb b/lib/paypal_server_sdk/models/billing_cycle.rb index 695a716..e5c80d8 100644 --- a/lib/paypal_server_sdk/models/billing_cycle.rb +++ b/lib/paypal_server_sdk/models/billing_cycle.rb @@ -46,6 +46,10 @@ class BillingCycle < BaseModel # @return [String] attr_accessor :start_date + # The frequency of the terms reset cycle. + # @return [CycleFrequency] + attr_accessor :frequency + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -54,6 +58,7 @@ def self.names @_hash['total_cycles'] = 'total_cycles' @_hash['sequence'] = 'sequence' @_hash['start_date'] = 'start_date' + @_hash['frequency'] = 'frequency' @_hash end @@ -64,6 +69,7 @@ def self.optionals total_cycles sequence start_date + frequency ] end @@ -73,12 +79,13 @@ def self.nullables end def initialize(tenure_type:, pricing_scheme: SKIP, total_cycles: 1, - sequence: 1, start_date: SKIP) + sequence: 1, start_date: SKIP, frequency: SKIP) @tenure_type = tenure_type @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP @total_cycles = total_cycles unless total_cycles == SKIP @sequence = sequence unless sequence == SKIP @start_date = start_date unless start_date == SKIP + @frequency = frequency unless frequency == SKIP end # Creates an instance of the object from a hash. @@ -91,20 +98,23 @@ def self.from_hash(hash) total_cycles = hash['total_cycles'] ||= 1 sequence = hash['sequence'] ||= 1 start_date = hash.key?('start_date') ? hash['start_date'] : SKIP + frequency = CycleFrequency.from_hash(hash['frequency']) if hash['frequency'] # Create object from extracted values. BillingCycle.new(tenure_type: tenure_type, pricing_scheme: pricing_scheme, total_cycles: total_cycles, sequence: sequence, - start_date: start_date) + start_date: start_date, + frequency: frequency) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last "<#{class_name} tenure_type: #{@tenure_type}, pricing_scheme: #{@pricing_scheme},"\ - " total_cycles: #{@total_cycles}, sequence: #{@sequence}, start_date: #{@start_date}>" + " total_cycles: #{@total_cycles}, sequence: #{@sequence}, start_date: #{@start_date},"\ + " frequency: #{@frequency}>" end # Provides a debugging-friendly string with detailed object information. @@ -112,7 +122,8 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} tenure_type: #{@tenure_type.inspect}, pricing_scheme:"\ " #{@pricing_scheme.inspect}, total_cycles: #{@total_cycles.inspect}, sequence:"\ - " #{@sequence.inspect}, start_date: #{@start_date.inspect}>" + " #{@sequence.inspect}, start_date: #{@start_date.inspect}, frequency:"\ + " #{@frequency.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/cycle_frequency.rb b/lib/paypal_server_sdk/models/cycle_frequency.rb new file mode 100644 index 0000000..64f49ed --- /dev/null +++ b/lib/paypal_server_sdk/models/cycle_frequency.rb @@ -0,0 +1,72 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The frequency of the terms reset cycle. + class CycleFrequency < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The interval unit at which the the usage limits will be reset. + # @return [FrequencyIntervalUnit] + attr_accessor :interval_unit + + # The interval count at which the terms will be reset, this is ignored if + # the unit is LIFETIME. + # @return [Integer] + attr_accessor :interval_count + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['interval_unit'] = 'interval_unit' + @_hash['interval_count'] = 'interval_count' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + interval_count + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(interval_unit:, interval_count: 1) + @interval_unit = interval_unit + @interval_count = interval_count unless interval_count == 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. + interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : nil + interval_count = hash['interval_count'] ||= 1 + + # Create object from extracted values. + CycleFrequency.new(interval_unit: interval_unit, + interval_count: interval_count) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} interval_unit: #{@interval_unit}, interval_count: #{@interval_count}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} interval_unit: #{@interval_unit.inspect}, interval_count:"\ + " #{@interval_count.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/frequency_interval_unit.rb b/lib/paypal_server_sdk/models/frequency_interval_unit.rb new file mode 100644 index 0000000..4299f50 --- /dev/null +++ b/lib/paypal_server_sdk/models/frequency_interval_unit.rb @@ -0,0 +1,48 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The interval unit at which the the usage limits will be reset. + class FrequencyIntervalUnit + FREQUENCY_INTERVAL_UNIT = [ + # A daily cycle. + DAY = 'DAY'.freeze, + + # A weekly cycle. + WEEK = 'WEEK'.freeze, + + # A monthly cycle. + MONTH = 'MONTH'.freeze, + + # A yearly cycle. + YEAR = 'YEAR'.freeze, + + # The lifetime of the BA translates to 1 cycle + LIFETIME = 'LIFETIME'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + + def self.from_value(value, default_value = DAY) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'day' then DAY + when 'week' then WEEK + when 'month' then MONTH + when 'year' then YEAR + when 'lifetime' then LIFETIME + else + default_value + end + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription.rb b/lib/paypal_server_sdk/models/subscription.rb index 4548af9..5334ee0 100644 --- a/lib/paypal_server_sdk/models/subscription.rb +++ b/lib/paypal_server_sdk/models/subscription.rb @@ -73,6 +73,21 @@ class Subscription < BaseModel # @return [Array[LinkDescription]] attr_accessor :links + # The status of the subscription. + # @return [SubscriptionStatus] + attr_accessor :status + + # The reason or notes for the status of the subscription. + # @return [String] + attr_accessor :status_change_note + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :status_update_time + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -89,6 +104,9 @@ def self.names @_hash['plan_overridden'] = 'plan_overridden' @_hash['plan'] = 'plan' @_hash['links'] = 'links' + @_hash['status'] = 'status' + @_hash['status_change_note'] = 'status_change_note' + @_hash['status_update_time'] = 'status_update_time' @_hash end @@ -108,6 +126,9 @@ def self.optionals plan_overridden plan links + status + status_change_note + status_update_time ] end @@ -119,7 +140,8 @@ def self.nullables def initialize(id: SKIP, plan_id: SKIP, start_time: SKIP, quantity: SKIP, shipping_amount: SKIP, subscriber: SKIP, billing_info: SKIP, create_time: SKIP, update_time: SKIP, custom_id: SKIP, - plan_overridden: SKIP, plan: SKIP, links: SKIP) + plan_overridden: SKIP, plan: SKIP, links: SKIP, status: SKIP, + status_change_note: SKIP, status_update_time: SKIP) @id = id unless id == SKIP @plan_id = plan_id unless plan_id == SKIP @start_time = start_time unless start_time == SKIP @@ -133,6 +155,9 @@ def initialize(id: SKIP, plan_id: SKIP, start_time: SKIP, quantity: SKIP, @plan_overridden = plan_overridden unless plan_overridden == SKIP @plan = plan unless plan == SKIP @links = links unless links == SKIP + @status = status unless status == SKIP + @status_change_note = status_change_note unless status_change_note == SKIP + @status_update_time = status_update_time unless status_update_time == SKIP end # Creates an instance of the object from a hash. @@ -164,6 +189,11 @@ def self.from_hash(hash) end links = SKIP unless hash.key?('links') + status = hash.key?('status') ? hash['status'] : SKIP + status_change_note = + hash.key?('status_change_note') ? hash['status_change_note'] : SKIP + status_update_time = + hash.key?('status_update_time') ? hash['status_update_time'] : SKIP # Create object from extracted values. Subscription.new(id: id, @@ -178,7 +208,10 @@ def self.from_hash(hash) custom_id: custom_id, plan_overridden: plan_overridden, plan: plan, - links: links) + links: links, + status: status, + status_change_note: status_change_note, + status_update_time: status_update_time) end # Provides a human-readable string representation of the object. @@ -188,7 +221,8 @@ def to_s " #{@quantity}, shipping_amount: #{@shipping_amount}, subscriber: #{@subscriber},"\ " billing_info: #{@billing_info}, create_time: #{@create_time}, update_time:"\ " #{@update_time}, custom_id: #{@custom_id}, plan_overridden: #{@plan_overridden}, plan:"\ - " #{@plan}, links: #{@links}>" + " #{@plan}, links: #{@links}, status: #{@status}, status_change_note:"\ + " #{@status_change_note}, status_update_time: #{@status_update_time}>" end # Provides a debugging-friendly string with detailed object information. @@ -199,7 +233,9 @@ def inspect " #{@shipping_amount.inspect}, subscriber: #{@subscriber.inspect}, billing_info:"\ " #{@billing_info.inspect}, create_time: #{@create_time.inspect}, update_time:"\ " #{@update_time.inspect}, custom_id: #{@custom_id.inspect}, plan_overridden:"\ - " #{@plan_overridden.inspect}, plan: #{@plan.inspect}, links: #{@links.inspect}>" + " #{@plan_overridden.inspect}, plan: #{@plan.inspect}, links: #{@links.inspect}, status:"\ + " #{@status.inspect}, status_change_note: #{@status_change_note.inspect},"\ + " status_update_time: #{@status_update_time.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/subscription_status.rb b/lib/paypal_server_sdk/models/subscription_status.rb new file mode 100644 index 0000000..5b50adc --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_status.rb @@ -0,0 +1,52 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The status of the subscription. + class SubscriptionStatus + SUBSCRIPTION_STATUS = [ + # The subscription is created but not yet approved by the buyer. + APPROVAL_PENDING = 'APPROVAL_PENDING'.freeze, + + # The buyer has approved the subscription. + APPROVED = 'APPROVED'.freeze, + + # The subscription is active. + ACTIVE = 'ACTIVE'.freeze, + + # The subscription is suspended. + SUSPENDED = 'SUSPENDED'.freeze, + + # The subscription is cancelled. + CANCELLED = 'CANCELLED'.freeze, + + # The subscription is expired. + EXPIRED = 'EXPIRED'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + + def self.from_value(value, default_value = APPROVAL_PENDING) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'approval_pending' then APPROVAL_PENDING + when 'approved' then APPROVED + when 'active' then ACTIVE + when 'suspended' then SUSPENDED + when 'cancelled' then CANCELLED + when 'expired' then EXPIRED + else + default_value + end + end + end +end diff --git a/paypal_server_sdk.gemspec b/paypal_server_sdk.gemspec index 0a45b80..144c062 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 = '2.3.0' + s.version = '2.4.0' s.summary = 'PayPal\'s SDK for interacting with the REST APIs' s.description = '' s.authors = ['PayPal']