Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - Devosc

Recommended Posts

Okay, hopefully i don't mess things up cause this is pretty heavy stuff for a NOOB like me .

i will give it a swirl tomorrow.

 

Just one question: DO i need to upgrade because the old one doesn't work or does this one just is the icing on the cake?

 

In other words what is the main reason i should upgrade [because the 2.4 seems to be working although it is not a live shop yet]

Share this post


Link to post
Share on other sites

Hi There,

 

Once last thing, sorry don't have as much time as used, but have noticed a changed that must done in order to get the txn_signature to actually validate properly, there are reasons why this was overlooked, but in finally settling the right one, need to change in ipn.class.php

 

Change:

if($txn_signature != $this->key['txn_signature'] && !$debug->enabled) {

 

To:

if($txn_signature != $this->key['custom']) {

 

And in catalog/ipn.php

need to add the line highligted below:

$orders_id = $orders_session->orders_id;

$sendto = $orders_session->sendto;

$billto = $orders_session->billto;

$txn_signature = $orders_session->txn_signature;

 

Hoping thats it, don't usually try to rush things but not often get time for everything.

 

Will upload a new ipn.class.php and ipn.php for convience, hopefully will get some feed back.

 

PVK

Well the main reason might be the better implementation of validating the association between an IPN and its order, from the above :blink: thats whats supposed to happen. Previously the order_id was clearly transmitted, so that even if the cart totals where correct, if the order_id was changed then the wrong order (for the wrong customer) could be updated.


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

Hi Greg,

 

not sure, but are there any comments in the 2.5a how to upgrade from 2.5? did not see...

 

or is it just what you have said before?

 

Another thing: do I need to uninstall the module in admin or is it ok just to copy the files over (I made the sql table changes before - so nothing changed here on my site)

 

Kai

Share this post


Link to post
Share on other sites

Hi saletco,

 

Yeah need to uninstall module via admin and then resinstall this will add the 'Digest Key' field. For 2.5 to 2.5a the comments in the contrib section will suffice.

 

Actually, upon thinking more now, the comments I made above regarding $txn_signature not are absolutely neccessary, since if the paypal.custom/orders_session_inf.txn_signature was not correct in the first place then nothing would happen at all since it is used in the very first query that gets everything going.

 

I'll try and review things soon, I did also notice that

 

define('TABLE_HEADING_PAYMENT_STATUS','Payment Status');

 

needs to be added in admin/includes/languages/english/orders.php


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

Where exactly am I supposed to put the following:

 

include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/orders.inc.php')

;

 

because I inserted it in my admin/orders.php file around line 172 but I am getting all kinds of errors when I try to view orders. Here are some of the errors:

 

Warning: main(/var/www/html/includes/modules/payment/paypal/admin_orders.php): failed to open stream: No such file or directory in /var/www/html/admin/orders.php on line 231

 

Warning: main(): Failed opening '/var/www/html/includes/modules/payment/paypal/admin_orders.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/admin/orders.php on line 231

Share this post


Link to post
Share on other sites

include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/orders.inc.php')

 

is supposed to, in your case, replace line 231?


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

hello,

I'm using the cvs version of 1st week of june 2004.

note: I have updated the files to the 5.5a and plus the two files (ipn.php, and the class file that came for download after 5.5a release). I still get the following problems.

 

I have two problems:

 

1. I get errors when I'm not registered and place a merchandise in the cart and attempting to remove and pressing the update botton. After pressing update (to remove) I get the following error (I realize that this has to do with registration, and am wondering why the scripts don't return the guest user into the signup page or new registration page to signin in order to continue! but then again, the person just places the product in the cart and tries to remove it before geting into action, and wouldn't require to sign in that early!!! so, I would think that I should be able to unload the cart content without any issues of registration as I have here):

 

Fatal error: Call to undefined function: tep_session_is_registered() in x:\catalog\includes\modules\payment\paypal\classes\paypal_order.class.php on line 28

 

this pertains to the following code in Paypal_order.class.php :

 

    if(tep_session_is_registered('paypal_order')) {

 

now above and below such code is:

 

  function check_order_status($start = false) {
   global $paypal_order, $customers_id;
   include_once(DIR_WS_MODULES . 'payment/paypal/database_tables.inc.php');
   if(tep_session_is_registered('paypal_order')) {
     if ($start === true && PHP_VERSION < 4) {
       $paypal_session_order = $paypal_order;
       $paypal_order = new paypal_order;
       $paypal_order->unserialize($paypal_session_order);
     }
     $orders_session_query = tep_db_query("select paypal_ipn_id from " . TABLE_ORDERS . " where orders_id ='" . (int)$paypal_order->orders_id . "'");
     $orders_session_check = tep_db_fetch_array($orders_session_query);
     if ($orders_session_check['paypal_ipn_id'] > 0 ) {
       paypal_order::reset_checkout_cart_session();
       return true;
     }
     return false;
   }
   return false;
 }

 

 

NUMBER 2 QUESTION:

 

I get an empty page in return after pressing send on the "test" ipn in the admin module paypal section...... ???? I don't have a code to show you guys!!

 

But was wondering, do data get sent off via sendmail or smtp?? (a mail function?) because this would explain my problem as I'm having mail problems.

 

 

Well, I'd appreciate your help. thanks.

Share this post


Link to post
Share on other sites

Greg,

Thanks for all your hard work, I was wondering if it was possble for you to include the file's so I could just use beyond compare to verify the edits. I am getting some errors like,

 

Fatal error: Undefined class name 'paypal_order' in d:\web_sites\dvbhardware\dvbhardware\catalog\includes\application_top.php on line 257

 

I know the file is correct, I took out the previous edits and applyed the new, I also had to comment out in the database table since it is not used.

 

/begin PayPal_Shopping_Cart_IPN

// require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.php');

//end PayPal_Shopping_Cart_IPN

 

I always did ok with all the previous versions, but the file edits would be fantastic.

 

Jimmy


I'm not a coder just a splicer.

Share this post


Link to post
Share on other sites

Greg,

 

I'm still using ipn v 2.2, and I notice that it does not include the "low order fee" in the total sent to PayPal. Is there something I need to do to have this appear? It appears on the customer's screen as he pays, but when it gets to paypal, it is not there either as a line item or in the total.

 

I tried using aggregate, but that made no difference either.

 

Thanks for any insight or help.

 

CharleyShipman

Share this post


Link to post
Share on other sites

Hi charles or someone else,

 

Could you please also address my questions if you could please, as they are still remaining unanswered.

 

thanks.

Share this post


Link to post
Share on other sites

Would someone mind dropping by a post that I have started looking to get some help!

 

the post is located here.

 

Thanks!


Joel Gallant

Share this post


Link to post
Share on other sites
include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/orders.inc.php')

 

is supposed to, in your case, replace line 231?

I'm not sure.. I have copy and pasted my whole admin/orders.php file so maybe someone can look at it and help me figure out what is wrong.

 

here it is:

 

 

<?php

/*

 $Id: orders.php,v 1.112 2003/06/29 22:50: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');

 

 require(DIR_WS_CLASSES . 'currencies.php');

 $currencies = new currencies();

 

 $orders_statuses = array();

 $orders_status_array = array();

 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");

 while ($orders_status = tep_db_fetch_array($orders_status_query)) {

   $orders_statuses[] = array('id' => $orders_status['orders_status_id'],

                              'text' => $orders_status['orders_status_name']);

   $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];

 }

 

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

// Begin mod for shipping info

 if (tep_not_null($action)) {

   switch ($action) {

     case 'update_order':

       $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

       $status = tep_db_prepare_input($HTTP_POST_VARS['status']);

       $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

 $tracking_no = tep_db_prepare_input($HTTP_POST_VARS['tracking_no']);

 $ship_date= tep_db_prepare_input($HTTP_POST_VARS['ship_date']);

 $delivery_date = tep_db_prepare_input($HTTP_POST_VARS['delivery_date']);

 

       $order_updated = false;

 $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, ship_date, tracking_no, delivery_date from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

       $check_status = tep_db_fetch_array($check_status_query);

 

 $display_ship_date = $check_status['ship_date'];

 $display_tracking_no = $check_status['tracking_no'];

 $display_delivery_date = $check_status['delivery_date'];

// End mod for shipping info

 

// Begin mod for shipping info        

 if (tep_not_null($tracking_no)) {

         tep_db_query("update " . TABLE_ORDERS . " set tracking_no = '" . tep_db_input($tracking_no) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

    }

 if (tep_not_null($ship_date)) {

         tep_db_query("update " . TABLE_ORDERS . " set ship_date = '" . tep_db_input($ship_date) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

    }

 if (tep_not_null($delivery_date)){

   tep_db_query("update " . TABLE_ORDERS . " set delivery_date = '" . tep_db_input($delivery_date) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

       }

       if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {

         tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

         $customer_notified = '0';

         if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

           $notify_comments = '';

           if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

             $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

           }

           // if status is Shipped or Delivered include tracking number and ship date in e-mail

  if ($status == '3'){

  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . "\n\n" . EMAIL_TEXT_SHIP_DATE . $ship_date . "\n\n" . EMAIL_TEXT_TRACKING_NO . $tracking_no . "\n\n" . EMAIL_TEXT_QUESTIONS;

 

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

           $customer_notified = '1';

  }

  elseif ($status == '4'){

  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . "\n\n" . EMAIL_TEXT_SHIP_DATE . $display_ship_date . "\n\n" . EMAIL_TEXT_TRACKING_NO . $display_tracking_no . "\n\n" . EMAIL_TEXT_DELIVERY_DATE . $delivery_date . "\n\n" . EMAIL_TEXT_FEEDBACK . "\n\n" . EMAIL_TEXT_QUESTIONS;

 

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

           $customer_notified = '1';

  }

  // else don't include them

           else {

  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

 

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

           $customer_notified = '1';

  }

         }

// End mod for shipping info

 

         tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");

 

         $order_updated = true;

       }

 

       if ($order_updated == true) {

        $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');

       } else {

         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');

       }

 

       tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));

       break;

     case 'deleteconfirm':

       $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

       tep_remove_order($oID, $HTTP_POST_VARS['restock']);

 

       tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));

       break;

   }

 }

 

 if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {

   $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

   $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

   $order_exists = true;

   if (!tep_db_num_rows($orders_query)) {

     $order_exists = false;

     $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');

   }

 }

 

 include(DIR_WS_CLASSES . 'order.php');

?>

<!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>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php

 require(DIR_WS_INCLUDES . 'header.php');

?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

 <tr>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- 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="2">

<?php

 if (($action == 'edit') && ($order_exists == true)) {

   $order = new order($oID);

?>

     <tr>

       <td width="100%"><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_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

           <?php

//begin PayPal_Shopping_Cart_IPN

include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/orders.inc.php');

if (strtolower($order->info['payment_method']) == 'paypal' && isset($HTTP_GET_VARS['referer']) && $HTTP_GET_VARS['referer'] == 'ipn'){

?>

   <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('action','oID','referer'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

<?php

} else {

?>

    <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action','referer'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

<?php

}//else not paypal

//end PayPal_Shopping_Cart_IPN

?>

<td class="pageHeading" align="right">

<?php echo '<a href="' . tep_href_link("edit_orders.php", tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>   '; ?>

<?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?>

</td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><table width="100%" border="0" cellspacing="0" cellpadding="2">

         <tr>

           <td colspan="3"><?php echo tep_draw_separator(); ?></td>

         </tr>

         <tr>

           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

             <tr>

               <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>

               <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>

             </tr>

             <tr>

               <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

             </tr>

             <tr>

               <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>

               <td class="main"><?php echo $order->customer['telephone']; ?></td>

             </tr>

             <tr>

               <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>

               <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>

             </tr>

           </table></td>

           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

             <tr>

               <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>

               <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>

             </tr>

           </table></td>

           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

             <tr>

               <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>

               <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td>

             </tr>

           </table></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

<?php

//begin PayPal_Shopping_Cart_IPN

 

if (strtolower($order->info['payment_method']) == 'paypal') {

 

include DIR_FS_CATALOG_MODULES . 'payment/paypal/admin_orders.php';

} else {

?>

 <td><table border="0" cellspacing="0" cellpadding="2">

   <tr>

   <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>

   <td class="main"><?php echo $order->info['payment_method']; ?></td>

 </tr>

<?php

}//else not paypal

//end PayPal_Shopping_Cart_IPN

?>

         <tr>

           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

<?php

   if (tep_not_null($order->shipping['ship_date'])) {

?>    

         <tr>

           <td class="main"><b><?php echo ENTRY_SHIP_DATE; ?></b></td>

           <td class="main"><?php echo $order->shipping['ship_date']; ?></td>

         </tr>

<?php

         }

   if (tep_not_null($order->shipping['tracking_no']))  {

?>

         <tr>

           <td class="main"><b><?php echo ENTRY_TRACKING_NO; ?></b></td>

           <td class="main"><?php echo $order->shipping['tracking_no']; ?></td>

         </tr>

 

<?php

         }

   if (tep_not_null($order->shipping['delivery_date']))  {

?>

         <tr>

           <td class="main"><b><?php echo ENTRY_DELIVERY_DATE; ?></b></td>

           <td class="main"><?php echo $order->shipping['delivery_date']; ?></td>

         </tr>

<?php

         }

?>

 

 

 

<?php

   if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {

?>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>

           <td class="main"><?php echo $order->info['cc_type']; ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>

           <td class="main"><?php echo $order->info['cc_owner']; ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>

           <td class="main"><?php echo $order->info['cc_number']; ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>

           <td class="main"><?php echo $order->info['cc_expires']; ?></td>

         </tr>

<?php

   }

?>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

         <tr class="dataTableHeadingRow">

           <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

           <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

         </tr>

<?php

   for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

     echo '          <tr class="dataTableRow">' . "\n" .

          '            <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

          '            <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

 

     if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {

       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {

         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];

         if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';

         echo '</i></small></nobr>';

       }

     }

 

     echo '            </td>' . "\n" .

          '            <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .

          '            <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";

     echo '          </tr>' . "\n";

   }

?>

         <tr>

           <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">

<?php

   for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {

     echo '              <tr>' . "\n" .

          '                <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .

          '                <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .

          '              </tr>' . "\n";

   }

?>

           </table></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

       <td class="main"><table border="1" cellspacing="0" cellpadding="5">

         <tr>

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

         </tr>

<?php

   $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

   if (tep_db_num_rows($orders_history_query)) {

     while ($orders_history = tep_db_fetch_array($orders_history_query)) {

       echo '          <tr>' . "\n" .

            '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .

            '            <td class="smallText" align="center">';

       if ($orders_history['customer_notified'] == '1') {

         echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";

       } else {

         echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";

       }

       echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .

            '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .

            '          </tr>' . "\n";

     }

   } else {

       echo '          <tr>' . "\n" .

            '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .

            '          </tr>' . "\n";

   }

?>

       </table></td>

     </tr>

     <tr>

       <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

     </tr>

     <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>

       <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

 

     <tr>

       <td class="main"><b><?php echo ENTRY_TRACKING_NO;?></b><?php echo tep_draw_input_field('tracking_no'); ?></td>

     </tr>

  <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '11'); ?></td>

     </tr>

     <tr>

       <td class="main"><b><?php echo ENTRY_SHIP_DATE;?></b><?php echo tep_draw_input_field('ship_date'); ?></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

       <td class="main"><b><?php echo ENTRY_DELIVERY_DATE;?></b><?php echo tep_draw_input_field('delivery_date'); ?></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

 

     <tr>

       <td><table border="0" cellspacing="0" cellpadding="2">

         <tr>

           <td><table border="0" cellspacing="0" cellpadding="2">

             <tr>

               <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>

             </tr>

             <tr>

               <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>

               <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>

             </tr>

           </table></td>

           <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>

         </tr>

       </table></td>

     </form></tr>

     <tr>

<?php

//begin PayPal_Shopping_Cart_IPN

if (strtolower($order->info['payment_method']) == 'paypal' && isset($HTTP_GET_VARS['referer']) && $HTTP_GET_VARS['referer'] == 'ipn'){

?>

   <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('action','oID','referer'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

<?php

} else {

?>

   <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

<?php

}//else not paypal

//end PayPal_Shopping_Cart_IPN

?>

     </tr>

<?php

 } else {

?>

     <tr>

       <td width="100%"><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_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

           <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">

             <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>

               <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>

             </form></tr>

             <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>

               <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>

             </form></tr>            

           </table></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

             <tr class="dataTableHeadingRow">

               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>

               <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

             </tr>

<?php

   if (isset($HTTP_GET_VARS['cID'])) {

     $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

     $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";

   } elseif (isset($HTTP_GET_VARS['status'])) {

     $status = tep_db_prepare_input($HTTP_GET_VARS['status']);

     $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";

   } else {

     $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

   }

   $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);

   $orders_query = tep_db_query($orders_query_raw);

   while ($orders = tep_db_fetch_array($orders_query)) {

   if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {

       $oInfo = new objectInfo($orders);

     }

 

     if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {

       echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";

     } else {

       echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";

     }

?>

               <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td>            

<td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>

               <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>

               <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>

               <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

             </tr>

<?php

   }

?>

             <tr>

               <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">

                 <tr>

                   <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>

                   <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>

                 </tr>

               </table></td>

             </tr>

           </table></td>

<?php

 $heading = array();

 $contents = array();

 

 switch ($action) {

   case 'delete':

     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');

 

     $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));

     $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');

     $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);

     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

     break;

   default:

     if (isset($oInfo) && is_object($oInfo)) {

       $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']  ' . tep_datetime_short($oInfo->date_purchased) . '</b>');

 

    $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $oInfo->orders_id). '">' . tep_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');

    $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

    $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

       if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));

       $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);

//begin PayPal_Shopping_Cart_IPN

if (strtolower($oInfo->payment_method) == 'paypal') {

  include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');

  $paypal_payment_status_query = tep_db_query("select p.payment_status from " . TABLE_PAYPAL . " p left join " . TABLE_ORDERS . " o on p.paypal_ipn_id = o.paypal_ipn_id where o.orders_id ='" . $oInfo->orders_id . "'");

  $paypal_payment_status = tep_db_fetch_array($paypal_payment_status_query);

  //quick work around for unkown order status id

  $paypal_payment_status_value = (tep_not_null($paypal_payment_status['payment_status'])) ? $paypal_payment_status['payment_status'] : $oInfo->orders_status_name;

  $contents[] = array('text' => TABLE_HEADING_PAYMENT_STATUS . ': ' . $paypal_payment_status_value );

}

//end PayPal_shopping

Share this post


Link to post
Share on other sites

Hi, Alibak,

 

As of my ms2.2 version the tep_session_is_registered function lives in catalog/includes/functions/sessions.php or admin/includes/functions/sessions.php. Your configuration files need to correctly point to these. Do they?

 

Of course, it may be that the structure has been completely changed by the version you are using. That or the tep functions have been renamed to osC functions or something -- I vaguely remember reading that they were doing away with the tep prefix.

 

You might try grep or windows grep as appropriate to find out.

 

I don't have a clue about your second question, sorry.

 

CharleyShipman

Share this post


Link to post
Share on other sites

thanks but what's grep or windows grep as you mentioned ....

and yes, I believe the code has changed in the new cvs! since everything that i'm installing is giving me the same exact errors! for example: affiliate, newsdesk, paypal ipn, and etc.!

 

so maybe someone could be kind enough to help me and others learn as to how we can tackle with this problem.

 

thank you.

Share this post


Link to post
Share on other sites

Hello, guys, I have been searching a solution for this problem, but can't find one exactly, and lots of different answers...im afraid if i would do something stupid...!

 

1062 - Duplicate entry '' for key 1

 

insert into orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, orders_status, currency, currency_value, date_purchased) values ('26', 'Joe Mark', '', '12333 Sheppard Ave.', '', 'Toronto', '234 542', 'Ontario', 'Canada', '416-7569512', 'contactmark@yadyshop.com', '1', ' ', '', '', '', '', '', '', '', '', 'Joe Mark', '', '12333 Sheppard Ave.', '', 'Toronto', '234 542', 'Ontario', 'Canada', '1', 'PayPal', '', '', '', '', '100000', 'USD', '1.00000000', now())

 

Thank you for any help! :unsure:


OS-commerce is great, but with other magical contributions, that is just so "COOL"!

Share this post


Link to post
Share on other sites

Hello,

I have upgraded to 2.5a but I have problem after the checkout page.

It show this:

Fatal error: Call to a member function on a non-object in /home/imoasis/public_html/catalog/includes/sts_display_output.php on line 243

 

I am using STS and it seems that this problem is about the latest change

in the checkout_success.php

 

I have noticed that 2.5a use this phase:

paypal_order::reset_checkout_cart_session();

 

while 2.4 use this phase:

paypal_reset_checkout_cart_session();

 

So can anyone help me to solve this problem?

 

Mark

Share this post


Link to post
Share on other sites

Hi,

I have found any problem.

In the new Paypal info page (the popup in checkout_payment),

should there links under the images?

I am using STS so I don't know whether it is my problem only or not.

Share this post


Link to post
Share on other sites
Hi,

I have found any problem.

In the new Paypal info page (the popup in checkout_payment),

should there links under the images?

I am using STS so I don't know whether it is my problem only or not.

Oh sorry I misunderstand the purpose of this info page,

so just neglect this problem, thx.

Share this post


Link to post
Share on other sites
Hello,

I have upgraded to 2.5a but I have problem after the checkout page.

It show this:

Fatal error: Call to a member function on a non-object in /home/imoasis/public_html/catalog/includes/sts_display_output.php on line 243

 

I am using STS and it seems that this problem is about the latest change

in the checkout_success.php

 

I have noticed that 2.5a use this phase:

paypal_order::reset_checkout_cart_session();

 

while 2.4 use this phase:

paypal_reset_checkout_cart_session();

 

So can anyone help me to solve this problem?

 

Mark

I have found this few sentences in checkout_splash.inc.php :

 

<?php

//since this script file is called via the main osC checkout_process.php

//the main osCommerce catalog/includes/application_top.php script has already been included

//so for compatibility for those using STS etc we'll include the original osC application_bottom.php

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

So maybe the problem is due to this?

But I still don't understand how to make it compatible with STS.

Hope someone can help with this.

 

Many thanks

Share this post


Link to post
Share on other sites

Okay, i struggled and wrestled myself thru all the updates, anecdotes, pointers, small hints and other confusing little directions in this thread AND the contributions updates and added all together in this piece of text which i may add to the update for other people who are basically really not into anything that has to be done in code other than just copy the file , place it in a particular map and thats it.

 

i hope this helps some people out who are just like me crying out like a little baby after being able to update to 2.4 and the THE HORROR :o finding out about having to update to the 2.5 <_< um correct 2.5a :( uhm correct 2.5a withsmall this and that :blink: correct ....well you get the point TOO confusing for normal NOOBS like me :D

 

 

However i hope that i have figure it out correctly and now i need a little help from people who do understand all of this with the greatest of ease :D

 

I have found some differences in my 2.4 version along the way to upgrading to the latest version.

 

Could you take a look at my workflow and answer whether i need to take out in my files the parts which have the :

 

Already had: ***

 

after it [which i think it should, but i am very carefull here.

If yes, then my workflow should be a blessing for those who are feeling what i have experienced already.

 

Thanks

okay here goes my attempt:

-------------------------------------------------------------------------------------

 

 

application top already had: ***

 

// begin PayPal_Shopping_Cart_IPN

require_once DIR_WS_MODULES . 'payment/paypal/functions.php';

paypal_check_order_status();

// end PayPal_Shopping_Cart_IPN ***

 

 

now new in that page:

// begin PayPal_Shopping_Cart_IPN

paypal_order::check_order_status(true);

// end PayPal_Shopping_Cart_IPN

 

 

 

in classes/order.php

 

already had: ***

 

// begin PayPal_Shopping_Cart_IPN

$order_total_query = tep_db_query("select text, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (

 

int)$order_id . "' and class = 'ot_total'");

// end PayPal_Shopping_Cart_IPN ***

 

 

 

now new in that page:

//begin PayPal_Shopping_Cart_IPN

$shipping_method_query = tep_db_query("select title, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '"

 

. (int)$order_id . "' and class = 'ot_shipping'");

//end PayPal_Shopping_Cart_IPN

 

 

in admin orders.php

 

already had: ***

 

//begin PayPal_Shopping_Cart_IPN

if (strtolower($oInfo->payment_method) == 'paypal') {

require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.php');

$paypal_payment_status_query = tep_db_query("select p.payment_status from " . TABLE_PAYPAL . " p left join " .

 

TABLE_ORDERS . " o on p.paypal_ipn_id = o.paypal_ipn_id where o.orders_id =" . $oInfo->orders_id . "'");

$paypal_payment_status = tep_db_fetch_array($paypal_payment_status_query);

//quick work around for unkown order status id

$paypal_payment_status_value = (tep_not_null($paypal_payment_status['payment_status])) ? $paypal_payment_status[

 

'payment_status'] : $oInfo->orders_status_name ;

$contents[] = array('text' => 'Payment Status:' . ' ' . $paypal_payment_status_value );

}

//end PayPal_shopping_Cart_IPN ***

 

 

 

now new in that page:

 

//begin PayPal_Shopping_Cart_IPN

if (strtolower($oInfo->payment_method) == 'paypal') {

include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');

$paypal_payment_status_query = tep_db_query("select p.payment_status from " . TABLE_PAYPAL . " p left join " .

 

TABLE_ORDERS . " o on p.paypal_ipn_id = o.paypal_ipn_id where o.orders_id ='" . $oInfo->orders_id . "'");

$paypal_payment_status = tep_db_fetch_array($paypal_payment_status_query);

//quick work around for unkown order status id

$paypal_payment_status_value = (tep_not_null($paypal_payment_status['payment_status'])) ? $paypal_payment_status[

 

'payment_status'] : $oInfo->orders_status_name ;

$contents[] = array('text' => TABLE_HEADING_PAYMENT_STATUS . ': ' . $paypal_payment_status_value );

}

//end PayPal_shopping_Cart_IPN

 

 

 

 

in admin/includes/functions/general.php

 

already had: ***

 

//begin PayPal_Shopping_Cart_IPN

$ipn_query = tep_db_query("select paypal_ipn_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'

 

");

if (tep_db_num_rows($ipn_query)) { // this is a paypal ipn order

$ipn_order = tep_db_fetch_array($ipn_query);

$paypal_ipn_id = $ipn_order['paypal_ipn_id'];

tep_db_query("delete from " . TABLE_PAYPAL . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");

tep_db_query("delete from " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " where paypal_ipn_id = '" . (int)$paypal_ipn_id

 

. "'");

}

//end PayPal_Shopping_Cart_IPN ***

 

 

now new in that page:

 

//begin PayPal_Shopping_Cart_IPN

$ipn_query = tep_db_query("select paypal_ipn_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'

 

");

if (tep_db_num_rows($ipn_query)) { // this is a paypal ipn order

include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');

$ipn_order = tep_db_fetch_array($ipn_query);

$paypal_ipn_id = $ipn_order['paypal_ipn_id'];

tep_db_query("delete from " . TABLE_PAYPAL . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");

tep_db_query("delete from " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " where paypal_ipn_id = '" . (int)$paypal_ipn_id

 

. "'");

}

//end PayPal_Shopping_Cart_IPN

 

 

 

 

in

admin/orders.php

 

was in 2.4

include DIR_FS_CATALOG_MODULES . 'payment/paypal/admin_orders.inc.php';

 

 

changed to :

include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/orders.inc.php');

 

 

 

Also change in:

admin/includes/languages/english/orders.php

 

add:

define('TABLE_HEADING_PAYMENT_STATUS','Payment Status');

 

 

COuld someone verify all the above please?

Share this post


Link to post
Share on other sites

I think i can answer that myself :D

 

When you do not remove the ones marked with ***

Your site will display the feared white screen of death with errors about classes etc not being able to find [which is logical, since they do not exist anymore]

 

Needless to say, it sscared the*&**( out of me when that happened ;)

after following my own advise i removed the ones marked with *** and BLAM my site came back alive and i was able to swith the contribution on in my admin WHHHIIIEEEHAAAAAAA

 

My question, does the darn thing work when you do not get any errors in the admin or will i only find out when trying to use it ??? [Hope not]

Share this post


Link to post
Share on other sites

Hmm , everything SEEMS okay, however when i try to do a test, the testpage in the ipn test panel, just won't continue .

 

It displays that it is busy opening my websites /shop.ipn page, however it stays at that.

IS this normal behaviour or do i need to switch certain things on / off in the admin to correct this or make the test succeed ??

Share this post


Link to post
Share on other sites

WIIIIEEEEEHHHHHAAAAAAAAAAA

 

It seems all is working now .

just one small question about the result i got :

 

 

------------------------------------------------------

Debug

------------------------------------------------------

 

Original Post

------------------------------------------------------

business=sales@myshop.com

receiver_email=sales@myshop.com

verify_sign=PAYPAL_SHOPPING_CART_IPN-TEST_TRANSACTION-00000000000000

payment_date=14:29:13 Jul 14, 2004 CEST

digest_key=9649d3edc68b63f177143a965fade074

first_name=John

last_name=Doe

payer_business_name=ACME Inc.

payer_email=root@localhost

payer_id=PAYERID000000

payer_status=verified

invoice=

address_name=John Doe

address_street=1 Way Street

address_city=NeverNever

address_state=CA

address_zip=12345

address_country=United States

address_status=confirmed

payment_type=instant

txn_type=cart

custom=2a622848966892dd68daa91ced942b87

txn_id=2a622848966892dd6

num_cart_items=1

notify_version=1.6

memo=PAYPAL_SHOPPING_CART_IPN TEST

mc_currency=EUR

mc_gross=53.24

mc_fee=0.01

settle_amount=0.00

settle_currency=

exchange_rate=0.00

payment_status=Completed

pending_reason=

reason_code=

submit=Test IPN

 

 

 

Reconstructed Post

------------------------------------------------------

cmd=_notify-validate

business=sales%40myshop.com

receiver_email=sales%40myshop.com

verify_sign=PAYPAL_SHOPPING_CART_IPN-TEST_TRANSACTION-00000000000000

payment_date=14%3A29%3A13+Jul+14%2C+2004+CEST

digest_key=9649d3edc68b63f177143a965fade074

first_name=John

last_name=Doe

payer_business_name=ACME+Inc.

payer_email=root%40localhost

payer_id=PAYERID000000

payer_status=verified

invoice=

address_name=John+Doe

address_street=1+Way+Street

address_city=NeverNever

address_state=CA

address_zip=12345

address_country=United+States

address_status=confirmed

payment_type=instant

txn_type=cart

custom=2a622848966892dd68daa91ced942b87

txn_id=2a622848966892dd6

num_cart_items=1

notify_version=1.6

memo=PAYPAL_SHOPPING_CART_IPN+TEST

mc_currency=EUR

mc_gross=53.24

mc_fee=0.01

settle_amount=0.00

settle_currency=

exchange_rate=0.00

payment_status=Completed

pending_reason=

reason_code=

submit=Test+IPN

 

 

 

------------------------------------------------------

Invalid PayPal Response

------------------------------------------------------

Connection Type

------------------------------------------------------

curl= , socket= tcp://, domain= www.paypal.com, port= 80

 

PayPal Response

------------------------------------------------------

HTTP/1.1 200 OK

Date: Wed, 14 Jul 2004 12:10:27 GMT

Server: Apache/1.3.27 (Unix) mod_ssl/2.8.12 OpenSSL/0.9.7a

Set-Cookie: bUvZeNT5yz-4zIbcNehmA5uOJzq=_EiD-0xHf5-eac0PTjTAI4r8y32fIpRnAaRfkf0vDXKasUWfq_kj4hPpJIUhHLhqfwlDQW; expires=Tue, 12-Oct-2004 12:10:28 GMT; path=/; domain=.paypal.com

Set-Cookie: cookie_check=yes; expires=Sat, 12-Jul-2014 12:10:28 GMT; path=/; domain=.paypal.com

Set-Cookie: Apache=81.18.161.73.168941089807027913; path=/; expires=Fri, 07-Jul-34 12:10:27 GMT

Connection: close

Content-Type: text/html; charset=windows-1252

 

INVALID

 

 

 

------------------------------------------------------

Email and Business ID config

------------------------------------------------------

Store Configuration Settings

Primary PayPal Email Address: sales@myshop.com

Business ID: sales@myshop.com

------------------------------------------------------

PayPal Configuration Settings

Primary PayPal Email Address: sales@myshop.com

Business ID: sales@myshop.com

 

 

 

------------------------------------------------------

IPN INSERTED

------------------------------------------------------

IPN 1 has been inserted

 

 

 

------------------------------------------------------

Validate PayPal_Shopping_Cart Transaction Signature

------------------------------------------------------

Incorrect Signature

PayPal:

osC:

 

 

 

------------------------------------------------------

Validate Total Transaction Amount

------------------------------------------------------

Incorrect Total

PayPal: 53.24

Session:

 

 

 

 

 

What do the : INVALID RESPONSES mean?

Is this a bad thing or is this normal behaviour when testing the IPN module?

 

thanks

Share this post


Link to post
Share on other sites

Hi all,

 

I appreciate that the recent upload(s) where not ultimately upto their usual standard, I had things going on a development version and then when retesting the install I ended up making a few other adjusts which also coincided with a discusion with Joe.

Anway, the intention behind the latest versions is a better IPN/order association, info about PayPal and Credit Cards, ability for customers to resume a payment similar to the PayPal send money feature (when synchronizing invoices), and a generally better structure. Having worked with the code for so longer it was always a little irrating having to figure out whether one was looking at/for a class file, so this now clearly occurs in its file name extenstion (I couldnt change the core payment/paypal.php one).

 

Ali this contrib is specifically developed for MS2-2.2, the code has generally transformed so that it will become more easily integratable with MS3, but MS3 itself has changed some of its core implementation hence the current tep_session_* issue.

 

I'll test things again and make a more decisive update soon, for those who are working out current issues I'll try to assist here in the forum.

 

Patrick quickly looking you seemed to have discovered the differences, however for catalog/includes/orders.php you've confused ' $order_total_query ' with '$shipping_method_query' there is an edit required for both.

 

As said I'll and sort something out soon, I'm still in two minds about uploading a copy of the files with the changes already made, one point is that the install docs specifies the differences? but for demonstrational purposes maybe be useful. Actually things are getting a bit more envolved since the contrib and its functionality grows.

 

Joe, see patricks post in regard to the difference between admin_orders.php and admin/orders.inc.php.

 

Patrick, do you have the Test Mode on? ahh ok you have it going :D, the invalid response is becuase you are simulating your own ipn which PayPal will not authenticate.


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

Oh goodie, i am beginning to feel very proud now :D

 

However do you mean that

 

in classes/order.php

 

// begin PayPal_Shopping_Cart_IPN

$order_total_query = tep_db_query("select text, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (

 

int)$order_id . "' and class = 'ot_total'");

// end PayPal_Shopping_Cart_IPN

 

 

AND ALSO

 

 

//begin PayPal_Shopping_Cart_IPN

$shipping_method_query = tep_db_query("select title, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '"

 

. (int)$order_id . "' and class = 'ot_shipping'");

//end PayPal_Shopping_Cart_IPN

 

 

 

 

Both have to be placed somewhere [does it matter where, or can they be placed above each other ]

 

Because now i have deleted the

 

 

// begin PayPal_Shopping_Cart_IPN

$order_total_query = tep_db_query("select text, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (

 

int)$order_id . "' and class = 'ot_total'");

// end PayPal_Shopping_Cart_IPN

 

 

 

At the moment.

 

 

 

DO i need to put that one back again?

And you said in :

 

catalog/includes/orders.php

 

don't you mean

catalog/includes/calsses/order.php

 

 

Could you specify it a bit so i can update my textfile and upload it as a contribution addition [oh my this would be my first one :rolleyes: ]

 

 

Thanks

Edited by PVK

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
Sign in to follow this  

×