Sha256: dec115c3112f66d502f7d09716944b1610e322e94542ce9d0a7fbda09e4e3623

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"

require 'spec'
require 'lib/exact4r'
require 'ruby-debug'

REPLICATION_TIME = 20

# address & authentication for testing against api.e-xact.com
# LOCATION = "https://api.e-xact.com/"
# BASIC_AUTH = {:gateway_id => "A00049-01", :password => "test1"}

# address & authentication for local testing
# LOCATION = "http://ws.local/"   # I am a Passenger...
LOCATION = "http://localhost:3000/"   # old skool
BASIC_AUTH = {:gateway_id => "AD0008-01", :password => "7nfcpc7n"}

Spec::Runner.configure do |config|
  include EWS::Transaction

  config.mock_with :mocha

end

def basic_params(options = {})
  {
    :transaction_type => :purchase,
    :amount => "10.13",
    :cardholder_name => "Simon Brown",
    :cc_number => "4111111111111111",
    :cc_expiry => "1012",
    :gateway_id => "someone", :password => "somehow"
  }.merge(options)
end

def basic_find_transaction(options = {})
  params = {
    :transaction_type => :transaction_details,
  }.merge(options)
  
  ::EWS::Transaction::Request.new(params.merge(BASIC_AUTH))  
end

def basic_new_transaction(options = {})
  params = {
    :transaction_type => :purchase,
    :amount => "10.13",
    :cardholder_name => "Simon Brown",
    :cc_number => "4111111111111111",
    :cc_expiry => "1012",
    :reference_no => "987987",
  }.merge(options)
  
  ::EWS::Transaction::Request.new(params.merge(BASIC_AUTH))
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exact4r-0.9.1 ./spec/spec_helper.rb