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
@@ -0,0 +1,270 @@
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
+ class CompanyResponseDocumentsInner
18
+ # Classification of the document. | Tipo de archivo | Descripción | | :--------------------------- | :-------------------------------------------------------- | | `id_legal_representative` | identificación oficial frente | | `id_legal_representative_back` | identificación oficial atrás | | `cfdi` | Prueba de situación fiscal | | `constitutive_act_basic` | Acta constitutiva | | `proof_of_address` | Comprobante de domicilio del negocio | | `power_of_attonery` | Poderes de representación | | `deposit_account_cover` | Carátula de la cuenta de depósito | | `permit_casino` | Permiso ante SEGOB | | `license_sanitation` | Licencia sanitaria de COFEPRIS | | `registration_tourism` | Inscripción ante el Registro Nacional de Turismo (SECTUR) |
19
+ attr_accessor :file_classification
20
+
21
+ # The status of the document.
22
+ attr_accessor :status
23
+
24
+ # The name of the file.
25
+ attr_accessor :file_name
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'file_classification' => :'file_classification',
53
+ :'status' => :'status',
54
+ :'file_name' => :'file_name'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'file_classification' => :'String',
67
+ :'status' => :'String',
68
+ :'file_name' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ :'file_name'
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::CompanyResponseDocumentsInner` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::CompanyResponseDocumentsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'file_classification')
95
+ self.file_classification = attributes[:'file_classification']
96
+ end
97
+
98
+ if attributes.key?(:'status')
99
+ self.status = attributes[:'status']
100
+ end
101
+
102
+ if attributes.key?(:'file_name')
103
+ self.file_name = attributes[:'file_name']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ file_classification_validator = EnumAttributeValidator.new('String', ["id_legal_representative", "id_legal_representative_back", "cfdi", "constitutive_act_basic", "proof_of_address", "power_of_attonery", "deposit_account_cover", "permit_casino", "license_sanitation", "registration_tourism"])
120
+ return false unless file_classification_validator.valid?(@file_classification)
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method checking allowed values (enum).
125
+ # @param [Object] file_classification Object to be assigned
126
+ def file_classification=(file_classification)
127
+ validator = EnumAttributeValidator.new('String', ["id_legal_representative", "id_legal_representative_back", "cfdi", "constitutive_act_basic", "proof_of_address", "power_of_attonery", "deposit_account_cover", "permit_casino", "license_sanitation", "registration_tourism"])
128
+ unless validator.valid?(file_classification)
129
+ fail ArgumentError, "invalid value for \"file_classification\", must be one of #{validator.allowable_values}."
130
+ end
131
+ @file_classification = file_classification
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ file_classification == o.file_classification &&
140
+ status == o.status &&
141
+ file_name == o.file_name
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [file_classification, status, file_name].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ attributes = attributes.transform_keys(&:to_sym)
162
+ transformed_hash = {}
163
+ openapi_types.each_pair do |key, type|
164
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = nil
166
+ elsif type =~ /\AArray<(.*)>/i
167
+ # check to ensure the input is an array given that the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[attribute_map[key]].is_a?(Array)
170
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
171
+ end
172
+ elsif !attributes[attribute_map[key]].nil?
173
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
174
+ end
175
+ end
176
+ new(transformed_hash)
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def self._deserialize(type, value)
184
+ case type.to_sym
185
+ when :Time
186
+ Time.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :Boolean
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ # models (e.g. Pet) or oneOf
217
+ klass = Conekta.const_get(type)
218
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map { |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end
267
+
268
+ end
269
+
270
+ end
@@ -0,0 +1,252 @@
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
+ class CreateCompanyRequest
18
+ # The name of the company.
19
+ attr_accessor :name
20
+
21
+ # The type of company, 'owner'
22
+ attr_accessor :type_company
23
+
24
+ attr_accessor :comercial_info
25
+
26
+ attr_accessor :fiscal_info
27
+
28
+ attr_accessor :bank_account_info
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'type_company' => :'type_company',
35
+ :'comercial_info' => :'comercial_info',
36
+ :'fiscal_info' => :'fiscal_info',
37
+ :'bank_account_info' => :'bank_account_info'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'name' => :'String',
50
+ :'type_company' => :'String',
51
+ :'comercial_info' => :'CreateCompanyRequestComercialInfo',
52
+ :'fiscal_info' => :'CreateCompanyRequestFiscalInfo',
53
+ :'bank_account_info' => :'CreateCompanyRequestBankAccountInfo'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::CreateCompanyRequest` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::CreateCompanyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'name')
79
+ self.name = attributes[:'name']
80
+ end
81
+
82
+ if attributes.key?(:'type_company')
83
+ self.type_company = attributes[:'type_company']
84
+ end
85
+
86
+ if attributes.key?(:'comercial_info')
87
+ self.comercial_info = attributes[:'comercial_info']
88
+ end
89
+
90
+ if attributes.key?(:'fiscal_info')
91
+ self.fiscal_info = attributes[:'fiscal_info']
92
+ end
93
+
94
+ if attributes.key?(:'bank_account_info')
95
+ self.bank_account_info = attributes[:'bank_account_info']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ name == o.name &&
120
+ type_company == o.type_company &&
121
+ comercial_info == o.comercial_info &&
122
+ fiscal_info == o.fiscal_info &&
123
+ bank_account_info == o.bank_account_info
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [name, type_company, comercial_info, fiscal_info, bank_account_info].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ attributes = attributes.transform_keys(&:to_sym)
144
+ transformed_hash = {}
145
+ openapi_types.each_pair do |key, type|
146
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = nil
148
+ elsif type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[attribute_map[key]].is_a?(Array)
152
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
153
+ end
154
+ elsif !attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
156
+ end
157
+ end
158
+ new(transformed_hash)
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def self._deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = Conekta.const_get(type)
200
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end