spree_core 3.3.3 → 3.3.4
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: ef97b18bc947e484d5e2b6af1d3c79d1c4d3acc4
|
4
|
+
data.tar.gz: c544d43cc2f5699ec49ac9809de2b26ca987dfeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21b387e7572157536d6e520802fd4b9832022fd03d2b2ba2edf0be1bb3e84d305ecac88d2fef304253bdc37b67582b4fad6290796be9174c8ce97a6e82cdb591
|
7
|
+
data.tar.gz: a4b127e56df213db4d280012ecf086501619a71c3b8f4a1dc42a6143581b02a50621267f9b8d7322f62821725b99fcb6dd462cc79ce30ef92082569a656203ce
|
data/app/models/spree/order.rb
CHANGED
@@ -622,6 +622,22 @@ module Spree
|
|
622
622
|
promotions.pluck(:code).compact.first
|
623
623
|
end
|
624
624
|
|
625
|
+
def payments_attributes=(attributes)
|
626
|
+
validate_payments_attributes(attributes)
|
627
|
+
super(attributes)
|
628
|
+
end
|
629
|
+
|
630
|
+
def validate_payments_attributes(attributes)
|
631
|
+
# Ensure the payment methods specified are allowed for this user
|
632
|
+
payment_methods = Spree::PaymentMethod.where(id: available_payment_methods.map(&:id))
|
633
|
+
attributes.each do |payment_attributes|
|
634
|
+
payment_method_id = payment_attributes[:payment_method_id]
|
635
|
+
|
636
|
+
# raise RecordNotFound unless it is an allowed payment method
|
637
|
+
payment_methods.find(payment_method_id) if payment_method_id
|
638
|
+
end
|
639
|
+
end
|
640
|
+
|
625
641
|
private
|
626
642
|
|
627
643
|
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.3.
|
4
|
+
version: 3.3.4
|
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
|