spree_core 3.1.11 → 3.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/order.rb +16 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3ebbca771b182322334dbc1ac1fcf3b7c7b18d
|
4
|
+
data.tar.gz: 27576641885f1676dc1e22aba3d720cff12efa41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4bb4bd04f186f04ac802ae24e9e22581e4b487335d73fa82474174b6f8555cff8b5ccd5c687e7b4ddc25982119c4fc67787f0332ced653c6e75f5d77538f78e
|
7
|
+
data.tar.gz: 8a7abab01b4753d4e32d0524414948754890b9a2fbb8d96d0dbe3bdd63857e6d3066c13cf2c5ae4e05feb1f2a4e4cbd486a94d82354cf684ccee9905f238a26d
|
data/app/models/spree/order.rb
CHANGED
@@ -608,6 +608,22 @@ module Spree
|
|
608
608
|
end
|
609
609
|
alias_method :fully_discounted, :fully_discounted?
|
610
610
|
|
611
|
+
def payments_attributes=(attributes)
|
612
|
+
validate_payments_attributes(attributes)
|
613
|
+
super(attributes)
|
614
|
+
end
|
615
|
+
|
616
|
+
def validate_payments_attributes(attributes)
|
617
|
+
# Ensure the payment methods specified are allowed for this user
|
618
|
+
payment_methods = Spree::PaymentMethod.where(id: available_payment_methods.map(&:id))
|
619
|
+
attributes.each do |payment_attributes|
|
620
|
+
payment_method_id = payment_attributes[:payment_method_id]
|
621
|
+
|
622
|
+
# raise RecordNotFound unless it is an allowed payment method
|
623
|
+
payment_methods.find(payment_method_id) if payment_method_id
|
624
|
+
end
|
625
|
+
end
|
626
|
+
|
611
627
|
private
|
612
628
|
|
613
629
|
def link_by_email
|
data/lib/spree/core/version.rb
CHANGED
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|