Sha256: 3cf5ecaa700e2ec4ccdea104ea2731c3f92626af54ae78a9010aad6b52ce1f2d

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 ./spec/spec_helper.rb