Jump to content
ldavies83

[CONTRIBUTION] Nochex APC Payment Module

Recommended Posts

Hi,

 

This is a great, slick module. I've installed it without problems on ms2.2 and it works more or less perfectly, with one small exception:

 

When you finish checking out and confirmation_success.php is displayed, the order stays in the shopping cart, or sometimes does not reset the cart box to display the BOX_SHOPPING_CART_EMPTY string (i.e. "0 items"), and the shopping cart page does not display the "your cart is empty" string either.

I'm guessing this is to do with the

if ($cart->count_contents() > 0)

conditions dotted around the cart php scripts being satisfied even though they shouldn't have been.

 

I tested the checkout using the money order payment module as well, and the cart is reset properly afterwards, so I can only assume it's something to do with the nochex scripts. I could of course be entirely wrong here.

 

This is a problem because it is possible to check out when there's nothing in the cart

 

I have been looking around to find out the reason for this but cannot see where the cart is updated in any of the nochex apc scripts, or the money order script for that matter.

 

I should mention that the APC module is currently in test mode, so could that be the reason why it's not updating the cart after checkout? Also I have tried setting it to update the stock before nochex accepts the payment but still no joy.

 

If I find out how to sort this out I'll let you know, but if someone could explain what's going on I'd really appreciate it

 

Thanks,

Drew

Edited by Mouseomatic

Share this post


Link to post
Share on other sites

Hi Guys,

 

Has anyone been able to sort out the problem of the shopping cart not being emptied after checkout completion.

 

I really really need to know how to do this!

 

Thanks

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites
Hi Guys,

 

Has anyone been able to sort out the problem of the shopping cart not being emptied after checkout completion.

 

I really really need to know how to do this!

 

Thanks

 

Mark

 

I did eventually find a way to do it, although it's probably not a very good solution at all.

add the line

 

$cart->reset(TRUE);

 

somewhere suitable in checkout_success.php.

 

My code currently looks like this:

// BEGIN NOCHEX APC ADDON
   $nochexapc_query = tep_db_query("select o.orders_status,p.* from " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_NOCHEXAPC_TXN . " p on p.order_id = o.orders_id AND o.customers_id = '" . (int)$customer_id . "' order by o.date_purchased desc limit 1");
 $nochexapc = tep_db_fetch_array($nochexapc_query);

 if ($nochexapc['nochex_reponse']=='AUTHORISED') {
     $NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_OK;
     $HEADING_TITLE = NOCHEX_HEADING_TITLE_OK; 
     $TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_OK; 
   $cart->reset(TRUE);
 } else if ($nochexapc['nochex_response']=='DECLINED') { 
   $NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_FAILED; 
   $HEADING_TITLE = NOCHEX_HEADING_TITLE_FAILED; 
   $TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_FAILED; 
 } else if ($nochexapc['orders_status']==50000) { 
     $NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_PENDING; 
     $HEADING_TITLE = NOCHEX_HEADING_TITLE_PENDING; 
     $TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_PENDING; 
 } else { 
   $NAVBAR_TITLE_2 = NAVBAR_TITLE_2; 
   $HEADING_TITLE = HEADING_TITLE; 
   $TEXT_SUCCESS = TEXT_SUCCESS; 
 };
 // END NOCHEX APC ADDON

Share this post


Link to post
Share on other sites

Hi all

This is my first contribution install, and I'm hoping that someone can give me quick hints as to where I might have gone wrong.

 

I've run through the install procedure, adding text to files as per inclusions in .txt files, uploading files otherwise, and I've run the sql successfully. I now have an entry for Nochex APC in my left hand menu box in the admin section, but I don't have a nochex apc (or a secure (ssl) transaction via nochex or whatever it was) within the payment modules section.

 

Does this sound familiar to anyone?

 

I've checked the files several times, and my only remaining solution is to junk the whole thing and start again, so thought I'd try here first.

 

thanks

 

Jax

Share this post


Link to post
Share on other sites
I did eventually find a way to do it, although it's probably not a very good solution at all.

add the line

 

$cart->reset(TRUE);

 

somewhere suitable in checkout_success.php.

 

My code currently looks like this:

// BEGIN NOCHEX APC ADDON
? ?$nochexapc_query = tep_db_query("select o.orders_status,p.* from " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_NOCHEXAPC_TXN . " p on p.order_id = o.orders_id AND o.customers_id = '" . (int)$customer_id . "' order by o.date_purchased desc limit 1");
?$nochexapc = tep_db_fetch_array($nochexapc_query);

?if ($nochexapc['nochex_reponse']=='AUTHORISED') {
? ? ?$NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_OK;
? ? ?$HEADING_TITLE = NOCHEX_HEADING_TITLE_OK; 
? ? ?$TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_OK; 
? ?$cart->reset(TRUE);
?} else if ($nochexapc['nochex_response']=='DECLINED') { 
? ?$NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_FAILED; 
? ?$HEADING_TITLE = NOCHEX_HEADING_TITLE_FAILED; 
? ?$TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_FAILED; 
?} else if ($nochexapc['orders_status']==50000) { 
? ? ?$NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_PENDING; 
? ? ?$HEADING_TITLE = NOCHEX_HEADING_TITLE_PENDING; 
? ? ?$TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_PENDING; 
?} else { 
? ?$NAVBAR_TITLE_2 = NAVBAR_TITLE_2; 
? ?$HEADING_TITLE = HEADING_TITLE; 
? ?$TEXT_SUCCESS = TEXT_SUCCESS; 
?};
?// END NOCHEX APC ADDON

 

I have managed to find a solution to my problem of the cart not being emptied after nochex checkout.

 

What I had to do was this

 

// BEGIN NOCHEX APC ADDON
   $nochexapc_query = tep_db_query("select o.orders_status,p.* from " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_NOCHEXAPC_TXN . " p on p.order_id = o.orders_id AND o.customers_id = '" . (int)$customer_id . "' order by o.date_purchased desc limit 1");
 $nochexapc = tep_db_fetch_array($nochexapc_query);

 if ($nochexapc['nochex_reponse']=='AUTHORISED') {
     $NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_OK;
     $HEADING_TITLE = NOCHEX_HEADING_TITLE_OK; 
     $TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_OK; 
   $cart->reset(TRUE);
 } else if ($nochexapc['nochex_response']=='DECLINED') { 
   $NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_FAILED; 
   $HEADING_TITLE = NOCHEX_HEADING_TITLE_FAILED; 
   $TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_FAILED; 
 } else if ($nochexapc['orders_status']==50000) { 
     $NAVBAR_TITLE_2 = NOCHEX_NAVBAR_TITLE_2_PENDING; 
     $HEADING_TITLE = NOCHEX_HEADING_TITLE_PENDING; 
     $TEXT_SUCCESS = NOCHEX_TEXT_SUCCESS_PENDING; 
     $cart->reset(TRUE); 
} else { 
   $NAVBAR_TITLE_2 = NAVBAR_TITLE_2; 
   $HEADING_TITLE = HEADING_TITLE; 
   $TEXT_SUCCESS = TEXT_SUCCESS; 
   $cart->reset(TRUE);
 };
 // END NOCHEX APC ADDON

 

Just added two extra

 

$cart->reset(TRUE);

 

If anyone knows if this will cause any possbile errors then please let me know.

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

Brilliant!! :rolleyes:

 

Works perfect....bit of editing bit of hacking bit of tweaking and it works perfectly....compared to the instructions at Nochex which i firmly believe are written in some cryptic code that only 8 people on the planet understand!! :P

 

Thanks Leigh for a great contribution :thumbsup:

Share this post


Link to post
Share on other sites

Seems i spoke too soon :'(

When i login on a test account i have made and go to account history i get SQL errors

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/XXXXXX/public_html/catalog/includes/functions/database.php on line 99

 

 

Fatal error: Call to a member function on a non-object in /home/XXXXX/public_html/catalog/account_history.php on line 125

 

Now this is referring back to one of the PHP files edited during install of the contrib. so i have checked it character by character and even repasted the code back into account_history.php and still the same errors. file code is:

<?php
/*
 $Id: account_history.php,v 1.63 2003/06/09 23:03:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY);

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
 $orders_total = tep_count_customer_orders();

 if ($orders_total > 0) {
   $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.orders_status != '50000' order by orders_id DESC";

   while ($history = tep_db_fetch_array($history_query)) {
     $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
     $products = tep_db_fetch_array($products_query);

     if (tep_not_null($history['delivery_name'])) {
       $order_type = TEXT_ORDER_SHIPPED_TO;
       $order_name = $history['delivery_name'];
     } else {
       $order_type = TEXT_ORDER_BILLED_TO;
       $order_name = $history['billing_name'];
     }
?>
         <table border="0" width="100%" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
             <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
           </tr>
         </table>
         <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
           <tr class="infoBoxContents">
             <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
               <tr>
                 <td class="main" width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
                 <td class="main" width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($history['order_total']); ?></td>
                 <td class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
               </tr>
             </table></td>
           </tr>
         </table>
         <table border="0" width="100%" cellspacing="0" cellpadding="2">
           <tr>
             <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
           </tr>
         </table>
<?php
   }
 } else {
?>
         <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
           <tr class="infoBoxContents">
             <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
               <tr>
                 <td class="main"><?php echo TEXT_NO_PURCHASES; ?></td>
               </tr>
             </table></td>
           </tr>
         </table>
<?php
 }
?>
       </td>
     </tr>
<?php
 if ($orders_total > 0) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
           <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

so any ideas as this is the only part of the APC contrib that isnt playing ball with me....all the other snags other people seem to have getting it to come back from Nochex ..... etc I dont seem to suffer from :blink:

Share this post


Link to post
Share on other sites
Anyone? :'(

Hi fluxweb, sorry been quite busy recently! First of all roll back to your original copy of account_history (you did make a backup didnt you!!?)

Make sure it worked beforehand. If it did, let me know, post it up I'll have a look at the code.

 

Cheers,

 

L.


Contribs Written: Nochex APC Payment Module, Cheque Payment Module

Contribs Updated: Information Pages Unlimited, Latest News V1

You've gotta be Quick on the Draw in this game!

Share this post


Link to post
Share on other sites

Hi. I'm a newby and this is my second ever post, so please be gentle with me.

 

I'm having a problem with Nochex, in that the Cart is not emptied after a transaction. I am in test mode, but all the emails seem fine and the order exists.

 

Is test mode relevant to the cart not being emptied? I'm not quite ready to go live on my site yet.

 

Martin

Share this post


Link to post
Share on other sites

Hi Leigh been away sorry for the late reply

 

Account_history.php works fine as the back up(stock) version code below.

 

<?php
/*
 $Id: account_history.php,v 1.63 2003/06/09 23:03:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY);

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
 $orders_total = tep_count_customer_orders();

 if ($orders_total > 0) {
   $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC";
   $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
   $history_query = tep_db_query($history_split->sql_query);

   while ($history = tep_db_fetch_array($history_query)) {
     $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
     $products = tep_db_fetch_array($products_query);

     if (tep_not_null($history['delivery_name'])) {
       $order_type = TEXT_ORDER_SHIPPED_TO;
       $order_name = $history['delivery_name'];
     } else {
       $order_type = TEXT_ORDER_BILLED_TO;
       $order_name = $history['billing_name'];
     }
?>
         <table border="0" width="100%" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
             <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
           </tr>
         </table>
         <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
           <tr class="infoBoxContents">
             <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
               <tr>
                 <td class="main" width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
                 <td class="main" width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($history['order_total']); ?></td>
                 <td class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
               </tr>
             </table></td>
           </tr>
         </table>
         <table border="0" width="100%" cellspacing="0" cellpadding="2">
           <tr>
             <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
           </tr>
         </table>
<?php
   }
 } else {
?>
         <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
           <tr class="infoBoxContents">
             <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
               <tr>
                 <td class="main"><?php echo TEXT_NO_PURCHASES; ?></td>
               </tr>
             </table></td>
           </tr>
         </table>
<?php
 }
?>
       </td>
     </tr>
<?php
 if ($orders_total > 0) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
           <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Any ideas?

Share this post


Link to post
Share on other sites
Hi.  I'm a newby and this is my second ever post, so please be gentle with me.

 

I'm having a problem with Nochex, in that the Cart is not emptied after a transaction.  I am in test mode, but all the emails seem fine and the order exists.

 

Is test mode relevant to the cart not being emptied?  I'm not quite ready to go live on my site yet.

 

Martin

 

Had the same problems....if you scroll back some of the pages in this thread it does give you the answers to that exact question, and it worked for me :D

Share this post


Link to post
Share on other sites
Had the same problems....if you scroll back some of the pages in this thread it does give you the answers to that exact question, and it worked for me  :D

Thanks for the reply.

So it seems the answer is in reply 80 - insert some $cart->reset() calls.

Is this something that will be updated in the contribution in future?

 

How come other peoples cart's don't need this additonal code?

 

Oh BTW - I've changed 'cart' to 'basket' throughout as I'm English.

 

Martin

Share this post


Link to post
Share on other sites

Hi all

 

Just wondered if anyone has the Paypal IPN contribution and Nochex running on the same site.

 

Both Paypal IPN and Nochex need account_history.php updating.

 

Here's the line in question:

 

 

Original:

 

$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC";

 

 

Paypal IPN:

 

$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.orders_status != '99999' order by orders_id DESC";

 

Nochex:

 

$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.orders_status != '50000' order by orders_id DESC";

 

 

Do I need to include these as two separate lines or will they have to be merged to work side by side?

 

Cheers

Urmy

Share this post


Link to post
Share on other sites

It's all OK now, i just gritted my teeth and tried it.

 

Now for my next question...

 

I'm working on a music download site at the minute and, when a customer selects nochex and goes to the checkout everything seems peachy. If they then change their mind and press 'back' they return to the website and can download the music in 'my account', despite not having paid.

 

It seems the download links are being activated before going to the nochex website, is there a way of activating them only on successful payment. The idea behind installing Paypal IPN and Nochex APC was to try and make that couldn't happen.

 

Any help appreciated, I'm a relative newcomer to php and suchlike

 

Cheers again

Urmy

Share this post


Link to post
Share on other sites

Hi Leigh any ideas on the SQL problem i have ther me old mate :-" I know your busy but i just picked up another contract to do another site and .......well ya know :D

Share this post


Link to post
Share on other sites
Hi Leigh any ideas on the SQL problem i have ther me old mate :-"  I know your busy but i just picked up another contract to do another site and .......well ya know :D

Hi Fluxweb, try this

Replace the history_query_raw line with this:

$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.orders_status != '50000'  order by orders_id DESC";

Now I'm assuming you havent changed the Status ID of "Nochex Pending" to anything other than '50000' if you have you will need to change the line above with the new status ID

 

Happy coding :)


Contribs Written: Nochex APC Payment Module, Cheque Payment Module

Contribs Updated: Information Pages Unlimited, Latest News V1

You've gotta be Quick on the Draw in this game!

Share this post


Link to post
Share on other sites

Hello to all,

 

The Nochex APC is working with my test site :thumbsup:.....I've been able to put through real transcations and they seem to go through fine. However I would like some clarification/explanation on the following point:

1) When Nochex declines a transaction (e.g if customer does not have enough cash or wrong card details have been entered) should the customer be sent back to my website automatically?

Or is it that only when a transaction is successful does Nochex communicate this to my server and return the customer?

Basically I have been trying to test failed transactions by putting incorrect card details in the Nochex window. Nochex validates my input and responds by saying that the card details are incorrect - and I am not returned back to my website. Only if the transaction is successful does the focus return to my website.

 

The only other point I need help on is that my logo is not appearing in the Nochex window. Could somebody please be kind enough to tell me what the parameter string should look like.

 

You help would be most appreciated.

 

Nagsy

 

PS Excellent APC...many thanks to Leigh.

PPS How else can/should I be testing for failed transactions?

Share this post


Link to post
Share on other sites

Hey Leigh

Copied and pasted this in Dweaver and Notepad too and still no joy im afraid same debug error as before it didnt look as if there was much changed in the new code you listed to be honest and i havent touched any other code or hacked anything except the order id number ( instead of starting at 0 it started at 200 or somthing and that was done thru PHP Myadmin direct to the DB)

 

Everything else was copied and pasted direct as you said in the instructions. The site was a new install NOT fantastico or anything else. and the only hack on there is the APC module. as far as i can tell this is the only part of the module that isnt working everything else is ok

 

 

You mentioned the Status ID where is that exactly? :blink:

 

 

Hi Fluxweb, try this

Replace the history_query_raw line with this:

$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and o.orders_status != '50000' ?order by orders_id DESC";

Now I'm assuming you havent changed the Status ID of "Nochex Pending" to anything other than '50000' if you have you will need to change the line above with the new status ID

 

Happy coding :)

Edited by fluxweb

Share this post


Link to post
Share on other sites
Hey Leigh

Copied and pasted this in Dweaver and Notepad too and still no joy im afraid same debug error as before it didnt look as if there was much changed in the new code you listed to be honest and i havent touched any other code or hacked anything except the order id number ( instead of starting at 0 it started at 200 or somthing and that was done thru PHP Myadmin direct to the DB)

 

Everything else was copied and pasted direct as you said in the instructions. The site was a new install NOT fantastico or anything else. and the only hack on there is the APC module. as far as i can tell this is the only part of the module that isnt working everything else is ok

You mentioned the Status ID where is that exactly? :blink:

Hi Fluxweb, just quickly, you DID run the SQL commands into the database did'nt you?? They are required to create the database table to store the Nochex Data and create the 2 status codes. You can check it has by accessing the database and seeing if a table called nochexapc_transactions exists, and further you have 2 Status's in your Orders_Status table; "Nochex Processing" & "Nochex Authorised"

 

 

Assuming you have run the SQL file in give this a try, the part of the SQL query where it reads:

where o.orders_status !='50000'

change it to:

where o.orders_status !=50000

i.e. without the quotes

 

The status for processing orders is set to 50000, or "Nochex Processing" if you change this in Modules > Payments > Secure SSL Payment through Nochex to a different status, you need to update the above query to say "Exclude Order Status X instead of 50000".

 

You can find out what ID code you are using by firstly checking which status code it allocates the order before going to Nochex (by default "Nochex Processing") and then viewing your database and going to the Orders_Status table, you will see "Nochex Processing" along with the Status code for that one in the "Orders_Status_ID" Column.

 

Hope this helps,

 

L.


Contribs Written: Nochex APC Payment Module, Cheque Payment Module

Contribs Updated: Information Pages Unlimited, Latest News V1

You've gotta be Quick on the Draw in this game!

Share this post


Link to post
Share on other sites

:sweating: :sweating:

For what ever reason this is it aint working me old mate

 

1 1 Pending

50001 1 Nochex Authorised

2 1 Processing

3 1 Delivered

50000 1 Nochex Processing

From Order_status table....i presume this is correct?? and i havent touched this table SQL is like a black art to me at the moment :blink:

 

The nochexapc_transactions table shows the 15 or so test transactions i have made .

I have tried everything you have said mate and im slowly thinking whether OSC is right for me due to this not working correctly....HELP :'(

Share this post


Link to post
Share on other sites
:sweating:  :sweating:

For what ever reason this is it aint working me old mate

 

1 1 Pending

      50001 1 Nochex Authorised

      2 1 Processing

      3 1 Delivered

      50000 1 Nochex Processing

From Order_status table....i presume this is correct?? and i havent touched this table  SQL is like a black art to me at the moment :blink:

 

The nochexapc_transactions table shows the 15 or so test transactions i have made .

I have tried everything you have said mate and im slowly thinking whether OSC is right for me due to this not working correctly....HELP    :'(

 

Hi Fluxweb.

 

Are you still having that problem where you get a SQL error on the account history file?


If at first you don't succeed. Find the answer on a Forum.

Share this post


Link to post
Share on other sites

Hi Leigh

MANY MANY thanks for all your help wouldnt have got this sorted without you and was on my knees with this little problem.

 

Dunno what happened when i installed the contrib but you sorted it and it works :thumbsup:

Cheers mate

Share this post


Link to post
Share on other sites
Hello to all,

 

The Nochex APC is working with my test site :thumbsup:.....I've been able to put through real transcations and they seem to go through fine.  However I would like some clarification/explanation on the following point:

1)  When Nochex declines a transaction (e.g if customer does not have enough cash or wrong card details have been entered) should the customer be sent back to my website automatically?

Or is it that only when a transaction is successful does Nochex communicate this to my server and return the customer?

Basically I have been trying to test failed transactions by putting incorrect card details in the Nochex window.  Nochex validates my input and responds by saying that the card details are incorrect - and I am not returned back to my website.  Only if the transaction is successful does the focus return to my website.

 

The only other point I need help on is that my logo is not appearing in the Nochex window.  Could somebody please be kind enough to tell me what the parameter string should look like.

 

You help would be most appreciated.

 

Nagsy

 

PS Excellent APC...many thanks to Leigh.

PPS How else can/should I be testing for failed transactions?

 

Hi Folks,

 

Leigh was kind enough to respond to the pm I sent him. You'll find his reponse below.

 

Enjoy.

 

Nagsy

 

Hi Nagsy,

Ok, there is a cancelurl string that is constructed but that is only used if the user clicks the cancel transaction button. The reason for the APC Module is to effectively combat the unknown. IE I used to get orders in under pending, and no method of finding out if the customer paid. Now with the APC what happens is the system sets the order status to "Nochex Processing" sends the customer to nochex, then if the customer pays up, the nochex APC goes back to your server and asks the order to be updated to "Nochex Authorised". So if the payment fails, the order status stays at "Nochex Processing" ready for you to contact the customer and arrange alternate methods of payment. I hope this clarifies how this is meant to work. Unfortuanately I dont think Nochex has the ability yet to forward failed payments back to the site.

 

Now your issue with the logo, you must have https space in order for it to work effectively otherwise you get errors about mixed secure/unsecure items on the page. The format should be a direct link from outside your own site i.e

 

https://www.yourdomain.com/catalog/images/storelogo.jpg

 

One other point is that your server cannot have any anti-leeching protection (software that stops your images being displayed anywhere other than your site)

 

Hope it helps, if it does, feel free to post this reply to the forum

Share this post


Link to post
Share on other sites

Hi,

 

I have just installed the Nochex APC module into my store. Checked twice that I made all the necessary changes and have it all uploaded to my server now. The admin interface all works great and I am able set the new APC module into test mode with all settings set as required. The problem is that when I go to checkout the Nochex APC option isn't showing, any ideas what I may have missed?

 

I ran the SQL on the database successfully, so its not that.

 

Oh and the call back from that nochex test page work okay, I get the debug email etc.

 

Thanks in advance.

 

Regards,

 

Nick Miles

Edited by milesmowbray

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×