stone_ecommerce 1.0.0 → 1.0.2
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.md +1 -7
- data/lib/gateway/Gateway.rb +6 -7
- data/spec/integration/gateway_spec.rb +35 -0
- data/stone_ecommerce.gemspec +1 -1
- metadata +98 -82
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -2,12 +2,7 @@
|
|
2
2
|
|
3
3
|
### Stone Gem Download
|
4
4
|
|
5
|
-
|
6
|
-
```ruby
|
7
|
-
$ gem install stone_ecommerce-#{version_of_release}
|
8
|
-
```
|
9
|
-
<!--
|
10
|
-
https://rubygems.org/gems/
|
5
|
+
https://rubygems.org/gems/stone_ecommerce
|
11
6
|
|
12
7
|
```ruby
|
13
8
|
$ gem install stone_ecommerce
|
@@ -16,7 +11,6 @@ $ gem install stone_ecommerce
|
|
16
11
|
```ruby
|
17
12
|
require 'stone_ecommerce'
|
18
13
|
```
|
19
|
-
-->
|
20
14
|
|
21
15
|
Ruby DevKit is required.
|
22
16
|
|
data/lib/gateway/Gateway.rb
CHANGED
@@ -230,15 +230,14 @@ class Gateway
|
|
230
230
|
retrySaleRequest.RetrySaleCreditCardTransactionCollection.each do |retrySale|
|
231
231
|
r = retrySale.to_json
|
232
232
|
saleHash['RetrySaleCreditCardTransactionCollection'] << r
|
233
|
-
|
234
|
-
if retrySaleRequest.Options.to_json.any?
|
235
|
-
retry_options = retrySaleRequest.Options.to_json
|
236
|
-
saleHash['Options'] = retry_options
|
237
|
-
else
|
238
|
-
saleHash['Options'] = nil
|
239
|
-
end
|
240
233
|
end
|
241
234
|
end
|
235
|
+
if retrySaleRequest.Options.to_json.any?
|
236
|
+
retry_options = retrySaleRequest.Options.to_json
|
237
|
+
saleHash['Options'] = retry_options
|
238
|
+
else
|
239
|
+
saleHash['Options'] = nil
|
240
|
+
end
|
242
241
|
rescue Exception => e
|
243
242
|
return e.message
|
244
243
|
end
|
@@ -309,6 +309,41 @@ RSpec.describe Gateway do
|
|
309
309
|
|
310
310
|
end
|
311
311
|
|
312
|
+
it 'should do a retry method with only order key' do
|
313
|
+
createSaleRequest = CreateSaleRequest.new
|
314
|
+
creditCardTransactionItem = CreditCardTransaction.new
|
315
|
+
creditCardTransactionItem.AmountInCents = 100
|
316
|
+
creditCardTransactionItem.CreditCard.CreditCardBrand = 'Visa'
|
317
|
+
creditCardTransactionItem.CreditCard.CreditCardNumber = '41111111111111'
|
318
|
+
creditCardTransactionItem.CreditCard.ExpMonth = 10
|
319
|
+
creditCardTransactionItem.CreditCard.ExpYear = 22
|
320
|
+
creditCardTransactionItem.CreditCard.HolderName = 'Maria do Carmo'
|
321
|
+
creditCardTransactionItem.CreditCard.SecurityCode = '123'
|
322
|
+
creditCardTransactionItem.CreditCardOperation = 'AuthAndCapture'
|
323
|
+
creditCardTransactionItem.TransactionReference = 'RubySDK-RetryTest'
|
324
|
+
|
325
|
+
createSaleRequest.CreditCardTransactionCollection << creditCardTransactionItem
|
326
|
+
createSaleRequest.Order.OrderReference = 'RubySDK-RetryTest'
|
327
|
+
|
328
|
+
# cria o pedido que sera usado para retentativa
|
329
|
+
responseCreate = gateway.CreateSale(createSaleRequest)
|
330
|
+
|
331
|
+
# pega o orderkey e o transaction key da resposta que sao necessarios para fazer a retentativa
|
332
|
+
orderKey = responseCreate["OrderResult"]["OrderKey"]
|
333
|
+
transactionKey = responseCreate['CreditCardTransactionResultCollection'][0]['TransactionKey']
|
334
|
+
|
335
|
+
retrySaleRequest = RetrySaleRequest.new
|
336
|
+
|
337
|
+
# monta o objeto de retentativa
|
338
|
+
retrySaleRequest.OrderKey = orderKey
|
339
|
+
|
340
|
+
# faz a requisicao de retentativa
|
341
|
+
response = gateway.Retry(retrySaleRequest)
|
342
|
+
|
343
|
+
expect(response['ErrorReport']).to eq nil
|
344
|
+
|
345
|
+
end
|
346
|
+
|
312
347
|
it 'should cancel a transaction' do
|
313
348
|
createSaleRequest = CreateSaleRequest.new
|
314
349
|
creditCardTransactionItem = CreditCardTransaction.new
|
data/stone_ecommerce.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'stone_ecommerce'
|
3
3
|
s.summary = 'Stone Ruby Client Library'
|
4
4
|
s.description = 'Ruby library for integrating with the Stone payment web services.'
|
5
|
-
s.version = '1.0.
|
5
|
+
s.version = '1.0.2' # Major.Minor.Revision
|
6
6
|
s.author = 'Stone Pagamentos'
|
7
7
|
s.email = 'meajuda@stone.com.br'
|
8
8
|
s.homepage = 'http://stone.com.br/'
|
metadata
CHANGED
@@ -1,153 +1,168 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stone_ecommerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Stone Pagamentos
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-11
|
12
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rest-client
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '1.8'
|
20
|
-
- -
|
22
|
+
- - ! '>='
|
21
23
|
- !ruby/object:Gem::Version
|
22
24
|
version: 1.8.0
|
23
25
|
type: :runtime
|
24
26
|
prerelease: false
|
25
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
26
29
|
requirements:
|
27
|
-
- -
|
30
|
+
- - ~>
|
28
31
|
- !ruby/object:Gem::Version
|
29
32
|
version: '1.8'
|
30
|
-
- -
|
33
|
+
- - ! '>='
|
31
34
|
- !ruby/object:Gem::Version
|
32
35
|
version: 1.8.0
|
33
36
|
- !ruby/object:Gem::Dependency
|
34
37
|
name: rspec
|
35
38
|
requirement: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
|
-
- -
|
41
|
+
- - ~>
|
38
42
|
- !ruby/object:Gem::Version
|
39
43
|
version: '3.3'
|
40
|
-
- -
|
44
|
+
- - ! '>='
|
41
45
|
- !ruby/object:Gem::Version
|
42
46
|
version: 3.3.0
|
43
47
|
type: :runtime
|
44
48
|
prerelease: false
|
45
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
46
51
|
requirements:
|
47
|
-
- -
|
52
|
+
- - ~>
|
48
53
|
- !ruby/object:Gem::Version
|
49
54
|
version: '3.3'
|
50
|
-
- -
|
55
|
+
- - ! '>='
|
51
56
|
- !ruby/object:Gem::Version
|
52
57
|
version: 3.3.0
|
53
58
|
- !ruby/object:Gem::Dependency
|
54
59
|
name: nori
|
55
60
|
requirement: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
56
62
|
requirements:
|
57
|
-
- -
|
63
|
+
- - ~>
|
58
64
|
- !ruby/object:Gem::Version
|
59
65
|
version: '2.6'
|
60
|
-
- -
|
66
|
+
- - ! '>='
|
61
67
|
- !ruby/object:Gem::Version
|
62
68
|
version: 2.6.0
|
63
69
|
type: :runtime
|
64
70
|
prerelease: false
|
65
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
66
73
|
requirements:
|
67
|
-
- -
|
74
|
+
- - ~>
|
68
75
|
- !ruby/object:Gem::Version
|
69
76
|
version: '2.6'
|
70
|
-
- -
|
77
|
+
- - ! '>='
|
71
78
|
- !ruby/object:Gem::Version
|
72
79
|
version: 2.6.0
|
73
80
|
- !ruby/object:Gem::Dependency
|
74
81
|
name: gyoku
|
75
82
|
requirement: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
76
84
|
requirements:
|
77
|
-
- -
|
85
|
+
- - ~>
|
78
86
|
- !ruby/object:Gem::Version
|
79
87
|
version: '1.3'
|
80
|
-
- -
|
88
|
+
- - ! '>='
|
81
89
|
- !ruby/object:Gem::Version
|
82
90
|
version: 1.3.1
|
83
91
|
type: :runtime
|
84
92
|
prerelease: false
|
85
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
86
95
|
requirements:
|
87
|
-
- -
|
96
|
+
- - ~>
|
88
97
|
- !ruby/object:Gem::Version
|
89
98
|
version: '1.3'
|
90
|
-
- -
|
99
|
+
- - ! '>='
|
91
100
|
- !ruby/object:Gem::Version
|
92
101
|
version: 1.3.1
|
93
102
|
- !ruby/object:Gem::Dependency
|
94
103
|
name: nokogiri
|
95
104
|
requirement: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
96
106
|
requirements:
|
97
|
-
- -
|
107
|
+
- - ~>
|
98
108
|
- !ruby/object:Gem::Version
|
99
109
|
version: '1.6'
|
100
|
-
- -
|
110
|
+
- - ! '>='
|
101
111
|
- !ruby/object:Gem::Version
|
102
112
|
version: 1.6.6.2
|
103
113
|
type: :runtime
|
104
114
|
prerelease: false
|
105
115
|
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
106
117
|
requirements:
|
107
|
-
- -
|
118
|
+
- - ~>
|
108
119
|
- !ruby/object:Gem::Version
|
109
120
|
version: '1.6'
|
110
|
-
- -
|
121
|
+
- - ! '>='
|
111
122
|
- !ruby/object:Gem::Version
|
112
123
|
version: 1.6.6.2
|
113
124
|
- !ruby/object:Gem::Dependency
|
114
125
|
name: ffi
|
115
126
|
requirement: !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
116
128
|
requirements:
|
117
|
-
- -
|
129
|
+
- - ~>
|
118
130
|
- !ruby/object:Gem::Version
|
119
131
|
version: '1.9'
|
120
|
-
- -
|
132
|
+
- - ! '>='
|
121
133
|
- !ruby/object:Gem::Version
|
122
134
|
version: 1.9.10
|
123
135
|
type: :runtime
|
124
136
|
prerelease: false
|
125
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
126
139
|
requirements:
|
127
|
-
- -
|
140
|
+
- - ~>
|
128
141
|
- !ruby/object:Gem::Version
|
129
142
|
version: '1.9'
|
130
|
-
- -
|
143
|
+
- - ! '>='
|
131
144
|
- !ruby/object:Gem::Version
|
132
145
|
version: 1.9.10
|
133
146
|
- !ruby/object:Gem::Dependency
|
134
147
|
name: bundler
|
135
148
|
requirement: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
136
150
|
requirements:
|
137
|
-
- -
|
151
|
+
- - ~>
|
138
152
|
- !ruby/object:Gem::Version
|
139
153
|
version: '1.10'
|
140
|
-
- -
|
154
|
+
- - ! '>='
|
141
155
|
- !ruby/object:Gem::Version
|
142
156
|
version: 1.10.6
|
143
157
|
type: :runtime
|
144
158
|
prerelease: false
|
145
159
|
version_requirements: !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
146
161
|
requirements:
|
147
|
-
- -
|
162
|
+
- - ~>
|
148
163
|
- !ruby/object:Gem::Version
|
149
164
|
version: '1.10'
|
150
|
-
- -
|
165
|
+
- - ! '>='
|
151
166
|
- !ruby/object:Gem::Version
|
152
167
|
version: 1.10.6
|
153
168
|
description: Ruby library for integrating with the Stone payment web services.
|
@@ -156,92 +171,93 @@ executables: []
|
|
156
171
|
extensions: []
|
157
172
|
extra_rdoc_files: []
|
158
173
|
files:
|
159
|
-
- LICENSE
|
160
174
|
- README.md
|
161
|
-
-
|
162
|
-
- lib/
|
163
|
-
- lib/gateway/Address/delivery_address.rb
|
164
|
-
- lib/gateway/AntiFraud/anti_fraud_analysis_result.rb
|
165
|
-
- lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb
|
166
|
-
- lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb
|
175
|
+
- LICENSE
|
176
|
+
- lib/stone_ecommerce.rb
|
167
177
|
- lib/gateway/BaseRequest.rb
|
168
|
-
- lib/gateway/
|
169
|
-
- lib/gateway/
|
170
|
-
- lib/gateway/BoletoTransaction/boleto_transaction_data.rb
|
171
|
-
- lib/gateway/BoletoTransaction/boleto_transaction_options.rb
|
172
|
-
- lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb
|
173
|
-
- lib/gateway/BoletoTransaction/boleto_transaction_result.rb
|
174
|
-
- lib/gateway/CreditCardTransaction/credit_card.rb
|
175
|
-
- lib/gateway/CreditCardTransaction/credit_card_transaction.rb
|
176
|
-
- lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb
|
177
|
-
- lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb
|
178
|
-
- lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb
|
179
|
-
- lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb
|
180
|
-
- lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb
|
181
|
-
- lib/gateway/ErrorItem.rb
|
178
|
+
- lib/gateway/ShoppingCart/shopping_cart_item.rb
|
179
|
+
- lib/gateway/ShoppingCart/shopping_cart.rb
|
182
180
|
- lib/gateway/ErrorReport.rb
|
183
|
-
- lib/gateway/
|
184
|
-
- lib/gateway/
|
185
|
-
- lib/gateway/
|
181
|
+
- lib/gateway/Parsers/online_debit_transaction_parser.rb
|
182
|
+
- lib/gateway/Parsers/header_parser.rb
|
183
|
+
- lib/gateway/Parsers/credit_card_transaction_parser.rb
|
184
|
+
- lib/gateway/Parsers/trailer_parser.rb
|
185
|
+
- lib/gateway/Parsers/boleto_transaction_parser.rb
|
186
|
+
- lib/gateway/SalesOption.rb
|
187
|
+
- lib/gateway/Trailer.rb
|
186
188
|
- lib/gateway/Merchant/merchant.rb
|
189
|
+
- lib/gateway/Recurrency/recurrency.rb
|
190
|
+
- lib/gateway/ErrorItem.rb
|
187
191
|
- lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb
|
188
192
|
- lib/gateway/Order/order.rb
|
189
193
|
- lib/gateway/Order/order_transaction_report_file.rb
|
190
|
-
- lib/gateway/
|
191
|
-
- lib/gateway/
|
192
|
-
- lib/gateway/
|
193
|
-
- lib/gateway/
|
194
|
-
- lib/gateway/
|
194
|
+
- lib/gateway/InstantBuy/get_instant_buy_data_response.rb
|
195
|
+
- lib/gateway/InstantBuy/credit_card_data.rb
|
196
|
+
- lib/gateway/BaseResponse.rb
|
197
|
+
- lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb
|
198
|
+
- lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb
|
199
|
+
- lib/gateway/AntiFraud/anti_fraud_analysis_result.rb
|
200
|
+
- lib/gateway/address.rb
|
201
|
+
- lib/gateway/Gateway.rb
|
195
202
|
- lib/gateway/Person/buyer.rb
|
196
203
|
- lib/gateway/Person/person.rb
|
197
|
-
- lib/gateway/
|
198
|
-
- lib/gateway/
|
199
|
-
- lib/gateway/
|
200
|
-
- lib/gateway/
|
204
|
+
- lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb
|
205
|
+
- lib/gateway/BoletoTransaction/boleto_transaction_options.rb
|
206
|
+
- lib/gateway/BoletoTransaction/boleto_transaction_result.rb
|
207
|
+
- lib/gateway/BoletoTransaction/boleto_transaction.rb
|
208
|
+
- lib/gateway/BoletoTransaction/boleto_transaction_data.rb
|
209
|
+
- lib/gateway/transaction_report_file.rb
|
201
210
|
- lib/gateway/Sale/manage_sale_response.rb
|
202
|
-
- lib/gateway/Sale/
|
203
|
-
- lib/gateway/Sale/query_sale_response.rb
|
204
|
-
- lib/gateway/Sale/request_data.rb
|
211
|
+
- lib/gateway/Sale/create_sale_response.rb
|
205
212
|
- lib/gateway/Sale/retry_sale_options.rb
|
206
|
-
- lib/gateway/Sale/retry_sale_request.rb
|
207
213
|
- lib/gateway/Sale/retry_sale_response.rb
|
208
214
|
- lib/gateway/Sale/sale_data.rb
|
215
|
+
- lib/gateway/Sale/manage_sale_request.rb
|
216
|
+
- lib/gateway/Sale/request_data.rb
|
217
|
+
- lib/gateway/Sale/retry_sale_request.rb
|
218
|
+
- lib/gateway/Sale/query_sale_response.rb
|
219
|
+
- lib/gateway/Sale/create_sale_request.rb
|
209
220
|
- lib/gateway/Sale/sale_order_data.rb
|
210
|
-
- lib/gateway/
|
211
|
-
- lib/gateway/ShoppingCart/shopping_cart.rb
|
212
|
-
- lib/gateway/ShoppingCart/shopping_cart_item.rb
|
213
|
-
- lib/gateway/Trailer.rb
|
214
|
-
- lib/gateway/address.rb
|
215
|
-
- lib/gateway/header.rb
|
221
|
+
- lib/gateway/Sale/query_sale_request.rb
|
216
222
|
- lib/gateway/post_notification.rb
|
217
|
-
- lib/gateway/
|
218
|
-
- lib/
|
219
|
-
-
|
220
|
-
-
|
223
|
+
- lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb
|
224
|
+
- lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb
|
225
|
+
- lib/gateway/CreditCardTransaction/credit_card_transaction.rb
|
226
|
+
- lib/gateway/CreditCardTransaction/credit_card.rb
|
227
|
+
- lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb
|
228
|
+
- lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb
|
229
|
+
- lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb
|
230
|
+
- lib/gateway/Address/delivery_address.rb
|
231
|
+
- lib/gateway/Address/billing_address.rb
|
232
|
+
- lib/gateway/Address/buyer_address.rb
|
233
|
+
- lib/gateway/header.rb
|
221
234
|
- spec/spec_helper.rb
|
235
|
+
- spec/integration/test_helper.rb
|
236
|
+
- spec/integration/gateway_spec.rb
|
222
237
|
- stone_ecommerce.gemspec
|
223
238
|
homepage: http://stone.com.br/
|
224
239
|
licenses:
|
225
240
|
- Apache 2.0
|
226
|
-
metadata: {}
|
227
241
|
post_install_message:
|
228
242
|
rdoc_options: []
|
229
243
|
require_paths:
|
230
244
|
- lib
|
231
245
|
required_ruby_version: !ruby/object:Gem::Requirement
|
246
|
+
none: false
|
232
247
|
requirements:
|
233
|
-
- -
|
248
|
+
- - ! '>='
|
234
249
|
- !ruby/object:Gem::Version
|
235
250
|
version: 2.1.7
|
236
251
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
|
+
none: false
|
237
253
|
requirements:
|
238
|
-
- -
|
254
|
+
- - ! '>='
|
239
255
|
- !ruby/object:Gem::Version
|
240
256
|
version: '0'
|
241
257
|
requirements: []
|
242
258
|
rubyforge_project:
|
243
|
-
rubygems_version:
|
259
|
+
rubygems_version: 1.8.23
|
244
260
|
signing_key:
|
245
|
-
specification_version:
|
261
|
+
specification_version: 3
|
246
262
|
summary: Stone Ruby Client Library
|
247
263
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 91f4d203c7367b8332d55ebe75722df5a321dbbc
|
4
|
-
data.tar.gz: f9ca97cd8860289c2ed4de2d1e65a311ab5091a9
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 231b484a07318c8bad6a95be1d0f1e798ebbbc07110e1808f6cb3e317b07c98d823c63dcd6f58dfa4a0053dda2521a942e7f9ae0aff0479649826c7d4a03019c
|
7
|
-
data.tar.gz: 8867080b9854aedbcc079611a0622b0f29d342f9ee6f1213e4784b3177377d55b8ae2e93b9aeeb304c4dd05c3082d8e056033885f5be0a7ff7b9fe499ad9a94c
|