conekta 7.0.2 → 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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -5
  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/CompaniesApi.md +2 -2
  9. data/docs/CompanyDocumentRequest.md +1 -1
  10. data/docs/CreateCustomerPaymentMethodsResponse.md +3 -2
  11. data/docs/CustomerPaymentMethodRequest.md +1 -1
  12. data/docs/CustomerPaymentMethodsData.md +3 -2
  13. data/docs/EventsResendResponse.md +1 -1
  14. data/docs/GetCustomerPaymentMethodDataResponse.md +3 -2
  15. data/docs/OrderResponseCheckout.md +1 -1
  16. data/docs/PaymentMethodCardRequest.md +1 -1
  17. data/docs/PaymentMethodCashRecurrentResponse.md +38 -0
  18. data/docs/PaymentMethodCashRequest.md +1 -1
  19. data/docs/PaymentMethodPbbPayment.md +30 -0
  20. data/docs/PaymentMethodPbbRequest.md +22 -0
  21. data/docs/PaymentMethodSpeiRequest.md +1 -1
  22. data/docs/PaymentMethodTokenRequest.md +1 -1
  23. data/docs/PaymentMethodsApi.md +1 -1
  24. data/docs/UpdateCustomerPaymentMethodsResponse.md +3 -2
  25. data/docs/UpdatePaymentMethods.md +4 -2
  26. data/docs/WebhookLog.md +1 -1
  27. data/docs/WebhookResponse.md +1 -1
  28. data/examples/one_time_charge_bnpl.rb +3 -0
  29. data/examples/one_time_charge_pbb.rb +47 -0
  30. data/lib/conekta/models/charge_order_response_payment_method.rb +4 -2
  31. data/lib/conekta/models/charge_request_payment_method.rb +2 -1
  32. data/lib/conekta/models/charge_response_payment_method.rb +4 -2
  33. data/lib/conekta/models/create_customer_payment_methods_response.rb +2 -2
  34. data/lib/conekta/models/customer_payment_methods_data.rb +2 -2
  35. data/lib/conekta/models/get_customer_payment_method_data_response.rb +2 -2
  36. data/lib/conekta/models/payment_method_cash_recurrent_response.rb +343 -0
  37. data/lib/conekta/models/payment_method_pbb_payment.rb +341 -0
  38. data/lib/conekta/models/payment_method_pbb_request.rb +309 -0
  39. data/lib/conekta/models/update_customer_payment_methods_response.rb +2 -2
  40. data/lib/conekta/models/update_payment_methods.rb +34 -4
  41. data/lib/conekta/version.rb +1 -1
  42. data/lib/conekta.rb +3 -0
  43. metadata +9 -2
@@ -0,0 +1,309 @@
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 PaymentMethodPbbRequest
18
+ # Type of the payment method
19
+ attr_accessor :type
20
+
21
+ # Expiration date of the payment method, in Unix timestamp format
22
+ attr_accessor :expires_at
23
+
24
+ # Product type of the payment method, use for the payment method to know the product type
25
+ attr_accessor :product_type
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
+ :'type' => :'type',
53
+ :'expires_at' => :'expires_at',
54
+ :'product_type' => :'product_type'
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
+ :'type' => :'String',
67
+ :'expires_at' => :'Integer',
68
+ :'product_type' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # List of class defined in allOf (OpenAPI v3)
79
+ def self.openapi_all_of
80
+ [
81
+ :'CustomerPaymentMethodRequest'
82
+ ]
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::PaymentMethodPbbRequest` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::PaymentMethodPbbRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'type')
101
+ self.type = attributes[:'type']
102
+ else
103
+ self.type = nil
104
+ end
105
+
106
+ if attributes.key?(:'expires_at')
107
+ self.expires_at = attributes[:'expires_at']
108
+ end
109
+
110
+ if attributes.key?(:'product_type')
111
+ self.product_type = attributes[:'product_type']
112
+ else
113
+ self.product_type = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @type.nil?
123
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
124
+ end
125
+
126
+ if !@expires_at.nil? && @expires_at < 0
127
+ invalid_properties.push('invalid value for "expires_at", must be greater than or equal to 0.')
128
+ end
129
+
130
+ if @product_type.nil?
131
+ invalid_properties.push('invalid value for "product_type", product_type cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @type.nil?
142
+ return false if !@expires_at.nil? && @expires_at < 0
143
+ return false if @product_type.nil?
144
+ product_type_validator = EnumAttributeValidator.new('String', ["bbva_pay_by_bank"])
145
+ return false unless product_type_validator.valid?(@product_type)
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] expires_at Value to be assigned
151
+ def expires_at=(expires_at)
152
+ if expires_at.nil?
153
+ fail ArgumentError, 'expires_at cannot be nil'
154
+ end
155
+
156
+ if expires_at < 0
157
+ fail ArgumentError, 'invalid value for "expires_at", must be greater than or equal to 0.'
158
+ end
159
+
160
+ @expires_at = expires_at
161
+ end
162
+
163
+ # Custom attribute writer method checking allowed values (enum).
164
+ # @param [Object] product_type Object to be assigned
165
+ def product_type=(product_type)
166
+ validator = EnumAttributeValidator.new('String', ["bbva_pay_by_bank"])
167
+ unless validator.valid?(product_type)
168
+ fail ArgumentError, "invalid value for \"product_type\", must be one of #{validator.allowable_values}."
169
+ end
170
+ @product_type = product_type
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ type == o.type &&
179
+ expires_at == o.expires_at &&
180
+ product_type == o.product_type
181
+ end
182
+
183
+ # @see the `==` method
184
+ # @param [Object] Object to be compared
185
+ def eql?(o)
186
+ self == o
187
+ end
188
+
189
+ # Calculates hash code according to all attributes.
190
+ # @return [Integer] Hash code
191
+ def hash
192
+ [type, expires_at, product_type].hash
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def self.build_from_hash(attributes)
199
+ return nil unless attributes.is_a?(Hash)
200
+ attributes = attributes.transform_keys(&:to_sym)
201
+ transformed_hash = {}
202
+ openapi_types.each_pair do |key, type|
203
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = nil
205
+ elsif type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[attribute_map[key]].is_a?(Array)
209
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
+ end
211
+ elsif !attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
213
+ end
214
+ end
215
+ new(transformed_hash)
216
+ end
217
+
218
+ # Deserializes the data based on type
219
+ # @param string type Data type
220
+ # @param string value Value to be deserialized
221
+ # @return [Object] Deserialized data
222
+ def self._deserialize(type, value)
223
+ case type.to_sym
224
+ when :Time
225
+ Time.parse(value)
226
+ when :Date
227
+ Date.parse(value)
228
+ when :String
229
+ value.to_s
230
+ when :Integer
231
+ value.to_i
232
+ when :Float
233
+ value.to_f
234
+ when :Boolean
235
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
236
+ true
237
+ else
238
+ false
239
+ end
240
+ when :Object
241
+ # generic object (usually a Hash), return directly
242
+ value
243
+ when /\AArray<(?<inner_type>.+)>\z/
244
+ inner_type = Regexp.last_match[:inner_type]
245
+ value.map { |v| _deserialize(inner_type, v) }
246
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
247
+ k_type = Regexp.last_match[:k_type]
248
+ v_type = Regexp.last_match[:v_type]
249
+ {}.tap do |hash|
250
+ value.each do |k, v|
251
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
252
+ end
253
+ end
254
+ else # model
255
+ # models (e.g. Pet) or oneOf
256
+ klass = Conekta.const_get(type)
257
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+
307
+ end
308
+
309
+ 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
@@ -15,12 +15,17 @@ require 'time'
15
15
 
16
16
  module Conekta
17
17
  class UpdatePaymentMethods
18
+ # The name of the payment method holder
18
19
  attr_accessor :name
19
20
 
21
+ # The expiration date of the payment method in Unix timestamp format
22
+ attr_accessor :expires_at
23
+
20
24
  # Attribute mapping from ruby-style variable name to JSON key.
21
25
  def self.attribute_map
22
26
  {
23
- :'name' => :'name'
27
+ :'name' => :'name',
28
+ :'expires_at' => :'expires_at'
24
29
  }
25
30
  end
26
31
 
@@ -32,7 +37,8 @@ module Conekta
32
37
  # Attribute type mapping.
33
38
  def self.openapi_types
34
39
  {
35
- :'name' => :'String'
40
+ :'name' => :'String',
41
+ :'expires_at' => :'Integer'
36
42
  }
37
43
  end
38
44
 
@@ -60,6 +66,10 @@ module Conekta
60
66
  if attributes.key?(:'name')
61
67
  self.name = attributes[:'name']
62
68
  end
69
+
70
+ if attributes.key?(:'expires_at')
71
+ self.expires_at = attributes[:'expires_at']
72
+ end
63
73
  end
64
74
 
65
75
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -67,6 +77,10 @@ module Conekta
67
77
  def list_invalid_properties
68
78
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
79
  invalid_properties = Array.new
80
+ if !@expires_at.nil? && @expires_at < 1
81
+ invalid_properties.push('invalid value for "expires_at", must be greater than or equal to 1.')
82
+ end
83
+
70
84
  invalid_properties
71
85
  end
72
86
 
@@ -74,15 +88,31 @@ module Conekta
74
88
  # @return true if the model is valid
75
89
  def valid?
76
90
  warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if !@expires_at.nil? && @expires_at < 1
77
92
  true
78
93
  end
79
94
 
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] expires_at Value to be assigned
97
+ def expires_at=(expires_at)
98
+ if expires_at.nil?
99
+ fail ArgumentError, 'expires_at cannot be nil'
100
+ end
101
+
102
+ if expires_at < 1
103
+ fail ArgumentError, 'invalid value for "expires_at", must be greater than or equal to 1.'
104
+ end
105
+
106
+ @expires_at = expires_at
107
+ end
108
+
80
109
  # Checks equality by comparing each attribute.
81
110
  # @param [Object] Object to be compared
82
111
  def ==(o)
83
112
  return true if self.equal?(o)
84
113
  self.class == o.class &&
85
- name == o.name
114
+ name == o.name &&
115
+ expires_at == o.expires_at
86
116
  end
87
117
 
88
118
  # @see the `==` method
@@ -94,7 +124,7 @@ module Conekta
94
124
  # Calculates hash code according to all attributes.
95
125
  # @return [Integer] Hash code
96
126
  def hash
97
- [name].hash
127
+ [name, expires_at].hash
98
128
  end
99
129
 
100
130
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.5.0
11
11
  =end
12
12
 
13
13
  module Conekta
14
- VERSION = '7.0.2'
14
+ VERSION = '7.0.3'
15
15
  end
data/lib/conekta.rb CHANGED
@@ -143,10 +143,13 @@ require 'conekta/models/payment_method_card'
143
143
  require 'conekta/models/payment_method_card_request'
144
144
  require 'conekta/models/payment_method_card_response'
145
145
  require 'conekta/models/payment_method_cash'
146
+ require 'conekta/models/payment_method_cash_recurrent_response'
146
147
  require 'conekta/models/payment_method_cash_request'
147
148
  require 'conekta/models/payment_method_cash_response'
148
149
  require 'conekta/models/payment_method_cash_response_all_of_agreements'
149
150
  require 'conekta/models/payment_method_general_request'
151
+ require 'conekta/models/payment_method_pbb_payment'
152
+ require 'conekta/models/payment_method_pbb_request'
150
153
  require 'conekta/models/payment_method_response'
151
154
  require 'conekta/models/payment_method_spei_recurrent'
152
155
  require 'conekta/models/payment_method_spei_request'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conekta
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.2
4
+ version: 7.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conekta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-12 00:00:00.000000000 Z
11
+ date: 2025-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -235,10 +235,13 @@ files:
235
235
  - docs/PaymentMethodCardRequest.md
236
236
  - docs/PaymentMethodCardResponse.md
237
237
  - docs/PaymentMethodCash.md
238
+ - docs/PaymentMethodCashRecurrentResponse.md
238
239
  - docs/PaymentMethodCashRequest.md
239
240
  - docs/PaymentMethodCashResponse.md
240
241
  - docs/PaymentMethodCashResponseAllOfAgreements.md
241
242
  - docs/PaymentMethodGeneralRequest.md
243
+ - docs/PaymentMethodPbbPayment.md
244
+ - docs/PaymentMethodPbbRequest.md
242
245
  - docs/PaymentMethodResponse.md
243
246
  - docs/PaymentMethodSpeiRecurrent.md
244
247
  - docs/PaymentMethodSpeiRequest.md
@@ -310,6 +313,7 @@ files:
310
313
  - docs/WhitelistlistRuleResponse.md
311
314
  - examples/README.md
312
315
  - examples/one_time_charge_bnpl.rb
316
+ - examples/one_time_charge_pbb.rb
313
317
  - lib/conekta.rb
314
318
  - lib/conekta/api/antifraud_api.rb
315
319
  - lib/conekta/api/api_keys_api.rb
@@ -504,12 +508,15 @@ files:
504
508
  - lib/conekta/models/payment_method_card_response.rb
505
509
  - lib/conekta/models/payment_method_card_response_all_of.rb
506
510
  - lib/conekta/models/payment_method_cash.rb
511
+ - lib/conekta/models/payment_method_cash_recurrent_response.rb
507
512
  - lib/conekta/models/payment_method_cash_request.rb
508
513
  - lib/conekta/models/payment_method_cash_request_all_of.rb
509
514
  - lib/conekta/models/payment_method_cash_response.rb
510
515
  - lib/conekta/models/payment_method_cash_response_all_of.rb
511
516
  - lib/conekta/models/payment_method_cash_response_all_of_agreements.rb
512
517
  - lib/conekta/models/payment_method_general_request.rb
518
+ - lib/conekta/models/payment_method_pbb_payment.rb
519
+ - lib/conekta/models/payment_method_pbb_request.rb
513
520
  - lib/conekta/models/payment_method_response.rb
514
521
  - lib/conekta/models/payment_method_spei_recurrent.rb
515
522
  - lib/conekta/models/payment_method_spei_recurrent_all_of.rb