spree_core 3.4.5 → 3.4.6
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3186ecc9fcd800b68cd881887ef41fd1512a7b96215d601b013200f1b4c0e3c0
|
4
|
+
data.tar.gz: ba34e2b2b2ae15e75e45aea3b8d397459f91f2019895de3a8a51d20e059c5c7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbabac3389a37851c3ca6b4c6814267f6d7117d8212b9035da4b9f5b9202d5b36b3b186b337a473cf80019115baba71236c1398d7599f865d43befd16a8d009f
|
7
|
+
data.tar.gz: c3bbc7170c4173d76201321e8e5003e502e6b657b817cd21a44e0d324f775a102ef881ecfa6ce906235a7f74717a23eb2cd735b3ead142a817e198a2363a6680
|
@@ -29,7 +29,7 @@ module Spree
|
|
29
29
|
# a new pending payment record for the remaining amount to capture later.
|
30
30
|
def capture!(amount = nil)
|
31
31
|
return true if completed?
|
32
|
-
amount ||= money.
|
32
|
+
amount ||= money.amount_in_cents
|
33
33
|
started_processing!
|
34
34
|
protect_from_connection_error do
|
35
35
|
# Standard ActiveMerchant capture usage
|
@@ -114,7 +114,7 @@ module Spree
|
|
114
114
|
|
115
115
|
def gateway_action(source, action, success_state)
|
116
116
|
protect_from_connection_error do
|
117
|
-
response = payment_method.send(action, money.
|
117
|
+
response = payment_method.send(action, money.amount_in_cents,
|
118
118
|
source,
|
119
119
|
gateway_options)
|
120
120
|
handle_response(response, success_state, :failure)
|
@@ -31,20 +31,12 @@ module Spree
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def actionable?(line_item)
|
34
|
-
|
35
|
-
|
34
|
+
product_id = line_item.product.id
|
35
|
+
option_values_ids = line_item.variant.option_value_ids
|
36
|
+
eligible_product_ids = preferred_eligible_values.keys
|
37
|
+
eligible_value_ids = preferred_eligible_values[product_id]
|
36
38
|
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def product_ids
|
43
|
-
preferred_eligible_values.keys
|
44
|
-
end
|
45
|
-
|
46
|
-
def value_ids(product_id)
|
47
|
-
preferred_eligible_values[product_id]
|
39
|
+
eligible_product_ids.include?(product_id) && (eligible_value_ids & option_values_ids).present?
|
48
40
|
end
|
49
41
|
end
|
50
42
|
end
|
data/app/models/spree/refund.rb
CHANGED
@@ -43,7 +43,7 @@ module Spree
|
|
43
43
|
def perform!
|
44
44
|
return true if transaction_id.present?
|
45
45
|
|
46
|
-
credit_cents = Spree::Money.new(amount.to_f, currency: payment.currency).
|
46
|
+
credit_cents = Spree::Money.new(amount.to_f, currency: payment.currency).amount_in_cents
|
47
47
|
|
48
48
|
@response = process!(credit_cents)
|
49
49
|
|
data/lib/spree/core/engine.rb
CHANGED
@@ -116,12 +116,12 @@ module Spree
|
|
116
116
|
end
|
117
117
|
|
118
118
|
config.to_prepare do
|
119
|
-
#
|
120
|
-
I18n.load_path
|
119
|
+
# Ensure spree locale paths are present before decorators
|
120
|
+
I18n.load_path.unshift(*(Dir.glob(
|
121
121
|
File.join(
|
122
122
|
File.dirname(__FILE__), '../../../config/locales', '*.{rb,yml}'
|
123
123
|
)
|
124
|
-
)
|
124
|
+
) - I18n.load_path))
|
125
125
|
|
126
126
|
# Load application's model / class decorators
|
127
127
|
Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
|
data/lib/spree/core/version.rb
CHANGED
data/lib/spree/money.rb
CHANGED
@@ -15,13 +15,17 @@ module Spree
|
|
15
15
|
|
16
16
|
attr_reader :money
|
17
17
|
|
18
|
-
delegate :cents, to: :money
|
18
|
+
delegate :cents, :currency, to: :money
|
19
19
|
|
20
20
|
def initialize(amount, options = {})
|
21
21
|
@money = Monetize.parse([amount, (options[:currency] || Spree::Config[:currency])].join)
|
22
22
|
@options = Spree::Money.default_formatting_rules.merge(options)
|
23
23
|
end
|
24
24
|
|
25
|
+
def amount_in_cents
|
26
|
+
(cents / currency.subunit_to_unit.to_f * 100).round
|
27
|
+
end
|
28
|
+
|
25
29
|
def to_s
|
26
30
|
@money.format(@options)
|
27
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -984,8 +984,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
984
984
|
- !ruby/object:Gem::Version
|
985
985
|
version: 1.8.23
|
986
986
|
requirements: []
|
987
|
-
|
988
|
-
rubygems_version: 2.6.12
|
987
|
+
rubygems_version: 3.0.2
|
989
988
|
signing_key:
|
990
989
|
specification_version: 4
|
991
990
|
summary: The bare bones necessary for Spree.
|