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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: 4cc72353166c66ccae00c73721c59ebb1bc4bd38
4
- data.tar.gz: 6ab5cc4910eeb939fe6372df4cdb573aee4ea310
2
+ SHA1:
3
+ metadata.gz: 9b8a1b58bac46347ec265ddf6279427a3e4f4146
4
+ data.tar.gz: b31e86eed6df4e4828c60efca30584a827f9311e
5
5
  SHA512:
6
- metadata.gz: f6e7e9f6027fabba4ef8fdaf143e23fc15bcd8d88af6ef04ad0d958b1d2c85e4a8dfb28ca66e0346c63b2b641197f04b836cf3e9f432c8a112144ff66dd14d8f
7
- data.tar.gz: 49e19fb8ec41b4dc324690dc9c3aeb57ee89a502e95c08af49104de609355ab428e0619ff4f79fdcb2f29e444b0bff3fe7a90eebc4d218e4e71ff9e2a3f05b0b
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
- self.check_params(params)
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(self.authorize_url).do_post(:authorize, data)
44
+ response = Braspag::Poster.new(authorize_url).do_post(:authorize, data)
45
45
 
46
46
  Utils::convert_to_map(response.body, {
47
- :amount => nil,
48
- :number => "authorisationNumber",
49
- :message => 'message',
50
- :return_code => 'returnCode',
51
- :status => 'status',
52
- :transaction_id => "transactionId"
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(self.capture_url).do_post(:capture, data)
67
+ response = Braspag::Poster.new(capture_url).do_post(:capture, data)
68
68
 
69
69
  Utils::convert_to_map(response.body, {
70
- :amount => nil,
71
- :number => "authorisationNumber",
72
- :message => 'message',
73
- :return_code => 'returnCode',
74
- :status => 'status',
75
- :transaction_id => "transactionId"
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(self.partial_capture_url).do_post(:partial_capture, data)
91
+ response = Braspag::Poster.new(partial_capture_url).do_post(:partial_capture, data)
92
92
 
93
93
  Utils::convert_to_map(response.body, {
94
- :amount => nil,
95
- :number => "authorisationNumber",
96
- :message => 'message',
97
- :return_code => 'returnCode',
98
- :status => 'status',
99
- :transaction_id => "transactionId"
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(self.cancellation_url).do_post(:void, data)
114
+ response = Braspag::Poster.new(cancellation_url).do_post(:void, data)
115
115
 
116
116
  Utils::convert_to_map(response.body, {
117
- :amount => nil,
118
- :number => "authorisationNumber",
119
- :message => 'message',
120
- :return_code => 'returnCode',
121
- :status => 'status',
122
- :transaction_id => "transactionId"
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(self.info_url).do_post(:info_credit_card, data)
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
- :checking_number => "NumeroComprovante",
136
- :certified => "Autenticada",
137
- :autorization_number => "NumeroAutorizacao",
138
- :card_number => "NumeroCartao",
139
- :transaction_number => "NumeroTransacao"
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.check_params(params)
147
- super
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
- matches = params[:expiration].to_s.match /^(\d{2})\/(\d{2,4})$/
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
- Date.new(year.to_i, matches[1].to_i)
162
- rescue ArgumentError
163
- raise InvalidExpirationDate
164
- end
151
+ data = { :numeroPedido => order_id, :loja => connection.merchant_id }
165
152
 
166
- raise InvalidSecurityCode if params[:security_code].to_s.size < 1 || params[:security_code].to_s.size > 4
153
+ response = Braspag::Poster.new(status_url).do_post(:order_status, data)
167
154
 
168
- raise InvalidNumberPayments if params[:number_payments].to_i < 1 || params[:number_payments].to_i > 99
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
- def self.info_url
190
- connection = Braspag::Connection.instance
191
- connection.braspag_url + (connection.production? ? PRODUCTION_INFO_URI : HOMOLOGATION_INFO_URI)
192
- end
188
+ class << self
189
+ private
193
190
 
194
- def self.authorize_url
195
- Braspag::Connection.instance.braspag_url + AUTHORIZE_URI
196
- end
191
+ def check_params(params)
192
+ super
197
193
 
198
- def self.capture_url
199
- Braspag::Connection.instance.braspag_url + CAPTURE_URI
200
- end
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
- def self.partial_capture_url
203
- Braspag::Connection.instance.braspag_url + PARTIAL_CAPTURE_URI
204
- end
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
- def self.cancellation_url
207
- Braspag::Connection.instance.braspag_url + CANCELLATION_URI
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
@@ -1,3 +1,3 @@
1
1
  module Braspag
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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(:braspag_homologation_url) { "https://homologacao.pagador.com.br" }
6
- let(:braspag_production_url) { "https://transaction.pagador.com.br" }
7
- let(:merchant_id) { "um id qualquer" }
8
- let(:logger) { mock(:info => nil) }
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
- @connection = mock(:merchant_id => merchant_id, :protected_card_url => 'https://www.cartaoprotegido.com.br/Services/TestEnvironment', :homologation? => false)
12
- Braspag::Connection.stub(:instance => @connection)
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(:params) do
17
- {
18
- :order_id => "um order id",
19
- :customer_name => "W" * 21,
20
- :amount => "100.00",
21
- :payment_method => :redecard,
22
- :holder => "Joao Maria Souza",
23
- :card_number => "9" * 10,
24
- :expiration => "10/12",
25
- :security_code => "123",
26
- :number_payments => 1,
27
- :type => 0
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
- let(:params_with_merchant_id) do
32
- params.merge!(:merchant_id => merchant_id)
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
- let(:authorize_url) { "http://braspag/bla" }
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
- before do
38
- @connection.should_receive(:merchant_id)
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
- Braspag::CreditCard.should_receive(:authorize_url)
41
- .and_return(authorize_url)
100
+ context "when order id is invalid" do
101
+ before { params[:order_id] = '' }
42
102
 
43
- Braspag::CreditCard.should_receive(:check_params)
44
- .and_return(true)
45
- end
103
+ it "raises an error" do
104
+ expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidOrderId)
105
+ end
106
+ end
46
107
 
47
- context "with invalid params"
108
+ context "when payment method is invalid" do
109
+ before { params[:payment_method] = 'invalid' }
48
110
 
49
- context "with valid params" do
50
- let(:valid_xml) do
51
- <<-EOXML
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
- let(:request) { OpenStruct.new :url => authorize_url }
116
+ context "when customer name is too long" do
117
+ before { params[:customer_name] = 'n' * 256 }
67
118
 
68
- before do
69
- Braspag::Connection.instance.should_receive(:homologation?)
70
- ::HTTPI::Request.should_receive(:new).with(authorize_url).and_return(request)
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
- it "should return a Hash" do
75
- response = Braspag::CreditCard.authorize(params)
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
- it "should post transation info" do
88
- Braspag::CreditCard.authorize(params)
89
- request.body.should == {"merchantId"=>"um id qualquer", "order"=>"", "orderId"=>"um order id", "customerName"=>"WWWWWWWWWWWWWWWWWWWWW", "amount"=>"100,00", "paymentMethod"=>20, "holder"=>"Joao Maria Souza", "cardNumber"=>"9999999999", "expiration"=>"10/12", "securityCode"=>"123", "numberPayments"=>1, "typePayment"=>0}
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
- describe ".capture" do
95
- let(:capture_url) { "http://foo.bar/bar/baz" }
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
- before do
99
- @connection.should_receive(:merchant_id)
100
- end
135
+ it "raises an error" do
136
+ expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidExpirationDate)
137
+ end
138
+ end
101
139
 
102
- context "invalid order id" do
103
- it "should raise an error" do
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
- expect {
109
- Braspag::CreditCard.capture(order_id)
110
- }.to raise_error(Braspag::InvalidOrderId)
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
- context "valid order id" do
115
- let(:valid_xml) do
116
- <<-EOXML
117
- <?xml version="1.0" encoding="utf-8"?>
118
- <PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
119
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
120
- xmlns="https://www.pagador.com.br/webservice/pagador">
121
- <amount>2</amount>
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
- let(:request) { OpenStruct.new :url => capture_url }
158
+ context "when security code is too long" do
159
+ before { params[:security_code] = '12345' }
130
160
 
131
- before do
132
- Braspag::CreditCard.should_receive(:capture_url)
133
- .and_return(capture_url)
161
+ it "raises an error" do
162
+ expect { Braspag::CreditCard.authorize(params) }.to raise_error(Braspag::InvalidSecurityCode)
163
+ end
164
+ end
134
165
 
135
- ::HTTPI::Request.should_receive(:new)
136
- .with(capture_url)
137
- .and_return(request)
166
+ context "when security code is too short" do
167
+ before { params[:security_code] = '' }
138
168
 
139
- ::HTTPI.should_receive(:post)
140
- .with(request)
141
- .and_return(mock(:body => valid_xml))
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
- it "should return a Hash" do
145
- response = Braspag::CreditCard.capture("order id qualquer")
146
- response.should be_kind_of Hash
147
- response.should == {
148
- :amount => "2",
149
- :number => nil,
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
- it "should post capture info" do
158
- Braspag::CreditCard.capture("order id qualquer")
159
- request.body.should == {"orderId"=>"order id qualquer", "merchantId"=>"um id qualquer"}
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 ".partial_capture" do
165
- let(:partial_capture_url) { "http://foo.bar/bar/partial" }
166
- let(:order_id) { "um id qualquer" }
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
- before do
169
- @connection.should_receive(:merchant_id)
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
- context "invalid order id" do
173
- it "should raise an error" do
174
- Braspag::CreditCard.should_receive(:valid_order_id?)
175
- .with(order_id)
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
- expect {
179
- Braspag::CreditCard.partial_capture(order_id, 10.0)
180
- }.to raise_error(Braspag::InvalidOrderId)
181
- end
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 "valid order id" do
185
- let(:valid_xml) do
186
- <<-EOXML
187
- <?xml version="1.0" encoding="utf-8"?>
188
- <PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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
- let(:request) { OpenStruct.new :url => partial_capture_url }
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
- before do
202
- Braspag::CreditCard.should_receive(:partial_capture_url)
203
- .and_return(partial_capture_url)
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
- ::HTTPI::Request.should_receive(:new)
206
- .with(partial_capture_url)
207
- .and_return(request)
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
- ::HTTPI.should_receive(:post)
210
- .with(request)
211
- .and_return(mock(:body => valid_xml))
212
- end
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
- it "should return a Hash" do
215
- response = Braspag::CreditCard.partial_capture("order id qualquer", 10.0)
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 "should post capture info" do
228
- Braspag::CreditCard.partial_capture("order id qualquer", 10.0)
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(:cancellation_url) { "http://foo.bar/bar/baz" }
236
- let(:order_id) { "um id qualquer" }
281
+ let(:operation_url) { "#{connection.braspag_url}/webservices/pagador/Pagador.asmx/VoidTransaction" }
282
+ let(:order_id) { 'order-id' }
237
283
 
238
- before do
239
- @connection.should_receive(:merchant_id)
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
- context "invalid order id" do
243
- it "should raise an error" do
244
- Braspag::CreditCard.should_receive(:valid_order_id?)
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
- context "valid order id" do
255
- let(:valid_xml) do
256
- <<-EOXML
257
- <?xml version="1.0" encoding="utf-8"?>
258
- <PagadorReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
259
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
260
- xmlns="https://www.pagador.com.br/webservice/pagador">
261
- <amount>2</amount>
262
- <message>Approved</message>
263
- <returnCode>0</returnCode>
264
- <status>0</status>
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
- it "should return a Hash" do
280
- response = Braspag::CreditCard.void("order id qualquer")
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 "should post void info" do
293
- Braspag::CreditCard.void("order id qualquer")
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(:info_url) { "http://braspag/bla" }
325
+ let(:operation_url) { "#{connection.braspag_url}/pagador/webservice/pedido.asmx/GetDadosCartao" }
326
+ let(:order_id) { 'order-id' }
301
327
 
302
- let(:invalid_xml) do
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 "should raise an error when order id is not valid" do
331
- Braspag::CreditCard.should_receive(:valid_order_id?)
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 => "11111",
362
- :certified => "false",
363
- :autorization_number => "557593",
364
- :card_number => "345678*****0007",
365
- :transaction_number => "101001225645"
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
- describe ".check_params" do
371
- let(:params) do
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
- [:order_id, :amount, :payment_method, :customer_name, :holder, :card_number, :expiration,
387
- :security_code, :number_payments, :type].each do |param|
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
- it "should raise an error when order_id is not valid" do
397
- Braspag::CreditCard.should_receive(:valid_order_id?)
398
- .with(params[:order_id])
399
- .and_return(false)
400
-
401
- expect {
402
- Braspag::CreditCard.check_params(params)
403
- }.to raise_error Braspag::InvalidOrderId
404
- end
405
-
406
- it "should raise an error when payment_method is not invalid" do
407
- expect {
408
- params[:payment_method] = "non ecziste"
409
- Braspag::CreditCard.check_params(params)
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
- expect {
463
- params[:number_payments] = 0
464
- Braspag::CreditCard.check_params(params)
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 ".info_url" do
470
- it "should return the correct info url when connection environment is homologation" do
471
- @connection.stub(:braspag_url => braspag_homologation_url)
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
- Braspag::CreditCard.info_url.should == "#{braspag_homologation_url}/pagador/webservice/pedido.asmx/GetDadosCartao"
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 "should return the correct info url when connection environment is production" do
479
- @connection.stub(:braspag_url => braspag_production_url)
480
- @connection.should_receive(:production?)
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
- describe ".authorize_url .capture_url .cancellation_url" do
488
- it "should return the correct credit card creation url when connection environment is homologation" do
489
- @connection.stub(:braspag_url => braspag_homologation_url)
490
-
491
- Braspag::CreditCard.authorize_url.should == "#{braspag_homologation_url}/webservices/pagador/Pagador.asmx/Authorize"
492
- Braspag::CreditCard.capture_url.should == "#{braspag_homologation_url}/webservices/pagador/Pagador.asmx/Capture"
493
- Braspag::CreditCard.cancellation_url.should == "#{braspag_homologation_url}/webservices/pagador/Pagador.asmx/VoidTransaction"
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
- it "should return the correct credit card creation url when connection environment is production" do
497
- @connection.stub(:braspag_url => braspag_production_url)
426
+ context "when the order id is invalid" do
427
+ let(:order_id) { '' }
498
428
 
499
- Braspag::CreditCard.authorize_url.should == "#{braspag_production_url}/webservices/pagador/Pagador.asmx/Authorize"
500
- Braspag::CreditCard.capture_url.should == "#{braspag_production_url}/webservices/pagador/Pagador.asmx/Capture"
501
- Braspag::CreditCard.cancellation_url.should == "#{braspag_production_url}/webservices/pagador/Pagador.asmx/VoidTransaction"
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.3.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: 2014-12-19 00:00:00.000000000 Z
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
- - ! '"dev-team@baby.com.br"'
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: