spree_core 3.4.2 → 3.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68cb55c21ddd24f8248dca5549bc6cdb7ce2460c
4
- data.tar.gz: b4ca12837622c5f82832b9e7e074e5b77a2fb294
3
+ metadata.gz: b40b001a02d80dd28675476b606bad24d0b6ca37
4
+ data.tar.gz: ef12f4025bdf9dccc1f6c309fd8e10e60afddd4b
5
5
  SHA512:
6
- metadata.gz: 0eae5883047bcd05bae1feeb7f6cd1bea296466e28a2b12311f4dddb5c1d7c380e9a60844dfa91e017979bce09f4e85c1d689de4f104a4161b4d1c83acbc2a2f
7
- data.tar.gz: a32117843440c4a5c6233bc52feac36293bdaf34ae3568c06df67901c2f4fa3b973d56346bb7a620ef4bef93a850fa517cbea09ff1a95fbf74eded59003a2007
6
+ metadata.gz: c0e5fe4e45e6f9a80ec20e7fdbd8a3f289b98de4a6b5f729c149e39796bfa04dfaaf8c9d98725e8754faa4a0eb6ad77090f5dd505d60a983aa12426e168f3cc7
7
+ data.tar.gz: 80a5b7eccac0e49e8cd5d287d8dff818a1965086476b6b2fb440a9c7bdc8a5d87f4c2f59d81d3500dc978cdaf74f350a0e7c01d4382af564122203515d4b62e4
@@ -620,6 +620,22 @@ module Spree
620
620
  promotions.pluck(:code).compact.first
621
621
  end
622
622
 
623
+ def payments_attributes=(attributes)
624
+ validate_payments_attributes(attributes)
625
+ super(attributes)
626
+ end
627
+
628
+ def validate_payments_attributes(attributes)
629
+ # Ensure the payment methods specified are allowed for this user
630
+ payment_methods = Spree::PaymentMethod.where(id: available_payment_methods.map(&:id))
631
+ attributes.each do |payment_attributes|
632
+ payment_method_id = payment_attributes[:payment_method_id]
633
+
634
+ # raise RecordNotFound unless it is an allowed payment method
635
+ payment_methods.find(payment_method_id) if payment_method_id
636
+ end
637
+ end
638
+
623
639
  private
624
640
 
625
641
  def link_by_email
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '3.4.2'
3
+ '3.4.3'
4
4
  end
5
5
  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.2
4
+ version: 3.4.3
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-08 00:00:00.000000000 Z
11
+ date: 2017-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant