rbraspag 0.0.18 → 0.0.19
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/Gemfile.lock +5 -5
- data/config/braspag.yml +7 -2
- data/lib/generators/braspag/install/install_generator.rb +1 -1
- data/lib/generators/braspag/install/templates/config/braspag.yml +3 -3
- data/lib/rbraspag/bill.rb +4 -7
- data/lib/rbraspag/connection.rb +26 -11
- data/lib/rbraspag/credit_card.rb +1 -1
- data/lib/rbraspag/order.rb +1 -1
- data/lib/rbraspag/version.rb +1 -1
- data/spec/bill_spec.rb +4 -3
- data/spec/connection_spec.rb +109 -83
- data/spec/credit_card_spec.rb +3 -2
- data/spec/order_spec.rb +3 -2
- metadata +24 -25
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rbraspag (0.0.
|
4
|
+
rbraspag (0.0.18)
|
5
5
|
cs-httpi (>= 0.9.5.2)
|
6
|
-
json
|
7
|
-
nokogiri
|
6
|
+
json (>= 1.6.1)
|
7
|
+
nokogiri (>= 1.5.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
@@ -22,11 +22,11 @@ GEM
|
|
22
22
|
guard (>= 0.2.2)
|
23
23
|
guard-rspec (0.4.0)
|
24
24
|
guard (>= 0.4.0)
|
25
|
-
json (1.
|
25
|
+
json (1.6.4)
|
26
26
|
linecache19 (0.5.12)
|
27
27
|
ruby_core_source (>= 0.1.4)
|
28
28
|
nokogiri (1.5.0)
|
29
|
-
rack (1.
|
29
|
+
rack (1.4.0)
|
30
30
|
rake (0.9.2)
|
31
31
|
rspec (2.6.0)
|
32
32
|
rspec-core (~> 2.6.0)
|
data/config/braspag.yml
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
development:
|
2
|
+
environment: "homologation"
|
2
3
|
merchant_id: "{84BE7E7F-698A-6C74-F820-AE359C2A07C2}"
|
3
|
-
braspag_url: "https://homologacao.pagador.com.br"
|
4
4
|
crypto_url: "http://localhost:9292"
|
5
5
|
crypto_key: "1234561246"
|
6
6
|
|
7
7
|
test:
|
8
|
+
environment: "homologation"
|
8
9
|
merchant_id: "{84BE7E7F-698A-6C74-F820-AE359C2A07C2}"
|
9
|
-
braspag_url: "https://homologacao.pagador.com.br"
|
10
10
|
crypto_url: "http://localhost:9292"
|
11
11
|
crypto_key: "1234561246"
|
12
12
|
|
13
|
+
production:
|
14
|
+
environment: "production"
|
15
|
+
merchant_id: "{84BE7E7F-698A-6C74-F820-AE359C2A07C2}"
|
16
|
+
crypto_url: "http://localhost:9292"
|
17
|
+
crypto_key: "1234561246"
|
@@ -1,17 +1,17 @@
|
|
1
1
|
development:
|
2
|
+
environment: "homologation"
|
2
3
|
merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
|
3
|
-
braspag_url: "https://homologacao.pagador.com.br"
|
4
4
|
crypto_url: "http://localhost:9292"
|
5
5
|
crypto_key: "1234561246"
|
6
6
|
|
7
7
|
test:
|
8
|
+
environment: "homologation"
|
8
9
|
merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
|
9
|
-
braspag_url: "https://homologacao.pagador.com.br"
|
10
10
|
crypto_url: "http://localhost:9292"
|
11
11
|
crypto_key: "1234561246"
|
12
12
|
|
13
13
|
production:
|
14
|
+
environment: "production"
|
14
15
|
merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
|
15
|
-
braspag_url: "https://www.pagador.com.br"
|
16
16
|
crypto_url: "http://localhost:9292"
|
17
17
|
crypto_key: "1234561246"
|
data/lib/rbraspag/bill.rb
CHANGED
@@ -2,7 +2,7 @@ require "bigdecimal"
|
|
2
2
|
|
3
3
|
module Braspag
|
4
4
|
class Bill < PaymentMethod
|
5
|
-
|
5
|
+
|
6
6
|
PAYMENT_METHODS = {
|
7
7
|
:bradesco => "06",
|
8
8
|
:cef => "07",
|
@@ -27,7 +27,7 @@ module Braspag
|
|
27
27
|
:emails => "emails"
|
28
28
|
}
|
29
29
|
|
30
|
-
|
30
|
+
# (my face when I saw this method ---------> D:)
|
31
31
|
def self.generate(params)
|
32
32
|
connection = Braspag::Connection.instance
|
33
33
|
params = params
|
@@ -71,7 +71,6 @@ module Braspag
|
|
71
71
|
raise InvalidPaymentMethod
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
74
|
data = MAPPING.inject({}) do |memo, k|
|
76
75
|
if k[0] == :payment_method
|
77
76
|
memo[k[1]] = PAYMENT_METHODS[params[:payment_method]]
|
@@ -117,14 +116,13 @@ module Braspag
|
|
117
116
|
response
|
118
117
|
end
|
119
118
|
|
120
|
-
|
121
119
|
def self.info(order_id)
|
122
120
|
connection = Braspag::Connection.instance
|
123
121
|
|
124
122
|
raise InvalidOrderId unless order_id.is_a?(String) || order_id.is_a?(Fixnum)
|
125
123
|
raise InvalidOrderId unless (1..50).include?(order_id.to_s.size)
|
126
124
|
|
127
|
-
request = ::HTTPI::Request.new("#{connection.
|
125
|
+
request = ::HTTPI::Request.new("#{connection.braspag_query_url}/GetDadosBoleto")
|
128
126
|
request.body = {:loja => connection.merchant_id, :numeroPedido => order_id.to_s}
|
129
127
|
|
130
128
|
response = ::HTTPI.post(request)
|
@@ -148,11 +146,10 @@ module Braspag
|
|
148
146
|
|
149
147
|
raise UnknownError if response[:document_number].nil?
|
150
148
|
response
|
151
|
-
|
152
149
|
end
|
153
150
|
|
154
151
|
protected
|
155
|
-
|
152
|
+
|
156
153
|
def self.uri
|
157
154
|
connection = Braspag::Connection.instance
|
158
155
|
"#{connection.braspag_url}/webservices/pagador/Boleto.asmx/CreateBoleto"
|
data/lib/rbraspag/connection.rb
CHANGED
@@ -1,27 +1,42 @@
|
|
1
1
|
module Braspag
|
2
2
|
class Connection
|
3
3
|
include Singleton
|
4
|
+
|
4
5
|
class InvalidMerchantId < Exception ; end
|
5
6
|
class InvalidEnv < Exception ; end
|
6
7
|
class InvalidBraspagUrl < Exception ; end
|
7
8
|
|
8
|
-
|
9
|
+
PRODUCTION_URL = "https://transaction.pagador.com.br"
|
10
|
+
HOMOLOGATION_URL = "https://homologacao.pagador.com.br"
|
11
|
+
|
12
|
+
PRODUCTION_QUERY_URL = "https://query.pagador.com.br/webservices/pagador/pedido.asmx"
|
13
|
+
HOMOLOGATION_QUERY_URL = "https://homologacao.pagador.com.br/pagador/webservice/pedido.asmx"
|
14
|
+
|
15
|
+
attr_reader :braspag_url, :braspag_query_url, :merchant_id, :crypto_url, :crypto_key, :options, :environment
|
9
16
|
|
10
17
|
def initialize
|
11
18
|
raise InvalidEnv if ENV["RACK_ENV"].nil? || ENV["RACK_ENV"].empty?
|
12
|
-
options = YAML.load_file("config/braspag.yml")
|
13
|
-
options = options[ENV["RACK_ENV"]]
|
14
19
|
|
15
|
-
|
20
|
+
@options = YAML.load_file('config/braspag.yml')[ ENV['RACK_ENV'] ]
|
21
|
+
@merchant_id = @options['merchant_id']
|
22
|
+
|
23
|
+
raise InvalidMerchantId unless @merchant_id =~ /\{[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}\}/i
|
24
|
+
|
25
|
+
@crypto_key = @options["crypto_key"]
|
26
|
+
@crypto_url = @options["crypto_url"]
|
16
27
|
|
17
|
-
|
18
|
-
|
19
|
-
|
28
|
+
@environment = @options["environment"] == 'production' ? 'production' : 'homologation'
|
29
|
+
|
30
|
+
@braspag_url = self.production? ? PRODUCTION_URL : HOMOLOGATION_URL
|
31
|
+
@braspag_query_url = self.production? ? PRODUCTION_QUERY_URL : HOMOLOGATION_QUERY_URL
|
32
|
+
end
|
33
|
+
|
34
|
+
def production?
|
35
|
+
@environment == 'production'
|
36
|
+
end
|
20
37
|
|
21
|
-
|
22
|
-
@
|
23
|
-
@braspag_url = options["braspag_url"]
|
24
|
-
@merchant_id = merchant_id
|
38
|
+
def homologation?
|
39
|
+
@environment == 'homologation'
|
25
40
|
end
|
26
41
|
end
|
27
42
|
end
|
data/lib/rbraspag/credit_card.rb
CHANGED
@@ -123,7 +123,7 @@ module Braspag
|
|
123
123
|
raise InvalidOrderId unless order_id.is_a?(String) || order_id.is_a?(Fixnum)
|
124
124
|
raise InvalidOrderId unless (1..50).include?(order_id.to_s.size)
|
125
125
|
|
126
|
-
request = ::HTTPI::Request.new("#{connection.
|
126
|
+
request = ::HTTPI::Request.new("#{connection.braspag_query_url}/GetDadosCartao")
|
127
127
|
request.body = {:loja => connection.merchant_id, :numeroPedido => order_id.to_s}
|
128
128
|
|
129
129
|
response = ::HTTPI.post(request)
|
data/lib/rbraspag/order.rb
CHANGED
@@ -8,7 +8,7 @@ module Braspag
|
|
8
8
|
raise InvalidOrderId unless order_id.is_a?(String) || order_id.is_a?(Fixnum)
|
9
9
|
raise InvalidOrderId unless (1..50).include?(order_id.to_s.size)
|
10
10
|
|
11
|
-
request = ::HTTPI::Request.new("#{connection.
|
11
|
+
request = ::HTTPI::Request.new("#{connection.braspag_query_url}/GetDadosPedido")
|
12
12
|
request.body = {:loja => connection.merchant_id, :numeroPedido => order_id.to_s}
|
13
13
|
|
14
14
|
response = ::HTTPI.post(request)
|
data/lib/rbraspag/version.rb
CHANGED
data/spec/bill_spec.rb
CHANGED
@@ -3,7 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
|
4
4
|
describe Braspag::Bill do
|
5
5
|
let!(:braspag_url) { "https://homologacao.pagador.com.br" }
|
6
|
-
|
6
|
+
let!(:braspag_query_url) { "https://homologacao.pagador.com.br/pagador/webservice/pedido.asmx" }
|
7
|
+
|
7
8
|
describe ".generate" do
|
8
9
|
context "consitencies" do
|
9
10
|
before do
|
@@ -496,7 +497,7 @@ describe Braspag::Bill do
|
|
496
497
|
xmlns="http://www.pagador.com.br/" />
|
497
498
|
EOXML
|
498
499
|
|
499
|
-
FakeWeb.register_uri(:post, "#{
|
500
|
+
FakeWeb.register_uri(:post, "#{braspag_query_url}/GetDadosBoleto",
|
500
501
|
:body => xml)
|
501
502
|
|
502
503
|
expect {
|
@@ -534,7 +535,7 @@ describe Braspag::Bill do
|
|
534
535
|
</DadosBoleto>
|
535
536
|
EOXML
|
536
537
|
|
537
|
-
FakeWeb.register_uri(:post, "#{
|
538
|
+
FakeWeb.register_uri(:post, "#{braspag_query_url}/GetDadosBoleto",
|
538
539
|
:body => xml)
|
539
540
|
status = Braspag::Bill.info("12345")
|
540
541
|
FakeWeb.clean_registry
|
data/spec/connection_spec.rb
CHANGED
@@ -1,129 +1,155 @@
|
|
1
|
-
#encoding: utf-8
|
1
|
+
# encoding: utf-8
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
3
|
|
4
4
|
describe Braspag::Connection do
|
5
|
-
let
|
6
|
-
let
|
7
|
-
let
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
let(:merchant_id) { "{12345678-1234-1234-1234-123456789000}" }
|
6
|
+
let(:crypto_key) { "{84BE7E7F-698A-6C74-F820-AE359C2A07C2}" }
|
7
|
+
let(:crypto_url) { "http://localhost:9292" }
|
8
|
+
|
9
|
+
let(:braspag_environment) { "homologation" }
|
10
|
+
|
11
|
+
let(:braspag_homologation_url) { "https://homologacao.pagador.com.br" }
|
12
|
+
let(:braspag_production_url) { "https://transaction.pagador.com.br" }
|
13
|
+
|
14
|
+
let(:braspag_homologation_query_url) { "https://homologacao.pagador.com.br/pagador/webservice/pedido.asmx" }
|
15
|
+
let(:braspag_production_query_url) { "https://query.pagador.com.br/webservices/pagador/pedido.asmx" }
|
16
|
+
|
17
|
+
let(:braspag_config) do
|
18
|
+
config = {}
|
19
|
+
config[ENV["RACK_ENV"]] = {
|
20
|
+
"environment" => braspag_environment,
|
13
21
|
"merchant_id" => merchant_id,
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"crypto_url" => crypto_url
|
22
|
+
"crypto_key" => crypto_key,
|
23
|
+
"crypto_url" => crypto_url
|
17
24
|
}
|
18
|
-
|
19
|
-
|
25
|
+
config
|
26
|
+
end
|
20
27
|
|
21
28
|
before(:all) do
|
22
29
|
@connection = Braspag::Connection.clone
|
23
30
|
end
|
24
31
|
|
25
32
|
it "should read config/braspag.yml when alloc first instance" do
|
26
|
-
YAML.should_receive(:load_file)
|
33
|
+
YAML.should_receive(:load_file)
|
34
|
+
.with("config/braspag.yml")
|
35
|
+
.and_return(braspag_config)
|
27
36
|
@connection.instance
|
28
37
|
end
|
29
38
|
|
30
|
-
it "should not read config/braspag.yml when alloc second instance" do
|
39
|
+
it "should not read config/braspag.yml when alloc a second instance" do
|
31
40
|
YAML.should_not_receive(:load_file)
|
32
41
|
@connection.instance
|
33
42
|
end
|
34
43
|
|
35
|
-
it "should generate exception when RACK_ENV is nil" do
|
36
|
-
|
37
|
-
|
44
|
+
it "should generate an exception when RACK_ENV is nil" do
|
45
|
+
ENV.should_receive(:[])
|
46
|
+
.with("RACK_ENV")
|
47
|
+
.and_return(nil)
|
48
|
+
|
38
49
|
expect {
|
39
|
-
|
40
|
-
|
41
|
-
}.should raise_error(Braspag::Connection::InvalidEnv)
|
42
|
-
ENV["RACK_ENV"] = backup
|
50
|
+
Braspag::Connection.clone.instance
|
51
|
+
}.to raise_error Braspag::Connection::InvalidEnv
|
43
52
|
end
|
44
53
|
|
45
|
-
it "should generate exception when RACK_ENV is empty" do
|
46
|
-
|
47
|
-
|
54
|
+
it "should generate an exception when RACK_ENV is empty" do
|
55
|
+
ENV.should_receive(:[])
|
56
|
+
.twice
|
57
|
+
.with("RACK_ENV")
|
58
|
+
.and_return("")
|
59
|
+
|
48
60
|
expect {
|
49
|
-
|
50
|
-
|
51
|
-
}.should raise_error(Braspag::Connection::InvalidEnv)
|
52
|
-
ENV["RACK_ENV"] = backup
|
61
|
+
Braspag::Connection.clone.instance
|
62
|
+
}.to raise_error Braspag::Connection::InvalidEnv
|
53
63
|
end
|
54
64
|
|
65
|
+
it "should generate an exception when merchant_id is not in a correct format" do
|
66
|
+
braspag_config[ENV["RACK_ENV"]]["merchant_id"] = "A" * 38
|
55
67
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
YAML.should_receive(:load_file).with("config/braspag.yml").and_return(mock_merchant)
|
60
|
-
other_connection = Braspag::Connection.clone
|
68
|
+
YAML.should_receive(:load_file)
|
69
|
+
.with("config/braspag.yml")
|
70
|
+
.and_return(braspag_config)
|
61
71
|
|
62
|
-
expect {
|
72
|
+
expect {
|
73
|
+
Braspag::Connection.clone.instance
|
74
|
+
}.to raise_error Braspag::Connection::InvalidMerchantId
|
63
75
|
end
|
64
76
|
|
65
|
-
it
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
77
|
+
it { @connection.instance.crypto_url.should == crypto_url }
|
78
|
+
it { @connection.instance.crypto_key.should == crypto_key }
|
79
|
+
it { @connection.instance.merchant_id.should == merchant_id }
|
80
|
+
|
81
|
+
[:braspag_url, :merchant_id, :crypto_url, :crypto_key,
|
82
|
+
:options, :environment].each do |attribute|
|
83
|
+
|
84
|
+
it { @connection.instance.should respond_to(attribute) }
|
70
85
|
|
71
|
-
expect { other_connection.instance }.should raise_error(Braspag::Connection::InvalidMerchantId)
|
72
86
|
end
|
73
87
|
|
74
|
-
|
75
|
-
it "
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
88
|
+
describe "#production?" do
|
89
|
+
it "should return true when environment is production" do
|
90
|
+
braspag_config[ENV["RACK_ENV"]]["environment"] = "production"
|
91
|
+
|
92
|
+
YAML.should_receive(:load_file)
|
93
|
+
.and_return(braspag_config)
|
94
|
+
|
95
|
+
Braspag::Connection.clone.instance.production?.should be_true
|
81
96
|
end
|
82
97
|
|
83
|
-
it "
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
98
|
+
it "should return false when environment is not production" do
|
99
|
+
braspag_config[ENV["RACK_ENV"]]["environment"] = "homologation"
|
100
|
+
|
101
|
+
YAML.should_receive(:load_file)
|
102
|
+
.and_return(braspag_config)
|
103
|
+
|
104
|
+
Braspag::Connection.clone.instance.production?.should be_false
|
89
105
|
end
|
90
106
|
end
|
91
107
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
end
|
108
|
+
describe "#homologation?" do
|
109
|
+
it "should return true when environment is homologation" do
|
110
|
+
braspag_config[ENV["RACK_ENV"]]["environment"] = "homologation"
|
96
111
|
|
97
|
-
|
98
|
-
|
99
|
-
mock_merchant[ENV["RACK_ENV"]]["braspag_url"] = nil
|
100
|
-
YAML.should_receive(:load_file).with("config/braspag.yml").and_return(mock_merchant)
|
101
|
-
other_connection = Braspag::Connection.clone
|
112
|
+
YAML.should_receive(:load_file)
|
113
|
+
.and_return(braspag_config)
|
102
114
|
|
103
|
-
|
104
|
-
|
115
|
+
Braspag::Connection.clone.instance.homologation?.should be_true
|
116
|
+
end
|
105
117
|
|
106
|
-
|
107
|
-
|
108
|
-
mock_merchant[ENV["RACK_ENV"]]["braspag_url"] = ""
|
109
|
-
YAML.should_receive(:load_file).with("config/braspag.yml").and_return(mock_merchant)
|
110
|
-
other_connection = Braspag::Connection.clone
|
118
|
+
it "should return false when environment is not homologation" do
|
119
|
+
braspag_config[ENV["RACK_ENV"]]["environment"] = "production"
|
111
120
|
|
112
|
-
|
113
|
-
|
121
|
+
YAML.should_receive(:load_file)
|
122
|
+
.and_return(braspag_config)
|
114
123
|
|
115
|
-
|
116
|
-
|
117
|
-
new_connection.braspag_url.should == braspag_url
|
124
|
+
Braspag::Connection.clone.instance.homologation?.should be_false
|
125
|
+
end
|
118
126
|
end
|
119
127
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
128
|
+
describe "#braspag_url" do
|
129
|
+
context "when environment is homologation" do
|
130
|
+
it "should return the Braspag homologation url" do
|
131
|
+
braspag_config[ENV["RACK_ENV"]]["environment"] = "homologation"
|
124
132
|
|
125
|
-
|
126
|
-
|
127
|
-
|
133
|
+
YAML.should_receive(:load_file)
|
134
|
+
.and_return(braspag_config)
|
135
|
+
|
136
|
+
connection = Braspag::Connection.clone.instance
|
137
|
+
connection.braspag_url.should == braspag_homologation_url
|
138
|
+
connection.braspag_query_url.should == braspag_homologation_query_url
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
context "when environment is production" do
|
143
|
+
it "should return the Braspag production url" do
|
144
|
+
braspag_config[ENV["RACK_ENV"]]["environment"] = "production"
|
145
|
+
|
146
|
+
YAML.should_receive(:load_file)
|
147
|
+
.and_return(braspag_config)
|
148
|
+
|
149
|
+
connection = Braspag::Connection.clone.instance
|
150
|
+
connection.braspag_url.should == braspag_production_url
|
151
|
+
connection.braspag_query_url.should == braspag_production_query_url
|
152
|
+
end
|
153
|
+
end
|
128
154
|
end
|
129
155
|
end
|
data/spec/credit_card_spec.rb
CHANGED
@@ -3,6 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
|
4
4
|
describe Braspag::CreditCard do
|
5
5
|
let!(:braspag_url) { "https://homologacao.pagador.com.br" }
|
6
|
+
let!(:braspag_query_url) { "https://homologacao.pagador.com.br/pagador/webservice/pedido.asmx" }
|
6
7
|
|
7
8
|
describe ".authorize" do
|
8
9
|
it "should raise an error when :order_id is not present" do
|
@@ -487,7 +488,7 @@ describe Braspag::CreditCard do
|
|
487
488
|
xmlns="http://www.pagador.com.br/" />
|
488
489
|
EOXML
|
489
490
|
|
490
|
-
FakeWeb.register_uri(:post, "#{
|
491
|
+
FakeWeb.register_uri(:post, "#{braspag_query_url}/GetDadosCartao",
|
491
492
|
:body => xml)
|
492
493
|
|
493
494
|
expect {
|
@@ -515,7 +516,7 @@ describe Braspag::CreditCard do
|
|
515
516
|
</DadosCartao>
|
516
517
|
EOXML
|
517
518
|
|
518
|
-
FakeWeb.register_uri(:post, "#{
|
519
|
+
FakeWeb.register_uri(:post, "#{braspag_query_url}/GetDadosCartao",
|
519
520
|
:body => xml)
|
520
521
|
order_info = Braspag::CreditCard.info("12345")
|
521
522
|
FakeWeb.clean_registry
|
data/spec/order_spec.rb
CHANGED
@@ -3,6 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
|
4
4
|
describe Braspag::Order do
|
5
5
|
let!(:braspag_url) { "https://homologacao.pagador.com.br" }
|
6
|
+
let!(:braspag_query_url) { "https://homologacao.pagador.com.br/pagador/webservice/pedido.asmx" }
|
6
7
|
|
7
8
|
describe "#status" do
|
8
9
|
it "should raise an error when no order_id is given" do
|
@@ -32,7 +33,7 @@ describe Braspag::Order do
|
|
32
33
|
xmlns="http://www.pagador.com.br/" />
|
33
34
|
EOXML
|
34
35
|
|
35
|
-
FakeWeb.register_uri(:post, "#{
|
36
|
+
FakeWeb.register_uri(:post, "#{braspag_query_url}/GetDadosPedido",
|
36
37
|
:body => xml)
|
37
38
|
|
38
39
|
expect {
|
@@ -68,7 +69,7 @@ describe Braspag::Order do
|
|
68
69
|
</DadosPedido>
|
69
70
|
EOXML
|
70
71
|
|
71
|
-
FakeWeb.register_uri(:post, "#{
|
72
|
+
FakeWeb.register_uri(:post, "#{braspag_query_url}/GetDadosPedido",
|
72
73
|
:body => xml)
|
73
74
|
order_info = Braspag::Order.status("12345")
|
74
75
|
FakeWeb.clean_registry
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbraspag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,12 +14,11 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
18
|
-
default_executable:
|
17
|
+
date: 2012-01-05 00:00:00.000000000Z
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
21
20
|
name: cs-httpi
|
22
|
-
requirement: &
|
21
|
+
requirement: &70280110585040 !ruby/object:Gem::Requirement
|
23
22
|
none: false
|
24
23
|
requirements:
|
25
24
|
- - ! '>='
|
@@ -27,10 +26,10 @@ dependencies:
|
|
27
26
|
version: 0.9.5.2
|
28
27
|
type: :runtime
|
29
28
|
prerelease: false
|
30
|
-
version_requirements: *
|
29
|
+
version_requirements: *70280110585040
|
31
30
|
- !ruby/object:Gem::Dependency
|
32
31
|
name: json
|
33
|
-
requirement: &
|
32
|
+
requirement: &70280110582040 !ruby/object:Gem::Requirement
|
34
33
|
none: false
|
35
34
|
requirements:
|
36
35
|
- - ! '>='
|
@@ -38,10 +37,10 @@ dependencies:
|
|
38
37
|
version: 1.6.1
|
39
38
|
type: :runtime
|
40
39
|
prerelease: false
|
41
|
-
version_requirements: *
|
40
|
+
version_requirements: *70280110582040
|
42
41
|
- !ruby/object:Gem::Dependency
|
43
42
|
name: nokogiri
|
44
|
-
requirement: &
|
43
|
+
requirement: &70280110574920 !ruby/object:Gem::Requirement
|
45
44
|
none: false
|
46
45
|
requirements:
|
47
46
|
- - ! '>='
|
@@ -49,10 +48,10 @@ dependencies:
|
|
49
48
|
version: 1.5.0
|
50
49
|
type: :runtime
|
51
50
|
prerelease: false
|
52
|
-
version_requirements: *
|
51
|
+
version_requirements: *70280110574920
|
53
52
|
- !ruby/object:Gem::Dependency
|
54
53
|
name: rake
|
55
|
-
requirement: &
|
54
|
+
requirement: &70280110572880 !ruby/object:Gem::Requirement
|
56
55
|
none: false
|
57
56
|
requirements:
|
58
57
|
- - ! '>='
|
@@ -60,10 +59,10 @@ dependencies:
|
|
60
59
|
version: '0'
|
61
60
|
type: :development
|
62
61
|
prerelease: false
|
63
|
-
version_requirements: *
|
62
|
+
version_requirements: *70280110572880
|
64
63
|
- !ruby/object:Gem::Dependency
|
65
64
|
name: rspec
|
66
|
-
requirement: &
|
65
|
+
requirement: &70280110560300 !ruby/object:Gem::Requirement
|
67
66
|
none: false
|
68
67
|
requirements:
|
69
68
|
- - ! '>='
|
@@ -71,10 +70,10 @@ dependencies:
|
|
71
70
|
version: '0'
|
72
71
|
type: :development
|
73
72
|
prerelease: false
|
74
|
-
version_requirements: *
|
73
|
+
version_requirements: *70280110560300
|
75
74
|
- !ruby/object:Gem::Dependency
|
76
75
|
name: fakeweb
|
77
|
-
requirement: &
|
76
|
+
requirement: &70280110545760 !ruby/object:Gem::Requirement
|
78
77
|
none: false
|
79
78
|
requirements:
|
80
79
|
- - ! '>='
|
@@ -82,10 +81,10 @@ dependencies:
|
|
82
81
|
version: '0'
|
83
82
|
type: :development
|
84
83
|
prerelease: false
|
85
|
-
version_requirements: *
|
84
|
+
version_requirements: *70280110545760
|
86
85
|
- !ruby/object:Gem::Dependency
|
87
86
|
name: shoulda-matchers
|
88
|
-
requirement: &
|
87
|
+
requirement: &70280110543940 !ruby/object:Gem::Requirement
|
89
88
|
none: false
|
90
89
|
requirements:
|
91
90
|
- - ! '>='
|
@@ -93,10 +92,10 @@ dependencies:
|
|
93
92
|
version: '0'
|
94
93
|
type: :development
|
95
94
|
prerelease: false
|
96
|
-
version_requirements: *
|
95
|
+
version_requirements: *70280110543940
|
97
96
|
- !ruby/object:Gem::Dependency
|
98
97
|
name: guard-rspec
|
99
|
-
requirement: &
|
98
|
+
requirement: &70280110538180 !ruby/object:Gem::Requirement
|
100
99
|
none: false
|
101
100
|
requirements:
|
102
101
|
- - ! '>='
|
@@ -104,10 +103,10 @@ dependencies:
|
|
104
103
|
version: '0'
|
105
104
|
type: :development
|
106
105
|
prerelease: false
|
107
|
-
version_requirements: *
|
106
|
+
version_requirements: *70280110538180
|
108
107
|
- !ruby/object:Gem::Dependency
|
109
108
|
name: guard-bundler
|
110
|
-
requirement: &
|
109
|
+
requirement: &70280110533400 !ruby/object:Gem::Requirement
|
111
110
|
none: false
|
112
111
|
requirements:
|
113
112
|
- - ! '>='
|
@@ -115,10 +114,10 @@ dependencies:
|
|
115
114
|
version: '0'
|
116
115
|
type: :development
|
117
116
|
prerelease: false
|
118
|
-
version_requirements: *
|
117
|
+
version_requirements: *70280110533400
|
119
118
|
- !ruby/object:Gem::Dependency
|
120
119
|
name: ruby-debug19
|
121
|
-
requirement: &
|
120
|
+
requirement: &70280110529600 !ruby/object:Gem::Requirement
|
122
121
|
none: false
|
123
122
|
requirements:
|
124
123
|
- - ! '>='
|
@@ -126,7 +125,7 @@ dependencies:
|
|
126
125
|
version: '0'
|
127
126
|
type: :development
|
128
127
|
prerelease: false
|
129
|
-
version_requirements: *
|
128
|
+
version_requirements: *70280110529600
|
130
129
|
description: rbraspag gem to use Braspag gateway
|
131
130
|
email:
|
132
131
|
- tinorj@gmail.com
|
@@ -171,7 +170,6 @@ files:
|
|
171
170
|
- spec/order_spec.rb
|
172
171
|
- spec/spec_helper.rb
|
173
172
|
- spec/utils_spec.rb
|
174
|
-
has_rdoc: true
|
175
173
|
homepage: http://github.com/concretesolutions/rbraspag
|
176
174
|
licenses: []
|
177
175
|
post_install_message:
|
@@ -192,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
190
|
version: '0'
|
193
191
|
requirements: []
|
194
192
|
rubyforge_project: rbraspag
|
195
|
-
rubygems_version: 1.
|
193
|
+
rubygems_version: 1.8.10
|
196
194
|
signing_key:
|
197
195
|
specification_version: 3
|
198
196
|
summary: rbraspag gem to use Braspag gateway
|
@@ -206,3 +204,4 @@ test_files:
|
|
206
204
|
- spec/order_spec.rb
|
207
205
|
- spec/spec_helper.rb
|
208
206
|
- spec/utils_spec.rb
|
207
|
+
has_rdoc:
|