Sha256: dacf58232c8246a86194b1a25263f6e015d6b019852de7339553366705633197

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

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

    # Metodo para verificar se o token gerado é valido.
    def self.verify card_token

      hash =  {
              "number_token" => card_token.to_s,
              "cardholder_name": "JOAO DA SILVA",
              "expiration_month": "12",
              "expiration_year": "20",
              "security_code": "123"
              }

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

      return JSON.parse(response.read_body)
    end

    private

    def self.endpoint
      return "cards/verification"
    end

  end
end

# GetnetApi::CardVerification.verify a["number_token"]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
getnet_api-0.1.1 lib/getnet_api/card_verification.rb