diff --git a/admin/view/template/payment/mollie.tpl b/admin/view/template/payment/mollie.tpl index de86ccff..fd2ac48f 100755 --- a/admin/view/template/payment/mollie.tpl +++ b/admin/view/template/payment/mollie.tpl @@ -51,19 +51,21 @@ - checked style="cursor:pointer" /> - + checked style="cursor:pointer; display:none" /> diff --git a/admin/view/template/payment/mollie_2.tpl b/admin/view/template/payment/mollie_2.tpl index 52f53660..8f80bfae 100755 --- a/admin/view/template/payment/mollie_2.tpl +++ b/admin/view/template/payment/mollie_2.tpl @@ -59,19 +59,21 @@
- checked style="cursor:pointer" /> - + checked style="cursor:pointer; display:none" />
diff --git a/catalog/controller/payment/mollie/base.php b/catalog/controller/payment/mollie/base.php index 684767e0..56322114 100755 --- a/catalog/controller/payment/mollie/base.php +++ b/catalog/controller/payment/mollie/base.php @@ -193,7 +193,7 @@ public function payment () $amount = round($amount, 2); $description = str_replace("%", $order['order_id'], html_entity_decode($this->config->get("mollie_ideal_description"), ENT_QUOTES, "UTF-8")); - $return_url = $this->url->link("payment/mollie_" . static::MODULE_NAME . "/callback", "utm_nooverride=1", "SSL"); + $return_url = $this->url->link("payment/mollie_" . static::MODULE_NAME . "/callback", "", "SSL"); $issuer = $this->getIssuer(); try @@ -379,6 +379,7 @@ public function callback () // Now that the customer has returned to our web site, check if we already know if the payment has succeeded. If the payment is all good, we need to clear the cart. if ($order && $order["order_status_id"] == $this->config->get("mollie_ideal_processing_status_id")) { + // Redirect to 'success' page. $this->redirect($this->url->link("checkout/success", "", "SSL")); return; } @@ -386,35 +387,25 @@ public function callback () // When an order could be found, check if Mollie has reported the new status. When the order status is still pending, the report is not delivered yet. elseif ($order && $order['order_status_id'] == $this->config->get("mollie_ideal_pending_status_id")) { - $data['message_title'] = $this->language->get("heading_unknown"); - $data['message_text'] = $this->language->get("msg_unknown"); - if ($this->cart) { $this->cart->clear(); } - } - // When no order could be found the session has probably expired. The payment has failed. - else - { - $data['message_title'] = $this->language->get("heading_failed"); - $data['message_text'] = $this->language->get("msg_failed"); + // Show a 'transaction pending' page. + return $this->showReturnPage( + $this->language->get("heading_unknown"), + $this->language->get("msg_unknown"), + NULL, + FALSE + ); } - $this->document->setTitle($this->language->get("ideal_title")); - - $this->setBreadcrumbs($data); - - // Render HTML output. - $this->renderTemplate("mollie_return", $data, array( - "column_left", - "column_right", - "content_top", - "content_bottom", - "footer", - "header", - )); + // Show a 'transaction failed' page. + return $this->showReturnPage( + $this->language->get("heading_failed"), + $this->language->get("msg_failed") + ); } /** @@ -433,19 +424,55 @@ protected function setBreadcrumbs (&$data) /** * @param $message + * + * @return string */ protected function showErrorPage ($message) { + $this->load->language("payment/mollie"); + $this->log->write("Error setting up transaction with Mollie: {$message}."); - $data['mollie_error'] = $message; - $data['message'] = $this->language; + return $this->showReturnPage( + $this->language->get("heading_error"), + $this->language->get("text_error"), + $message + ); + } + + /** + * Render a return page. + * + * @param string $title The title of the status page. + * @param string $body The status message. + * @param string|NULL $api_error Show an API error, if applicable. + * @param bool $show_retry_button Show a retry button that redirects the customer back to the checkout page. + * + * @return string + */ + protected function showReturnPage ($title, $body, $api_error = NULL, $show_retry_button = TRUE) + { + $this->load->language("payment/mollie"); + + $data['message_title'] = $title; + $data['message_text'] = $body; + + if ($api_error) + { + $data['mollie_error'] = $api_error; + } + + if ($show_retry_button) + { + $data['checkout_url'] = $this->url->link("checkout/checkout", "", "SSL"); + $data['button_retry'] = $this->language->get("button_retry"); + } + + $this->document->setTitle($this->language->get("ideal_title")); - // Breadcrumbs $this->setBreadcrumbs($data); - // Render HTML output - return $this->renderTemplate("mollie_payment_error", $data, array( + return $this->renderTemplate("mollie_return", $data, array( "column_left", "column_right", "content_top", diff --git a/catalog/language/dutch/payment/mollie.php b/catalog/language/dutch/payment/mollie.php index 5c57984d..d9d65dfa 100755 --- a/catalog/language/dutch/payment/mollie.php +++ b/catalog/language/dutch/payment/mollie.php @@ -40,13 +40,20 @@ $_['ideal_title'] = 'Uw betaling'; $_['text_title'] = 'Online betalen'; $_['text_redirected'] = 'De klant is doorgestuurd naar het betaalscherm'; -$_['msg_failed'] = 'De betaling is mislukt.'; -$_['msg_unknown'] = 'We hebben uw betaling nog niet ontvangen. Wij zullen een bevestigingsmail versturen op het moment dat de betaling binnen is.'; -$_['heading_failed'] = 'Uw betaling is niet voltooid'; -$_['heading_unknown'] = 'Wij wachten nog op uw betaling'; -$_['heading_error'] = 'Er is een fout opgetreden bij het opzetten van de betaling.'; -$_['text_error'] = 'Er is een fout opgetreden tijdens het opzetten van de betaling bij Mollie:'; $_['text_issuer'] = 'Kies uw bank'; +$_['button_retry'] = 'Opnieuw proberen af te rekenen'; + +// Status page: payment failed (e.g. cancelled). +$_['heading_failed'] = 'Uw betaling is niet voltooid'; +$_['msg_failed'] = 'Helaas is de betaling mislukt. Klik op onderstaande knop om terug te keren naar het afrekenscherm.'; + +// Status page: payment pending. +$_['heading_unknown'] = 'We wachten nog op uw betaling'; +$_['msg_unknown'] = 'We hebben uw betaling nog niet ontvangen. Wij zullen een bevestigingsmail versturen op het moment dat de betaling binnen is.'; + +// Status page: API failure. +$_['heading_error'] = 'Er is een fout opgetreden bij het opzetten van de betaling'; +$_['text_error'] = 'Er is een fout opgetreden bij het opzetten van de betaling bij Mollie. Klik op onderstaande knop om terug te keren naar het afrekenscherm.'; // Response $_['response_success'] = 'De betaling is ontvangen'; diff --git a/catalog/language/english/payment/mollie.php b/catalog/language/english/payment/mollie.php index 8c62f2cf..91bc8c90 100755 --- a/catalog/language/english/payment/mollie.php +++ b/catalog/language/english/payment/mollie.php @@ -40,13 +40,20 @@ $_['ideal_title'] = 'Your payment'; $_['text_title'] = 'Pay online'; $_['text_redirected'] = 'The client has been referred to the payment screen'; -$_['msg_failed'] = 'Unfortunately your payment has failed.'; -$_['msg_unknown'] = 'Your payment has not been received yet. We will send you a confirmation email the moment the payment is received.'; +$_['text_issuer'] = 'Select your bank'; +$_['button_retry'] = 'Return to checkout page'; + +// Status page: payment failed (e.g. cancelled). $_['heading_failed'] = 'Your payment has not been completed'; +$_['msg_failed'] = 'Unfortunately your payment has failed. Please click the button below to return to the checkout page and retry setting up a payment.'; + +// Status page: payment pending. $_['heading_unknown'] = 'Your payment is pending'; -$_['heading_error'] = 'An error occurred when setting up the payment.'; -$_['text_error'] = 'An error occurred when setting up the payment with Mollie:'; -$_['text_issuer'] = 'Select your bank'; +$_['msg_unknown'] = 'Your payment has not been received yet. We will send you a confirmation email the moment the payment is received.'; + +// Status page: API failure. +$_['heading_error'] = 'An error occurred when setting up the payment'; +$_['text_error'] = 'An error occurred when setting up the payment with Mollie. Click the button below to return to the checkout page.'; // Response $_['response_success'] = 'The payment is received'; diff --git a/catalog/language/french/payment/mollie.php b/catalog/language/french/payment/mollie.php index 45340bab..9d031a92 100755 --- a/catalog/language/french/payment/mollie.php +++ b/catalog/language/french/payment/mollie.php @@ -40,13 +40,20 @@ $_['ideal_title'] = 'Votre paiement'; $_['text_title'] = 'Payez en ligne'; $_['text_redirected'] = 'Le client a été renvoyé à l\'écran de paiement'; -$_['msg_failed'] = 'Malheureusement, votre paiement est échoué.'; -$_['msg_unknown'] = 'Votre paiement n\'a pas encore été reçu. Nous vous enverrons un e-mail de confirmation au moment où le paiement est reçu.'; +$_['text_issuer'] = 'Selectionnez votre banque:'; +$_['button_retry'] = 'Retour à la page de paiement'; + +// Status page: payment failed (e.g. cancelled). $_['heading_failed'] = 'Votre paiement n\'a pas été achevée'; +$_['msg_failed'] = 'Malheureusement, votre paiement est échoué.'; + +// Status page: payment pending. $_['heading_unknown'] = 'Votre paiement est en attente'; -$_['heading_error'] = 'Une erreur s\'est produite lors de la mise en place du paiement.'; +$_['msg_unknown'] = 'Votre paiement n\'a pas encore été reçu. Nous vous enverrons un e-mail de confirmation au moment où le paiement est reçu.'; + +// Status page: API failure. +$_['heading_error'] = 'Une erreur s\'est produite lors de la mise en place du paiement'; $_['text_error'] = 'Une erreur s\'est produite lors de la mise en place du paiement avec Mollie:'; -$_['text_issuer'] = 'Selectionnez votre banque:'; // Response $_['response_success'] = 'Le paiement est reçu'; diff --git a/catalog/view/theme/default/template/payment/mollie_payment_error.tpl b/catalog/view/theme/default/template/payment/mollie_payment_error.tpl deleted file mode 100755 index 4e86362f..00000000 --- a/catalog/view/theme/default/template/payment/mollie_payment_error.tpl +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - -
- - - - -
-

get("heading_error")) ?>

-
- -

get("text_error")) ?>

- -

-
-
- - - diff --git a/catalog/view/theme/default/template/payment/mollie_payment_error_2.tpl b/catalog/view/theme/default/template/payment/mollie_payment_error_2.tpl deleted file mode 100755 index 3431e674..00000000 --- a/catalog/view/theme/default/template/payment/mollie_payment_error_2.tpl +++ /dev/null @@ -1,37 +0,0 @@ - - - - -
- - - -
- -
- -

get("heading_error")) ?>

-
- -

get("text_error")) ?>

- -

- -
- -
-
- - diff --git a/catalog/view/theme/default/template/payment/mollie_return.tpl b/catalog/view/theme/default/template/payment/mollie_return.tpl index 4ba94fec..d1913ac7 100755 --- a/catalog/view/theme/default/template/payment/mollie_return.tpl +++ b/catalog/view/theme/default/template/payment/mollie_return.tpl @@ -26,6 +26,14 @@

+ + +

+ + + +

+
diff --git a/catalog/view/theme/default/template/payment/mollie_return_2.tpl b/catalog/view/theme/default/template/payment/mollie_return_2.tpl index 82dd0f76..706d1591 100755 --- a/catalog/view/theme/default/template/payment/mollie_return_2.tpl +++ b/catalog/view/theme/default/template/payment/mollie_return_2.tpl @@ -26,6 +26,14 @@

+ + +

+ + + +

+