conekta 6.0.5 → 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 (311) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +2 -2
  3. data/README.md +30 -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 +6 -6
  18. data/docs/ChargesDataResponse.md +8 -8
  19. data/docs/ChargesOrderResponseAllOfData.md +8 -8
  20. data/docs/Checkout.md +1 -1
  21. data/docs/CheckoutRequest.md +1 -1
  22. data/docs/CheckoutResponse.md +2 -2
  23. data/docs/CompaniesApi.md +2 -2
  24. data/docs/CreateCustomerPaymentMethodsResponse.md +1 -0
  25. data/docs/CustomerPaymentMethodRequest.md +1 -1
  26. data/docs/CustomerPaymentMethodsData.md +1 -0
  27. data/docs/CustomersApi.md +7 -7
  28. data/docs/DeleteApiKeysResponse.md +5 -3
  29. data/docs/DiscountsApi.md +5 -5
  30. data/docs/EventsApi.md +12 -12
  31. data/docs/GetCustomerPaymentMethodDataResponse.md +1 -0
  32. data/docs/LogResponse.md +3 -3
  33. data/docs/LogsApi.md +2 -2
  34. data/docs/LogsResponseData.md +3 -3
  35. data/docs/OrderChannelResponse.md +24 -0
  36. data/docs/{OrderResponseCharges.md → OrderChargesResponse.md} +2 -2
  37. data/docs/{OrderResponseDiscountLines.md → OrderDiscountLinesResponse.md} +2 -2
  38. data/docs/OrderRequest.md +5 -5
  39. data/docs/OrderResponse.md +3 -3
  40. data/docs/OrderResponseCheckout.md +2 -2
  41. data/docs/OrderUpdateRequest.md +3 -3
  42. data/docs/OrdersApi.md +8 -8
  43. data/docs/PaymentLinkApi.md +7 -7
  44. data/docs/PaymentMethodBankTransfer.md +1 -1
  45. data/docs/PaymentMethodBnplPayment.md +32 -0
  46. data/docs/PaymentMethodBnplRequest.md +28 -0
  47. data/docs/PaymentMethodCardRequest.md +1 -1
  48. data/docs/PaymentMethodCash.md +3 -3
  49. data/docs/PaymentMethodCashRequest.md +1 -1
  50. data/docs/PaymentMethodCashResponse.md +6 -4
  51. data/docs/PaymentMethodCashResponseAllOfAgreements.md +20 -0
  52. data/docs/PaymentMethodSpeiRequest.md +1 -1
  53. data/docs/PaymentMethodTokenRequest.md +2 -2
  54. data/docs/PaymentMethodsApi.md +5 -5
  55. data/docs/PayoutOrdersApi.md +4 -4
  56. data/docs/PlanRequest.md +5 -1
  57. data/docs/PlanResponse.md +5 -1
  58. data/docs/PlansApi.md +5 -5
  59. data/docs/ProductsApi.md +3 -3
  60. data/docs/ResendRequest.md +18 -0
  61. data/docs/ShippingContactsApi.md +3 -3
  62. data/docs/ShippingsApi.md +3 -3
  63. data/docs/SubscriptionsApi.md +793 -73
  64. data/docs/TaxesApi.md +3 -3
  65. data/docs/TokensApi.md +1 -1
  66. data/docs/TransactionsApi.md +2 -2
  67. data/docs/TransfersApi.md +2 -2
  68. data/docs/UpdateCustomerPaymentMethodsResponse.md +1 -0
  69. data/docs/WebhookKeysApi.md +5 -5
  70. data/docs/WebhookRequest.md +2 -2
  71. data/docs/WebhookResponse.md +10 -14
  72. data/docs/WebhookUpdateRequest.md +5 -5
  73. data/docs/WebhooksApi.md +8 -8
  74. data/lib/conekta/api/antifraud_api.rb +7 -7
  75. data/lib/conekta/api/api_keys_api.rb +6 -6
  76. data/lib/conekta/api/balances_api.rb +2 -2
  77. data/lib/conekta/api/charges_api.rb +5 -5
  78. data/lib/conekta/api/companies_api.rb +3 -3
  79. data/lib/conekta/api/customers_api.rb +8 -8
  80. data/lib/conekta/api/discounts_api.rb +6 -6
  81. data/lib/conekta/api/events_api.rb +21 -16
  82. data/lib/conekta/api/logs_api.rb +3 -3
  83. data/lib/conekta/api/orders_api.rb +9 -9
  84. data/lib/conekta/api/payment_link_api.rb +7 -7
  85. data/lib/conekta/api/payment_methods_api.rb +5 -5
  86. data/lib/conekta/api/payout_orders_api.rb +5 -5
  87. data/lib/conekta/api/plans_api.rb +6 -6
  88. data/lib/conekta/api/products_api.rb +4 -4
  89. data/lib/conekta/api/shipping_contacts_api.rb +4 -4
  90. data/lib/conekta/api/shippings_api.rb +4 -4
  91. data/lib/conekta/api/subscriptions_api.rb +826 -63
  92. data/lib/conekta/api/taxes_api.rb +4 -4
  93. data/lib/conekta/api/tokens_api.rb +2 -2
  94. data/lib/conekta/api/transactions_api.rb +3 -3
  95. data/lib/conekta/api/transfers_api.rb +3 -3
  96. data/lib/conekta/api/webhook_keys_api.rb +6 -6
  97. data/lib/conekta/api/webhooks_api.rb +7 -7
  98. data/lib/conekta/api_client.rb +1 -1
  99. data/lib/conekta/api_error.rb +1 -1
  100. data/lib/conekta/configuration.rb +1 -1
  101. data/lib/conekta/models/api_key_create_response.rb +13 -12
  102. data/lib/conekta/models/api_key_request.rb +1 -1
  103. data/lib/conekta/models/api_key_response.rb +13 -12
  104. data/lib/conekta/models/api_key_response_on_delete.rb +10 -9
  105. data/lib/conekta/models/api_key_update_request.rb +1 -1
  106. data/lib/conekta/models/balance_common_field.rb +1 -1
  107. data/lib/conekta/models/balance_response.rb +1 -1
  108. data/lib/conekta/models/blacklist_rule_response.rb +1 -1
  109. data/lib/conekta/models/charge_order_response.rb +1 -1
  110. data/lib/conekta/models/charge_order_response_payment_method.rb +3 -1
  111. data/lib/conekta/models/charge_request.rb +1 -1
  112. data/lib/conekta/models/charge_request_payment_method.rb +2 -1
  113. data/lib/conekta/models/charge_response.rb +58 -1
  114. data/lib/conekta/models/charge_response_channel.rb +1 -1
  115. data/lib/conekta/models/charge_response_payment_method.rb +3 -1
  116. data/lib/conekta/models/charge_response_refunds.rb +1 -1
  117. data/lib/conekta/models/charge_response_refunds_data.rb +1 -1
  118. data/lib/conekta/models/charge_update_request.rb +1 -1
  119. data/lib/conekta/models/charges_data_response.rb +58 -1
  120. data/lib/conekta/models/charges_order_response.rb +1 -1
  121. data/lib/conekta/models/charges_order_response_all_of_data.rb +58 -1
  122. data/lib/conekta/models/checkout.rb +1 -1
  123. data/lib/conekta/models/checkout_order_template.rb +1 -1
  124. data/lib/conekta/models/checkout_order_template_customer_info.rb +1 -1
  125. data/lib/conekta/models/checkout_request.rb +2 -2
  126. data/lib/conekta/models/checkout_response.rb +2 -1
  127. data/lib/conekta/models/checkouts_response.rb +1 -1
  128. data/lib/conekta/models/company_fiscal_info_address_response.rb +1 -1
  129. data/lib/conekta/models/company_fiscal_info_response.rb +1 -1
  130. data/lib/conekta/models/company_payout_destination_response.rb +1 -1
  131. data/lib/conekta/models/company_response.rb +1 -1
  132. data/lib/conekta/models/create_customer_fiscal_entities_response.rb +1 -1
  133. data/lib/conekta/models/create_customer_payment_methods_request.rb +1 -1
  134. data/lib/conekta/models/create_customer_payment_methods_response.rb +2 -1
  135. data/lib/conekta/models/create_risk_rules_data.rb +1 -1
  136. data/lib/conekta/models/customer.rb +1 -1
  137. data/lib/conekta/models/customer_address.rb +1 -1
  138. data/lib/conekta/models/customer_antifraud_info.rb +1 -1
  139. data/lib/conekta/models/customer_antifraud_info_response.rb +1 -1
  140. data/lib/conekta/models/customer_fiscal_entities_data_response.rb +1 -1
  141. data/lib/conekta/models/customer_fiscal_entities_request.rb +1 -1
  142. data/lib/conekta/models/customer_fiscal_entities_response.rb +1 -1
  143. data/lib/conekta/models/customer_info.rb +1 -1
  144. data/lib/conekta/models/customer_info_just_customer_id.rb +1 -1
  145. data/lib/conekta/models/customer_info_just_customer_id_response.rb +1 -1
  146. data/lib/conekta/models/customer_payment_method_request.rb +1 -1
  147. data/lib/conekta/models/customer_payment_methods_data.rb +2 -1
  148. data/lib/conekta/models/customer_payment_methods_request.rb +1 -1
  149. data/lib/conekta/models/customer_payment_methods_response.rb +1 -1
  150. data/lib/conekta/models/customer_response.rb +1 -1
  151. data/lib/conekta/models/customer_response_shipping_contacts.rb +1 -1
  152. data/lib/conekta/models/customer_shipping_contacts.rb +2 -2
  153. data/lib/conekta/models/customer_shipping_contacts_address.rb +1 -1
  154. data/lib/conekta/models/customer_shipping_contacts_data_response.rb +1 -1
  155. data/lib/conekta/models/customer_shipping_contacts_response.rb +1 -1
  156. data/lib/conekta/models/customer_shipping_contacts_response_address.rb +1 -1
  157. data/lib/conekta/models/customer_update_fiscal_entities_request.rb +1 -1
  158. data/lib/conekta/models/customer_update_shipping_contacts.rb +2 -2
  159. data/lib/conekta/models/customers_response.rb +1 -1
  160. data/lib/conekta/models/delete_api_keys_response.rb +22 -11
  161. data/lib/conekta/models/deleted_blacklist_rule_response.rb +1 -1
  162. data/lib/conekta/models/deleted_whitelist_rule_response.rb +1 -1
  163. data/lib/conekta/models/details.rb +1 -1
  164. data/lib/conekta/models/details_error.rb +1 -1
  165. data/lib/conekta/models/discount_lines_data_response.rb +1 -1
  166. data/lib/conekta/models/discount_lines_response.rb +1 -1
  167. data/lib/conekta/models/email_checkout_request.rb +1 -1
  168. data/lib/conekta/models/error.rb +1 -1
  169. data/lib/conekta/models/event_response.rb +1 -1
  170. data/lib/conekta/models/event_types.rb +1 -1
  171. data/lib/conekta/models/events_resend_response.rb +1 -1
  172. data/lib/conekta/models/fiscal_entity_address.rb +1 -1
  173. data/lib/conekta/models/get_api_keys_response.rb +1 -1
  174. data/lib/conekta/models/get_charges_response.rb +1 -1
  175. data/lib/conekta/models/get_companies_response.rb +1 -1
  176. data/lib/conekta/models/get_customer_payment_method_data_response.rb +2 -1
  177. data/lib/conekta/models/get_events_response.rb +1 -1
  178. data/lib/conekta/models/get_order_discount_lines_response.rb +1 -1
  179. data/lib/conekta/models/get_orders_response.rb +1 -1
  180. data/lib/conekta/models/get_payment_method_response.rb +1 -1
  181. data/lib/conekta/models/get_plans_response.rb +1 -1
  182. data/lib/conekta/models/get_transactions_response.rb +1 -1
  183. data/lib/conekta/models/get_transfers_response.rb +1 -1
  184. data/lib/conekta/models/get_webhook_keys_response.rb +1 -1
  185. data/lib/conekta/models/get_webhooks_response.rb +1 -1
  186. data/lib/conekta/models/log_response.rb +1 -1
  187. data/lib/conekta/models/logs_response.rb +1 -1
  188. data/lib/conekta/models/logs_response_data.rb +1 -1
  189. data/lib/conekta/models/order_capture_request.rb +1 -1
  190. data/lib/conekta/models/order_channel_response.rb +241 -0
  191. data/lib/conekta/models/order_charges_response.rb +258 -0
  192. data/lib/conekta/models/order_customer_info_response.rb +1 -1
  193. data/lib/conekta/models/order_discount_lines_request.rb +1 -1
  194. data/lib/conekta/models/order_discount_lines_response.rb +257 -0
  195. data/lib/conekta/models/order_fiscal_entity_address_response.rb +1 -1
  196. data/lib/conekta/models/order_fiscal_entity_request.rb +1 -1
  197. data/lib/conekta/models/order_fiscal_entity_response.rb +1 -1
  198. data/lib/conekta/models/order_next_action_response.rb +1 -1
  199. data/lib/conekta/models/order_next_action_response_redirect_to_url.rb +1 -1
  200. data/lib/conekta/models/order_refund_request.rb +1 -1
  201. data/lib/conekta/models/order_request.rb +6 -6
  202. data/lib/conekta/models/order_request_customer_info.rb +1 -1
  203. data/lib/conekta/models/order_response.rb +4 -4
  204. data/lib/conekta/models/order_response_checkout.rb +2 -1
  205. data/lib/conekta/models/order_response_customer_info.rb +1 -1
  206. data/lib/conekta/models/order_response_products.rb +1 -1
  207. data/lib/conekta/models/order_response_shipping_contact.rb +1 -1
  208. data/lib/conekta/models/order_tax_request.rb +1 -1
  209. data/lib/conekta/models/order_update_fiscal_entity_request.rb +1 -1
  210. data/lib/conekta/models/order_update_request.rb +4 -4
  211. data/lib/conekta/models/order_update_request_customer_info.rb +1 -1
  212. data/lib/conekta/models/orders_response.rb +1 -1
  213. data/lib/conekta/models/page.rb +1 -1
  214. data/lib/conekta/models/pagination.rb +1 -1
  215. data/lib/conekta/models/payment_method.rb +1 -1
  216. data/lib/conekta/models/payment_method_bank_transfer.rb +2 -2
  217. data/lib/conekta/models/payment_method_bnpl_payment.rb +311 -0
  218. data/lib/conekta/models/payment_method_bnpl_request.rb +348 -0
  219. data/lib/conekta/models/payment_method_card.rb +1 -1
  220. data/lib/conekta/models/payment_method_card_request.rb +1 -1
  221. data/lib/conekta/models/payment_method_card_response.rb +1 -1
  222. data/lib/conekta/models/payment_method_cash.rb +1 -1
  223. data/lib/conekta/models/payment_method_cash_request.rb +1 -1
  224. data/lib/conekta/models/payment_method_cash_response.rb +14 -2
  225. data/lib/conekta/models/payment_method_cash_response_all_of_agreements.rb +225 -0
  226. data/lib/conekta/models/payment_method_general_request.rb +1 -1
  227. data/lib/conekta/models/payment_method_response.rb +1 -1
  228. data/lib/conekta/models/payment_method_spei_recurrent.rb +1 -1
  229. data/lib/conekta/models/payment_method_spei_request.rb +1 -1
  230. data/lib/conekta/models/payment_method_token_request.rb +2 -2
  231. data/lib/conekta/models/payout.rb +1 -1
  232. data/lib/conekta/models/payout_method.rb +1 -1
  233. data/lib/conekta/models/payout_order.rb +1 -1
  234. data/lib/conekta/models/payout_order_payouts_item.rb +1 -1
  235. data/lib/conekta/models/payout_order_response.rb +1 -1
  236. data/lib/conekta/models/payout_order_response_customer_info.rb +1 -1
  237. data/lib/conekta/models/payout_orders_response.rb +1 -1
  238. data/lib/conekta/models/plan_request.rb +63 -5
  239. data/lib/conekta/models/plan_response.rb +24 -6
  240. data/lib/conekta/models/plan_update_request.rb +1 -1
  241. data/lib/conekta/models/product.rb +1 -1
  242. data/lib/conekta/models/product_data_response.rb +1 -1
  243. data/lib/conekta/models/product_order_response.rb +1 -1
  244. data/lib/conekta/models/resend_request.rb +224 -0
  245. data/lib/conekta/models/risk_rules_data.rb +1 -1
  246. data/lib/conekta/models/risk_rules_list.rb +1 -1
  247. data/lib/conekta/models/shipping_order_response.rb +1 -1
  248. data/lib/conekta/models/shipping_request.rb +1 -1
  249. data/lib/conekta/models/sms_checkout_request.rb +1 -1
  250. data/lib/conekta/models/subscription_events_response.rb +1 -1
  251. data/lib/conekta/models/subscription_request.rb +1 -1
  252. data/lib/conekta/models/subscription_response.rb +1 -1
  253. data/lib/conekta/models/subscription_update_request.rb +1 -1
  254. data/lib/conekta/models/token.rb +1 -1
  255. data/lib/conekta/models/token_card.rb +1 -1
  256. data/lib/conekta/models/token_checkout.rb +1 -1
  257. data/lib/conekta/models/token_response.rb +1 -1
  258. data/lib/conekta/models/token_response_checkout.rb +1 -1
  259. data/lib/conekta/models/transaction_response.rb +1 -1
  260. data/lib/conekta/models/transfer_destination_response.rb +1 -1
  261. data/lib/conekta/models/transfer_method_response.rb +1 -1
  262. data/lib/conekta/models/transfer_response.rb +1 -1
  263. data/lib/conekta/models/transfers_response.rb +1 -1
  264. data/lib/conekta/models/update_customer.rb +1 -1
  265. data/lib/conekta/models/update_customer_antifraud_info.rb +1 -1
  266. data/lib/conekta/models/update_customer_fiscal_entities_response.rb +1 -1
  267. data/lib/conekta/models/update_customer_payment_methods_response.rb +2 -1
  268. data/lib/conekta/models/update_order_discount_lines_request.rb +1 -1
  269. data/lib/conekta/models/update_order_tax_request.rb +1 -1
  270. data/lib/conekta/models/update_order_tax_response.rb +1 -1
  271. data/lib/conekta/models/update_payment_methods.rb +1 -1
  272. data/lib/conekta/models/update_product.rb +1 -1
  273. data/lib/conekta/models/webhook_key_create_response.rb +1 -1
  274. data/lib/conekta/models/webhook_key_delete_response.rb +1 -1
  275. data/lib/conekta/models/webhook_key_request.rb +1 -1
  276. data/lib/conekta/models/webhook_key_response.rb +1 -1
  277. data/lib/conekta/models/webhook_key_update_request.rb +1 -1
  278. data/lib/conekta/models/webhook_log.rb +1 -1
  279. data/lib/conekta/models/webhook_request.rb +11 -16
  280. data/lib/conekta/models/webhook_response.rb +28 -39
  281. data/lib/conekta/models/webhook_update_request.rb +20 -28
  282. data/lib/conekta/models/whitelistlist_rule_response.rb +1 -1
  283. data/lib/conekta/version.rb +2 -2
  284. data/lib/conekta.rb +8 -3
  285. data/spec/api/antifraud_api_spec.rb +8 -65
  286. data/spec/api/api_keys_api_spec.rb +7 -51
  287. data/spec/api/balances_api_spec.rb +3 -12
  288. data/spec/api/charges_api_spec.rb +30 -83
  289. data/spec/api/companies_api_spec.rb +5 -13
  290. data/spec/api/customers_api_spec.rb +13 -184
  291. data/spec/api/discounts_api_spec.rb +7 -46
  292. data/spec/api/events_api_spec.rb +7 -24
  293. data/spec/api/logs_api_spec.rb +3 -15
  294. data/spec/api/orders_api_spec.rb +19 -247
  295. data/spec/api/payment_link_api_spec.rb +9 -82
  296. data/spec/api/payment_methods_api_spec.rb +6 -41
  297. data/spec/api/payout_orders_api_spec.rb +14 -1
  298. data/spec/api/plans_api_spec.rb +7 -42
  299. data/spec/api/products_api_spec.rb +5 -30
  300. data/spec/api/shipping_contacts_api_spec.rb +5 -41
  301. data/spec/api/shippings_api_spec.rb +5 -32
  302. data/spec/api/subscriptions_api_spec.rb +168 -68
  303. data/spec/api/taxes_api_spec.rb +5 -34
  304. data/spec/api/tokens_api_spec.rb +3 -31
  305. data/spec/api/transactions_api_spec.rb +8 -21
  306. data/spec/api/transfers_api_spec.rb +4 -34
  307. data/spec/api/webhook_keys_api_spec.rb +7 -49
  308. data/spec/api/webhooks_api_spec.rb +9 -42
  309. data/spec/spec_helper.rb +1 -1
  310. metadata +31 -21
  311. data/spec/api/base_test.rb +0 -9
@@ -0,0 +1,311 @@
1
+ =begin
2
+ #Conekta API
3
+
4
+ #Conekta sdk
5
+
6
+ The version of the OpenAPI document: 2.2.0
7
+ Contact: engineering@conekta.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Conekta
17
+ class PaymentMethodBnplPayment
18
+ attr_accessor :type
19
+
20
+ attr_accessor :object
21
+
22
+ # URL to redirect the customer after a canceled payment
23
+ attr_accessor :cancel_url
24
+
25
+ # Expiration date of the charge
26
+ attr_accessor :expires_at
27
+
28
+ # URL to redirect the customer after a failed payment
29
+ attr_accessor :failure_url
30
+
31
+ # Product type of the charge
32
+ attr_accessor :product_type
33
+
34
+ # URL to redirect the customer to complete the payment
35
+ attr_accessor :redirect_url
36
+
37
+ # URL to redirect the customer after a successful payment
38
+ attr_accessor :success_url
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'type' => :'type',
44
+ :'object' => :'object',
45
+ :'cancel_url' => :'cancel_url',
46
+ :'expires_at' => :'expires_at',
47
+ :'failure_url' => :'failure_url',
48
+ :'product_type' => :'product_type',
49
+ :'redirect_url' => :'redirect_url',
50
+ :'success_url' => :'success_url'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'type' => :'String',
63
+ :'object' => :'String',
64
+ :'cancel_url' => :'String',
65
+ :'expires_at' => :'Integer',
66
+ :'failure_url' => :'String',
67
+ :'product_type' => :'String',
68
+ :'redirect_url' => :'String',
69
+ :'success_url' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # List of class defined in allOf (OpenAPI v3)
80
+ def self.openapi_all_of
81
+ [
82
+ :'PaymentMethod'
83
+ ]
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::PaymentMethodBnplPayment` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!self.class.attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::PaymentMethodBnplPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'type')
102
+ self.type = attributes[:'type']
103
+ end
104
+
105
+ if attributes.key?(:'object')
106
+ self.object = attributes[:'object']
107
+ else
108
+ self.object = nil
109
+ end
110
+
111
+ if attributes.key?(:'cancel_url')
112
+ self.cancel_url = attributes[:'cancel_url']
113
+ end
114
+
115
+ if attributes.key?(:'expires_at')
116
+ self.expires_at = attributes[:'expires_at']
117
+ else
118
+ self.expires_at = nil
119
+ end
120
+
121
+ if attributes.key?(:'failure_url')
122
+ self.failure_url = attributes[:'failure_url']
123
+ end
124
+
125
+ if attributes.key?(:'product_type')
126
+ self.product_type = attributes[:'product_type']
127
+ else
128
+ self.product_type = nil
129
+ end
130
+
131
+ if attributes.key?(:'redirect_url')
132
+ self.redirect_url = attributes[:'redirect_url']
133
+ end
134
+
135
+ if attributes.key?(:'success_url')
136
+ self.success_url = attributes[:'success_url']
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
144
+ invalid_properties = Array.new
145
+ if @object.nil?
146
+ invalid_properties.push('invalid value for "object", object cannot be nil.')
147
+ end
148
+
149
+ if @expires_at.nil?
150
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
151
+ end
152
+
153
+ if @product_type.nil?
154
+ invalid_properties.push('invalid value for "product_type", product_type cannot be nil.')
155
+ end
156
+
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ warn '[DEPRECATED] the `valid?` method is obsolete'
164
+ return false if @object.nil?
165
+ return false if @expires_at.nil?
166
+ return false if @product_type.nil?
167
+ true
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ type == o.type &&
176
+ object == o.object &&
177
+ cancel_url == o.cancel_url &&
178
+ expires_at == o.expires_at &&
179
+ failure_url == o.failure_url &&
180
+ product_type == o.product_type &&
181
+ redirect_url == o.redirect_url &&
182
+ success_url == o.success_url
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [type, object, cancel_url, expires_at, failure_url, product_type, redirect_url, success_url].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ attributes = attributes.transform_keys(&:to_sym)
203
+ transformed_hash = {}
204
+ openapi_types.each_pair do |key, type|
205
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = nil
207
+ elsif type =~ /\AArray<(.*)>/i
208
+ # check to ensure the input is an array given that the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[attribute_map[key]].is_a?(Array)
211
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
212
+ end
213
+ elsif !attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
215
+ end
216
+ end
217
+ new(transformed_hash)
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def self._deserialize(type, value)
225
+ case type.to_sym
226
+ when :Time
227
+ Time.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value.to_s
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :Boolean
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ # models (e.g. Pet) or oneOf
258
+ klass = Conekta.const_get(type)
259
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
260
+ end
261
+ end
262
+
263
+ # Returns the string representation of the object
264
+ # @return [String] String presentation of the object
265
+ def to_s
266
+ to_hash.to_s
267
+ end
268
+
269
+ # to_body is an alias to to_hash (backward compatibility)
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_body
272
+ to_hash
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ # Outputs non-array value in the form of hash
292
+ # For object, use to_hash. Otherwise, just return the value
293
+ # @param [Object] value Any valid value
294
+ # @return [Hash] Returns the value in the form of hash
295
+ def _to_hash(value)
296
+ if value.is_a?(Array)
297
+ value.compact.map { |v| _to_hash(v) }
298
+ elsif value.is_a?(Hash)
299
+ {}.tap do |hash|
300
+ value.each { |k, v| hash[k] = _to_hash(v) }
301
+ end
302
+ elsif value.respond_to? :to_hash
303
+ value.to_hash
304
+ else
305
+ value
306
+ end
307
+ end
308
+
309
+ end
310
+
311
+ end
@@ -0,0 +1,348 @@
1
+ =begin
2
+ #Conekta API
3
+
4
+ #Conekta sdk
5
+
6
+ The version of the OpenAPI document: 2.2.0
7
+ Contact: engineering@conekta.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Conekta
17
+ class PaymentMethodBnplRequest
18
+ # Type of the payment method
19
+ attr_accessor :type
20
+
21
+ # URL to redirect the customer after a canceled payment
22
+ attr_accessor :cancel_url
23
+
24
+ # Indicates if the payment method can not expire
25
+ attr_accessor :can_not_expire
26
+
27
+ # URL to redirect the customer after a failed payment
28
+ attr_accessor :failure_url
29
+
30
+ # Product type of the payment method, use for the payment method to know the product type
31
+ attr_accessor :product_type
32
+
33
+ # URL to redirect the customer after a successful payment
34
+ attr_accessor :success_url
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'type' => :'type',
62
+ :'cancel_url' => :'cancel_url',
63
+ :'can_not_expire' => :'can_not_expire',
64
+ :'failure_url' => :'failure_url',
65
+ :'product_type' => :'product_type',
66
+ :'success_url' => :'success_url'
67
+ }
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'type' => :'String',
79
+ :'cancel_url' => :'String',
80
+ :'can_not_expire' => :'Boolean',
81
+ :'failure_url' => :'String',
82
+ :'product_type' => :'String',
83
+ :'success_url' => :'String'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ ])
91
+ end
92
+
93
+ # List of class defined in allOf (OpenAPI v3)
94
+ def self.openapi_all_of
95
+ [
96
+ :'CustomerPaymentMethodRequest'
97
+ ]
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::PaymentMethodBnplRequest` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!self.class.attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::PaymentMethodBnplRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'type')
116
+ self.type = attributes[:'type']
117
+ else
118
+ self.type = nil
119
+ end
120
+
121
+ if attributes.key?(:'cancel_url')
122
+ self.cancel_url = attributes[:'cancel_url']
123
+ else
124
+ self.cancel_url = nil
125
+ end
126
+
127
+ if attributes.key?(:'can_not_expire')
128
+ self.can_not_expire = attributes[:'can_not_expire']
129
+ else
130
+ self.can_not_expire = nil
131
+ end
132
+
133
+ if attributes.key?(:'failure_url')
134
+ self.failure_url = attributes[:'failure_url']
135
+ else
136
+ self.failure_url = nil
137
+ end
138
+
139
+ if attributes.key?(:'product_type')
140
+ self.product_type = attributes[:'product_type']
141
+ else
142
+ self.product_type = nil
143
+ end
144
+
145
+ if attributes.key?(:'success_url')
146
+ self.success_url = attributes[:'success_url']
147
+ else
148
+ self.success_url = nil
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
156
+ invalid_properties = Array.new
157
+ if @type.nil?
158
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
159
+ end
160
+
161
+ if @cancel_url.nil?
162
+ invalid_properties.push('invalid value for "cancel_url", cancel_url cannot be nil.')
163
+ end
164
+
165
+ if @can_not_expire.nil?
166
+ invalid_properties.push('invalid value for "can_not_expire", can_not_expire cannot be nil.')
167
+ end
168
+
169
+ if @failure_url.nil?
170
+ invalid_properties.push('invalid value for "failure_url", failure_url cannot be nil.')
171
+ end
172
+
173
+ if @product_type.nil?
174
+ invalid_properties.push('invalid value for "product_type", product_type cannot be nil.')
175
+ end
176
+
177
+ if @success_url.nil?
178
+ invalid_properties.push('invalid value for "success_url", success_url cannot be nil.')
179
+ end
180
+
181
+ invalid_properties
182
+ end
183
+
184
+ # Check to see if the all the properties in the model are valid
185
+ # @return true if the model is valid
186
+ def valid?
187
+ warn '[DEPRECATED] the `valid?` method is obsolete'
188
+ return false if @type.nil?
189
+ return false if @cancel_url.nil?
190
+ return false if @can_not_expire.nil?
191
+ return false if @failure_url.nil?
192
+ return false if @product_type.nil?
193
+ product_type_validator = EnumAttributeValidator.new('String', ["klarna_bnpl", "creditea_bnpl"])
194
+ return false unless product_type_validator.valid?(@product_type)
195
+ return false if @success_url.nil?
196
+ true
197
+ end
198
+
199
+ # Custom attribute writer method checking allowed values (enum).
200
+ # @param [Object] product_type Object to be assigned
201
+ def product_type=(product_type)
202
+ validator = EnumAttributeValidator.new('String', ["klarna_bnpl", "creditea_bnpl"])
203
+ unless validator.valid?(product_type)
204
+ fail ArgumentError, "invalid value for \"product_type\", must be one of #{validator.allowable_values}."
205
+ end
206
+ @product_type = product_type
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ type == o.type &&
215
+ cancel_url == o.cancel_url &&
216
+ can_not_expire == o.can_not_expire &&
217
+ failure_url == o.failure_url &&
218
+ product_type == o.product_type &&
219
+ success_url == o.success_url
220
+ end
221
+
222
+ # @see the `==` method
223
+ # @param [Object] Object to be compared
224
+ def eql?(o)
225
+ self == o
226
+ end
227
+
228
+ # Calculates hash code according to all attributes.
229
+ # @return [Integer] Hash code
230
+ def hash
231
+ [type, cancel_url, can_not_expire, failure_url, product_type, success_url].hash
232
+ end
233
+
234
+ # Builds the object from hash
235
+ # @param [Hash] attributes Model attributes in the form of hash
236
+ # @return [Object] Returns the model itself
237
+ def self.build_from_hash(attributes)
238
+ return nil unless attributes.is_a?(Hash)
239
+ attributes = attributes.transform_keys(&:to_sym)
240
+ transformed_hash = {}
241
+ openapi_types.each_pair do |key, type|
242
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
243
+ transformed_hash["#{key}"] = nil
244
+ elsif type =~ /\AArray<(.*)>/i
245
+ # check to ensure the input is an array given that the attribute
246
+ # is documented as an array but the input is not
247
+ if attributes[attribute_map[key]].is_a?(Array)
248
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
249
+ end
250
+ elsif !attributes[attribute_map[key]].nil?
251
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
252
+ end
253
+ end
254
+ new(transformed_hash)
255
+ end
256
+
257
+ # Deserializes the data based on type
258
+ # @param string type Data type
259
+ # @param string value Value to be deserialized
260
+ # @return [Object] Deserialized data
261
+ def self._deserialize(type, value)
262
+ case type.to_sym
263
+ when :Time
264
+ Time.parse(value)
265
+ when :Date
266
+ Date.parse(value)
267
+ when :String
268
+ value.to_s
269
+ when :Integer
270
+ value.to_i
271
+ when :Float
272
+ value.to_f
273
+ when :Boolean
274
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
275
+ true
276
+ else
277
+ false
278
+ end
279
+ when :Object
280
+ # generic object (usually a Hash), return directly
281
+ value
282
+ when /\AArray<(?<inner_type>.+)>\z/
283
+ inner_type = Regexp.last_match[:inner_type]
284
+ value.map { |v| _deserialize(inner_type, v) }
285
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
286
+ k_type = Regexp.last_match[:k_type]
287
+ v_type = Regexp.last_match[:v_type]
288
+ {}.tap do |hash|
289
+ value.each do |k, v|
290
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
291
+ end
292
+ end
293
+ else # model
294
+ # models (e.g. Pet) or oneOf
295
+ klass = Conekta.const_get(type)
296
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
297
+ end
298
+ end
299
+
300
+ # Returns the string representation of the object
301
+ # @return [String] String presentation of the object
302
+ def to_s
303
+ to_hash.to_s
304
+ end
305
+
306
+ # to_body is an alias to to_hash (backward compatibility)
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_body
309
+ to_hash
310
+ end
311
+
312
+ # Returns the object in the form of hash
313
+ # @return [Hash] Returns the object in the form of hash
314
+ def to_hash
315
+ hash = {}
316
+ self.class.attribute_map.each_pair do |attr, param|
317
+ value = self.send(attr)
318
+ if value.nil?
319
+ is_nullable = self.class.openapi_nullable.include?(attr)
320
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
321
+ end
322
+
323
+ hash[param] = _to_hash(value)
324
+ end
325
+ hash
326
+ end
327
+
328
+ # Outputs non-array value in the form of hash
329
+ # For object, use to_hash. Otherwise, just return the value
330
+ # @param [Object] value Any valid value
331
+ # @return [Hash] Returns the value in the form of hash
332
+ def _to_hash(value)
333
+ if value.is_a?(Array)
334
+ value.compact.map { |v| _to_hash(v) }
335
+ elsif value.is_a?(Hash)
336
+ {}.tap do |hash|
337
+ value.each { |k, v| hash[k] = _to_hash(v) }
338
+ end
339
+ elsif value.respond_to? :to_hash
340
+ value.to_hash
341
+ else
342
+ value
343
+ end
344
+ end
345
+
346
+ end
347
+
348
+ end
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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