conekta 2.6.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHORS.md +28 -0
- data/CHANGELOG.md +8 -0
- data/CODE_OF_CONDUCT.md +77 -0
- data/CONTRIBUTING.md +19 -0
- data/Gemfile +5 -9
- data/{LICENSE.txt → LICENSE} +1 -1
- data/Makefile +2 -0
- data/README.md +367 -123
- data/Rakefile +9 -0
- data/VERSION +1 -0
- data/conekta.gemspec +38 -29
- data/conekta.png +0 -0
- data/docs/AntifraudApi.md +443 -0
- data/docs/ApiKeyCreateResponse.md +40 -0
- data/docs/ApiKeyCreateResponseAllOf.md +18 -0
- data/docs/ApiKeyRequest.md +20 -0
- data/docs/ApiKeyResponse.md +38 -0
- data/docs/ApiKeyResponseOnDelete.md +34 -0
- data/docs/ApiKeyUpdateRequest.md +20 -0
- data/docs/ApiKeysApi.md +391 -0
- data/docs/BalanceCommonField.md +20 -0
- data/docs/BalanceResponse.md +36 -0
- data/docs/BalancesApi.md +79 -0
- data/docs/BlacklistRuleResponse.md +24 -0
- data/docs/ChargeDataPaymentMethodBankTransferResponse.md +48 -0
- data/docs/ChargeDataPaymentMethodCardResponse.md +38 -0
- data/docs/ChargeDataPaymentMethodCashResponse.md +32 -0
- data/docs/ChargeOrderResponse.md +56 -0
- data/docs/ChargeOrderResponsePaymentMethod.md +82 -0
- data/docs/ChargeRequest.md +24 -0
- data/docs/ChargeRequestPaymentMethod.md +26 -0
- data/docs/ChargeResponse.md +54 -0
- data/docs/ChargeResponseChannel.md +24 -0
- data/docs/ChargeResponsePaymentMethod.md +82 -0
- data/docs/ChargeResponseRefunds.md +26 -0
- data/docs/ChargeResponseRefundsAllOf.md +18 -0
- data/docs/ChargeResponseRefundsData.md +30 -0
- data/docs/ChargesApi.md +165 -0
- data/docs/ChargesDataResponse.md +54 -0
- data/docs/Checkout.md +38 -0
- data/docs/CheckoutOrderTemplate.md +24 -0
- data/docs/CheckoutOrderTemplateCustomerInfo.md +49 -0
- data/docs/CheckoutRequest.md +34 -0
- data/docs/CheckoutResponse.md +66 -0
- data/docs/CheckoutsResponse.md +26 -0
- data/docs/CheckoutsResponseAllOf.md +18 -0
- data/docs/CompaniesApi.md +159 -0
- data/docs/CompanyFiscalInfoAddressResponse.md +34 -0
- data/docs/CompanyFiscalInfoResponse.md +30 -0
- data/docs/CompanyPayoutDestinationResponse.md +28 -0
- data/docs/CompanyResponse.md +32 -0
- data/docs/CreateCustomerFiscalEntitiesResponse.md +38 -0
- data/docs/CreateCustomerFiscalEntitiesResponseAllOf.md +26 -0
- data/docs/CreateCustomerPaymentMethodsRequest.md +51 -0
- data/docs/CreateCustomerPaymentMethodsResponse.md +83 -0
- data/docs/CreateRiskRulesData.md +22 -0
- data/docs/Customer.md +44 -0
- data/docs/CustomerAddress.md +32 -0
- data/docs/CustomerAntifraudInfo.md +20 -0
- data/docs/CustomerAntifraudInfoResponse.md +20 -0
- data/docs/CustomerFiscalEntitiesDataResponse.md +38 -0
- data/docs/CustomerFiscalEntitiesRequest.md +28 -0
- data/docs/CustomerFiscalEntitiesRequestAddress.md +32 -0
- data/docs/CustomerFiscalEntitiesResponse.md +22 -0
- data/docs/CustomerFiscalEntitiesResponseAllOf.md +18 -0
- data/docs/CustomerInfo.md +26 -0
- data/docs/CustomerInfoJustCustomerId.md +18 -0
- data/docs/CustomerInfoJustCustomerIdResponse.md +18 -0
- data/docs/CustomerInfoResponse.md +26 -0
- data/docs/CustomerPaymentMethodRequest.md +18 -0
- data/docs/CustomerPaymentMethods.md +18 -0
- data/docs/CustomerPaymentMethodsData.md +83 -0
- data/docs/CustomerPaymentMethodsRequest.md +51 -0
- data/docs/CustomerPaymentMethodsResponse.md +26 -0
- data/docs/CustomerResponse.md +50 -0
- data/docs/CustomerResponseShippingContacts.md +22 -0
- data/docs/CustomerResponseShippingContactsAllOf.md +18 -0
- data/docs/CustomerShippingContacts.md +30 -0
- data/docs/CustomerShippingContactsAddress.md +30 -0
- data/docs/CustomerShippingContactsDataResponse.md +36 -0
- data/docs/CustomerShippingContactsDataResponseAllOf.md +22 -0
- data/docs/CustomerShippingContactsResponse.md +36 -0
- data/docs/CustomerShippingContactsResponseAddress.md +32 -0
- data/docs/CustomerUpdateFiscalEntitiesRequest.md +28 -0
- data/docs/CustomerUpdateShippingContacts.md +30 -0
- data/docs/CustomersApi.md +553 -0
- data/docs/CustomersResponse.md +26 -0
- data/docs/CustomersResponseAllOf.md +18 -0
- data/docs/DeleteApiKeysResponse.md +34 -0
- data/docs/DeleteApiKeysResponseAllOf.md +18 -0
- data/docs/DeletedBlacklistRuleResponse.md +24 -0
- data/docs/DeletedWhitelistRuleResponse.md +24 -0
- data/docs/Details.md +18 -0
- data/docs/DetailsError.md +24 -0
- data/docs/DiscountLinesDataResponse.md +28 -0
- data/docs/DiscountLinesResponse.md +28 -0
- data/docs/DiscountLinesResponseAllOf.md +22 -0
- data/docs/DiscountsApi.md +405 -0
- data/docs/EmailCheckoutRequest.md +18 -0
- data/docs/Error.md +24 -0
- data/docs/ErrorAllOf.md +22 -0
- data/docs/EventResponse.md +32 -0
- data/docs/EventsApi.md +239 -0
- data/docs/EventsResendResponse.md +28 -0
- data/docs/GetApiKeysResponse.md +26 -0
- data/docs/GetApiKeysResponseAllOf.md +18 -0
- data/docs/GetChargesResponse.md +26 -0
- data/docs/GetChargesResponseAllOf.md +18 -0
- data/docs/GetCompaniesResponse.md +26 -0
- data/docs/GetCompaniesResponseAllOf.md +18 -0
- data/docs/GetCustomerPaymentMethodDataResponse.md +83 -0
- data/docs/GetEventsResponse.md +26 -0
- data/docs/GetEventsResponseAllOf.md +18 -0
- data/docs/GetOrderDiscountLinesResponse.md +26 -0
- data/docs/GetOrderDiscountLinesResponseAllOf.md +18 -0
- data/docs/GetOrdersResponse.md +26 -0
- data/docs/GetPaymentMethodResponse.md +26 -0
- data/docs/GetPaymentMethodResponseAllOf.md +18 -0
- data/docs/GetPlansResponse.md +26 -0
- data/docs/GetPlansResponseAllOf.md +18 -0
- data/docs/GetTransactionsResponse.md +26 -0
- data/docs/GetTransactionsResponseAllOf.md +18 -0
- data/docs/GetTransfersResponse.md +26 -0
- data/docs/GetTransfersResponseAllOf.md +18 -0
- data/docs/GetWebhookKeysResponse.md +26 -0
- data/docs/GetWebhookKeysResponseAllOf.md +18 -0
- data/docs/GetWebhooksResponse.md +26 -0
- data/docs/GetWebhooksResponseAllOf.md +18 -0
- data/docs/LogResponse.md +56 -0
- data/docs/LogsApi.md +165 -0
- data/docs/LogsResponse.md +26 -0
- data/docs/LogsResponseData.md +56 -0
- data/docs/OrderCaptureRequest.md +18 -0
- data/docs/OrderDiscountLinesRequest.md +22 -0
- data/docs/OrderRefundRequest.md +22 -0
- data/docs/OrderRequest.md +42 -0
- data/docs/OrderRequestCustomerInfo.md +49 -0
- data/docs/OrderResponse.md +56 -0
- data/docs/OrderResponseCharges.md +22 -0
- data/docs/OrderResponseChargesAllOf.md +18 -0
- data/docs/OrderResponseCheckout.md +68 -0
- data/docs/OrderResponseCustomerInfo.md +28 -0
- data/docs/OrderResponseCustomerInfoAllOf.md +18 -0
- data/docs/OrderResponseDiscountLines.md +22 -0
- data/docs/OrderResponseDiscountLinesAllOf.md +18 -0
- data/docs/OrderResponseFiscalEntity.md +24 -0
- data/docs/OrderResponseFiscalEntityAddress.md +34 -0
- data/docs/OrderResponseFiscalEntityAddressAllOf.md +18 -0
- data/docs/OrderResponseProducts.md +26 -0
- data/docs/OrderResponseProductsAllOf.md +18 -0
- data/docs/OrderResponseShippingContact.md +36 -0
- data/docs/OrderResponseShippingContactAllOf.md +22 -0
- data/docs/OrderTaxRequest.md +22 -0
- data/docs/OrderUpdateRequest.md +38 -0
- data/docs/OrderUpdateRequestCustomerInfo.md +49 -0
- data/docs/OrdersApi.md +627 -0
- data/docs/OrdersResponse.md +18 -0
- data/docs/Page.md +20 -0
- data/docs/Pagination.md +20 -0
- data/docs/PaymentLinkApi.md +463 -0
- data/docs/PaymentMethod.md +20 -0
- data/docs/PaymentMethodBankTransfer.md +52 -0
- data/docs/PaymentMethodCard.md +42 -0
- data/docs/PaymentMethodCardRequest.md +20 -0
- data/docs/PaymentMethodCardRequestAllOf.md +18 -0
- data/docs/PaymentMethodCardResponse.md +46 -0
- data/docs/PaymentMethodCardResponseAllOf.md +36 -0
- data/docs/PaymentMethodCash.md +36 -0
- data/docs/PaymentMethodCashRequest.md +20 -0
- data/docs/PaymentMethodCashRequestAllOf.md +18 -0
- data/docs/PaymentMethodCashResponse.md +36 -0
- data/docs/PaymentMethodCashResponseAllOf.md +26 -0
- data/docs/PaymentMethodResponse.md +26 -0
- data/docs/PaymentMethodSpeiRecurrent.md +30 -0
- data/docs/PaymentMethodSpeiRecurrentAllOf.md +20 -0
- data/docs/PaymentMethodSpeiRequest.md +20 -0
- data/docs/PaymentMethodsApi.md +327 -0
- data/docs/PlanRequest.md +32 -0
- data/docs/PlanResponse.md +38 -0
- data/docs/PlanUpdateRequest.md +24 -0
- data/docs/PlansApi.md +385 -0
- data/docs/Product.md +34 -0
- data/docs/ProductDataResponse.md +40 -0
- data/docs/ProductDataResponseAllOf.md +22 -0
- data/docs/ProductOrderResponse.md +40 -0
- data/docs/ProductOrderResponseAllOf.md +22 -0
- data/docs/ProductsApi.md +243 -0
- data/docs/RiskRules.md +18 -0
- data/docs/RiskRulesData.md +30 -0
- data/docs/RiskRulesList.md +26 -0
- data/docs/ShippingContactsApi.md +243 -0
- data/docs/ShippingOrderResponse.md +32 -0
- data/docs/ShippingRequest.md +26 -0
- data/docs/ShippingsApi.md +243 -0
- data/docs/SmsCheckoutRequest.md +18 -0
- data/docs/SubscriptionEventsResponse.md +26 -0
- data/docs/SubscriptionRequest.md +22 -0
- data/docs/SubscriptionResponse.md +50 -0
- data/docs/SubscriptionUpdateRequest.md +22 -0
- data/docs/SubscriptionsApi.md +539 -0
- data/docs/TaxesApi.md +243 -0
- data/docs/Token.md +20 -0
- data/docs/TokenCard.md +28 -0
- data/docs/TokenCheckout.md +18 -0
- data/docs/TokenResponse.md +26 -0
- data/docs/TokenResponseCheckout.md +62 -0
- data/docs/TokensApi.md +81 -0
- data/docs/TransactionResponse.md +38 -0
- data/docs/TransactionsApi.md +165 -0
- data/docs/TransferDestinationResponse.md +32 -0
- data/docs/TransferMethodResponse.md +32 -0
- data/docs/TransferResponse.md +36 -0
- data/docs/TransfersApi.md +165 -0
- data/docs/TransfersResponse.md +36 -0
- data/docs/UpdateCustomer.md +44 -0
- data/docs/UpdateCustomerAntifraudInfo.md +20 -0
- data/docs/UpdateCustomerFiscalEntitiesResponse.md +38 -0
- data/docs/UpdateCustomerFiscalEntitiesResponseAllOf.md +26 -0
- data/docs/UpdateCustomerPaymentMethodsResponse.md +83 -0
- data/docs/UpdateOrderDiscountLinesRequest.md +22 -0
- data/docs/UpdateOrderTaxRequest.md +22 -0
- data/docs/UpdateOrderTaxResponse.md +28 -0
- data/docs/UpdateOrderTaxResponseAllOf.md +22 -0
- data/docs/UpdatePaymentMethods.md +18 -0
- data/docs/UpdateProduct.md +34 -0
- data/docs/WebhookKeyCreateResponse.md +28 -0
- data/docs/WebhookKeyDeleteResponse.md +28 -0
- data/docs/WebhookKeyRequest.md +18 -0
- data/docs/WebhookKeyResponse.md +30 -0
- data/docs/WebhookKeyUpdateRequest.md +18 -0
- data/docs/WebhookKeysApi.md +385 -0
- data/docs/WebhookLog.md +30 -0
- data/docs/WebhookRequest.md +20 -0
- data/docs/WebhookResponse.md +36 -0
- data/docs/WebhookUpdateRequest.md +22 -0
- data/docs/WebhooksApi.md +461 -0
- data/docs/WhitelistlistRuleResponse.md +24 -0
- data/lib/conekta/api/antifraud_api.rb +434 -0
- data/lib/conekta/api/api_keys_api.rb +407 -0
- data/lib/conekta/api/balances_api.rb +86 -0
- data/lib/conekta/api/charges_api.rb +191 -0
- data/lib/conekta/api/companies_api.rb +174 -0
- data/lib/conekta/api/customers_api.rb +591 -0
- data/lib/conekta/api/discounts_api.rb +447 -0
- data/lib/conekta/api/events_api.rb +256 -0
- data/lib/conekta/api/logs_api.rb +182 -0
- data/lib/conekta/api/orders_api.rb +657 -0
- data/lib/conekta/api/payment_link_api.rb +491 -0
- data/lib/conekta/api/payment_methods_api.rb +368 -0
- data/lib/conekta/api/plans_api.rb +406 -0
- data/lib/conekta/api/products_api.rb +275 -0
- data/lib/conekta/api/shipping_contacts_api.rb +275 -0
- data/lib/conekta/api/shippings_api.rb +275 -0
- data/lib/conekta/api/subscriptions_api.rb +550 -0
- data/lib/conekta/api/taxes_api.rb +275 -0
- data/lib/conekta/api/tokens_api.rb +97 -0
- data/lib/conekta/api/transactions_api.rb +182 -0
- data/lib/conekta/api/transfers_api.rb +182 -0
- data/lib/conekta/api/webhook_keys_api.rb +396 -0
- data/lib/conekta/api/webhooks_api.rb +477 -0
- data/lib/conekta/api_client.rb +439 -0
- data/lib/conekta/api_error.rb +58 -0
- data/lib/conekta/configuration.rb +379 -0
- data/lib/conekta/models/api_key_create_response.rb +339 -0
- data/lib/conekta/models/api_key_create_response_all_of.rb +220 -0
- data/lib/conekta/models/api_key_request.rb +234 -0
- data/lib/conekta/models/api_key_response.rb +322 -0
- data/lib/conekta/models/api_key_response_on_delete.rb +301 -0
- data/lib/conekta/models/api_key_update_request.rb +230 -0
- data/lib/conekta/models/balance_common_field.rb +231 -0
- data/lib/conekta/models/balance_response.rb +329 -0
- data/lib/conekta/models/blacklist_rule_response.rb +250 -0
- data/lib/conekta/models/charge_data_payment_method_bank_transfer_response.rb +367 -0
- data/lib/conekta/models/charge_data_payment_method_card_response.rb +337 -0
- data/lib/conekta/models/charge_data_payment_method_cash_response.rb +286 -0
- data/lib/conekta/models/charge_order_response.rb +397 -0
- data/lib/conekta/models/charge_order_response_payment_method.rb +57 -0
- data/lib/conekta/models/charge_request.rb +254 -0
- data/lib/conekta/models/charge_request_payment_method.rb +287 -0
- data/lib/conekta/models/charge_response.rb +385 -0
- data/lib/conekta/models/charge_response_channel.rb +246 -0
- data/lib/conekta/models/charge_response_payment_method.rb +57 -0
- data/lib/conekta/models/charge_response_refunds.rb +283 -0
- data/lib/conekta/models/charge_response_refunds_all_of.rb +222 -0
- data/lib/conekta/models/charge_response_refunds_data.rb +295 -0
- data/lib/conekta/models/charges_data_response.rb +392 -0
- data/lib/conekta/models/checkout.rb +355 -0
- data/lib/conekta/models/checkout_order_template.rb +298 -0
- data/lib/conekta/models/checkout_order_template_customer_info.rb +106 -0
- data/lib/conekta/models/checkout_request.rb +307 -0
- data/lib/conekta/models/checkout_response.rb +466 -0
- data/lib/conekta/models/checkouts_response.rb +282 -0
- data/lib/conekta/models/checkouts_response_all_of.rb +221 -0
- data/lib/conekta/models/company_fiscal_info_address_response.rb +335 -0
- data/lib/conekta/models/company_fiscal_info_response.rb +314 -0
- data/lib/conekta/models/company_payout_destination_response.rb +317 -0
- data/lib/conekta/models/company_response.rb +323 -0
- data/lib/conekta/models/create_customer_fiscal_entities_response.rb +339 -0
- data/lib/conekta/models/create_customer_fiscal_entities_response_all_of.rb +270 -0
- data/lib/conekta/models/create_customer_payment_methods_request.rb +107 -0
- data/lib/conekta/models/create_customer_payment_methods_response.rb +58 -0
- data/lib/conekta/models/create_risk_rules_data.rb +255 -0
- data/lib/conekta/models/customer.rb +388 -0
- data/lib/conekta/models/customer_address.rb +298 -0
- data/lib/conekta/models/customer_antifraud_info.rb +228 -0
- data/lib/conekta/models/customer_antifraud_info_response.rb +228 -0
- data/lib/conekta/models/customer_fiscal_entities_data_response.rb +339 -0
- data/lib/conekta/models/customer_fiscal_entities_request.rb +271 -0
- data/lib/conekta/models/customer_fiscal_entities_request_address.rb +305 -0
- data/lib/conekta/models/customer_fiscal_entities_response.rb +259 -0
- data/lib/conekta/models/customer_fiscal_entities_response_all_of.rb +221 -0
- data/lib/conekta/models/customer_info.rb +270 -0
- data/lib/conekta/models/customer_info_just_customer_id.rb +224 -0
- data/lib/conekta/models/customer_info_just_customer_id_response.rb +219 -0
- data/lib/conekta/models/customer_info_response.rb +257 -0
- data/lib/conekta/models/customer_payment_method_request.rb +226 -0
- data/lib/conekta/models/customer_payment_methods.rb +221 -0
- data/lib/conekta/models/customer_payment_methods_data.rb +58 -0
- data/lib/conekta/models/customer_payment_methods_request.rb +106 -0
- data/lib/conekta/models/customer_payment_methods_response.rb +282 -0
- data/lib/conekta/models/customer_response.rb +387 -0
- data/lib/conekta/models/customer_response_shipping_contacts.rb +259 -0
- data/lib/conekta/models/customer_response_shipping_contacts_all_of.rb +221 -0
- data/lib/conekta/models/customer_shipping_contacts.rb +284 -0
- data/lib/conekta/models/customer_shipping_contacts_address.rb +276 -0
- data/lib/conekta/models/customer_shipping_contacts_data_response.rb +333 -0
- data/lib/conekta/models/customer_shipping_contacts_data_response_all_of.rb +252 -0
- data/lib/conekta/models/customer_shipping_contacts_response.rb +302 -0
- data/lib/conekta/models/customer_shipping_contacts_response_address.rb +282 -0
- data/lib/conekta/models/customer_update_fiscal_entities_request.rb +266 -0
- data/lib/conekta/models/customer_update_shipping_contacts.rb +279 -0
- data/lib/conekta/models/customers_response.rb +282 -0
- data/lib/conekta/models/customers_response_all_of.rb +221 -0
- data/lib/conekta/models/delete_api_keys_response.rb +307 -0
- data/lib/conekta/models/delete_api_keys_response_all_of.rb +219 -0
- data/lib/conekta/models/deleted_blacklist_rule_response.rb +250 -0
- data/lib/conekta/models/deleted_whitelist_rule_response.rb +250 -0
- data/lib/conekta/models/details.rb +221 -0
- data/lib/conekta/models/details_error.rb +247 -0
- data/lib/conekta/models/discount_lines_data_response.rb +326 -0
- data/lib/conekta/models/discount_lines_response.rb +327 -0
- data/lib/conekta/models/discount_lines_response_all_of.rb +255 -0
- data/lib/conekta/models/email_checkout_request.rb +224 -0
- data/lib/conekta/models/error.rb +259 -0
- data/lib/conekta/models/error_all_of.rb +239 -0
- data/lib/conekta/models/event_response.rb +302 -0
- data/lib/conekta/models/events_resend_response.rb +282 -0
- data/lib/conekta/models/get_api_keys_response.rb +282 -0
- data/lib/conekta/models/get_api_keys_response_all_of.rb +221 -0
- data/lib/conekta/models/get_charges_response.rb +282 -0
- data/lib/conekta/models/get_charges_response_all_of.rb +221 -0
- data/lib/conekta/models/get_companies_response.rb +282 -0
- data/lib/conekta/models/get_companies_response_all_of.rb +221 -0
- data/lib/conekta/models/get_customer_payment_method_data_response.rb +58 -0
- data/lib/conekta/models/get_events_response.rb +282 -0
- data/lib/conekta/models/get_events_response_all_of.rb +221 -0
- data/lib/conekta/models/get_order_discount_lines_response.rb +282 -0
- data/lib/conekta/models/get_order_discount_lines_response_all_of.rb +221 -0
- data/lib/conekta/models/get_orders_response.rb +287 -0
- data/lib/conekta/models/get_payment_method_response.rb +282 -0
- data/lib/conekta/models/get_payment_method_response_all_of.rb +221 -0
- data/lib/conekta/models/get_plans_response.rb +282 -0
- data/lib/conekta/models/get_plans_response_all_of.rb +221 -0
- data/lib/conekta/models/get_transactions_response.rb +283 -0
- data/lib/conekta/models/get_transactions_response_all_of.rb +222 -0
- data/lib/conekta/models/get_transfers_response.rb +283 -0
- data/lib/conekta/models/get_transfers_response_all_of.rb +222 -0
- data/lib/conekta/models/get_webhook_keys_response.rb +282 -0
- data/lib/conekta/models/get_webhook_keys_response_all_of.rb +221 -0
- data/lib/conekta/models/get_webhooks_response.rb +282 -0
- data/lib/conekta/models/get_webhooks_response_all_of.rb +221 -0
- data/lib/conekta/models/log_response.rb +417 -0
- data/lib/conekta/models/logs_response.rb +266 -0
- data/lib/conekta/models/logs_response_data.rb +401 -0
- data/lib/conekta/models/order_capture_request.rb +244 -0
- data/lib/conekta/models/order_discount_lines_request.rb +275 -0
- data/lib/conekta/models/order_refund_request.rb +248 -0
- data/lib/conekta/models/order_request.rb +401 -0
- data/lib/conekta/models/order_request_customer_info.rb +106 -0
- data/lib/conekta/models/order_response.rb +418 -0
- data/lib/conekta/models/order_response_charges.rb +260 -0
- data/lib/conekta/models/order_response_charges_all_of.rb +221 -0
- data/lib/conekta/models/order_response_checkout.rb +468 -0
- data/lib/conekta/models/order_response_customer_info.rb +275 -0
- data/lib/conekta/models/order_response_customer_info_all_of.rb +219 -0
- data/lib/conekta/models/order_response_discount_lines.rb +259 -0
- data/lib/conekta/models/order_response_discount_lines_all_of.rb +221 -0
- data/lib/conekta/models/order_response_fiscal_entity.rb +246 -0
- data/lib/conekta/models/order_response_fiscal_entity_address.rb +315 -0
- data/lib/conekta/models/order_response_fiscal_entity_address_all_of.rb +219 -0
- data/lib/conekta/models/order_response_products.rb +282 -0
- data/lib/conekta/models/order_response_products_all_of.rb +221 -0
- data/lib/conekta/models/order_response_shipping_contact.rb +309 -0
- data/lib/conekta/models/order_response_shipping_contact_all_of.rb +237 -0
- data/lib/conekta/models/order_tax_request.rb +305 -0
- data/lib/conekta/models/order_update_request.rb +344 -0
- data/lib/conekta/models/order_update_request_customer_info.rb +105 -0
- data/lib/conekta/models/orders_response.rb +226 -0
- data/lib/conekta/models/page.rb +233 -0
- data/lib/conekta/models/pagination.rb +241 -0
- data/lib/conekta/models/payment_method.rb +233 -0
- data/lib/conekta/models/payment_method_bank_transfer.rb +397 -0
- data/lib/conekta/models/payment_method_card.rb +367 -0
- data/lib/conekta/models/payment_method_card_request.rb +248 -0
- data/lib/conekta/models/payment_method_card_request_all_of.rb +220 -0
- data/lib/conekta/models/payment_method_card_response.rb +373 -0
- data/lib/conekta/models/payment_method_card_response_all_of.rb +301 -0
- data/lib/conekta/models/payment_method_cash.rb +316 -0
- data/lib/conekta/models/payment_method_cash_request.rb +242 -0
- data/lib/conekta/models/payment_method_cash_request_all_of.rb +219 -0
- data/lib/conekta/models/payment_method_cash_response.rb +328 -0
- data/lib/conekta/models/payment_method_cash_response_all_of.rb +256 -0
- data/lib/conekta/models/payment_method_response.rb +275 -0
- data/lib/conekta/models/payment_method_spei_recurrent.rb +301 -0
- data/lib/conekta/models/payment_method_spei_recurrent_all_of.rb +229 -0
- data/lib/conekta/models/payment_method_spei_request.rb +242 -0
- data/lib/conekta/models/plan_request.rb +398 -0
- data/lib/conekta/models/plan_response.rb +327 -0
- data/lib/conekta/models/plan_update_request.rb +281 -0
- data/lib/conekta/models/product.rb +388 -0
- data/lib/conekta/models/product_data_response.rb +423 -0
- data/lib/conekta/models/product_data_response_all_of.rb +237 -0
- data/lib/conekta/models/product_order_response.rb +423 -0
- data/lib/conekta/models/product_order_response_all_of.rb +237 -0
- data/lib/conekta/models/risk_rules.rb +221 -0
- data/lib/conekta/models/risk_rules_data.rb +280 -0
- data/lib/conekta/models/risk_rules_list.rb +282 -0
- data/lib/conekta/models/shipping_order_response.rb +336 -0
- data/lib/conekta/models/shipping_request.rb +301 -0
- data/lib/conekta/models/sms_checkout_request.rb +224 -0
- data/lib/conekta/models/subscription_events_response.rb +282 -0
- data/lib/conekta/models/subscription_request.rb +243 -0
- data/lib/conekta/models/subscription_response.rb +371 -0
- data/lib/conekta/models/subscription_update_request.rb +238 -0
- data/lib/conekta/models/token.rb +231 -0
- data/lib/conekta/models/token_card.rb +352 -0
- data/lib/conekta/models/token_checkout.rb +220 -0
- data/lib/conekta/models/token_response.rb +281 -0
- data/lib/conekta/models/token_response_checkout.rb +439 -0
- data/lib/conekta/models/transaction_response.rb +395 -0
- data/lib/conekta/models/transfer_destination_response.rb +291 -0
- data/lib/conekta/models/transfer_method_response.rb +291 -0
- data/lib/conekta/models/transfer_response.rb +325 -0
- data/lib/conekta/models/transfers_response.rb +325 -0
- data/lib/conekta/models/update_customer.rb +373 -0
- data/lib/conekta/models/update_customer_antifraud_info.rb +228 -0
- data/lib/conekta/models/update_customer_fiscal_entities_response.rb +339 -0
- data/lib/conekta/models/update_customer_fiscal_entities_response_all_of.rb +270 -0
- data/lib/conekta/models/update_customer_payment_methods_response.rb +58 -0
- data/lib/conekta/models/update_order_discount_lines_request.rb +254 -0
- data/lib/conekta/models/update_order_tax_request.rb +287 -0
- data/lib/conekta/models/update_order_tax_response.rb +345 -0
- data/lib/conekta/models/update_order_tax_response_all_of.rb +237 -0
- data/lib/conekta/models/update_payment_methods.rb +219 -0
- data/lib/conekta/models/update_product.rb +342 -0
- data/lib/conekta/models/webhook_key_create_response.rb +271 -0
- data/lib/conekta/models/webhook_key_delete_response.rb +271 -0
- data/lib/conekta/models/webhook_key_request.rb +222 -0
- data/lib/conekta/models/webhook_key_response.rb +282 -0
- data/lib/conekta/models/webhook_key_update_request.rb +222 -0
- data/lib/conekta/models/webhook_log.rb +290 -0
- data/lib/conekta/models/webhook_request.rb +264 -0
- data/lib/conekta/models/webhook_response.rb +304 -0
- data/lib/conekta/models/webhook_update_request.rb +270 -0
- data/lib/conekta/models/whitelistlist_rule_response.rb +250 -0
- data/lib/conekta/version.rb +13 -1
- data/lib/conekta.rb +255 -93
- data/lib/ssl_data/ca_bundle.crt +84 -0
- data/spec/api/antifraud_api_spec.rb +166 -0
- data/spec/api/api_keys_api_spec.rb +151 -0
- data/spec/api/balances_api_spec.rb +56 -0
- data/spec/api/base_test.rb +9 -0
- data/spec/api/charges_api_spec.rb +140 -0
- data/spec/api/companies_api_spec.rb +71 -0
- data/spec/api/customers_api_spec.rb +305 -0
- data/spec/api/discounts_api_spec.rb +153 -0
- data/spec/api/events_api_spec.rb +96 -0
- data/spec/api/logs_api_spec.rb +78 -0
- data/spec/api/orders_api_spec.rb +362 -0
- data/spec/api/payment_link_api_spec.rb +192 -0
- data/spec/api/payment_methods_api_spec.rb +134 -0
- data/spec/api/plans_api_spec.rb +139 -0
- data/spec/api/products_api_spec.rb +106 -0
- data/spec/api/shipping_contacts_api_spec.rb +117 -0
- data/spec/api/shippings_api_spec.rb +108 -0
- data/spec/api/subscriptions_api_spec.rb +177 -0
- data/spec/api/taxes_api_spec.rb +110 -0
- data/spec/api/tokens_api_spec.rb +76 -0
- data/spec/api/transactions_api_spec.rb +82 -0
- data/spec/api/transfers_api_spec.rb +96 -0
- data/spec/api/webhook_keys_api_spec.rb +146 -0
- data/spec/api/webhooks_api_spec.rb +152 -0
- data/spec/api_client_spec.rb +223 -0
- data/spec/configuration_spec.rb +82 -0
- data/spec/spec_helper.rb +114 -9
- metadata +535 -188
- data/.gitignore +0 -23
- data/.rspec +0 -1
- data/Dockerfile +0 -44
- data/lib/conekta/address.rb +0 -5
- data/lib/conekta/card.rb +0 -21
- data/lib/conekta/charge.rb +0 -25
- data/lib/conekta/checkout.rb +0 -35
- data/lib/conekta/conekta_object.rb +0 -109
- data/lib/conekta/customer.rb +0 -82
- data/lib/conekta/customer_info.rb +0 -5
- data/lib/conekta/destination.rb +0 -17
- data/lib/conekta/details.rb +0 -5
- data/lib/conekta/discount_line.rb +0 -19
- data/lib/conekta/error.rb +0 -100
- data/lib/conekta/error_details.rb +0 -14
- data/lib/conekta/event.rb +0 -9
- data/lib/conekta/line_item.rb +0 -21
- data/lib/conekta/list.rb +0 -58
- data/lib/conekta/log.rb +0 -10
- data/lib/conekta/method.rb +0 -4
- data/lib/conekta/operations/create.rb +0 -18
- data/lib/conekta/operations/create_member.rb +0 -40
- data/lib/conekta/operations/custom_action.rb +0 -13
- data/lib/conekta/operations/delete.rb +0 -45
- data/lib/conekta/operations/find.rb +0 -20
- data/lib/conekta/operations/update.rb +0 -11
- data/lib/conekta/operations/where.rb +0 -30
- data/lib/conekta/order.rb +0 -86
- data/lib/conekta/payee.rb +0 -66
- data/lib/conekta/payment_method.rb +0 -4
- data/lib/conekta/payment_source.rb +0 -17
- data/lib/conekta/payout.rb +0 -7
- data/lib/conekta/payout_method.rb +0 -17
- data/lib/conekta/plan.rb +0 -16
- data/lib/conekta/refund.rb +0 -6
- data/lib/conekta/requestor.rb +0 -76
- data/lib/conekta/resource.rb +0 -55
- data/lib/conekta/return.rb +0 -12
- data/lib/conekta/shipping_contact.rb +0 -19
- data/lib/conekta/shipping_line.rb +0 -20
- data/lib/conekta/subscription.rb +0 -25
- data/lib/conekta/tax_line.rb +0 -19
- data/lib/conekta/token.rb +0 -8
- data/lib/conekta/transfer.rb +0 -7
- data/lib/conekta/util.rb +0 -137
- data/lib/conekta/webhook.rb +0 -12
- data/lib/conekta/webhook_log.rb +0 -4
- data/locales/en.yml +0 -9
- data/locales/es.yml +0 -10
- data/readme_files/banner.png +0 -0
- data/readme_files/conekta-badge.png +0 -0
- data/readme_files/ruby-badge.png +0 -0
- data/spec/conekta/1.0.0/.DS_Store +0 -0
- data/spec/conekta/1.0.0/card_spec.rb +0 -40
- data/spec/conekta/1.0.0/charge_spec.rb +0 -152
- data/spec/conekta/1.0.0/customer_spec.rb +0 -147
- data/spec/conekta/1.0.0/error_spec.rb +0 -69
- data/spec/conekta/1.0.0/event_spec.rb +0 -26
- data/spec/conekta/1.0.0/log_spec.rb +0 -20
- data/spec/conekta/1.0.0/payout_spec.rb +0 -60
- data/spec/conekta/1.0.0/plan_spec.rb +0 -53
- data/spec/conekta/1.0.0/token_spec.rb +0 -5
- data/spec/conekta/1.0.0/webhook_spec.rb +0 -36
- data/spec/conekta/2.0.0/checkout_spec.rb +0 -224
- data/spec/conekta/2.0.0/customer_spec.rb +0 -77
- data/spec/conekta/2.0.0/discount_line_spec.rb +0 -49
- data/spec/conekta/2.0.0/error_spec.rb +0 -61
- data/spec/conekta/2.0.0/line_item_spec.rb +0 -53
- data/spec/conekta/2.0.0/list_spec.rb +0 -29
- data/spec/conekta/2.0.0/order_spec.rb +0 -376
- data/spec/conekta/2.0.0/payee_spec.rb +0 -55
- data/spec/conekta/2.0.0/shipping_contact_spec.rb +0 -60
- data/spec/conekta/2.0.0/shipping_line_spec.rb +0 -53
- data/spec/conekta/2.0.0/source_spec.rb +0 -31
- data/spec/conekta/2.0.0/tax_line_spec.rb +0 -44
- data/spec/conekta/2.0.0/transfer_spec.rb +0 -59
- data/spec/conekta_spec.rb +0 -29
- data/spec/support/fixtures/orders.json +0 -1127
- data/spec/support/shared_context.rb +0 -49
@@ -0,0 +1,379 @@
|
|
1
|
+
=begin
|
2
|
+
#Conekta API
|
3
|
+
|
4
|
+
#Conekta sdk
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
7
|
+
Contact: engineering@conekta.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module Conekta
|
14
|
+
class Configuration
|
15
|
+
# Defines url scheme
|
16
|
+
attr_accessor :scheme
|
17
|
+
|
18
|
+
# Defines url host
|
19
|
+
attr_accessor :host
|
20
|
+
|
21
|
+
# Defines url base path
|
22
|
+
attr_accessor :base_path
|
23
|
+
|
24
|
+
# Define server configuration index
|
25
|
+
attr_accessor :server_index
|
26
|
+
|
27
|
+
# Define server operation configuration index
|
28
|
+
attr_accessor :server_operation_index
|
29
|
+
|
30
|
+
# Default server variables
|
31
|
+
attr_accessor :server_variables
|
32
|
+
|
33
|
+
# Default server operation variables
|
34
|
+
attr_accessor :server_operation_variables
|
35
|
+
|
36
|
+
# Defines API keys used with API Key authentications.
|
37
|
+
#
|
38
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
39
|
+
#
|
40
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
41
|
+
# config.api_key['api_key'] = 'xxx'
|
42
|
+
attr_accessor :api_key
|
43
|
+
|
44
|
+
# Defines API key prefixes used with API Key authentications.
|
45
|
+
#
|
46
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
47
|
+
#
|
48
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
49
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
50
|
+
attr_accessor :api_key_prefix
|
51
|
+
|
52
|
+
# Defines the username used with HTTP basic authentication.
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
attr_accessor :username
|
56
|
+
|
57
|
+
# Defines the password used with HTTP basic authentication.
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :password
|
61
|
+
|
62
|
+
# Defines the access token (Bearer) used with OAuth2.
|
63
|
+
attr_accessor :access_token
|
64
|
+
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
66
|
+
# Overrides the access_token if set
|
67
|
+
# @return [Proc]
|
68
|
+
attr_accessor :access_token_getter
|
69
|
+
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
72
|
+
# Default to false.
|
73
|
+
attr_accessor :return_binary_data
|
74
|
+
|
75
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
76
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
77
|
+
# Default to false.
|
78
|
+
#
|
79
|
+
# @return [true, false]
|
80
|
+
attr_accessor :debugging
|
81
|
+
|
82
|
+
# Defines the logger used for debugging.
|
83
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
84
|
+
#
|
85
|
+
# @return [#debug]
|
86
|
+
attr_accessor :logger
|
87
|
+
|
88
|
+
# Defines the temporary folder to store downloaded files
|
89
|
+
# (for API endpoints that have file response).
|
90
|
+
# Default to use `Tempfile`.
|
91
|
+
#
|
92
|
+
# @return [String]
|
93
|
+
attr_accessor :temp_folder_path
|
94
|
+
|
95
|
+
# The time limit for HTTP request in seconds.
|
96
|
+
# Default to 0 (never times out).
|
97
|
+
attr_accessor :timeout
|
98
|
+
|
99
|
+
# Set this to false to skip client side validation in the operation.
|
100
|
+
# Default to true.
|
101
|
+
# @return [true, false]
|
102
|
+
attr_accessor :client_side_validation
|
103
|
+
|
104
|
+
### TLS/SSL setting
|
105
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
106
|
+
# Default to true.
|
107
|
+
#
|
108
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
109
|
+
#
|
110
|
+
# @return [true, false]
|
111
|
+
attr_accessor :ssl_verify
|
112
|
+
|
113
|
+
### TLS/SSL setting
|
114
|
+
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
115
|
+
#
|
116
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
117
|
+
#
|
118
|
+
attr_accessor :ssl_verify_mode
|
119
|
+
|
120
|
+
### TLS/SSL setting
|
121
|
+
# Set this to customize the certificate file to verify the peer.
|
122
|
+
#
|
123
|
+
# @return [String] the path to the certificate file
|
124
|
+
attr_accessor :ssl_ca_file
|
125
|
+
|
126
|
+
### TLS/SSL setting
|
127
|
+
# Client certificate file (for client certificate)
|
128
|
+
attr_accessor :ssl_client_cert
|
129
|
+
|
130
|
+
### TLS/SSL setting
|
131
|
+
# Client private key file (for client certificate)
|
132
|
+
attr_accessor :ssl_client_key
|
133
|
+
|
134
|
+
### Proxy setting
|
135
|
+
# HTTP Proxy settings
|
136
|
+
attr_accessor :proxy
|
137
|
+
|
138
|
+
# Set this to customize parameters encoder of array parameter.
|
139
|
+
# Default to nil. Faraday uses NestedParamsEncoder when nil.
|
140
|
+
#
|
141
|
+
# @see The params_encoder option of Faraday. Related source code:
|
142
|
+
# https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
|
143
|
+
attr_accessor :params_encoder
|
144
|
+
|
145
|
+
|
146
|
+
attr_accessor :inject_format
|
147
|
+
|
148
|
+
attr_accessor :force_ending_format
|
149
|
+
|
150
|
+
def initialize
|
151
|
+
@scheme = 'https'
|
152
|
+
@host = 'api.conekta.io'
|
153
|
+
@base_path = ''
|
154
|
+
@server_index = 0
|
155
|
+
@server_operation_index = {}
|
156
|
+
@server_variables = {}
|
157
|
+
@server_operation_variables = {}
|
158
|
+
@api_key = {}
|
159
|
+
@api_key_prefix = {}
|
160
|
+
@client_side_validation = true
|
161
|
+
@ssl_verify = true
|
162
|
+
@ssl_verify_mode = nil
|
163
|
+
@ssl_ca_file = File.dirname(__FILE__) + '/../ssl_data/ca_bundle.crt'
|
164
|
+
@ssl_client_cert = nil
|
165
|
+
@ssl_client_key = nil
|
166
|
+
@middlewares = Hash.new { |h, k| h[k] = [] }
|
167
|
+
@configure_connection_blocks = []
|
168
|
+
@timeout = 60
|
169
|
+
# return data as binary instead of file
|
170
|
+
@return_binary_data = false
|
171
|
+
@params_encoder = nil
|
172
|
+
@debugging = false
|
173
|
+
@inject_format = false
|
174
|
+
@force_ending_format = false
|
175
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
176
|
+
|
177
|
+
yield(self) if block_given?
|
178
|
+
end
|
179
|
+
|
180
|
+
# The default Configuration object.
|
181
|
+
def self.default
|
182
|
+
@@default ||= Configuration.new
|
183
|
+
end
|
184
|
+
|
185
|
+
def configure
|
186
|
+
yield(self) if block_given?
|
187
|
+
end
|
188
|
+
|
189
|
+
def scheme=(scheme)
|
190
|
+
# remove :// from scheme
|
191
|
+
@scheme = scheme.sub(/:\/\//, '')
|
192
|
+
end
|
193
|
+
|
194
|
+
def host=(host)
|
195
|
+
# remove http(s):// and anything after a slash
|
196
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
197
|
+
end
|
198
|
+
|
199
|
+
def base_path=(base_path)
|
200
|
+
# Add leading and trailing slashes to base_path
|
201
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
202
|
+
@base_path = '' if @base_path == '/'
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns base URL for specified operation based on server settings
|
206
|
+
def base_url(operation = nil)
|
207
|
+
index = server_operation_index[operation]
|
208
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
|
209
|
+
|
210
|
+
server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
211
|
+
end
|
212
|
+
|
213
|
+
# Gets API key (with prefix if set).
|
214
|
+
# @param [String] param_name the parameter name of API key auth
|
215
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
216
|
+
key = @api_key[param_name]
|
217
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
218
|
+
if @api_key_prefix[param_name]
|
219
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
220
|
+
else
|
221
|
+
key
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
226
|
+
def access_token_with_refresh
|
227
|
+
return access_token if access_token_getter.nil?
|
228
|
+
access_token_getter.call
|
229
|
+
end
|
230
|
+
|
231
|
+
# Gets Basic Auth token string
|
232
|
+
def basic_auth_token
|
233
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns Auth Settings hash for api client.
|
237
|
+
def auth_settings
|
238
|
+
{
|
239
|
+
'bearerAuth' =>
|
240
|
+
{
|
241
|
+
type: 'bearer',
|
242
|
+
in: 'header',
|
243
|
+
key: 'Authorization',
|
244
|
+
value: "Bearer #{access_token_with_refresh}"
|
245
|
+
},
|
246
|
+
}
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns an array of Server setting
|
250
|
+
def server_settings
|
251
|
+
[
|
252
|
+
{
|
253
|
+
url: "https://api.conekta.io",
|
254
|
+
description: "Conekta main server",
|
255
|
+
}
|
256
|
+
]
|
257
|
+
end
|
258
|
+
|
259
|
+
def operation_server_settings
|
260
|
+
{
|
261
|
+
}
|
262
|
+
end
|
263
|
+
|
264
|
+
# Returns URL based on server settings
|
265
|
+
#
|
266
|
+
# @param index array index of the server settings
|
267
|
+
# @param variables hash of variable and the corresponding value
|
268
|
+
def server_url(index, variables = {}, servers = nil)
|
269
|
+
servers = server_settings if servers == nil
|
270
|
+
|
271
|
+
# check array index out of bound
|
272
|
+
if (index < 0 || index >= servers.size)
|
273
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
274
|
+
end
|
275
|
+
|
276
|
+
server = servers[index]
|
277
|
+
url = server[:url]
|
278
|
+
|
279
|
+
return url unless server.key? :variables
|
280
|
+
|
281
|
+
# go through variable and assign a value
|
282
|
+
server[:variables].each do |name, variable|
|
283
|
+
if variables.key?(name)
|
284
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
285
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
286
|
+
else
|
287
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
288
|
+
end
|
289
|
+
else
|
290
|
+
# use default value
|
291
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
url
|
296
|
+
end
|
297
|
+
|
298
|
+
# Configure Faraday connection directly.
|
299
|
+
#
|
300
|
+
# ```
|
301
|
+
# c.configure_faraday_connection do |conn|
|
302
|
+
# conn.use Faraday::HttpCache, shared_cache: false, logger: logger
|
303
|
+
# conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
|
304
|
+
# logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
|
305
|
+
# end
|
306
|
+
# end
|
307
|
+
#
|
308
|
+
# c.configure_faraday_connection do |conn|
|
309
|
+
# conn.adapter :typhoeus
|
310
|
+
# end
|
311
|
+
# ```
|
312
|
+
#
|
313
|
+
# @param block [Proc] `#call`able object that takes one arg, the connection
|
314
|
+
def configure_faraday_connection(&block)
|
315
|
+
@configure_connection_blocks << block
|
316
|
+
end
|
317
|
+
|
318
|
+
def configure_connection(conn)
|
319
|
+
@configure_connection_blocks.each do |block|
|
320
|
+
block.call(conn)
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
# Adds middleware to the stack
|
325
|
+
def use(*middleware)
|
326
|
+
set_faraday_middleware(:use, *middleware)
|
327
|
+
end
|
328
|
+
|
329
|
+
# Adds request middleware to the stack
|
330
|
+
def request(*middleware)
|
331
|
+
set_faraday_middleware(:request, *middleware)
|
332
|
+
end
|
333
|
+
|
334
|
+
# Adds response middleware to the stack
|
335
|
+
def response(*middleware)
|
336
|
+
set_faraday_middleware(:response, *middleware)
|
337
|
+
end
|
338
|
+
|
339
|
+
# Adds Faraday middleware setting information to the stack
|
340
|
+
#
|
341
|
+
# @example Use the `set_faraday_middleware` method to set middleware information
|
342
|
+
# config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
|
343
|
+
# config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
|
344
|
+
# config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
|
345
|
+
# config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
|
346
|
+
# config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
|
347
|
+
# config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
|
348
|
+
#
|
349
|
+
# @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
|
350
|
+
def set_faraday_middleware(operation, key, *args, &block)
|
351
|
+
unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
|
352
|
+
fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
|
353
|
+
" :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
|
354
|
+
end
|
355
|
+
|
356
|
+
@middlewares[operation] << [key, args, block]
|
357
|
+
end
|
358
|
+
ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
|
359
|
+
|
360
|
+
# Set up middleware on the connection
|
361
|
+
def configure_middleware(connection)
|
362
|
+
return if @middlewares.empty?
|
363
|
+
|
364
|
+
[:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
|
365
|
+
next unless @middlewares.key?(operation)
|
366
|
+
|
367
|
+
@middlewares[operation].each do |key, args, block|
|
368
|
+
connection.builder.send(operation, key, *args, &block)
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
if @middlewares.key?(:delete)
|
373
|
+
@middlewares[:delete].each do |key, _args, _block|
|
374
|
+
connection.builder.delete(key)
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
@@ -0,0 +1,339 @@
|
|
1
|
+
=begin
|
2
|
+
#Conekta API
|
3
|
+
|
4
|
+
#Conekta sdk
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
7
|
+
Contact: engineering@conekta.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Conekta
|
17
|
+
class ApiKeyCreateResponse
|
18
|
+
# It is occupied as a user when authenticated with basic authentication, with a blank password. This value will only appear once, in the request to create a new key. Copy and save it in a safe place.
|
19
|
+
attr_accessor :authentication_token
|
20
|
+
|
21
|
+
# Indicates if the api key is active
|
22
|
+
attr_accessor :active
|
23
|
+
|
24
|
+
# Unix timestamp in seconds of when the api key was created
|
25
|
+
attr_accessor :created_at
|
26
|
+
|
27
|
+
# Unix timestamp in seconds of when the api key was last updated
|
28
|
+
attr_accessor :updated_at
|
29
|
+
|
30
|
+
# Unix timestamp in seconds of when the api key was deleted
|
31
|
+
attr_accessor :deactivated_at
|
32
|
+
|
33
|
+
# A name or brief explanation of what this api key is used for
|
34
|
+
attr_accessor :description
|
35
|
+
|
36
|
+
# Unique identifier of the api key
|
37
|
+
attr_accessor :id
|
38
|
+
|
39
|
+
# Indicates if the api key is in production
|
40
|
+
attr_accessor :livemode
|
41
|
+
|
42
|
+
# Indicates if the api key was deleted
|
43
|
+
attr_accessor :deleted
|
44
|
+
|
45
|
+
# Object name, value is 'api_key'
|
46
|
+
attr_accessor :object
|
47
|
+
|
48
|
+
# The first few characters of the authentication_token
|
49
|
+
attr_accessor :prefix
|
50
|
+
|
51
|
+
# Indicates if the api key is private or public
|
52
|
+
attr_accessor :role
|
53
|
+
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
55
|
+
def self.attribute_map
|
56
|
+
{
|
57
|
+
:'authentication_token' => :'authentication_token',
|
58
|
+
:'active' => :'active',
|
59
|
+
:'created_at' => :'created_at',
|
60
|
+
:'updated_at' => :'updated_at',
|
61
|
+
:'deactivated_at' => :'deactivated_at',
|
62
|
+
:'description' => :'description',
|
63
|
+
:'id' => :'id',
|
64
|
+
:'livemode' => :'livemode',
|
65
|
+
:'deleted' => :'deleted',
|
66
|
+
:'object' => :'object',
|
67
|
+
:'prefix' => :'prefix',
|
68
|
+
:'role' => :'role'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Returns all the JSON keys this model knows about
|
73
|
+
def self.acceptable_attributes
|
74
|
+
attribute_map.values
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute type mapping.
|
78
|
+
def self.openapi_types
|
79
|
+
{
|
80
|
+
:'authentication_token' => :'String',
|
81
|
+
:'active' => :'Boolean',
|
82
|
+
:'created_at' => :'Integer',
|
83
|
+
:'updated_at' => :'Integer',
|
84
|
+
:'deactivated_at' => :'Integer',
|
85
|
+
:'description' => :'String',
|
86
|
+
:'id' => :'String',
|
87
|
+
:'livemode' => :'Boolean',
|
88
|
+
:'deleted' => :'Boolean',
|
89
|
+
:'object' => :'String',
|
90
|
+
:'prefix' => :'String',
|
91
|
+
:'role' => :'String'
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
# List of attributes with nullable: true
|
96
|
+
def self.openapi_nullable
|
97
|
+
Set.new([
|
98
|
+
:'deactivated_at',
|
99
|
+
])
|
100
|
+
end
|
101
|
+
|
102
|
+
# List of class defined in allOf (OpenAPI v3)
|
103
|
+
def self.openapi_all_of
|
104
|
+
[
|
105
|
+
:'ApiKeyCreateResponseAllOf',
|
106
|
+
:'ApiKeyResponse'
|
107
|
+
]
|
108
|
+
end
|
109
|
+
|
110
|
+
# Initializes the object
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
def initialize(attributes = {})
|
113
|
+
if (!attributes.is_a?(Hash))
|
114
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::ApiKeyCreateResponse` initialize method"
|
115
|
+
end
|
116
|
+
|
117
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
118
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
119
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
120
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::ApiKeyCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
121
|
+
end
|
122
|
+
h[k.to_sym] = v
|
123
|
+
}
|
124
|
+
|
125
|
+
if attributes.key?(:'authentication_token')
|
126
|
+
self.authentication_token = attributes[:'authentication_token']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'active')
|
130
|
+
self.active = attributes[:'active']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'created_at')
|
134
|
+
self.created_at = attributes[:'created_at']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'updated_at')
|
138
|
+
self.updated_at = attributes[:'updated_at']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'deactivated_at')
|
142
|
+
self.deactivated_at = attributes[:'deactivated_at']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'description')
|
146
|
+
self.description = attributes[:'description']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.key?(:'id')
|
150
|
+
self.id = attributes[:'id']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:'livemode')
|
154
|
+
self.livemode = attributes[:'livemode']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.key?(:'deleted')
|
158
|
+
self.deleted = attributes[:'deleted']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'object')
|
162
|
+
self.object = attributes[:'object']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.key?(:'prefix')
|
166
|
+
self.prefix = attributes[:'prefix']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'role')
|
170
|
+
self.role = attributes[:'role']
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
175
|
+
# @return Array for valid properties with the reasons
|
176
|
+
def list_invalid_properties
|
177
|
+
invalid_properties = Array.new
|
178
|
+
invalid_properties
|
179
|
+
end
|
180
|
+
|
181
|
+
# Check to see if the all the properties in the model are valid
|
182
|
+
# @return true if the model is valid
|
183
|
+
def valid?
|
184
|
+
true
|
185
|
+
end
|
186
|
+
|
187
|
+
# Checks equality by comparing each attribute.
|
188
|
+
# @param [Object] Object to be compared
|
189
|
+
def ==(o)
|
190
|
+
return true if self.equal?(o)
|
191
|
+
self.class == o.class &&
|
192
|
+
authentication_token == o.authentication_token &&
|
193
|
+
active == o.active &&
|
194
|
+
created_at == o.created_at &&
|
195
|
+
updated_at == o.updated_at &&
|
196
|
+
deactivated_at == o.deactivated_at &&
|
197
|
+
description == o.description &&
|
198
|
+
id == o.id &&
|
199
|
+
livemode == o.livemode &&
|
200
|
+
deleted == o.deleted &&
|
201
|
+
object == o.object &&
|
202
|
+
prefix == o.prefix &&
|
203
|
+
role == o.role
|
204
|
+
end
|
205
|
+
|
206
|
+
# @see the `==` method
|
207
|
+
# @param [Object] Object to be compared
|
208
|
+
def eql?(o)
|
209
|
+
self == o
|
210
|
+
end
|
211
|
+
|
212
|
+
# Calculates hash code according to all attributes.
|
213
|
+
# @return [Integer] Hash code
|
214
|
+
def hash
|
215
|
+
[authentication_token, active, created_at, updated_at, deactivated_at, description, id, livemode, deleted, object, prefix, role].hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Builds the object from hash
|
219
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
220
|
+
# @return [Object] Returns the model itself
|
221
|
+
def self.build_from_hash(attributes)
|
222
|
+
new.build_from_hash(attributes)
|
223
|
+
end
|
224
|
+
|
225
|
+
# Builds the object from hash
|
226
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
227
|
+
# @return [Object] Returns the model itself
|
228
|
+
def build_from_hash(attributes)
|
229
|
+
return nil unless attributes.is_a?(Hash)
|
230
|
+
attributes = attributes.transform_keys(&:to_sym)
|
231
|
+
self.class.openapi_types.each_pair do |key, type|
|
232
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
233
|
+
self.send("#{key}=", nil)
|
234
|
+
elsif type =~ /\AArray<(.*)>/i
|
235
|
+
# check to ensure the input is an array given that the attribute
|
236
|
+
# is documented as an array but the input is not
|
237
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
238
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
239
|
+
end
|
240
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
241
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
self
|
246
|
+
end
|
247
|
+
|
248
|
+
# Deserializes the data based on type
|
249
|
+
# @param string type Data type
|
250
|
+
# @param string value Value to be deserialized
|
251
|
+
# @return [Object] Deserialized data
|
252
|
+
def _deserialize(type, value)
|
253
|
+
case type.to_sym
|
254
|
+
when :Time
|
255
|
+
Time.parse(value)
|
256
|
+
when :Date
|
257
|
+
Date.parse(value)
|
258
|
+
when :String
|
259
|
+
value.to_s
|
260
|
+
when :Integer
|
261
|
+
value.to_i
|
262
|
+
when :Float
|
263
|
+
value.to_f
|
264
|
+
when :Boolean
|
265
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
266
|
+
true
|
267
|
+
else
|
268
|
+
false
|
269
|
+
end
|
270
|
+
when :Object
|
271
|
+
# generic object (usually a Hash), return directly
|
272
|
+
value
|
273
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
274
|
+
inner_type = Regexp.last_match[:inner_type]
|
275
|
+
value.map { |v| _deserialize(inner_type, v) }
|
276
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
277
|
+
k_type = Regexp.last_match[:k_type]
|
278
|
+
v_type = Regexp.last_match[:v_type]
|
279
|
+
{}.tap do |hash|
|
280
|
+
value.each do |k, v|
|
281
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
282
|
+
end
|
283
|
+
end
|
284
|
+
else # model
|
285
|
+
# models (e.g. Pet) or oneOf
|
286
|
+
klass = Conekta.const_get(type)
|
287
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
# Returns the string representation of the object
|
292
|
+
# @return [String] String presentation of the object
|
293
|
+
def to_s
|
294
|
+
to_hash.to_s
|
295
|
+
end
|
296
|
+
|
297
|
+
# to_body is an alias to to_hash (backward compatibility)
|
298
|
+
# @return [Hash] Returns the object in the form of hash
|
299
|
+
def to_body
|
300
|
+
to_hash
|
301
|
+
end
|
302
|
+
|
303
|
+
# Returns the object in the form of hash
|
304
|
+
# @return [Hash] Returns the object in the form of hash
|
305
|
+
def to_hash
|
306
|
+
hash = {}
|
307
|
+
self.class.attribute_map.each_pair do |attr, param|
|
308
|
+
value = self.send(attr)
|
309
|
+
if value.nil?
|
310
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
311
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
312
|
+
end
|
313
|
+
|
314
|
+
hash[param] = _to_hash(value)
|
315
|
+
end
|
316
|
+
hash
|
317
|
+
end
|
318
|
+
|
319
|
+
# Outputs non-array value in the form of hash
|
320
|
+
# For object, use to_hash. Otherwise, just return the value
|
321
|
+
# @param [Object] value Any valid value
|
322
|
+
# @return [Hash] Returns the value in the form of hash
|
323
|
+
def _to_hash(value)
|
324
|
+
if value.is_a?(Array)
|
325
|
+
value.compact.map { |v| _to_hash(v) }
|
326
|
+
elsif value.is_a?(Hash)
|
327
|
+
{}.tap do |hash|
|
328
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
329
|
+
end
|
330
|
+
elsif value.respond_to? :to_hash
|
331
|
+
value.to_hash
|
332
|
+
else
|
333
|
+
value
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
end
|
338
|
+
|
339
|
+
end
|