pcp-server-ruby-sdk 1.12.0 → 1.14.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 (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/api-definition.yaml +693 -40
  5. data/lib/PCP-server-Ruby-SDK/endpoints/pay_by_link_api_client.rb +33 -0
  6. data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
  7. data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
  8. data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
  9. data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
  10. data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
  11. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
  12. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
  13. data/lib/PCP-server-Ruby-SDK/models/authentication_token.rb +6 -183
  14. data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
  15. data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
  16. data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
  17. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
  18. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
  19. data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
  20. data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
  21. data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
  22. data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
  23. data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
  24. data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
  25. data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
  26. data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
  27. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
  28. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
  29. data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
  30. data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
  31. data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
  32. data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
  33. data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
  34. data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
  35. data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
  36. data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
  37. data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
  38. data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
  39. data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
  40. data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
  41. data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
  42. data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
  43. data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
  44. data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
  45. data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
  46. data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
  47. data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
  48. data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
  49. data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
  50. data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
  51. data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
  52. data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_request.rb +12 -0
  53. data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_response.rb +13 -0
  54. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
  55. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
  56. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
  57. data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
  58. data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
  59. data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
  60. data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
  61. data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
  62. data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
  63. data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
  64. data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
  65. data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
  66. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
  67. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
  68. data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
  69. data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
  70. data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
  71. data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
  72. data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
  73. data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
  74. data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
  75. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
  76. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
  77. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
  78. data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
  79. data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
  80. data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
  81. data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
  82. data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
  83. data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
  84. data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
  85. data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
  86. data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
  87. data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
  88. data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
  89. data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
  90. data/lib/PCP-server-Ruby-SDK/models/pay_link_status_value.rb +20 -0
  91. data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
  92. data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
  93. data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
  94. data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
  95. data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
  96. data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
  97. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
  98. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
  99. data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
  100. data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +34 -314
  101. data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
  102. data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
  103. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
  104. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
  105. data/lib/PCP-server-Ruby-SDK/models/payment_link_order.rb +10 -0
  106. data/lib/PCP-server-Ruby-SDK/models/payment_link_specific_input.rb +19 -0
  107. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
  108. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
  109. data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
  110. data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
  111. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
  112. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
  113. data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
  114. data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
  115. data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
  116. data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
  117. data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account_for_intent.rb +12 -0
  118. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +6 -211
  119. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +12 -0
  120. data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
  121. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_payment_intent.rb +11 -0
  122. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
  123. data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
  124. data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
  125. data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
  126. data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
  127. data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
  128. data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
  129. data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
  130. data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
  131. data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
  132. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
  133. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
  134. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
  135. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
  136. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
  137. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
  138. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
  139. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
  140. data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
  141. data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
  142. data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
  143. data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
  144. data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
  145. data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
  146. data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
  147. data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
  148. data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
  149. data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
  150. data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
  151. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
  152. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
  153. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
  154. data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
  155. data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
  156. data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
  157. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
  158. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
  159. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
  160. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
  161. data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
  162. data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
  163. data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +5 -1
  164. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  165. data/lib/PCP-server-Ruby-SDK.rb +25 -0
  166. data/package-lock.json +2 -2
  167. data/package.json +1 -1
  168. data/scripts/convert_models_to_model_base.rb +128 -0
  169. data/spec/endpoints/pay_by_link_api_client_spec.rb +38 -0
  170. data/spec/endpoints/payment_information_api_client_spec.rb +9 -2
  171. data/spec/endpoints/payment_intent_api_client_spec.rb +45 -0
  172. data/spec/models/api_definition_conformance_spec.rb +88 -0
  173. data/spec/models/model_base_spec.rb +87 -0
  174. data/spec/models/pay_by_link_models_spec.rb +50 -0
  175. data/spec/models/payment_intent_models_spec.rb +51 -0
  176. data/spec/models/required_field_validation_spec.rb +5 -5
  177. data/spec/queries/get_checkouts_query_spec.rb +15 -0
  178. metadata +45 -10
  179. data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
  180. data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
  181. data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
@@ -1,236 +1,15 @@
1
+ require_relative 'model_base'
1
2
 
2
- require 'date'
3
- require 'time'
4
3
  module PCPServerSDK
5
4
  module Models
6
- # Additional information about the Apple payment data token. This information are needed for checking the validity of the payment data token before decryption.
7
- class ApplePaymentDataTokenInformation
5
+ class ApplePaymentDataTokenInformation < ModelBase
8
6
  # Version information about the payment token. Currently only EC_v1 for ECC-encrypted data is supported.
9
- attr_accessor :version
10
-
11
- # Detached PKCS #7 signature, Base64 encoded as string. Signature of the payment and header data. The signature includes the signing certificate, its intermediate CA certificate, and information about the signing algorithm.
12
- attr_accessor :signature
13
-
14
- attr_accessor :header
15
-
16
- class EnumAttributeValidator
17
- attr_reader :datatype
18
- attr_reader :allowable_values
19
-
20
- def initialize(datatype, allowable_values)
21
- @allowable_values = allowable_values.map do |value|
22
- case datatype.to_s
23
- when /Integer/i
24
- value.to_i
25
- when /Float/i
26
- value.to_f
27
- else
28
- value
29
- end
30
- end
31
- end
32
-
33
- def valid?(value)
34
- !value || allowable_values.include?(value)
35
- end
36
- end
37
-
38
- # Attribute mapping from ruby-style variable name to JSON key.
39
- def self.attribute_map
40
- {
41
- :'version' => :'version',
42
- :'signature' => :'signature',
43
- :'header' => :'header'
44
- }
45
- end
46
-
47
- # Returns all the JSON keys this model knows about
48
- def self.acceptable_attributes
49
- attribute_map.values
50
- end
51
-
52
- # Attribute type mapping.
53
- def self.openapi_types
54
- {
55
- :'version' => :'String',
56
- :'signature' => :'String',
57
- :'header' => :'ApplePaymentDataTokenHeaderInformation'
58
- }
59
- end
60
-
61
- # List of attributes with nullable: true
62
- def self.openapi_nullable
63
- Set.new([
64
- ])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `ApplePaymentDataTokenInformation` initialize method"
72
- end
73
-
74
- # check to see if the attribute exists and convert string to symbol for hash key
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `ApplePaymentDataTokenInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'version')
83
- self.version = attributes[:'version']
84
- else
85
- self.version = nil
86
- end
87
-
88
- if attributes.key?(:'signature')
89
- self.signature = attributes[:'signature']
90
- else
91
- self.signature = nil
92
- end
93
-
94
- if attributes.key?(:'header')
95
- self.header = attributes[:'header']
96
- else
97
- self.header = nil
98
- end
99
- end
100
-
101
- # Checks equality by comparing each attribute.
102
- # @param [Object] Object to be compared
103
- def ==(o)
104
- return true if self.equal?(o)
105
- self.class == o.class &&
106
- version == o.version &&
107
- signature == o.signature &&
108
- header == o.header
109
- end
110
-
111
- # @see the `==` method
112
- # @param [Object] Object to be compared
113
- def eql?(o)
114
- self == o
115
- end
116
-
117
- # Calculates hash code according to all attributes.
118
- # @return [Integer] Hash code
119
- def hash
120
- [version, signature, header].hash
121
- end
122
-
123
- # Builds the object from hash
124
- # @param [Hash] attributes Model attributes in the form of hash
125
- # @return [Object] Returns the model itself
126
- def self.build_from_hash(attributes)
127
- return nil unless attributes.is_a?(Hash)
128
- attributes = attributes.transform_keys(&:to_sym)
129
- transformed_hash = {}
130
- openapi_types.each_pair do |key, type|
131
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
- transformed_hash["#{key}"] = nil
133
- elsif type =~ /\AArray<(.*)>/i
134
- # check to ensure the input is an array given that the attribute
135
- # is documented as an array but the input is not
136
- if attributes[attribute_map[key]].is_a?(Array)
137
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
- end
139
- elsif !attributes[attribute_map[key]].nil?
140
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
- end
142
- end
143
- new(transformed_hash)
144
- end
145
-
146
- # Deserializes the data based on type
147
- # @param string type Data type
148
- # @param string value Value to be deserialized
149
- # @return [Object] Deserialized data
150
- def self._deserialize(type, value)
151
- case type.to_sym
152
- when :Time
153
- Time.parse(value)
154
- when :Date
155
- Date.parse(value)
156
- when :String
157
- value.to_s
158
- when :Integer
159
- value.to_i
160
- when :Float
161
- value.to_f
162
- when :Boolean
163
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
- true
165
- else
166
- false
167
- end
168
- when :Object
169
- # generic object (usually a Hash), return directly
170
- value
171
- when /\AArray<(?<inner_type>.+)>\z/
172
- inner_type = Regexp.last_match[:inner_type]
173
- value.map { |v| _deserialize(inner_type, v) }
174
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
- k_type = Regexp.last_match[:k_type]
176
- v_type = Regexp.last_match[:v_type]
177
- {}.tap do |hash|
178
- value.each do |k, v|
179
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
- end
181
- end
182
- else # model
183
- # models (e.g. Pet) or oneOf
184
- klass = PCPServerSDK::Models.const_get(type)
185
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
- end
187
- end
188
-
189
- # Returns the string representation of the object
190
- # @return [String] String presentation of the object
191
- def to_s
192
- to_hash.to_s
193
- end
194
-
195
- # to_body is an alias to to_hash (backward compatibility)
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_body
198
- to_hash
199
- end
200
-
201
- # Returns the object in the form of hash
202
- # @return [Hash] Returns the object in the form of hash
203
- def to_hash
204
- hash = {}
205
- self.class.attribute_map.each_pair do |attr, param|
206
- value = self.send(attr)
207
- if value.nil?
208
- is_nullable = self.class.openapi_nullable.include?(attr)
209
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
- end
211
-
212
- hash[param] = _to_hash(value)
213
- end
214
- hash
215
- end
216
-
217
- # Outputs non-array value in the form of hash
218
- # For object, use to_hash. Otherwise, just return the value
219
- # @param [Object] value Any valid value
220
- # @return [Hash] Returns the value in the form of hash
221
- def _to_hash(value)
222
- if value.is_a?(Array)
223
- value.compact.map { |v| _to_hash(v) }
224
- elsif value.is_a?(Hash)
225
- {}.tap do |hash|
226
- value.each { |k, v| hash[k] = _to_hash(v) }
227
- end
228
- elsif value.respond_to? :to_hash
229
- value.to_hash
230
- else
231
- value
232
- end
233
- end
7
+ attribute :version, :version, :String, enum: ["EC_V1"]
8
+ # Detached PKCS #7 signature, Base64 encoded as string. Signature of the payment and header data. The
9
+ # signature includes the signing certificate, its intermediate CA certificate, and information about the
10
+ # signing algorithm.
11
+ attribute :signature, :signature, :String
12
+ attribute :header, :header, :ApplePaymentDataTokenHeaderInformation
234
13
  end
235
14
  end
236
15
  end
@@ -1,189 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
- require 'json'
4
- require 'date'
5
- require 'securerandom'
1
+ require_relative 'model_base'
6
2
 
7
3
  module PCPServerSDK
8
4
  module Models
9
- # Model for the authentication JWT token response
10
- class AuthenticationToken
11
- attr_accessor :token
12
- attr_accessor :id
13
- attr_accessor :creation_date
14
- attr_accessor :expiration_date
15
-
16
- def self.attribute_map
17
- {
18
- :'token' => :'token',
19
- :'id' => :'id',
20
- :'creation_date' => :'creationDate',
21
- :'expiration_date' => :'expirationDate'
22
- }
23
- end
24
-
25
- def self.acceptable_attributes
26
- attribute_map.values
27
- end
28
-
29
- def self.openapi_types
30
- {
31
- :'token' => :'String',
32
- :'id' => :'String',
33
- :'creation_date' => :'Time',
34
- :'expiration_date' => :'Time'
35
- }
36
- end
37
-
38
- def self.openapi_nullable
39
- Set.new([])
40
- end
41
-
42
- def initialize(attributes = {})
43
- if (!attributes.is_a?(Hash))
44
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthenticationToken` initialize method"
45
- end
46
-
47
- attributes = attributes.each_with_object({}) { |(k, v), h|
48
- if (!self.class.attribute_map.key?(k.to_sym))
49
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthenticationToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
- end
51
- h[k.to_sym] = v
52
- }
53
-
54
- if attributes.key?(:'token')
55
- self.token = attributes[:'token']
56
- end
57
-
58
- if attributes.key?(:'id')
59
- self.id = attributes[:'id']
60
- end
61
-
62
- if attributes.key?(:'creation_date')
63
- self.creation_date = attributes[:'creation_date'].is_a?(String) ? Time.parse(attributes[:'creation_date']) : attributes[:'creation_date']
64
- end
65
-
66
- if attributes.key?(:'expiration_date')
67
- self.expiration_date = attributes[:'expiration_date'].is_a?(String) ? Time.parse(attributes[:'expiration_date']) : attributes[:'expiration_date']
68
- end
69
- end
70
-
71
- def self.from_json(json_str)
72
- data = JSON.parse(json_str)
73
- new(data)
74
- end
75
-
76
- def self.build_from_hash(attributes)
77
- return nil unless attributes.is_a?(Hash)
78
- attributes = attributes.transform_keys(&:to_sym)
79
- transformed_hash = {}
80
- openapi_types.each_pair do |key, type|
81
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
82
- transformed_hash[key] = nil
83
- elsif type =~ /\AArray<(.*)>/i
84
- if attributes[attribute_map[key]].is_a?(Array)
85
- transformed_hash[key] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
86
- end
87
- elsif !attributes[attribute_map[key]].nil?
88
- transformed_hash[key] = _deserialize(type, attributes[attribute_map[key]])
89
- end
90
- end
91
- new(transformed_hash)
92
- end
93
-
94
- def self._deserialize(type, value)
95
- case type.to_sym
96
- when :Time
97
- Time.parse(value)
98
- when :Date
99
- Date.parse(value)
100
- when :String
101
- value.to_s
102
- when :Integer
103
- value.to_i
104
- when :Float
105
- value.to_f
106
- when :Boolean
107
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
108
- true
109
- else
110
- false
111
- end
112
- when :Object
113
- value
114
- when /\AArray<(?<inner_type>.+)>/i
115
- inner_type = Regexp.last_match[:inner_type]
116
- value.map { |v| _deserialize(inner_type, v) }
117
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>/i
118
- k_type = Regexp.last_match[:k_type]
119
- v_type = Regexp.last_match[:v_type]
120
- {}.tap do |hash|
121
- value.each do |k, v|
122
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
123
- end
124
- end
125
- else
126
- # models (e.g. Pet) or oneOf
127
- if PCPServerSDK::Models.const_defined?(type)
128
- klass = PCPServerSDK::Models.const_get(type)
129
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
130
- else
131
- value
132
- end
133
- end
134
- end
135
-
136
- def ==(o)
137
- return true if self.equal?(o)
138
- self.class == o.class &&
139
- token == o.token &&
140
- id == o.id &&
141
- creation_date == o.creation_date &&
142
- expiration_date == o.expiration_date
143
- end
144
-
145
- def eql?(o)
146
- self == o
147
- end
148
-
149
- def hash
150
- [token, id, creation_date, expiration_date].hash
151
- end
152
-
153
- def to_s
154
- to_hash.to_s
155
- end
156
-
157
- def to_body
158
- to_hash
159
- end
160
-
161
- def to_hash
162
- hash = {}
163
- self.class.attribute_map.each_pair do |attr, param|
164
- value = self.send(attr)
165
- if value.nil?
166
- is_nullable = self.class.openapi_nullable.include?(attr)
167
- next if !is_nullable || (is_nullable && !instance_variable_defined?("@#{attr}"))
168
- end
169
- hash[param] = _to_hash(value)
170
- end
171
- hash
172
- end
173
-
174
- def _to_hash(value)
175
- if value.is_a?(Array)
176
- value.compact.map { |v| _to_hash(v) }
177
- elsif value.is_a?(Hash)
178
- {}.tap do |hash|
179
- value.each { |k, v| hash[k] = _to_hash(v) }
180
- end
181
- elsif value.respond_to? :to_hash
182
- value.to_hash
183
- else
184
- value
185
- end
186
- end
5
+ class AuthenticationToken < ModelBase
6
+ attribute :token, :token, :String
7
+ attribute :id, :id, :String
8
+ attribute :creation_date, :creationDate, :Time
9
+ attribute :expiration_date, :expirationDate, :Time
187
10
  end
188
11
  end
189
12
  end
@@ -1,213 +1,17 @@
1
- require 'date'
2
- require 'time'
1
+ require_relative 'model_base'
3
2
 
4
3
  module PCPServerSDK
5
4
  module Models
6
- # Object containing information about the end customer's bank account.
7
- class BankAccountInformation
8
- # IBAN of the end customer's bank account. The IBAN is the International Bank Account Number. It is an internationally agreed format for the BBAN and includes the ISO country code and two check digits.
9
- attr_accessor :iban
10
-
11
- # Account holder of the bank account with the given IBAN. Does not necessarily have to be the end customer (e.g. joint accounts).
12
- attr_accessor :account_holder
13
-
14
- # BIC (Bank Identification Code)
15
- attr_accessor :bic
16
-
17
- # Attribute mapping from ruby-style variable name to JSON key.
18
- def self.attribute_map
19
- {
20
- :'iban' => :'iban',
21
- :'account_holder' => :'accountHolder',
22
- :'bic' => :'bic'
23
- }
24
- end
25
-
26
- # Returns all the JSON keys this model knows about
27
- def self.acceptable_attributes
28
- attribute_map.values
29
- end
30
-
31
- # Attribute type mapping.
32
- def self.openapi_types
33
- {
34
- :'iban' => :'String',
35
- :'account_holder' => :'String',
36
- :'bic' => :'String'
37
- }
38
- end
39
-
40
- # List of attributes with nullable: true
41
- def self.openapi_nullable
42
- Set.new([
43
- ])
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `BankAccountInformation` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `BankAccountInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'iban')
62
- self.iban = attributes[:'iban']
63
- else
64
- self.iban = nil
65
- end
66
-
67
- if attributes.key?(:'account_holder')
68
- self.account_holder = attributes[:'account_holder']
69
- else
70
- self.account_holder = nil
71
- end
72
-
73
- if attributes.key?(:'bic')
74
- self.bic = attributes[:'bic']
75
- end
76
- end
77
-
78
- # Checks equality by comparing each attribute.
79
- # @param [Object] Object to be compared
80
- def ==(o)
81
- return true if self.equal?(o)
82
- self.class == o.class &&
83
- iban == o.iban &&
84
- account_holder == o.account_holder &&
85
- bic == o.bic
86
- end
87
-
88
- # @see the `==` method
89
- # @param [Object] Object to be compared
90
- def eql?(o)
91
- self == o
92
- end
93
-
94
- # Calculates hash code according to all attributes.
95
- # @return [Integer] Hash code
96
- def hash
97
- [iban, account_holder, bic].hash
98
- end
99
-
100
- # Builds the object from hash
101
- # @param [Hash] attributes Model attributes in the form of hash
102
- # @return [Object] Returns the model itself
103
- def self.build_from_hash(attributes)
104
- return nil unless attributes.is_a?(Hash)
105
- attributes = attributes.transform_keys(&:to_sym)
106
- transformed_hash = {}
107
- openapi_types.each_pair do |key, type|
108
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
- transformed_hash["#{key}"] = nil
110
- elsif type =~ /\AArray<(.*)>/i
111
- # check to ensure the input is an array given that the attribute
112
- # is documented as an array but the input is not
113
- if attributes[attribute_map[key]].is_a?(Array)
114
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
115
- end
116
- elsif !attributes[attribute_map[key]].nil?
117
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
118
- end
119
- end
120
- new(transformed_hash)
121
- end
122
-
123
- # Deserializes the data based on type
124
- # @param string type Data type
125
- # @param string value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def self._deserialize(type, value)
128
- case type.to_sym
129
- when :Time
130
- Time.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :Boolean
140
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- # models (e.g. Pet) or oneOf
161
- klass = PCPServerSDK::Models.const_get(type)
162
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
163
- end
164
- end
165
-
166
- # Returns the string representation of the object
167
- # @return [String] String presentation of the object
168
- def to_s
169
- to_hash.to_s
170
- end
171
-
172
- # to_body is an alias to to_hash (backward compatibility)
173
- # @return [Hash] Returns the object in the form of hash
174
- def to_body
175
- to_hash
176
- end
177
-
178
- # Returns the object in the form of hash
179
- # @return [Hash] Returns the object in the form of hash
180
- def to_hash
181
- hash = {}
182
- self.class.attribute_map.each_pair do |attr, param|
183
- value = self.send(attr)
184
- if value.nil?
185
- is_nullable = self.class.openapi_nullable.include?(attr)
186
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
187
- end
188
-
189
- hash[param] = _to_hash(value)
190
- end
191
- hash
192
- end
193
-
194
- # Outputs non-array value in the form of hash
195
- # For object, use to_hash. Otherwise, just return the value
196
- # @param [Object] value Any valid value
197
- # @return [Hash] Returns the value in the form of hash
198
- def _to_hash(value)
199
- if value.is_a?(Array)
200
- value.compact.map { |v| _to_hash(v) }
201
- elsif value.is_a?(Hash)
202
- {}.tap do |hash|
203
- value.each { |k, v| hash[k] = _to_hash(v) }
204
- end
205
- elsif value.respond_to? :to_hash
206
- value.to_hash
207
- else
208
- value
209
- end
210
- end
5
+ class BankAccountInformation < ModelBase
6
+ # IBAN of the end customer's bank account.
7
+ # The IBAN is the International Bank Account Number. It is an internationally agreed format for the BBAN and
8
+ # includes the ISO country code and two check digits.
9
+ attribute :iban, :iban, :String
10
+ # Bank Identification Code
11
+ attribute :bic, :bic, :String
12
+ # Account holder of the bank account with the given IBAN.
13
+ # Does not necessarily have to be the end customer (e.g. joint accounts).
14
+ attribute :account_holder, :accountHolder, :String
211
15
  end
212
16
  end
213
17
  end