spree_core 3.2.6 → 3.2.7

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: 29390ea0bd0ed2b5069fcab5125778fa23d316cc
4
- data.tar.gz: 5079c2417a09e239ee60bbd9a37861e451e8ca46
3
+ metadata.gz: b966f0b41c17b1b0397491803b4f3f475f472375
4
+ data.tar.gz: bf70f58208a09a564a5b337b3a2b84cad71e27d3
5
5
  SHA512:
6
- metadata.gz: d03cbdee9e12a5497437798a6aada084762a7721793228a3bee3a6a842d84a93c8dbddcad7b9bfa1ce9ffa4c176fb0174182c7811c031eca81039c37608f695b
7
- data.tar.gz: 3258f0cf50c6d9eaa892e7c41a663d2a50ea804774189a9e615bbbc2d28087d008cbfdeb37d304a130d0fdd528cf5a9a6a8c1e6336158687d1fff2df7edcd512
6
+ metadata.gz: acbd6dd076a001da65ed6bb6340e5670ff6169884ebb44941eebed7659dbbadea45589e568d6d7e0660a88b2272f77a50bb8543a933496772ecceda61f95bb67
7
+ data.tar.gz: 32694d53a8ef20c28199bc571e9a8ebd3b5a153a69b7fa4e5c87522e6aa0e1c9a59724c03e663ce0935d9a5bdda09ba945b909032358ac614f19feeaaf7a2c2f
@@ -604,6 +604,22 @@ module Spree
604
604
  end
605
605
  alias_method :fully_discounted, :fully_discounted?
606
606
 
607
+ def payments_attributes=(attributes)
608
+ validate_payments_attributes(attributes)
609
+ super(attributes)
610
+ end
611
+
612
+ def validate_payments_attributes(attributes)
613
+ # Ensure the payment methods specified are allowed for this user
614
+ payment_methods = Spree::PaymentMethod.where(id: available_payment_methods.map(&:id))
615
+ attributes.each do |payment_attributes|
616
+ payment_method_id = payment_attributes[:payment_method_id]
617
+
618
+ # raise RecordNotFound unless it is an allowed payment method
619
+ payment_methods.find(payment_method_id) if payment_method_id
620
+ end
621
+ end
622
+
607
623
  private
608
624
 
609
625
  def link_by_email
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.2.6"
3
+ "3.2.7"
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.2.6
4
+ version: 3.2.7
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