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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 47ed17c5959d2c1e1f2210d1881f1322627cd2eb
4
- data.tar.gz: fdccd81627f2e2f086fe2e797d99759328212b1a
2
+ SHA256:
3
+ metadata.gz: ff60269717cc854516bde94a85ab7c708fad2eed35bacdee31933460416c502f
4
+ data.tar.gz: 90e483a9b1da8e55de1eed1a01da9b008a8d6b206f5d0410a006249ba1da89cb
5
5
  SHA512:
6
- metadata.gz: b683d9cd40b4104862c419964f11d09998bf3ba5e7a174fa667ca9e3e53a2b2eec3dae27b78016a5195f4565a1d8f4b50434a976f3dfad311cf90f9f357307ca
7
- data.tar.gz: c606673074120c983143a2118bf2f1e6971443a210df6d617da78e4da0b41f6545dfdfd6a9f317a52e6731083ac78afe75c89d033bdb1d14ed4b16beb669f2e6
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 returnly obtain an estimate, process a return and apply a reimbursement
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.0.0`
17
- - Spree : `~>3.0.1`
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.pre_tax_amount + self.included_tax_total
6
+ self.total_excluding_vat + self.included_tax_total
7
7
  end
8
8
 
9
9
 
10
10
  def amount=(amount)
11
- self.pre_tax_amount = amount - self.included_tax_total
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.pre_tax_amount
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
 
@@ -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|
@@ -1,5 +1,5 @@
1
1
  module Returnly
2
- VERSION = '0.9.0'
2
+ VERSION = '0.10.0'
3
3
 
4
4
  def platform_version
5
5
  defined?(Solidus)
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.9.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: 2017-11-17 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
54
+ version: 2.4.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: solidus_auth_devise
56
+ name: awesome_print
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '1.0'
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: '1.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rails
70
+ name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '5.0'
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: '5.0'
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: erubis
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: minitest
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: awesome_print
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: poltergeist
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: coffee-rails
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: sass-rails
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: database_cleaner
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: factory_girl
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: '3.5'
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: '3.5'
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.37.2
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.37.2
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: 1.4.0
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: 1.4.0
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: with_model
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: byebug
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.4.5.1
421
+ rubygems_version: 2.7.6
380
422
  signing_key:
381
423
  specification_version: 4
382
424
  summary: Returnly integration with Solidus