class Paysure::Verify

Attributes

config[R]
merchant_id[RW]
response[R]
token[RW]

Public Class Methods

new(args = {}) click to toggle source
Calls superclass method Paysure::RequestBase::new
# File lib/paysure/requests/verify.rb, line 8
def initialize(args = {})
  super
  @ACTION_NAME = [:verify,'json'].join('.').freeze
  @token       = args.fetch(:token)
  @merchant_id = args.fetch(:merchant_id,Paysure.configuration.merchant_id)
  @response    = ResponseVerify.new
end

Public Instance Methods

call() click to toggle source
# File lib/paysure/requests/verify.rb, line 17
def call
    connection = Faraday.new(url: "#{@API_URL}/transaction/") do |faraday|
      faraday.adapter Faraday.default_adapter
      faraday.response :json
    end
      response = connection.get(@ACTION_NAME, token: @token,merchant_id: @merchant_id)
      @response.validate(response.body)
end