Sha256: a34ee3e680a5ae8f2b8e402f83d9ca96724ec3664abac98ac966a6df98166ad5

Contents?: true

Size: 562 Bytes

Versions: 6

Compression:

Stored size: 562 Bytes

Contents

# -*- encoding : utf-8 -*-
module GetnetApi
  class CardToken < Base
    require 'uri'
    require 'net/http'

    # Metodo para gerar o token do cartão de credito do cliente, para ser usado no pagamento.
    def self.get card_number

      hash =  {
              "card_number" => card_number.to_s
              }

      response = self.build_request self.endpoint, "post", hash

      return JSON.parse(response.read_body)
    end

    private

    def self.endpoint
      return "tokens/card"
    end

  end
end

# GetnetApi::CardToken.get "5155901222280001"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
getnet_api-1.0.3 lib/getnet_api/card_token.rb
getnet_api-1.0.2 lib/getnet_api/card_token.rb
getnet_api-1.0.1 lib/getnet_api/card_token.rb
getnet_api-1.0.0 lib/getnet_api/card_token.rb
getnet_api-0.1.2 lib/getnet_api/card_token.rb
getnet_api-0.1.1 lib/getnet_api/card_token.rb