Official PayPal IPN Support Thread
#421
Posted 06 May 2005, 22:13
I am having that problem.
What I did was installed a fresh osc then put on the contribution 3.15 ipn
They are scattered around and each have updates apparently.
When IPN is working they do not need to click continue at paypal (after they click pay) and their cart and invetory gets subtracted!!!
I'm not sure which IPN is the 'new one released by OSC' anyone know?
So I had it working find and was smart enough to back it up.
Sure enough after modding only 'appearance' pages- nothing in the paypal folder than I can remember it clears the cart but does not do the inventory.
I've spent hours today trying to follow the code.
What I'm going to do now is install the working one again- make sure it still works then do a file compare. If nothing comes up that means it is a database setting.
Maybe there is an admin setting that affects this?
Settings:
Aggregate cart is fine (itemized is bad according to paypal)
Paypal settings not needed for ipn
Autoreturn not needed
The info sent to paypal sets it up.
When the IPN works it is so cool.
I tested on the live server, refunded and the status changed.
When it doesn't you can kick off your shoes close the door and click for many hours!
#422
Posted 07 May 2005, 00:54
I realise that there are many versions kicking around in the contributions section:
PayPal_Shopping_Cart_IPN
osCommerce PayPal IPN Module v1.0 For 2.2MS2
Paypal Express Checkout 1.0 Alpha
PayPal_Shopping_Cart_IPN_v2.6a (addon only)
PayPal IPN v0.981 for Milestone 2
PayPal IPN Gateway for osCommerce
PayPal IPN v0.98 for Milestone 2
PayPal IPN
As far as I'm aware, only the second one (the one this support thread relates to) is "official" in that it's developed by the osC team. It's also the simplest to install (AFAIK).
I was just hoping that someone had done some work in shifting the email notifications and stock update functions from checkout_success to ipn, and if this was successful.
I couldn't find anything with 3.15 (I used +paypal +ipn for my search term) - where is this, and did you get it to work successfully? If so, I can have a look at their code and see if I can integrate it into this one somehow.
Cheers
John
slofly, on May 7 2005, 11:13 AM, said:
What I did was installed a fresh osc then put on the contribution 3.15 ipn
They are scattered around and each have updates apparently.
(SNIP)
I'm not sure which IPN is the 'new one released by OSC' anyone know?
(SNIP)
#423
Posted 08 May 2005, 15:03
i record this error:
Parse error: parse error, unexpected ';', expecting ')' in /home/virtual/site24/fst/var/www/html/myshop/admin/includes/boxes/customers.php on line 29my customers.php
[SIZE=7]<?php
$Id: customers.php,v 1.1.1.1 2003/08/14 07:59:00 nickle Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
?>
<!-- customers //-->
<tr>
<td>
<?php
$heading = array();
$contents = array();
$heading[] = array('text' => BOX_HEADING_CUSTOMERS,
'link' => tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers'));
if ($selected_box == 'customers') {
$contents[] = array('text' =>
//Admin begin
// '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
// '<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a><br>'.
//begin PayPal_Shopping_Cart_IPN
'<a href="' . tep_href_link(FILENAME_PAYPAL, '', 'NONSSL') . '" class="menuBoxContentLink">'. BOX_CUSTOMERS_PAYPAL .'</a>';
//end PayPal_Shopping_Cart_IPN
tep_admin_files_boxes(FILENAME_CUSTOMERS, BOX_CUSTOMERS_CUSTOMERS) .
tep_admin_files_boxes(FILENAME_ORDERS, BOX_CUSTOMERS_ORDERS));
//Admin end
}
$box = new box;
echo $box->menuBox($heading, $contents);
?>
</td>
</tr>
<!-- customers_eof //-->
#424
Posted 08 May 2005, 16:15
When verifying Discount Coupon.. checkout_confirmation shows correct adjusted total (discount is redemed). But....... when it proceed to PayPal, the discount coupon is NOT reflected.
What have I done.
Although the confirmation page shows discount AND hidden values passed to PayPal reflect correct values INCLUDING amount equal to the adjusted total, PAYPAL ignores and shows the total WITHOUT the discount.
Is there somewhere I can look? Is there a patch? Is anyone else experiencing this?
Thanks!
#425
Posted 12 May 2005, 00:56
busyduck, on May 9 2005, 04:03 AM, said:
i record this error:
Parse error: parse error, unexpected ';', expecting ')' in /home/virtual/site24/fst/var/www/html/myshop/admin/includes/boxes/customers.php on line 29my customers.php
(SNIP)
(29) '<a href="' . tep_href_link(FILENAME_PAYPAL, '', 'NONSSL') . '" class="menuBoxContentLink">'. BOX_CUSTOMERS_PAYPAL .'</a>';
(SNIP)
You'll see that at the end of this line you haven't included the closing bracket ) before the ; so the line should read:
'<a href="' . tep_href_link(FILENAME_PAYPAL, '', 'NONSSL') . '" class="menuBoxContentLink">'. BOX_CUSTOMERS_PAYPAL .'</a>');
the opening bracket is on line 24:
$contents[] = array('text' =>
Try that
Cheers
John
#426
Posted 14 May 2005, 02:42
Quote
Exactly and it is a pain. Does anyone have this problem or better yet have a fix for it?
#427
Posted 18 May 2005, 14:05
because I do not require a Paypal Account they are presented with the option to Return to the site or save their information. At this point if they close the window I at least get the order and have to manually update my inventory for each item.
I am trying some messages to the user to see if it gets any better. However, I would love to find some kind of contrib that will let me at least re-process the order to update the inventory.
-G
rudizoon, on May 4 2005, 11:31 PM, said:
There have been numerous posts informing me that it shouldn't be turned on, because that's taken care of from my end. Besides, I'm not having any problems with the ipn part - I'm receiving the verifications from PayPal okay, and the order status is updated. Just that there are no osC generated emails and stock updates.
Cheers
John
#428
Posted 18 May 2005, 15:32
For the workaround I hacked the Restore Inventory On Void Order - ver.1.0 to allow me to Add/Subtract inventory for an order by changing its status.
I am not sure if you are interested in this but if you are let me know.
-G
rudizoon, on May 4 2005, 09:03 PM, said:
The module is working fine, except that no emails to customer and shopkeeper from osC, and no stock updates. I have to update the stock quantities manually, which means that it is possible that another customer can purchase the same product, even if it should be out of stock due to the first purchase. Order status update from ipn is working okay though.
I don't know what the reason is, whether it's because my customers aren't returning to my site, or the fact that I'm sending a total instead of itemised details to PayPal.
The solution is probably to create a dedicated checkout_success page for this, and transfer the email and stock transfer parts to the ipn script, with an evaluation for the PayPal status "Verified" - has anyone done this successfully?
Any other suggestions?
John
#429
Posted 20 May 2005, 11:30
I believe I see a security vulnerability in osCommerce-PayPal_IPN-v1.1/catalog/ext/modules/payment/paypal_ipn/ipn.php
POSTED variables are inserted in the database (via $comment_status) at line 147 without having gone through tep_db_prepare_input or tep_sanitize_string.
I know these should be safe from Paypal (equally unprotected insert at line 111), but the insert at line 147 is specifically for invalid IPNs - therefore any not originating from Paypal would be processed here.
Please tell me I'm wrong as this looks pretty easy to exploit...
Anna
#430
Posted 20 May 2005, 11:49
#431
Posted 21 May 2005, 01:34
Thanks in advance!
#432
Posted 23 May 2005, 14:45
2/ As for the above, I am unsure if the person making the order gets an email if they are not registered. They do get the order is they are already registered.
3/ The script cannot be used on multiple shops that use just 1 Paypal Account. Eg, shop A sells blue widgets on widgets@blahdiddy.com, and shop B sells purple wodgets on wodgets@blahdiddy.com - both these email addresses are aliases of 1 Paypal Account == cannot use this contrib without amending the "invoice" parameter.
4/ If that parameter is amended, it appears from my initial testing that the script does not update the order from preparing paypalipn to (for example) processing (even if set to do so).
I did not raise these as bugs as this is not core Code. If anyone can confirm these errors that would be helpful. Thanks.
#433
Posted 23 May 2005, 20:02
I have installed the most recent version (I think) paypal_ipn.php,v 1.1.2.11 2004/12/05
Installation was easy. The ipn works well accept for the fact that when I receive orders back I am missing all contact information including email, name and address of the customer. I have read threads about this, but have not been able to find a clear answer. The message that specifically asks the same issue I have is found here
If an answer has been given , if you could, please reply with a link to the answer.... I can't find it.
Thank you for your great contribution.
Mike
#434
Posted 26 May 2005, 17:19
IF your unencrypted calls to Paypal work, but encrypted ones don't
AND at checkout_confirmation.php you view page source and see that the hidden field called encrypted is empty
AND you have safe_mode on, then read on....
The rest of the store was fine & live since last year. I've just added osCommerce-PayPal_IPN-v1.1 and have been testing in the Sandbox. Unencrypted calls went fine (great contribution & easy to install!), but encrypted calls to Paypal were not working as field 'encrypted' was empty.
I looked at function process_button in includes/modules/payment/paypal_ipn.php and determined that line 355:
if (function_exists('openssl_pkcs7_sign') && function_exists('openssl_pkcs7_encrypt'))
was not true for us (if it's true for you then you have a different problem sorry!) so instead of the openssl_pkcs7_... calls it was doing the execs at lines 382 & 385.
Except that they were not creating the signed and encrypted files which they should have.
Well there's problems with exec & spaces with safe mode on (see the 2nd Warning in the PHP Manual (exec) that seems to mean that exec commands using redirects ("<" & ">"), among other things, will not work as expected. (The openssl commands worked fine at the linux command line.)
Sure enough, just switching safe mode off for the site worked for us.
(If you're on a shared server this has security implications.)
It would be great if this bit were coded in a way that did not rely on safe mode = off, but having spent too long hunting this down I'm off to tackle my next bit of work. I hope this helps anyone else hitting the same issue.
All the best
Anna
(using osCommerce-PayPal_IPN-v1.1 and PHP 4.3.4)
#435
Posted 28 May 2005, 03:04
I have recently installed the Paypal IPN module v1.1 to a test site which was a very easy process, well done to all contributors. Whilst testing I noticed that when customers proceed to 'Checkout' and reach the 'Confirmation' stage a 'Preparing Paypal IPN' status is created in both my 'Admin' and the 'Customers Account page'. All very good, this is what you'd expect.
But, if the customer decides to back out of the purchase (ie. doesn't proceed to Paypal to complete the purchase) and then empties his/her cart as most people would, then the 'Preparing Paypal IPN' status still remains visable from the 'Customers Account page', even though he or she cancelled and removed items from the cart.
It appears that the only way the Customer can alter this entry within their accounts section is to build a new cart and reach the 'Confirmation' stage, where by a new Perparing IPN status is created overwriting the existing one. Or obviously I can cancel it through admin.
Now, I've probably not understood this module correctly, but should the customer still be able to see 'Preparing Paypal IPN' for an order which they've decided not to proceed with and then removed the items from their cart? Isn't this going to be confusing for customers as they may well believe that their previous order is still somehow live which could deture them from inputing a new order (and reaching the confirmation stage) to overwrite the old one.
Would be very grateful if someone could advise, as I'm concerned that this action could cause potential customers testing out mysite to look elsewhere for fear that their cancelled transaction is stuck in the system, or at the very least could be very confussing to clients.
Cheers
Andy
#436
Posted 28 May 2005, 09:08
mightymidget, on May 28 2005, 03:04 AM, said:
I'm interested if anyone has any reasons that shoppers should be able to see orders with this status?
Anna
#437
Posted 28 May 2005, 22:56
Quote
Would be very grateful if someone could advise, as I'm concerned that this action could cause potential customers testing out mysite to look elsewhere for fear that their cancelled transaction is stuck in the system, or at the very least could be very confussing to clients.
Anna, on May 28 2005, 09:08 AM, said:
I'm interested if anyone has any reasons that shoppers should be able to see orders with this status?
Anna
Hi Anna, I'm glad someone agrees with me! I was starting to think I'd installed my module incorrectly and that I was the only one who'd seen this.
I'm sure this is the way it was designed to work, but like you I think it can be very confusing to potential client.
Has anybody got a idea's which would hide this status from clients after they cancel? Ultimately I know it can be removed by admin, but in normal daily business this might not be for sometime (probably the next day) by which time the client may have given up and decided to go elsewhere.
#438
Posted 30 May 2005, 11:47
Here's a quick fix to hide from shoppers their orders that are currently "Preparing" status. Store admin is completely unchanged.
It does rely on "Set Preparing Order Status" having been set to a distinctive value e.g. "Preparing [PayPal IPN]" in the Store Admin's Payment Modules - Paypal IPN section. I have NOT checked to see what would happen if this was, for example, 'default'
account.php about line 97:
Replace
$orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, 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 limit 3"); with $orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, 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_status != '" . MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_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 limit 3");
account_history.php about line 65:
Replace
$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";with
$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_status != '" . MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_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";
(I added
and o.orders_status != '" . MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID . "'
to each file's database order query.)
Warning! IF a shopper's only orders are (all) preparing status AND they look at account_history.php, they may see something like "Result Pages: -4 -3 -2 -1 0". I think this is because tep_count_customer_orders probably won't exclude orders with preparing status. I don't want to look at the implications of changing tep_count_customer_orders right now. For now, I'd rather show "Result Pages: -4 -3 -2 -1 0" than the "Preparing" orders.
Hope that helps!
Anna
#439
Posted 31 May 2005, 17:13
Anna, on May 30 2005, 11:47 AM, said:
Here's a quick fix to hide from shoppers their orders that are currently "Preparing" status. Store admin is completely unchanged.
It does rely on "Set Preparing Order Status" having been set to a distinctive value e.g. "Preparing [PayPal IPN]" in the Store Admin's Payment Modules - Paypal IPN section. I have NOT checked to see what would happen if this was, for example, 'default'
Warning! IF a shopper's only orders are (all) preparing status AND they look at account_history.php, they may see something like "Result Pages: -4 -3 -2 -1 0". I think this is because tep_count_customer_orders probably won't exclude orders with preparing status. I don't want to look at the implications of changing tep_count_customer_orders right now. For now, I'd rather show "Result Pages: -4 -3 -2 -1 0" than the "Preparing" orders.
Hope that helps!
Anna
Thanks Anna, I'm gunna give it a try later on my local installation to see how it works.
Speak to you soon
Andy
#440
Posted 31 May 2005, 23:49
I have a serious problem, since the purchased items are NOT being subtracted from the QTpro Attribute Stock......
Please, help, if there is a solution about it, or any other files i need to change.
Thank you very, VERY much...
George.














