baby-braspag 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/baby-braspag/credit_card.rb +102 -75
- data/lib/baby-braspag/version.rb +1 -1
- data/spec/credit_card_spec.rb +323 -393
- metadata +21 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9b8a1b58bac46347ec265ddf6279427a3e4f4146
|
4
|
+
data.tar.gz: b31e86eed6df4e4828c60efca30584a827f9311e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b6f5744db076aaef3373e4b3413d4a60267ccee3f3b5bc29c64168f23cc594e45f4892f6cff0d4643c42fc1e5de368dbe5b7417619242c9741c563a22c593a6
|
7
|
+
data.tar.gz: cbb231e804583bd4841da0e00b6d2ac44330ca9af18546b6d133ab18ad2a83d32973e2898b750334a4e0363aa1f63a317712cb3e489747c5f8c92e7cb82caacb
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Braspag
|
2
2
|
class CreditCard < PaymentMethod
|
3
|
-
|
4
3
|
MAPPING = {
|
5
4
|
:merchant_id => "merchantId",
|
6
5
|
:order => 'order',
|
@@ -22,12 +21,13 @@ module Braspag
|
|
22
21
|
CANCELLATION_URI = "/webservices/pagador/Pagador.asmx/VoidTransaction"
|
23
22
|
PRODUCTION_INFO_URI = "/webservices/pagador/pedido.asmx/GetDadosCartao"
|
24
23
|
HOMOLOGATION_INFO_URI = "/pagador/webservice/pedido.asmx/GetDadosCartao"
|
24
|
+
STATUS_URI = "/webservices/pagador/pedido.asmx/GetDadosPedido"
|
25
25
|
|
26
26
|
def self.authorize(params = {})
|
27
27
|
connection = Braspag::Connection.instance
|
28
28
|
params[:merchant_id] = connection.merchant_id
|
29
29
|
|
30
|
-
|
30
|
+
check_params(params)
|
31
31
|
|
32
32
|
data = {}
|
33
33
|
MAPPING.each do |k, v|
|
@@ -41,16 +41,16 @@ module Braspag
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
response = Braspag::Poster.new(
|
44
|
+
response = Braspag::Poster.new(authorize_url).do_post(:authorize, data)
|
45
45
|
|
46
46
|
Utils::convert_to_map(response.body, {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
:amount => nil,
|
48
|
+
:number => "authorisationNumber",
|
49
|
+
:message => 'message',
|
50
|
+
:return_code => 'returnCode',
|
51
|
+
:status => 'status',
|
52
|
+
:transaction_id => "transactionId"
|
53
|
+
})
|
54
54
|
end
|
55
55
|
|
56
56
|
def self.capture(order_id)
|
@@ -64,16 +64,16 @@ module Braspag
|
|
64
64
|
MAPPING[:merchant_id] => merchant_id
|
65
65
|
}
|
66
66
|
|
67
|
-
response = Braspag::Poster.new(
|
67
|
+
response = Braspag::Poster.new(capture_url).do_post(:capture, data)
|
68
68
|
|
69
69
|
Utils::convert_to_map(response.body, {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
:amount => nil,
|
71
|
+
:number => "authorisationNumber",
|
72
|
+
:message => 'message',
|
73
|
+
:return_code => 'returnCode',
|
74
|
+
:status => 'status',
|
75
|
+
:transaction_id => "transactionId"
|
76
|
+
})
|
77
77
|
end
|
78
78
|
|
79
79
|
def self.partial_capture(order_id, amount)
|
@@ -88,16 +88,16 @@ module Braspag
|
|
88
88
|
"captureAmount" => Utils.convert_decimal_to_string(amount)
|
89
89
|
}
|
90
90
|
|
91
|
-
response = Braspag::Poster.new(
|
91
|
+
response = Braspag::Poster.new(partial_capture_url).do_post(:partial_capture, data)
|
92
92
|
|
93
93
|
Utils::convert_to_map(response.body, {
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
94
|
+
:amount => nil,
|
95
|
+
:number => "authorisationNumber",
|
96
|
+
:message => 'message',
|
97
|
+
:return_code => 'returnCode',
|
98
|
+
:status => 'status',
|
99
|
+
:transaction_id => "transactionId"
|
100
|
+
})
|
101
101
|
end
|
102
102
|
|
103
103
|
def self.void(order_id)
|
@@ -111,16 +111,16 @@ module Braspag
|
|
111
111
|
MAPPING[:merchant_id] => merchant_id
|
112
112
|
}
|
113
113
|
|
114
|
-
response = Braspag::Poster.new(
|
114
|
+
response = Braspag::Poster.new(cancellation_url).do_post(:void, data)
|
115
115
|
|
116
116
|
Utils::convert_to_map(response.body, {
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
117
|
+
:amount => nil,
|
118
|
+
:number => "authorisationNumber",
|
119
|
+
:message => 'message',
|
120
|
+
:return_code => 'returnCode',
|
121
|
+
:status => 'status',
|
122
|
+
:transaction_id => "transactionId"
|
123
|
+
})
|
124
124
|
end
|
125
125
|
|
126
126
|
def self.info(order_id)
|
@@ -129,43 +129,42 @@ module Braspag
|
|
129
129
|
raise InvalidOrderId unless self.valid_order_id?(order_id)
|
130
130
|
|
131
131
|
data = {:loja => connection.merchant_id, :numeroPedido => order_id.to_s}
|
132
|
-
response = Braspag::Poster.new(
|
132
|
+
response = Braspag::Poster.new(info_url).do_post(:info_credit_card, data)
|
133
133
|
|
134
134
|
response = Utils::convert_to_map(response.body, {
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
135
|
+
:checking_number => "NumeroComprovante",
|
136
|
+
:certified => "Autenticada",
|
137
|
+
:autorization_number => "NumeroAutorizacao",
|
138
|
+
:card_number => "NumeroCartao",
|
139
|
+
:transaction_number => "NumeroTransacao"
|
140
|
+
})
|
141
141
|
|
142
142
|
raise UnknownError if response[:checking_number].nil?
|
143
143
|
response
|
144
144
|
end
|
145
145
|
|
146
|
-
def self.
|
147
|
-
|
148
|
-
|
149
|
-
[:customer_name, :holder, :card_number, :expiration, :security_code, :number_payments, :type].each do |param|
|
150
|
-
raise IncompleteParams if params[param].nil?
|
151
|
-
end
|
152
|
-
|
153
|
-
raise InvalidHolder if params[:holder].to_s.size < 1 || params[:holder].to_s.size > 100
|
146
|
+
def self.status(order_id)
|
147
|
+
connection = Braspag::Connection.instance
|
154
148
|
|
155
|
-
|
156
|
-
raise InvalidExpirationDate unless matches
|
157
|
-
begin
|
158
|
-
year = matches[2].to_i
|
159
|
-
year = "20#{year}" if year.size == 2
|
149
|
+
raise InvalidOrderId unless self.valid_order_id?(order_id)
|
160
150
|
|
161
|
-
|
162
|
-
rescue ArgumentError
|
163
|
-
raise InvalidExpirationDate
|
164
|
-
end
|
151
|
+
data = { :numeroPedido => order_id, :loja => connection.merchant_id }
|
165
152
|
|
166
|
-
|
153
|
+
response = Braspag::Poster.new(status_url).do_post(:order_status, data)
|
167
154
|
|
168
|
-
|
155
|
+
Utils::convert_to_map(response.body, {
|
156
|
+
:authorization_code => "CodigoAutorizacao",
|
157
|
+
:payment_code => "CodigoPagamento",
|
158
|
+
:payment_method => "FormaPagamento",
|
159
|
+
:installments => "NumeroParcelas",
|
160
|
+
:status => "Status",
|
161
|
+
:value => "Valor",
|
162
|
+
:payment_date => "DataPagamento",
|
163
|
+
:order_date => "DataPedido",
|
164
|
+
:transaction_id => "TransId",
|
165
|
+
:error_code => "CodigoErro",
|
166
|
+
:error_message => "MensagemErro"
|
167
|
+
})
|
169
168
|
end
|
170
169
|
|
171
170
|
# <b>DEPRECATED:</b> Please use <tt>ProtectedCreditCard.save</tt> instead.
|
@@ -186,25 +185,53 @@ module Braspag
|
|
186
185
|
ProtectedCreditCard.just_click_shop(params)
|
187
186
|
end
|
188
187
|
|
189
|
-
|
190
|
-
|
191
|
-
connection.braspag_url + (connection.production? ? PRODUCTION_INFO_URI : HOMOLOGATION_INFO_URI)
|
192
|
-
end
|
188
|
+
class << self
|
189
|
+
private
|
193
190
|
|
194
|
-
|
195
|
-
|
196
|
-
end
|
191
|
+
def check_params(params)
|
192
|
+
super
|
197
193
|
|
198
|
-
|
199
|
-
|
200
|
-
|
194
|
+
[:customer_name, :holder, :card_number, :expiration, :security_code, :number_payments, :type].each do |param|
|
195
|
+
raise IncompleteParams if params[param].nil?
|
196
|
+
end
|
201
197
|
|
202
|
-
|
203
|
-
|
204
|
-
|
198
|
+
raise InvalidHolder if params[:holder].to_s.size < 1 || params[:holder].to_s.size > 100
|
199
|
+
|
200
|
+
matches = params[:expiration].to_s.match /^(\d{2})\/(\d{2,4})$/
|
201
|
+
raise InvalidExpirationDate unless matches
|
205
202
|
|
206
|
-
|
207
|
-
|
203
|
+
year = matches[2].size == 4 ? matches[2] : "20#{matches[2]}"
|
204
|
+
raise if !Date.valid_date?(year.to_i, matches[1].to_i, 1)
|
205
|
+
|
206
|
+
raise InvalidSecurityCode if params[:security_code].to_s.size < 1 || params[:security_code].to_s.size > 4
|
207
|
+
|
208
|
+
raise InvalidNumberPayments if params[:number_payments].to_i < 1 || params[:number_payments].to_i > 99
|
209
|
+
end
|
210
|
+
|
211
|
+
def authorize_url
|
212
|
+
Braspag::Connection.instance.braspag_url + AUTHORIZE_URI
|
213
|
+
end
|
214
|
+
|
215
|
+
def capture_url
|
216
|
+
Braspag::Connection.instance.braspag_url + CAPTURE_URI
|
217
|
+
end
|
218
|
+
|
219
|
+
def partial_capture_url
|
220
|
+
Braspag::Connection.instance.braspag_url + PARTIAL_CAPTURE_URI
|
221
|
+
end
|
222
|
+
|
223
|
+
def cancellation_url
|
224
|
+
Braspag::Connection.instance.braspag_url + CANCELLATION_URI
|
225
|
+
end
|
226
|
+
|
227
|
+
def info_url
|
228
|
+
connection = Braspag::Connection.instance
|
229
|
+
connection.braspag_url + (connection.production? ? PRODUCTION_INFO_URI : HOMOLOGATION_INFO_URI)
|
230
|
+
end
|
231
|
+
|
232
|
+
def status_url
|
233
|
+
Braspag::Connection.instance.braspag_url + STATUS_URI
|
234
|
+
end
|
208
235
|
end
|
209
236
|
end
|
210
237
|
end
|
data/lib/baby-braspag/version.rb
CHANGED
data/spec/credit_card_spec.rb
CHANGED
@@ -2,318 +2,330 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
require 'ostruct'
|
3
3
|
|
4
4
|
describe Braspag::CreditCard do
|
5
|
-
let(:
|
6
|
-
|
7
|
-
let(:
|
8
|
-
|
5
|
+
let(:braspag_service_url) { 'https://homologacao.pagador.com.br' }
|
6
|
+
|
7
|
+
let(:connection) { mock(
|
8
|
+
:merchant_id => 'merchant-id',
|
9
|
+
:protected_card_url => 'https://www.cartaoprotegido.com.br/Services/TestEnvironment',
|
10
|
+
:homologation? => (environment == 'homologation'),
|
11
|
+
:production? => (environment == 'production'),
|
12
|
+
braspag_url: braspag_service_url
|
13
|
+
) }
|
14
|
+
|
15
|
+
let(:request) { OpenStruct.new :url => operation_url }
|
16
|
+
let(:environment) { 'homologation' }
|
17
|
+
let(:response_xml) { nil }
|
18
|
+
let(:operation_url) { nil }
|
19
|
+
|
20
|
+
before { Braspag::Connection.stub(:instance => connection) }
|
9
21
|
|
10
22
|
before do
|
11
|
-
|
12
|
-
|
23
|
+
::HTTPI::Request.stub(:new).with(operation_url).and_return(request)
|
24
|
+
::HTTPI.stub(:post).with(request).and_return(mock(:body => response_xml))
|
13
25
|
end
|
14
26
|
|
15
27
|
describe ".authorize" do
|
16
|
-
let(:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/Pagador.asmx/Authorize" }
|
29
|
+
let(:order_id) { 'order-id' }
|
30
|
+
|
31
|
+
let(:params) { {
|
32
|
+
:order_id => order_id,
|
33
|
+
:customer_name => 'W' * 21,
|
34
|
+
:amount => '100.00',
|
35
|
+
:payment_method => :redecard,
|
36
|
+
:holder => 'Joao Maria Souza',
|
37
|
+
:card_number => '9' * 10,
|
38
|
+
:expiration => '10/12',
|
39
|
+
:security_code => '123',
|
40
|
+
:number_payments => 1,
|
41
|
+
:type => 0
|
42
|
+
} }
|
43
|
+
|
44
|
+
|
45
|
+
let(:response_xml) do
|
46
|
+
<<-EOXML
|
47
|
+
<?xml version="1.0" encoding="utf-8"?>
|
48
|
+
<PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
49
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
50
|
+
xmlns="https://www.pagador.com.br/webservice/pagador">
|
51
|
+
<amount>5</amount>
|
52
|
+
<message>Transaction Successful</message>
|
53
|
+
<authorisationNumber>733610</authorisationNumber>
|
54
|
+
<returnCode>7</returnCode>
|
55
|
+
<status>2</status>
|
56
|
+
<transactionId>0</transactionId>
|
57
|
+
</PagadorReturn>
|
58
|
+
EOXML
|
29
59
|
end
|
30
60
|
|
31
|
-
|
32
|
-
|
61
|
+
it "request the order authorization" do
|
62
|
+
Braspag::CreditCard.authorize(params)
|
63
|
+
request.body.should == {
|
64
|
+
'merchantId' => 'merchant-id',
|
65
|
+
'order' => '',
|
66
|
+
'orderId' => 'order-id',
|
67
|
+
'customerName' => 'WWWWWWWWWWWWWWWWWWWWW',
|
68
|
+
'amount' => '100,00',
|
69
|
+
'paymentMethod' => 997,
|
70
|
+
'holder' => 'Joao Maria Souza',
|
71
|
+
'cardNumber' => '9999999999',
|
72
|
+
'expiration' => '10/12',
|
73
|
+
'securityCode' => '123',
|
74
|
+
'numberPayments' => 1,
|
75
|
+
'typePayment' => 0
|
76
|
+
}
|
33
77
|
end
|
34
78
|
|
35
|
-
|
79
|
+
it "returns the authorization result" do
|
80
|
+
response = Braspag::CreditCard.authorize(params)
|
81
|
+
response.should == {
|
82
|
+
:amount => '5',
|
83
|
+
:message => 'Transaction Successful',
|
84
|
+
:number => '733610',
|
85
|
+
:return_code => '7',
|
86
|
+
:status => '2',
|
87
|
+
:transaction_id => '0'
|
88
|
+
}
|
89
|
+
end
|
36
90
|
|
37
|
-
|
38
|
-
|
91
|
+
describe "validation" do
|
92
|
+
[:order_id, :amount, :payment_method, :customer_name, :holder, :card_number, :expiration,
|
93
|
+
:security_code, :number_payments, :type].each do |param|
|
94
|
+
it "raises an error when #{param} parameter is missing" do
|
95
|
+
params[param] = nil
|
96
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::IncompleteParams)
|
97
|
+
end
|
98
|
+
end
|
39
99
|
|
40
|
-
|
41
|
-
|
100
|
+
context "when order id is invalid" do
|
101
|
+
before { params[:order_id] = '' }
|
42
102
|
|
43
|
-
|
44
|
-
|
45
|
-
|
103
|
+
it "raises an error" do
|
104
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidOrderId)
|
105
|
+
end
|
106
|
+
end
|
46
107
|
|
47
|
-
|
108
|
+
context "when payment method is invalid" do
|
109
|
+
before { params[:payment_method] = 'invalid' }
|
48
110
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<?xml version="1.0" encoding="utf-8"?>
|
53
|
-
<PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
54
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
55
|
-
xmlns="https://www.pagador.com.br/webservice/pagador">
|
56
|
-
<amount>5</amount>
|
57
|
-
<message>Transaction Successful</message>
|
58
|
-
<authorisationNumber>733610</authorisationNumber>
|
59
|
-
<returnCode>7</returnCode>
|
60
|
-
<status>2</status>
|
61
|
-
<transactionId>0</transactionId>
|
62
|
-
</PagadorReturn>
|
63
|
-
EOXML
|
111
|
+
it "raises an error" do
|
112
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidPaymentMethod)
|
113
|
+
end
|
64
114
|
end
|
65
115
|
|
66
|
-
|
116
|
+
context "when customer name is too long" do
|
117
|
+
before { params[:customer_name] = 'n' * 256 }
|
67
118
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
::HTTPI.should_receive(:post).with(request).and_return(mock(:body => valid_xml))
|
119
|
+
it "raises an error" do
|
120
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidCustomerName)
|
121
|
+
end
|
72
122
|
end
|
73
123
|
|
74
|
-
|
75
|
-
|
76
|
-
response.should be_kind_of Hash
|
77
|
-
response.should == {
|
78
|
-
:amount => "5",
|
79
|
-
:message => "Transaction Successful",
|
80
|
-
:number => "733610",
|
81
|
-
:return_code => "7",
|
82
|
-
:status => "2",
|
83
|
-
:transaction_id => "0"
|
84
|
-
}
|
85
|
-
end
|
124
|
+
context "when card holder name is too long" do
|
125
|
+
before { params[:holder] = 'h' * 101 }
|
86
126
|
|
87
|
-
|
88
|
-
|
89
|
-
|
127
|
+
it "raises an error" do
|
128
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidHolder)
|
129
|
+
end
|
90
130
|
end
|
91
|
-
end
|
92
|
-
end
|
93
131
|
|
94
|
-
|
95
|
-
|
96
|
-
let(:order_id) { "um id qualquer" }
|
132
|
+
context "when expiration is in invalid format" do
|
133
|
+
before { params[:expiration] = '2011/19/19' }
|
97
134
|
|
98
|
-
|
99
|
-
|
100
|
-
|
135
|
+
it "raises an error" do
|
136
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidExpirationDate)
|
137
|
+
end
|
138
|
+
end
|
101
139
|
|
102
|
-
|
103
|
-
|
104
|
-
Braspag::CreditCard.should_receive(:valid_order_id?)
|
105
|
-
.with(order_id)
|
106
|
-
.and_return(false)
|
140
|
+
context "when expiration is in valid format with invalid date" do
|
141
|
+
before { params[:expiration] = '2015/19' }
|
107
142
|
|
108
|
-
|
109
|
-
Braspag::CreditCard.
|
110
|
-
|
143
|
+
it "raises an error" do
|
144
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidExpirationDate)
|
145
|
+
end
|
111
146
|
end
|
112
|
-
end
|
113
147
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
<message>Approved</message>
|
123
|
-
<returnCode>0</returnCode>
|
124
|
-
<status>0</status>
|
125
|
-
</PagadorReturn>
|
126
|
-
EOXML
|
148
|
+
['01/15', '01/2015'].each do |expiration|
|
149
|
+
context "when expiration is in #{expiration} format" do
|
150
|
+
before { params[:expiration] = expiration }
|
151
|
+
|
152
|
+
it "raises no error" do
|
153
|
+
expect { Braspag::CreditCard.authorize(params) }.not_to raise_error
|
154
|
+
end
|
155
|
+
end
|
127
156
|
end
|
128
157
|
|
129
|
-
|
158
|
+
context "when security code is too long" do
|
159
|
+
before { params[:security_code] = '12345' }
|
130
160
|
|
131
|
-
|
132
|
-
|
133
|
-
|
161
|
+
it "raises an error" do
|
162
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidSecurityCode)
|
163
|
+
end
|
164
|
+
end
|
134
165
|
|
135
|
-
|
136
|
-
|
137
|
-
.and_return(request)
|
166
|
+
context "when security code is too short" do
|
167
|
+
before { params[:security_code] = '' }
|
138
168
|
|
139
|
-
|
140
|
-
|
141
|
-
|
169
|
+
it "raises an error" do
|
170
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidSecurityCode)
|
171
|
+
end
|
142
172
|
end
|
143
173
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
:message => "Approved",
|
151
|
-
:return_code => "0",
|
152
|
-
:status => "0",
|
153
|
-
:transaction_id => nil
|
154
|
-
}
|
174
|
+
context "when the number of payments is too high" do
|
175
|
+
before { params[:number_payments] = 100 }
|
176
|
+
|
177
|
+
it "raises an error" do
|
178
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidNumberPayments)
|
179
|
+
end
|
155
180
|
end
|
156
181
|
|
157
|
-
|
158
|
-
|
159
|
-
|
182
|
+
context "when the number of payments is too low" do
|
183
|
+
before { params[:number_payments] = 0 }
|
184
|
+
|
185
|
+
it "raises an error" do
|
186
|
+
expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidNumberPayments)
|
187
|
+
end
|
160
188
|
end
|
161
189
|
end
|
162
190
|
end
|
163
191
|
|
164
|
-
describe ".
|
165
|
-
let(:
|
166
|
-
let(:order_id) {
|
192
|
+
describe ".capture" do
|
193
|
+
let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/Pagador.asmx/Capture" }
|
194
|
+
let(:order_id) { 'order-id' }
|
167
195
|
|
168
|
-
|
169
|
-
|
196
|
+
let(:response_xml) do
|
197
|
+
<<-EOXML
|
198
|
+
<?xml version="1.0" encoding="utf-8"?>
|
199
|
+
<PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
200
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
201
|
+
xmlns="https://www.pagador.com.br/webservice/pagador">
|
202
|
+
<amount>2</amount>
|
203
|
+
<message>Approved</message>
|
204
|
+
<returnCode>0</returnCode>
|
205
|
+
<status>0</status>
|
206
|
+
</PagadorReturn>
|
207
|
+
EOXML
|
170
208
|
end
|
171
209
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
.and_return(false)
|
210
|
+
it "requests the order capture" do
|
211
|
+
Braspag::CreditCard.capture('order id qualquer')
|
212
|
+
request.body.should == { 'orderId' => 'order id qualquer', 'merchantId' => 'merchant-id' }
|
213
|
+
end
|
177
214
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
215
|
+
it "returns the capture result" do
|
216
|
+
response = Braspag::CreditCard.capture('order id qualquer')
|
217
|
+
response.should == {
|
218
|
+
:amount => '2',
|
219
|
+
:number => nil,
|
220
|
+
:message => 'Approved',
|
221
|
+
:return_code => '0',
|
222
|
+
:status => '0',
|
223
|
+
:transaction_id => nil
|
224
|
+
}
|
182
225
|
end
|
183
226
|
|
184
|
-
context "
|
185
|
-
let(:
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
190
|
-
xmlns="https://www.pagador.com.br/webservice/pagador">
|
191
|
-
<amount>2</amount>
|
192
|
-
<message>Approved</message>
|
193
|
-
<returnCode>0</returnCode>
|
194
|
-
<status>0</status>
|
195
|
-
</PagadorReturn>
|
196
|
-
EOXML
|
227
|
+
context "when the order id is invalid" do
|
228
|
+
let(:order_id) { '' }
|
229
|
+
|
230
|
+
it "raises an error" do
|
231
|
+
expect { Braspag::CreditCard.capture(order_id) }.to raise_error(Braspag::InvalidOrderId)
|
197
232
|
end
|
233
|
+
end
|
234
|
+
end
|
198
235
|
|
199
|
-
|
236
|
+
describe ".partial_capture" do
|
237
|
+
let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/Pagador.asmx/CapturePartial" }
|
238
|
+
let(:order_id) { 'order-id' }
|
200
239
|
|
201
|
-
|
202
|
-
|
203
|
-
|
240
|
+
let(:response_xml) do
|
241
|
+
<<-EOXML
|
242
|
+
<?xml version="1.0" encoding="utf-8"?>
|
243
|
+
<PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
244
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
245
|
+
xmlns="https://www.pagador.com.br/webservice/pagador">
|
246
|
+
<amount>2</amount>
|
247
|
+
<message>Approved</message>
|
248
|
+
<returnCode>0</returnCode>
|
249
|
+
<status>0</status>
|
250
|
+
</PagadorReturn>
|
251
|
+
EOXML
|
252
|
+
end
|
204
253
|
|
205
|
-
|
206
|
-
|
207
|
-
|
254
|
+
it "requests the order partial capture" do
|
255
|
+
Braspag::CreditCard.partial_capture(order_id, 10.0)
|
256
|
+
request.body.should == { 'orderId' => 'order-id', 'captureAmount' => '10,00', 'merchantId' => 'merchant-id' }
|
257
|
+
end
|
208
258
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
259
|
+
it "returns the partial capture response" do
|
260
|
+
response = Braspag::CreditCard.partial_capture(order_id, 10.0)
|
261
|
+
response.should == {
|
262
|
+
:amount => '2',
|
263
|
+
:number => nil,
|
264
|
+
:message => 'Approved',
|
265
|
+
:return_code => '0',
|
266
|
+
:status => '0',
|
267
|
+
:transaction_id => nil
|
268
|
+
}
|
269
|
+
end
|
213
270
|
|
214
|
-
|
215
|
-
|
216
|
-
response.should be_kind_of Hash
|
217
|
-
response.should == {
|
218
|
-
:amount => "2",
|
219
|
-
:number => nil,
|
220
|
-
:message => "Approved",
|
221
|
-
:return_code => "0",
|
222
|
-
:status => "0",
|
223
|
-
:transaction_id => nil
|
224
|
-
}
|
225
|
-
end
|
271
|
+
context "when the order id is invalid" do
|
272
|
+
let(:order_id) { '' }
|
226
273
|
|
227
|
-
it "
|
228
|
-
Braspag::CreditCard.partial_capture(
|
229
|
-
request.body.should == {"orderId"=>"order id qualquer", "captureAmount"=>"10,00", "merchantId"=>"um id qualquer"}
|
274
|
+
it "raises an error" do
|
275
|
+
expect { Braspag::CreditCard.partial_capture(order_id, 10.0) }.to raise_error(Braspag::InvalidOrderId)
|
230
276
|
end
|
231
277
|
end
|
232
278
|
end
|
233
279
|
|
234
280
|
describe ".void" do
|
235
|
-
let(:
|
236
|
-
let(:order_id) {
|
281
|
+
let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/Pagador.asmx/VoidTransaction" }
|
282
|
+
let(:order_id) { 'order-id' }
|
237
283
|
|
238
|
-
|
239
|
-
|
284
|
+
let(:response_xml) do
|
285
|
+
<<-EOXML
|
286
|
+
<?xml version="1.0" encoding="utf-8"?>
|
287
|
+
<PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
288
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
289
|
+
xmlns="https://www.pagador.com.br/webservice/pagador">
|
290
|
+
<amount>2</amount>
|
291
|
+
<message>Approved</message>
|
292
|
+
<returnCode>0</returnCode>
|
293
|
+
<status>0</status>
|
294
|
+
</PagadorReturn>
|
295
|
+
EOXML
|
240
296
|
end
|
241
297
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
.with(order_id)
|
246
|
-
.and_return(false)
|
247
|
-
|
248
|
-
expect {
|
249
|
-
Braspag::CreditCard.void(order_id)
|
250
|
-
}.to raise_error(Braspag::InvalidOrderId)
|
251
|
-
end
|
298
|
+
it "requests the order cancellation" do
|
299
|
+
Braspag::CreditCard.void(order_id)
|
300
|
+
request.body.should == { 'order' => 'order-id', 'merchantId' => 'merchant-id' }
|
252
301
|
end
|
253
302
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
</PagadorReturn>
|
266
|
-
EOXML
|
267
|
-
end
|
268
|
-
|
269
|
-
let(:request) { OpenStruct.new :url => cancellation_url }
|
270
|
-
|
271
|
-
before do
|
272
|
-
Braspag::CreditCard.should_receive(:cancellation_url)
|
273
|
-
.and_return(cancellation_url)
|
274
|
-
|
275
|
-
::HTTPI::Request.should_receive(:new).with(cancellation_url).and_return(request)
|
276
|
-
::HTTPI.should_receive(:post).with(request).and_return(mock(:body => valid_xml))
|
277
|
-
end
|
303
|
+
it "returns the cancellation response" do
|
304
|
+
response = Braspag::CreditCard.void(order_id)
|
305
|
+
response.should == {
|
306
|
+
:amount => '2',
|
307
|
+
:number => nil,
|
308
|
+
:message => 'Approved',
|
309
|
+
:return_code => '0',
|
310
|
+
:status => '0',
|
311
|
+
:transaction_id => nil
|
312
|
+
}
|
313
|
+
end
|
278
314
|
|
279
|
-
|
280
|
-
|
281
|
-
response.should be_kind_of Hash
|
282
|
-
response.should == {
|
283
|
-
:amount => "2",
|
284
|
-
:number => nil,
|
285
|
-
:message => "Approved",
|
286
|
-
:return_code => "0",
|
287
|
-
:status => "0",
|
288
|
-
:transaction_id => nil
|
289
|
-
}
|
290
|
-
end
|
315
|
+
context "when the order id is invalid" do
|
316
|
+
let(:order_id) { '' }
|
291
317
|
|
292
|
-
it "
|
293
|
-
Braspag::CreditCard.void(
|
294
|
-
request.body.should == {"order"=>"order id qualquer", "merchantId"=>"um id qualquer"}
|
318
|
+
it "raises an error" do
|
319
|
+
expect { Braspag::CreditCard.void(order_id) }.to raise_error(Braspag::InvalidOrderId)
|
295
320
|
end
|
296
321
|
end
|
297
322
|
end
|
298
323
|
|
299
324
|
describe ".info" do
|
300
|
-
let(:
|
325
|
+
let(:operation_url) { "#{connection.braspag_url}/pagador/webservice/pedido.asmx/GetDadosCartao" }
|
326
|
+
let(:order_id) { 'order-id' }
|
301
327
|
|
302
|
-
let(:
|
303
|
-
<<-EOXML
|
304
|
-
<DadosCartao xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
305
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
306
|
-
xmlns="http://www.pagador.com.br/">
|
307
|
-
<NumeroComprovante></NumeroComprovante>
|
308
|
-
<Autenticada>false</Autenticada>
|
309
|
-
<NumeroAutorizacao>557593</NumeroAutorizacao>
|
310
|
-
<NumeroCartao>345678*****0007</NumeroCartao>
|
311
|
-
<NumeroTransacao>101001225645</NumeroTransacao>
|
312
|
-
</DadosCartao>
|
313
|
-
EOXML
|
314
|
-
end
|
315
|
-
|
316
|
-
let(:valid_xml) do
|
328
|
+
let(:response_xml) do
|
317
329
|
<<-EOXML
|
318
330
|
<DadosCartao xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
319
331
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -327,178 +339,96 @@ describe Braspag::CreditCard do
|
|
327
339
|
EOXML
|
328
340
|
end
|
329
341
|
|
330
|
-
it "
|
331
|
-
Braspag::CreditCard.
|
332
|
-
.with("bla")
|
333
|
-
.and_return(false)
|
334
|
-
|
335
|
-
expect {
|
336
|
-
Braspag::CreditCard.info "bla"
|
337
|
-
}.to raise_error(Braspag::InvalidOrderId)
|
338
|
-
end
|
339
|
-
|
340
|
-
it "should raise an error when Braspag returned an invalid xml as response" do
|
341
|
-
FakeWeb.register_uri(:post, info_url, :body => invalid_xml)
|
342
|
-
|
343
|
-
Braspag::CreditCard.should_receive(:info_url)
|
344
|
-
.and_return(info_url)
|
345
|
-
|
346
|
-
expect {
|
347
|
-
Braspag::CreditCard.info("orderid")
|
348
|
-
}.to raise_error(Braspag::UnknownError)
|
349
|
-
end
|
350
|
-
|
351
|
-
it "should return a Hash when Braspag returned a valid xml as response" do
|
352
|
-
FakeWeb.register_uri(:post, info_url, :body => valid_xml)
|
353
|
-
|
354
|
-
Braspag::CreditCard.should_receive(:info_url)
|
355
|
-
.and_return(info_url)
|
356
|
-
|
357
|
-
response = Braspag::CreditCard.info("orderid")
|
358
|
-
response.should be_kind_of Hash
|
359
|
-
|
342
|
+
it "returns the credit card info response" do
|
343
|
+
response = Braspag::CreditCard.info(order_id)
|
360
344
|
response.should == {
|
361
|
-
:checking_number =>
|
362
|
-
:certified =>
|
363
|
-
:autorization_number =>
|
364
|
-
:card_number =>
|
365
|
-
:transaction_number =>
|
345
|
+
:checking_number => '11111',
|
346
|
+
:certified => 'false',
|
347
|
+
:autorization_number => '557593',
|
348
|
+
:card_number => '345678*****0007',
|
349
|
+
:transaction_number => '101001225645'
|
366
350
|
}
|
367
351
|
end
|
368
|
-
end
|
369
352
|
|
370
|
-
|
371
|
-
|
372
|
-
{
|
373
|
-
:order_id => 12345,
|
374
|
-
:customer_name => "AAAAAAAA",
|
375
|
-
:payment_method => :amex_2p,
|
376
|
-
:amount => "100.00",
|
377
|
-
:holder => "Joao Maria Souza",
|
378
|
-
:expiration => "10/12",
|
379
|
-
:card_number => "9" * 10,
|
380
|
-
:security_code => "123",
|
381
|
-
:number_payments => 1,
|
382
|
-
:type => 0
|
383
|
-
}
|
384
|
-
end
|
353
|
+
context "when in production" do
|
354
|
+
let(:environment) { 'production' }
|
355
|
+
let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/pedido.asmx/GetDadosCartao" }
|
385
356
|
|
386
|
-
|
387
|
-
|
388
|
-
it "should raise an error when #{param} is not present" do
|
389
|
-
expect {
|
390
|
-
params[param] = nil
|
391
|
-
Braspag::CreditCard.check_params(params)
|
392
|
-
}.to raise_error Braspag::IncompleteParams
|
357
|
+
it "hits the production path" do
|
358
|
+
Braspag::CreditCard.info(order_id)
|
393
359
|
end
|
394
360
|
end
|
395
361
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
}.to raise_error Braspag::InvalidPaymentMethod
|
411
|
-
end
|
412
|
-
|
413
|
-
it "should raise an error when customer_name is greater than 255 chars" do
|
414
|
-
expect {
|
415
|
-
params[:customer_name] = "b" * 256
|
416
|
-
Braspag::CreditCard.check_params(params)
|
417
|
-
}.to raise_error Braspag::InvalidCustomerName
|
418
|
-
end
|
419
|
-
|
420
|
-
it "should raise an error when holder is greater than 100 chars" do
|
421
|
-
expect {
|
422
|
-
params[:holder] = "r" * 101
|
423
|
-
Braspag::CreditCard.check_params(params)
|
424
|
-
}.to raise_error Braspag::InvalidHolder
|
425
|
-
end
|
426
|
-
|
427
|
-
it "should raise an error when expiration is not in a valid format" do
|
428
|
-
expect {
|
429
|
-
params[:expiration] = "2011/19/19"
|
430
|
-
Braspag::CreditCard.check_params(params)
|
431
|
-
}.to raise_error Braspag::InvalidExpirationDate
|
432
|
-
|
433
|
-
expect {
|
434
|
-
params[:expiration] = "12/2012"
|
435
|
-
Braspag::CreditCard.check_params(params)
|
436
|
-
}.to_not raise_error Braspag::InvalidExpirationDate
|
437
|
-
|
438
|
-
expect {
|
439
|
-
params[:expiration] = "12/12"
|
440
|
-
Braspag::CreditCard.check_params(params)
|
441
|
-
}.to_not raise_error Braspag::InvalidExpirationDate
|
442
|
-
end
|
443
|
-
|
444
|
-
it "should raise an error when security code is greater than 4 chars" do
|
445
|
-
expect {
|
446
|
-
params[:security_code] = "12345"
|
447
|
-
Braspag::CreditCard.check_params(params)
|
448
|
-
}.to raise_error Braspag::InvalidSecurityCode
|
449
|
-
|
450
|
-
expect {
|
451
|
-
params[:security_code] = ""
|
452
|
-
Braspag::CreditCard.check_params(params)
|
453
|
-
}.to raise_error Braspag::InvalidSecurityCode
|
454
|
-
end
|
455
|
-
|
456
|
-
it "should raise an error when number_payments is greater than 99" do
|
457
|
-
expect {
|
458
|
-
params[:number_payments] = 100
|
459
|
-
Braspag::CreditCard.check_params(params)
|
460
|
-
}.to raise_error Braspag::InvalidNumberPayments
|
362
|
+
context "when gateway returns a bad response" do
|
363
|
+
let(:response_xml) do
|
364
|
+
<<-EOXML
|
365
|
+
<DadosCartao xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
366
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
367
|
+
xmlns="http://www.pagador.com.br/">
|
368
|
+
<NumeroComprovante></NumeroComprovante>
|
369
|
+
<Autenticada>false</Autenticada>
|
370
|
+
<NumeroAutorizacao>557593</NumeroAutorizacao>
|
371
|
+
<NumeroCartao>345678*****0007</NumeroCartao>
|
372
|
+
<NumeroTransacao>101001225645</NumeroTransacao>
|
373
|
+
</DadosCartao>
|
374
|
+
EOXML
|
375
|
+
end
|
461
376
|
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
}.to raise_error Braspag::InvalidNumberPayments
|
377
|
+
it "raises an error" do
|
378
|
+
expect { Braspag::CreditCard.info(order_id) }.to raise_error(Braspag::UnknownError)
|
379
|
+
end
|
466
380
|
end
|
467
381
|
end
|
468
382
|
|
469
|
-
describe ".
|
470
|
-
|
471
|
-
|
472
|
-
@connection.should_receive(:production?)
|
473
|
-
.and_return(false)
|
383
|
+
describe ".status" do
|
384
|
+
let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/pedido.asmx/GetDadosPedido" }
|
385
|
+
let(:order_id) { 'order-id' }
|
474
386
|
|
475
|
-
|
387
|
+
let(:response_xml) do
|
388
|
+
<<-EOXML
|
389
|
+
<?xml version="1.0" encoding="utf-8"?>
|
390
|
+
<DadosPedido xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.pagador.com.br/">
|
391
|
+
<CodigoAutorizacao>012543 </CodigoAutorizacao>
|
392
|
+
<CodigoPagamento>42</CodigoPagamento>
|
393
|
+
<FormaPagamento>Redecard Webservice PreAuth</FormaPagamento>
|
394
|
+
<NumeroParcelas>1</NumeroParcelas>
|
395
|
+
<Status>3</Status>
|
396
|
+
<Valor>35.46</Valor>
|
397
|
+
<DataPagamento>2/28/2015 12:00:00 AM</DataPagamento>
|
398
|
+
<DataPedido>2/28/2015 9:56:35 AM</DataPedido>
|
399
|
+
<TransId>0301122</TransId>
|
400
|
+
</DadosPedido>
|
401
|
+
EOXML
|
476
402
|
end
|
477
403
|
|
478
|
-
it "
|
479
|
-
|
480
|
-
|
481
|
-
.and_return(true)
|
482
|
-
|
483
|
-
Braspag::CreditCard.info_url.should == "#{braspag_production_url}/webservices/pagador/pedido.asmx/GetDadosCartao"
|
404
|
+
it "requests the order status" do
|
405
|
+
Braspag::CreditCard.status(order_id)
|
406
|
+
request.body.should == { :numeroPedido => 'order-id', :loja => 'merchant-id' }
|
484
407
|
end
|
485
|
-
end
|
486
408
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
409
|
+
it "returns the status response" do
|
410
|
+
response = Braspag::CreditCard.status(order_id)
|
411
|
+
response.should == {
|
412
|
+
:authorization_code=>'012543 ',
|
413
|
+
:payment_code=>'42',
|
414
|
+
:payment_method=>'Redecard Webservice PreAuth',
|
415
|
+
:installments=>'1',
|
416
|
+
:status=>'3',
|
417
|
+
:value=>'35.46',
|
418
|
+
:payment_date=>'2/28/2015 12:00:00 AM',
|
419
|
+
:order_date=>'2/28/2015 9:56:35 AM',
|
420
|
+
:transaction_id=>'0301122',
|
421
|
+
:error_code=>nil,
|
422
|
+
:error_message=>nil
|
423
|
+
}
|
494
424
|
end
|
495
425
|
|
496
|
-
|
497
|
-
|
426
|
+
context "when the order id is invalid" do
|
427
|
+
let(:order_id) { '' }
|
498
428
|
|
499
|
-
|
500
|
-
|
501
|
-
|
429
|
+
it "raises an error" do
|
430
|
+
expect { Braspag::CreditCard.status(order_id) }.to raise_error(Braspag::InvalidOrderId)
|
431
|
+
end
|
502
432
|
end
|
503
433
|
end
|
504
434
|
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baby-braspag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- baby dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.9.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.9.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.6.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.6.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -98,75 +98,75 @@ dependencies:
|
|
98
98
|
name: fakeweb
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: shoulda-matchers
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: guard-rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: guard-bundler
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: debugger
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
description: baby braspag gem to use Braspag gateway
|
168
168
|
email:
|
169
|
-
-
|
169
|
+
- '"dev-team@baby.com.br"'
|
170
170
|
executables: []
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
@@ -216,12 +216,12 @@ require_paths:
|
|
216
216
|
- lib
|
217
217
|
required_ruby_version: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
|
-
- -
|
219
|
+
- - '>='
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
223
|
requirements:
|
224
|
-
- -
|
224
|
+
- - '>='
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
227
|
requirements: []
|
@@ -242,4 +242,3 @@ test_files:
|
|
242
242
|
- spec/protected_credit_card_spec.rb
|
243
243
|
- spec/spec_helper.rb
|
244
244
|
- spec/utils_spec.rb
|
245
|
-
has_rdoc:
|