ipizza 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
data/ipizza.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ipizza}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Priit Haamer"]
12
- s.date = %q{2010-12-04}
12
+ s.date = %q{2010-12-05}
13
13
  s.description = %q{ Simplifies generating payment requests and parsing responses from banks when using iPizza protocol.
14
14
  }
15
15
  s.email = %q{priit@fraktal.ee}
@@ -20,8 +20,12 @@ module Ipizza::Provider
20
20
  @valid
21
21
  end
22
22
 
23
- def user_info
24
- valid? ? {'name' => @params['B02K_CUSTNAME'], 'custid' => @params['B02K_CUSTID']} : {}
23
+ def info_name
24
+ valid? ? @params['B02K_CUSTNAME'] : ''
25
+ end
26
+
27
+ def info_social_security_id
28
+ valid? ? @params['B02K_CUSTID'] : ''
25
29
  end
26
30
 
27
31
  private
@@ -7,35 +7,27 @@ describe Ipizza::Provider::Nordea::AuthenticationResponse do
7
7
  "B02K_STAMP" => "20101204155339", "B02K_KEYVERS" => "0001", "B02K_MAC" => "A061E22312D7D63FDC2B0B52E16BC971",
8
8
  "B02K_CUSTTYPE" => "01", "B02K_ALG" => "01", "B02K_CUSTID" => "37404280367", "B02K_VERS" => "0002"
9
9
  }
10
+ @response = Ipizza::Provider::Nordea::AuthenticationResponse.new(@valid_params)
11
+ @response.verify(Ipizza::Provider::Nordea.file_key)
10
12
  end
11
13
 
12
14
  describe '#valid?' do
13
15
  context 'given valid parameters' do
14
16
  it 'returns true' do
15
- @response = Ipizza::Provider::Nordea::AuthenticationResponse.new(@valid_params)
16
- @response.verify(Ipizza::Provider::Nordea.file_key)
17
17
  @response.valid?.should be_true
18
18
  end
19
19
  end
20
20
  end
21
21
 
22
- describe '#user_info' do
23
- before(:each) do
24
- @response = Ipizza::Provider::Nordea::AuthenticationResponse.new(@valid_params)
22
+ describe '#info_social_security_id' do
23
+ it 'should get user social security id from the response' do
24
+ @response.info_social_security_id.should == '37404280367'
25
25
  end
26
-
27
- context 'given valid parameters' do
28
- before(:each) do
29
- @response.verify(Ipizza::Provider::Nordea.file_key)
30
- end
31
-
32
- it 'returns hash containing user name' do
33
- @response.user_info.fetch('name').should == 'Demo kasutaja'
34
- end
35
-
36
- it 'returns hash containing user id' do
37
- @response.user_info.fetch('custid').should == '37404280367'
38
- end
26
+ end
27
+
28
+ describe '#info_name' do
29
+ it 'should get user name from the response' do
30
+ @response.info_name.should == 'Demo kasutaja'
39
31
  end
40
32
  end
41
33
  end
@@ -7,7 +7,7 @@ describe Ipizza::Provider::Nordea do
7
7
  end
8
8
 
9
9
  it 'returns signed authentication request object' do
10
- @req.params.fetch('A01Y_MAC').should be
10
+ @req.request_params.fetch('A01Y_MAC').should be
11
11
  end
12
12
 
13
13
  it 'adds service url to request' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipizza
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Priit Haamer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-04 00:00:00 +02:00
18
+ date: 2010-12-05 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21