cielox 0.0.2a → 0.0.3a

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ module Cielo
2
+ class Authentication
3
+ include HappyMapper
4
+
5
+ tag "autenticacao"
6
+ element :code, Integer, :tag => "codigo"
7
+ element :message, String, :tag => "mensagem"
8
+ element :time, Time, :tag => "data-hora"
9
+ element :total, Integer, :tag => "valor"
10
+ element :eci, Integer
11
+ end
12
+ end
@@ -8,6 +8,7 @@ module Cielo
8
8
  element :status, Integer
9
9
  element :authentication_url, String, :tag => "url-autenticacao"
10
10
 
11
+ has_one :authentication, Authentication
11
12
  has_one :authorization, Authorization
12
13
  has_one :capture, Capture
13
14
  has_one :cancelation, Cancelation
data/lib/cielo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cielo
2
- VERSION = "0.0.2a"
2
+ VERSION = "0.0.3a"
3
3
  end
data/lib/cielo.rb CHANGED
@@ -14,6 +14,8 @@ module Cielo
14
14
  autoload :TransactionRequest, "cielo/transaction_request"
15
15
  autoload :Transaction, "cielo/transaction"
16
16
 
17
+ autoload :Authentication, "cielo/authentication"
18
+
17
19
  autoload :AuthorizationRequest, "cielo/authorization_request"
18
20
  autoload :Authorization, "cielo/authorization"
19
21
 
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ describe Cielo::Authentication do
4
+ let(:xml) { '<autenticacao><codigo>5</codigo><mensagem>Transacao sem autenticacao</mensagem><data-hora>2012-05-23T12:20:26.831-03:00</data-hora><valor>2390</valor><eci>1</eci></autenticacao>' }
5
+ subject { described_class.parse(xml, :single => true) }
6
+ its(:code) { should == 5 }
7
+ its(:message) { should == "Transacao sem autenticacao" }
8
+ its(:time) { should == Time.parse("2012-05-23T12:20:26.831-03:00") }
9
+ its(:total) { should == 2390 }
10
+ its(:eci) { should == 1 }
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cielox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2a
4
+ version: 0.0.3a
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: happymapper
16
- requirement: &70150121511440 !ruby/object:Gem::Requirement
16
+ requirement: &70199035986920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70150121511440
24
+ version_requirements: *70199035986920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70150121510940 !ruby/object:Gem::Requirement
27
+ requirement: &70199035986300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.9.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70150121510940
35
+ version_requirements: *70199035986300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: timecop
38
- requirement: &70150121510480 !ruby/object:Gem::Requirement
38
+ requirement: &70199035985720 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.3.5
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70150121510480
46
+ version_requirements: *70199035985720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: webmock
49
- requirement: &70150121510020 !ruby/object:Gem::Requirement
49
+ requirement: &70199035985260 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 1.8.6
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70150121510020
57
+ version_requirements: *70199035985260
58
58
  description: Gem for integration with Cielo
59
59
  email:
60
60
  - me@rafaelss.com
@@ -71,6 +71,7 @@ files:
71
71
  - Rakefile
72
72
  - cielox.gemspec
73
73
  - lib/cielo.rb
74
+ - lib/cielo/authentication.rb
74
75
  - lib/cielo/authorization.rb
75
76
  - lib/cielo/authorization_request.rb
76
77
  - lib/cielo/cancelation.rb
@@ -90,6 +91,7 @@ files:
90
91
  - lib/cielo/transaction_request.rb
91
92
  - lib/cielo/version.rb
92
93
  - lib/cielox.rb
94
+ - spec/cielo/authentication_spec.rb
93
95
  - spec/cielo/authorization_request_spec.rb
94
96
  - spec/cielo/cancelation_request_spec.rb
95
97
  - spec/cielo/capture_request_spec.rb
@@ -147,6 +149,7 @@ signing_key:
147
149
  specification_version: 3
148
150
  summary: Gem for integration with Cielo
149
151
  test_files:
152
+ - spec/cielo/authentication_spec.rb
150
153
  - spec/cielo/authorization_request_spec.rb
151
154
  - spec/cielo/cancelation_request_spec.rb
152
155
  - spec/cielo/capture_request_spec.rb