conekta 7.0.1 → 7.0.3

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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -8
  3. data/VERSION +1 -1
  4. data/config-ruby.json +1 -1
  5. data/docs/ChargeOrderResponsePaymentMethod.md +5 -2
  6. data/docs/ChargeRequestPaymentMethod.md +3 -1
  7. data/docs/ChargeResponsePaymentMethod.md +5 -2
  8. data/docs/ChargesApi.md +2 -2
  9. data/docs/CheckoutRequest.md +1 -1
  10. data/docs/CompaniesApi.md +296 -0
  11. data/docs/CompanyDocumentRequest.md +26 -0
  12. data/docs/CompanyDocumentResponse.md +22 -0
  13. data/docs/CompanyResponse.md +18 -16
  14. data/docs/CompanyResponseDocumentsInner.md +22 -0
  15. data/docs/CreateCompanyRequest.md +26 -0
  16. data/docs/CreateCompanyRequestBankAccountInfo.md +18 -0
  17. data/docs/CreateCompanyRequestComercialInfo.md +24 -0
  18. data/docs/CreateCompanyRequestFiscalInfo.md +20 -0
  19. data/docs/CreateCustomerPaymentMethodsResponse.md +3 -2
  20. data/docs/CustomerPaymentMethodRequest.md +1 -1
  21. data/docs/CustomerPaymentMethodsData.md +3 -2
  22. data/docs/EventsResendResponse.md +1 -1
  23. data/docs/GetCustomerPaymentMethodDataResponse.md +3 -2
  24. data/docs/OrderResponseCheckout.md +1 -1
  25. data/docs/PaymentMethodBnplRequest.md +1 -1
  26. data/docs/PaymentMethodCardRequest.md +1 -1
  27. data/docs/PaymentMethodCashRecurrentResponse.md +38 -0
  28. data/docs/PaymentMethodCashRequest.md +1 -1
  29. data/docs/PaymentMethodPbbPayment.md +30 -0
  30. data/docs/PaymentMethodPbbRequest.md +22 -0
  31. data/docs/PaymentMethodSpeiRecurrent.md +2 -0
  32. data/docs/PaymentMethodSpeiRequest.md +1 -1
  33. data/docs/PaymentMethodTokenRequest.md +1 -1
  34. data/docs/PaymentMethodsApi.md +1 -1
  35. data/docs/UpdateCustomerPaymentMethodsResponse.md +3 -2
  36. data/docs/UpdatePaymentMethods.md +4 -2
  37. data/docs/WebhookLog.md +1 -1
  38. data/docs/WebhookResponse.md +1 -1
  39. data/examples/README.md +15 -0
  40. data/examples/one_time_charge_bnpl.rb +49 -0
  41. data/examples/one_time_charge_pbb.rb +47 -0
  42. data/lib/conekta/api/companies_api.rb +300 -0
  43. data/lib/conekta/models/charge_order_response_payment_method.rb +4 -2
  44. data/lib/conekta/models/charge_request_payment_method.rb +2 -1
  45. data/lib/conekta/models/charge_response_payment_method.rb +4 -2
  46. data/lib/conekta/models/company_document_request.rb +318 -0
  47. data/lib/conekta/models/company_document_response.rb +291 -0
  48. data/lib/conekta/models/company_response.rb +110 -74
  49. data/lib/conekta/models/company_response_documents_inner.rb +270 -0
  50. data/lib/conekta/models/create_company_request.rb +252 -0
  51. data/lib/conekta/models/create_company_request_bank_account_info.rb +216 -0
  52. data/lib/conekta/models/create_company_request_comercial_info.rb +246 -0
  53. data/lib/conekta/models/create_company_request_fiscal_info.rb +226 -0
  54. data/lib/conekta/models/create_customer_payment_methods_response.rb +2 -2
  55. data/lib/conekta/models/customer_payment_methods_data.rb +2 -2
  56. data/lib/conekta/models/get_customer_payment_method_data_response.rb +2 -2
  57. data/lib/conekta/models/payment_method_bnpl_request.rb +2 -2
  58. data/lib/conekta/models/payment_method_cash_recurrent_response.rb +343 -0
  59. data/lib/conekta/models/payment_method_pbb_payment.rb +341 -0
  60. data/lib/conekta/models/payment_method_pbb_request.rb +309 -0
  61. data/lib/conekta/models/payment_method_spei_recurrent.rb +11 -1
  62. data/lib/conekta/models/update_customer_payment_methods_response.rb +2 -2
  63. data/lib/conekta/models/update_payment_methods.rb +34 -4
  64. data/lib/conekta/version.rb +1 -1
  65. data/lib/conekta.rb +10 -3
  66. data/spec/api/companies_api_spec.rb +53 -0
  67. metadata +42 -22
  68. data/docs/CompanyFiscalInfoAddressResponse.md +0 -34
  69. data/docs/CompanyFiscalInfoResponse.md +0 -30
  70. data/docs/CompanyPayoutDestinationResponse.md +0 -28
@@ -20,6 +20,7 @@ module Conekta
20
20
  def openapi_one_of
21
21
  [
22
22
  :'PaymentMethodCardResponse',
23
+ :'PaymentMethodCashRecurrentResponse',
23
24
  :'PaymentMethodCashResponse',
24
25
  :'PaymentMethodSpeiRecurrent'
25
26
  ]
@@ -35,8 +36,7 @@ module Conekta
35
36
  {
36
37
  :'card' => :'PaymentMethodCardResponse',
37
38
  :'cash' => :'PaymentMethodCashResponse',
38
- :'cash_recurrent' => :'PaymentMethodCashResponse',
39
- :'oxxo_recurrent' => :'PaymentMethodCashResponse',
39
+ :'cash_recurrent' => :'PaymentMethodCashRecurrentResponse',
40
40
  :'spei_recurrent' => :'PaymentMethodSpeiRecurrent'
41
41
  }
42
42
  end
@@ -20,6 +20,7 @@ module Conekta
20
20
  def openapi_one_of
21
21
  [
22
22
  :'PaymentMethodCardResponse',
23
+ :'PaymentMethodCashRecurrentResponse',
23
24
  :'PaymentMethodCashResponse',
24
25
  :'PaymentMethodSpeiRecurrent'
25
26
  ]
@@ -35,8 +36,7 @@ module Conekta
35
36
  {
36
37
  :'card' => :'PaymentMethodCardResponse',
37
38
  :'cash' => :'PaymentMethodCashResponse',
38
- :'cash_recurrent' => :'PaymentMethodCashResponse',
39
- :'oxxo_recurrent' => :'PaymentMethodCashResponse',
39
+ :'cash_recurrent' => :'PaymentMethodCashRecurrentResponse',
40
40
  :'spei_recurrent' => :'PaymentMethodSpeiRecurrent'
41
41
  }
42
42
  end
@@ -190,7 +190,7 @@ module Conekta
190
190
  return false if @can_not_expire.nil?
191
191
  return false if @failure_url.nil?
192
192
  return false if @product_type.nil?
193
- product_type_validator = EnumAttributeValidator.new('String', ["klarna_bnpl", "creditea_bnpl"])
193
+ product_type_validator = EnumAttributeValidator.new('String', ["aplazo_bnpl", "creditea_bnpl"])
194
194
  return false unless product_type_validator.valid?(@product_type)
195
195
  return false if @success_url.nil?
196
196
  true
@@ -199,7 +199,7 @@ module Conekta
199
199
  # Custom attribute writer method checking allowed values (enum).
200
200
  # @param [Object] product_type Object to be assigned
201
201
  def product_type=(product_type)
202
- validator = EnumAttributeValidator.new('String', ["klarna_bnpl", "creditea_bnpl"])
202
+ validator = EnumAttributeValidator.new('String', ["aplazo_bnpl", "creditea_bnpl"])
203
203
  unless validator.valid?(product_type)
204
204
  fail ArgumentError, "invalid value for \"product_type\", must be one of #{validator.allowable_values}."
205
205
  end
@@ -0,0 +1,343 @@
1
+ =begin
2
+ #Conekta API
3
+
4
+ #Conekta sdk
5
+
6
+ The version of the OpenAPI document: 2.2.0
7
+ Contact: engineering@conekta.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Conekta
17
+ # Alias of cash response used when type=cash_recurrent
18
+ class PaymentMethodCashRecurrentResponse
19
+ attr_accessor :type
20
+
21
+ attr_accessor :id
22
+
23
+ attr_accessor :object
24
+
25
+ attr_accessor :created_at
26
+
27
+ attr_accessor :parent_id
28
+
29
+ attr_accessor :agreements
30
+
31
+ attr_accessor :reference
32
+
33
+ attr_accessor :barcode
34
+
35
+ # URL to the barcode image, reference is the same as barcode
36
+ attr_accessor :barcode_url
37
+
38
+ attr_accessor :expires_at
39
+
40
+ attr_accessor :provider
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'type' => :'type',
46
+ :'id' => :'id',
47
+ :'object' => :'object',
48
+ :'created_at' => :'created_at',
49
+ :'parent_id' => :'parent_id',
50
+ :'agreements' => :'agreements',
51
+ :'reference' => :'reference',
52
+ :'barcode' => :'barcode',
53
+ :'barcode_url' => :'barcode_url',
54
+ :'expires_at' => :'expires_at',
55
+ :'provider' => :'provider'
56
+ }
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'type' => :'String',
68
+ :'id' => :'String',
69
+ :'object' => :'String',
70
+ :'created_at' => :'Integer',
71
+ :'parent_id' => :'String',
72
+ :'agreements' => :'Array<PaymentMethodCashResponseAllOfAgreements>',
73
+ :'reference' => :'String',
74
+ :'barcode' => :'String',
75
+ :'barcode_url' => :'String',
76
+ :'expires_at' => :'Integer',
77
+ :'provider' => :'String'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ ])
85
+ end
86
+
87
+ # List of class defined in allOf (OpenAPI v3)
88
+ def self.openapi_all_of
89
+ [
90
+ :'PaymentMethodCashResponse'
91
+ ]
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::PaymentMethodCashRecurrentResponse` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::PaymentMethodCashRecurrentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'type')
110
+ self.type = attributes[:'type']
111
+ else
112
+ self.type = nil
113
+ end
114
+
115
+ if attributes.key?(:'id')
116
+ self.id = attributes[:'id']
117
+ else
118
+ self.id = nil
119
+ end
120
+
121
+ if attributes.key?(:'object')
122
+ self.object = attributes[:'object']
123
+ else
124
+ self.object = nil
125
+ end
126
+
127
+ if attributes.key?(:'created_at')
128
+ self.created_at = attributes[:'created_at']
129
+ else
130
+ self.created_at = nil
131
+ end
132
+
133
+ if attributes.key?(:'parent_id')
134
+ self.parent_id = attributes[:'parent_id']
135
+ end
136
+
137
+ if attributes.key?(:'agreements')
138
+ if (value = attributes[:'agreements']).is_a?(Array)
139
+ self.agreements = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'reference')
144
+ self.reference = attributes[:'reference']
145
+ end
146
+
147
+ if attributes.key?(:'barcode')
148
+ self.barcode = attributes[:'barcode']
149
+ end
150
+
151
+ if attributes.key?(:'barcode_url')
152
+ self.barcode_url = attributes[:'barcode_url']
153
+ end
154
+
155
+ if attributes.key?(:'expires_at')
156
+ self.expires_at = attributes[:'expires_at']
157
+ end
158
+
159
+ if attributes.key?(:'provider')
160
+ self.provider = attributes[:'provider']
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @type.nil?
170
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
171
+ end
172
+
173
+ if @id.nil?
174
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
175
+ end
176
+
177
+ if @object.nil?
178
+ invalid_properties.push('invalid value for "object", object cannot be nil.')
179
+ end
180
+
181
+ if @created_at.nil?
182
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
183
+ end
184
+
185
+ invalid_properties
186
+ end
187
+
188
+ # Check to see if the all the properties in the model are valid
189
+ # @return true if the model is valid
190
+ def valid?
191
+ warn '[DEPRECATED] the `valid?` method is obsolete'
192
+ return false if @type.nil?
193
+ return false if @id.nil?
194
+ return false if @object.nil?
195
+ return false if @created_at.nil?
196
+ true
197
+ end
198
+
199
+ # Checks equality by comparing each attribute.
200
+ # @param [Object] Object to be compared
201
+ def ==(o)
202
+ return true if self.equal?(o)
203
+ self.class == o.class &&
204
+ type == o.type &&
205
+ id == o.id &&
206
+ object == o.object &&
207
+ created_at == o.created_at &&
208
+ parent_id == o.parent_id &&
209
+ agreements == o.agreements &&
210
+ reference == o.reference &&
211
+ barcode == o.barcode &&
212
+ barcode_url == o.barcode_url &&
213
+ expires_at == o.expires_at &&
214
+ provider == o.provider
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [type, id, object, created_at, parent_id, agreements, reference, barcode, barcode_url, expires_at, provider].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ return nil unless attributes.is_a?(Hash)
234
+ attributes = attributes.transform_keys(&:to_sym)
235
+ transformed_hash = {}
236
+ openapi_types.each_pair do |key, type|
237
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
238
+ transformed_hash["#{key}"] = nil
239
+ elsif type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[attribute_map[key]].is_a?(Array)
243
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
244
+ end
245
+ elsif !attributes[attribute_map[key]].nil?
246
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
247
+ end
248
+ end
249
+ new(transformed_hash)
250
+ end
251
+
252
+ # Deserializes the data based on type
253
+ # @param string type Data type
254
+ # @param string value Value to be deserialized
255
+ # @return [Object] Deserialized data
256
+ def self._deserialize(type, value)
257
+ case type.to_sym
258
+ when :Time
259
+ Time.parse(value)
260
+ when :Date
261
+ Date.parse(value)
262
+ when :String
263
+ value.to_s
264
+ when :Integer
265
+ value.to_i
266
+ when :Float
267
+ value.to_f
268
+ when :Boolean
269
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
270
+ true
271
+ else
272
+ false
273
+ end
274
+ when :Object
275
+ # generic object (usually a Hash), return directly
276
+ value
277
+ when /\AArray<(?<inner_type>.+)>\z/
278
+ inner_type = Regexp.last_match[:inner_type]
279
+ value.map { |v| _deserialize(inner_type, v) }
280
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
281
+ k_type = Regexp.last_match[:k_type]
282
+ v_type = Regexp.last_match[:v_type]
283
+ {}.tap do |hash|
284
+ value.each do |k, v|
285
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
286
+ end
287
+ end
288
+ else # model
289
+ # models (e.g. Pet) or oneOf
290
+ klass = Conekta.const_get(type)
291
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
292
+ end
293
+ end
294
+
295
+ # Returns the string representation of the object
296
+ # @return [String] String presentation of the object
297
+ def to_s
298
+ to_hash.to_s
299
+ end
300
+
301
+ # to_body is an alias to to_hash (backward compatibility)
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_body
304
+ to_hash
305
+ end
306
+
307
+ # Returns the object in the form of hash
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_hash
310
+ hash = {}
311
+ self.class.attribute_map.each_pair do |attr, param|
312
+ value = self.send(attr)
313
+ if value.nil?
314
+ is_nullable = self.class.openapi_nullable.include?(attr)
315
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
316
+ end
317
+
318
+ hash[param] = _to_hash(value)
319
+ end
320
+ hash
321
+ end
322
+
323
+ # Outputs non-array value in the form of hash
324
+ # For object, use to_hash. Otherwise, just return the value
325
+ # @param [Object] value Any valid value
326
+ # @return [Hash] Returns the value in the form of hash
327
+ def _to_hash(value)
328
+ if value.is_a?(Array)
329
+ value.compact.map { |v| _to_hash(v) }
330
+ elsif value.is_a?(Hash)
331
+ {}.tap do |hash|
332
+ value.each { |k, v| hash[k] = _to_hash(v) }
333
+ end
334
+ elsif value.respond_to? :to_hash
335
+ value.to_hash
336
+ else
337
+ value
338
+ end
339
+ end
340
+
341
+ end
342
+
343
+ end