Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

No IPN Payments In Sandbox

 

This seems to be a recurring theme in this thread, but so far I have not found anything that seems to explain the reasons why...

 

I am in the process of setting up my very first osC site with PayPal IPN and have downloaded and installed v2.2 of the contribution. I have set up the test acount in my PayPal sandbox and the module appears to let the payment through with no problem.

 

There are no error messages, the user is returned to the site as expected and order process e-mails flow happily to the user, but yet there are no payments arriving in my sandbox account?

 

I've gone through every order staus including "Preparing [PayPal IPN]" expecting an event somewhere to trigger the payment to PayPal, but still nothing.

 

Even adding a debug e-mail address doesn't do anything. No e-mail arrives there either so one would assume that there is no problem with the order.

 

I've tried turning on the IPN settings in the PayPal profile and adding the full URL, but that has no effect either.

 

Does the module in "test" mode actually talk to the Sandbox or is it simply nulling the orders?

 

Is there a log on the osC database that logs the responses back from Paypal IPN?

 

I have no way of knowing whether this is working or not. How do I intercept? How do I know that a payment is being processed without trying it live and incurring cost? Isn't that what the Sandbox is all about?

 

I'm about to e-mail my host to see if there is anything specific (ie proxy) I need to set up as this is the only thing left I can think of.

 

Any help would be appreciated.

 

Cheers,

 

Roy

Share this post


Link to post
Share on other sites
No IPN Payments In Sandbox

I've gone through every order staus including "Preparing [PayPal IPN]" expecting an event somewhere to trigger the payment to PayPal, but still nothing.

Roy

 

#1) See this posting:

 

http://forums.oscommerce.com/index.php?s=&...t&p=1060220

 

You must have register globals turned on in the paypal_ipn directory.

 

#2) Try V1.0 (the original) by Harald Ponce de Leon. It's very simple and works flawlessly.

Share this post


Link to post
Share on other sites

Hello,

 

I'll try to describe my problem with more details. Hopefully it can give someone an idea.

 

The contribution is setup as follows:

 

- Preparing order status is set to "Preparing [Paypal IPN]"

- Acknowledged order status is set to "default" which is "processing"

 

My Paypal account has "Auto-return" set to "ON". And it is pointed to my checkout_process.php. IPN is not enabled in my Paypal account.

 

I made some live transactions on my website to test the module. Here are the tests and the results:

 

TEST 1:

 

I went to my store and made a purchase using the Paypal IPN payment method. When I am sent to Paypal, but before I make the payment, an order is created in admin. The status of this order is "Preparing [Paypal IPN]". No notification is sent.

Once I make the payment in Paypal, but am still on Paypal's website, the status of the order is updated to "Processing" (the default status). No notification is sent. I only get a Paypal confirmation.

When I click on the return link in Paypal, I am returned to my website. I can see that checkout_process.php is loaded and then checkout_success.php is loaded. At this point, the status of the order is again updated to "Preparing [Paypal IPN]" and this time I receive a notification as a customer.

 

QUESTIONS:

 

- Why is the status updated to "Processing" when the customer makes the payment? Isn't it supposed to be updated when the customer returns to the website?

- Why is the status updated to "Preparing [Paypal IPN]" when the customer returns to the store?

 

TEST 2:

 

I went to my store and made a purchase using the Paypal IPN payment method. When I am sent to Paypal, but before I make the payment, an order is created in admin. The status of this order is "Preparing [Paypal IPN]. No notification is sent.

Once I make the payment in Paypal, but am still on Paypal's website, the status of the order is updated to "Processing" (the default status). No notification is sent. Paypal sends an email confirmation.

At this point I close the Paypal browser window. The status remains "Processing" (the default status) and no notification is sent.

 

QUESTIONS:

 

- Why is the status updated to "Processing" when the customer makes the payment? Isn't it supposed to be updated when the customer returns to the website?

- What is the function of "Auto-return" in Paypal?

 

I hope this will give someone an idea. I have been scanning the php files involved and cannot figure it out.

 

Thanks in advance for any help or suggestions. :thumbsup:

 

Karim.

Share this post


Link to post
Share on other sites

Which version of the PayPal IPN module you're testing with?

 

The premature order (with Preparing status) was created when you reached checkout_confirmation.php, and the status got updated after you paid because the IPN is received. If you're testing with v2.2, the email should be sent at the same time, even you didn't return to store.

 

I can't think of any reason why the status got 'updated' back to Preparing when you returned, unless there is something wrong in your code or your osCommerce setup.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
Which version of the PayPal IPN module you're testing with?

 

The premature order (with Preparing status) was created when you reached checkout_confirmation.php, and the status got updated after you paid because the IPN is received. If you're testing with v2.2, the email should be sent at the same time, even you didn't return to store.

 

I can't think of any reason why the status got 'updated' back to Preparing when you returned, unless there is something wrong in your code or your osCommerce setup.

 

 

I am testing with version 1.4.

 

You are right. The premature order is created properly and the status is updated when my store receives the IPN after the payment is made.

 

What puzzles me is:

 

- How come the email confirmation is not sent to the customer?

- How come the status is updated back to "Preparing [Paypal IPN]"?

 

I am pretty sure that version 1.4 does not send an email if I don't go back to the store. But it doesn't even send it when I do go back to the store...

I will go through the files again. My store is quite modified so maybe something is wrongly setup.

 

Thanks for the help. ;)

Share this post


Link to post
Share on other sites

Hi Terra,

 

Ok, further testing reveals the following:-

 

I am using a sandbox account

Register globals is ON

All order IDs and emails are getting through fine

Stock count is NOT being updated

Order status is NOT being updated from "1"

 

Any help / guidance would be MUCH apprechiated!

 

DoA

 

ps. Just so you know, I am using the "Super Download Shop" mod & the author referred me to this topic for help because he is convinced it is a paypal problem.

Share this post


Link to post
Share on other sites

Please check your orders and see what you got in the comments (IPN reponse). I thought you didn't get any IPN at all.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
I debugged the ipn.php and I have the phenomenon, that only the variable "invoice" is empty. The ipn.php gets "verified"-status from paypal, but can't update the status without the invoice-number.

Jonas - did you make ANY modification to the ipn.php or paypal_ipn.php? The order ID is sent as a POST variable and unless any mods have been made, it should work as is. The relevant code is:

 

In paypal_ipn.php the order id variable is constructed & sent to Paypal:

$_SESSION['cart_PayPal_IPN_ID'] = $cartID . '-' . $insert_id;
......................
$parameters['invoice'] = substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

 

In ipn.php the order id is received:

	if (isset($_POST['invoice']) && is_numeric($_POST['invoice']) && ($_POST['invoice'] > 0)) {
  $order_query = tep_db_query("select currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . $_POST['invoice'] . "' and customers_id = '" . (int)$_POST['custom'] . "'");
  if (tep_db_num_rows($order_query) > 0) {
	$order_db = tep_db_fetch_array($order_query);

  // let's re-create the required arrays
	 require(DIR_WS_CLASSES . 'order.php');
	 $order = new order($_POST['invoice']);

all the best - Terra

 

PS: a previous poster on this thread had an issue with the order id as he implemented the "duplicate order id" fix slightly wrong - if you are using this fix, please post the top part of your ipn.php file on this thread (the first 100 lines - no need for more).


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites
Just so you know, I am using the "Super Download Shop" mod & the author referred me to this topic for help because he is convinced it is a paypal problem.

The PayPal IPN requires custom integration with any modification which affects checkout_process.php. If "super download shop" modifies checkout_process.php then you or your developer must custom integrate it - it won't work "out of the box". For heavily modified shops I do not recommend using the PayPal IPN unless you have an experienced PHP developer on board. A simpler solution might be to use the standard PayPal module and to implement a different contrib which pre-saves orders or baskets (there are several in the contrib section). All the best - Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites
- Why is the status updated to "Processing" when the customer makes the payment? Isn't it supposed to be updated when the customer returns to the website?

- What is the function of "Auto-return" in Paypal?

The functionality of auto-return is to automatically transfer you back to the shop once payment has been made (usually you get a message "you will be transferred within 10 seconds). It only works if somebody pays with PayPal account as far as I know. Enabling it doesn't harm, but I wouldn't expect any miracles from it either - some customers will still fail to return to your site.

 

The update to "processing" is correct - the update is done once payment is confirmed by PayPal. PayPal sends a notification to the ipn.php file which then updates the order status. The customer does not have to return to your site for this update to happen.

 

Regarding the order status going back to "preparing" .. there were some updates in v1.4 to avoid problems with order ids / changing orders, not sure if this affects it. I've stopped development on version 1.x so I can only offer 1. to use the module as is (and change the order status yourself) or 2. to upgrade to the 2.x version. Not sure if this helps. My pragmatic view is that if everything else works and it's not a showstopper, then use the module as is. All the best - Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites

Agghh!!

 

I have no reinstalled my shop so I'm starting from a vanilla install.

 

I get the paypal emails to the customer (copy included below)

I DO NOT get the paypal emails to the admin address listed in Oscommerce admin section

Order status is updating partially to "2" which is my "Set PayPal Acknowledged Order Status"

 

It seems like paypal is not posting back to my site. Could it be a file permission (CHMOD 777) error? Do I need to set some files / folders to be writeable?

Share this post


Link to post
Share on other sites
It seems like paypal is not posting back to my site. Could it be a file permission (CHMOD 777) error? Do I need to set some files / folders to be writeable?

Adam - on most servers 777 is not alllowed for php files as it's a security risk. The files should be 644. If you set your php files to 777 then it's likely that they will be blocked by the server & not executed. If in doubt, check with your hosting provider. And if this does not help, please use my debug file as posted earlier on this thread - without more info, we can't help. Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites

Hi Terra,

 

I've asked support and here is the reply :( :(

 

Hello Adam,

 

Due to the clustered structure of our systems there is no single log file for you to use as your site is served by many servers............

 

Is there any way I can generate the error log on the server and output it as a text file? If you know it can be done I will obviously research HOW exactly to do it.

Share this post


Link to post
Share on other sites
Is there any way I can generate the error log on the server and output it as a text file? If you know it can be done I will obviously research HOW exactly to do it.

Sorry - I'm used to working with standard servers. If you don't have an error log, then you can replace the error entries with send mail commands (posting yourself the info via email) or just keep trying different solutions suggested on this thread. Personally I'd also ditch the hosting provider but then again I'm biased :) Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites

I have modified the debug.php file so that it sends me an email with errors. I have simply replaced error_log with mail() function. As below ->

 

mail( "MY EMAIL ADDRESS", "Debug Form Results", "PP TEST start", "From: $email" );

 

However none of the emails are getting through, does this mean that it isn't even hitting the ipn script??

 

Adam

 

ps. it is the /ext/ directory ipn.php I need to modify isn't it?

Share this post


Link to post
Share on other sites

I have modified the debug.php file so that it sends me an email with errors. I have simply replaced error_log with mail() function. As below ->

 

mail( "MY EMAIL ADDRESS", "Debug Form Results", "PP TEST start", "From: $email" );

 

However none of the emails are getting through, does this mean that it isn't even hitting the ipn script??

 

Adam

 

ps. it is the /ext/ directory ipn.php I need to modify isn't it?

Share this post


Link to post
Share on other sites

Yes - it is ipn.php in the /ext/ directory. As long as you correctly defined MY EMAIL ADDRESS and $email, then it should work. If no emails get triggered, then PayPal does not access the file. In this case you may want to check permissions as PayPal needs clear access to the /ext/ directory. Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites

Thanks a lot for the explanations Terra.

 

I will keep on fiddling with the files.

Like you said, I have 2 options: using it as is or upgrading to 2.x.

 

Would there be any specific version you would recommend (same features as 1.4 and most bugs fixed)?

 

Thanks again :thumbsup:

 

Karim.

 

 

 

 

The functionality of auto-return is to automatically transfer you back to the shop once payment has been made (usually you get a message "you will be transferred within 10 seconds). It only works if somebody pays with PayPal account as far as I know. Enabling it doesn't harm, but I wouldn't expect any miracles from it either - some customers will still fail to return to your site.

 

The update to "processing" is correct - the update is done once payment is confirmed by PayPal. PayPal sends a notification to the ipn.php file which then updates the order status. The customer does not have to return to your site for this update to happen.

 

Regarding the order status going back to "preparing" .. there were some updates in v1.4 to avoid problems with order ids / changing orders, not sure if this affects it. I've stopped development on version 1.x so I can only offer 1. to use the module as is (and change the order status yourself) or 2. to upgrade to the 2.x version. Not sure if this helps. My pragmatic view is that if everything else works and it's not a showstopper, then use the module as is. All the best - Terra

Share this post


Link to post
Share on other sites

nope, still no emails. I have just installed the stock files from 2.2 Paypal IPN - is there a fix / mod in this topic that I need to apply / code I need to change that I've missed?

 

All I want to do is make it so that people cannot access my downloads without paying first (the hack where they go to paypal but don't pay & get the download link) will version 1 of this MOD suffice? I know it is alot more stable than this one seems to be (on my server).

 

DoA

Share this post


Link to post
Share on other sites

nope, still no emails. I have just installed the stock files from 2.2 Paypal IPN - is there a fix / mod in this topic that I need to apply / code I need to change that I've missed?

 

All I want to do is make it so that people cannot access my downloads without paying first (the hack where they go to paypal but don't pay & get the download link) will version 1 of this MOD suffice? I know it is alot more stable than this one seems to be (on my server).

 

DoA

Share this post


Link to post
Share on other sites

ive installed the latest paypal ipn module (14 January 2007 - 2.2 Release). when a customer makes a purchase, i receive an email from my store and paypal, the inventory is updated, and the admin mainpage shows the order as pending, but admin order page shows 0 orders as does the customer history. I am able to manually type in the order id number that i get in the transaction completed email and see the order, yet my admin order page shows 0 orders when sorted by "all orders".

 

I tried turning off the paypal ipn module and running the standard paypal module and the problem is repaired. i see the new orders placed (while running standard paypal (non-ipn) module) in my admin order page as well as in the customer order history.

 

i have the os commerce store placed in the root level (the catalog folder is my root level). does this have something to do with me not having the catalog folder and a path needing to be updated in one of the ipn files?

 

please help!

Share this post


Link to post
Share on other sites

ive installed the latest paypal ipn module (14 January 2007 - 2.2 Release). when a customer makes a purchase, i receive an email from my store and paypal, the inventory is updated, and the admin mainpage shows the order as pending, but admin order page shows 0 orders as does the customer history. I am able to manually type in the order id number that i get in the transaction completed email and see the order, yet my admin order page shows 0 orders when sorted by "all orders".

 

I tried turning off the paypal ipn module and running the standard paypal module and the problem is repaired. i see the new orders placed (while running standard paypal (non-ipn) module) in my admin order page as well as in the customer order history.

 

i have the os commerce store placed in the root level (the catalog folder is my root level). does this have something to do with me not having the catalog folder and a path needing to be updated in one of the ipn files?

 

please help!

Share this post


Link to post
Share on other sites

Question about missing customer confirmation email.

 

I placed a test order using paypal and received a "notification of payment received" from Paypal, but the order confirmation email from the store itself did not arrive.

 

When I place a test order using the "cash on delivery" module, I do get the confirmation email.

 

Admin shows this:

 

Date Added Customer Notified Status Comments

04/21/2007 02:31:36 Preparing [PayPal IPN]

 

 

Why am I not getting a customer order confirmation email when using Paypal?

 

Any input will be much appreciated.

Share this post


Link to post
Share on other sites

I have the same problem, when customers pay with paypal I get no order confirmation email from the store, but I do get notification of payment from paypal, and the order is stored in store's database and customer history.

What can we do to receive order confirmation emails? note that we do get them when customers choose other payment methods.

 

Any help would be appreciated.

 

Isabella


~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites

Ok, last call for help here. :(

 

Does ANYONE have MVS (Multi Vendor Shipping) successfully integrated with Paypal IPN V1.4 or greater? I know of over 20 people here at the forums who would greatly benefit from this merge.

 

If so, then you have modified paypal_ipn.php with the MVS changes from checkout_shipping.php

 

PLEASE PLEASE PLEASE contact me if you have pulled this off!

 

Best of luck everyone!

Edited by phi148

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

×