opencart/opencart — pull request #216 by alberto-gdedios (2012-10-28 17:24:02+00:00)
Title: New checkout error controller (when payment fails)

Now in Opencart, when a payment has failed (payment denied, payment
canceled ...), there is no way of showing the customer that the order has
not been processed. Opencart only has a success controller that shows a
Success page with "Your Order Has Been Processed!" although the payment
has failed.
With these 3 new files, a payment gateway module can redirect the
costumer to this error controller if the payment has failed.
In the payment gateway, the return page of the bank should be managed by
the payment gateway and determine if the order is processed or not. If
yes, then redirect the costumer to checkout/success. If not, then
redirect the costumer to checkout/error.
You can see this behavior in my free payment gateway module called BBVA
(http://www.opencart.com/index.php?route=extension/extension/info&extension_id=4309),
although I redirect to checkout/checkout instead of error page.
This controller is backward compatible. Payment gateways can implement
it if developers want, but it´s not mandatory.
The files are very similar to success.php (success controller), with
some little modifications. In the controller, cart data is not clear to
allow the costumer to retry the payment.