From 4be45303bf27d83e76aa8af558ccd1539c823ccc Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 27 Apr 2021 11:49:09 +0100 Subject: [PATCH] Reload order before updating in Payment callback --- app/models/spree/payment.rb | 2 +- spec/features/admin/payments_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index d16e428922..e9173d59a1 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -201,7 +201,7 @@ module Spree end def update_order - order.update! + order.reload.update! end # Necessary because some payment gateways will refuse payments with diff --git a/spec/features/admin/payments_spec.rb b/spec/features/admin/payments_spec.rb index 75b1de38c2..23baabd4ed 100644 --- a/spec/features/admin/payments_spec.rb +++ b/spec/features/admin/payments_spec.rb @@ -46,7 +46,7 @@ feature ' ) end - xit "creates the payment, completes the order, and updates payment and shipping states" do + it "creates the payment, completes the order, and updates payment and shipping states" do login_as_admin_and_visit spree.new_admin_order_payment_path order expect(page).to have_content "New Payment"