paypal-server-sdk 2.1.0 → 2.3.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -28
  3. data/lib/paypal_server_sdk/controllers/base_controller.rb +1 -1
  4. data/lib/paypal_server_sdk/controllers/transaction_search_controller.rb +4 -4
  5. data/lib/paypal_server_sdk/exceptions/error_exception.rb +1 -1
  6. data/lib/paypal_server_sdk/exceptions/subscription_error_exception.rb +1 -1
  7. data/lib/paypal_server_sdk/models/address.rb +2 -1
  8. data/lib/paypal_server_sdk/models/amount_with_breakdown.rb +3 -2
  9. data/lib/paypal_server_sdk/models/apple_pay_card_response.rb +6 -5
  10. data/lib/paypal_server_sdk/models/bancontact_payment_object.rb +6 -5
  11. data/lib/paypal_server_sdk/models/bancontact_payment_request.rb +6 -5
  12. data/lib/paypal_server_sdk/models/bin_details.rb +6 -5
  13. data/lib/paypal_server_sdk/models/blik_experience_context.rb +3 -2
  14. data/lib/paypal_server_sdk/models/blik_payment_object.rb +6 -5
  15. data/lib/paypal_server_sdk/models/blik_payment_request.rb +6 -5
  16. data/lib/paypal_server_sdk/models/card_response_address.rb +2 -1
  17. data/lib/paypal_server_sdk/models/card_response_with_billing_address.rb +2 -1
  18. data/lib/paypal_server_sdk/models/confirm_order_request.rb +16 -5
  19. data/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb +2 -1
  20. data/lib/paypal_server_sdk/models/eps_payment_object.rb +6 -5
  21. data/lib/paypal_server_sdk/models/eps_payment_request.rb +6 -5
  22. data/lib/paypal_server_sdk/models/error_details.rb +3 -3
  23. data/lib/paypal_server_sdk/models/exchange_rate.rb +4 -2
  24. data/lib/paypal_server_sdk/models/experience_context.rb +3 -2
  25. data/lib/paypal_server_sdk/models/giropay_payment_object.rb +6 -5
  26. data/lib/paypal_server_sdk/models/giropay_payment_request.rb +6 -5
  27. data/lib/paypal_server_sdk/models/ideal_payment_object.rb +6 -5
  28. data/lib/paypal_server_sdk/models/ideal_payment_request.rb +6 -5
  29. data/lib/paypal_server_sdk/models/link_description.rb +6 -1
  30. data/lib/paypal_server_sdk/models/money.rb +3 -2
  31. data/lib/paypal_server_sdk/models/mybank_payment_object.rb +6 -5
  32. data/lib/paypal_server_sdk/models/mybank_payment_request.rb +6 -5
  33. data/lib/paypal_server_sdk/models/order.rb +18 -5
  34. data/lib/paypal_server_sdk/models/order_authorize_response.rb +18 -5
  35. data/lib/paypal_server_sdk/models/order_confirm_application_context.rb +3 -2
  36. data/lib/paypal_server_sdk/models/order_request.rb +17 -5
  37. data/lib/paypal_server_sdk/models/p24_payment_object.rb +6 -5
  38. data/lib/paypal_server_sdk/models/p24_payment_request.rb +6 -5
  39. data/lib/paypal_server_sdk/models/payment_token_response.rb +2 -1
  40. data/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb +1 -2
  41. data/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb +3 -2
  42. data/lib/paypal_server_sdk/models/paypal_wallet_vault_base.rb +134 -0
  43. data/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb +20 -10
  44. data/lib/paypal_server_sdk/models/processing_instruction.rb +33 -0
  45. data/lib/paypal_server_sdk/models/search_response.rb +1 -1
  46. data/lib/paypal_server_sdk/models/sepa_debit_experience_context.rb +3 -2
  47. data/lib/paypal_server_sdk/models/setup_token_response.rb +2 -1
  48. data/lib/paypal_server_sdk/models/sofort_payment_object.rb +6 -5
  49. data/lib/paypal_server_sdk/models/sofort_payment_request.rb +6 -5
  50. data/lib/paypal_server_sdk/models/subscriber.rb +29 -6
  51. data/lib/paypal_server_sdk/models/subscriber_request.rb +40 -17
  52. data/lib/paypal_server_sdk/models/subscription_payer.rb +85 -0
  53. data/lib/paypal_server_sdk/models/trustly_payment_object.rb +6 -5
  54. data/lib/paypal_server_sdk/models/trustly_payment_request.rb +6 -5
  55. data/lib/paypal_server_sdk/models/usage_type.rb +39 -0
  56. data/lib/paypal_server_sdk/models/vault_card_experience_context.rb +3 -2
  57. data/lib/paypal_server_sdk/models/vault_experience_context.rb +3 -2
  58. data/lib/paypal_server_sdk.rb +4 -0
  59. metadata +6 -2
@@ -13,11 +13,12 @@ module PaypalServerSdk
13
13
  # @return [String]
14
14
  attr_accessor :name
15
15
 
16
- # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
- # that identifies the country or region. Note: The country code for Great
18
- # Britain is GB and not UK as used in the top-level domain names for that
19
- # country. Use the `C2` country code for China worldwide for comparable
20
- # uncontrolled price (CUP) method, bank card, and cross-border transactions.
16
+ # The [two-character ISO 3166-1
17
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) that
18
+ # identifies the country or region. Note: The country code for Great Britain
19
+ # is GB and not UK as used in the top-level domain names for that country.
20
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
21
+ # price (CUP) method, bank card, and cross-border transactions.
21
22
  # @return [String]
22
23
  attr_accessor :country_code
23
24
 
@@ -4,7 +4,12 @@
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
6
  module PaypalServerSdk
7
- # The request-related [HATEOAS link](/api/rest/responses/#hateoas-links)
7
+ # The request-related [HATEOAS
8
+ # link](https://developer.paypal.com/api/rest/responses/#hateoas-links)
9
+ # information., The request-related [HATEOAS
10
+ # link](/api/rest/responses/#hateoas-links) information., The request-related
11
+ # [HATEOAS
12
+ # link](https://developer.paypal.com/api/rest/responses/#hateoas-links)
8
13
  # information.
9
14
  class LinkDescription < BaseModel
10
15
  SKIP = Object.new
@@ -11,7 +11,8 @@ module PaypalServerSdk
11
11
  private_constant :SKIP
12
12
 
13
13
  # The [three-character ISO-4217 currency
14
- # code](/api/rest/reference/currency-codes/) that identifies the currency.
14
+ # code](https://developer.paypal.com/api/rest/reference/currency-codes/)
15
+ # that identifies the currency.
15
16
  # @return [String]
16
17
  attr_accessor :currency_code
17
18
 
@@ -19,7 +20,7 @@ module PaypalServerSdk
19
20
  # not typically fractional. A decimal fraction for currencies like `TND`
20
21
  # that are subdivided into thousandths. For the required number of decimal
21
22
  # places for a currency code, see [Currency
22
- # Codes](/api/rest/reference/currency-codes/).
23
+ # Codes](https://developer.paypal.com/api/rest/reference/currency-codes/).
23
24
  # @return [String]
24
25
  attr_accessor :value
25
26
 
@@ -13,11 +13,12 @@ module PaypalServerSdk
13
13
  # @return [String]
14
14
  attr_accessor :name
15
15
 
16
- # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
- # that identifies the country or region. Note: The country code for Great
18
- # Britain is GB and not UK as used in the top-level domain names for that
19
- # country. Use the `C2` country code for China worldwide for comparable
20
- # uncontrolled price (CUP) method, bank card, and cross-border transactions.
16
+ # The [two-character ISO 3166-1
17
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) that
18
+ # identifies the country or region. Note: The country code for Great Britain
19
+ # is GB and not UK as used in the top-level domain names for that country.
20
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
21
+ # price (CUP) method, bank card, and cross-border transactions.
21
22
  # @return [String]
22
23
  attr_accessor :country_code
23
24
 
@@ -13,11 +13,12 @@ module PaypalServerSdk
13
13
  # @return [String]
14
14
  attr_accessor :name
15
15
 
16
- # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
- # that identifies the country or region. Note: The country code for Great
18
- # Britain is GB and not UK as used in the top-level domain names for that
19
- # country. Use the `C2` country code for China worldwide for comparable
20
- # uncontrolled price (CUP) method, bank card, and cross-border transactions.
16
+ # The [two-character ISO 3166-1
17
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) that
18
+ # identifies the country or region. Note: The country code for Great Britain
19
+ # is GB and not UK as used in the top-level domain names for that country.
20
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
21
+ # price (CUP) method, bank card, and cross-border transactions.
21
22
  # @return [String]
22
23
  attr_accessor :country_code
23
24
 
@@ -36,6 +36,10 @@ module PaypalServerSdk
36
36
  # @return [CheckoutPaymentIntent]
37
37
  attr_accessor :intent
38
38
 
39
+ # The instruction to process an order.
40
+ # @return [ProcessingInstruction]
41
+ attr_accessor :processing_instruction
42
+
39
43
  # DEPRECATED. The customer is also known as the payer. The Payer object was
40
44
  # intended to only be used with the `payment_source.paypal` object. In order
41
45
  # to make this design more clear, the details in the `payer` object are now
@@ -77,6 +81,7 @@ module PaypalServerSdk
77
81
  @_hash['id'] = 'id'
78
82
  @_hash['payment_source'] = 'payment_source'
79
83
  @_hash['intent'] = 'intent'
84
+ @_hash['processing_instruction'] = 'processing_instruction'
80
85
  @_hash['payer'] = 'payer'
81
86
  @_hash['purchase_units'] = 'purchase_units'
82
87
  @_hash['status'] = 'status'
@@ -92,6 +97,7 @@ module PaypalServerSdk
92
97
  id
93
98
  payment_source
94
99
  intent
100
+ processing_instruction
95
101
  payer
96
102
  purchase_units
97
103
  status
@@ -105,13 +111,15 @@ module PaypalServerSdk
105
111
  end
106
112
 
107
113
  def initialize(create_time: SKIP, update_time: SKIP, id: SKIP,
108
- payment_source: SKIP, intent: SKIP, payer: SKIP,
114
+ payment_source: SKIP, intent: SKIP,
115
+ processing_instruction: SKIP, payer: SKIP,
109
116
  purchase_units: SKIP, status: SKIP, links: SKIP)
110
117
  @create_time = create_time unless create_time == SKIP
111
118
  @update_time = update_time unless update_time == SKIP
112
119
  @id = id unless id == SKIP
113
120
  @payment_source = payment_source unless payment_source == SKIP
114
121
  @intent = intent unless intent == SKIP
122
+ @processing_instruction = processing_instruction unless processing_instruction == SKIP
115
123
  @payer = payer unless payer == SKIP
116
124
  @purchase_units = purchase_units unless purchase_units == SKIP
117
125
  @status = status unless status == SKIP
@@ -129,6 +137,8 @@ module PaypalServerSdk
129
137
  payment_source = PaymentSourceResponse.from_hash(hash['payment_source']) if
130
138
  hash['payment_source']
131
139
  intent = hash.key?('intent') ? hash['intent'] : SKIP
140
+ processing_instruction =
141
+ hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
132
142
  payer = Payer.from_hash(hash['payer']) if hash['payer']
133
143
  # Parameter is an array, so we need to iterate through it
134
144
  purchase_units = nil
@@ -158,6 +168,7 @@ module PaypalServerSdk
158
168
  id: id,
159
169
  payment_source: payment_source,
160
170
  intent: intent,
171
+ processing_instruction: processing_instruction,
161
172
  payer: payer,
162
173
  purchase_units: purchase_units,
163
174
  status: status,
@@ -168,8 +179,9 @@ module PaypalServerSdk
168
179
  def to_s
169
180
  class_name = self.class.name.split('::').last
170
181
  "<#{class_name} create_time: #{@create_time}, update_time: #{@update_time}, id: #{@id},"\
171
- " payment_source: #{@payment_source}, intent: #{@intent}, payer: #{@payer}, purchase_units:"\
172
- " #{@purchase_units}, status: #{@status}, links: #{@links}>"
182
+ " payment_source: #{@payment_source}, intent: #{@intent}, processing_instruction:"\
183
+ " #{@processing_instruction}, payer: #{@payer}, purchase_units: #{@purchase_units}, status:"\
184
+ " #{@status}, links: #{@links}>"
173
185
  end
174
186
 
175
187
  # Provides a debugging-friendly string with detailed object information.
@@ -177,8 +189,9 @@ module PaypalServerSdk
177
189
  class_name = self.class.name.split('::').last
178
190
  "<#{class_name} create_time: #{@create_time.inspect}, update_time: #{@update_time.inspect},"\
179
191
  " id: #{@id.inspect}, payment_source: #{@payment_source.inspect}, intent:"\
180
- " #{@intent.inspect}, payer: #{@payer.inspect}, purchase_units: #{@purchase_units.inspect},"\
181
- " status: #{@status.inspect}, links: #{@links.inspect}>"
192
+ " #{@intent.inspect}, processing_instruction: #{@processing_instruction.inspect}, payer:"\
193
+ " #{@payer.inspect}, purchase_units: #{@purchase_units.inspect}, status: #{@status.inspect},"\
194
+ " links: #{@links.inspect}>"
182
195
  end
183
196
  end
184
197
  end
@@ -36,6 +36,10 @@ module PaypalServerSdk
36
36
  # @return [CheckoutPaymentIntent]
37
37
  attr_accessor :intent
38
38
 
39
+ # The instruction to process an order.
40
+ # @return [ProcessingInstruction]
41
+ attr_accessor :processing_instruction
42
+
39
43
  # The customer who approves and pays for the order. The customer is also
40
44
  # known as the payer.
41
45
  # @return [Payer]
@@ -74,6 +78,7 @@ module PaypalServerSdk
74
78
  @_hash['id'] = 'id'
75
79
  @_hash['payment_source'] = 'payment_source'
76
80
  @_hash['intent'] = 'intent'
81
+ @_hash['processing_instruction'] = 'processing_instruction'
77
82
  @_hash['payer'] = 'payer'
78
83
  @_hash['purchase_units'] = 'purchase_units'
79
84
  @_hash['status'] = 'status'
@@ -89,6 +94,7 @@ module PaypalServerSdk
89
94
  id
90
95
  payment_source
91
96
  intent
97
+ processing_instruction
92
98
  payer
93
99
  purchase_units
94
100
  status
@@ -102,13 +108,15 @@ module PaypalServerSdk
102
108
  end
103
109
 
104
110
  def initialize(create_time: SKIP, update_time: SKIP, id: SKIP,
105
- payment_source: SKIP, intent: SKIP, payer: SKIP,
111
+ payment_source: SKIP, intent: SKIP,
112
+ processing_instruction: SKIP, payer: SKIP,
106
113
  purchase_units: SKIP, status: SKIP, links: SKIP)
107
114
  @create_time = create_time unless create_time == SKIP
108
115
  @update_time = update_time unless update_time == SKIP
109
116
  @id = id unless id == SKIP
110
117
  @payment_source = payment_source unless payment_source == SKIP
111
118
  @intent = intent unless intent == SKIP
119
+ @processing_instruction = processing_instruction unless processing_instruction == SKIP
112
120
  @payer = payer unless payer == SKIP
113
121
  @purchase_units = purchase_units unless purchase_units == SKIP
114
122
  @status = status unless status == SKIP
@@ -126,6 +134,8 @@ module PaypalServerSdk
126
134
  payment_source = OrderAuthorizeResponsePaymentSource.from_hash(hash['payment_source']) if
127
135
  hash['payment_source']
128
136
  intent = hash.key?('intent') ? hash['intent'] : SKIP
137
+ processing_instruction =
138
+ hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
129
139
  payer = Payer.from_hash(hash['payer']) if hash['payer']
130
140
  # Parameter is an array, so we need to iterate through it
131
141
  purchase_units = nil
@@ -155,6 +165,7 @@ module PaypalServerSdk
155
165
  id: id,
156
166
  payment_source: payment_source,
157
167
  intent: intent,
168
+ processing_instruction: processing_instruction,
158
169
  payer: payer,
159
170
  purchase_units: purchase_units,
160
171
  status: status,
@@ -165,8 +176,9 @@ module PaypalServerSdk
165
176
  def to_s
166
177
  class_name = self.class.name.split('::').last
167
178
  "<#{class_name} create_time: #{@create_time}, update_time: #{@update_time}, id: #{@id},"\
168
- " payment_source: #{@payment_source}, intent: #{@intent}, payer: #{@payer}, purchase_units:"\
169
- " #{@purchase_units}, status: #{@status}, links: #{@links}>"
179
+ " payment_source: #{@payment_source}, intent: #{@intent}, processing_instruction:"\
180
+ " #{@processing_instruction}, payer: #{@payer}, purchase_units: #{@purchase_units}, status:"\
181
+ " #{@status}, links: #{@links}>"
170
182
  end
171
183
 
172
184
  # Provides a debugging-friendly string with detailed object information.
@@ -174,8 +186,9 @@ module PaypalServerSdk
174
186
  class_name = self.class.name.split('::').last
175
187
  "<#{class_name} create_time: #{@create_time.inspect}, update_time: #{@update_time.inspect},"\
176
188
  " id: #{@id.inspect}, payment_source: #{@payment_source.inspect}, intent:"\
177
- " #{@intent.inspect}, payer: #{@payer.inspect}, purchase_units: #{@purchase_units.inspect},"\
178
- " status: #{@status.inspect}, links: #{@links.inspect}>"
189
+ " #{@intent.inspect}, processing_instruction: #{@processing_instruction.inspect}, payer:"\
190
+ " #{@payer.inspect}, purchase_units: #{@purchase_units.inspect}, status: #{@status.inspect},"\
191
+ " links: #{@links.inspect}>"
179
192
  end
180
193
  end
181
194
  end
@@ -20,8 +20,9 @@ module PaypalServerSdk
20
20
  # language code](https://www.loc.gov/standards/iso639-2/php/code_list.php),
21
21
  # the optional [ISO-15924 script
22
22
  # tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166
23
- # alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region
24
- # code](https://unstats.un.org/unsd/methodology/m49/).
23
+ # alpha-2 country
24
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) or
25
+ # [M49 region code](https://unstats.un.org/unsd/methodology/m49/).
25
26
  # @return [String]
26
27
  attr_accessor :locale
27
28
 
@@ -14,6 +14,10 @@ module PaypalServerSdk
14
14
  # @return [CheckoutPaymentIntent]
15
15
  attr_accessor :intent
16
16
 
17
+ # The instruction to process an order.
18
+ # @return [ProcessingInstruction]
19
+ attr_accessor :processing_instruction
20
+
17
21
  # DEPRECATED. The customer is also known as the payer. The Payer object was
18
22
  # intended to only be used with the `payment_source.paypal` object. In order
19
23
  # to make this design more clear, the details in the `payer` object are now
@@ -43,6 +47,7 @@ module PaypalServerSdk
43
47
  def self.names
44
48
  @_hash = {} if @_hash.nil?
45
49
  @_hash['intent'] = 'intent'
50
+ @_hash['processing_instruction'] = 'processing_instruction'
46
51
  @_hash['payer'] = 'payer'
47
52
  @_hash['purchase_units'] = 'purchase_units'
48
53
  @_hash['payment_source'] = 'payment_source'
@@ -53,6 +58,7 @@ module PaypalServerSdk
53
58
  # An array for optional fields
54
59
  def self.optionals
55
60
  %w[
61
+ processing_instruction
56
62
  payer
57
63
  payment_source
58
64
  application_context
@@ -64,9 +70,10 @@ module PaypalServerSdk
64
70
  []
65
71
  end
66
72
 
67
- def initialize(intent:, purchase_units:, payer: SKIP, payment_source: SKIP,
68
- application_context: SKIP)
73
+ def initialize(intent:, purchase_units:, processing_instruction: SKIP,
74
+ payer: SKIP, payment_source: SKIP, application_context: SKIP)
69
75
  @intent = intent
76
+ @processing_instruction = processing_instruction unless processing_instruction == SKIP
70
77
  @payer = payer unless payer == SKIP
71
78
  @purchase_units = purchase_units
72
79
  @payment_source = payment_source unless payment_source == SKIP
@@ -89,6 +96,8 @@ module PaypalServerSdk
89
96
  end
90
97
 
91
98
  purchase_units = nil unless hash.key?('purchase_units')
99
+ processing_instruction =
100
+ hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
92
101
  payer = Payer.from_hash(hash['payer']) if hash['payer']
93
102
  payment_source = PaymentSource.from_hash(hash['payment_source']) if hash['payment_source']
94
103
  application_context = OrderApplicationContext.from_hash(hash['application_context']) if
@@ -97,6 +106,7 @@ module PaypalServerSdk
97
106
  # Create object from extracted values.
98
107
  OrderRequest.new(intent: intent,
99
108
  purchase_units: purchase_units,
109
+ processing_instruction: processing_instruction,
100
110
  payer: payer,
101
111
  payment_source: payment_source,
102
112
  application_context: application_context)
@@ -105,14 +115,16 @@ module PaypalServerSdk
105
115
  # Provides a human-readable string representation of the object.
106
116
  def to_s
107
117
  class_name = self.class.name.split('::').last
108
- "<#{class_name} intent: #{@intent}, payer: #{@payer}, purchase_units: #{@purchase_units},"\
109
- " payment_source: #{@payment_source}, application_context: #{@application_context}>"
118
+ "<#{class_name} intent: #{@intent}, processing_instruction: #{@processing_instruction},"\
119
+ " payer: #{@payer}, purchase_units: #{@purchase_units}, payment_source: #{@payment_source},"\
120
+ " application_context: #{@application_context}>"
110
121
  end
111
122
 
112
123
  # Provides a debugging-friendly string with detailed object information.
113
124
  def inspect
114
125
  class_name = self.class.name.split('::').last
115
- "<#{class_name} intent: #{@intent.inspect}, payer: #{@payer.inspect}, purchase_units:"\
126
+ "<#{class_name} intent: #{@intent.inspect}, processing_instruction:"\
127
+ " #{@processing_instruction.inspect}, payer: #{@payer.inspect}, purchase_units:"\
116
128
  " #{@purchase_units.inspect}, payment_source: #{@payment_source.inspect},"\
117
129
  " application_context: #{@application_context.inspect}>"
118
130
  end
@@ -20,11 +20,12 @@ module PaypalServerSdk
20
20
  # @return [String]
21
21
  attr_accessor :email
22
22
 
23
- # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
24
- # that identifies the country or region. Note: The country code for Great
25
- # Britain is GB and not UK as used in the top-level domain names for that
26
- # country. Use the `C2` country code for China worldwide for comparable
27
- # uncontrolled price (CUP) method, bank card, and cross-border transactions.
23
+ # The [two-character ISO 3166-1
24
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) that
25
+ # identifies the country or region. Note: The country code for Great Britain
26
+ # is GB and not UK as used in the top-level domain names for that country.
27
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
28
+ # price (CUP) method, bank card, and cross-border transactions.
28
29
  # @return [String]
29
30
  attr_accessor :country_code
30
31
 
@@ -20,11 +20,12 @@ module PaypalServerSdk
20
20
  # @return [String]
21
21
  attr_accessor :email
22
22
 
23
- # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
24
- # that identifies the country or region. Note: The country code for Great
25
- # Britain is GB and not UK as used in the top-level domain names for that
26
- # country. Use the `C2` country code for China worldwide for comparable
27
- # uncontrolled price (CUP) method, bank card, and cross-border transactions.
23
+ # The [two-character ISO 3166-1
24
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) that
25
+ # identifies the country or region. Note: The country code for Great Britain
26
+ # is GB and not UK as used in the top-level domain names for that country.
27
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
28
+ # price (CUP) method, bank card, and cross-border transactions.
28
29
  # @return [String]
29
30
  attr_accessor :country_code
30
31
 
@@ -23,7 +23,8 @@ module PaypalServerSdk
23
23
  # @return [PaymentTokenResponsePaymentSource]
24
24
  attr_accessor :payment_source
25
25
 
26
- # An array of related [HATEOAS links](/api/rest/responses/#hateoas).
26
+ # An array of related [HATEOAS
27
+ # links](https://developer.paypal.com/api/rest/responses/#hateoas).
27
28
  # @return [Array[LinkDescription]]
28
29
  attr_accessor :links
29
30
 
@@ -13,8 +13,7 @@ module PaypalServerSdk
13
13
  # @return [PaypalWalletCustomerRequest]
14
14
  attr_accessor :customer
15
15
 
16
- # Resource consolidating common request and response attributes for vaulting
17
- # PayPal Wallet.
16
+ # TODO: Write general description for this method
18
17
  # @return [PaypalWalletVaultInstruction]
19
18
  attr_accessor :vault
20
19
 
@@ -24,8 +24,9 @@ module PaypalServerSdk
24
24
  # language code](https://www.loc.gov/standards/iso639-2/php/code_list.php),
25
25
  # the optional [ISO-15924 script
26
26
  # tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166
27
- # alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region
28
- # code](https://unstats.un.org/unsd/methodology/m49/).
27
+ # alpha-2 country
28
+ # code](https://developer.paypal.com/api/rest/reference/country-codes/) or
29
+ # [M49 region code](https://unstats.un.org/unsd/methodology/m49/).
29
30
  # @return [String]
30
31
  attr_accessor :locale
31
32
 
@@ -0,0 +1,134 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Resource consolidating common request and response attributes for vaulting
8
+ # PayPal Wallet.
9
+ class PaypalWalletVaultBase < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Defines how and when the payment source gets vaulted.
14
+ # @return [StoreInVaultInstruction]
15
+ attr_accessor :store_in_vault
16
+
17
+ # The description displayed to PayPal consumer on the approval flow for
18
+ # PayPal, as well as on the PayPal payment token management experience on
19
+ # PayPal.com.
20
+ # @return [String]
21
+ attr_accessor :description
22
+
23
+ # Expected business/pricing model for the billing agreement.
24
+ # @return [UsagePattern]
25
+ attr_accessor :usage_pattern
26
+
27
+ # The usage type associated with the PayPal payment token.
28
+ # @return [UsageType]
29
+ attr_accessor :usage_type
30
+
31
+ # The customer type associated with the PayPal payment token. This is to
32
+ # indicate whether the customer acting on the merchant / platform is either
33
+ # a business or a consumer.
34
+ # @return [PaypalPaymentTokenCustomerType]
35
+ attr_accessor :customer_type
36
+
37
+ # Create multiple payment tokens for the same payer, merchant/platform
38
+ # combination. Use this when the customer has not logged in at
39
+ # merchant/platform. The payment token thus generated, can then also be used
40
+ # to create the customer account at merchant/platform. Use this also when
41
+ # multiple payment tokens are required for the same payer, different
42
+ # customer at merchant/platform. This helps to identify customers distinctly
43
+ # even though they may share the same PayPal account. This only applies to
44
+ # PayPal payment source.
45
+ # @return [TrueClass | FalseClass]
46
+ attr_accessor :permit_multiple_payment_tokens
47
+
48
+ # A mapping from model property names to API property names.
49
+ def self.names
50
+ @_hash = {} if @_hash.nil?
51
+ @_hash['store_in_vault'] = 'store_in_vault'
52
+ @_hash['description'] = 'description'
53
+ @_hash['usage_pattern'] = 'usage_pattern'
54
+ @_hash['usage_type'] = 'usage_type'
55
+ @_hash['customer_type'] = 'customer_type'
56
+ @_hash['permit_multiple_payment_tokens'] =
57
+ 'permit_multiple_payment_tokens'
58
+ @_hash
59
+ end
60
+
61
+ # An array for optional fields
62
+ def self.optionals
63
+ %w[
64
+ store_in_vault
65
+ description
66
+ usage_pattern
67
+ usage_type
68
+ customer_type
69
+ permit_multiple_payment_tokens
70
+ ]
71
+ end
72
+
73
+ # An array for nullable fields
74
+ def self.nullables
75
+ []
76
+ end
77
+
78
+ def initialize(store_in_vault: SKIP, description: SKIP, usage_pattern: SKIP,
79
+ usage_type: SKIP,
80
+ customer_type: PaypalPaymentTokenCustomerType::CONSUMER,
81
+ permit_multiple_payment_tokens: false)
82
+ @store_in_vault = store_in_vault unless store_in_vault == SKIP
83
+ @description = description unless description == SKIP
84
+ @usage_pattern = usage_pattern unless usage_pattern == SKIP
85
+ @usage_type = usage_type unless usage_type == SKIP
86
+ @customer_type = customer_type unless customer_type == SKIP
87
+ unless permit_multiple_payment_tokens == SKIP
88
+ @permit_multiple_payment_tokens =
89
+ permit_multiple_payment_tokens
90
+ end
91
+ end
92
+
93
+ # Creates an instance of the object from a hash.
94
+ def self.from_hash(hash)
95
+ return nil unless hash
96
+
97
+ # Extract variables from the hash.
98
+ store_in_vault =
99
+ hash.key?('store_in_vault') ? hash['store_in_vault'] : SKIP
100
+ description = hash.key?('description') ? hash['description'] : SKIP
101
+ usage_pattern = hash.key?('usage_pattern') ? hash['usage_pattern'] : SKIP
102
+ usage_type = hash.key?('usage_type') ? hash['usage_type'] : SKIP
103
+ customer_type =
104
+ hash['customer_type'] ||= PaypalPaymentTokenCustomerType::CONSUMER
105
+ permit_multiple_payment_tokens =
106
+ hash['permit_multiple_payment_tokens'] ||= false
107
+
108
+ # Create object from extracted values.
109
+ PaypalWalletVaultBase.new(store_in_vault: store_in_vault,
110
+ description: description,
111
+ usage_pattern: usage_pattern,
112
+ usage_type: usage_type,
113
+ customer_type: customer_type,
114
+ permit_multiple_payment_tokens: permit_multiple_payment_tokens)
115
+ end
116
+
117
+ # Provides a human-readable string representation of the object.
118
+ def to_s
119
+ class_name = self.class.name.split('::').last
120
+ "<#{class_name} store_in_vault: #{@store_in_vault}, description: #{@description},"\
121
+ " usage_pattern: #{@usage_pattern}, usage_type: #{@usage_type}, customer_type:"\
122
+ " #{@customer_type}, permit_multiple_payment_tokens: #{@permit_multiple_payment_tokens}>"
123
+ end
124
+
125
+ # Provides a debugging-friendly string with detailed object information.
126
+ def inspect
127
+ class_name = self.class.name.split('::').last
128
+ "<#{class_name} store_in_vault: #{@store_in_vault.inspect}, description:"\
129
+ " #{@description.inspect}, usage_pattern: #{@usage_pattern.inspect}, usage_type:"\
130
+ " #{@usage_type.inspect}, customer_type: #{@customer_type.inspect},"\
131
+ " permit_multiple_payment_tokens: #{@permit_multiple_payment_tokens.inspect}>"
132
+ end
133
+ end
134
+ end
@@ -4,12 +4,15 @@
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
6
  module PaypalServerSdk
7
- # Resource consolidating common request and response attributes for vaulting
8
- # PayPal Wallet.
7
+ # PaypalWalletVaultInstruction Model.
9
8
  class PaypalWalletVaultInstruction < BaseModel
10
9
  SKIP = Object.new
11
10
  private_constant :SKIP
12
11
 
12
+ # Defines how and when the payment source gets vaulted.
13
+ # @return [StoreInVaultInstruction]
14
+ attr_accessor :store_in_vault
15
+
13
16
  # The description displayed to PayPal consumer on the approval flow for
14
17
  # PayPal, as well as on the PayPal payment token management experience on
15
18
  # PayPal.com.
@@ -44,6 +47,7 @@ module PaypalServerSdk
44
47
  # A mapping from model property names to API property names.
45
48
  def self.names
46
49
  @_hash = {} if @_hash.nil?
50
+ @_hash['store_in_vault'] = 'store_in_vault'
47
51
  @_hash['description'] = 'description'
48
52
  @_hash['usage_pattern'] = 'usage_pattern'
49
53
  @_hash['usage_type'] = 'usage_type'
@@ -56,6 +60,7 @@ module PaypalServerSdk
56
60
  # An array for optional fields
57
61
  def self.optionals
58
62
  %w[
63
+ store_in_vault
59
64
  description
60
65
  usage_pattern
61
66
  customer_type
@@ -68,9 +73,11 @@ module PaypalServerSdk
68
73
  []
69
74
  end
70
75
 
71
- def initialize(usage_type:, description: SKIP, usage_pattern: SKIP,
76
+ def initialize(usage_type:, store_in_vault: SKIP, description: SKIP,
77
+ usage_pattern: SKIP,
72
78
  customer_type: PaypalPaymentTokenCustomerType::CONSUMER,
73
79
  permit_multiple_payment_tokens: false)
80
+ @store_in_vault = store_in_vault unless store_in_vault == SKIP
74
81
  @description = description unless description == SKIP
75
82
  @usage_pattern = usage_pattern unless usage_pattern == SKIP
76
83
  @usage_type = usage_type
@@ -87,6 +94,8 @@ module PaypalServerSdk
87
94
 
88
95
  # Extract variables from the hash.
89
96
  usage_type = hash.key?('usage_type') ? hash['usage_type'] : nil
97
+ store_in_vault =
98
+ hash.key?('store_in_vault') ? hash['store_in_vault'] : SKIP
90
99
  description = hash.key?('description') ? hash['description'] : SKIP
91
100
  usage_pattern = hash.key?('usage_pattern') ? hash['usage_pattern'] : SKIP
92
101
  customer_type =
@@ -96,6 +105,7 @@ module PaypalServerSdk
96
105
 
97
106
  # Create object from extracted values.
98
107
  PaypalWalletVaultInstruction.new(usage_type: usage_type,
108
+ store_in_vault: store_in_vault,
99
109
  description: description,
100
110
  usage_pattern: usage_pattern,
101
111
  customer_type: customer_type,
@@ -105,18 +115,18 @@ module PaypalServerSdk
105
115
  # Provides a human-readable string representation of the object.
106
116
  def to_s
107
117
  class_name = self.class.name.split('::').last
108
- "<#{class_name} description: #{@description}, usage_pattern: #{@usage_pattern}, usage_type:"\
109
- " #{@usage_type}, customer_type: #{@customer_type}, permit_multiple_payment_tokens:"\
110
- " #{@permit_multiple_payment_tokens}>"
118
+ "<#{class_name} store_in_vault: #{@store_in_vault}, description: #{@description},"\
119
+ " usage_pattern: #{@usage_pattern}, usage_type: #{@usage_type}, customer_type:"\
120
+ " #{@customer_type}, permit_multiple_payment_tokens: #{@permit_multiple_payment_tokens}>"
111
121
  end
112
122
 
113
123
  # Provides a debugging-friendly string with detailed object information.
114
124
  def inspect
115
125
  class_name = self.class.name.split('::').last
116
- "<#{class_name} description: #{@description.inspect}, usage_pattern:"\
117
- " #{@usage_pattern.inspect}, usage_type: #{@usage_type.inspect}, customer_type:"\
118
- " #{@customer_type.inspect}, permit_multiple_payment_tokens:"\
119
- " #{@permit_multiple_payment_tokens.inspect}>"
126
+ "<#{class_name} store_in_vault: #{@store_in_vault.inspect}, description:"\
127
+ " #{@description.inspect}, usage_pattern: #{@usage_pattern.inspect}, usage_type:"\
128
+ " #{@usage_type.inspect}, customer_type: #{@customer_type.inspect},"\
129
+ " permit_multiple_payment_tokens: #{@permit_multiple_payment_tokens.inspect}>"
120
130
  end
121
131
  end
122
132
  end