forked from anujluthra/activemerchant-anz-gateway
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged with remote master, fixed up test_helper includes
- Loading branch information
Showing
15 changed files
with
374 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.gem | ||
.bundle | ||
Gemfile.lock | ||
pkg/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source "http://rubygems.org" | ||
|
||
# Specify your gem's dependencies in activemerchant-anz.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (C) 2009 by Anuj Luthra | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Anz eGate | ||
|
||
Provides an ActiveMerchant gateway to interface with ANZ's eGate. | ||
|
||
## Usage | ||
|
||
This is now available as a gem, as long as you have it in your Gemfile you can use bundler. | ||
|
||
Gemfile | ||
|
||
source :rubygems | ||
|
||
gem 'activemerchant-anz-gateway' | ||
|
||
Basic Usage | ||
|
||
require 'bundler' | ||
Bundler.require | ||
|
||
# Your merchant must have operators, to test prefix your merchant name with TEST | ||
gateway = ActiveMerchant::Billing::AnzGateway.new( | ||
:merchant_id => 'TESTANZMURCONREG', | ||
:access_code => '31C43EF3' | ||
) | ||
|
||
# ANZ only require the card number, month and year | ||
card = ActiveMerchant::Billing::CreditCard.new( | ||
:number => '5123456789012346', | ||
:month => 5, | ||
:year => 2013 | ||
) | ||
|
||
params = { | ||
:order_id => 'X123F', | ||
:invoice => '10001' | ||
} | ||
|
||
# $10 puchase | ||
result = gateway.purchase(1000, card, params) | ||
|
||
Other Features | ||
|
||
There are features for refuding/crediting and querying past records, however these are missing tests and I can't vouch for them. | ||
|
||
You can manage your anz merchant account over at https://migs.mastercard.com.au/ma | ||
|
||
## 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. | ||
|
||
## Acknowledgements | ||
|
||
I had pretty much nothing to do with this library, I just made it into a gem and check on the tests. This is a fork of [Anuj Luthra's](https://github.com/anujluthra) [fantastic work](https://github.com/anujluthra/activemerchant-anz-gateway). | ||
|
||
# LICENCE | ||
|
||
Licenced under MIT Copyright 2009 by Anuj Luthra, for details see LICENCE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require "bundler/gem_tasks" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require File.expand_path("../lib/active_merchant-anz/version", __FILE__) | ||
|
||
Gem::Specification.new do |s| | ||
s.platform = Gem::Platform::RUBY | ||
s.name = "activemerchant-anz-gateway" | ||
s.version = ActiveMerchant::Anz::VERSION | ||
s.authors = ["Anuj Luthra", "Dirk Kelly"] | ||
s.email = ["anuj.luthra@gmail.com", "dk@dirkkelly.com"] | ||
s.homepage = "" | ||
s.summary = %q{Gateway for ANZ and ActiveMerchant} | ||
s.description = %q{Provides an interface to ANZ for the Activemerchant library, fork of github@anujluthra's work} | ||
|
||
s.rubyforge_project = "activemerchant-anz-gateway" | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- {spec,features}/*`.split("\n") | ||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | ||
s.require_paths = ["lib"] | ||
|
||
# specify any dependencies here; for example: | ||
s.add_development_dependency "test-unit" | ||
s.add_development_dependency "mocha" | ||
|
||
s.add_runtime_dependency "activemerchant" | ||
s.add_runtime_dependency "activesupport" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'active_merchant' | ||
require 'active_merchant/billing' | ||
require 'active_support/core_ext/object' | ||
|
||
require "active_merchant-anz/version" | ||
require "active_merchant/billing/gateways/anz" | ||
|
||
|
||
module ActiveMerchant | ||
module Anz | ||
# Your code goes here... | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module ActiveMerchant | ||
module Anz | ||
VERSION = "0.1.0" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'active_merchant-anz' |
Oops, something went wrong.