Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Metrics/PerceivedComplexity:

Layout/EndOfLine:
Enabled: false

Layout/EmptyLines:
Enabled: false

Lint/UnderscorePrefixedVariableName:
Enabled: false

Expand Down
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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. <br> **Default: `Environment.SANDBOX`** |
| environment | [`Environment`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.4.0/README.md#environments) | The API environment. <br> **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. <br> **Default: 60** |
Expand All @@ -86,9 +86,9 @@ The following parameters are configurable for the API Client:
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **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:

Expand Down Expand Up @@ -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

Expand All @@ -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)

10 changes: 5 additions & 5 deletions doc/models/activate-subscription-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ The activate subscription request details.
| --- | --- | --- | --- |
| `reason` | `String` | Optional | The reason for activation of a subscription. Required to reactivate the subscription.<br><br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` |

## Example (as JSON)
## Example

```json
{
"reason": "reason4"
}
```ruby
activate_subscription_request = ActivateSubscriptionRequest.new(
reason: 'reason4'
)
```

12 changes: 6 additions & 6 deletions doc/models/activity-timestamps.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br><br>**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` |
| `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.<br><br>**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` |

## 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'
)
```

22 changes: 11 additions & 11 deletions doc/models/address.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).<br><br>**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.<br><br>**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'
)
```

50 changes: 25 additions & 25 deletions doc/models/amount-breakdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
)
```

58 changes: 29 additions & 29 deletions doc/models/amount-with-breakdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).<br><br>**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'
)
)
)
```

22 changes: 9 additions & 13 deletions doc/models/app-switch-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
)
```

39 changes: 16 additions & 23 deletions doc/models/apple-pay-attributes-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
)
)
)
```

Loading
Loading