conekta 6.0.4 → 7.0.0

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 (315) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +2 -2
  3. data/README.md +34 -16
  4. data/VERSION +1 -1
  5. data/conekta.gemspec +1 -1
  6. data/config-ruby.json +1 -1
  7. data/docs/AntifraudApi.md +6 -6
  8. data/docs/ApiKeyCreateResponse.md +2 -2
  9. data/docs/ApiKeyResponse.md +2 -2
  10. data/docs/ApiKeyResponseOnDelete.md +2 -2
  11. data/docs/ApiKeysApi.md +5 -5
  12. data/docs/BalancesApi.md +1 -1
  13. data/docs/ChargeOrderResponsePaymentMethod.md +3 -0
  14. data/docs/ChargeRequestPaymentMethod.md +3 -1
  15. data/docs/ChargeResponse.md +8 -8
  16. data/docs/ChargeResponsePaymentMethod.md +3 -0
  17. data/docs/ChargesApi.md +82 -4
  18. data/docs/ChargesDataResponse.md +8 -8
  19. data/docs/ChargesOrderResponse.md +22 -0
  20. data/docs/ChargesOrderResponseAllOfData.md +52 -0
  21. data/docs/Checkout.md +1 -1
  22. data/docs/CheckoutRequest.md +3 -1
  23. data/docs/CheckoutResponse.md +2 -2
  24. data/docs/CompaniesApi.md +2 -2
  25. data/docs/CreateCustomerPaymentMethodsResponse.md +1 -0
  26. data/docs/Customer.md +4 -0
  27. data/docs/CustomerPaymentMethodRequest.md +1 -1
  28. data/docs/CustomerPaymentMethodsData.md +1 -0
  29. data/docs/CustomerResponse.md +4 -0
  30. data/docs/CustomersApi.md +7 -7
  31. data/docs/DeleteApiKeysResponse.md +5 -3
  32. data/docs/DiscountsApi.md +5 -5
  33. data/docs/EventsApi.md +12 -12
  34. data/docs/GetCustomerPaymentMethodDataResponse.md +1 -0
  35. data/docs/LogResponse.md +3 -3
  36. data/docs/LogsApi.md +2 -2
  37. data/docs/LogsResponseData.md +3 -3
  38. data/docs/OrderChannelResponse.md +24 -0
  39. data/docs/{OrderResponseCharges.md → OrderChargesResponse.md} +2 -2
  40. data/docs/{OrderResponseDiscountLines.md → OrderDiscountLinesResponse.md} +2 -2
  41. data/docs/OrderRequest.md +5 -5
  42. data/docs/OrderResponse.md +3 -3
  43. data/docs/OrderResponseCheckout.md +4 -2
  44. data/docs/OrderUpdateRequest.md +3 -3
  45. data/docs/OrdersApi.md +8 -8
  46. data/docs/PaymentLinkApi.md +7 -7
  47. data/docs/PaymentMethodBankTransfer.md +1 -1
  48. data/docs/PaymentMethodBnplPayment.md +32 -0
  49. data/docs/PaymentMethodBnplRequest.md +28 -0
  50. data/docs/PaymentMethodCardRequest.md +1 -1
  51. data/docs/PaymentMethodCash.md +7 -3
  52. data/docs/PaymentMethodCashRequest.md +1 -1
  53. data/docs/PaymentMethodCashResponse.md +6 -4
  54. data/docs/PaymentMethodCashResponseAllOfAgreements.md +20 -0
  55. data/docs/PaymentMethodSpeiRequest.md +1 -1
  56. data/docs/PaymentMethodTokenRequest.md +3 -3
  57. data/docs/PaymentMethodsApi.md +5 -5
  58. data/docs/PayoutOrdersApi.md +77 -3
  59. data/docs/PlanRequest.md +5 -1
  60. data/docs/PlanResponse.md +5 -1
  61. data/docs/PlansApi.md +5 -5
  62. data/docs/ProductsApi.md +3 -3
  63. data/docs/ResendRequest.md +18 -0
  64. data/docs/ShippingContactsApi.md +3 -3
  65. data/docs/ShippingsApi.md +3 -3
  66. data/docs/SubscriptionsApi.md +793 -73
  67. data/docs/TaxesApi.md +3 -3
  68. data/docs/TokensApi.md +1 -1
  69. data/docs/TransactionsApi.md +2 -2
  70. data/docs/TransfersApi.md +2 -2
  71. data/docs/UpdateCustomer.md +4 -0
  72. data/docs/UpdateCustomerPaymentMethodsResponse.md +1 -0
  73. data/docs/WebhookKeysApi.md +5 -5
  74. data/docs/WebhookRequest.md +2 -2
  75. data/docs/WebhookResponse.md +10 -14
  76. data/docs/WebhookUpdateRequest.md +5 -5
  77. data/docs/WebhooksApi.md +8 -8
  78. data/lib/conekta/api/antifraud_api.rb +7 -7
  79. data/lib/conekta/api/api_keys_api.rb +6 -6
  80. data/lib/conekta/api/balances_api.rb +2 -2
  81. data/lib/conekta/api/charges_api.rb +88 -4
  82. data/lib/conekta/api/companies_api.rb +3 -3
  83. data/lib/conekta/api/customers_api.rb +8 -8
  84. data/lib/conekta/api/discounts_api.rb +6 -6
  85. data/lib/conekta/api/events_api.rb +21 -16
  86. data/lib/conekta/api/logs_api.rb +3 -3
  87. data/lib/conekta/api/orders_api.rb +9 -9
  88. data/lib/conekta/api/payment_link_api.rb +7 -7
  89. data/lib/conekta/api/payment_methods_api.rb +5 -5
  90. data/lib/conekta/api/payout_orders_api.rb +74 -4
  91. data/lib/conekta/api/plans_api.rb +6 -6
  92. data/lib/conekta/api/products_api.rb +4 -4
  93. data/lib/conekta/api/shipping_contacts_api.rb +4 -4
  94. data/lib/conekta/api/shippings_api.rb +4 -4
  95. data/lib/conekta/api/subscriptions_api.rb +826 -63
  96. data/lib/conekta/api/taxes_api.rb +4 -4
  97. data/lib/conekta/api/tokens_api.rb +2 -2
  98. data/lib/conekta/api/transactions_api.rb +3 -3
  99. data/lib/conekta/api/transfers_api.rb +3 -3
  100. data/lib/conekta/api/webhook_keys_api.rb +6 -6
  101. data/lib/conekta/api/webhooks_api.rb +7 -7
  102. data/lib/conekta/api_client.rb +1 -1
  103. data/lib/conekta/api_error.rb +1 -1
  104. data/lib/conekta/configuration.rb +1 -1
  105. data/lib/conekta/models/api_key_create_response.rb +13 -12
  106. data/lib/conekta/models/api_key_request.rb +1 -1
  107. data/lib/conekta/models/api_key_response.rb +13 -12
  108. data/lib/conekta/models/api_key_response_on_delete.rb +10 -9
  109. data/lib/conekta/models/api_key_update_request.rb +1 -1
  110. data/lib/conekta/models/balance_common_field.rb +1 -1
  111. data/lib/conekta/models/balance_response.rb +1 -1
  112. data/lib/conekta/models/blacklist_rule_response.rb +1 -1
  113. data/lib/conekta/models/charge_order_response.rb +1 -1
  114. data/lib/conekta/models/charge_order_response_payment_method.rb +3 -1
  115. data/lib/conekta/models/charge_request.rb +1 -1
  116. data/lib/conekta/models/charge_request_payment_method.rb +2 -1
  117. data/lib/conekta/models/charge_response.rb +58 -1
  118. data/lib/conekta/models/charge_response_channel.rb +1 -1
  119. data/lib/conekta/models/charge_response_payment_method.rb +3 -1
  120. data/lib/conekta/models/charge_response_refunds.rb +1 -1
  121. data/lib/conekta/models/charge_response_refunds_data.rb +1 -1
  122. data/lib/conekta/models/charge_update_request.rb +1 -1
  123. data/lib/conekta/models/charges_data_response.rb +58 -1
  124. data/lib/conekta/models/charges_order_response.rb +258 -0
  125. data/lib/conekta/models/charges_order_response_all_of_data.rb +439 -0
  126. data/lib/conekta/models/checkout.rb +1 -1
  127. data/lib/conekta/models/checkout_order_template.rb +1 -1
  128. data/lib/conekta/models/checkout_order_template_customer_info.rb +1 -1
  129. data/lib/conekta/models/checkout_request.rb +13 -3
  130. data/lib/conekta/models/checkout_response.rb +2 -1
  131. data/lib/conekta/models/checkouts_response.rb +1 -1
  132. data/lib/conekta/models/company_fiscal_info_address_response.rb +1 -1
  133. data/lib/conekta/models/company_fiscal_info_response.rb +1 -1
  134. data/lib/conekta/models/company_payout_destination_response.rb +1 -1
  135. data/lib/conekta/models/company_response.rb +1 -1
  136. data/lib/conekta/models/create_customer_fiscal_entities_response.rb +1 -1
  137. data/lib/conekta/models/create_customer_payment_methods_request.rb +1 -1
  138. data/lib/conekta/models/create_customer_payment_methods_response.rb +2 -1
  139. data/lib/conekta/models/create_risk_rules_data.rb +1 -1
  140. data/lib/conekta/models/customer.rb +22 -2
  141. data/lib/conekta/models/customer_address.rb +1 -1
  142. data/lib/conekta/models/customer_antifraud_info.rb +1 -1
  143. data/lib/conekta/models/customer_antifraud_info_response.rb +1 -1
  144. data/lib/conekta/models/customer_fiscal_entities_data_response.rb +1 -1
  145. data/lib/conekta/models/customer_fiscal_entities_request.rb +1 -1
  146. data/lib/conekta/models/customer_fiscal_entities_response.rb +1 -1
  147. data/lib/conekta/models/customer_info.rb +1 -1
  148. data/lib/conekta/models/customer_info_just_customer_id.rb +1 -1
  149. data/lib/conekta/models/customer_info_just_customer_id_response.rb +1 -1
  150. data/lib/conekta/models/customer_payment_method_request.rb +1 -1
  151. data/lib/conekta/models/customer_payment_methods_data.rb +2 -1
  152. data/lib/conekta/models/customer_payment_methods_request.rb +1 -1
  153. data/lib/conekta/models/customer_payment_methods_response.rb +1 -1
  154. data/lib/conekta/models/customer_response.rb +22 -2
  155. data/lib/conekta/models/customer_response_shipping_contacts.rb +1 -1
  156. data/lib/conekta/models/customer_shipping_contacts.rb +2 -2
  157. data/lib/conekta/models/customer_shipping_contacts_address.rb +1 -1
  158. data/lib/conekta/models/customer_shipping_contacts_data_response.rb +1 -1
  159. data/lib/conekta/models/customer_shipping_contacts_response.rb +1 -1
  160. data/lib/conekta/models/customer_shipping_contacts_response_address.rb +1 -1
  161. data/lib/conekta/models/customer_update_fiscal_entities_request.rb +1 -1
  162. data/lib/conekta/models/customer_update_shipping_contacts.rb +2 -2
  163. data/lib/conekta/models/customers_response.rb +1 -1
  164. data/lib/conekta/models/delete_api_keys_response.rb +22 -11
  165. data/lib/conekta/models/deleted_blacklist_rule_response.rb +1 -1
  166. data/lib/conekta/models/deleted_whitelist_rule_response.rb +1 -1
  167. data/lib/conekta/models/details.rb +1 -1
  168. data/lib/conekta/models/details_error.rb +1 -1
  169. data/lib/conekta/models/discount_lines_data_response.rb +1 -1
  170. data/lib/conekta/models/discount_lines_response.rb +1 -1
  171. data/lib/conekta/models/email_checkout_request.rb +1 -1
  172. data/lib/conekta/models/error.rb +1 -1
  173. data/lib/conekta/models/event_response.rb +1 -1
  174. data/lib/conekta/models/event_types.rb +1 -1
  175. data/lib/conekta/models/events_resend_response.rb +1 -1
  176. data/lib/conekta/models/fiscal_entity_address.rb +1 -1
  177. data/lib/conekta/models/get_api_keys_response.rb +1 -1
  178. data/lib/conekta/models/get_charges_response.rb +1 -1
  179. data/lib/conekta/models/get_companies_response.rb +1 -1
  180. data/lib/conekta/models/get_customer_payment_method_data_response.rb +2 -1
  181. data/lib/conekta/models/get_events_response.rb +1 -1
  182. data/lib/conekta/models/get_order_discount_lines_response.rb +1 -1
  183. data/lib/conekta/models/get_orders_response.rb +1 -1
  184. data/lib/conekta/models/get_payment_method_response.rb +1 -1
  185. data/lib/conekta/models/get_plans_response.rb +1 -1
  186. data/lib/conekta/models/get_transactions_response.rb +1 -1
  187. data/lib/conekta/models/get_transfers_response.rb +1 -1
  188. data/lib/conekta/models/get_webhook_keys_response.rb +1 -1
  189. data/lib/conekta/models/get_webhooks_response.rb +1 -1
  190. data/lib/conekta/models/log_response.rb +1 -1
  191. data/lib/conekta/models/logs_response.rb +1 -1
  192. data/lib/conekta/models/logs_response_data.rb +1 -1
  193. data/lib/conekta/models/order_capture_request.rb +1 -1
  194. data/lib/conekta/models/order_channel_response.rb +241 -0
  195. data/lib/conekta/models/order_charges_response.rb +258 -0
  196. data/lib/conekta/models/order_customer_info_response.rb +1 -1
  197. data/lib/conekta/models/order_discount_lines_request.rb +1 -1
  198. data/lib/conekta/models/order_discount_lines_response.rb +257 -0
  199. data/lib/conekta/models/order_fiscal_entity_address_response.rb +1 -1
  200. data/lib/conekta/models/order_fiscal_entity_request.rb +1 -1
  201. data/lib/conekta/models/order_fiscal_entity_response.rb +1 -1
  202. data/lib/conekta/models/order_next_action_response.rb +1 -1
  203. data/lib/conekta/models/order_next_action_response_redirect_to_url.rb +1 -1
  204. data/lib/conekta/models/order_refund_request.rb +1 -2
  205. data/lib/conekta/models/order_request.rb +6 -6
  206. data/lib/conekta/models/order_request_customer_info.rb +1 -1
  207. data/lib/conekta/models/order_response.rb +4 -4
  208. data/lib/conekta/models/order_response_checkout.rb +14 -2
  209. data/lib/conekta/models/order_response_customer_info.rb +1 -1
  210. data/lib/conekta/models/order_response_products.rb +1 -1
  211. data/lib/conekta/models/order_response_shipping_contact.rb +1 -1
  212. data/lib/conekta/models/order_tax_request.rb +1 -1
  213. data/lib/conekta/models/order_update_fiscal_entity_request.rb +1 -1
  214. data/lib/conekta/models/order_update_request.rb +4 -4
  215. data/lib/conekta/models/order_update_request_customer_info.rb +1 -1
  216. data/lib/conekta/models/orders_response.rb +1 -1
  217. data/lib/conekta/models/page.rb +1 -1
  218. data/lib/conekta/models/pagination.rb +1 -1
  219. data/lib/conekta/models/payment_method.rb +1 -1
  220. data/lib/conekta/models/payment_method_bank_transfer.rb +2 -2
  221. data/lib/conekta/models/payment_method_bnpl_payment.rb +311 -0
  222. data/lib/conekta/models/payment_method_bnpl_request.rb +348 -0
  223. data/lib/conekta/models/payment_method_card.rb +1 -1
  224. data/lib/conekta/models/payment_method_card_request.rb +1 -1
  225. data/lib/conekta/models/payment_method_card_response.rb +1 -1
  226. data/lib/conekta/models/payment_method_cash.rb +22 -2
  227. data/lib/conekta/models/payment_method_cash_request.rb +1 -1
  228. data/lib/conekta/models/payment_method_cash_response.rb +14 -2
  229. data/lib/conekta/models/payment_method_cash_response_all_of_agreements.rb +225 -0
  230. data/lib/conekta/models/payment_method_general_request.rb +1 -1
  231. data/lib/conekta/models/payment_method_response.rb +1 -1
  232. data/lib/conekta/models/payment_method_spei_recurrent.rb +1 -1
  233. data/lib/conekta/models/payment_method_spei_request.rb +1 -1
  234. data/lib/conekta/models/payment_method_token_request.rb +2 -2
  235. data/lib/conekta/models/payout.rb +1 -1
  236. data/lib/conekta/models/payout_method.rb +1 -1
  237. data/lib/conekta/models/payout_order.rb +1 -1
  238. data/lib/conekta/models/payout_order_payouts_item.rb +1 -1
  239. data/lib/conekta/models/payout_order_response.rb +1 -1
  240. data/lib/conekta/models/payout_order_response_customer_info.rb +1 -1
  241. data/lib/conekta/models/payout_orders_response.rb +1 -1
  242. data/lib/conekta/models/plan_request.rb +63 -5
  243. data/lib/conekta/models/plan_response.rb +24 -6
  244. data/lib/conekta/models/plan_update_request.rb +1 -1
  245. data/lib/conekta/models/product.rb +1 -1
  246. data/lib/conekta/models/product_data_response.rb +1 -1
  247. data/lib/conekta/models/product_order_response.rb +1 -1
  248. data/lib/conekta/models/resend_request.rb +224 -0
  249. data/lib/conekta/models/risk_rules_data.rb +1 -1
  250. data/lib/conekta/models/risk_rules_list.rb +1 -1
  251. data/lib/conekta/models/shipping_order_response.rb +1 -1
  252. data/lib/conekta/models/shipping_request.rb +1 -1
  253. data/lib/conekta/models/sms_checkout_request.rb +1 -1
  254. data/lib/conekta/models/subscription_events_response.rb +1 -1
  255. data/lib/conekta/models/subscription_request.rb +1 -1
  256. data/lib/conekta/models/subscription_response.rb +1 -1
  257. data/lib/conekta/models/subscription_update_request.rb +1 -1
  258. data/lib/conekta/models/token.rb +1 -1
  259. data/lib/conekta/models/token_card.rb +1 -1
  260. data/lib/conekta/models/token_checkout.rb +1 -1
  261. data/lib/conekta/models/token_response.rb +1 -1
  262. data/lib/conekta/models/token_response_checkout.rb +1 -1
  263. data/lib/conekta/models/transaction_response.rb +1 -1
  264. data/lib/conekta/models/transfer_destination_response.rb +1 -1
  265. data/lib/conekta/models/transfer_method_response.rb +1 -1
  266. data/lib/conekta/models/transfer_response.rb +1 -1
  267. data/lib/conekta/models/transfers_response.rb +1 -1
  268. data/lib/conekta/models/update_customer.rb +22 -2
  269. data/lib/conekta/models/update_customer_antifraud_info.rb +1 -1
  270. data/lib/conekta/models/update_customer_fiscal_entities_response.rb +1 -1
  271. data/lib/conekta/models/update_customer_payment_methods_response.rb +2 -1
  272. data/lib/conekta/models/update_order_discount_lines_request.rb +1 -1
  273. data/lib/conekta/models/update_order_tax_request.rb +1 -1
  274. data/lib/conekta/models/update_order_tax_response.rb +1 -1
  275. data/lib/conekta/models/update_payment_methods.rb +1 -1
  276. data/lib/conekta/models/update_product.rb +1 -1
  277. data/lib/conekta/models/webhook_key_create_response.rb +1 -1
  278. data/lib/conekta/models/webhook_key_delete_response.rb +1 -1
  279. data/lib/conekta/models/webhook_key_request.rb +1 -1
  280. data/lib/conekta/models/webhook_key_response.rb +1 -1
  281. data/lib/conekta/models/webhook_key_update_request.rb +1 -1
  282. data/lib/conekta/models/webhook_log.rb +1 -1
  283. data/lib/conekta/models/webhook_request.rb +11 -16
  284. data/lib/conekta/models/webhook_response.rb +28 -39
  285. data/lib/conekta/models/webhook_update_request.rb +20 -28
  286. data/lib/conekta/models/whitelistlist_rule_response.rb +1 -1
  287. data/lib/conekta/version.rb +2 -2
  288. data/lib/conekta.rb +10 -3
  289. data/spec/api/antifraud_api_spec.rb +8 -65
  290. data/spec/api/api_keys_api_spec.rb +7 -51
  291. data/spec/api/balances_api_spec.rb +3 -12
  292. data/spec/api/charges_api_spec.rb +30 -83
  293. data/spec/api/companies_api_spec.rb +5 -13
  294. data/spec/api/customers_api_spec.rb +13 -184
  295. data/spec/api/discounts_api_spec.rb +7 -46
  296. data/spec/api/events_api_spec.rb +7 -24
  297. data/spec/api/logs_api_spec.rb +3 -15
  298. data/spec/api/orders_api_spec.rb +19 -247
  299. data/spec/api/payment_link_api_spec.rb +9 -82
  300. data/spec/api/payment_methods_api_spec.rb +6 -41
  301. data/spec/api/payout_orders_api_spec.rb +14 -1
  302. data/spec/api/plans_api_spec.rb +7 -42
  303. data/spec/api/products_api_spec.rb +5 -30
  304. data/spec/api/shipping_contacts_api_spec.rb +5 -41
  305. data/spec/api/shippings_api_spec.rb +5 -32
  306. data/spec/api/subscriptions_api_spec.rb +168 -68
  307. data/spec/api/taxes_api_spec.rb +5 -34
  308. data/spec/api/tokens_api_spec.rb +3 -31
  309. data/spec/api/transactions_api_spec.rb +8 -21
  310. data/spec/api/transfers_api_spec.rb +4 -34
  311. data/spec/api/webhook_keys_api_spec.rb +7 -49
  312. data/spec/api/webhooks_api_spec.rb +9 -42
  313. data/spec/spec_helper.rb +1 -1
  314. metadata +36 -22
  315. data/spec/api/base_test.rb +0 -9
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Conekta sdk
5
5
 
6
- The version of the OpenAPI document: 2.1.0
6
+ The version of the OpenAPI document: 2.2.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.5.0
@@ -19,8 +19,8 @@ module Conekta
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Cancel Subscription
23
- # You can cancel the subscription to stop the plans that your customers consume
22
+ # Cancel Subscription [Deprecated]
23
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
24
24
  # @param id [String] Identifier of the resource
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -31,8 +31,8 @@ module Conekta
31
31
  data
32
32
  end
33
33
 
34
- # Cancel Subscription
35
- # You can cancel the subscription to stop the plans that your customers consume
34
+ # Cancel Subscription [Deprecated]
35
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
36
36
  # @param id [String] Identifier of the resource
37
37
  # @param [Hash] opts the optional parameters
38
38
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -59,7 +59,7 @@ module Conekta
59
59
  # header parameters
60
60
  header_params = opts[:header_params] || {}
61
61
  # HTTP header 'Accept' (if needed)
62
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
63
63
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
64
64
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
65
65
 
@@ -92,8 +92,8 @@ module Conekta
92
92
  return data, status_code, headers
93
93
  end
94
94
 
95
- # Create Subscription
96
- # You can create the subscription to include the plans that your customers consume
95
+ # Create Subscription [Deprecated]
96
+ # DEPRECATED: This endpoint will be removed in version 2.3.0. You can create the subscription to include the plans that your customers consume
97
97
  # @param id [String] Identifier of the resource
98
98
  # @param subscription_request [SubscriptionRequest] requested field for subscriptions
99
99
  # @param [Hash] opts the optional parameters
@@ -105,8 +105,8 @@ module Conekta
105
105
  data
106
106
  end
107
107
 
108
- # Create Subscription
109
- # You can create the subscription to include the plans that your customers consume
108
+ # Create Subscription [Deprecated]
109
+ # DEPRECATED: This endpoint will be removed in version 2.3.0. You can create the subscription to include the plans that your customers consume
110
110
  # @param id [String] Identifier of the resource
111
111
  # @param subscription_request [SubscriptionRequest] requested field for subscriptions
112
112
  # @param [Hash] opts the optional parameters
@@ -138,7 +138,7 @@ module Conekta
138
138
  # header parameters
139
139
  header_params = opts[:header_params] || {}
140
140
  # HTTP header 'Accept' (if needed)
141
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
141
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
142
142
  # HTTP header 'Content-Type'
143
143
  content_type = @api_client.select_header_content_type(['application/json'])
144
144
  if !content_type.nil?
@@ -176,39 +176,37 @@ module Conekta
176
176
  return data, status_code, headers
177
177
  end
178
178
 
179
- # Get Events By Subscription
180
- # You can get the events of the subscription(s) of a client, with the customer id
179
+ # Get Subscription [Deprecated]
180
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
181
181
  # @param id [String] Identifier of the resource
182
182
  # @param [Hash] opts the optional parameters
183
183
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
184
- # @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.
185
- # @return [SubscriptionEventsResponse]
186
- def get_all_events_from_subscription(id, opts = {})
187
- data, _status_code, _headers = get_all_events_from_subscription_with_http_info(id, opts)
184
+ # @return [SubscriptionResponse]
185
+ def get_subscription(id, opts = {})
186
+ data, _status_code, _headers = get_subscription_with_http_info(id, opts)
188
187
  data
189
188
  end
190
189
 
191
- # Get Events By Subscription
192
- # You can get the events of the subscription(s) of a client, with the customer id
190
+ # Get Subscription [Deprecated]
191
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
193
192
  # @param id [String] Identifier of the resource
194
193
  # @param [Hash] opts the optional parameters
195
194
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
196
- # @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.
197
- # @return [Array<(SubscriptionEventsResponse, Integer, Hash)>] SubscriptionEventsResponse data, response status code and response headers
198
- def get_all_events_from_subscription_with_http_info(id, opts = {})
195
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
196
+ def get_subscription_with_http_info(id, opts = {})
199
197
  if @api_client.config.debugging
200
- @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_all_events_from_subscription ...'
198
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription ...'
201
199
  end
202
200
  # verify the required parameter 'id' is set
203
201
  if @api_client.config.client_side_validation && id.nil?
204
- fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.get_all_events_from_subscription"
202
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.get_subscription"
205
203
  end
206
204
  allowable_values = ["es", "en"]
207
205
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
208
206
  fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
209
207
  end
210
208
  # resource path
211
- local_var_path = '/customers/{id}/subscription/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
209
+ local_var_path = '/customers/{id}/subscription'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
212
210
 
213
211
  # query parameters
214
212
  query_params = opts[:query_params] || {}
@@ -216,9 +214,8 @@ module Conekta
216
214
  # header parameters
217
215
  header_params = opts[:header_params] || {}
218
216
  # HTTP header 'Accept' (if needed)
219
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
217
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
220
218
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
221
- header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
222
219
 
223
220
  # form parameters
224
221
  form_params = opts[:form_params] || {}
@@ -227,13 +224,13 @@ module Conekta
227
224
  post_body = opts[:debug_body]
228
225
 
229
226
  # return_type
230
- return_type = opts[:debug_return_type] || 'SubscriptionEventsResponse'
227
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
231
228
 
232
229
  # auth_names
233
230
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
234
231
 
235
232
  new_options = opts.merge(
236
- :operation => :"SubscriptionsApi.get_all_events_from_subscription",
233
+ :operation => :"SubscriptionsApi.get_subscription",
237
234
  :header_params => header_params,
238
235
  :query_params => query_params,
239
236
  :form_params => form_params,
@@ -244,40 +241,44 @@ module Conekta
244
241
 
245
242
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
246
243
  if @api_client.config.debugging
247
- @api_client.config.logger.debug "API called: SubscriptionsApi#get_all_events_from_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
244
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
245
  end
249
246
  return data, status_code, headers
250
247
  end
251
248
 
252
- # Get Subscription
249
+ # Get Subscription Events [Deprecated]
250
+ # DEPRECATED: This endpoint will be removed in version 2.3.0. You can get the events of the subscription(s) of a client, with the customer id
253
251
  # @param id [String] Identifier of the resource
254
252
  # @param [Hash] opts the optional parameters
255
253
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
256
- # @return [SubscriptionResponse]
257
- def get_subscription(id, opts = {})
258
- data, _status_code, _headers = get_subscription_with_http_info(id, opts)
254
+ # @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.
255
+ # @return [SubscriptionEventsResponse]
256
+ def get_subscription_events(id, opts = {})
257
+ data, _status_code, _headers = get_subscription_events_with_http_info(id, opts)
259
258
  data
260
259
  end
261
260
 
262
- # Get Subscription
261
+ # Get Subscription Events [Deprecated]
262
+ # DEPRECATED: This endpoint will be removed in version 2.3.0. You can get the events of the subscription(s) of a client, with the customer id
263
263
  # @param id [String] Identifier of the resource
264
264
  # @param [Hash] opts the optional parameters
265
265
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
266
- # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
267
- def get_subscription_with_http_info(id, opts = {})
266
+ # @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.
267
+ # @return [Array<(SubscriptionEventsResponse, Integer, Hash)>] SubscriptionEventsResponse data, response status code and response headers
268
+ def get_subscription_events_with_http_info(id, opts = {})
268
269
  if @api_client.config.debugging
269
- @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription ...'
270
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription_events ...'
270
271
  end
271
272
  # verify the required parameter 'id' is set
272
273
  if @api_client.config.client_side_validation && id.nil?
273
- fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.get_subscription"
274
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.get_subscription_events"
274
275
  end
275
276
  allowable_values = ["es", "en"]
276
277
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
277
278
  fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
278
279
  end
279
280
  # resource path
280
- local_var_path = '/customers/{id}/subscription'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
281
+ local_var_path = '/customers/{id}/subscription/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
281
282
 
282
283
  # query parameters
283
284
  query_params = opts[:query_params] || {}
@@ -285,8 +286,9 @@ module Conekta
285
286
  # header parameters
286
287
  header_params = opts[:header_params] || {}
287
288
  # HTTP header 'Accept' (if needed)
288
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
289
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
289
290
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
291
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
290
292
 
291
293
  # form parameters
292
294
  form_params = opts[:form_params] || {}
@@ -295,13 +297,13 @@ module Conekta
295
297
  post_body = opts[:debug_body]
296
298
 
297
299
  # return_type
298
- return_type = opts[:debug_return_type] || 'SubscriptionResponse'
300
+ return_type = opts[:debug_return_type] || 'SubscriptionEventsResponse'
299
301
 
300
302
  # auth_names
301
303
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
302
304
 
303
305
  new_options = opts.merge(
304
- :operation => :"SubscriptionsApi.get_subscription",
306
+ :operation => :"SubscriptionsApi.get_subscription_events",
305
307
  :header_params => header_params,
306
308
  :query_params => query_params,
307
309
  :form_params => form_params,
@@ -312,13 +314,13 @@ module Conekta
312
314
 
313
315
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
314
316
  if @api_client.config.debugging
315
- @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
317
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
316
318
  end
317
319
  return data, status_code, headers
318
320
  end
319
321
 
320
- # Pause Subscription
321
- # You can pause the subscription to stop the plans that your customers consume
322
+ # Pause Subscription [Deprecated]
323
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
322
324
  # @param id [String] Identifier of the resource
323
325
  # @param [Hash] opts the optional parameters
324
326
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -329,8 +331,8 @@ module Conekta
329
331
  data
330
332
  end
331
333
 
332
- # Pause Subscription
333
- # You can pause the subscription to stop the plans that your customers consume
334
+ # Pause Subscription [Deprecated]
335
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
334
336
  # @param id [String] Identifier of the resource
335
337
  # @param [Hash] opts the optional parameters
336
338
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -357,7 +359,7 @@ module Conekta
357
359
  # header parameters
358
360
  header_params = opts[:header_params] || {}
359
361
  # HTTP header 'Accept' (if needed)
360
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
362
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
361
363
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
362
364
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
363
365
 
@@ -390,8 +392,8 @@ module Conekta
390
392
  return data, status_code, headers
391
393
  end
392
394
 
393
- # Resume Subscription
394
- # You can resume the subscription to start the plans that your customers consume
395
+ # Resume Subscription [Deprecated]
396
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
395
397
  # @param id [String] Identifier of the resource
396
398
  # @param [Hash] opts the optional parameters
397
399
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -402,8 +404,8 @@ module Conekta
402
404
  data
403
405
  end
404
406
 
405
- # Resume Subscription
406
- # You can resume the subscription to start the plans that your customers consume
407
+ # Resume Subscription [Deprecated]
408
+ # DEPRECATED: This endpoint will be removed in version 2.3.0.
407
409
  # @param id [String] Identifier of the resource
408
410
  # @param [Hash] opts the optional parameters
409
411
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -430,7 +432,7 @@ module Conekta
430
432
  # header parameters
431
433
  header_params = opts[:header_params] || {}
432
434
  # HTTP header 'Accept' (if needed)
433
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
435
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
434
436
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
435
437
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
436
438
 
@@ -463,21 +465,782 @@ module Conekta
463
465
  return data, status_code, headers
464
466
  end
465
467
 
466
- # Update Subscription
467
- # You can modify the subscription to change the plans that your customers consume
468
- # @param id [String] Identifier of the resource
469
- # @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription
468
+ # Cancel Subscription
469
+ # Cancel a specific subscription
470
+ # @param customer_id [String] Identifier of the customer resource
471
+ # @param id [String] Identifier of the subscription resource
470
472
  # @param [Hash] opts the optional parameters
471
473
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
472
474
  # @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.
473
475
  # @return [SubscriptionResponse]
474
- def update_subscription(id, subscription_update_request, opts = {})
475
- data, _status_code, _headers = update_subscription_with_http_info(id, subscription_update_request, opts)
476
+ def subscription_cancel(customer_id, id, opts = {})
477
+ data, _status_code, _headers = subscription_cancel_with_http_info(customer_id, id, opts)
476
478
  data
477
479
  end
478
480
 
479
- # Update Subscription
480
- # You can modify the subscription to change the plans that your customers consume
481
+ # Cancel Subscription
482
+ # Cancel a specific subscription
483
+ # @param customer_id [String] Identifier of the customer resource
484
+ # @param id [String] Identifier of the subscription resource
485
+ # @param [Hash] opts the optional parameters
486
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
487
+ # @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.
488
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
489
+ def subscription_cancel_with_http_info(customer_id, id, opts = {})
490
+ if @api_client.config.debugging
491
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_cancel ...'
492
+ end
493
+ # verify the required parameter 'customer_id' is set
494
+ if @api_client.config.client_side_validation && customer_id.nil?
495
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_cancel"
496
+ end
497
+ # verify the required parameter 'id' is set
498
+ if @api_client.config.client_side_validation && id.nil?
499
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_cancel"
500
+ end
501
+ allowable_values = ["es", "en"]
502
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
503
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
504
+ end
505
+ # resource path
506
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}/cancel'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
507
+
508
+ # query parameters
509
+ query_params = opts[:query_params] || {}
510
+
511
+ # header parameters
512
+ header_params = opts[:header_params] || {}
513
+ # HTTP header 'Accept' (if needed)
514
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
515
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
516
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
517
+
518
+ # form parameters
519
+ form_params = opts[:form_params] || {}
520
+
521
+ # http body (model)
522
+ post_body = opts[:debug_body]
523
+
524
+ # return_type
525
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
526
+
527
+ # auth_names
528
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
529
+
530
+ new_options = opts.merge(
531
+ :operation => :"SubscriptionsApi.subscription_cancel",
532
+ :header_params => header_params,
533
+ :query_params => query_params,
534
+ :form_params => form_params,
535
+ :body => post_body,
536
+ :auth_names => auth_names,
537
+ :return_type => return_type
538
+ )
539
+
540
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
541
+ if @api_client.config.debugging
542
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
543
+ end
544
+ return data, status_code, headers
545
+ end
546
+
547
+ # Create Subscription
548
+ # Create a new subscription for a customer (keeps existing subscriptions active)
549
+ # @param customer_id [String] Identifier of the customer resource
550
+ # @param subscription_request [SubscriptionRequest] requested field for subscriptions
551
+ # @param [Hash] opts the optional parameters
552
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
553
+ # @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.
554
+ # @return [SubscriptionResponse]
555
+ def subscription_create(customer_id, subscription_request, opts = {})
556
+ data, _status_code, _headers = subscription_create_with_http_info(customer_id, subscription_request, opts)
557
+ data
558
+ end
559
+
560
+ # Create Subscription
561
+ # Create a new subscription for a customer (keeps existing subscriptions active)
562
+ # @param customer_id [String] Identifier of the customer resource
563
+ # @param subscription_request [SubscriptionRequest] requested field for subscriptions
564
+ # @param [Hash] opts the optional parameters
565
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
566
+ # @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.
567
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
568
+ def subscription_create_with_http_info(customer_id, subscription_request, opts = {})
569
+ if @api_client.config.debugging
570
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_create ...'
571
+ end
572
+ # verify the required parameter 'customer_id' is set
573
+ if @api_client.config.client_side_validation && customer_id.nil?
574
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_create"
575
+ end
576
+ # verify the required parameter 'subscription_request' is set
577
+ if @api_client.config.client_side_validation && subscription_request.nil?
578
+ fail ArgumentError, "Missing the required parameter 'subscription_request' when calling SubscriptionsApi.subscription_create"
579
+ end
580
+ allowable_values = ["es", "en"]
581
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
582
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
583
+ end
584
+ # resource path
585
+ local_var_path = '/customers/{customer_id}/subscriptions'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s))
586
+
587
+ # query parameters
588
+ query_params = opts[:query_params] || {}
589
+
590
+ # header parameters
591
+ header_params = opts[:header_params] || {}
592
+ # HTTP header 'Accept' (if needed)
593
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
594
+ # HTTP header 'Content-Type'
595
+ content_type = @api_client.select_header_content_type(['application/json'])
596
+ if !content_type.nil?
597
+ header_params['Content-Type'] = content_type
598
+ end
599
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
600
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
601
+
602
+ # form parameters
603
+ form_params = opts[:form_params] || {}
604
+
605
+ # http body (model)
606
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_request)
607
+
608
+ # return_type
609
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
610
+
611
+ # auth_names
612
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
613
+
614
+ new_options = opts.merge(
615
+ :operation => :"SubscriptionsApi.subscription_create",
616
+ :header_params => header_params,
617
+ :query_params => query_params,
618
+ :form_params => form_params,
619
+ :body => post_body,
620
+ :auth_names => auth_names,
621
+ :return_type => return_type
622
+ )
623
+
624
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
625
+ if @api_client.config.debugging
626
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
627
+ end
628
+ return data, status_code, headers
629
+ end
630
+
631
+ # Get Subscription Events
632
+ # Get events for a specific subscription
633
+ # @param customer_id [String] Identifier of the customer resource
634
+ # @param id [String] Identifier of the subscription resource
635
+ # @param [Hash] opts the optional parameters
636
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
637
+ # @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.
638
+ # @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20)
639
+ # @option opts [String] :search General order search, e.g. by mail, reference etc.
640
+ # @option opts [String] :_next next page
641
+ # @option opts [String] :previous previous page
642
+ # @return [SubscriptionEventsResponse]
643
+ def subscription_events(customer_id, id, opts = {})
644
+ data, _status_code, _headers = subscription_events_with_http_info(customer_id, id, opts)
645
+ data
646
+ end
647
+
648
+ # Get Subscription Events
649
+ # Get events for a specific subscription
650
+ # @param customer_id [String] Identifier of the customer resource
651
+ # @param id [String] Identifier of the subscription resource
652
+ # @param [Hash] opts the optional parameters
653
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
654
+ # @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.
655
+ # @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20)
656
+ # @option opts [String] :search General order search, e.g. by mail, reference etc.
657
+ # @option opts [String] :_next next page
658
+ # @option opts [String] :previous previous page
659
+ # @return [Array<(SubscriptionEventsResponse, Integer, Hash)>] SubscriptionEventsResponse data, response status code and response headers
660
+ def subscription_events_with_http_info(customer_id, id, opts = {})
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_events ...'
663
+ end
664
+ # verify the required parameter 'customer_id' is set
665
+ if @api_client.config.client_side_validation && customer_id.nil?
666
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_events"
667
+ end
668
+ # verify the required parameter 'id' is set
669
+ if @api_client.config.client_side_validation && id.nil?
670
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_events"
671
+ end
672
+ allowable_values = ["es", "en"]
673
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
674
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
675
+ end
676
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
677
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_events, must be smaller than or equal to 250.'
678
+ end
679
+
680
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
681
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_events, must be greater than or equal to 1.'
682
+ end
683
+
684
+ # resource path
685
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}/events'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
686
+
687
+ # query parameters
688
+ query_params = opts[:query_params] || {}
689
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
690
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
691
+ query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?
692
+ query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?
693
+
694
+ # header parameters
695
+ header_params = opts[:header_params] || {}
696
+ # HTTP header 'Accept' (if needed)
697
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
698
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
699
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
700
+
701
+ # form parameters
702
+ form_params = opts[:form_params] || {}
703
+
704
+ # http body (model)
705
+ post_body = opts[:debug_body]
706
+
707
+ # return_type
708
+ return_type = opts[:debug_return_type] || 'SubscriptionEventsResponse'
709
+
710
+ # auth_names
711
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
712
+
713
+ new_options = opts.merge(
714
+ :operation => :"SubscriptionsApi.subscription_events",
715
+ :header_params => header_params,
716
+ :query_params => query_params,
717
+ :form_params => form_params,
718
+ :body => post_body,
719
+ :auth_names => auth_names,
720
+ :return_type => return_type
721
+ )
722
+
723
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
724
+ if @api_client.config.debugging
725
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
726
+ end
727
+ return data, status_code, headers
728
+ end
729
+
730
+ # List Subscriptions
731
+ # Get a list of subscriptions for a customer
732
+ # @param customer_id [String] Identifier of the customer resource
733
+ # @param [Hash] opts the optional parameters
734
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
735
+ # @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.
736
+ # @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20)
737
+ # @option opts [String] :search General order search, e.g. by mail, reference etc.
738
+ # @option opts [String] :_next next page
739
+ # @option opts [String] :previous previous page
740
+ # @return [SubscriptionResponse]
741
+ def subscription_list(customer_id, opts = {})
742
+ data, _status_code, _headers = subscription_list_with_http_info(customer_id, opts)
743
+ data
744
+ end
745
+
746
+ # List Subscriptions
747
+ # Get a list of subscriptions for a customer
748
+ # @param customer_id [String] Identifier of the customer resource
749
+ # @param [Hash] opts the optional parameters
750
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
751
+ # @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.
752
+ # @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20)
753
+ # @option opts [String] :search General order search, e.g. by mail, reference etc.
754
+ # @option opts [String] :_next next page
755
+ # @option opts [String] :previous previous page
756
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
757
+ def subscription_list_with_http_info(customer_id, opts = {})
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_list ...'
760
+ end
761
+ # verify the required parameter 'customer_id' is set
762
+ if @api_client.config.client_side_validation && customer_id.nil?
763
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_list"
764
+ end
765
+ allowable_values = ["es", "en"]
766
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
767
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
768
+ end
769
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
770
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_list, must be smaller than or equal to 250.'
771
+ end
772
+
773
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
774
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_list, must be greater than or equal to 1.'
775
+ end
776
+
777
+ # resource path
778
+ local_var_path = '/customers/{customer_id}/subscriptions'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s))
779
+
780
+ # query parameters
781
+ query_params = opts[:query_params] || {}
782
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
783
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
784
+ query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?
785
+ query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?
786
+
787
+ # header parameters
788
+ header_params = opts[:header_params] || {}
789
+ # HTTP header 'Accept' (if needed)
790
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
791
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
792
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
793
+
794
+ # form parameters
795
+ form_params = opts[:form_params] || {}
796
+
797
+ # http body (model)
798
+ post_body = opts[:debug_body]
799
+
800
+ # return_type
801
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
802
+
803
+ # auth_names
804
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
805
+
806
+ new_options = opts.merge(
807
+ :operation => :"SubscriptionsApi.subscription_list",
808
+ :header_params => header_params,
809
+ :query_params => query_params,
810
+ :form_params => form_params,
811
+ :body => post_body,
812
+ :auth_names => auth_names,
813
+ :return_type => return_type
814
+ )
815
+
816
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
817
+ if @api_client.config.debugging
818
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
819
+ end
820
+ return data, status_code, headers
821
+ end
822
+
823
+ # Pause Subscription
824
+ # Pause a specific subscription
825
+ # @param customer_id [String] Identifier of the customer resource
826
+ # @param id [String] Identifier of the subscription resource
827
+ # @param [Hash] opts the optional parameters
828
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
829
+ # @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.
830
+ # @return [SubscriptionResponse]
831
+ def subscription_pause(customer_id, id, opts = {})
832
+ data, _status_code, _headers = subscription_pause_with_http_info(customer_id, id, opts)
833
+ data
834
+ end
835
+
836
+ # Pause Subscription
837
+ # Pause a specific subscription
838
+ # @param customer_id [String] Identifier of the customer resource
839
+ # @param id [String] Identifier of the subscription resource
840
+ # @param [Hash] opts the optional parameters
841
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
842
+ # @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.
843
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
844
+ def subscription_pause_with_http_info(customer_id, id, opts = {})
845
+ if @api_client.config.debugging
846
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_pause ...'
847
+ end
848
+ # verify the required parameter 'customer_id' is set
849
+ if @api_client.config.client_side_validation && customer_id.nil?
850
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_pause"
851
+ end
852
+ # verify the required parameter 'id' is set
853
+ if @api_client.config.client_side_validation && id.nil?
854
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_pause"
855
+ end
856
+ allowable_values = ["es", "en"]
857
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
858
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
859
+ end
860
+ # resource path
861
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}/pause'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
862
+
863
+ # query parameters
864
+ query_params = opts[:query_params] || {}
865
+
866
+ # header parameters
867
+ header_params = opts[:header_params] || {}
868
+ # HTTP header 'Accept' (if needed)
869
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
870
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
871
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
872
+
873
+ # form parameters
874
+ form_params = opts[:form_params] || {}
875
+
876
+ # http body (model)
877
+ post_body = opts[:debug_body]
878
+
879
+ # return_type
880
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
881
+
882
+ # auth_names
883
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
884
+
885
+ new_options = opts.merge(
886
+ :operation => :"SubscriptionsApi.subscription_pause",
887
+ :header_params => header_params,
888
+ :query_params => query_params,
889
+ :form_params => form_params,
890
+ :body => post_body,
891
+ :auth_names => auth_names,
892
+ :return_type => return_type
893
+ )
894
+
895
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
896
+ if @api_client.config.debugging
897
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_pause\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
898
+ end
899
+ return data, status_code, headers
900
+ end
901
+
902
+ # Resume Subscription
903
+ # Resume a specific paused subscription
904
+ # @param customer_id [String] Identifier of the customer resource
905
+ # @param id [String] Identifier of the subscription resource
906
+ # @param [Hash] opts the optional parameters
907
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
908
+ # @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.
909
+ # @return [SubscriptionResponse]
910
+ def subscription_resume(customer_id, id, opts = {})
911
+ data, _status_code, _headers = subscription_resume_with_http_info(customer_id, id, opts)
912
+ data
913
+ end
914
+
915
+ # Resume Subscription
916
+ # Resume a specific paused subscription
917
+ # @param customer_id [String] Identifier of the customer resource
918
+ # @param id [String] Identifier of the subscription resource
919
+ # @param [Hash] opts the optional parameters
920
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
921
+ # @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.
922
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
923
+ def subscription_resume_with_http_info(customer_id, id, opts = {})
924
+ if @api_client.config.debugging
925
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_resume ...'
926
+ end
927
+ # verify the required parameter 'customer_id' is set
928
+ if @api_client.config.client_side_validation && customer_id.nil?
929
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_resume"
930
+ end
931
+ # verify the required parameter 'id' is set
932
+ if @api_client.config.client_side_validation && id.nil?
933
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_resume"
934
+ end
935
+ allowable_values = ["es", "en"]
936
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
937
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
938
+ end
939
+ # resource path
940
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}/resume'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
941
+
942
+ # query parameters
943
+ query_params = opts[:query_params] || {}
944
+
945
+ # header parameters
946
+ header_params = opts[:header_params] || {}
947
+ # HTTP header 'Accept' (if needed)
948
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
949
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
950
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
951
+
952
+ # form parameters
953
+ form_params = opts[:form_params] || {}
954
+
955
+ # http body (model)
956
+ post_body = opts[:debug_body]
957
+
958
+ # return_type
959
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
960
+
961
+ # auth_names
962
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
963
+
964
+ new_options = opts.merge(
965
+ :operation => :"SubscriptionsApi.subscription_resume",
966
+ :header_params => header_params,
967
+ :query_params => query_params,
968
+ :form_params => form_params,
969
+ :body => post_body,
970
+ :auth_names => auth_names,
971
+ :return_type => return_type
972
+ )
973
+
974
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
975
+ if @api_client.config.debugging
976
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_resume\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
977
+ end
978
+ return data, status_code, headers
979
+ end
980
+
981
+ # Update Subscription
982
+ # Update a specific subscription
983
+ # @param customer_id [String] Identifier of the customer resource
984
+ # @param id [String] Identifier of the subscription resource
985
+ # @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription
986
+ # @param [Hash] opts the optional parameters
987
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
988
+ # @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.
989
+ # @return [SubscriptionResponse]
990
+ def subscription_update(customer_id, id, subscription_update_request, opts = {})
991
+ data, _status_code, _headers = subscription_update_with_http_info(customer_id, id, subscription_update_request, opts)
992
+ data
993
+ end
994
+
995
+ # Update Subscription
996
+ # Update a specific subscription
997
+ # @param customer_id [String] Identifier of the customer resource
998
+ # @param id [String] Identifier of the subscription resource
999
+ # @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription
1000
+ # @param [Hash] opts the optional parameters
1001
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
1002
+ # @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.
1003
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
1004
+ def subscription_update_with_http_info(customer_id, id, subscription_update_request, opts = {})
1005
+ if @api_client.config.debugging
1006
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_update ...'
1007
+ end
1008
+ # verify the required parameter 'customer_id' is set
1009
+ if @api_client.config.client_side_validation && customer_id.nil?
1010
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_update"
1011
+ end
1012
+ # verify the required parameter 'id' is set
1013
+ if @api_client.config.client_side_validation && id.nil?
1014
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_update"
1015
+ end
1016
+ # verify the required parameter 'subscription_update_request' is set
1017
+ if @api_client.config.client_side_validation && subscription_update_request.nil?
1018
+ fail ArgumentError, "Missing the required parameter 'subscription_update_request' when calling SubscriptionsApi.subscription_update"
1019
+ end
1020
+ allowable_values = ["es", "en"]
1021
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
1022
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
1023
+ end
1024
+ # resource path
1025
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
1026
+
1027
+ # query parameters
1028
+ query_params = opts[:query_params] || {}
1029
+
1030
+ # header parameters
1031
+ header_params = opts[:header_params] || {}
1032
+ # HTTP header 'Accept' (if needed)
1033
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
1034
+ # HTTP header 'Content-Type'
1035
+ content_type = @api_client.select_header_content_type(['application/json'])
1036
+ if !content_type.nil?
1037
+ header_params['Content-Type'] = content_type
1038
+ end
1039
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
1040
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
1041
+
1042
+ # form parameters
1043
+ form_params = opts[:form_params] || {}
1044
+
1045
+ # http body (model)
1046
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_update_request)
1047
+
1048
+ # return_type
1049
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
1050
+
1051
+ # auth_names
1052
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1053
+
1054
+ new_options = opts.merge(
1055
+ :operation => :"SubscriptionsApi.subscription_update",
1056
+ :header_params => header_params,
1057
+ :query_params => query_params,
1058
+ :form_params => form_params,
1059
+ :body => post_body,
1060
+ :auth_names => auth_names,
1061
+ :return_type => return_type
1062
+ )
1063
+
1064
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1065
+ if @api_client.config.debugging
1066
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1067
+ end
1068
+ return data, status_code, headers
1069
+ end
1070
+
1071
+ # Get Subscription
1072
+ # Retrieve a specific subscription
1073
+ # @param customer_id [String] Identifier of the customer resource
1074
+ # @param id [String] Identifier of the subscription resource
1075
+ # @param [Hash] opts the optional parameters
1076
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
1077
+ # @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.
1078
+ # @return [SubscriptionResponse]
1079
+ def subscriptions_get(customer_id, id, opts = {})
1080
+ data, _status_code, _headers = subscriptions_get_with_http_info(customer_id, id, opts)
1081
+ data
1082
+ end
1083
+
1084
+ # Get Subscription
1085
+ # Retrieve a specific subscription
1086
+ # @param customer_id [String] Identifier of the customer resource
1087
+ # @param id [String] Identifier of the subscription resource
1088
+ # @param [Hash] opts the optional parameters
1089
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
1090
+ # @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.
1091
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
1092
+ def subscriptions_get_with_http_info(customer_id, id, opts = {})
1093
+ if @api_client.config.debugging
1094
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_get ...'
1095
+ end
1096
+ # verify the required parameter 'customer_id' is set
1097
+ if @api_client.config.client_side_validation && customer_id.nil?
1098
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscriptions_get"
1099
+ end
1100
+ # verify the required parameter 'id' is set
1101
+ if @api_client.config.client_side_validation && id.nil?
1102
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_get"
1103
+ end
1104
+ allowable_values = ["es", "en"]
1105
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
1106
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
1107
+ end
1108
+ # resource path
1109
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
1110
+
1111
+ # query parameters
1112
+ query_params = opts[:query_params] || {}
1113
+
1114
+ # header parameters
1115
+ header_params = opts[:header_params] || {}
1116
+ # HTTP header 'Accept' (if needed)
1117
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
1118
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
1119
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
1120
+
1121
+ # form parameters
1122
+ form_params = opts[:form_params] || {}
1123
+
1124
+ # http body (model)
1125
+ post_body = opts[:debug_body]
1126
+
1127
+ # return_type
1128
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
1129
+
1130
+ # auth_names
1131
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1132
+
1133
+ new_options = opts.merge(
1134
+ :operation => :"SubscriptionsApi.subscriptions_get",
1135
+ :header_params => header_params,
1136
+ :query_params => query_params,
1137
+ :form_params => form_params,
1138
+ :body => post_body,
1139
+ :auth_names => auth_names,
1140
+ :return_type => return_type
1141
+ )
1142
+
1143
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1144
+ if @api_client.config.debugging
1145
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1146
+ end
1147
+ return data, status_code, headers
1148
+ end
1149
+
1150
+ # Retry Failed Payment
1151
+ # Retry a failed payment for a specific subscription
1152
+ # @param customer_id [String] Identifier of the customer resource
1153
+ # @param id [String] Identifier of the subscription resource
1154
+ # @param [Hash] opts the optional parameters
1155
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
1156
+ # @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.
1157
+ # @return [SubscriptionResponse]
1158
+ def subscriptions_retry(customer_id, id, opts = {})
1159
+ data, _status_code, _headers = subscriptions_retry_with_http_info(customer_id, id, opts)
1160
+ data
1161
+ end
1162
+
1163
+ # Retry Failed Payment
1164
+ # Retry a failed payment for a specific subscription
1165
+ # @param customer_id [String] Identifier of the customer resource
1166
+ # @param id [String] Identifier of the subscription resource
1167
+ # @param [Hash] opts the optional parameters
1168
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
1169
+ # @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.
1170
+ # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
1171
+ def subscriptions_retry_with_http_info(customer_id, id, opts = {})
1172
+ if @api_client.config.debugging
1173
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_retry ...'
1174
+ end
1175
+ # verify the required parameter 'customer_id' is set
1176
+ if @api_client.config.client_side_validation && customer_id.nil?
1177
+ fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscriptions_retry"
1178
+ end
1179
+ # verify the required parameter 'id' is set
1180
+ if @api_client.config.client_side_validation && id.nil?
1181
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_retry"
1182
+ end
1183
+ allowable_values = ["es", "en"]
1184
+ if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
1185
+ fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
1186
+ end
1187
+ # resource path
1188
+ local_var_path = '/customers/{customer_id}/subscriptions/{id}/retry'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
1189
+
1190
+ # query parameters
1191
+ query_params = opts[:query_params] || {}
1192
+
1193
+ # header parameters
1194
+ header_params = opts[:header_params] || {}
1195
+ # HTTP header 'Accept' (if needed)
1196
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
1197
+ header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
1198
+ header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?
1199
+
1200
+ # form parameters
1201
+ form_params = opts[:form_params] || {}
1202
+
1203
+ # http body (model)
1204
+ post_body = opts[:debug_body]
1205
+
1206
+ # return_type
1207
+ return_type = opts[:debug_return_type] || 'SubscriptionResponse'
1208
+
1209
+ # auth_names
1210
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1211
+
1212
+ new_options = opts.merge(
1213
+ :operation => :"SubscriptionsApi.subscriptions_retry",
1214
+ :header_params => header_params,
1215
+ :query_params => query_params,
1216
+ :form_params => form_params,
1217
+ :body => post_body,
1218
+ :auth_names => auth_names,
1219
+ :return_type => return_type
1220
+ )
1221
+
1222
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1223
+ if @api_client.config.debugging
1224
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_retry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1225
+ end
1226
+ return data, status_code, headers
1227
+ end
1228
+
1229
+ # Update Subscription [Deprecated]
1230
+ # DEPRECATED: This endpoint will be removed in version 2.3.0. You can modify the subscription to change the plans that your customers consume
1231
+ # @param id [String] Identifier of the resource
1232
+ # @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription
1233
+ # @param [Hash] opts the optional parameters
1234
+ # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
1235
+ # @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.
1236
+ # @return [SubscriptionResponse]
1237
+ def update_subscription(id, subscription_update_request, opts = {})
1238
+ data, _status_code, _headers = update_subscription_with_http_info(id, subscription_update_request, opts)
1239
+ data
1240
+ end
1241
+
1242
+ # Update Subscription [Deprecated]
1243
+ # DEPRECATED: This endpoint will be removed in version 2.3.0. You can modify the subscription to change the plans that your customers consume
481
1244
  # @param id [String] Identifier of the resource
482
1245
  # @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription
483
1246
  # @param [Hash] opts the optional parameters
@@ -509,7 +1272,7 @@ module Conekta
509
1272
  # header parameters
510
1273
  header_params = opts[:header_params] || {}
511
1274
  # HTTP header 'Accept' (if needed)
512
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
1275
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
513
1276
  # HTTP header 'Content-Type'
514
1277
  content_type = @api_client.select_header_content_type(['application/json'])
515
1278
  if !content_type.nil?