activemerchant-bpoint 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ spec/test_credentials.rb
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use @activemerchant-bpoint --create
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011 Sentia Australia Pty Ltd
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,103 @@
1
+ # activemerchant-bpoint
2
+
3
+ ActiveMerchant Bpoint is an add-on for ActiveMerchant which provides a gateway for the Commonwealth Bank of Australia's BPOINT merchant gateway. Development on the gem has been sponsored by [Sentia Australia](http://www.sentia.com.au/).
4
+
5
+ ## Installation
6
+ Before installing the gem you should have a BPOINT account ready to use. If not then [Contact the commonwealth bank of australia for more info.](http://www.bpoint.com.au/bpoint/business/contact.html)
7
+
8
+ To install simply add the following line to your `Gemfile` and then run `bundle install`:
9
+
10
+ ``` ruby
11
+ gem 'activemerchant-bpoint'
12
+ ```
13
+
14
+ The gateway can be initialised by passing your login details like so:
15
+
16
+ ``` ruby
17
+ gateway = ActiveMerchant::Billing::BpointGateway.new(:login => 'login', :password => 'pass', :merchant_number => 'num')
18
+ ```
19
+
20
+ ## Usage
21
+ Once you have an initialised gateway, there are several public methods available including `purchase`, `store` and `unstore`.
22
+
23
+ Here is an example of using the purchase method:
24
+
25
+ ``` ruby
26
+ amount = 1000 # 1000 cents is $10.00 AUD
27
+ options = { :order_id => '5' } # Store the customers order number at the gateway
28
+
29
+ creditcard = ActiveMerchant::Billing::CreditCard.new(
30
+ :number => '4111111111111111',
31
+ :month => 8,
32
+ :year => 2006,
33
+ :first_name => 'Longbob',
34
+ :last_name => 'Longsen'
35
+ )
36
+
37
+ response = gateway.purchase(amount, creditcard, options)
38
+
39
+ if response.sucess?
40
+ puts "All OK!"
41
+ else
42
+ puts response.message # Output the error message
43
+ end
44
+ ```
45
+
46
+ You can also store credit card numbers at the BPOINT gateway and then pass the token to `purchase()` like so:
47
+
48
+ ``` ruby
49
+ amount = 1000 # 1000 cents is $10.00 AUD
50
+ tptions = { :order_id => '5' } # Store the customers order number at the gateway
51
+
52
+ creditcard = ActiveMerchant::Billing::CreditCard.new(
53
+ :number => '4111111111111111',
54
+ :month => 8,
55
+ :year => 2006,
56
+ :first_name => 'Longbob',
57
+ :last_name => 'Longsen'
58
+ )
59
+
60
+
61
+ token = gateway.store(credit_card).params['token']
62
+
63
+ response = gateway.purchase(amount, token, options)
64
+
65
+ # ...
66
+
67
+ ```
68
+
69
+ ## Using test mode
70
+ As [noted in the BPOINT developer documenation in regards to testing](https://www.bpoint.com.au/backoffice/Views/Bpoint/Support/HelpGuids/TechExtracts/Testing(Phone,Internet,DDCC\).pdf) the gateway can be put into test mode by sending a month value of `99`. The initialiser for the gateway takes an optional test argument which will put it into test mode like so:
71
+
72
+ ``` ruby
73
+ ActiveMerchant::Billing::BpointGateway.new(:login => 'l', :password => 'p', :merchant_number => 'n', :test => true)
74
+ ```
75
+
76
+ When the gateway is in test mode then all requests will automatically have the month set to 99 (which triggers test mode on the gateway). The last 2 digits of the year is then used to determine which response code the gateway returns. The caveat with this is that you cannot have a successful status (year 2000 or 2100) and have a valid `ActiveMerchant::Billing::CreditCard`. To get around this you can pass the parameter `:force_success => true` with the options to the purchase method. This will result in a successful transaction.
77
+
78
+ ``` ruby
79
+ gateway = ActiveMerchant::Billing::BpointGateway.new(:login => 'l', :password => 'p', :merchant_number => 'n', :test => true)
80
+
81
+ # ...
82
+ options = { :force_success => true, :customer_id => '9' }
83
+ response = gateway.purchase(amount, creditcard, options)
84
+
85
+ ```
86
+
87
+ Optionally you can pass the flag into the initializer for the gateway to always force success:
88
+
89
+ ``` ruby
90
+ ActiveMerchant::Billing::BpointGateway.new(:login => 'l', :password => 'p', :merchant_number => 'n', :test => true, :force_success => true
91
+ ```
92
+
93
+ ## License
94
+
95
+ activemerchant-bpoint is distributed under a standard MIT license, see [LICENSE](https://github.com/Sentia/activemerchant-bpoint/blob/master/LICENSE) for further information.
96
+
97
+ ## Contributing
98
+
99
+ Fork on GitHub and after you’ve committed tested patches, send a pull request.
100
+
101
+ To get tests running simply `run bundle install` and then `rspec spec`.
102
+
103
+ The test suite performs some remote tests by hitting the gateway and uses the VCR gem which prerecords responses. This means that you do not need to enter any details to perform the remote tests. If you do need to add new actions which hit the gateway, or rerecord responses, simply add your BPOINT details to the `spec/test_credentials.rb` file.
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "activemerchant/bpoint/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "activemerchant-bpoint"
7
+ s.version = ActiveMerchant::Bpoint::VERSION
8
+ s.authors = ["Mario Visic"]
9
+ s.email = ["mario@mariovisic.com"]
10
+ s.homepage = ""
11
+ s.summary = 'ActiveMerchant BPOINT Plugin'
12
+ s.description = 'An ActiveMerchant plugin that provides a full featured BPOINT gateway. Development sponsored by Sentia Australia.'
13
+
14
+ s.rubyforge_project = "activemerchant-bpoint"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency 'rspec'
22
+ s.add_development_dependency 'vcr'
23
+ s.add_development_dependency 'fakeweb'
24
+ s.add_runtime_dependency 'activemerchant', '>= 1.20.0'
25
+ end
@@ -0,0 +1,3 @@
1
+ require 'active_merchant'
2
+ require 'activemerchant/bpoint/version'
3
+ require 'activemerchant/billing/gateways/bpoint'
@@ -0,0 +1,131 @@
1
+ module ActiveMerchant
2
+ module Billing
3
+ class BpointGateway < Gateway
4
+ LIVE_URL = 'https://www.bpoint.com.au/evolve/service.asmx'
5
+
6
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
7
+ self.supported_countries = ['AU']
8
+ self.homepage_url = 'http://www.bpoint.com.au'
9
+ self.display_name = 'BPOINT'
10
+ self.default_currency = 'AUD'
11
+ self.money_format = :cents
12
+
13
+ def initialize(options = {})
14
+ requires!(options, :login, :password, :merchant_number)
15
+ @options = options
16
+ super
17
+ end
18
+
19
+ def purchase(money, creditcard, options = {})
20
+ post = {}
21
+ add_invoice(post, options)
22
+ add_creditcard(post, creditcard, options)
23
+
24
+ commit('ProcessPayment', money, post)
25
+ end
26
+
27
+ def store(credit_card, options = {})
28
+ post = {}
29
+ add_creditcard(post, credit_card, options)
30
+
31
+ commit('AddToken', nil, post)
32
+ end
33
+
34
+ def unstore(token, options = {})
35
+ post = { :token => token }
36
+
37
+ commit('DeleteToken', nil, post)
38
+ end
39
+
40
+ def test?
41
+ @options[:test] || super
42
+ end
43
+
44
+ private
45
+
46
+ def add_invoice(post, options)
47
+ post[:MerchantReference] = options[:order_id]
48
+ end
49
+
50
+ def add_creditcard(post, creditcard_or_token, options = {})
51
+ if creditcard_or_token.is_a?(String)
52
+ post[:CardNumber] = creditcard_or_token
53
+ else
54
+ if test?
55
+ creditcard_or_token = creditcard_or_token.dup
56
+ creditcard_or_token.month = '99'
57
+ creditcard_or_token.year = '2000' if @options[:force_success] == true || options[:force_success] == true
58
+ end
59
+ post[:CardNumber] = creditcard_or_token.number
60
+ post[:ExpiryDate] = "%02d%02s" % [creditcard_or_token.month, creditcard_or_token.year.to_s[-2..-1]]
61
+ post[:CVC] = creditcard_or_token.verification_value
62
+ post[:CRN1] = [creditcard_or_token.first_name, creditcard_or_token.last_name].join(' ')
63
+ end
64
+ end
65
+
66
+ def parse(body)
67
+ return {} if body.blank?
68
+
69
+ xml = REXML::Document.new(body)
70
+ result = {}.tap { |response| xml.root.elements.to_a.each { |node| parse_element(response, node) } }
71
+ end
72
+
73
+ def parse_element(response, node)
74
+ return response[node.name.underscore.to_sym] = node.text unless node.has_elements?
75
+
76
+ node.elements.each{|element| parse_element(response, element) }
77
+ end
78
+
79
+ def commit(action, money, parameters)
80
+ if action == 'ProcessPayment'
81
+ parameters[:Amount] = amount(money)
82
+ parameters[:PaymentType] = 'PAYMENT'
83
+ parameters[:TxnType] = 'INTERNET_ANONYMOUS'
84
+ end
85
+
86
+ response = parse(ssl_post(LIVE_URL, post_data(action, parameters), 'SOAPAction' => "urn:Eve/#{action}", 'Content-Type' => 'text/xml;charset=UTF-8'))
87
+ options = {
88
+ :test => test?,
89
+ :authorization => response[:authorise_id]
90
+ }
91
+
92
+ Response.new(success_from(response), message_from(response), response, options)
93
+ end
94
+
95
+ def success_from(response)
96
+ response[:response_code] == 'SUCCESS' && (response[:acquirer_response_code] == nil || response[:acquirer_response_code] == '00')
97
+ end
98
+
99
+ def message_from(response)
100
+ response[:response_message]
101
+ end
102
+
103
+ def post_data(action, parameters = {})
104
+ xml = REXML::Document.new
105
+ envelope = xml.add_element('env:Envelope', { 'xmlns:xsd' =>
106
+ 'http://www.w3.org/2001/XMLSchema',
107
+ 'xmlns:xsi' =>
108
+ 'http://www.w3.org/2001/XMLSchema-instance',
109
+ 'xmlns:wsdl' => 'urn:Eve', 'xmlns:env' =>
110
+ 'http://schemas.xmlsoap.org/soap/envelope/',
111
+ 'xmlns:ns0' => 'urn:Eve'})
112
+
113
+ body = envelope.add_element('env:Body')
114
+ request = body.add_element("ns0:#{action}")
115
+
116
+ tnx_request = request.add_element('ns0:tokenRequest') if action == 'AddToken'
117
+ tnx_request = request.add_element('ns0:txnReq') if action == 'ProcessPayment'
118
+ tnx_request = request if tnx_request.blank?
119
+
120
+ request.add_element('ns0:username').text = @options[:login]
121
+ request.add_element('ns0:password').text = @options[:password]
122
+ request.add_element('ns0:merchantNumber').text = @options[:merchant_number]
123
+
124
+ parameters.each { |key, value| tnx_request.add_element("ns0:#{key}").text = value }
125
+
126
+ xml << REXML::XMLDecl.new('1.0', 'UTF-8')
127
+ xml.to_s
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,5 @@
1
+ module ActiveMerchant
2
+ module Bpoint
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActiveMerchant::Billing::BpointGateway do
4
+ context 'on initialize' do
5
+ subject { ActiveMerchant::Billing::BpointGateway.new(:login => 'foo', :password => 'bar', :merchant_number => '7') }
6
+
7
+ it 'sets the given username' do
8
+ subject.instance_variable_get('@options')[:login].should == 'foo'
9
+ end
10
+
11
+ it 'sets the given password' do
12
+ subject.instance_variable_get('@options')[:password].should == 'bar'
13
+ end
14
+
15
+ it 'sets the given merchant number' do
16
+ subject.instance_variable_get('@options')[:merchant_number].should == '7'
17
+ end
18
+
19
+ it 'should raise an exception if the username is missing' do
20
+ expect { ActiveMerchant::Billing::BpointGateway.new(:password => 'bar', :merchant_number => '4') }.to raise_error ArgumentError
21
+ end
22
+
23
+ it 'should raise an exception if the password is missing' do
24
+ expect { ActiveMerchant::Billing::BpointGateway.new(:login => 'foo', :merchant_number => '4') }.to raise_error ArgumentError
25
+ end
26
+
27
+ it 'should raise an exception if the merchant number is missing' do
28
+ expect { ActiveMerchant::Billing::BpointGateway.new(:login => 'foo', :password => 'bar') }.to raise_error ArgumentError
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,94 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActiveMerchant::Billing::BpointGateway do
4
+ let(:options) { { :order_id => '1', :description => 'Store Purchase' } }
5
+ let(:success_credit_card) { credit_card('5123456789012346', :year => 2100) }
6
+ let(:fail_credit_card) { credit_card('5123456789012346', :year => 2010) }
7
+ let(:invalid_credit_card) { credit_card('', :year => 2010) }
8
+
9
+ context 'using invalid details' do
10
+ let(:my_gateway) { gateway(:login => 'does', :password => 'not_exist', :merchant_number => '8') }
11
+ let(:response) { VCR.use_cassette('invalid login') { my_gateway.purchase(100, credit_card, options) } }
12
+
13
+ it 'is not successful' do
14
+ response.should_not be_success
15
+ end
16
+
17
+ it 'returns an invalid login status' do
18
+ response.message.should include 'invalid login'
19
+ end
20
+ end
21
+
22
+ context 'making a purchase' do
23
+ context 'on a valid credit card' do
24
+ subject { VCR.use_cassette('valid CC purchase') { gateway.purchase(1000, success_credit_card, options) } }
25
+
26
+ it { should be_success }
27
+
28
+ it 'should return an authorization ID' do
29
+ subject.authorization.should be_present
30
+ end
31
+ end
32
+
33
+ context 'on an invalid credit card' do
34
+ subject { VCR.use_cassette('invalid CC purchase') { gateway.purchase(1000, fail_credit_card, options) } }
35
+
36
+ it { should_not be_success }
37
+ end
38
+ end
39
+
40
+ context 'making a purchase with a stored credit card' do
41
+ let!(:token) { VCR.use_cassette('store valid CC') { gateway.store(success_credit_card).params['token'] } }
42
+
43
+ context 'with a valid token' do
44
+ subject { VCR.use_cassette('valid token purchase') { gateway.purchase(1000, token, options) } }
45
+
46
+ it { should be_success }
47
+
48
+ it 'should return an authorization ID' do
49
+ subject.authorization.should be_present
50
+ end
51
+ end
52
+
53
+ context 'on an invalid token' do
54
+ subject { VCR.use_cassette('invalid token purchase') { gateway.purchase(1000, 'invalid', options) } }
55
+
56
+ it { should_not be_success }
57
+ end
58
+
59
+ end
60
+
61
+ context 'storing a credit card' do
62
+ context 'for a valid credit card' do
63
+ subject { VCR.use_cassette('store valid CC') { gateway.store(success_credit_card) } }
64
+
65
+ it { should be_success }
66
+
67
+ it 'should return a token' do
68
+ subject.params['token'].should be_present
69
+ end
70
+ end
71
+
72
+ context 'for an invalid credit card' do
73
+ subject { VCR.use_cassette('store invalid CC') { gateway.store(invalid_credit_card) } }
74
+
75
+ it { should_not be_success }
76
+ end
77
+ end
78
+
79
+ context 'removing a credit card from storage' do
80
+ let!(:token) { VCR.use_cassette('store valid CC') { gateway.store(success_credit_card).params['token'] } }
81
+
82
+ context 'when given a valid token' do
83
+ subject { VCR.use_cassette('unstore valid token') { gateway.unstore(token) } }
84
+
85
+ it { should be_success }
86
+ end
87
+
88
+ context 'when not given a valid token' do
89
+ subject { VCR.use_cassette('unstore invalid token') { gateway.unstore('7') } }
90
+
91
+ it { should_not be_success }
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'activemerchant-bpoint'
3
+ require 'support/gateway_helpers'
4
+ require 'vcr'
5
+ require 'test_credentials'
6
+
7
+ RSpec.configure do |config|
8
+ config.include GatewayHelpers
9
+ end
10
+
11
+ VCR.config do |c|
12
+ c.cassette_library_dir = File.dirname(__FILE__) + '/support/vcr_cassettes'
13
+ c.stub_with :fakeweb
14
+ end
@@ -0,0 +1,19 @@
1
+ module GatewayHelpers
2
+ def credit_card(number = '5123456789012346', options = {})
3
+ defaults = {
4
+ :number => number,
5
+ :month => 99, # We need to use 99 to trigger 'Test' mode for the gatewqy
6
+ :year => 2000, # In gateway test mode the year is used to set the response status, (2000 in YY == 00 which is approved)
7
+ :first_name => 'Longbob',
8
+ :last_name => 'Longsen',
9
+ :verification_value => '123',
10
+ :type => 'visa'
11
+ }.update(options)
12
+
13
+ ActiveMerchant::Billing::CreditCard.new(defaults)
14
+ end
15
+
16
+ def gateway(options = {})
17
+ ActiveMerchant::Billing::BpointGateway.new({ :login => GATEWAY_LOGIN, :password => GATEWAY_PASSWORD, :merchant_number => GATEWAY_MERCHANT_NUMBER }.merge(options))
18
+ end
19
+ end
@@ -0,0 +1,35 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/ProcessPayment
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '758'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:13 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ProcessPaymentResponse
33
+ xmlns="urn:Eve"><ProcessPaymentResult><ResponseCode>1</ResponseCode><AcquirerResponseCode>10</AcquirerResponseCode><AuthorisationResult>Declined</AuthorisationResult><TransactionNumber>68858229</TransactionNumber><ReceiptNumber>19386838229</ReceiptNumber><AuthoriseId
34
+ /><SettlementDate>20111214</SettlementDate><MaskedCardNumber>512345...346</MaskedCardNumber><CardType>MC</CardType></ProcessPaymentResult><response><ResponseCode>SUCCESS</ResponseCode></response></ProcessPaymentResponse></soap:Body></soap:Envelope>
35
+ http_version: '1.1'
@@ -0,0 +1,35 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/ProcessPayment
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '438'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:05 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ProcessPaymentResponse
33
+ xmlns="urn:Eve"><ProcessPaymentResult /><response><ResponseCode>ERROR</ResponseCode><ResponseMessage>invalid
34
+ login</ResponseMessage></response></ProcessPaymentResponse></soap:Body></soap:Envelope>
35
+ http_version: '1.1'
@@ -0,0 +1,35 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/ProcessPayment
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '454'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:21 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ProcessPaymentResponse
33
+ xmlns="urn:Eve"><ProcessPaymentResult /><response><ResponseCode>ERROR</ResponseCode><ResponseMessage>unable
34
+ to determine card type</ResponseMessage></response></ProcessPaymentResponse></soap:Body></soap:Envelope>
35
+ http_version: '1.1'
@@ -0,0 +1,35 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/AddToken
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '436'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:23 GMT
31
+ body: ! '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><AddTokenResponse
33
+ xmlns="urn:Eve"><AddTokenResult /><response><ResponseCode>ERROR</ResponseCode><ResponseMessage>invalid
34
+ card number: no value</ResponseMessage></response></AddTokenResponse></soap:Body></soap:Envelope>'
35
+ http_version: '1.1'
@@ -0,0 +1,34 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/AddToken
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '492'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:16 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><AddTokenResponse
33
+ xmlns="urn:Eve"><AddTokenResult><Token>5999991331436461</Token><MaskedCardNumber>512345...346</MaskedCardNumber><CardType>MC</CardType></AddTokenResult><response><ResponseCode>SUCCESS</ResponseCode></response></AddTokenResponse></soap:Body></soap:Envelope>
34
+ http_version: '1.1'
@@ -0,0 +1,35 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/DeleteToken
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '408'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:26 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><DeleteTokenResponse
33
+ xmlns="urn:Eve"><response><ResponseCode>ERROR</ResponseCode><ResponseMessage>invalid
34
+ token</ResponseMessage></response></DeleteTokenResponse></soap:Body></soap:Envelope>
35
+ http_version: '1.1'
@@ -0,0 +1,34 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/DeleteToken
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '362'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:24 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><DeleteTokenResponse
33
+ xmlns="urn:Eve"><response><ResponseCode>SUCCESS</ResponseCode></response></DeleteTokenResponse></soap:Body></soap:Envelope>
34
+ http_version: '1.1'
@@ -0,0 +1,34 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/ProcessPayment
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '782'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:09 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ProcessPaymentResponse
33
+ xmlns="urn:Eve"><ProcessPaymentResult><ResponseCode>0</ResponseCode><AcquirerResponseCode>00</AcquirerResponseCode><AuthorisationResult>Approved</AuthorisationResult><TransactionNumber>68858204</TransactionNumber><ReceiptNumber>19386838204</ReceiptNumber><AuthoriseId>141551075643</AuthoriseId><SettlementDate>20111214</SettlementDate><MaskedCardNumber>512345...346</MaskedCardNumber><CardType>MC</CardType></ProcessPaymentResult><response><ResponseCode>SUCCESS</ResponseCode></response></ProcessPaymentResponse></soap:Body></soap:Envelope>
34
+ http_version: '1.1'
@@ -0,0 +1,34 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://www.bpoint.com.au:443/evolve/service.asmx
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - text/xml;charset=UTF-8
10
+ soapaction:
11
+ - urn:Eve/ProcessPayment
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ cache-control:
18
+ - private, max-age=0
19
+ content-length:
20
+ - '782'
21
+ content-type:
22
+ - text/xml; charset=utf-8
23
+ x-powered-by:
24
+ - ASP.NET
25
+ x-aspnet-version:
26
+ - 2.0.50727
27
+ server:
28
+ - Apache2
29
+ date:
30
+ - Wed, 14 Dec 2011 04:51:19 GMT
31
+ body: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
32
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ProcessPaymentResponse
33
+ xmlns="urn:Eve"><ProcessPaymentResult><ResponseCode>0</ResponseCode><AcquirerResponseCode>00</AcquirerResponseCode><AuthorisationResult>Approved</AuthorisationResult><TransactionNumber>68858264</TransactionNumber><ReceiptNumber>19386838264</ReceiptNumber><AuthoriseId>141551176576</AuthoriseId><SettlementDate>20111214</SettlementDate><MaskedCardNumber>512345...346</MaskedCardNumber><CardType>MC</CardType></ProcessPaymentResult><response><ResponseCode>SUCCESS</ResponseCode></response></ProcessPaymentResponse></soap:Body></soap:Envelope>
34
+ http_version: '1.1'
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activemerchant-bpoint
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mario Visic
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70283272734580 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70283272734580
25
+ - !ruby/object:Gem::Dependency
26
+ name: vcr
27
+ requirement: &70283272734080 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70283272734080
36
+ - !ruby/object:Gem::Dependency
37
+ name: fakeweb
38
+ requirement: &70283272733560 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70283272733560
47
+ - !ruby/object:Gem::Dependency
48
+ name: activemerchant
49
+ requirement: &70283272732860 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.20.0
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70283272732860
58
+ description: An ActiveMerchant plugin that provides a full featured BPOINT gateway.
59
+ Development sponsored by Sentia Australia.
60
+ email:
61
+ - mario@mariovisic.com
62
+ executables: []
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - .gitignore
67
+ - .rvmrc
68
+ - Gemfile
69
+ - LICENSE
70
+ - Rakefile
71
+ - Readme.md
72
+ - activemerchant-bpoint.gemspec
73
+ - lib/activemerchant-bpoint.rb
74
+ - lib/activemerchant/billing/gateways/bpoint.rb
75
+ - lib/activemerchant/bpoint/version.rb
76
+ - spec/activemerchant/billing/gateways/bpoint_spec.rb
77
+ - spec/integration/bpoint_spec.rb
78
+ - spec/spec_helper.rb
79
+ - spec/support/gateway_helpers.rb
80
+ - spec/support/vcr_cassettes/invalid_CC_purchase.yml
81
+ - spec/support/vcr_cassettes/invalid_login.yml
82
+ - spec/support/vcr_cassettes/invalid_token_purchase.yml
83
+ - spec/support/vcr_cassettes/store_invalid_CC.yml
84
+ - spec/support/vcr_cassettes/store_valid_CC.yml
85
+ - spec/support/vcr_cassettes/unstore_invalid_token.yml
86
+ - spec/support/vcr_cassettes/unstore_valid_token.yml
87
+ - spec/support/vcr_cassettes/valid_CC_purchase.yml
88
+ - spec/support/vcr_cassettes/valid_token_purchase.yml
89
+ - spec/test_credentials.rb
90
+ homepage: ''
91
+ licenses: []
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project: activemerchant-bpoint
110
+ rubygems_version: 1.8.10
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: ActiveMerchant BPOINT Plugin
114
+ test_files:
115
+ - spec/activemerchant/billing/gateways/bpoint_spec.rb
116
+ - spec/integration/bpoint_spec.rb
117
+ - spec/spec_helper.rb
118
+ - spec/support/gateway_helpers.rb
119
+ - spec/support/vcr_cassettes/invalid_CC_purchase.yml
120
+ - spec/support/vcr_cassettes/invalid_login.yml
121
+ - spec/support/vcr_cassettes/invalid_token_purchase.yml
122
+ - spec/support/vcr_cassettes/store_invalid_CC.yml
123
+ - spec/support/vcr_cassettes/store_valid_CC.yml
124
+ - spec/support/vcr_cassettes/unstore_invalid_token.yml
125
+ - spec/support/vcr_cassettes/unstore_valid_token.yml
126
+ - spec/support/vcr_cassettes/valid_CC_purchase.yml
127
+ - spec/support/vcr_cassettes/valid_token_purchase.yml
128
+ - spec/test_credentials.rb