All URIs are relative to https://api.conekta.io
Method | HTTP request | Description |
---|---|---|
create_token | POST /tokens | Create Token |
create_token(token, opts)
Create Token
Generate a payment token, to associate it with a card
require 'time'
require 'conekta'
# setup authorization
Conekta.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Conekta::TokensApi.new
token = Conekta::Token.new # Token | requested field for token
opts = {
accept_language: 'es' # String | Use for knowing which language to use
}
begin
# Create Token
result = api_instance.create_token(token, opts)
p result
rescue Conekta::ApiError => e
puts "Error when calling TokensApi->create_token: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_token_with_http_info(token, opts)
begin
# Create Token
data, status_code, headers = api_instance.create_token_with_http_info(token, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TokenResponse>
rescue Conekta::ApiError => e
puts "Error when calling TokensApi->create_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
token | Token | requested field for token | |
accept_language | String | Use for knowing which language to use | [optional][default to 'es'] |
- Content-Type: application/json
- Accept: application/vnd.conekta-v2.1.0+json