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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 270e63acb2ee4007b6bea2044c6d983e308c0e9e
4
- data.tar.gz: 6d048ddd8484553b669a1e38ecae1c82a323add5
3
+ metadata.gz: db3ebbca771b182322334dbc1ac1fcf3b7c7b18d
4
+ data.tar.gz: 27576641885f1676dc1e22aba3d720cff12efa41
5
5
  SHA512:
6
- metadata.gz: b8da7ac191edc6933febe5cd2006d8ea31a96d3fc1be13a7043644b0ba7afcd17c33399847a277d88a6eea4d75ad0c94ef83029fdf2ddfaf563a6751f1d008fe
7
- data.tar.gz: defab635ca53f329c9539dd6b36835e24b9e9e88080f5cc006818f93f8b4bbcfdd928f996baf28b0508140104f255c7466cdf56568c0d07bedf8353701a6a973
6
+ metadata.gz: c4bb4bd04f186f04ac802ae24e9e22581e4b487335d73fa82474174b6f8555cff8b5ccd5c687e7b4ddc25982119c4fc67787f0332ced653c6e75f5d77538f78e
7
+ data.tar.gz: 8a7abab01b4753d4e32d0524414948754890b9a2fbb8d96d0dbe3bdd63857e6d3066c13cf2c5ae4e05feb1f2a4e4cbd486a94d82354cf684ccee9905f238a26d
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.1.11"
3
+ "3.1.12"
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.1.11
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-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