tray-checkout 0.2.1 → 0.3.0
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/README.rdoc +123 -141
- data/lib/tray/checkout/base_transaction.rb +25 -0
- data/lib/tray/checkout/config.rb +10 -2
- data/lib/tray/checkout/response_parser.rb +22 -14
- data/lib/tray/checkout/temp_transaction.rb +22 -0
- data/lib/tray/checkout/transaction.rb +8 -18
- data/lib/tray/checkout/transaction_params_parser.rb +1 -0
- data/lib/tray/checkout/version.rb +1 -1
- data/lib/tray-checkout.rb +2 -0
- data/spec/spec_helper.rb +1 -2
- data/spec/support/mock_request.rb +2 -1
- data/spec/support/responses/create_failure_validation_errors.xml +10 -48
- data/spec/support/responses/create_success_boleto.xml +35 -75
- data/spec/support/responses/create_temp_transaction_with_token.xml +28 -0
- data/spec/support/responses/get_failure_not_found.xml +4 -4
- data/spec/support/responses/get_success_boleto.xml +36 -76
- data/spec/support/responses/get_success_boleto_without_contacts.xml +37 -67
- data/spec/support/responses/get_success_mastercard.xml +36 -76
- data/spec/support/vcr/model/create_cart.yml +59 -0
- data/spec/support/vcr/model/create_failure_validation_errors.yml +75 -0
- data/spec/support/vcr/model/create_success_boleto.yml +93 -0
- data/spec/support/vcr/model/create_success_mastercard.yml +90 -0
- data/spec/support/vcr/model/get_failure_not_found.yml +72 -0
- data/spec/support/vcr/model/get_success_boleto.yml +114 -0
- data/spec/support/vcr/model/update_cart.yml +59 -0
- data/spec/support/vcr_setup.rb +7 -0
- data/spec/tray/checkout/parser_spec.rb +1 -1
- data/spec/tray/checkout/response_parser_spec.rb +83 -67
- data/spec/tray/checkout/temp_transaction_spec.rb +94 -0
- data/spec/tray/checkout/transaction_spec.rb +146 -23
- data/spec/tray/checkout_spec.rb +2 -2
- data/tray-checkout.gemspec +1 -0
- metadata +77 -14
@@ -3,6 +3,53 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe Tray::Checkout::ResponseParser do
|
5
5
|
describe "#parse" do
|
6
|
+
context "with success response from temp_transaction" do
|
7
|
+
let(:xml) { body_for :create_temp_transaction_with_token }
|
8
|
+
let(:parser) { Tray::Checkout::ResponseParser.new(xml) }
|
9
|
+
let(:response) { parser.parse }
|
10
|
+
|
11
|
+
it "returns success" do
|
12
|
+
response.success?.should be_true
|
13
|
+
end
|
14
|
+
|
15
|
+
context "returns transaction" do
|
16
|
+
{
|
17
|
+
token: "a906bf32cb59060dfc90769524f99d5a",
|
18
|
+
url_car: "\n\t\t\thttp://checkout.sandbox.tray.com.br/payment/car/v1/\n\t\t"
|
19
|
+
}.each do |param, value|
|
20
|
+
it param do
|
21
|
+
response.transaction[param].should == value
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "returns products" do
|
27
|
+
{
|
28
|
+
code: "teste",
|
29
|
+
img: "\n\t\t\t\t\thttp://catnross.com/wp-content/uploads/2011/08/product1.jpg\n\t\t\t\t",
|
30
|
+
sku_code: nil,
|
31
|
+
description: "produto teste",
|
32
|
+
extra: nil,
|
33
|
+
id: 4502,
|
34
|
+
type_product: nil
|
35
|
+
}.each do |param, value|
|
36
|
+
it param do
|
37
|
+
response.transaction[:products].first[param].should == value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
{
|
42
|
+
price_unit: "10.0",
|
43
|
+
quantity: "5.0",
|
44
|
+
weight: "300.0"
|
45
|
+
}.each do |param, value|
|
46
|
+
it param do
|
47
|
+
response.transaction[:products].first[param].to_s.should == value
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
6
53
|
context "with success response" do
|
7
54
|
let(:xml) { body_for :get_success_boleto }
|
8
55
|
let(:parser) { Tray::Checkout::ResponseParser.new(xml) }
|
@@ -17,70 +64,51 @@ describe Tray::Checkout::ResponseParser do
|
|
17
64
|
end
|
18
65
|
|
19
66
|
context "returns transaction" do
|
20
|
-
{
|
21
|
-
|
22
|
-
|
23
|
-
status_name: "
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
price_seller: 30.69,
|
28
|
-
price_additional: 0.00,
|
29
|
-
price_discount: 0.00,
|
30
|
-
shipping_type: "Sedex",
|
31
|
-
shipping_price: 1.23,
|
32
|
-
split: 1,
|
33
|
-
url_notification: "http://prodis.blog.br/tray_notification",
|
34
|
-
transaction_token: nil,
|
35
|
-
transaction_id: nil,
|
36
|
-
status_id: nil
|
67
|
+
{
|
68
|
+
order_number: "1234567",
|
69
|
+
free: "Texto Interno",
|
70
|
+
status_name: "Em Recupera\\xC3\\xA7\\xC3\\xA3o",
|
71
|
+
status: :recovering,
|
72
|
+
id: 3856,
|
73
|
+
token: "4761d2e198ba6b60b45900a4d95482d5"
|
37
74
|
}.each do |param, value|
|
38
75
|
it param do
|
39
76
|
response.transaction[param].should == value
|
40
77
|
end
|
41
78
|
end
|
42
|
-
|
43
|
-
it "date_transaction" do
|
44
|
-
date_transaction = response.transaction[:date_transaction]
|
45
|
-
date_transaction.should be_a(Time)
|
46
|
-
date_transaction.to_s.should == "2012-12-13 02:49:42 UTC"
|
47
|
-
end
|
48
79
|
end
|
49
80
|
|
50
81
|
context "returns payment" do
|
51
|
-
{
|
52
|
-
|
53
|
-
price: 33.21,
|
82
|
+
{
|
83
|
+
tid: nil,
|
54
84
|
split: 1,
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
linha_digitavel: "34191.76007 00075.091140 53021.450001 1 55510000003321",
|
59
|
-
payment_method_id: nil,
|
60
|
-
payment_method_name: nil,
|
61
|
-
price_payment: nil,
|
62
|
-
url_payment: nil,
|
63
|
-
payment_response: nil
|
85
|
+
linha_digitavel: "34191.76007 00536.260144 50565.600009 6 58630000219999",
|
86
|
+
method: :boleto,
|
87
|
+
method_name: "Boleto Bancario"
|
64
88
|
}.each do |param, value|
|
65
89
|
it param do
|
66
90
|
response.payment[param].should == value
|
67
91
|
end
|
68
92
|
end
|
69
93
|
|
70
|
-
{
|
71
|
-
|
94
|
+
{
|
95
|
+
price_original: '2199.99',
|
96
|
+
price: '2199.99'
|
72
97
|
}.each do |param, value|
|
73
98
|
it param do
|
74
|
-
response.payment[param].should be_a(Time)
|
75
99
|
response.payment[param].to_s.should == value
|
76
100
|
end
|
77
101
|
end
|
78
102
|
end
|
79
103
|
|
80
104
|
context "returns customer" do
|
81
|
-
{
|
82
|
-
|
83
|
-
cpf: "
|
105
|
+
{
|
106
|
+
name: "Nome do Cliente",
|
107
|
+
cpf: "98489882380",
|
108
|
+
email: "emaildo@cliente.com.br",
|
109
|
+
company_name: nil,
|
110
|
+
trade_name: nil,
|
111
|
+
cnpj: nil
|
84
112
|
}.each do |param, value|
|
85
113
|
it param do
|
86
114
|
response.customer[param].should == value
|
@@ -88,12 +116,13 @@ describe Tray::Checkout::ResponseParser do
|
|
88
116
|
end
|
89
117
|
|
90
118
|
context "address with" do
|
91
|
-
{
|
92
|
-
|
93
|
-
|
94
|
-
|
119
|
+
{
|
120
|
+
street: "Av Paulista",
|
121
|
+
number: "1001",
|
122
|
+
neighborhood: "Centro",
|
123
|
+
postal_code: "04001001",
|
95
124
|
completion: nil,
|
96
|
-
city: "
|
125
|
+
city: "S\\xC3\\xA3o Paulo",
|
97
126
|
state: "SP"
|
98
127
|
}.each do |param, value|
|
99
128
|
it param do
|
@@ -103,21 +132,10 @@ describe Tray::Checkout::ResponseParser do
|
|
103
132
|
end
|
104
133
|
|
105
134
|
context "contacts with" do
|
106
|
-
[ {
|
107
|
-
number: "
|
108
|
-
|
109
|
-
|
110
|
-
contact_id: nil,
|
111
|
-
value: nil,
|
112
|
-
type_contact: nil
|
113
|
-
},
|
114
|
-
{ id: 348,
|
115
|
-
number: "11987654321",
|
116
|
-
type: :mobile,
|
117
|
-
primary: false,
|
118
|
-
contact_id: nil,
|
119
|
-
value: nil,
|
120
|
-
type_contact: nil
|
135
|
+
[ {
|
136
|
+
number: "11998761234",
|
137
|
+
id: nil,
|
138
|
+
type: :mobile
|
121
139
|
}
|
122
140
|
].each_with_index do |contacts, i|
|
123
141
|
contacts.each do |param, value|
|
@@ -154,8 +172,8 @@ describe Tray::Checkout::ResponseParser do
|
|
154
172
|
end
|
155
173
|
|
156
174
|
context "returns error" do
|
157
|
-
{ code: "
|
158
|
-
message: "
|
175
|
+
{ code: "001001",
|
176
|
+
message: "Token inválido ou não encontrado"
|
159
177
|
}.each do |param, value|
|
160
178
|
it param do
|
161
179
|
response.errors.first[param].should == value
|
@@ -180,10 +198,8 @@ describe Tray::Checkout::ResponseParser do
|
|
180
198
|
end
|
181
199
|
|
182
200
|
context "returns error" do
|
183
|
-
{ code: "
|
184
|
-
message: "não
|
185
|
-
message_complete: "Tipo não pode ficar em branco",
|
186
|
-
field: "person_addresses.type_address"
|
201
|
+
{ code: "13",
|
202
|
+
message: "Tipo de Contato não está incluído na lista"
|
187
203
|
}.each do |param, value|
|
188
204
|
it param do
|
189
205
|
response.errors.first[param].should == value
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Tray::Checkout::TempTransaction do
|
5
|
+
let(:token) { 'a906bf32cb59060dfc90769524f99d5a' }
|
6
|
+
let(:transaction) { Tray::Checkout::TempTransaction.new }
|
7
|
+
let(:params) {
|
8
|
+
{
|
9
|
+
token_account: "8bfe5ddcb77207b",
|
10
|
+
postal_code_seller: "18523698",
|
11
|
+
transaction: {
|
12
|
+
order_number: "1234567",
|
13
|
+
free: "Texto Interno",
|
14
|
+
url_notification: "http://prodis.blog.br/tray_notification",
|
15
|
+
products: [
|
16
|
+
{
|
17
|
+
code: "teste",
|
18
|
+
description: "Notebook Branco",
|
19
|
+
quantity: "1",
|
20
|
+
price_unit: "2199.99",
|
21
|
+
weight: "300",
|
22
|
+
url_img: "http://catnross.com/wp-content/uploads/2011/08/product1.jpg"
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
before :all do
|
30
|
+
Tray::Checkout.environment = :sandbox
|
31
|
+
end
|
32
|
+
|
33
|
+
after :all do
|
34
|
+
Tray::Checkout.environment = :production
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "#cart_url" do
|
38
|
+
context 'when there is a cart created' do
|
39
|
+
let(:transaction) { Tray::Checkout::TempTransaction.new(token) }
|
40
|
+
|
41
|
+
it 'returns the URL' do
|
42
|
+
url = transaction.cart_url
|
43
|
+
|
44
|
+
url.should == "http://checkout.sandbox.tray.com.br/payment/car/v1/#{token}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "when there is no cart created" do
|
49
|
+
it 'returns nil' do
|
50
|
+
url = transaction.cart_url
|
51
|
+
|
52
|
+
url.should == nil
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '#add_to_cart' do
|
58
|
+
context 'when there is a cart created' do
|
59
|
+
let(:transaction) { Tray::Checkout::TempTransaction.new(token) }
|
60
|
+
|
61
|
+
before do
|
62
|
+
params['token_transaction'] = token
|
63
|
+
|
64
|
+
VCR.use_cassette 'model/update_cart' do
|
65
|
+
@response = transaction.add_to_cart(params)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'updates the same cart' do
|
70
|
+
@response.transaction[:token].should == token
|
71
|
+
end
|
72
|
+
|
73
|
+
it "adds quantity to cart's quantity" do
|
74
|
+
@response.transaction[:products].first[:quantity].to_i.should > 1
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context "when there is no cart created" do
|
79
|
+
before do
|
80
|
+
VCR.use_cassette 'model/create_cart' do
|
81
|
+
@response = transaction.add_to_cart(params)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'creates a cart and stores the token' do
|
86
|
+
@response.transaction[:token].should_not == token
|
87
|
+
end
|
88
|
+
|
89
|
+
it "cart's quantity is the same as sent" do
|
90
|
+
@response.transaction[:products].first[:quantity].to_i.should == 1
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -3,12 +3,103 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe Tray::Checkout::Transaction do
|
5
5
|
let(:transaction) { Tray::Checkout::Transaction.new }
|
6
|
+
let(:params) {
|
7
|
+
{
|
8
|
+
token_account: "8bfe5ddcb77207b",
|
9
|
+
customer: {
|
10
|
+
name: "Nome do Cliente",
|
11
|
+
cpf: "12312312312",
|
12
|
+
email: "emaildo@cliente.com.br",
|
13
|
+
birth_date: '01/01/1900'.to_date,
|
14
|
+
sex: :male,
|
15
|
+
marital_status: :single,
|
16
|
+
contacts: [
|
17
|
+
{ type: :mobile,
|
18
|
+
number: "11998761234"
|
19
|
+
}
|
20
|
+
],
|
21
|
+
addresses: [
|
22
|
+
{ type: :billing,
|
23
|
+
street: "Av Paulista",
|
24
|
+
number: "1001",
|
25
|
+
neighborhood: "Centro",
|
26
|
+
postal_code: "04001001",
|
27
|
+
completion: "apto 11",
|
28
|
+
city: "São Paulo",
|
29
|
+
state: "SP"
|
30
|
+
}
|
31
|
+
]
|
32
|
+
},
|
33
|
+
transaction: {
|
34
|
+
available_payment_methods: '6',
|
35
|
+
order_number: "123456789",
|
36
|
+
shipping_type: "Sedex",
|
37
|
+
shipping_price: "15.00",
|
38
|
+
price_discount: "1.00",
|
39
|
+
price_additional: "1.00",
|
40
|
+
url_notification: "http://prodis.blog.br/tray_notification",
|
41
|
+
free: "Texto Interno",
|
42
|
+
sub_store: "2",
|
43
|
+
products: [
|
44
|
+
{
|
45
|
+
description: "Notebook Branco",
|
46
|
+
quantity: "1",
|
47
|
+
price_unit: "1999.99",
|
48
|
+
code: "123",
|
49
|
+
sku_code: "72628",
|
50
|
+
extra: "Produto novo"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
},
|
54
|
+
payment: {
|
55
|
+
method: :mastercard,
|
56
|
+
split: 12,
|
57
|
+
card_name: "Nome Impresso",
|
58
|
+
card_number: "4073020000000002",
|
59
|
+
card_expdate_month: "01",
|
60
|
+
card_expdate_year: "2017",
|
61
|
+
cvv: "123"
|
62
|
+
},
|
63
|
+
affiliates: [
|
64
|
+
{
|
65
|
+
email: "affiliates@test.com",
|
66
|
+
percentage: "1"
|
67
|
+
}
|
68
|
+
]
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
before :all do
|
73
|
+
Tray::Checkout.environment = :sandbox
|
74
|
+
end
|
75
|
+
|
76
|
+
after :all do
|
77
|
+
Tray::Checkout.environment = :production
|
78
|
+
end
|
6
79
|
|
7
80
|
describe "#get" do
|
81
|
+
context "token account is defined on the configuration" do
|
82
|
+
before :each do
|
83
|
+
Tray::Checkout.configure { |config| config.token_account = "8bfe5ddcb77207b" }
|
84
|
+
VCR.use_cassette 'model/get_success_boleto' do
|
85
|
+
@response = transaction.get("4761d2e198ba6b60b45900a4d95482d5")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
it "returns success" do
|
90
|
+
@response.success?.should be_true
|
91
|
+
end
|
92
|
+
|
93
|
+
it "returns the transaction with only one parameter" do
|
94
|
+
@response.transaction[:token].should == "4761d2e198ba6b60b45900a4d95482d5"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
8
98
|
context "when transaction is found" do
|
9
99
|
before :each do
|
10
|
-
|
11
|
-
|
100
|
+
VCR.use_cassette 'model/get_success_boleto' do
|
101
|
+
@response = transaction.get("4761d2e198ba6b60b45900a4d95482d5", "8bfe5ddcb77207b")
|
102
|
+
end
|
12
103
|
end
|
13
104
|
|
14
105
|
it "returns success" do
|
@@ -16,25 +107,25 @@ describe Tray::Checkout::Transaction do
|
|
16
107
|
end
|
17
108
|
|
18
109
|
it "returns transaction data" do
|
19
|
-
@response.transaction[:token].should == "
|
20
|
-
@response.transaction[:id].should ==
|
110
|
+
@response.transaction[:token].should == "4761d2e198ba6b60b45900a4d95482d5"
|
111
|
+
@response.transaction[:id].should == 3856
|
21
112
|
end
|
22
113
|
|
23
114
|
it "returns payment data" do
|
24
115
|
@response.payment[:method_name].should == "Boleto Bancario"
|
25
|
-
@response.payment[:url].should == "http://checkout.sandbox.tray.com.br/payment/billet/d2baa84c13f23addde401c8e1426396e"
|
26
116
|
end
|
27
117
|
|
28
118
|
it "returns customer data" do
|
29
|
-
@response.customer[:name].should == "
|
30
|
-
@response.customer[:email].should == "
|
119
|
+
@response.customer[:name].should == "Nome do Cliente"
|
120
|
+
@response.customer[:email].should == "emaildo@cliente.com.br"
|
31
121
|
end
|
32
122
|
end
|
33
123
|
|
34
124
|
context "when transaction is not found" do
|
35
125
|
before :each do
|
36
|
-
|
37
|
-
|
126
|
+
VCR.use_cassette 'model/get_failure_not_found' do
|
127
|
+
@response = transaction.get("987asd654lkj321qwe098poi", "8bfe5ddcb77207b")
|
128
|
+
end
|
38
129
|
end
|
39
130
|
|
40
131
|
it "does not return success" do
|
@@ -49,10 +140,40 @@ describe Tray::Checkout::Transaction do
|
|
49
140
|
end
|
50
141
|
|
51
142
|
describe "#create" do
|
52
|
-
context "successful" do
|
143
|
+
context "successful payment slip" do
|
144
|
+
before :each do
|
145
|
+
VCR.use_cassette 'model/create_success_boleto' do
|
146
|
+
new_params = params
|
147
|
+
new_params[:payment] = { method: :boleto }
|
148
|
+
|
149
|
+
@response = transaction.create(new_params)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
it "returns success" do
|
154
|
+
@response.success?.should be_true
|
155
|
+
end
|
156
|
+
|
157
|
+
it "returns transaction data" do
|
158
|
+
@response.transaction[:token].should == "756c0bb313b7e86caf59cf8f1ddfb281"
|
159
|
+
@response.transaction[:status].should == :recovering
|
160
|
+
end
|
161
|
+
|
162
|
+
it "returns payment data" do
|
163
|
+
@response.payment[:method].should == :boleto
|
164
|
+
@response.payment[:tid].should == nil
|
165
|
+
end
|
166
|
+
|
167
|
+
it "returns customer data" do
|
168
|
+
@response.customer[:name].should == "Nome do Cliente"
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
context "successful credit card" do
|
53
173
|
before :each do
|
54
|
-
|
55
|
-
|
174
|
+
VCR.use_cassette 'model/create_success_mastercard' do
|
175
|
+
@response = transaction.create(params)
|
176
|
+
end
|
56
177
|
end
|
57
178
|
|
58
179
|
it "returns success" do
|
@@ -60,25 +181,27 @@ describe Tray::Checkout::Transaction do
|
|
60
181
|
end
|
61
182
|
|
62
183
|
it "returns transaction data" do
|
63
|
-
@response.transaction[:token].should == "
|
64
|
-
@response.transaction[:status].should == :
|
184
|
+
@response.transaction[:token].should == "756c0bb313b7e86caf59cf8f1ddfb281"
|
185
|
+
@response.transaction[:status].should == :recovering
|
65
186
|
end
|
66
187
|
|
67
188
|
it "returns payment data" do
|
68
189
|
@response.payment[:method].should == :mastercard
|
69
|
-
@response.payment[:tid].should ==
|
190
|
+
@response.payment[:tid].should == '1233'
|
70
191
|
end
|
71
192
|
|
72
193
|
it "returns customer data" do
|
73
|
-
@response.customer[:name].should == "
|
74
|
-
@response.customer[:email].should == "pedro@bo.com.br"
|
194
|
+
@response.customer[:name].should == "Nome do Cliente"
|
75
195
|
end
|
76
196
|
end
|
77
197
|
|
78
|
-
context "unsuccess" do
|
198
|
+
context "unsuccess payment slip" do
|
79
199
|
before :each do
|
80
|
-
|
81
|
-
|
200
|
+
params[:customer][:contacts][0].delete(:type)
|
201
|
+
|
202
|
+
VCR.use_cassette 'model/create_failure_validation_errors' do
|
203
|
+
@response = transaction.create(params)
|
204
|
+
end
|
82
205
|
end
|
83
206
|
|
84
207
|
it "does not return success" do
|
@@ -86,9 +209,9 @@ describe Tray::Checkout::Transaction do
|
|
86
209
|
end
|
87
210
|
|
88
211
|
it "returns error" do
|
89
|
-
@response.errors.first[:code].should == "
|
90
|
-
@response.errors.first[:message].should == "não
|
91
|
-
@response.errors.first[:message_complete].should == "Tipo não
|
212
|
+
@response.errors.first[:code].should == "13"
|
213
|
+
@response.errors.first[:message].should == "não está incluído na lista"
|
214
|
+
@response.errors.first[:message_complete].should == "Tipo de Contato não está incluído na lista"
|
92
215
|
end
|
93
216
|
end
|
94
217
|
end
|
data/spec/tray/checkout_spec.rb
CHANGED
@@ -43,8 +43,8 @@ describe Tray::Checkout do
|
|
43
43
|
Tray::Checkout.environment.should == :production
|
44
44
|
end
|
45
45
|
|
46
|
-
{ production: "https://api.
|
47
|
-
sandbox: "http://api.sandbox.
|
46
|
+
{ production: "https://api.traycheckout.com.br/",
|
47
|
+
sandbox: "http://api.sandbox.traycheckout.com.br/"
|
48
48
|
}.each do |environment, url|
|
49
49
|
context "when environment is #{environment}" do
|
50
50
|
around do |example|
|
data/tray-checkout.gemspec
CHANGED