diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rb index d3ba30bc53d..d4a70909d5b 100644 --- a/core/app/models/spree/order.rb +++ b/core/app/models/spree/order.rb @@ -779,13 +779,12 @@ def payments_attributes=(attributes) def validate_payments_attributes(attributes) attributes = Array(attributes) - # Ensure the payment methods specified are allowed for this user - payment_methods = Spree::PaymentMethod.where(id: available_payment_methods) + attributes.each do |payment_attributes| payment_method_id = payment_attributes[:payment_method_id] # raise RecordNotFound unless it is an allowed payment method - payment_methods.find(payment_method_id) if payment_method_id + available_payment_methods.find(payment_method_id) if payment_method_id end end