Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed up the remote tests, started on the readme

  • Loading branch information...
commit b9b7e30cdcb8627febbfa10787aac94a63b6a122 1 parent d2cf91f
Dirk Kelly authored
View
14 README.md
@@ -0,0 +1,14 @@
+# Anz eGate
+
+## Usage
+
+
+
+## Testing
+
+Anz seem to have removed their public testing profile, I've instead set the fixtures to come from environment variables
+
+ export ANZ_MERCHANT=TESTyoumerchantname
+ export ANZ_CODE=youroperatorcode
+
+To set up your testing environment you will need to log in as the _Administrator_ using your merchantid prefixed by test. The password will be the same as your production account.
View
4 test/fixtures.yml
@@ -1,3 +1,3 @@
anz:
- merchant_id: TESTANZTEST3
- access_code: 6447E199
+ merchant_id: <%= ENV['ANZ_MERCHANT'] %>
+ access_code: <%= ENV['ANZ_CODE'] %>
View
18 test/remote/gateways/remote_anz_test.rb
@@ -11,35 +11,27 @@ def setup
@credit_card_fail = credit_card('1234567812345678',
:month => Time.now.month,
- :year => Time.now.year
+ :year => Time.now.year
)
@params = {
- :booking_number => '222222D',
- :unique_id => 'efad6659cea26be50fe36cbdec91f042',
+ :order_id => 'X123F',
+ :invoice => '10001',
}
end
def test_invalid_amount
- assert response = @gateway.purchase(Money.new(0), @credit_card_success, @params)
+ assert response = @gateway.purchase(0, @credit_card_success, @params)
assert_failure response
assert response.test?
end
def test_purchase_success_with_verification_value
- assert response = @gateway.purchase(Money.new(100), @credit_card_success, @params)
+ assert response = @gateway.purchase(100, @credit_card_success, @params)
assert_success response
assert response.test?
end
-# def test_purchase_with_invalid_verification_value
-# @credit_card_success.verification_value = 'AAA'
-# assert response = @gateway.purchase(100, @credit_card_success, @params)
-# assert_nil response.authorization
-# assert_failure response
-# assert response.test?
-# end
-
def test_invalid_expiration_date
@credit_card_success.year = 2005
assert response = @gateway.purchase(100, @credit_card_success, @params)
View
3  test/test_helper.rb
@@ -9,6 +9,7 @@
require 'test/unit'
require 'mocha'
+require 'erb'
require 'activemerchant'
require 'activemerchant-anz'
@@ -155,7 +156,7 @@ def fixtures(key)
def load_fixtures
file = File.exists?(LOCAL_CREDENTIALS) ? LOCAL_CREDENTIALS : DEFAULT_CREDENTIALS
- yaml_data = YAML.load(File.read(file))
+ yaml_data = YAML.load(ERB.new(File.read(file)).result)
symbolize_keys(yaml_data)
yaml_data

0 comments on commit b9b7e30

Please sign in to comment.
Something went wrong with that request. Please try again.