wire4_client 1.0.3 → 1.0.5

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 (157) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -7
  3. data/docs/Account.md +3 -3
  4. data/docs/AccountDetail.md +13 -0
  5. data/docs/AccountReassigned.md +21 -0
  6. data/docs/AccountResponse.md +4 -3
  7. data/docs/AddressCompany.md +17 -0
  8. data/docs/AmountRequest.md +2 -0
  9. data/docs/AuthorizationTransactionGroup.md +9 -0
  10. data/docs/AuthorizedBeneficiariesResponse.md +10 -0
  11. data/docs/AuthorizedUsers.md +13 -0
  12. data/docs/CertificateRequest.md +11 -0
  13. data/docs/CodiCodeQrResponseDTO.md +17 -0
  14. data/docs/CodiCodeRequestDTO.md +14 -0
  15. data/docs/CodiOperationResponseDTO.md +14 -0
  16. data/docs/CodiOperationsFiltersRequestDTO.md +15 -0
  17. data/docs/CompanyRegistered.md +13 -0
  18. data/docs/CompanyRequested.md +11 -0
  19. data/docs/Compay.md +11 -0
  20. data/docs/ContractDetailRequest.md +11 -0
  21. data/docs/ContractDetailResponse.md +9 -0
  22. data/docs/ContractsDetailsApi.md +167 -0
  23. data/docs/CuentasDeBeneficiariosSPEIApi.md +69 -4
  24. data/docs/CuentasDeBeneficiariosSPIDApi.md +11 -1
  25. data/docs/EmpresasCoDiApi.md +107 -0
  26. data/docs/MessageAccountBeneficiary.md +2 -2
  27. data/docs/MessageCEP.md +9 -9
  28. data/docs/MessageCodiAction.md +19 -0
  29. data/docs/MessagePayment.md +3 -1
  30. data/docs/MessagePaymentStatePending.md +23 -0
  31. data/docs/MessageRequestChanged.md +2 -2
  32. data/docs/MessageSalesPoint.md +10 -0
  33. data/docs/MessageSubscription.md +6 -6
  34. data/docs/MessageUserAuthorized.md +13 -0
  35. data/docs/MessageWebHook.md +2 -2
  36. data/docs/OperacionesCoDiApi.md +68 -0
  37. data/docs/Operations.md +17 -0
  38. data/docs/PagerResponseDto.md +13 -0
  39. data/docs/Payment.md +3 -1
  40. data/docs/PaymentRequestCodiResponseDTO.md +18 -0
  41. data/docs/PeticionesDePagoPorCoDiApi.md +116 -0
  42. data/docs/PreMonexAuthorization.md +11 -0
  43. data/docs/PuntosDeVentaCoDiApi.md +113 -0
  44. data/docs/SalesPoint.md +10 -0
  45. data/docs/SalesPointFound.md +14 -0
  46. data/docs/SalesPointRequest.md +11 -0
  47. data/docs/SalesPointRespose.md +11 -0
  48. data/docs/SpidBeneficiaryResponse.md +2 -0
  49. data/docs/SuscripcionesApi.md +14 -14
  50. data/docs/TransactionOutgoing.md +2 -1
  51. data/docs/TransferenciasSPEIApi.md +60 -2
  52. data/docs/UrlsRedirect.md +9 -0
  53. data/docs/UserCompany.md +16 -0
  54. data/docs/Webhook.md +13 -0
  55. data/lib/wire4_client.rb +36 -0
  56. data/lib/wire4_client/api/contracts_details_api.rb +230 -0
  57. data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +100 -5
  58. data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +15 -0
  59. data/lib/wire4_client/api/empresas_co_di_api.rb +137 -0
  60. data/lib/wire4_client/api/operaciones_co_di_api.rb +92 -0
  61. data/lib/wire4_client/api/peticiones_de_pago_por_co_di_api.rb +178 -0
  62. data/lib/wire4_client/api/puntos_de_venta_co_di_api.rb +151 -0
  63. data/lib/wire4_client/api/suscripciones_api.rb +14 -14
  64. data/lib/wire4_client/api/transferencias_spei_api.rb +82 -0
  65. data/lib/wire4_client/models/account.rb +3 -3
  66. data/lib/wire4_client/models/account_detail.rb +239 -0
  67. data/lib/wire4_client/models/account_reassigned.rb +375 -0
  68. data/lib/wire4_client/models/account_response.rb +14 -4
  69. data/lib/wire4_client/models/address_company.rb +275 -0
  70. data/lib/wire4_client/models/amount_request.rb +90 -4
  71. data/lib/wire4_client/models/authorization_transaction_group.rb +207 -0
  72. data/lib/wire4_client/models/authorized_beneficiaries_response.rb +206 -0
  73. data/lib/wire4_client/models/authorized_users.rb +235 -0
  74. data/lib/wire4_client/models/certificate_request.rb +248 -0
  75. data/lib/wire4_client/models/codi_code_qr_response_dto.rb +320 -0
  76. data/lib/wire4_client/models/codi_code_request_dto.rb +402 -0
  77. data/lib/wire4_client/models/codi_operation_response_dto.rb +245 -0
  78. data/lib/wire4_client/models/codi_operations_filters_request_dto.rb +336 -0
  79. data/lib/wire4_client/models/company_registered.rb +235 -0
  80. data/lib/wire4_client/models/company_requested.rb +215 -0
  81. data/lib/wire4_client/models/compay.rb +215 -0
  82. data/lib/wire4_client/models/contract_detail_request.rb +247 -0
  83. data/lib/wire4_client/models/contract_detail_response.rb +194 -0
  84. data/lib/wire4_client/models/message_account_beneficiary.rb +2 -2
  85. data/lib/wire4_client/models/message_cep.rb +10 -10
  86. data/lib/wire4_client/models/message_codi_action.rb +295 -0
  87. data/lib/wire4_client/models/message_deposit_received.rb +1 -1
  88. data/lib/wire4_client/models/message_payment.rb +23 -2
  89. data/lib/wire4_client/models/message_payment_state_pending.rb +335 -0
  90. data/lib/wire4_client/models/message_request_changed.rb +3 -3
  91. data/lib/wire4_client/models/message_sales_point.rb +205 -0
  92. data/lib/wire4_client/models/message_subscription.rb +7 -7
  93. data/lib/wire4_client/models/message_user_authorized.rb +235 -0
  94. data/lib/wire4_client/models/message_web_hook.rb +2 -2
  95. data/lib/wire4_client/models/operations.rb +321 -0
  96. data/lib/wire4_client/models/pager_response_dto.rb +236 -0
  97. data/lib/wire4_client/models/payment.rb +22 -2
  98. data/lib/wire4_client/models/payment_request_codi_response_dto.rb +287 -0
  99. data/lib/wire4_client/models/pre_monex_authorization.rb +291 -0
  100. data/lib/wire4_client/models/sales_point.rb +205 -0
  101. data/lib/wire4_client/models/sales_point_found.rb +279 -0
  102. data/lib/wire4_client/models/sales_point_request.rb +254 -0
  103. data/lib/wire4_client/models/sales_point_respose.rb +215 -0
  104. data/lib/wire4_client/models/spid_beneficiary_response.rb +24 -4
  105. data/lib/wire4_client/models/transaction_outgoing.rb +12 -2
  106. data/lib/wire4_client/models/urls_redirect.rb +205 -0
  107. data/lib/wire4_client/models/user_company.rb +269 -0
  108. data/lib/wire4_client/models/webhook.rb +271 -0
  109. data/lib/wire4_client/version.rb +1 -1
  110. data/spec/api/contracts_details_api_spec.rb +76 -0
  111. data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +20 -1
  112. data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +5 -0
  113. data/spec/api/empresas_co_di_api_spec.rb +60 -0
  114. data/spec/api/operaciones_co_di_api_spec.rb +52 -0
  115. data/spec/api/peticiones_de_pago_por_co_di_api_spec.rb +63 -0
  116. data/spec/api/puntos_de_venta_co_di_api_spec.rb +62 -0
  117. data/spec/api/suscripciones_api_spec.rb +7 -7
  118. data/spec/api/transferencias_spei_api_spec.rb +15 -0
  119. data/spec/models/account_detail_spec.rb +71 -0
  120. data/spec/models/account_reassigned_spec.rb +119 -0
  121. data/spec/models/account_response_spec.rb +6 -0
  122. data/spec/models/address_company_spec.rb +95 -0
  123. data/spec/models/amount_request_spec.rb +12 -0
  124. data/spec/models/authorization_transaction_group_spec.rb +47 -0
  125. data/spec/models/authorized_beneficiaries_response_spec.rb +53 -0
  126. data/spec/models/authorized_users_spec.rb +71 -0
  127. data/spec/models/certificate_request_spec.rb +59 -0
  128. data/spec/models/codi_code_qr_response_dto_spec.rb +103 -0
  129. data/spec/models/codi_code_request_dto_spec.rb +81 -0
  130. data/spec/models/codi_operation_response_dto_spec.rb +77 -0
  131. data/spec/models/codi_operations_filters_request_dto_spec.rb +87 -0
  132. data/spec/models/company_registered_spec.rb +71 -0
  133. data/spec/models/company_requested_spec.rb +59 -0
  134. data/spec/models/compay_spec.rb +59 -0
  135. data/spec/models/contract_detail_request_spec.rb +59 -0
  136. data/spec/models/contract_detail_response_spec.rb +47 -0
  137. data/spec/models/message_codi_action_spec.rb +107 -0
  138. data/spec/models/message_payment_spec.rb +12 -0
  139. data/spec/models/message_payment_state_pending_spec.rb +131 -0
  140. data/spec/models/message_sales_point_spec.rb +53 -0
  141. data/spec/models/message_user_authorized_spec.rb +71 -0
  142. data/spec/models/operations_spec.rb +103 -0
  143. data/spec/models/pager_response_dto_spec.rb +71 -0
  144. data/spec/models/payment_request_codi_response_dto_spec.rb +101 -0
  145. data/spec/models/payment_spec.rb +12 -0
  146. data/spec/models/pre_monex_authorization_spec.rb +59 -0
  147. data/spec/models/sales_point_found_spec.rb +81 -0
  148. data/spec/models/sales_point_request_spec.rb +59 -0
  149. data/spec/models/sales_point_respose_spec.rb +59 -0
  150. data/spec/models/sales_point_spec.rb +53 -0
  151. data/spec/models/spid_beneficiary_response_spec.rb +12 -0
  152. data/spec/models/transaction_outgoing_spec.rb +6 -0
  153. data/spec/models/urls_redirect_spec.rb +47 -0
  154. data/spec/models/user_company_spec.rb +89 -0
  155. data/spec/models/webhook_spec.rb +75 -0
  156. metadata +146 -3
  157. data/Gemfile.lock +0 -69
@@ -0,0 +1,236 @@
1
+ =begin
2
+ #Wire4RestAPI
3
+
4
+ #Referencia de la API de Wire4
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.10
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Wire4Client
16
+ class PagerResponseDto
17
+ # Contenido de la respuesta paginada
18
+ attr_accessor :content
19
+
20
+ # Numero de elementos en la pagina
21
+ attr_accessor :number_of_elements
22
+
23
+ # Número de pagina
24
+ attr_accessor :page
25
+
26
+ # Tamaño de la pagina
27
+ attr_accessor :size
28
+
29
+ # Numero total de elementos de la consulta
30
+ attr_accessor :total_items
31
+
32
+ # Numero total de paginas
33
+ attr_accessor :total_pages
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'content' => :'content',
39
+ :'number_of_elements' => :'number_of_elements',
40
+ :'page' => :'page',
41
+ :'size' => :'size',
42
+ :'total_items' => :'total_items',
43
+ :'total_pages' => :'total_pages'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'content' => :'Array<Operations>',
51
+ :'number_of_elements' => :'Integer',
52
+ :'page' => :'Integer',
53
+ :'size' => :'Integer',
54
+ :'total_items' => :'Integer',
55
+ :'total_pages' => :'Integer'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ if attributes.has_key?(:'content')
68
+ if (value = attributes[:'content']).is_a?(Array)
69
+ self.content = value
70
+ end
71
+ end
72
+
73
+ if attributes.has_key?(:'number_of_elements')
74
+ self.number_of_elements = attributes[:'number_of_elements']
75
+ end
76
+
77
+ if attributes.has_key?(:'page')
78
+ self.page = attributes[:'page']
79
+ end
80
+
81
+ if attributes.has_key?(:'size')
82
+ self.size = attributes[:'size']
83
+ end
84
+
85
+ if attributes.has_key?(:'total_items')
86
+ self.total_items = attributes[:'total_items']
87
+ end
88
+
89
+ if attributes.has_key?(:'total_pages')
90
+ self.total_pages = attributes[:'total_pages']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ content == o.content &&
113
+ number_of_elements == o.number_of_elements &&
114
+ page == o.page &&
115
+ size == o.size &&
116
+ total_items == o.total_items &&
117
+ total_pages == o.total_pages
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [content, number_of_elements, page, size, total_items, total_pages].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = Wire4Client.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+ end
236
+ end
@@ -29,7 +29,7 @@ module Wire4Client
29
29
  # Nombre del Beneficiario
30
30
  attr_accessor :beneficiary_name
31
31
 
32
- # CEP emitido por Banxico de la transferencia, sólo en caso de que este disponible en banxico, posteriomente podrá usar la consulta de CEP del API
32
+ # CEP emitido por Banxico de la transferencia, sólo en caso de que este disponible en Banxico, posteriomente podrá usar la consulta de CEP del API
33
33
  attr_accessor :cep
34
34
 
35
35
  # Clave de rastreo de la transferencia
@@ -47,6 +47,9 @@ module Wire4Client
47
47
  # Mensaje proporcionado por Monex para la transferencia
48
48
  attr_accessor :detention_message
49
49
 
50
+ # Mensaje de error, en caso de algún error se informará aquí
51
+ attr_accessor :error_message
52
+
50
53
  # Descripción
51
54
  attr_accessor :monex_description
52
55
 
@@ -56,6 +59,9 @@ module Wire4Client
56
59
  # Identificador de la orden de pago en Monex
57
60
  attr_accessor :payment_order_id
58
61
 
62
+ # Razón de porque esta pendiente aun cuando se autorizó la transferencia
63
+ attr_accessor :pending_reason
64
+
59
65
  # Referencia numérica
60
66
  attr_accessor :reference
61
67
 
@@ -79,9 +85,11 @@ module Wire4Client
79
85
  :'confirm_date' => :'confirm_date',
80
86
  :'currency_code' => :'currency_code',
81
87
  :'detention_message' => :'detention_message',
88
+ :'error_message' => :'error_message',
82
89
  :'monex_description' => :'monex_description',
83
90
  :'order_id' => :'order_id',
84
91
  :'payment_order_id' => :'payment_order_id',
92
+ :'pending_reason' => :'pending_reason',
85
93
  :'reference' => :'reference',
86
94
  :'status_code' => :'status_code',
87
95
  :'transaction_id' => :'transaction_id'
@@ -102,9 +110,11 @@ module Wire4Client
102
110
  :'confirm_date' => :'DateTime',
103
111
  :'currency_code' => :'String',
104
112
  :'detention_message' => :'String',
113
+ :'error_message' => :'String',
105
114
  :'monex_description' => :'String',
106
115
  :'order_id' => :'String',
107
116
  :'payment_order_id' => :'Integer',
117
+ :'pending_reason' => :'String',
108
118
  :'reference' => :'Integer',
109
119
  :'status_code' => :'String',
110
120
  :'transaction_id' => :'Integer'
@@ -163,6 +173,10 @@ module Wire4Client
163
173
  self.detention_message = attributes[:'detention_message']
164
174
  end
165
175
 
176
+ if attributes.has_key?(:'error_message')
177
+ self.error_message = attributes[:'error_message']
178
+ end
179
+
166
180
  if attributes.has_key?(:'monex_description')
167
181
  self.monex_description = attributes[:'monex_description']
168
182
  end
@@ -175,6 +189,10 @@ module Wire4Client
175
189
  self.payment_order_id = attributes[:'payment_order_id']
176
190
  end
177
191
 
192
+ if attributes.has_key?(:'pending_reason')
193
+ self.pending_reason = attributes[:'pending_reason']
194
+ end
195
+
178
196
  if attributes.has_key?(:'reference')
179
197
  self.reference = attributes[:'reference']
180
198
  end
@@ -217,9 +235,11 @@ module Wire4Client
217
235
  confirm_date == o.confirm_date &&
218
236
  currency_code == o.currency_code &&
219
237
  detention_message == o.detention_message &&
238
+ error_message == o.error_message &&
220
239
  monex_description == o.monex_description &&
221
240
  order_id == o.order_id &&
222
241
  payment_order_id == o.payment_order_id &&
242
+ pending_reason == o.pending_reason &&
223
243
  reference == o.reference &&
224
244
  status_code == o.status_code &&
225
245
  transaction_id == o.transaction_id
@@ -234,7 +254,7 @@ module Wire4Client
234
254
  # Calculates hash code according to all attributes.
235
255
  # @return [Fixnum] Hash code
236
256
  def hash
237
- [account, amount, beneficiary_account, beneficiary_bank, beneficiary_name, cep, clave_rastreo, concept, confirm_date, currency_code, detention_message, monex_description, order_id, payment_order_id, reference, status_code, transaction_id].hash
257
+ [account, amount, beneficiary_account, beneficiary_bank, beneficiary_name, cep, clave_rastreo, concept, confirm_date, currency_code, detention_message, error_message, monex_description, order_id, payment_order_id, pending_reason, reference, status_code, transaction_id].hash
238
258
  end
239
259
 
240
260
  # Builds the object from hash
@@ -0,0 +1,287 @@
1
+ =begin
2
+ #Wire4RestAPI
3
+
4
+ #Referencia de la API de Wire4
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.10
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Wire4Client
16
+ # Objeto que contiene la información de solicitud de pago por CODI®.
17
+ class PaymentRequestCodiResponseDTO
18
+ # Monto del pago.
19
+ attr_accessor :amount
20
+
21
+ # Imagen QR en formato Base64 para el CODI®.
22
+ attr_accessor :barcode_base64
23
+
24
+ # URL de la imagen QR para el CODI®.
25
+ attr_accessor :barcode_url
26
+
27
+ # Concepto de pago.
28
+ attr_accessor :concept
29
+
30
+ # Fecha de creación.
31
+ attr_accessor :creation_date
32
+
33
+ # Fecha de vencimiento.
34
+ attr_accessor :due_date
35
+
36
+ # Listado de pagos realizados sobre la petición.
37
+ attr_accessor :operations
38
+
39
+ # OrderId asignada a la solicitud.
40
+ attr_accessor :order_id
41
+
42
+ # Numero de teléfono.
43
+ attr_accessor :phone_number
44
+
45
+ # Estatus de la orden de pago.
46
+ attr_accessor :status
47
+
48
+ # Tipo de petición.
49
+ attr_accessor :type
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'amount' => :'amount',
55
+ :'barcode_base64' => :'barcode_base64',
56
+ :'barcode_url' => :'barcode_url',
57
+ :'concept' => :'concept',
58
+ :'creation_date' => :'creation_date',
59
+ :'due_date' => :'due_date',
60
+ :'operations' => :'operations',
61
+ :'order_id' => :'order_id',
62
+ :'phone_number' => :'phone_number',
63
+ :'status' => :'status',
64
+ :'type' => :'type'
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'amount' => :'Float',
72
+ :'barcode_base64' => :'String',
73
+ :'barcode_url' => :'String',
74
+ :'concept' => :'String',
75
+ :'creation_date' => :'DateTime',
76
+ :'due_date' => :'DateTime',
77
+ :'operations' => :'Array<CodiOperationResponseDTO>',
78
+ :'order_id' => :'String',
79
+ :'phone_number' => :'String',
80
+ :'status' => :'String',
81
+ :'type' => :'String'
82
+ }
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ return unless attributes.is_a?(Hash)
89
+
90
+ # convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
92
+
93
+ if attributes.has_key?(:'amount')
94
+ self.amount = attributes[:'amount']
95
+ end
96
+
97
+ if attributes.has_key?(:'barcode_base64')
98
+ self.barcode_base64 = attributes[:'barcode_base64']
99
+ end
100
+
101
+ if attributes.has_key?(:'barcode_url')
102
+ self.barcode_url = attributes[:'barcode_url']
103
+ end
104
+
105
+ if attributes.has_key?(:'concept')
106
+ self.concept = attributes[:'concept']
107
+ end
108
+
109
+ if attributes.has_key?(:'creation_date')
110
+ self.creation_date = attributes[:'creation_date']
111
+ end
112
+
113
+ if attributes.has_key?(:'due_date')
114
+ self.due_date = attributes[:'due_date']
115
+ end
116
+
117
+ if attributes.has_key?(:'operations')
118
+ if (value = attributes[:'operations']).is_a?(Array)
119
+ self.operations = value
120
+ end
121
+ end
122
+
123
+ if attributes.has_key?(:'order_id')
124
+ self.order_id = attributes[:'order_id']
125
+ end
126
+
127
+ if attributes.has_key?(:'phone_number')
128
+ self.phone_number = attributes[:'phone_number']
129
+ end
130
+
131
+ if attributes.has_key?(:'status')
132
+ self.status = attributes[:'status']
133
+ end
134
+
135
+ if attributes.has_key?(:'type')
136
+ self.type = attributes[:'type']
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ invalid_properties = Array.new
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ amount == o.amount &&
159
+ barcode_base64 == o.barcode_base64 &&
160
+ barcode_url == o.barcode_url &&
161
+ concept == o.concept &&
162
+ creation_date == o.creation_date &&
163
+ due_date == o.due_date &&
164
+ operations == o.operations &&
165
+ order_id == o.order_id &&
166
+ phone_number == o.phone_number &&
167
+ status == o.status &&
168
+ type == o.type
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Fixnum] Hash code
179
+ def hash
180
+ [amount, barcode_base64, barcode_url, concept, creation_date, due_date, operations, order_id, phone_number, status, type].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ self.class.swagger_types.each_pair do |key, type|
189
+ if type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
193
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
194
+ end
195
+ elsif !attributes[self.class.attribute_map[key]].nil?
196
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :DateTime
210
+ DateTime.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :BOOLEAN
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ temp_model = Wire4Client.const_get(type).new
241
+ temp_model.build_from_hash(value)
242
+ end
243
+ end
244
+
245
+ # Returns the string representation of the object
246
+ # @return [String] String presentation of the object
247
+ def to_s
248
+ to_hash.to_s
249
+ end
250
+
251
+ # to_body is an alias to to_hash (backward compatibility)
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_body
254
+ to_hash
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = self.send(attr)
263
+ next if value.nil?
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+ end
287
+ end