Skip to content

Commit

Permalink
Update mollie_controller.rb to set order_completed to true
Browse files Browse the repository at this point in the history
I was missing another piece of code from the mollie gateway gem. 
Even though I did some edit in spree views, I'm still using there `order_just_completed?` method to display a thank you message.
This method needs `flash['order_completed']` to be true and is normally set in the checkout update action: 

https://github.com/spree/spree/blob/master/frontend/app/controllers/spree/checkout_controller.rb#L43

So, I'm guessing, setting it here to true would be a good thing to do. 

Wdyt?
  • Loading branch information
Kulgar authored and Oldharlem committed Aug 8, 2021
1 parent c412477 commit 1b48b1b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/spree/mollie_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def validate_payment
MollieLogger.debug("Redirect URL visited for order #{params[:order_number]}")

order = order.reload

flash['order_completed'] = order.completed?

# Order is paid for or authorized (e.g. Klarna Pay Later)
redirect_to order.paid? || payment.pending? ? order_path(order) : checkout_state_path(:payment)
Expand Down

0 comments on commit 1b48b1b

Please sign in to comment.