pleasurewear Posted August 6, 2006 Share Posted August 6, 2006 I have paypal set up on my site, and when someone uses this to pay if they already have a paypal account they make payment and I have set it up so that they are transfered back to the finish page so as to complete the order process. This return path is set up on paypal itself. However paypal now has "Paypal account optional" so you go through to the same paypal page when you check that option but you can choose to pay if you dont have a paypal account. If this option is used they have to click "return to merchant" when payment is completed but this takes them back to the login page , so I get the cash but no order. Good you may say but not helpful. I have contacted paypal and they have sent me an answer I do not have a clue about, I am a novice at this so would love this explaining in English This is it: There could be a chance that the return URL your site is using may be getting cut off when users try to return back to your site. Since your return URL is a query string, you will want to make sure you are passing this variable to us through to paypal form post that takes your buyer into our system: <input type="hidden"name="rm"value="2"> This will change the return method to a "post" and make sure the query string you are using stays intact. I did not understand this and asked them to explain this is what I got back: If you have an OSCommerce shopping cart, it will depend if the cart has a preference to change this option. If not, you would need to edit the scripting of your cart. Specifically, you would need to add the "rm" variable to the form post that is sent to paypal when buyers checkout to include this variable. I am still lost with this can any boffin help. G Link to comment Share on other sites More sharing options...
pleasurewear Posted August 6, 2006 Author Share Posted August 6, 2006 helllllllllllllp Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 6, 2006 Share Posted August 6, 2006 hi, I do not think many users are still using the regular paypal mod ... most use paypal IPN from the contrib section where you get instant notification if payment was really made and orders are prerecorded. http://www.oscommerce.com/community/contri...paypal+ipn+team :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
amestres Posted August 7, 2006 Share Posted August 7, 2006 This is a problem not solved 100% with both regular paypal or paypal.IPN. With regular paypal, you will have the problem you described: if the customer does not click on "return to mechant" while on the last screen of Paypal site, you get the money but not the order. I have contacted Paypal and even suggested that they have a warning on that page indicating customers that they should click on return to merchant to no aveil. The problem with paypal.IPN is that you get the order even if the customer changes his mind once on the paypal site and decides not to pay. So you have to make sure you link each payment with each order plus erase the non paid orders. The other problem, although not major, with paypal.ipn is that, although you get the order and the payment, if the customer did not click on "return to merchant", their cart stays full with the products they ordered, so next time they go to their account they will see a full cart of past stuff. so you have to pick betwenn 2 non-perfect solutions Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 7, 2006 Share Posted August 7, 2006 This is a problem not solved 100% with both regular paypal or paypal.IPN. With regular paypal, you will have the problem you described: if the customer does not click on "return to mechant" while on the last screen of Paypal site, you get the money but not the order. I have contacted Paypal and even suggested that they have a warning on that page indicating customers that they should click on return to merchant to no aveil. The problem with paypal.IPN is that you get the order even if the customer changes his mind once on the paypal site and decides not to pay. So you have to make sure you link each payment with each order plus erase the non paid orders. The other problem, although not major, with paypal.ipn is that, although you get the order and the payment, if the customer did not click on "return to merchant", their cart stays full with the products they ordered, so next time they go to their account they will see a full cart of past stuff. so you have to pick betwenn 2 non-perfect solutions Alex, both of your paypal IPN issues can easily be corrected. if you prefer not to see the preparing paypal IPN orders - which are clearly those that have not been payed, you can run a cron job to deleted all those orders after say 20 minutes. The second issue about the cart not emptying is even easier ... just add these 3 lines to your ipn.php in the ext folder: ( added it right below the history table insert) $customer_id = $_POST['custom']; tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'"); Next time the user logs in, his cart is empty ... UNLESS he logs back right afterwards, but not by clicking the button. We can safely say that this hack takes care of most situations ... :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Nap BlownApart Posted August 17, 2006 Share Posted August 17, 2006 Hi Monika, Since I am fairly new to osCommerce, and PHP for that matter, I have have a couple questions about your advice. In the 'ipn.php' file, there are two places where the History Table Insert takes place. Once where an normal notification is received, and the other when a debug email is generated. Do I put the 3 lines of code you gave in the first (normal notification) place or both? (I have assumed that it's only needed when normal notification is received.) My other question is about the CRON JOB. I have a shared SSL server, and therefore don't have access to SSH. But I do have access to CRON JOBs through cPanel. Here are my questions: Where can I get the script to properly delete the orders in 'Preparing [PayPal IPN]'? Can you give a sample command line that I would put into CRON Jobs? Cheers, Nap Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 17, 2006 Share Posted August 17, 2006 Hi Monika, Since I am fairly new to osCommerce, and PHP for that matter, I have have a couple questions about your advice. In the 'ipn.php' file, there are two places where the History Table Insert takes place. Once where an normal notification is received, and the other when a debug email is generated. Do I put the 3 lines of code you gave in the first (normal notification) place or both? (I have assumed that it's only needed when normal notification is received.) My other question is about the CRON JOB. I have a shared SSL server, and therefore don't have access to SSH. But I do have access to CRON JOBs through cPanel. Here are my questions: Where can I get the script to properly delete the orders in 'Preparing [PayPal IPN]'? Can you give a sample command line that I would put into CRON Jobs? Cheers, Nap Hi, the delete commands in ipn file go only under the top histrory table the one for PayPal IPN Verified as for the cron job, well each host's cron needs a different file call for running php files ... you should confirm with them which method to use. My old host used wget and the new one uses /dev /null etc etc as for the file called, I do not have one ready for you. You create a query for all orders that are stuck with the ID your preparing status has for more than 20 minutes. Loop through that ... delete order itself, orders_products, the attributes, history and totals table rows associated with this order. You'll have to write it yourself ;-). :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Nap BlownApart Posted August 17, 2006 Share Posted August 17, 2006 Thanks Monika. Does anyone else have a script already written to delete orders in Preparing [PayPal IPN] status? If I write my own, I will post them here. Cheers, Nap Link to comment Share on other sites More sharing options...
drtduarte Posted May 10, 2008 Share Posted May 10, 2008 Thanks Monika. Does anyone else have a script already written to delete orders in Preparing [PayPal IPN] status? If I write my own, I will post them here. Cheers, Nap Hello Nap, Do you have it already? Link to comment Share on other sites More sharing options...
drtduarte Posted May 14, 2008 Share Posted May 14, 2008 Download the script here: http://addons.oscommerce.com/info/5949 Take care ;) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.