solidus-returnly 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -3
- data/app/models/spree/return_item_decorator.rb +2 -2
- data/lib/returnly/builders/return_item.rb +4 -0
- data/lib/returnly/refund_calculator.rb +5 -3
- data/lib/returnly/refund_presenter.rb +2 -2
- data/lib/returnly/refunder.rb +1 -1
- data/lib/returnly/version.rb +1 -1
- metadata +83 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ff60269717cc854516bde94a85ab7c708fad2eed35bacdee31933460416c502f
|
4
|
+
data.tar.gz: 90e483a9b1da8e55de1eed1a01da9b008a8d6b206f5d0410a006249ba1da89cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f273e4f016e1eb454eccb16a9cbfecfd3260069a70f90fca9a56a8e7ec23944dc2cbe10553f267fc644646c70eedd1b8d1f35f178720438599a79b99de3aeb72
|
7
|
+
data.tar.gz: 373866d8194a4f50077d3e35d005ffaed3f037b666092a4108116db6efec2417809153b1d3d463511d061c393ea5c0ae0c6ccfffebfadf7a9207b447cfb0f0f5
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Solidus Returnly
|
2
2
|
===============
|
3
3
|
|
4
|
-
This gem adds the required APIs to allow
|
4
|
+
This gem adds the required APIs to allow Returnly to obtain an estimate, process a return, and apply a reimbursement
|
5
5
|
|
6
6
|
|
7
7
|
Spree/Solidus
|
@@ -13,8 +13,8 @@ $ rake both_releases
|
|
13
13
|
this will generate two packages, `solidus-returnly` and `spree-returnly`
|
14
14
|
|
15
15
|
Current Compat Versions:
|
16
|
-
- Solidus : `~>2.
|
17
|
-
- Spree : `~>3.0
|
16
|
+
- Solidus : `~> 2.4.0`
|
17
|
+
- Spree : `~> 3.1.0`
|
18
18
|
|
19
19
|
Installation
|
20
20
|
------------
|
@@ -3,12 +3,12 @@ Spree::ReturnItem.class_eval do
|
|
3
3
|
attr_accessor :amount
|
4
4
|
|
5
5
|
def amount
|
6
|
-
self.
|
6
|
+
self.total_excluding_vat + self.included_tax_total
|
7
7
|
end
|
8
8
|
|
9
9
|
|
10
10
|
def amount=(amount)
|
11
|
-
self.
|
11
|
+
self.total_excluding_vat = amount - self.included_tax_total
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -20,6 +20,10 @@ module Returnly
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def build_for_estimate(requested_line_items)
|
24
|
+
build_by_requested_line_items(requested_line_items)
|
25
|
+
end
|
26
|
+
|
23
27
|
def build_by_inventory_unit(inventory_unit, options = {})
|
24
28
|
Spree::ReturnItem.new(
|
25
29
|
amount: inventory_unit.line_item.price,
|
@@ -20,8 +20,8 @@ module Returnly
|
|
20
20
|
(line_item.adjustments.tax.sum(&:amount).to_d / line_item.quantity).round(2, :down)
|
21
21
|
end
|
22
22
|
|
23
|
-
def line_items_return_items
|
24
|
-
available_return_items.each_with_object({}) do |return_item, return_items|
|
23
|
+
def line_items_return_items(is_estimate)
|
24
|
+
available_return_items(is_estimate).each_with_object({}) do |return_item, return_items|
|
25
25
|
line_item_id = return_item.inventory_unit.line_item_id
|
26
26
|
return_items[line_item_id] ||= []
|
27
27
|
return_items[line_item_id] << set_tax(return_item)
|
@@ -35,7 +35,9 @@ module Returnly
|
|
35
35
|
|
36
36
|
protected
|
37
37
|
|
38
|
-
def available_return_items
|
38
|
+
def available_return_items(is_estimate)
|
39
|
+
return self.class.return_item_builder_class.new(order).build_for_estimate(line_items) if is_estimate
|
40
|
+
|
39
41
|
self.class.return_item_builder_class.new(order).build_by_requested_line_items(line_items)
|
40
42
|
end
|
41
43
|
|
@@ -5,8 +5,8 @@ module Returnly
|
|
5
5
|
sub_total = Money.new 0
|
6
6
|
tax = Money.new 0
|
7
7
|
|
8
|
-
calculator.line_items_return_items.values.flatten.each do |return_item|
|
9
|
-
sub_total += Money.from_amount return_item.
|
8
|
+
calculator.line_items_return_items(true).values.flatten.each do |return_item|
|
9
|
+
sub_total += Money.from_amount return_item.total_excluding_vat
|
10
10
|
tax += Money.from_amount calculator.line_item_tax(return_item.inventory_unit.line_item)
|
11
11
|
end
|
12
12
|
|
data/lib/returnly/refunder.rb
CHANGED
@@ -95,7 +95,7 @@ module Returnly
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def each_return_item
|
98
|
-
return_items = refund_calculator.line_items_return_items.values.flatten
|
98
|
+
return_items = refund_calculator.line_items_return_items(false).values.flatten
|
99
99
|
self.customer_return = Returnly::Builders::CustomerReturn.build_by_return_items(return_items)
|
100
100
|
|
101
101
|
return_items.each do |return_item|
|
data/lib/returnly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus-returnly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Returnly Technologies, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.4.0
|
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
|
-
version:
|
26
|
+
version: 2.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solidus_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.4.0
|
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
|
-
version:
|
40
|
+
version: 2.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: solidus_api
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 2.4.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 2.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: awesome_print
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: byebug
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
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
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: capybara
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: coffee-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: database_cleaner
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: erubis
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: factory_girl
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: ffaker
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: minitest
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - ">="
|
@@ -179,7 +179,7 @@ dependencies:
|
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
182
|
+
name: poltergeist
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - ">="
|
@@ -193,7 +193,7 @@ dependencies:
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
196
|
+
name: rails
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - ">="
|
@@ -210,44 +210,58 @@ dependencies:
|
|
210
210
|
name: rspec-rails
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - "
|
213
|
+
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
215
|
+
version: '0'
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- - "
|
220
|
+
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
222
|
+
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rubocop
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
|
-
- -
|
227
|
+
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 0
|
229
|
+
version: '0'
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
|
-
- -
|
234
|
+
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 0
|
236
|
+
version: '0'
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: rubocop-rspec
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- -
|
241
|
+
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
243
|
+
version: '0'
|
244
244
|
type: :development
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
|
-
- -
|
248
|
+
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
250
|
+
version: '0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: sass-rails
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
251
265
|
- !ruby/object:Gem::Dependency
|
252
266
|
name: simplecov
|
253
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,6 +276,20 @@ dependencies:
|
|
262
276
|
- - ">="
|
263
277
|
- !ruby/object:Gem::Version
|
264
278
|
version: '0'
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: solidus_auth_devise
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - ">="
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '0'
|
286
|
+
type: :development
|
287
|
+
prerelease: false
|
288
|
+
version_requirements: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - ">="
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: '0'
|
265
293
|
- !ruby/object:Gem::Dependency
|
266
294
|
name: sqlite3
|
267
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,7 +305,7 @@ dependencies:
|
|
277
305
|
- !ruby/object:Gem::Version
|
278
306
|
version: '0'
|
279
307
|
- !ruby/object:Gem::Dependency
|
280
|
-
name:
|
308
|
+
name: versioncake
|
281
309
|
requirement: !ruby/object:Gem::Requirement
|
282
310
|
requirements:
|
283
311
|
- - ">="
|
@@ -291,7 +319,7 @@ dependencies:
|
|
291
319
|
- !ruby/object:Gem::Version
|
292
320
|
version: '0'
|
293
321
|
- !ruby/object:Gem::Dependency
|
294
|
-
name:
|
322
|
+
name: with_model
|
295
323
|
requirement: !ruby/object:Gem::Requirement
|
296
324
|
requirements:
|
297
325
|
- - ">="
|
@@ -318,6 +346,20 @@ dependencies:
|
|
318
346
|
- - ">="
|
319
347
|
- !ruby/object:Gem::Version
|
320
348
|
version: '0'
|
349
|
+
- !ruby/object:Gem::Dependency
|
350
|
+
name: pry
|
351
|
+
requirement: !ruby/object:Gem::Requirement
|
352
|
+
requirements:
|
353
|
+
- - ">="
|
354
|
+
- !ruby/object:Gem::Version
|
355
|
+
version: '0'
|
356
|
+
type: :development
|
357
|
+
prerelease: false
|
358
|
+
version_requirements: !ruby/object:Gem::Requirement
|
359
|
+
requirements:
|
360
|
+
- - ">="
|
361
|
+
- !ruby/object:Gem::Version
|
362
|
+
version: '0'
|
321
363
|
description: Solidus API extensions for returnly
|
322
364
|
email: support@returnly.com
|
323
365
|
executables: []
|
@@ -376,7 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
376
418
|
version: '0'
|
377
419
|
requirements: []
|
378
420
|
rubyforge_project:
|
379
|
-
rubygems_version: 2.
|
421
|
+
rubygems_version: 2.7.6
|
380
422
|
signing_key:
|
381
423
|
specification_version: 4
|
382
424
|
summary: Returnly integration with Solidus
|