Permalink
Browse files

fix #2 by showing address only on success page and invoice

  • Loading branch information...
1 parent 142c993 commit 2ea4959208612cba04b44bd016375dc60f19d8bb @weex committed Mar 12, 2012
Showing with 13 additions and 6 deletions.
  1. +11 −1 checkout_success.php
  2. +2 −5 includes/modules/payment/bitcoin.php
View
12 checkout_success.php
@@ -50,7 +50,7 @@
$global = tep_db_fetch_array($global_query);
if ($global['global_product_notifications'] != '1') {
- $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
+ $orders_query = tep_db_query("select * from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$products_array = array();
@@ -70,7 +70,17 @@
<div class="contentContainer">
<div class="contentText">
+ <?php
+ if( $orders['payment_method'] == "Bitcoin Payment" ) {
+ $amount_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$orders['orders_id'] . "' and class = 'ot_total'");
+ $payment_amount = tep_db_fetch_array($amount_query);
+ $payment_address_query = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$orders['orders_id'] . "'");
+ $payment_address = tep_db_fetch_array($payment_address_query);
+ echo "To complete your order please send " . $payment_amount['text']. " to " . $payment_address['comments'] . "<br /><br />";
+ }
+ ?>
<?php echo TEXT_SUCCESS; ?>
+
</div>
<div class="contentText">
View
7 includes/modules/payment/bitcoin.php
@@ -74,8 +74,6 @@ function pre_confirmation_check() {
function confirmation() {
//Here we will generate a new payment address and any other related tasks
global $order;
-
- $order->info['bitcoin_checkout_key'] = tep_create_random_value(32);
require_once 'bitcoin/jsonRPCClient.php';
@@ -88,11 +86,10 @@ function confirmation() {
return $confirmation;
}
- $address = $bitcoin->getaccountaddress($order->customer['email_address'].'-'.$order->info['bitcoin_checkout_key']);
$confirmation = array('title' => '');
$confirmation['fields']
= array(
- array('title'=>'Payment Address', 'field'=>'<div><br />Please send payment to this address after confirming your order. You will receive this address and the total amount in the order confirmation email:<hr> '.$address.'</div> <hr>'));
+ array('title'=>'Instructions', 'field'=>'<div>Please send payment to the adddress shown after you confirm your order.</div> <hr>'));
return $confirmation;
}
@@ -103,7 +100,7 @@ function process_button() {
function before_process() {
global $insert_id, $order;
- $address = $order->customer['email_address'].'-'.$order->info['bitcoin_checkout_key'];
+ $address = $order->customer['email_address'].'-'.tep_create_random_value(32);
require_once 'bitcoin/jsonRPCClient.php';

0 comments on commit 2ea4959

Please sign in to comment.