From cd0d7894347e41c66264a8d2e7e6e0739482a1f5 Mon Sep 17 00:00:00 2001 From: John Atkinson Date: Fri, 17 May 2013 15:43:33 -0700 Subject: [PATCH] bugfixes --- upload/admin/view/template/payment/bitcoin.tpl | 3 +++ upload/catalog/controller/payment/bitcoin.php | 6 +++--- upload/catalog/language/english/payment/bitcoin.php | 2 +- .../catalog/view/theme/default/template/payment/bitcoin.tpl | 6 ++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/upload/admin/view/template/payment/bitcoin.tpl b/upload/admin/view/template/payment/bitcoin.tpl index 91a73d6..7a07d03 100644 --- a/upload/admin/view/template/payment/bitcoin.tpl +++ b/upload/admin/view/template/payment/bitcoin.tpl @@ -22,6 +22,9 @@ Copyright (c) 2013 John Atkinson (jga)
+ + +
Click here the first time you configure this extension to prepare your database.
* diff --git a/upload/catalog/controller/payment/bitcoin.php b/upload/catalog/controller/payment/bitcoin.php index 3ec5511..13f87f5 100644 --- a/upload/catalog/controller/payment/bitcoin.php +++ b/upload/catalog/controller/payment/bitcoin.php @@ -89,14 +89,14 @@ public function confirm_sent() { if(round((float)$received_amount,4) >= round((float)$bitcoin_total,4)) { $order = $this->model_checkout_order->getOrder($order_id); $this->model_checkout_order->confirm($order_id, $this->config->get('bitcoin_order_status_id')); - echo true; + echo "1"; } else { - echo false; + echo "0"; } } catch (Exception $e) { $this->data['error'] = true; - echo false; + echo "0"; } } diff --git a/upload/catalog/language/english/payment/bitcoin.php b/upload/catalog/language/english/payment/bitcoin.php index e98ee97..38c5ef4 100644 --- a/upload/catalog/language/english/payment/bitcoin.php +++ b/upload/catalog/language/english/payment/bitcoin.php @@ -14,7 +14,7 @@ $_['text_click_here'] = 'Click here'; $_['text_pre_timer'] = 'You have '; $_['text_post_timer'] = ' remaining to complete your transaction.'; -$_['text_countdown_expired'] = 'Your time to complete this transaction has expired. Please refresh the page and attempt to checkout again.'; +$_['text_countdown_expired'] = 'Your time to complete this transaction has expired. Please click here to attempt to checkout again.'; $_['text_if_not_redirect'] = 'if you are not redirected automatically a few seconds after payment.'; $_['error_msg'] = 'Error communicating with payment provider. Please contact the store for assistance.'; $_['error_confirm'] = 'That didn\\\'t quite work. Please try again. If you receive this message multiple times, please contact us so we can help finalize your order.'; diff --git a/upload/catalog/view/theme/default/template/payment/bitcoin.tpl b/upload/catalog/view/theme/default/template/payment/bitcoin.tpl index 299d965..0aa60d1 100644 --- a/upload/catalog/view/theme/default/template/payment/bitcoin.tpl +++ b/upload/catalog/view/theme/default/template/payment/bitcoin.tpl @@ -83,11 +83,12 @@ $('#button-pay').on('click', function() { type: 'GET', url: 'index.php?route=payment/bitcoin/confirm_sent', timeout: 5000, + dataType: 'text', error: function() { document.getElementById("cboxLoadedContent").innerHTML = document.getElementById("cboxLoadedContent").innerHTML + '
'; }, success: function(received) { - if(!received) { + if(received != "1") { document.getElementById("cboxLoadedContent").innerHTML = document.getElementById("cboxLoadedContent").innerHTML + '
'; } else { @@ -102,11 +103,12 @@ $('#button-pay').on('click', function() { type: 'GET', url: 'index.php?route=payment/bitcoin/confirm_sent', timeout: 5000, + dataType: 'text', error: function() { document.getElementById("cboxLoadedContent").innerHTML = document.getElementById("cboxLoadedContent").innerHTML + '
'; }, success: function(received) { - if(received) { + if(received == "1") { location.href = 'index.php?route=checkout/success'; } }