app/controllers/spree/admin/payments_controller.rb in spree_backend-2.2.5 vs app/controllers/spree/admin/payments_controller.rb in spree_backend-2.2.6
- old
+ new
@@ -20,10 +20,10 @@
end
def create
invoke_callbacks(:create, :before)
@payment ||= @order.payments.build(object_params)
- if params[:card].present? and params[:card] != 'new'
+ if @payment.payment_method.source_required? && params[:card].present? and params[:card] != 'new'
@payment.source = @payment.payment_method.payment_source_class.find_by_id(params[:card])
end
begin
if @payment.save