Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * - 1 votes

[CONTRIBUTION] Nochex APC Payment Module


322 replies to this topic

#81 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 27 October 2004, 20:38

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:

#82 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 28 October 2004, 00:54

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:

#83 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 28 October 2004, 15:08

Anyone? :'(

#84 ldavies83

  • Community Member
  • 114 posts
  • Real Name:Leigh
  • Location:UK

Posted 28 October 2004, 15:29

fluxweb, on Oct 28 2004, 03:08 PM, said:

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!

#85 Cyberdog

  • Community Member
  • 17 posts
  • Real Name:Martin Robinson

Posted 29 October 2004, 09:49

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

#86 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 31 October 2004, 16:21

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?

#87 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 31 October 2004, 16:22

Cyberdog, on Oct 29 2004, 10:49 AM, said:

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

<{POST_SNAPBACK}>


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

#88 Cyberdog

  • Community Member
  • 17 posts
  • Real Name:Martin Robinson

Posted 31 October 2004, 17:48

fluxweb, on Oct 31 2004, 04:22 PM, said:

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

<{POST_SNAPBACK}>

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

#89 tetchi

  • Community Member
  • 3 posts
  • Real Name:Tetchi
  • Gender:Male

Posted 02 November 2004, 06:57

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

#90 tetchi

  • Community Member
  • 3 posts
  • Real Name:Tetchi
  • Gender:Male

Posted 02 November 2004, 07:41

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

#91 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 03 November 2004, 01:40

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

#92 ldavies83

  • Community Member
  • 114 posts
  • Real Name:Leigh
  • Location:UK

Posted 03 November 2004, 09:11

fluxweb, on Nov 3 2004, 01:40 AM, said:

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

<{POST_SNAPBACK}>

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!

#93 nagsy

  • Community Member
  • 55 posts
  • Real Name:nagsy
  • Location:UK

Posted 06 November 2004, 22:40

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?

#94 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 08 November 2004, 21:19

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:


ldavies83, on Nov 3 2004, 10:11 AM, said:

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 :)

<{POST_SNAPBACK}>


Edited by fluxweb, 08 November 2004, 21:23.


#95 ldavies83

  • Community Member
  • 114 posts
  • Real Name:Leigh
  • Location:UK

Posted 09 November 2004, 08:59

fluxweb, on Nov 8 2004, 09:19 PM, said:

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:

<{POST_SNAPBACK}>

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!

#96 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 09 November 2004, 16:45

: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 :'(

#97 marcoh

  • Community Member
  • 103 posts
  • Real Name:Mark

Posted 09 November 2004, 16:56

fluxweb, on Nov 9 2004, 04:45 PM, said:

: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    :'(

<{POST_SNAPBACK}>


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.

#98 fluxweb

  • Community Member
  • 10 posts
  • Real Name:Andy

Posted 11 November 2004, 18:04

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

#99 nagsy

  • Community Member
  • 55 posts
  • Real Name:nagsy
  • Location:UK

Posted 13 November 2004, 18:53

nagsy, on Nov 6 2004, 06:40 PM, said:

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?

<{POST_SNAPBACK}>


Hi Folks,

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

Enjoy.

Nagsy

Quote

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


#100 milesmowbray

  • Community Member
  • 1 posts
  • Real Name:Nick Miles

Posted 17 November 2004, 14:16

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, 17 November 2004, 14:17.