sisow 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,8 +1,7 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
4
3
  pkg/*
5
4
  spec/sisow.yml
6
5
  coverage/
7
6
  spec/vcr_cassettes
8
- .rvmrc
7
+ vendor
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.3-p194@sisow
data/Gemfile.lock ADDED
@@ -0,0 +1,46 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sisow (0.9.3)
5
+ hashie
6
+ httparty
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.1.3)
12
+ fakeweb (1.3.0)
13
+ hashie (1.2.0)
14
+ httparty (0.8.3)
15
+ multi_json (~> 1.0)
16
+ multi_xml
17
+ multi_json (1.3.5)
18
+ multi_xml (0.5.1)
19
+ rake (0.9.2.2)
20
+ rspec (2.10.0)
21
+ rspec-core (~> 2.10.0)
22
+ rspec-expectations (~> 2.10.0)
23
+ rspec-mocks (~> 2.10.0)
24
+ rspec-core (2.10.0)
25
+ rspec-expectations (2.10.0)
26
+ diff-lcs (~> 1.1.3)
27
+ rspec-mocks (2.10.1)
28
+ simplecov (0.6.4)
29
+ multi_json (~> 1.0)
30
+ simplecov-html (~> 0.5.3)
31
+ simplecov-html (0.5.3)
32
+ simplecov-rcov (0.2.3)
33
+ simplecov (>= 0.4.1)
34
+ vcr (2.1.1)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ fakeweb
41
+ rake
42
+ rspec
43
+ simplecov
44
+ simplecov-rcov
45
+ sisow!
46
+ vcr
data/README.rdoc CHANGED
@@ -1,7 +1,9 @@
1
1
  = Sisow
2
2
  {<img src="https://secure.travis-ci.org/marceldegraaf/sisow.png" />}[http://travis-ci.org/marceldegraaf/sisow]
3
3
 
4
- *NOTE* This gem is work in progress. I'm planning to have it ready somewhere in March.
4
+ *WARNING* There is an issue in the <tt>httparty</tt> gem that breaks the <tt>debug_mode</tt> of this Sisow gem. The only work-around at this time is to not enable <tt>debug_mode</tt>. I'll keep an eye on the <tt>httparty</tt> issue and update the Readme if anything changes. Sorry for the inconvenience.
5
+
6
+ -------
5
7
 
6
8
  This gem provides an interface to interact with the Sisow payment provider. Sisow offers payments through the iDeal (Dutch),
7
9
  Bancontact/Mister Cash (Belgian) and Sofort (German) online payment systems.
@@ -66,7 +68,8 @@ Setting up a payment looks like this:
66
68
  }
67
69
 
68
70
  payment = Sisow::IdealPayment.new(payment_attributes)
69
- redirect_url = payment.payment_url
71
+ redirect_url = payment.payment_url
72
+ transaction_id = payment.transaction_id # this value corresponds with Sisow's "trxid"
70
73
 
71
74
  === Supported payment methods
72
75
 
data/lib/sisow/payment.rb CHANGED
@@ -18,12 +18,13 @@ module Sisow
18
18
  end
19
19
 
20
20
  def payment_url
21
- request = Sisow::Api::TransactionRequest.new(self)
22
- response = request.perform
23
-
24
21
  CGI::unescape(response.issuerurl) if response.issuerurl?
25
22
  end
26
23
 
24
+ def transaction_id
25
+ response.trxid if response.trxid?
26
+ end
27
+
27
28
  def shop_id
28
29
  Sisow.configuration.shop_id
29
30
  end
@@ -36,5 +37,15 @@ module Sisow
36
37
 
37
38
  def payment_method; raise 'Implement me in a subclass'; end
38
39
 
40
+ private
41
+
42
+ def response
43
+ @raw_response ||= request.perform
44
+ end
45
+
46
+ def request
47
+ @request ||= Sisow::Api::TransactionRequest.new(self)
48
+ end
49
+
39
50
  end
40
51
  end
data/lib/sisow/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sisow
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
data/script/bundler ADDED
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "--- Making sure bundler is installed"
5
+
6
+ gem which bundler &> /dev/null || gem install bundler --no-ri --no-rdoc
7
+
8
+ echo "--- Installing gems"
9
+
10
+ bundle check --no-color || time bundle install --no-color
data/script/ci ADDED
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ export RAILS_ENV=test
3
+
4
+ run() {
5
+ time bundle exec $*
6
+ }
7
+
8
+ echo "--- Starting continuous integration build"
9
+
10
+ ./script/bundler
11
+
12
+ cp ./spec/sisow.yml.example ./spec/sisow.yml
13
+
14
+ run rspec
data/sisow.gemspec CHANGED
@@ -26,4 +26,5 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency 'vcr'
27
27
  s.add_development_dependency 'fakeweb'
28
28
  s.add_development_dependency 'simplecov'
29
+ s.add_development_dependency 'simplecov-rcov'
29
30
  end
@@ -26,4 +26,10 @@ describe Sisow::IdealPayment do
26
26
  end
27
27
  end
28
28
 
29
+ it "should contain a transaction ID from Sisow" do
30
+ VCR.use_cassette("ideal_payment") do
31
+ @payment.transaction_id.should =~ /TEST\d{12}/
32
+ end
33
+ end
34
+
29
35
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,14 @@
1
1
  require 'bundler/setup'
2
2
  require 'simplecov'
3
- SimpleCov.start
3
+ require 'simplecov-rcov'
4
+
5
+ SimpleCov.start do
6
+ add_filter 'vendor'
7
+ end
8
+
9
+ if ENV['BUILD_NUMBER'] && ENV['BUILD_ID']
10
+ SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
11
+ end
4
12
 
5
13
  require 'vcr_setup'
6
14
 
metadata CHANGED
@@ -1,97 +1,140 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sisow
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.4
4
5
  prerelease:
5
- version: 0.9.3
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Marcel de Graaf
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-03-16 00:00:00 +01:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-06-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: httparty
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: hashie
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
31
25
  none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: "0"
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: hashie
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
36
38
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: rspec
40
39
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
42
41
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0"
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
47
54
  type: :development
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: vcr
51
55
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: vcr
64
+ requirement: !ruby/object:Gem::Requirement
53
65
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
58
70
  type: :development
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: fakeweb
62
71
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: fakeweb
80
+ requirement: !ruby/object:Gem::Requirement
64
81
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: "0"
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
69
86
  type: :development
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
72
95
  name: simplecov
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
73
103
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: simplecov-rcov
112
+ requirement: !ruby/object:Gem::Requirement
75
113
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: "0"
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
80
118
  type: :development
81
- version_requirements: *id006
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
82
126
  description: This gem implements the REST API of the Sisow payment provider.
83
- email:
127
+ email:
84
128
  - mail@marceldegraaf.net
85
129
  executables: []
86
-
87
130
  extensions: []
88
-
89
131
  extra_rdoc_files: []
90
-
91
- files:
132
+ files:
92
133
  - .gitignore
134
+ - .rvmrc
93
135
  - .travis.yml
94
136
  - Gemfile
137
+ - Gemfile.lock
95
138
  - README.rdoc
96
139
  - Rakefile
97
140
  - lib/sisow.rb
@@ -112,6 +155,8 @@ files:
112
155
  - lib/sisow/payment/sofort_payment.rb
113
156
  - lib/sisow/ping.rb
114
157
  - lib/sisow/version.rb
158
+ - script/bundler
159
+ - script/ci
115
160
  - sisow.gemspec
116
161
  - spec/models/bancontact_payment_spec.rb
117
162
  - spec/models/callback_spec.rb
@@ -129,35 +174,31 @@ files:
129
174
  - spec/sisow.yml.example
130
175
  - spec/spec_helper.rb
131
176
  - spec/vcr_setup.rb
132
- has_rdoc: true
133
177
  homepage: http://github.com/marceldegraaf/sisow
134
178
  licenses: []
135
-
136
179
  post_install_message:
137
180
  rdoc_options: []
138
-
139
- require_paths:
181
+ require_paths:
140
182
  - lib
141
- required_ruby_version: !ruby/object:Gem::Requirement
183
+ required_ruby_version: !ruby/object:Gem::Requirement
142
184
  none: false
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: "0"
147
- required_rubygems_version: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
190
  none: false
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: "0"
191
+ requirements:
192
+ - - ! '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
153
195
  requirements: []
154
-
155
196
  rubyforge_project: sisow
156
- rubygems_version: 1.5.0
197
+ rubygems_version: 1.8.24
157
198
  signing_key:
158
199
  specification_version: 3
159
200
  summary: Rails gem for payments through Sisow.
160
- test_files:
201
+ test_files:
161
202
  - spec/models/bancontact_payment_spec.rb
162
203
  - spec/models/callback_spec.rb
163
204
  - spec/models/configuration_spec.rb