activepayment 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/activepayment/payone/gateway.rb +1 -0
- data/lib/activepayment/version.rb +1 -1
- data/spec/functional/payone/config.yml +3 -0
- data/spec/functional/{payone_spec.rb → payone/payone_spec.rb} +2 -10
- data/spec/functional/wirecard/config.yml +5 -0
- data/spec/functional/{wirecard_spec.rb → wirecard/wirecard_spec.rb} +2 -9
- data/spec/spec_helper.rb +12 -0
- data/spec/unit/payone/gateway_spec.rb +8 -0
- metadata +6 -4
@@ -29,6 +29,7 @@ module ActivePayment
|
|
29
29
|
define_request :createaccess, :obligation_params => [:aid, :reference]
|
30
30
|
define_request :updateuser, :obligation_params => [:userid]
|
31
31
|
define_request :updateaccess, :obligation_params => [:accessid, :action]
|
32
|
+
define_request :updatereminder, :obligation_params => [:txid]
|
32
33
|
define_request :threedscheck, :request_method => '3dscheck', :obligation_params => [:aid], :default => {:currency => self.default_currency}
|
33
34
|
|
34
35
|
private
|
@@ -30,11 +30,7 @@ describe ActivePayment::Payone::Gateway do
|
|
30
30
|
let(:payone_access_id) { payone_response.accessid }
|
31
31
|
|
32
32
|
before(:all) do
|
33
|
-
ActivePayment::Payone::Gateway.
|
34
|
-
ActivePayment::Payone::Gateway.portalid = 2226
|
35
|
-
ActivePayment::Payone::Gateway.key = 'test'
|
36
|
-
ActivePayment::Payone::Gateway.mode = 'test'
|
37
|
-
ActivePayment::Payone::Gateway.default_currency = 'EUR'
|
33
|
+
ActivePayment::Payone::Gateway.config = load_config('payone', 'zugang')
|
38
34
|
end
|
39
35
|
|
40
36
|
it "should post createaccess request" do
|
@@ -58,11 +54,7 @@ describe ActivePayment::Payone::Gateway do
|
|
58
54
|
|
59
55
|
describe "Portal Shop" do
|
60
56
|
before(:all) do
|
61
|
-
ActivePayment::Payone::Gateway.
|
62
|
-
ActivePayment::Payone::Gateway.portalid = 2013125
|
63
|
-
ActivePayment::Payone::Gateway.key = 'test'
|
64
|
-
ActivePayment::Payone::Gateway.mode = 'test'
|
65
|
-
ActivePayment::Payone::Gateway.default_currency = 'EUR'
|
57
|
+
ActivePayment::Payone::Gateway.config = load_config('payone', 'shop')
|
66
58
|
end
|
67
59
|
|
68
60
|
it "should post authorization request" do
|
@@ -8,11 +8,7 @@ describe ActivePayment::Wirecard::Gateway do
|
|
8
8
|
describe "post request" do
|
9
9
|
|
10
10
|
before(:all) do
|
11
|
-
ActivePayment::Wirecard::Gateway.
|
12
|
-
ActivePayment::Wirecard::Gateway.password = "TestXAPTER"
|
13
|
-
ActivePayment::Wirecard::Gateway.signature = "56501"
|
14
|
-
ActivePayment::Wirecard::Gateway.mode = "demo"
|
15
|
-
ActivePayment::Wirecard::Gateway.default_currency = 'EUR'
|
11
|
+
ActivePayment::Wirecard::Gateway.config = load_config('wirecard', 'without_3d_secure')
|
16
12
|
|
17
13
|
gateway.jop_id = 'test dummy data'
|
18
14
|
gateway.transaction_params = {
|
@@ -90,10 +86,7 @@ describe ActivePayment::Wirecard::Gateway do
|
|
90
86
|
describe "3D secure" do
|
91
87
|
|
92
88
|
before(:all) do
|
93
|
-
ActivePayment::Wirecard::Gateway.
|
94
|
-
ActivePayment::Wirecard::Gateway.password = 'TestXAPTER'
|
95
|
-
ActivePayment::Wirecard::Gateway.signature = '000000315DE0A429'
|
96
|
-
ActivePayment::Wirecard::Gateway.mode = ''
|
89
|
+
ActivePayment::Wirecard::Gateway.config = load_config('wirecard', 'with_3d_secure')
|
97
90
|
|
98
91
|
gateway.jop_id = 'test dummy data'
|
99
92
|
gateway.transaction_params = {
|
data/spec/spec_helper.rb
CHANGED
@@ -19,4 +19,16 @@ def credit_card_hash(number = '4200000000000000', options = {})
|
|
19
19
|
:expiration_month => '01',
|
20
20
|
:card_holder_name => Forgery::Name.full_name
|
21
21
|
}.update(options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def load_config(path, type = nil)
|
25
|
+
config = YAML::load(File.open(File.join(File.dirname(__FILE__), 'functional', path, "config.yml")).read)
|
26
|
+
unless type.blank?
|
27
|
+
if !config.blank? && !config[type].blank?
|
28
|
+
return config[type]
|
29
|
+
end
|
30
|
+
else
|
31
|
+
return config unless config.blank?
|
32
|
+
end
|
33
|
+
raise "Please set your own #{path} account data"
|
22
34
|
end
|
@@ -78,6 +78,14 @@ describe ActivePayment::Payone::Gateway do
|
|
78
78
|
request.should include('cardtype=V')
|
79
79
|
end
|
80
80
|
|
81
|
+
it "should build updatereminder request" do
|
82
|
+
request = gateway.updatereminder_request(:txid => 123, :reminderlevel => 2)
|
83
|
+
|
84
|
+
request.should_not be_blank
|
85
|
+
request.should include('txid=123')
|
86
|
+
request.should include('reminderlevel=2')
|
87
|
+
end
|
88
|
+
|
81
89
|
it "should get exception if forget mandatory parameter" do
|
82
90
|
gateway.transaction_params.delete(:reference)
|
83
91
|
lambda { gateway.createaccess_request }.should raise_exception(ActivePayment::Exception, "Payone API Parameters not complete: reference not exists")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activepayment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-10-10 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: ActivePayment is an abstraction layer for different Payment-Interfaces
|
15
15
|
(XML, JSON)
|
@@ -45,8 +45,10 @@ files:
|
|
45
45
|
- spec/fixtures/wirecard/gateway/purchase_request_with_3d.xml
|
46
46
|
- spec/fixtures/wirecard/gateway/successful_authorization_response.xml
|
47
47
|
- spec/fixtures/wirecard/gateway/successful_capture_response.xml
|
48
|
-
- spec/functional/
|
49
|
-
- spec/functional/
|
48
|
+
- spec/functional/payone/config.yml
|
49
|
+
- spec/functional/payone/payone_spec.rb
|
50
|
+
- spec/functional/wirecard/config.yml
|
51
|
+
- spec/functional/wirecard/wirecard_spec.rb
|
50
52
|
- spec/spec_helper.rb
|
51
53
|
- spec/unit/gateway_base_spec.rb
|
52
54
|
- spec/unit/payone/gateway_spec.rb
|