paypal-server-sdk 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -36
  3. data/lib/paypal_server_sdk/controllers/base_controller.rb +1 -1
  4. data/lib/paypal_server_sdk/controllers/orders_controller.rb +211 -171
  5. data/lib/paypal_server_sdk/controllers/payments_controller.rb +95 -92
  6. data/lib/paypal_server_sdk/controllers/vault_controller.rb +81 -81
  7. data/lib/paypal_server_sdk/exceptions/error_exception.rb +5 -3
  8. data/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb +5 -3
  9. data/lib/paypal_server_sdk/models/apple_pay_attributes.rb +2 -1
  10. data/lib/paypal_server_sdk/models/apple_pay_experience_context.rb +68 -0
  11. data/lib/paypal_server_sdk/models/apple_pay_request.rb +18 -4
  12. data/lib/paypal_server_sdk/models/callback_configuration.rb +1 -2
  13. data/lib/paypal_server_sdk/models/card_brand.rb +1 -1
  14. data/lib/paypal_server_sdk/models/card_customer_information.rb +14 -4
  15. data/lib/paypal_server_sdk/models/customer_information.rb +16 -5
  16. data/lib/paypal_server_sdk/models/customer_response.rb +1 -2
  17. data/lib/paypal_server_sdk/models/google_pay_experience_context.rb +68 -0
  18. data/lib/paypal_server_sdk/models/google_pay_request.rb +17 -4
  19. data/lib/paypal_server_sdk/models/item.rb +14 -4
  20. data/lib/paypal_server_sdk/models/line_item.rb +22 -11
  21. data/lib/paypal_server_sdk/models/order_billing_plan.rb +93 -0
  22. data/lib/paypal_server_sdk/models/order_status.rb +5 -5
  23. data/lib/paypal_server_sdk/models/payment_token_response.rb +1 -2
  24. data/lib/paypal_server_sdk/models/paypal_wallet_contact_preference.rb +34 -0
  25. data/lib/paypal_server_sdk/models/paypal_wallet_customer.rb +14 -4
  26. data/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb +14 -4
  27. data/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb +20 -6
  28. data/lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb +24 -5
  29. data/lib/paypal_server_sdk/models/vault_customer.rb +15 -5
  30. data/lib/paypal_server_sdk/models/vault_response.rb +2 -1
  31. data/lib/paypal_server_sdk/models/vault_response_customer.rb +1 -1
  32. data/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb +24 -4
  33. data/lib/paypal_server_sdk.rb +149 -145
  34. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57ccf4a802a623251769dc25b3947371457e03c91cf3f40a1644b7073972a09b
4
- data.tar.gz: 6f7fa9685e2e524b81e3479b29b3a9c732a13e47d90ccb041d930051d505bf62
3
+ metadata.gz: a6efdfdb5c0d12d4903e4c09dc6a0b033b574e4ace39f00c1d867314ac006783
4
+ data.tar.gz: d0d73b90afe15c9bb77a687a8a9a0233da6e5365f05fbd39f1b1039bd4af9dc0
5
5
  SHA512:
6
- metadata.gz: e0b73e8c5b558d9ee4d156a56d2c7aa5bb0ad19f0c56c621d9dbe64bacabfa214f3b55508d86b9db2dc554de7d7aacb717d1edc7f284414513f9ae3b3894e24d
7
- data.tar.gz: 67f44b93ff99d35c3e6d86776b083dac1060cff1d56216d46e9f49f9a88caf8b2eebe433c414e1e6aa8184217dd914479b4c8e648c10501667eb5495bbb7d6c3
6
+ metadata.gz: b8564b3b7cc18e06c95424b33fe51319e469f70b61ccc96812e7952bddab1e1013aedefc282ce98b16d790e0996d4029263b54ee366a899872373f959097c317
7
+ data.tar.gz: 3c2d90a8a331ced3469cdd1d49a8d5fe77e657875ee92d56b7b691299bc57fb02528e9f0041b2305e7d49ae6e7fa2bef858885394a95dc2720371b86c91abb59
data/README.md CHANGED
@@ -5,55 +5,52 @@
5
5
 
6
6
  ### Important Notes
7
7
 
8
- - **Available Features:** This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
9
- - **API Changes:** Expect potential changes in APIs and features as we finalize the product.
8
+ - **Available Features:** This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
10
9
 
11
10
  ### Information
12
11
 
13
12
  The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers:
14
13
 
15
- - Orders Controller: <a href="https://developer.paypal.com/docs/api/orders/v2/">Orders API v2</a>
16
- - Payments Controller: <a href="https://developer.paypal.com/docs/api/payments/v2/">Payments API v2</a>
17
- - Vault Controller: <a href="https://developer.paypal.com/docs/api/payment-tokens/v3/">Payment Method Tokens API v3</a> *Available in the US only.*
18
-
19
- Find out more here: [https://developer.paypal.com/docs/api/orders/v2/](https://developer.paypal.com/docs/api/orders/v2/)
14
+ - Orders Controller: [Orders API v2](https://developer.paypal.com/docs/api/orders/v2/)
15
+ - Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2
16
+ - Vault Controller: [Payment Method Tokens API v3](https://developer.paypal.com/docs/api/payment-tokens/v3/) *Available in the US only.*
20
17
 
21
18
  ## Install the Package
22
19
 
23
20
  Install the gem from the command line:
24
21
 
25
22
  ```bash
26
- gem install paypal-server-sdk -v 1.0.0
23
+ gem install paypal-server-sdk -v 1.1.0
27
24
  ```
28
25
 
29
26
  Or add the gem to your Gemfile and run `bundle`:
30
27
 
31
28
  ```ruby
32
- gem 'paypal-server-sdk', '1.0.0'
29
+ gem 'paypal-server-sdk', '1.1.0'
33
30
  ```
34
31
 
35
- For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/1.0.0).
32
+ For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/1.1.0).
36
33
 
37
34
  ## Initialize the API Client
38
35
 
39
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/client.md)
36
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/client.md)
40
37
 
41
38
  The following parameters are configurable for the API Client:
42
39
 
43
40
  | Parameter | Type | Description |
44
41
  | --- | --- | --- |
45
- | `environment` | `Environment` | The API environment. <br> **Default: `Environment.SANDBOX`** |
46
- | `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
47
- | `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
48
- | `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 60** |
49
- | `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
50
- | `retry_interval` | `Float` | Pause in seconds between retries. <br> **Default: 1** |
51
- | `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
52
- | `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
53
- | `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
54
- | `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
55
- | `logging_configuration` | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/logging-configuration.md) | The SDK logging configuration for API calls |
56
- | `client_credentials_auth_credentials` | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
42
+ | environment | `Environment` | The API environment. <br> **Default: `Environment.SANDBOX`** |
43
+ | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
44
+ | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
45
+ | timeout | `Float` | The value to use for connection timeout. <br> **Default: 60** |
46
+ | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
47
+ | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
48
+ | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
49
+ | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
50
+ | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
51
+ | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
52
+ | logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/logging-configuration.md) | The SDK logging configuration for API calls |
53
+ | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
57
54
 
58
55
  The API client can be initialized as follows:
59
56
 
@@ -91,22 +88,31 @@ The SDK can be configured to use a different environment for making API calls. A
91
88
 
92
89
  This API uses the following authentication schemes.
93
90
 
94
- * [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/auth/oauth-2-client-credentials-grant.md)
91
+ * [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md)
95
92
 
96
93
  ## List of APIs
97
94
 
98
- * [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/controllers/orders.md)
99
- * [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/controllers/payments.md)
100
- * [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/controllers/vault.md)
95
+ * [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/controllers/orders.md)
96
+ * [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/controllers/payments.md)
97
+ * [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/controllers/vault.md)
101
98
 
102
- ## Classes Documentation
99
+ ## SDK Infrastructure
103
100
 
104
- * [Utility Classes](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/utility-classes.md)
105
- * [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/http-response.md)
106
- * [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/http-request.md)
107
- * [ApiResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/api-response.md)
108
- * [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/logging-configuration.md)
109
- * [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/request-logging-configuration.md)
110
- * [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/response-logging-configuration.md)
111
- * [Abstract Logger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.0.0/doc/abstract-logger.md)
101
+ ### Configuration
102
+
103
+ * [AbstractLogger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/abstract-logger.md)
104
+ * [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/logging-configuration.md)
105
+ * [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/request-logging-configuration.md)
106
+ * [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/response-logging-configuration.md)
107
+
108
+ ### HTTP
109
+
110
+ * [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/http-response.md)
111
+ * [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/http-request.md)
112
+
113
+ ### Utilities
114
+
115
+ * [ApiResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/api-response.md)
116
+ * [ApiHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/api-helper.md)
117
+ * [DateTimeHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/date-time-helper.md)
112
118
 
@@ -10,7 +10,7 @@ module PaypalServerSdk
10
10
  attr_accessor :config, :http_call_back
11
11
 
12
12
  def self.user_agent
13
- 'PayPal REST API Ruby SDK, Version: 1.0.0, on OS {os-info}'
13
+ 'PayPal REST API Ruby SDK, Version: 1.1.0, on OS {os-info}'
14
14
  end
15
15
 
16
16
  def self.user_agent_parameters