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
@@ -6,17 +6,18 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **type** | **String** | | [optional] |
8
8
  | **object** | **String** | | |
9
- | **account_type** | **String** | | [optional] |
9
+ | **account_type** | **String** | Account type of the card | [optional] |
10
10
  | **auth_code** | **String** | | [optional] |
11
- | **brand** | **String** | | [optional] |
11
+ | **brand** | **String** | Brand of the card | [optional] |
12
12
  | **contract_id** | **String** | Id sent for recurrent charges. | [optional] |
13
- | **country** | **String** | | [optional] |
14
- | **exp_month** | **String** | | [optional] |
15
- | **exp_year** | **String** | | [optional] |
13
+ | **country** | **String** | Country of the card | [optional] |
14
+ | **exp_month** | **String** | Expiration month of the card | [optional] |
15
+ | **exp_year** | **String** | Expiration year of the card | [optional] |
16
16
  | **fraud_indicators** | **Array<Object>** | | [optional] |
17
- | **issuer** | **String** | | [optional] |
18
- | **last4** | **String** | | [optional] |
19
- | **name** | **String** | | [optional] |
17
+ | **issuer** | **String** | Issuer of the card | [optional] |
18
+ | **last4** | **String** | Last 4 digits of the card | [optional] |
19
+ | **name** | **String** | Name of the cardholder | [optional] |
20
+ | **customer_ip_address** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] |
20
21
 
21
22
  ## Example
22
23
 
@@ -32,11 +33,12 @@ instance = Conekta::PaymentMethodCard.new(
32
33
  contract_id: S781317595,
33
34
  country: MX,
34
35
  exp_month: 02,
35
- exp_year: 30,
36
+ exp_year: 2026,
36
37
  fraud_indicators: null,
37
38
  issuer: BANAMEX,
38
39
  last4: 4242,
39
- name: Fulanito Perez
40
+ name: Fulanito Perez,
41
+ customer_ip_address: 0.0.0.0
40
42
  )
41
43
  ```
42
44
 
@@ -5,7 +5,12 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **type** | **String** | Type of payment method | |
8
- | **token_id** | **String** | Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. | |
8
+ | **cvc** | **String** | Card security code | |
9
+ | **exp_month** | **String** | Card expiration month | |
10
+ | **exp_year** | **String** | Card expiration year | |
11
+ | **name** | **String** | Cardholder name | |
12
+ | **number** | **String** | Card number | |
13
+ | **customer_ip_address** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] |
9
14
 
10
15
  ## Example
11
16
 
@@ -14,7 +19,12 @@ require 'conekta'
14
19
 
15
20
  instance = Conekta::PaymentMethodCardRequest.new(
16
21
  type: card | cash | spei,
17
- token_id: tok_32hj4g234as
22
+ cvc: 198,
23
+ exp_month: 12,
24
+ exp_year: 2025,
25
+ name: John Doe,
26
+ number: 4242424242424242,
27
+ customer_ip_address: 0.0.0.0
18
28
  )
19
29
  ```
20
30
 
@@ -6,14 +6,17 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **type** | **String** | | [optional] |
8
8
  | **object** | **String** | | |
9
+ | **agreement** | **String** | Agreement ID | [optional] |
9
10
  | **auth_code** | **Integer** | | [optional] |
10
11
  | **cashier_id** | **String** | | [optional] |
11
12
  | **reference** | **String** | | [optional] |
12
13
  | **barcode_url** | **String** | | [optional] |
13
14
  | **expires_at** | **Integer** | | [optional] |
15
+ | **product_type** | **String** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional] |
14
16
  | **service_name** | **String** | | [optional] |
15
17
  | **store** | **String** | | [optional] |
16
18
  | **store_name** | **String** | | [optional] |
19
+ | **customer_ip_address** | **String** | | [optional] |
17
20
 
18
21
  ## Example
19
22
 
@@ -23,14 +26,17 @@ require 'conekta'
23
26
  instance = Conekta::PaymentMethodCash.new(
24
27
  type: null,
25
28
  object: payment_source,
29
+ agreement: agreement_2tN73UdUSNrYRPD9r,
26
30
  auth_code: 542563,
27
31
  cashier_id: OINM01010,
28
32
  reference: 93000262276908,
29
33
  barcode_url: https://pt-common-s3-stg.s3.amazonaws.com/644ebf80f2243197aad6cd8810375b905b613dbe.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA3UN6375MP4SLLCWV%2F20230203%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230203T215750Z&X-Amz-Expires=604800&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEH4aCXVzLWVhc3QtMSJGMEQCICd79cu7DYu%2F4%2B3HnVVswydgU9yHcE9kmQIIk2TLoZJrAiBVZ0HxVSeboK5lhdQSqADjwQF62XX35jhC%2F2riB0M8uCqQBAj2%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAIaDDc5OTgwMTA4MTY4OCIMXWZds9ZI5hzUdbeGKuQDFreMyeWnWWPqDuGZ2%2BHk6usCr%2Fl096%2FNJh9xtf8htLu56K%2FhWUTx%2BjiqFWM2O%2FF5zTS%2BIV6TqkLDZ%2BQ5Jo1miQrRmR57YDz6uP2Yd1mNZ1ouq5ipnNjUuu5UWCCBAmqyZQsrVmeMQpSV2IB%2BTERCCcW2SukFEYU%2F20%2Fzy5orsoZ8DxOW460IymR3cWBk5u3Xh2cV6Y1RdPEwDEThhqYEF5w%2ByKbLENloMsI%2FUm6sG5PPrO3yQOAP9aK2muLJs9lXQRU%2FL%2FSsmS4FKSUFOqlN6YU%2Bi2Y%2FyGIKAJT2VDkngvz5Sl%2Fadj0j%2BPKftVRV5FcEhySB6Rl%2BSkPN7kVQMJp6pS8hMJ6JCyEA%2BA3eWYdIfKgQhWVXAR4oCBfJ62DH8FU3a7WfSjjpTwfVkiReWen3GGCYfUWETTVKp46MKnJ9PG0CD3KzxKV8VfmEGc5krK%2FI%2F%2BDV2wtSa%2F9qf1%2BK1YYJIK9qZGb25ljUiGhTB4T%2BMUOSQFjetiWUoOJc5Q3Jz%2FXJbiTAMTST39MhdbCgiMgfrc8OGKN5DOVbex33Z7dn0xf%2FOCkSqurhLaG08efKQBdhLNS0RlE9hbg9yZ2ywwtQIF39fI6A7eeH0T11a5HMlvm51u4rAffPHRuEJfwJoIuj%2F2s3QzDg7%2FWeBjqmAbnPOlGfysjrDdvHyG7HVnaX02kdG%2BI3Q4PFOO4Mjaa3ocpjcfPT70%2BZ5a%2FSv5vP0jDLGrLToeM9%2BAUlNepptICRu23a1tLGW4ri0twPA%2FZ4JDTtUUUgdblyG8bKpcUTNp4oOsdmLLBz3FVyr4c2xQbDZSu2zYOtoOxB18W0AC6kIbsMWVU55Bf0mBhPeBWxGrtM4Kw1SgHHlt%2F8vetQi2OwtUcg08c%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=d06dfa41550003359f2aabc8006063a80dfd806a13a54d244024946a76aa9abc,
30
34
  expires_at: 0,
35
+ product_type: bbva_cash_in,
31
36
  service_name: OxxoPay,
32
37
  store: 10MON50EDI,
33
- store_name: OXXO
38
+ store_name: OXXO,
39
+ customer_ip_address: 0.0.0.0
34
40
  )
35
41
  ```
36
42
 
@@ -0,0 +1,32 @@
1
+ # Conekta::PaymentMethodGeneralRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **expires_at** | **Integer** | Method expiration date as unix timestamp | [optional] |
8
+ | **monthly_installments** | **Integer** | How many months without interest to apply, it can be 3, 6, 9, 12 or 18 | [optional] |
9
+ | **type** | **String** | Type of payment method | |
10
+ | **token_id** | **String** | | [optional] |
11
+ | **payment_source_id** | **String** | | [optional] |
12
+ | **cvc** | **String** | Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants | [optional] |
13
+ | **contract_id** | **String** | Optional id sent to indicate the bank contract for recurrent card charges. | [optional] |
14
+ | **customer_ip_address** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] |
15
+
16
+ ## Example
17
+
18
+ ```ruby
19
+ require 'conekta'
20
+
21
+ instance = Conekta::PaymentMethodGeneralRequest.new(
22
+ expires_at: 1677196303,
23
+ monthly_installments: null,
24
+ type: card,
25
+ token_id: tok_2897348234,
26
+ payment_source_id: src_2tLkkyfMPh6v7pFry,
27
+ cvc: 123,
28
+ contract_id: S781317595,
29
+ customer_ip_address: 0.0.0.0
30
+ )
31
+ ```
32
+
@@ -0,0 +1,20 @@
1
+ # Conekta::PaymentMethodTokenRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **type** | **String** | Type of payment method | |
8
+ | **token_id** | **String** | Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'conekta'
14
+
15
+ instance = Conekta::PaymentMethodTokenRequest.new(
16
+ type: card | cash | spei,
17
+ token_id: tok_32hj4g234as
18
+ )
19
+ ```
20
+
@@ -31,7 +31,7 @@ end
31
31
 
32
32
  api_instance = Conekta::PaymentMethodsApi.new
33
33
  id = '6307a60c41de27127515a575' # String | Identifier of the resource
34
- create_customer_payment_methods_request = Conekta::PaymentMethodCardRequest.new({type: 'card | cash | spei', token_id: 'tok_32hj4g234as'}) # CreateCustomerPaymentMethodsRequest | requested field for customer payment methods
34
+ create_customer_payment_methods_request = Conekta::PaymentMethodCashRequest.new({type: 'card | cash | spei'}) # CreateCustomerPaymentMethodsRequest | requested field for customer payment methods
35
35
  opts = {
36
36
  accept_language: 'es', # String | Use for knowing which language to use
37
37
  x_child_company_id: '6441b6376b60c3a638da80af' # String | In the case of a holding company, the company id of the child company to which will process the request.
@@ -4,11 +4,85 @@ All URIs are relative to *https://api.conekta.io*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
+ | [**cancel_payout_order_by_id**](PayoutOrdersApi.md#cancel_payout_order_by_id) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order |
7
8
  | [**create_payout_order**](PayoutOrdersApi.md#create_payout_order) | **POST** /payout_orders | Create payout order |
8
9
  | [**get_payout_order_by_id**](PayoutOrdersApi.md#get_payout_order_by_id) | **GET** /payout_orders/{id} | Get Payout Order |
9
10
  | [**get_payout_orders**](PayoutOrdersApi.md#get_payout_orders) | **GET** /payout_orders | Get a list of Payout Orders |
10
11
 
11
12
 
13
+ ## cancel_payout_order_by_id
14
+
15
+ > <PayoutOrderResponse> cancel_payout_order_by_id(id, opts)
16
+
17
+ Cancel Payout Order
18
+
19
+ Cancel a payout Order resource that corresponds to a payout order ID.
20
+
21
+ ### Examples
22
+
23
+ ```ruby
24
+ require 'time'
25
+ require 'conekta'
26
+ # setup authorization
27
+ Conekta.configure do |config|
28
+ # Configure Bearer authorization: bearerAuth
29
+ config.access_token = 'YOUR_BEARER_TOKEN'
30
+ end
31
+
32
+ api_instance = Conekta::PayoutOrdersApi.new
33
+ id = '6307a60c41de27127515a575' # String | Identifier of the resource
34
+ opts = {
35
+ accept_language: 'es' # String | Use for knowing which language to use
36
+ }
37
+
38
+ begin
39
+ # Cancel Payout Order
40
+ result = api_instance.cancel_payout_order_by_id(id, opts)
41
+ p result
42
+ rescue Conekta::ApiError => e
43
+ puts "Error when calling PayoutOrdersApi->cancel_payout_order_by_id: #{e}"
44
+ end
45
+ ```
46
+
47
+ #### Using the cancel_payout_order_by_id_with_http_info variant
48
+
49
+ This returns an Array which contains the response data, status code and headers.
50
+
51
+ > <Array(<PayoutOrderResponse>, Integer, Hash)> cancel_payout_order_by_id_with_http_info(id, opts)
52
+
53
+ ```ruby
54
+ begin
55
+ # Cancel Payout Order
56
+ data, status_code, headers = api_instance.cancel_payout_order_by_id_with_http_info(id, opts)
57
+ p status_code # => 2xx
58
+ p headers # => { ... }
59
+ p data # => <PayoutOrderResponse>
60
+ rescue Conekta::ApiError => e
61
+ puts "Error when calling PayoutOrdersApi->cancel_payout_order_by_id_with_http_info: #{e}"
62
+ end
63
+ ```
64
+
65
+ ### Parameters
66
+
67
+ | Name | Type | Description | Notes |
68
+ | ---- | ---- | ----------- | ----- |
69
+ | **id** | **String** | Identifier of the resource | |
70
+ | **accept_language** | **String** | Use for knowing which language to use | [optional][default to &#39;es&#39;] |
71
+
72
+ ### Return type
73
+
74
+ [**PayoutOrderResponse**](PayoutOrderResponse.md)
75
+
76
+ ### Authorization
77
+
78
+ [bearerAuth](../README.md#bearerAuth)
79
+
80
+ ### HTTP request headers
81
+
82
+ - **Content-Type**: Not defined
83
+ - **Accept**: application/vnd.conekta-v2.1.0+json
84
+
85
+
12
86
  ## create_payout_order
13
87
 
14
88
  > <PayoutOrderResponse> create_payout_order(payout_order, opts)
@@ -7,6 +7,7 @@
7
7
  | **billing_cycle_start** | **Integer** | | [optional] |
8
8
  | **billing_cycle_end** | **Integer** | | [optional] |
9
9
  | **canceled_at** | **Integer** | | [optional] |
10
+ | **canceled_reason** | **String** | Reason for cancellation. This field appears when the subscription status is &#39;canceled&#39;. | [optional] |
10
11
  | **card_id** | **String** | | [optional] |
11
12
  | **charge_id** | **String** | | [optional] |
12
13
  | **created_at** | **Integer** | | [optional] |
@@ -31,6 +32,7 @@ instance = Conekta::SubscriptionResponse.new(
31
32
  billing_cycle_start: 1677626827,
32
33
  billing_cycle_end: 1677626827,
33
34
  canceled_at: 1678258162,
35
+ canceled_reason: user_cancelation,
34
36
  card_id: src_2tKcHxhTz7xU5SymL,
35
37
  charge_id: 2tKcHxhTz7xU5SymL,
36
38
  created_at: 1677626837,
@@ -5,6 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **antifraud_info** | [**UpdateCustomerAntifraudInfo**](UpdateCustomerAntifraudInfo.md) | | [optional] |
8
+ | **date_of_birth** | **String** | It is a parameter that allows to identify the date of birth of the client. | [optional] |
8
9
  | **default_payment_source_id** | **String** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional] |
9
10
  | **email** | **String** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). | [optional] |
10
11
  | **name** | **String** | Client&#39;s name | [optional] |
@@ -15,6 +16,7 @@
15
16
  | **custom_reference** | **String** | It is an undefined value. | [optional] |
16
17
  | **fiscal_entities** | [**Array&lt;CustomerFiscalEntitiesRequest&gt;**](CustomerFiscalEntitiesRequest.md) | | [optional] |
17
18
  | **metadata** | **Hash&lt;String, Object&gt;** | | [optional] |
19
+ | **national_id** | **String** | It is a parameter that allows to identify the national identification number of the client. | [optional] |
18
20
  | **payment_sources** | [**Array&lt;CustomerPaymentMethodsRequest&gt;**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional] |
19
21
  | **shipping_contacts** | [**Array&lt;CustomerShippingContacts&gt;**](CustomerShippingContacts.md) | Contains the detail of the shipping addresses that the client has active or has used in Conekta | [optional] |
20
22
  | **subscription** | [**SubscriptionRequest**](SubscriptionRequest.md) | | [optional] |
@@ -26,6 +28,7 @@ require 'conekta'
26
28
 
27
29
  instance = Conekta::UpdateCustomer.new(
28
30
  antifraud_info: null,
31
+ date_of_birth: 24/07/1992,
29
32
  default_payment_source_id: src_1a2b3c4d5e6f7g8h,
30
33
  email: miguel@gmail.com,
31
34
  name: miguel,
@@ -36,6 +39,7 @@ instance = Conekta::UpdateCustomer.new(
36
39
  custom_reference: null,
37
40
  fiscal_entities: null,
38
41
  metadata: null,
42
+ national_id: HEGG560427MVZRRL04,
39
43
  payment_sources: null,
40
44
  shipping_contacts: null,
41
45
  subscription: null
@@ -188,6 +188,90 @@ module Conekta
188
188
  return data, status_code, headers
189
189
  end
190
190
 
191
+ # Create charges
192
+ # Create charges for an existing orden
193
+ # @param id [String] Identifier of the resource
194
+ # @param charge_request [ChargeRequest] requested field for a charge
195
+ # @param [Hash] opts the optional parameters
196
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
197
+ # @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request.
198
+ # @return [ChargesOrderResponse]
199
+ def orders_create_charges(id, charge_request, opts = {})
200
+ data, _status_code, _headers = orders_create_charges_with_http_info(id, charge_request, opts)
201
+ data
202
+ end
203
+
204
+ # Create charges
205
+ # Create charges for an existing orden
206
+ # @param id [String] Identifier of the resource
207
+ # @param charge_request [ChargeRequest] requested field for a charge
208
+ # @param [Hash] opts the optional parameters
209
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
210
+ # @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request.
211
+ # @return [Array<(ChargesOrderResponse, Integer, Hash)>] ChargesOrderResponse data, response status code and response headers
212
+ def orders_create_charges_with_http_info(id, charge_request, opts = {})
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug 'Calling API: ChargesApi.orders_create_charges ...'
215
+ end
216
+ # verify the required parameter 'id' is set
217
+ if @api_client.config.client_side_validation && id.nil?
218
+ fail ArgumentError, "Missing the required parameter 'id' when calling ChargesApi.orders_create_charges"
219
+ end
220
+ # verify the required parameter 'charge_request' is set
221
+ if @api_client.config.client_side_validation && charge_request.nil?
222
+ fail ArgumentError, "Missing the required parameter 'charge_request' when calling ChargesApi.orders_create_charges"
223
+ end
224
+ allowable_values = ["es", "en"]
225
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
226
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
227
+ end
228
+ # resource path
229
+ local_var_path = '/orders/{id}/add_charges'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
230
+
231
+ # query parameters
232
+ query_params = opts[:query_params] || {}
233
+
234
+ # header parameters
235
+ header_params = opts[:header_params] || {}
236
+ # HTTP header 'Accept' (if needed)
237
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
238
+ # HTTP header 'Content-Type'
239
+ content_type = @api_client.select_header_content_type(['application/json'])
240
+ if !content_type.nil?
241
+ header_params['Content-Type'] = content_type
242
+ end
243
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
244
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
245
+
246
+ # form parameters
247
+ form_params = opts[:form_params] || {}
248
+
249
+ # http body (model)
250
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(charge_request)
251
+
252
+ # return_type
253
+ return_type = opts[:debug_return_type] || 'ChargesOrderResponse'
254
+
255
+ # auth_names
256
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
257
+
258
+ new_options = opts.merge(
259
+ :operation => :"ChargesApi.orders_create_charges",
260
+ :header_params => header_params,
261
+ :query_params => query_params,
262
+ :form_params => form_params,
263
+ :body => post_body,
264
+ :auth_names => auth_names,
265
+ :return_type => return_type
266
+ )
267
+
268
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
269
+ if @api_client.config.debugging
270
+ @api_client.config.logger.debug "API called: ChargesApi#orders_create_charges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
271
+ end
272
+ return data, status_code, headers
273
+ end
274
+
191
275
  # Update a charge
192
276
  # @param id [String] Identifier of the resource
193
277
  # @param charge_update_request [ChargeUpdateRequest] requested field for update a charge
@@ -19,6 +19,76 @@ module Conekta
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Cancel Payout Order
23
+ # Cancel a payout Order resource that corresponds to a payout order ID.
24
+ # @param id [String] Identifier of the resource
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
27
+ # @return [PayoutOrderResponse]
28
+ def cancel_payout_order_by_id(id, opts = {})
29
+ data, _status_code, _headers = cancel_payout_order_by_id_with_http_info(id, opts)
30
+ data
31
+ end
32
+
33
+ # Cancel Payout Order
34
+ # Cancel a payout Order resource that corresponds to a payout order ID.
35
+ # @param id [String] Identifier of the resource
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
38
+ # @return [Array<(PayoutOrderResponse, Integer, Hash)>] PayoutOrderResponse data, response status code and response headers
39
+ def cancel_payout_order_by_id_with_http_info(id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: PayoutOrdersApi.cancel_payout_order_by_id ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling PayoutOrdersApi.cancel_payout_order_by_id"
46
+ end
47
+ allowable_values = ["es", "en"]
48
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
49
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
50
+ end
51
+ # resource path
52
+ local_var_path = '/payout_orders/{id}/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
61
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body]
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'PayoutOrderResponse'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
74
+
75
+ new_options = opts.merge(
76
+ :operation => :"PayoutOrdersApi.cancel_payout_order_by_id",
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: PayoutOrdersApi#cancel_payout_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
22
92
  # Create payout order
23
93
  # Create a new payout order.
24
94
  # @param payout_order [PayoutOrder] requested field for payout order
@@ -16,6 +16,7 @@ require 'time'
16
16
  module Conekta
17
17
  # The charges to be made
18
18
  class ChargeRequest
19
+ # Amount to be charged in cents
19
20
  attr_accessor :amount
20
21
 
21
22
  attr_accessor :payment_method