Recently I've found that when a customer goes to checkout and hits the craft\commerce\controllers actionPay() using a custom gateway that it's automatically marking the cart as complete.

This never used to happen, the gateway would set the cart to complete after receiving a webhook response itself at a later time, allowing the customer to go back and update their cart before checking out properly(or not as they decide).

Now if they hit the back button they, obviously, have an empty cart as it's been marked as completed (along with the automated emails etc that are sent at that time).

Can someone point me in the right direction on how to stop this auto-complete from happening?

1 Answer 1


Just to update this with an answer, thanks very much to P&T's excellent dev team.

The model implementing RequestResponseInterface returned from the gateway's authorize() method isSuccessful() method should only return true when completing a payment.

I also had to return false on the isProcessing() method during my tests. Not sure what that method does but setting both those methods to return false fixed the issue.

It was a recent change in the commerce code that identified this bug in my gateway's code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.