spree_core 3.1.12 → 3.1.13
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7568a6b4ed997ff5d99042e84358b08ec25554a4
|
4
|
+
data.tar.gz: f2ac9e4517f5fb96c8b8a0a0f9200c2c355ab698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d16c88f57a2e168618e2e1fd68fb7d498d2ccd536b08bfff9dd8c705e02dcf7f7ca2a3bf0ec98ce9381e6ca2bcb88908e2cf33047003278ee981bd829f8f5b
|
7
|
+
data.tar.gz: ea5ad4e14b89144564066c400e0f36f9faeafedfb6c7b8041e72ef67e460a023244b4d42471c7b95448cd974385b3fae07ac07ca12a29f90c4a409903e8593ff
|
@@ -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
|
@@ -115,7 +115,7 @@ module Spree
|
|
115
115
|
|
116
116
|
def gateway_action(source, action, success_state)
|
117
117
|
protect_from_connection_error do
|
118
|
-
response = payment_method.send(action, money.
|
118
|
+
response = payment_method.send(action, money.amount_in_cents,
|
119
119
|
source,
|
120
120
|
gateway_options)
|
121
121
|
handle_response(response, success_state, :failure)
|
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
@@ -115,12 +115,13 @@ module Spree
|
|
115
115
|
end
|
116
116
|
|
117
117
|
config.to_prepare do
|
118
|
-
#
|
119
|
-
I18n.load_path
|
118
|
+
# Ensure spree locale paths are present before decorators
|
119
|
+
I18n.load_path.unshift(*(Dir.glob(
|
120
120
|
File.join(
|
121
121
|
File.dirname(__FILE__), '../../../config/locales', '*.{rb,yml}'
|
122
122
|
)
|
123
|
-
)
|
123
|
+
) - I18n.load_path))
|
124
|
+
|
124
125
|
# Load application's model / class decorators
|
125
126
|
Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
|
126
127
|
Rails.configuration.cache_classes ? require(c) : load(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
|
@@ -40,6 +44,16 @@ module Spree
|
|
40
44
|
to_s
|
41
45
|
end
|
42
46
|
|
47
|
+
def decimal_mark
|
48
|
+
return @money.decimal_mark if @options[:decimal_mark].nil?
|
49
|
+
@options[:decimal_mark]
|
50
|
+
end
|
51
|
+
|
52
|
+
def thousands_separator
|
53
|
+
return @money.thousands_separator if @options[:thousands_separator].nil?
|
54
|
+
@options[:thousands_separator]
|
55
|
+
end
|
56
|
+
|
43
57
|
def ==(obj)
|
44
58
|
@money == obj.money
|
45
59
|
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.1.
|
4
|
+
version: 3.1.13
|
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: 2018-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -971,7 +971,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
971
971
|
version: 1.8.23
|
972
972
|
requirements: []
|
973
973
|
rubyforge_project:
|
974
|
-
rubygems_version: 2.6.
|
974
|
+
rubygems_version: 2.6.10
|
975
975
|
signing_key:
|
976
976
|
specification_version: 4
|
977
977
|
summary: The bare bones necessary for Spree.
|