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,219 +1,17 @@
1
+ require_relative 'model_base'
1
2
 
2
- require 'date'
3
- require 'time'
4
3
  module PCPServerSDK
5
4
  module Models
6
- # Information for card payments realized at a POS.
7
- class CardPaymentDetails
5
+ class CardPaymentDetails < ModelBase
8
6
  # Reference to the card of the transaction.
9
- attr_accessor :masked_card_number
10
-
7
+ attribute :masked_card_number, :maskedCardNumber, :String
11
8
  # ID of the token. This property is populated when the payment was done with a token.
12
- attr_accessor :payment_processing_token
13
-
9
+ attribute :payment_processing_token, :paymentProcessingToken, :String
14
10
  # Token to identify the card in the reporting.
15
- attr_accessor :reporting_token
16
-
17
- # Identifier for a successful authorization, reversal or refund. Usually provided by the issuer system. Only provided for card payments.
18
- attr_accessor :card_authorization_id
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'masked_card_number' => :'maskedCardNumber',
24
- :'payment_processing_token' => :'paymentProcessingToken',
25
- :'reporting_token' => :'reportingToken',
26
- :'card_authorization_id' => :'cardAuthorizationId'
27
- }
28
- end
29
-
30
- # Returns all the JSON keys this model knows about
31
- def self.acceptable_attributes
32
- attribute_map.values
33
- end
34
-
35
- # Attribute type mapping.
36
- def self.openapi_types
37
- {
38
- :'masked_card_number' => :'String',
39
- :'payment_processing_token' => :'String',
40
- :'reporting_token' => :'String',
41
- :'card_authorization_id' => :'String'
42
- }
43
- end
44
-
45
- # List of attributes with nullable: true
46
- def self.openapi_nullable
47
- Set.new([
48
- ])
49
- end
50
-
51
- # Initializes the object
52
- # @param [Hash] attributes Model attributes in the form of hash
53
- def initialize(attributes = {})
54
- if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `CardPaymentDetails` initialize method"
56
- end
57
-
58
- # check to see if the attribute exists and convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `CardPaymentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
- end
63
- h[k.to_sym] = v
64
- }
65
-
66
- if attributes.key?(:'masked_card_number')
67
- self.masked_card_number = attributes[:'masked_card_number']
68
- end
69
-
70
- if attributes.key?(:'payment_processing_token')
71
- self.payment_processing_token = attributes[:'payment_processing_token']
72
- end
73
-
74
- if attributes.key?(:'reporting_token')
75
- self.reporting_token = attributes[:'reporting_token']
76
- end
77
-
78
- if attributes.key?(:'card_authorization_id')
79
- self.card_authorization_id = attributes[:'card_authorization_id']
80
- end
81
- end
82
-
83
- # Checks equality by comparing each attribute.
84
- # @param [Object] Object to be compared
85
- def ==(o)
86
- return true if self.equal?(o)
87
- self.class == o.class &&
88
- masked_card_number == o.masked_card_number &&
89
- payment_processing_token == o.payment_processing_token &&
90
- reporting_token == o.reporting_token &&
91
- card_authorization_id == o.card_authorization_id
92
- end
93
-
94
- # @see the `==` method
95
- # @param [Object] Object to be compared
96
- def eql?(o)
97
- self == o
98
- end
99
-
100
- # Calculates hash code according to all attributes.
101
- # @return [Integer] Hash code
102
- def hash
103
- [masked_card_number, payment_processing_token, reporting_token, card_authorization_id].hash
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def self.build_from_hash(attributes)
110
- return nil unless attributes.is_a?(Hash)
111
- attributes = attributes.transform_keys(&:to_sym)
112
- transformed_hash = {}
113
- openapi_types.each_pair do |key, type|
114
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
- transformed_hash["#{key}"] = nil
116
- elsif type =~ /\AArray<(.*)>/i
117
- # check to ensure the input is an array given that the attribute
118
- # is documented as an array but the input is not
119
- if attributes[attribute_map[key]].is_a?(Array)
120
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
- end
122
- elsif !attributes[attribute_map[key]].nil?
123
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
- end
125
- end
126
- new(transformed_hash)
127
- end
128
-
129
- # Deserializes the data based on type
130
- # @param string type Data type
131
- # @param string value Value to be deserialized
132
- # @return [Object] Deserialized data
133
- def self._deserialize(type, value)
134
- case type.to_sym
135
- when :Time
136
- Time.parse(value)
137
- when :Date
138
- Date.parse(value)
139
- when :String
140
- value.to_s
141
- when :Integer
142
- value.to_i
143
- when :Float
144
- value.to_f
145
- when :Boolean
146
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
- true
148
- else
149
- false
150
- end
151
- when :Object
152
- # generic object (usually a Hash), return directly
153
- value
154
- when /\AArray<(?<inner_type>.+)>\z/
155
- inner_type = Regexp.last_match[:inner_type]
156
- value.map { |v| _deserialize(inner_type, v) }
157
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
- k_type = Regexp.last_match[:k_type]
159
- v_type = Regexp.last_match[:v_type]
160
- {}.tap do |hash|
161
- value.each do |k, v|
162
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
- end
164
- end
165
- else # model
166
- # models (e.g. Pet) or oneOf
167
- klass = PCPServerSDK::Models.const_get(type)
168
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
- end
170
- end
171
-
172
- # Returns the string representation of the object
173
- # @return [String] String presentation of the object
174
- def to_s
175
- to_hash.to_s
176
- end
177
-
178
- # to_body is an alias to to_hash (backward compatibility)
179
- # @return [Hash] Returns the object in the form of hash
180
- def to_body
181
- to_hash
182
- end
183
-
184
- # Returns the object in the form of hash
185
- # @return [Hash] Returns the object in the form of hash
186
- def to_hash
187
- hash = {}
188
- self.class.attribute_map.each_pair do |attr, param|
189
- value = self.send(attr)
190
- if value.nil?
191
- is_nullable = self.class.openapi_nullable.include?(attr)
192
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
- end
194
-
195
- hash[param] = _to_hash(value)
196
- end
197
- hash
198
- end
199
-
200
- # Outputs non-array value in the form of hash
201
- # For object, use to_hash. Otherwise, just return the value
202
- # @param [Object] value Any valid value
203
- # @return [Hash] Returns the value in the form of hash
204
- def _to_hash(value)
205
- if value.is_a?(Array)
206
- value.compact.map { |v| _to_hash(v) }
207
- elsif value.is_a?(Hash)
208
- {}.tap do |hash|
209
- value.each { |k, v| hash[k] = _to_hash(v) }
210
- end
211
- elsif value.respond_to? :to_hash
212
- value.to_hash
213
- else
214
- value
215
- end
216
- end
11
+ attribute :reporting_token, :reportingToken, :String
12
+ # Identifier for a successful authorization, reversal or refund.
13
+ # Usually provided by the issuer system. Only provided for card payments.
14
+ attribute :card_authorization_id, :cardAuthorizationId, :String
217
15
  end
218
16
  end
219
17
  end
@@ -1,315 +1,40 @@
1
+ require_relative 'model_base'
1
2
 
2
- require 'date'
3
- require 'time'
4
3
  module PCPServerSDK
5
4
  module Models
6
- # Object containing the specific input details for card payments.
7
- class CardPaymentMethodSpecificInput
8
- attr_accessor :authorization_mode
9
-
10
- attr_accessor :recurring
11
-
5
+ class CardPaymentMethodSpecificInput < ModelBase
6
+ attribute :authorization_mode, :authorizationMode, :AuthorizationMode
7
+ attribute :recurring, :recurring, :CardRecurrenceDetails
12
8
  # ID of the token to use to create the payment.
13
- attr_accessor :payment_processing_token
14
-
9
+ attribute :payment_processing_token, :paymentProcessingToken, :String
15
10
  # Token to identify the card in the reporting.
16
- attr_accessor :reporting_token
17
-
18
- attr_accessor :transaction_channel
19
-
20
- attr_accessor :unscheduled_card_on_file_requestor
21
-
22
- attr_accessor :unscheduled_card_on_file_sequence_indicator
23
-
24
- # Payment product identifier - please check product documentation for a full overview of possible values.
25
- attr_accessor :payment_product_id
26
-
27
- attr_accessor :card
28
-
29
- # The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process. Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of protocol://. This protocol must be registered on the device first. URLs without a protocol will be rejected.
30
- attr_accessor :return_url
31
-
32
- # Period of payment occurrence for recurring and installment payments. Allowed values: * Yearly * Quarterly * Monthly * Weekly * Daily Supported soon
33
- attr_accessor :card_on_file_recurring_frequency
34
-
35
- # The end date of the last scheduled payment in a series of transactions. Format YYYYMMDD Supported soon
36
- attr_accessor :card_on_file_recurring_expiration
37
-
38
- class EnumAttributeValidator
39
- attr_reader :datatype
40
- attr_reader :allowable_values
41
-
42
- def initialize(datatype, allowable_values)
43
- @allowable_values = allowable_values.map do |value|
44
- case datatype.to_s
45
- when /Integer/i
46
- value.to_i
47
- when /Float/i
48
- value.to_f
49
- else
50
- value
51
- end
52
- end
53
- end
54
-
55
- def valid?(value)
56
- !value || allowable_values.include?(value)
57
- end
58
- end
59
-
60
- # Attribute mapping from ruby-style variable name to JSON key.
61
- def self.attribute_map
62
- {
63
- :'authorization_mode' => :'authorizationMode',
64
- :'recurring' => :'recurring',
65
- :'payment_processing_token' => :'paymentProcessingToken',
66
- :'reporting_token' => :'reportingToken',
67
- :'transaction_channel' => :'transactionChannel',
68
- :'unscheduled_card_on_file_requestor' => :'unscheduledCardOnFileRequestor',
69
- :'unscheduled_card_on_file_sequence_indicator' => :'unscheduledCardOnFileSequenceIndicator',
70
- :'payment_product_id' => :'paymentProductId',
71
- :'card' => :'card',
72
- :'return_url' => :'returnUrl',
73
- :'card_on_file_recurring_frequency' => :'cardOnFileRecurringFrequency',
74
- :'card_on_file_recurring_expiration' => :'cardOnFileRecurringExpiration'
75
- }
76
- end
77
-
78
- # Returns all the JSON keys this model knows about
79
- def self.acceptable_attributes
80
- attribute_map.values
81
- end
82
-
83
- # Attribute type mapping.
84
- def self.openapi_types
85
- {
86
- :'authorization_mode' => :'AuthorizationMode',
87
- :'recurring' => :'CardRecurrenceDetails',
88
- :'payment_processing_token' => :'String',
89
- :'reporting_token' => :'String',
90
- :'transaction_channel' => :'TransactionChannel',
91
- :'unscheduled_card_on_file_requestor' => :'UnscheduledCardOnFileRequestor',
92
- :'unscheduled_card_on_file_sequence_indicator' => :'UnscheduledCardOnFileSequenceIndicator',
93
- :'payment_product_id' => :'Integer',
94
- :'card' => :'CardInfo',
95
- :'return_url' => :'String',
96
- :'card_on_file_recurring_frequency' => :'String',
97
- :'card_on_file_recurring_expiration' => :'String'
98
- }
99
- end
100
-
101
- # List of attributes with nullable: true
102
- def self.openapi_nullable
103
- Set.new([
104
- ])
105
- end
106
-
107
- # Initializes the object
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- def initialize(attributes = {})
110
- if (!attributes.is_a?(Hash))
111
- fail ArgumentError, "The input argument (attributes) must be a hash in `CardPaymentMethodSpecificInput` initialize method"
112
- end
113
-
114
- # check to see if the attribute exists and convert string to symbol for hash key
115
- attributes = attributes.each_with_object({}) { |(k, v), h|
116
- if (!self.class.attribute_map.key?(k.to_sym))
117
- fail ArgumentError, "`#{k}` is not a valid attribute in `CardPaymentMethodSpecificInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
- end
119
- h[k.to_sym] = v
120
- }
121
-
122
- if attributes.key?(:'authorization_mode')
123
- self.authorization_mode = attributes[:'authorization_mode']
124
- end
125
-
126
- if attributes.key?(:'recurring')
127
- self.recurring = attributes[:'recurring']
128
- end
129
-
130
- if attributes.key?(:'payment_processing_token')
131
- self.payment_processing_token = attributes[:'payment_processing_token']
132
- end
133
-
134
- if attributes.key?(:'reporting_token')
135
- self.reporting_token = attributes[:'reporting_token']
136
- end
137
-
138
- if attributes.key?(:'transaction_channel')
139
- self.transaction_channel = attributes[:'transaction_channel']
140
- end
141
-
142
- if attributes.key?(:'unscheduled_card_on_file_requestor')
143
- self.unscheduled_card_on_file_requestor = attributes[:'unscheduled_card_on_file_requestor']
144
- end
145
-
146
- if attributes.key?(:'unscheduled_card_on_file_sequence_indicator')
147
- self.unscheduled_card_on_file_sequence_indicator = attributes[:'unscheduled_card_on_file_sequence_indicator']
148
- end
149
-
150
- if attributes.key?(:'payment_product_id')
151
- self.payment_product_id = attributes[:'payment_product_id']
152
- end
153
-
154
- if attributes.key?(:'card')
155
- self.card = attributes[:'card']
156
- end
157
-
158
- if attributes.key?(:'return_url')
159
- self.return_url = attributes[:'return_url']
160
- end
161
-
162
- if attributes.key?(:'card_on_file_recurring_frequency')
163
- self.card_on_file_recurring_frequency = attributes[:'card_on_file_recurring_frequency']
164
- end
165
-
166
- if attributes.key?(:'card_on_file_recurring_expiration')
167
- self.card_on_file_recurring_expiration = attributes[:'card_on_file_recurring_expiration']
168
- end
169
- end
170
-
171
- # Checks equality by comparing each attribute.
172
- # @param [Object] Object to be compared
173
- def ==(o)
174
- return true if self.equal?(o)
175
- self.class == o.class &&
176
- authorization_mode == o.authorization_mode &&
177
- recurring == o.recurring &&
178
- payment_processing_token == o.payment_processing_token &&
179
- reporting_token == o.reporting_token &&
180
- transaction_channel == o.transaction_channel &&
181
- unscheduled_card_on_file_requestor == o.unscheduled_card_on_file_requestor &&
182
- unscheduled_card_on_file_sequence_indicator == o.unscheduled_card_on_file_sequence_indicator &&
183
- payment_product_id == o.payment_product_id &&
184
- card == o.card &&
185
- return_url == o.return_url &&
186
- card_on_file_recurring_frequency == o.card_on_file_recurring_frequency &&
187
- card_on_file_recurring_expiration == o.card_on_file_recurring_expiration
188
- end
189
-
190
- # @see the `==` method
191
- # @param [Object] Object to be compared
192
- def eql?(o)
193
- self == o
194
- end
195
-
196
- # Calculates hash code according to all attributes.
197
- # @return [Integer] Hash code
198
- def hash
199
- [authorization_mode, recurring, payment_processing_token, reporting_token, transaction_channel, unscheduled_card_on_file_requestor, unscheduled_card_on_file_sequence_indicator, payment_product_id, card, return_url, card_on_file_recurring_frequency, card_on_file_recurring_expiration].hash
200
- end
201
-
202
- # Builds the object from hash
203
- # @param [Hash] attributes Model attributes in the form of hash
204
- # @return [Object] Returns the model itself
205
- def self.build_from_hash(attributes)
206
- return nil unless attributes.is_a?(Hash)
207
- attributes = attributes.transform_keys(&:to_sym)
208
- transformed_hash = {}
209
- openapi_types.each_pair do |key, type|
210
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
211
- transformed_hash["#{key}"] = nil
212
- elsif type =~ /\AArray<(.*)>/i
213
- # check to ensure the input is an array given that the attribute
214
- # is documented as an array but the input is not
215
- if attributes[attribute_map[key]].is_a?(Array)
216
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
217
- end
218
- elsif !attributes[attribute_map[key]].nil?
219
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
220
- end
221
- end
222
- new(transformed_hash)
223
- end
224
-
225
- # Deserializes the data based on type
226
- # @param string type Data type
227
- # @param string value Value to be deserialized
228
- # @return [Object] Deserialized data
229
- def self._deserialize(type, value)
230
- case type.to_sym
231
- when :Time
232
- Time.parse(value)
233
- when :Date
234
- Date.parse(value)
235
- when :String
236
- value.to_s
237
- when :Integer
238
- value.to_i
239
- when :Float
240
- value.to_f
241
- when :Boolean
242
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
243
- true
244
- else
245
- false
246
- end
247
- when :Object
248
- # generic object (usually a Hash), return directly
249
- value
250
- when /\AArray<(?<inner_type>.+)>\z/
251
- inner_type = Regexp.last_match[:inner_type]
252
- value.map { |v| _deserialize(inner_type, v) }
253
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
254
- k_type = Regexp.last_match[:k_type]
255
- v_type = Regexp.last_match[:v_type]
256
- {}.tap do |hash|
257
- value.each do |k, v|
258
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
259
- end
260
- end
261
- else # model
262
- # models (e.g. Pet) or oneOf
263
- klass = PCPServerSDK::Models.const_get(type)
264
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
265
- end
266
- end
267
-
268
- # Returns the string representation of the object
269
- # @return [String] String presentation of the object
270
- def to_s
271
- to_hash.to_s
272
- end
273
-
274
- # to_body is an alias to to_hash (backward compatibility)
275
- # @return [Hash] Returns the object in the form of hash
276
- def to_body
277
- to_hash
278
- end
279
-
280
- # Returns the object in the form of hash
281
- # @return [Hash] Returns the object in the form of hash
282
- def to_hash
283
- hash = {}
284
- self.class.attribute_map.each_pair do |attr, param|
285
- value = self.send(attr)
286
- if value.nil?
287
- is_nullable = self.class.openapi_nullable.include?(attr)
288
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
289
- end
290
-
291
- hash[param] = _to_hash(value)
292
- end
293
- hash
294
- end
295
-
296
- # Outputs non-array value in the form of hash
297
- # For object, use to_hash. Otherwise, just return the value
298
- # @param [Object] value Any valid value
299
- # @return [Hash] Returns the value in the form of hash
300
- def _to_hash(value)
301
- if value.is_a?(Array)
302
- value.compact.map { |v| _to_hash(v) }
303
- elsif value.is_a?(Hash)
304
- {}.tap do |hash|
305
- value.each { |k, v| hash[k] = _to_hash(v) }
306
- end
307
- elsif value.respond_to? :to_hash
308
- value.to_hash
309
- else
310
- value
311
- end
312
- end
11
+ attribute :reporting_token, :reportingToken, :String
12
+ attribute :transaction_channel, :transactionChannel, :TransactionChannel
13
+ attribute :unscheduled_card_on_file_requestor, :unscheduledCardOnFileRequestor, :UnscheduledCardOnFileRequestor
14
+ attribute :unscheduled_card_on_file_sequence_indicator, :unscheduledCardOnFileSequenceIndicator, :UnscheduledCardOnFileSequenceIndicator
15
+ attribute :payment_product_id, :paymentProductId, :Integer
16
+ attribute :card, :card, :CardInfo
17
+ # The URL that the customer is redirect to after the payment flow has finished. You can add any number of key
18
+ # value pairs in the query string that, for instance help you to identify the customer when they return to
19
+ # your site. Please note that we will also append some additional key value pairs that will also help you with
20
+ # this identification process.
21
+ # Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use
22
+ # on mobile devices a custom protocol can be used in the form of protocol://. This protocol must be registered
23
+ # on the device first.
24
+ # URLs without a protocol will be rejected.
25
+ attribute :return_url, :returnUrl, :String
26
+ # Period of payment occurrence for recurring and installment payments. Allowed values:
27
+ # * Yearly
28
+ # * Quarterly
29
+ # * Monthly
30
+ #
31
+ # * Weekly
32
+ # * Daily
33
+ # Supported soon
34
+ attribute :card_on_file_recurring_frequency, :cardOnFileRecurringFrequency, :String, enum: ["Yearly", "Quarterly", "Monthly", "Weekly", "Daily"]
35
+ # The end date of the last scheduled payment in a series of transactions.
36
+ # Format YYYYMMDD Supported soon
37
+ attribute :card_on_file_recurring_expiration, :cardOnFileRecurringExpiration, :String
313
38
  end
314
39
  end
315
40
  end