Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quick question: Confirming when using paypal...


ActiveTuning

Recommended Posts

I haven't tried it yet, but when you pay using PayPal it goes right to PayPals site. What happens after? Does it go back to my store to confirm? One of my customers just payed with PayPal, but the order hasn't showed up in my system, and when looking who's online he's on:

 

/store/checkout_confirmation.php?osCsid=2eb1a053fefb149aea63a2f9

 

Any help would be appreciated.

Link to comment
Share on other sites

Alright I just did a paypal payment to see what the problem was, and after I did the payment it says click to continue and the link went here:

 

http:///store/checkout_process.php?osCsid=8f74d17ad8782ddc796c886149185cf1

 

Where it should have gone to:

 

http://www.activetuning.com/store/checkout...96c886149185cf1

 

What do I do about this? Is there any way to process the order in OSC's database as soon as you press confirm the first time?

 

What do I do? This is a pretty big problem....

Link to comment
Share on other sites

If the transaction is complete, it goes to success otherwise it's not a success :shock:

 

As to why you are encountering this on paypal ... what version and snapshot are you using?

 

Have you made and changes or modifications to the /includes/modules/payment/paypal.php file?

Link to comment
Share on other sites

I can send somebody any file that they think there might be a problem with? I don't how to resolve this, but now I just got my first order and it doesn't even say what they got, so I have to e-mail them about it before even putting it in.....

 

Somebody please help me! I'm sure it's some retarded reason this is happening...

Link to comment
Share on other sites

Here's my paypal.php any noticeable issues in here?

 

<?php

/*

 $Id: paypal.php,v 1.29 2002/08/13 16:00:42 dgw_ Exp $



 The Exchange Project - Community Made Shopping!

 http://www.theexchangeproject.org



 Copyright (c) 2000,2001 The Exchange Project



 Released under the GNU General Public License

*/



 class paypal {

   var $code, $title, $description, $enabled;



// class constructor

   function paypal() {

     $this->code = 'paypal';

     $this->title = MODULE_PAYMENT_PAYPAL_TEXT_TITLE;

     $this->description = MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION;

     $this->enabled = MODULE_PAYMENT_PAYPAL_STATUS;

   }



// class methods

   function javascript_validation() {

     return false;

   }



   function selection() {

     return false;

   }



   function pre_confirmation_check() {

     return false;

   }



   function confirmation() {

  global $checkout_form_action;



     $checkout_form_action = 'https://secure.paypal.com/cgi-bin/webscr';

   }



   function process_button() {

     global $order, $currencies;



     $process_button_string = tep_draw_hidden_field('cmd', '_xclick') .

                              tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) .

                              tep_draw_hidden_field('item_name', STORE_NAME) .

                              tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->currencies['USD']['value'], 2)) .

                              tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $currencies->get_value('USD'), 2)) .

                              tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .

                              tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));



     return $process_button_string;

   }



   function before_process() {

     return false;

   }



   function after_process() {

  return false;

   }



   function output_error() {

     return false;

   }



   function check() {

     if (!isset($this->_check)) {

       $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'");

       $this->_check = tep_db_num_rows($check_query);

     }

     return $this->_check;

   }



   function install() {

     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Allow PayPal', 'MODULE_PAYMENT_PAYPAL_STATUS', '1', 'Do you want to accept PayPal payments?', '6', '3', now())");

     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPal ID', 'MODULE_PAYMENT_PAYPAL_ID', '[email protected]', 'Your buisness ID at PayPal.  Usually the email address you signed up with.  You can create a free PayPal account at http://www.paypal.com.', '6', '4', now())");

   }



   function remove() {

     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'");

     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_ID'");

   }



   function keys() {

     $keys = array('MODULE_PAYMENT_PAYPAL_STATUS', 'MODULE_PAYMENT_PAYPAL_ID');



     return $keys;

   }

 }

?>

Link to comment
Share on other sites

I'm thinking it's more of a problem with maybe checkout_confirmation:

 

<?php

/*

 $Id: checkout_confirmation.php,v 1.120 2002/08/23 08:54:13 harley_vb Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

*/



 require('includes/application_top.php');



 if (!tep_session_is_registered('customer_id')) {

   $navigation->set_snapshot(array('mode' => 'NONSSL', 'page' => FILENAME_SHOPPING_CART));

   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 }



// Check if there is something in the cart

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

   tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));

 }



// Stock Check

 $any_out_of_stock = 0;

 if (STOCK_CHECK == 'true') {

   $products = $cart->get_products();

   for ($i=0; $i<sizeof($products); $i++) {

     if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {

       $any_out_of_stock = 1;

     }

   }

   // Out of Stock

   if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock) ) {

     tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

   }

 }



// Register checkout variables

 if ($HTTP_POST_VARS['comments']) {

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

 }

 if ($HTTP_POST_VARS['payment']) {

   $payment = stripslashes($HTTP_POST_VARS['payment']);

 }

 if ($HTTP_POST_VARS['shipping_selected']) {

   $shipping_selected = stripslashes($HTTP_POST_VARS['shipping_selected']);

 }

 if (!tep_session_is_registered('comments')) {

   tep_session_register('comments');

 }

 if (!tep_session_is_registered('payment')) {

   tep_session_register('payment');

 }

 if (!tep_session_is_registered('shipping_selected')) {

   tep_session_register('shipping_selected');

 }

 if (!tep_session_is_registered('shipping_cost')) {

   tep_session_register('shipping_cost');

 }

 if (!tep_session_is_registered('shipping_method')) {

   tep_session_register('shipping_method');

 }



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

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_ADDRESS, '', 'SSL'));

 $breadcrumb->add(NAVBAR_TITLE_2);



// load shipping modules as objects

 require(DIR_WS_CLASSES . 'shipping.php');

 $shipping_modules = new shipping;



// load payment modules as objects

 require(DIR_WS_CLASSES . 'payment.php');

 $payment_modules = new payment;



 if (MODULE_PAYMENT_INSTALLED) {

   $payment_modules->pre_confirmation_check();

 }



 if (MODULE_SHIPPING_INSTALLED) {

   $shipping_modules->confirm();

 }



 require(DIR_WS_CLASSES . 'order_total.php');

 require(DIR_WS_CLASSES . 'order.php');

 $order = new order;

 $order_total_modules = new order_total;

?>

<!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 (getenv('HTTPS') == 'on' ? 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>

         </tr>

       </table></td>

     </tr>

     <tr>

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

     </tr>

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

     <tr>

       <td>

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

         <tr>

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

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

           <td class="tableHeading" align="right"><?php echo TABLE_HEADING_TOTAL; ?></td>

         </tr>

         <tr>

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

         </tr>

<?php

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

     echo '          <tr>' . "n" .

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

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



     if (STOCK_CHECK == 'true') {

       echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);

     }



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

       for ($j=0; $j<sizeof($order->products[$i]['attributes']); $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->display_price($order->products[$i]['attributes'][$j]['price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . ')';

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

       }

     }



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

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

     echo '            <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "n";

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

 }

?>

         <tr>

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

         </tr>

         <tr>

           <td colspan="4" align="right"><table border="0" cellspacing="0" cellpadding="1">

<?php

 if (MODULE_ORDER_TOTAL_INSTALLED) {

   $order_total_modules->process();

   echo $order_total_modules->output();

 }

?>

           </table></td>

         </tr>

       </table></td>

     </tr>

     <tr>

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

         <tr>

           <td class="tableHeading"><?php echo TABLE_HEADING_DELIVERY_ADDRESS; ?></td>

         </tr>

         <tr>

           <td><?php echo tep_draw_separator(); ?></td>

         </tr>

         <tr>

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

         </tr>

       </table></td>

     </tr>

     <tr>

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

<?php

  if (MODULE_PAYMENT_INSTALLED) {

?>

         <tr>

           <td class="tableHeading"><br><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></td>

         </tr>

         <tr>

           <td><?php echo tep_draw_separator(); ?></td>

         </tr>

         <tr>

           <td><?php echo $payment_modules->confirmation(); ?></td>

         </tr>

<?php

 }



 if (!$checkout_form_action) {

   $checkout_form_action = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

 }



 echo '<form name="checkout_confirmation" method="post" action="' . $checkout_form_action . '">';



 if ($order->info['comments']) {

?>

         <tr>

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

         </tr>

         <tr>

           <td><?php echo tep_draw_separator(); ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo nl2br($order->info['comments']); ?></td>

         </tr>

<?php

 }

// Stock Options prompts user for sending when STOCK is available or send now !

 if ( ($any_out_of_stock) && (STOCK_ALLOW_CHECKOUT == 'true') ) {

?>

         <tr>

           <td class="tableHeading"><br><?php echo TEXT_STOCK_WARNING; ?></td>

         </tr>

         <tr>

           <td><?php echo tep_draw_separator(); ?></td>

         </tr>

         <tr class="payment-odd">

           <td class="main"><?php echo TEXT_MULTIPLE_SHIPMENT; ?> <input type="radio" name="shiptype" value="Multiple Ship" checked><?php echo TEXT_UNIQUE_SHIPMENT; ?><input type="radio" name="shiptype" value="Single Ship"></td>

         </tr>

         <tr>

           <td class="infoBox"><br><?php echo TEXT_STOCK_WARNING_DESC; ?></td>

         </tr>

         <tr>

           <td class="infoBox"><b><?php echo TEXT_IMEDIATE_DELIVER; ?></b><br><br>

<?php

   for ($i=0; $i<sizeof($products); $i++) {

     if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {

       echo '<b>' . tep_get_products_stock($products[$i]['id']) . '</b> ' . TEXT_UNITS . ' <b>' . $products[$i]['name'] . '</b><br>';

     }

   }

?>

           </td>

         </tr>

<?php

 }

?>

         <tr>

           <td align="right" class="main"><br>

<?php

 echo tep_draw_hidden_field('prod', $HTTP_POST_VARS['prod']) .

      $payment_modules->process_button();



 if (!$checkout_form_submit) {

   echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER);

 } else {

   echo $checkout_form_submit;

 }

?></td>

         </tr></form>

       </table></td>

     </tr>

     <tr>

       <td align="right" class="checkoutBar"><br>[ <?php echo CHECKOUT_BAR_DELIVERY_ADDRESS; ?> | <?php echo CHECKOUT_BAR_PAYMENT_METHOD; ?> | <span class="checkoutBarHighlighted"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></span> | <?php echo CHECKOUT_BAR_FINISHED; ?> ]</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'); ?>

Link to comment
Share on other sites

  • 1 month later...

I found something new....In the HTML when confirming an order for the hidden variables it sends to paypal it shows this:

 

<form name="checkout_confirmation" method="post" action="https://secure.paypal.com/cgi-bin/webscr">          <tr>

           <td align="right" class="main"><br>

<input type="hidden" name="prod" value=""><input type="hidden" name="cmd" value="_xclick"><input type="hidden" name="business" value="[email protected]"><input type="hidden" name="item_name" value="Active Tuning"><input type="hidden" name="amount" value="200.00"><input type="hidden" name="shipping" value="9.26"><input type="hidden" name="return" value="/store/checkout_process.php?osCsid=636e1c66fd8c8b51f58b40350183915e"><input type="hidden" name="cancel_return" value="/store/checkout_payment.php?osCsid=636e1c66fd8c8b51f58b40350183915e"><input type="image" src="includes/languages/english/images/buttons/button_confirm_order.gif" border="0" alt="Confirm Order" title=" Confirm Order "></td>

         </tr></form>

 

Shouldn't the values be like http://SITEURL/store rather than just /store? Would that be causing the problem?

Link to comment
Share on other sites

I unfortunately do not know exactly how the included PayPal support or the PayPal IPN contribution work exactly but suggest that they *not* process an order based on the "return" URL but instead use the Instant Payment Notification (IPN) POST. This is easy to do and the merchant need not configure anything in their PayPal account. In the PayPal button which transfers the buyer to PayPal to pay, simply include a "notify_url" which points to a script that will process the PayPal payment. The mere presence of "notigy_url" will activate IPN for that payment. Since OSC presumably can figure out the merchant's URL, it should be able to figure out the correct URL to populate "notify_url" with. Processing "notify_url" is much more reliable because it does not depend on the buyer clicking the "Continue" button and the PayPal server retries until successfull (merchant server returns "200 OK" response).

 

I'm happy to provide further assistance for those developing PayPal itnerfaces.

Patrick Breitenbach

Link to comment
Share on other sites

Patrick, Yeah the odd thing is that OSC supports PayPal from the get go....Which means the issue I am having shouldn't have happened in the first place...If I am having the issue, it would mean everybody else should be as well. That's why I'm trying to at least figure out what is different with my configuration that is causing it not to send the correct URL, and basically not put the order into our system. It would be nice to make it so that the customer does not need to press the continue button either...not sure if that's the case already or not...

Link to comment
Share on other sites

Alright, I just finished installing the PayPal IPN. Works like a charm...BUT, when you press continue it still goes here:

 

http:///store/checkout_success.php?osCsid=41c99187a17096d8fd960a023a7be4d4

 

If I can't get that fixed, at least the orders are getting in the system now....that's a huge improvement. But any ideas on that???

Link to comment
Share on other sites

The IPN was developed and contributed by a user of Oscommerce. I believe that the Core Team are going to be putting forward some of the better contributions for inclusion in the base code of Oscommerce - the IPN might well be one of them.

 

Without IPN, this situation may occur:

 

- User buys a product from your shop, checks out and chosoes to pay by Paypal.

- He then goes off to Paypal and transfers the money to your Paypal account. Lovely.

- If he doesn't press [continue] in the Paypal screen the sale IS NOT REGISTERED in your Admin section of your Osc site. Not good.

 

With IPN, your Osc shop is notified of a sale - means you do not have to look foolish and contact the customer to ask what he ordered.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...