conekta 6.0.3 → 6.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -5
  3. data/VERSION +1 -1
  4. data/config-ruby.json +1 -1
  5. data/docs/ChargeRequest.md +1 -1
  6. data/docs/ChargeRequestPaymentMethod.md +39 -18
  7. data/docs/ChargeResponse.md +6 -6
  8. data/docs/ChargesApi.md +79 -1
  9. data/docs/ChargesDataResponse.md +6 -6
  10. data/docs/ChargesOrderResponse.md +22 -0
  11. data/docs/ChargesOrderResponseAllOfData.md +52 -0
  12. data/docs/Checkout.md +2 -0
  13. data/docs/CheckoutRequest.md +2 -0
  14. data/docs/CreateCustomerPaymentMethodsRequest.md +4 -4
  15. data/docs/Customer.md +4 -0
  16. data/docs/CustomerPaymentMethodsRequest.md +4 -4
  17. data/docs/CustomerResponse.md +4 -0
  18. data/docs/OrderRefundRequest.md +2 -2
  19. data/docs/OrderRequest.md +1 -1
  20. data/docs/OrderResponseCheckout.md +2 -0
  21. data/docs/PaymentMethodBankTransfer.md +3 -1
  22. data/docs/PaymentMethodCard.md +12 -10
  23. data/docs/PaymentMethodCardRequest.md +12 -2
  24. data/docs/PaymentMethodCash.md +7 -1
  25. data/docs/PaymentMethodGeneralRequest.md +32 -0
  26. data/docs/PaymentMethodTokenRequest.md +20 -0
  27. data/docs/PaymentMethodsApi.md +1 -1
  28. data/docs/PayoutOrdersApi.md +74 -0
  29. data/docs/SubscriptionResponse.md +2 -0
  30. data/docs/UpdateCustomer.md +4 -0
  31. data/lib/conekta/api/charges_api.rb +84 -0
  32. data/lib/conekta/api/payout_orders_api.rb +70 -0
  33. data/lib/conekta/models/charge_request.rb +1 -0
  34. data/lib/conekta/models/charge_request_payment_method.rb +74 -239
  35. data/lib/conekta/models/charge_response.rb +4 -0
  36. data/lib/conekta/models/charges_data_response.rb +4 -0
  37. data/lib/conekta/models/charges_order_response.rb +258 -0
  38. data/lib/conekta/models/charges_order_response_all_of_data.rb +382 -0
  39. data/lib/conekta/models/checkout.rb +11 -1
  40. data/lib/conekta/models/checkout_request.rb +11 -1
  41. data/lib/conekta/models/create_customer_payment_methods_request.rb +2 -2
  42. data/lib/conekta/models/customer.rb +21 -1
  43. data/lib/conekta/models/customer_payment_methods_request.rb +2 -2
  44. data/lib/conekta/models/customer_response.rb +21 -1
  45. data/lib/conekta/models/order_refund_request.rb +2 -1
  46. data/lib/conekta/models/order_request.rb +1 -1
  47. data/lib/conekta/models/order_response_checkout.rb +12 -1
  48. data/lib/conekta/models/payment_method_bank_transfer.rb +14 -5
  49. data/lib/conekta/models/payment_method_card.rb +22 -4
  50. data/lib/conekta/models/payment_method_card_request.rb +174 -12
  51. data/lib/conekta/models/payment_method_cash.rb +33 -4
  52. data/lib/conekta/models/payment_method_general_request.rb +291 -0
  53. data/lib/conekta/models/payment_method_token_request.rb +246 -0
  54. data/lib/conekta/models/subscription_response.rb +11 -1
  55. data/lib/conekta/models/update_customer.rb +21 -1
  56. data/lib/conekta/version.rb +1 -1
  57. data/lib/conekta.rb +4 -0
  58. data/spec/api/charges_api_spec.rb +18 -10
  59. data/spec/api/customers_api_spec.rb +10 -4
  60. data/spec/api/orders_api_spec.rb +6 -6
  61. metadata +32 -24
@@ -22,6 +22,9 @@ module Conekta
22
22
 
23
23
  attr_accessor :canceled_at
24
24
 
25
+ # Reason for cancellation. This field appears when the subscription status is 'canceled'.
26
+ attr_accessor :canceled_reason
27
+
25
28
  attr_accessor :card_id
26
29
 
27
30
  attr_accessor :charge_id
@@ -56,6 +59,7 @@ module Conekta
56
59
  :'billing_cycle_start' => :'billing_cycle_start',
57
60
  :'billing_cycle_end' => :'billing_cycle_end',
58
61
  :'canceled_at' => :'canceled_at',
62
+ :'canceled_reason' => :'canceled_reason',
59
63
  :'card_id' => :'card_id',
60
64
  :'charge_id' => :'charge_id',
61
65
  :'created_at' => :'created_at',
@@ -84,6 +88,7 @@ module Conekta
84
88
  :'billing_cycle_start' => :'Integer',
85
89
  :'billing_cycle_end' => :'Integer',
86
90
  :'canceled_at' => :'Integer',
91
+ :'canceled_reason' => :'String',
87
92
  :'card_id' => :'String',
88
93
  :'charge_id' => :'String',
89
94
  :'created_at' => :'Integer',
@@ -141,6 +146,10 @@ module Conekta
141
146
  self.canceled_at = attributes[:'canceled_at']
142
147
  end
143
148
 
149
+ if attributes.key?(:'canceled_reason')
150
+ self.canceled_reason = attributes[:'canceled_reason']
151
+ end
152
+
144
153
  if attributes.key?(:'card_id')
145
154
  self.card_id = attributes[:'card_id']
146
155
  end
@@ -221,6 +230,7 @@ module Conekta
221
230
  billing_cycle_start == o.billing_cycle_start &&
222
231
  billing_cycle_end == o.billing_cycle_end &&
223
232
  canceled_at == o.canceled_at &&
233
+ canceled_reason == o.canceled_reason &&
224
234
  card_id == o.card_id &&
225
235
  charge_id == o.charge_id &&
226
236
  created_at == o.created_at &&
@@ -246,7 +256,7 @@ module Conekta
246
256
  # Calculates hash code according to all attributes.
247
257
  # @return [Integer] Hash code
248
258
  def hash
249
- [billing_cycle_start, billing_cycle_end, canceled_at, card_id, charge_id, created_at, customer_custom_reference, customer_id, id, last_billing_cycle_order_id, object, paused_at, plan_id, status, subscription_start, trial_start, trial_end].hash
259
+ [billing_cycle_start, billing_cycle_end, canceled_at, canceled_reason, card_id, charge_id, created_at, customer_custom_reference, customer_id, id, last_billing_cycle_order_id, object, paused_at, plan_id, status, subscription_start, trial_start, trial_end].hash
250
260
  end
251
261
 
252
262
  # Builds the object from hash
@@ -18,6 +18,9 @@ module Conekta
18
18
  class UpdateCustomer
19
19
  attr_accessor :antifraud_info
20
20
 
21
+ # It is a parameter that allows to identify the date of birth of the client.
22
+ attr_accessor :date_of_birth
23
+
21
24
  # It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id)
22
25
  attr_accessor :default_payment_source_id
23
26
 
@@ -46,6 +49,9 @@ module Conekta
46
49
 
47
50
  attr_accessor :metadata
48
51
 
52
+ # It is a parameter that allows to identify the national identification number of the client.
53
+ attr_accessor :national_id
54
+
49
55
  # Contains details of the payment methods that the customer has active or has used in Conekta
50
56
  attr_accessor :payment_sources
51
57
 
@@ -58,6 +64,7 @@ module Conekta
58
64
  def self.attribute_map
59
65
  {
60
66
  :'antifraud_info' => :'antifraud_info',
67
+ :'date_of_birth' => :'date_of_birth',
61
68
  :'default_payment_source_id' => :'default_payment_source_id',
62
69
  :'email' => :'email',
63
70
  :'name' => :'name',
@@ -68,6 +75,7 @@ module Conekta
68
75
  :'custom_reference' => :'custom_reference',
69
76
  :'fiscal_entities' => :'fiscal_entities',
70
77
  :'metadata' => :'metadata',
78
+ :'national_id' => :'national_id',
71
79
  :'payment_sources' => :'payment_sources',
72
80
  :'shipping_contacts' => :'shipping_contacts',
73
81
  :'subscription' => :'subscription'
@@ -83,6 +91,7 @@ module Conekta
83
91
  def self.openapi_types
84
92
  {
85
93
  :'antifraud_info' => :'UpdateCustomerAntifraudInfo',
94
+ :'date_of_birth' => :'String',
86
95
  :'default_payment_source_id' => :'String',
87
96
  :'email' => :'String',
88
97
  :'name' => :'String',
@@ -93,6 +102,7 @@ module Conekta
93
102
  :'custom_reference' => :'String',
94
103
  :'fiscal_entities' => :'Array<CustomerFiscalEntitiesRequest>',
95
104
  :'metadata' => :'Hash<String, Object>',
105
+ :'national_id' => :'String',
96
106
  :'payment_sources' => :'Array<CustomerPaymentMethodsRequest>',
97
107
  :'shipping_contacts' => :'Array<CustomerShippingContacts>',
98
108
  :'subscription' => :'SubscriptionRequest'
@@ -125,6 +135,10 @@ module Conekta
125
135
  self.antifraud_info = attributes[:'antifraud_info']
126
136
  end
127
137
 
138
+ if attributes.key?(:'date_of_birth')
139
+ self.date_of_birth = attributes[:'date_of_birth']
140
+ end
141
+
128
142
  if attributes.key?(:'default_payment_source_id')
129
143
  self.default_payment_source_id = attributes[:'default_payment_source_id']
130
144
  end
@@ -171,6 +185,10 @@ module Conekta
171
185
  end
172
186
  end
173
187
 
188
+ if attributes.key?(:'national_id')
189
+ self.national_id = attributes[:'national_id']
190
+ end
191
+
174
192
  if attributes.key?(:'payment_sources')
175
193
  if (value = attributes[:'payment_sources']).is_a?(Array)
176
194
  self.payment_sources = value
@@ -228,6 +246,7 @@ module Conekta
228
246
  return true if self.equal?(o)
229
247
  self.class == o.class &&
230
248
  antifraud_info == o.antifraud_info &&
249
+ date_of_birth == o.date_of_birth &&
231
250
  default_payment_source_id == o.default_payment_source_id &&
232
251
  email == o.email &&
233
252
  name == o.name &&
@@ -238,6 +257,7 @@ module Conekta
238
257
  custom_reference == o.custom_reference &&
239
258
  fiscal_entities == o.fiscal_entities &&
240
259
  metadata == o.metadata &&
260
+ national_id == o.national_id &&
241
261
  payment_sources == o.payment_sources &&
242
262
  shipping_contacts == o.shipping_contacts &&
243
263
  subscription == o.subscription
@@ -252,7 +272,7 @@ module Conekta
252
272
  # Calculates hash code according to all attributes.
253
273
  # @return [Integer] Hash code
254
274
  def hash
255
- [antifraud_info, default_payment_source_id, email, name, phone, plan_id, default_shipping_contact_id, corporate, custom_reference, fiscal_entities, metadata, payment_sources, shipping_contacts, subscription].hash
275
+ [antifraud_info, date_of_birth, default_payment_source_id, email, name, phone, plan_id, default_shipping_contact_id, corporate, custom_reference, fiscal_entities, metadata, national_id, payment_sources, shipping_contacts, subscription].hash
256
276
  end
257
277
 
258
278
  # 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 = '6.0.3'
14
+ VERSION = '6.0.5'
15
15
  end
data/lib/conekta.rb CHANGED
@@ -36,6 +36,8 @@ require 'conekta/models/charge_response_refunds'
36
36
  require 'conekta/models/charge_response_refunds_data'
37
37
  require 'conekta/models/charge_update_request'
38
38
  require 'conekta/models/charges_data_response'
39
+ require 'conekta/models/charges_order_response'
40
+ require 'conekta/models/charges_order_response_all_of_data'
39
41
  require 'conekta/models/checkout'
40
42
  require 'conekta/models/checkout_order_template'
41
43
  require 'conekta/models/checkout_order_template_customer_info'
@@ -136,9 +138,11 @@ require 'conekta/models/payment_method_card_response'
136
138
  require 'conekta/models/payment_method_cash'
137
139
  require 'conekta/models/payment_method_cash_request'
138
140
  require 'conekta/models/payment_method_cash_response'
141
+ require 'conekta/models/payment_method_general_request'
139
142
  require 'conekta/models/payment_method_response'
140
143
  require 'conekta/models/payment_method_spei_recurrent'
141
144
  require 'conekta/models/payment_method_spei_request'
145
+ require 'conekta/models/payment_method_token_request'
142
146
  require 'conekta/models/payout'
143
147
  require 'conekta/models/payout_method'
144
148
  require 'conekta/models/payout_order'
@@ -75,12 +75,16 @@ describe 'ChargesApi' do
75
75
  describe 'orders_create_charge test' do
76
76
  it 'card' do
77
77
  id = 'ord_2tVKxbhNzfUnGjnXG'
78
+
79
+ payment_method_data = {
80
+ type: 'card',
81
+ token_id: 'ttest5214'
82
+ }
83
+
84
+ payment_method = Conekta::ChargeRequestPaymentMethod.build(payment_method_data)
78
85
  charge_request = Conekta::ChargeRequest.new({
79
86
  amount: 40000,
80
- payment_method: Conekta::ChargeRequestPaymentMethod.new({
81
- type: 'card',
82
- token_id: 'tok_2tVKyGpobEKAR3xVH'
83
- })
87
+ payment_method: payment_method
84
88
  })
85
89
  response = @api_instance.orders_create_charge(id, charge_request)
86
90
 
@@ -95,11 +99,13 @@ describe 'ChargesApi' do
95
99
 
96
100
  it 'cash' do
97
101
  id = "ord_2tVL8dT1Hm3y3YiaN"
102
+ payment_method_data = {
103
+ type: 'cash',
104
+ }
105
+ payment_method = Conekta::ChargeRequestPaymentMethod.build(payment_method_data)
98
106
  charge_request = Conekta::ChargeRequest.new({
99
107
  amount: 40000,
100
- payment_method: Conekta::ChargeRequestPaymentMethod.new({
101
- type: 'cash',
102
- })
108
+ payment_method: payment_method
103
109
  })
104
110
  response = @api_instance.orders_create_charge(id,charge_request)
105
111
 
@@ -117,11 +123,13 @@ describe 'ChargesApi' do
117
123
  end
118
124
  it 'spei' do
119
125
  id = "ord_2tVLUFrQBB4HKz1zj"
126
+ payment_method_data = {
127
+ type: 'spei',
128
+ }
129
+ payment_method = Conekta::ChargeRequestPaymentMethod.build(payment_method_data)
120
130
  charge_request = Conekta::ChargeRequest.new({
121
131
  amount: 40000,
122
- payment_method: Conekta::ChargeRequestPaymentMethod.new({
123
- type: 'spei',
124
- })
132
+ payment_method: payment_method
125
133
  })
126
134
  response = @api_instance.orders_create_charge(id,charge_request)
127
135
 
@@ -265,11 +265,17 @@ describe 'CustomersApi' do
265
265
  })
266
266
 
267
267
  payment_sources = Array.new(1)
268
+ payment_method_data = {
269
+ type: 'card',
270
+ cvc: '123',
271
+ exp_month: '12',
272
+ exp_year: '2025',
273
+ name: 'John Doe',
274
+ number: '4242424242424242',
275
+ customer_ip_address: '127.0.0.1'
276
+ }
268
277
  payment_sources[0] =
269
- Conekta::PaymentMethodCardRequest.new({
270
- type: 'card',
271
- token_id: 'tok_2tXyExrU6U7yiaTto'
272
- })
278
+ Conekta::PaymentMethodCardRequest.new(payment_method_data)
273
279
  shipping_contacts = Array.new(1)
274
280
  shipping_contacts[0] = Conekta::CustomerShippingContacts.new({
275
281
  address: Conekta::CustomerShippingContactsAddress.new({
@@ -83,14 +83,14 @@ describe 'OrdersApi' do
83
83
  unit_price: 1555
84
84
  })
85
85
  ]
86
+ payment_method_data = {
87
+ expires_at: unix_timestamp,
88
+ type: 'cash'
89
+ }
86
90
  charges = Array.new(1)
91
+ payment_method = Conekta::ChargeRequestPaymentMethod.build(payment_method_data)
87
92
  charges[0] = Conekta::ChargeRequest.new({ amount: 1555,
88
- payment_method: Conekta::ChargeRequestPaymentMethod.new(
89
- {
90
- expires_at: unix_timestamp,
91
- type: 'cash'
92
- }
93
- )
93
+ payment_method: Conekta::ChargeRequestPaymentMethod.build(payment_method_data)
94
94
  })
95
95
  request = Conekta::OrderRequest.new(
96
96
  {
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: 6.0.3
4
+ version: 6.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conekta
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-29 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -121,6 +121,8 @@ files:
121
121
  - docs/ChargeUpdateRequest.md
122
122
  - docs/ChargesApi.md
123
123
  - docs/ChargesDataResponse.md
124
+ - docs/ChargesOrderResponse.md
125
+ - docs/ChargesOrderResponseAllOfData.md
124
126
  - docs/Checkout.md
125
127
  - docs/CheckoutOrderTemplate.md
126
128
  - docs/CheckoutOrderTemplateCustomerInfo.md
@@ -228,9 +230,11 @@ files:
228
230
  - docs/PaymentMethodCash.md
229
231
  - docs/PaymentMethodCashRequest.md
230
232
  - docs/PaymentMethodCashResponse.md
233
+ - docs/PaymentMethodGeneralRequest.md
231
234
  - docs/PaymentMethodResponse.md
232
235
  - docs/PaymentMethodSpeiRecurrent.md
233
236
  - docs/PaymentMethodSpeiRequest.md
237
+ - docs/PaymentMethodTokenRequest.md
234
238
  - docs/PaymentMethodsApi.md
235
239
  - docs/Payout.md
236
240
  - docs/PayoutMethod.md
@@ -347,6 +351,8 @@ files:
347
351
  - lib/conekta/models/charge_response_refunds_data.rb
348
352
  - lib/conekta/models/charge_update_request.rb
349
353
  - lib/conekta/models/charges_data_response.rb
354
+ - lib/conekta/models/charges_order_response.rb
355
+ - lib/conekta/models/charges_order_response_all_of_data.rb
350
356
  - lib/conekta/models/checkout.rb
351
357
  - lib/conekta/models/checkout_order_template.rb
352
358
  - lib/conekta/models/checkout_order_template_customer_info.rb
@@ -479,10 +485,12 @@ files:
479
485
  - lib/conekta/models/payment_method_cash_request_all_of.rb
480
486
  - lib/conekta/models/payment_method_cash_response.rb
481
487
  - lib/conekta/models/payment_method_cash_response_all_of.rb
488
+ - lib/conekta/models/payment_method_general_request.rb
482
489
  - lib/conekta/models/payment_method_response.rb
483
490
  - lib/conekta/models/payment_method_spei_recurrent.rb
484
491
  - lib/conekta/models/payment_method_spei_recurrent_all_of.rb
485
492
  - lib/conekta/models/payment_method_spei_request.rb
493
+ - lib/conekta/models/payment_method_token_request.rb
486
494
  - lib/conekta/models/payout.rb
487
495
  - lib/conekta/models/payout_method.rb
488
496
  - lib/conekta/models/payout_order.rb
@@ -577,7 +585,7 @@ homepage: https://www.conekta.com
577
585
  licenses:
578
586
  - MIT
579
587
  metadata: {}
580
- post_install_message:
588
+ post_install_message:
581
589
  rdoc_options: []
582
590
  require_paths:
583
591
  - lib
@@ -593,35 +601,35 @@ required_rubygems_version: !ruby/object:Gem::Requirement
593
601
  version: '0'
594
602
  requirements: []
595
603
  rubygems_version: 3.3.27
596
- signing_key:
604
+ signing_key:
597
605
  specification_version: 4
598
606
  summary: This library provides https://api.conekta.io operations
599
607
  test_files:
600
- - spec/api/webhook_keys_api_spec.rb
601
- - spec/api/charges_api_spec.rb
602
- - spec/api/transfers_api_spec.rb
603
- - spec/api/api_keys_api_spec.rb
604
- - spec/api/orders_api_spec.rb
605
- - spec/api/payment_methods_api_spec.rb
606
- - spec/api/payment_link_api_spec.rb
607
- - spec/api/balances_api_spec.rb
608
+ - spec/api/companies_api_spec.rb
608
609
  - spec/api/plans_api_spec.rb
609
- - spec/api/logs_api_spec.rb
610
+ - spec/api/transfers_api_spec.rb
610
611
  - spec/api/products_api_spec.rb
611
- - spec/api/base_test.rb
612
- - spec/api/shipping_contacts_api_spec.rb
613
- - spec/api/discounts_api_spec.rb
614
- - spec/api/subscriptions_api_spec.rb
615
612
  - spec/api/tokens_api_spec.rb
616
- - spec/api/events_api_spec.rb
617
- - spec/api/payout_orders_api_spec.rb
613
+ - spec/api/api_keys_api_spec.rb
614
+ - spec/api/customers_api_spec.rb
615
+ - spec/api/balances_api_spec.rb
618
616
  - spec/api/webhooks_api_spec.rb
619
- - spec/api/antifraud_api_spec.rb
620
- - spec/api/companies_api_spec.rb
621
- - spec/api/transactions_api_spec.rb
617
+ - spec/api/events_api_spec.rb
618
+ - spec/api/shipping_contacts_api_spec.rb
622
619
  - spec/api/taxes_api_spec.rb
620
+ - spec/api/charges_api_spec.rb
621
+ - spec/api/payout_orders_api_spec.rb
622
+ - spec/api/orders_api_spec.rb
623
+ - spec/api/webhook_keys_api_spec.rb
624
+ - spec/api/logs_api_spec.rb
625
+ - spec/api/discounts_api_spec.rb
626
+ - spec/api/payment_methods_api_spec.rb
623
627
  - spec/api/shippings_api_spec.rb
624
- - spec/api/customers_api_spec.rb
628
+ - spec/api/transactions_api_spec.rb
629
+ - spec/api/base_test.rb
630
+ - spec/api/payment_link_api_spec.rb
631
+ - spec/api/antifraud_api_spec.rb
632
+ - spec/api/subscriptions_api_spec.rb
625
633
  - spec/api_client_spec.rb
626
634
  - spec/configuration_spec.rb
627
635
  - spec/spec_helper.rb