solidus-returnly 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/refund_methods.rb +5 -10
- data/lib/returnly/refund_presenter.rb +12 -9
- data/lib/returnly/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75f8eee45930bec292d27a3b6fb876f21361b0df
|
4
|
+
data.tar.gz: 425e7dbb0fed050f6762c4b5c766d7e77ac89bbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90d55e4b55a56af2737040bc1c9826fe9ab80269a724a48dd43f133a33152bc7056b101180461959735ec1f9ff12efb8205075b269c1392625569f3c35144b37
|
7
|
+
data.tar.gz: ceeb5f3e0c0f472a213b3e736ed92e86d1b44dc35c56fb475a1e26c99cd87138b3c2d3caebf6a5d71e4db5ae3010d15067fb9ea49d177237236e3b1eb3721c84
|
@@ -7,19 +7,14 @@ module RefundMethods
|
|
7
7
|
|
8
8
|
class_methods do
|
9
9
|
def whitelisted_refund_methods
|
10
|
-
#
|
11
|
-
|
12
|
-
begin
|
13
|
-
methods << payment_method.constantize
|
14
|
-
methods
|
15
|
-
rescue
|
16
|
-
methods
|
17
|
-
end
|
18
|
-
end
|
10
|
+
# Override this methods to whitelist payment methods
|
11
|
+
[]
|
19
12
|
end
|
20
13
|
|
21
14
|
def defined_refund_methods
|
22
|
-
Spree::PaymentMethod.
|
15
|
+
payment_methods = Spree::PaymentMethod.pluck(:type)
|
16
|
+
sorted_payment_methods = payment_methods.reject { |payment_method| payment_method =~ /StoreCredit/ }
|
17
|
+
(sorted_payment_methods | payment_methods).map(&:constantize)
|
23
18
|
end
|
24
19
|
end
|
25
20
|
end
|
@@ -51,20 +51,23 @@ module Returnly
|
|
51
51
|
customer_return = refunder.customer_return
|
52
52
|
|
53
53
|
{
|
54
|
-
refund_id: refunder.order.refunds.last.try(:id),
|
54
|
+
refund_id: refunder.order.reload.refunds.last.try(:id).try(:to_s),
|
55
55
|
line_items: customer_return.return_items.group_by { |ri| ri.inventory_unit.line_item.id }.map do |_, return_items|
|
56
56
|
first_return_item = return_items.first
|
57
57
|
{
|
58
|
-
refund_line_item_id:
|
59
|
-
order_line_item_id:
|
60
|
-
|
61
|
-
|
58
|
+
refund_line_item_id: first_return_item.id.to_s,
|
59
|
+
order_line_item_id: first_return_item.inventory_unit.line_item.id.to_s,
|
60
|
+
units: return_items.size,
|
61
|
+
restock: first_return_item.resellable
|
62
62
|
}
|
63
63
|
end,
|
64
|
-
transactions:
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
transactions: refunder.reimbursement.refunds.map do |refund|
|
65
|
+
{
|
66
|
+
id: refund.transaction_id,
|
67
|
+
amount: refund.amount.to_f,
|
68
|
+
code: refund.payment.source_type.constantize.model_name.human
|
69
|
+
}
|
70
|
+
end
|
68
71
|
}
|
69
72
|
end
|
70
73
|
|
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.7.
|
4
|
+
version: 0.7.1
|
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-10-
|
11
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus
|
@@ -373,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
373
373
|
version: '0'
|
374
374
|
requirements: []
|
375
375
|
rubyforge_project:
|
376
|
-
rubygems_version: 2.
|
376
|
+
rubygems_version: 2.4.5.1
|
377
377
|
signing_key:
|
378
378
|
specification_version: 4
|
379
379
|
summary: Returnly integration with Solidus
|