pagseguro-transparente 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/pagseguro/transaction.rb +2 -2
- data/lib/pagseguro/version.rb +1 -1
- data/spec/pagseguro/notification_spec.rb +4 -4
- data/spec/pagseguro/transaction_spec.rb +28 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab229b6f3625d815fcacfabd2141da3a26c5cb40
|
4
|
+
data.tar.gz: 8625ca7d6d42ca4b921de0296d9dbe78d76952ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3599ad6440a6c63bd9c9d7ec5d82ca2aec3cca74645d5a6a470a6eab3ac7ffabb46dde4f390c461419e60cc03c29f12d9b97d29fbbadcd34fe285df07f312289
|
7
|
+
data.tar.gz: 049105aa8cc58c8a7e09ad48c679b0dbdcef4b0d3cbe1263b37ae04a11a37f0e92cdf11bbb5a6015c6ccb300647caa2bbfabf1d88b7d54731420bf87beb7bff8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pagseguro-transparente (0.0.
|
4
|
+
pagseguro-transparente (0.0.3)
|
5
5
|
activemodel
|
6
6
|
httparty
|
7
7
|
json
|
@@ -38,12 +38,12 @@ GEM
|
|
38
38
|
i18n (0.6.9)
|
39
39
|
json (1.8.1)
|
40
40
|
mime-types (2.2)
|
41
|
-
mini_portile (0.
|
41
|
+
mini_portile (0.6.0)
|
42
42
|
minitest (5.3.3)
|
43
43
|
multi_json (1.10.0)
|
44
44
|
multi_xml (0.5.5)
|
45
|
-
nokogiri (1.6.1)
|
46
|
-
mini_portile (
|
45
|
+
nokogiri (1.6.2.1)
|
46
|
+
mini_portile (= 0.6.0)
|
47
47
|
rake (10.3.1)
|
48
48
|
rest-client (1.6.7)
|
49
49
|
mime-types (>= 1.16)
|
data/lib/pagseguro/version.rb
CHANGED
@@ -18,8 +18,8 @@ describe PagSeguro::Notification do
|
|
18
18
|
context "with default credencials" do
|
19
19
|
subject { notification.transaction }
|
20
20
|
before do
|
21
|
-
stub_request(:get, "https://ws.pagseguro.uol.com.br/v2/transactions/notifications/766B9C-AD4B044B04DA-77742F5FA653-E1AB24").
|
22
|
-
|
21
|
+
stub_request(:get, "https://ws.pagseguro.uol.com.br/v2/transactions/notifications/766B9C-AD4B044B04DA-77742F5FA653-E1AB24?email=mail&token=token").
|
22
|
+
to_return(:status => 200, :body => "", :headers => {})
|
23
23
|
end
|
24
24
|
|
25
25
|
it { should be_a_kind_of(PagSeguro::Transaction) }
|
@@ -31,8 +31,8 @@ describe PagSeguro::Notification do
|
|
31
31
|
let(:notification) { PagSeguro::Notification.new(code, type, 'custom_email', 'custom_token') }
|
32
32
|
|
33
33
|
before do
|
34
|
-
stub_request(:get, "https://ws.pagseguro.uol.com.br/v2/transactions/notifications/766B9C-AD4B044B04DA-77742F5FA653-E1AB24").
|
35
|
-
|
34
|
+
stub_request(:get, "https://ws.pagseguro.uol.com.br/v2/transactions/notifications/766B9C-AD4B044B04DA-77742F5FA653-E1AB24?email=custom_email&token=custom_token").
|
35
|
+
to_return(:status => 200, :body => "", :headers => {})
|
36
36
|
end
|
37
37
|
|
38
38
|
it { should be_a_kind_of(PagSeguro::Transaction) }
|
@@ -55,16 +55,34 @@ describe PagSeguro::Transaction do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
context "unsuccessfull transaction" do
|
58
|
-
|
59
|
-
|
60
|
-
<
|
61
|
-
<
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
58
|
+
context "one error only" do
|
59
|
+
let(:xml_file) {
|
60
|
+
"<errors>
|
61
|
+
<error>
|
62
|
+
<code>53044</code>
|
63
|
+
<message>credit card holder name invalid value: Flora</message>
|
64
|
+
</error>
|
65
|
+
</errors>"
|
66
|
+
}
|
67
|
+
|
68
|
+
it { should_not be_valid}
|
69
|
+
its(:errors) { should eq( [ { "code" => "53044", "message" => "credit card holder name invalid value: Flora"} ]) }
|
70
|
+
end
|
71
|
+
|
72
|
+
context "various errors" do
|
73
|
+
let(:xml_file) {
|
74
|
+
"<errors>
|
75
|
+
<error>
|
76
|
+
<code>53017</code><message>sender cpf invalid value: 01391039130</message>
|
77
|
+
</error>
|
78
|
+
<error>
|
79
|
+
<code>53015</code><message>sender name invalid value: Flora</message>
|
80
|
+
</error>
|
81
|
+
</errors>"
|
82
|
+
}
|
66
83
|
|
67
|
-
|
68
|
-
|
84
|
+
it { should_not be_valid}
|
85
|
+
its(:errors) { should eq( [ { "code" => "53017", "message" => "sender cpf invalid value: 01391039130"}, { "code" => "53015", "message" => "sender name invalid value: Flora"} ]) }
|
86
|
+
end
|
69
87
|
end
|
70
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagseguro-transparente
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cirdes Henrique
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|