Jump to content
cdetdi

When is /ext/.../standard_ipn used?

Recommended Posts

Short story long I'm suffering from Paypal standard transactions that randomly have issues.  I believe it is due to the two different IPN channels - payments_standard and /ext/../standard_ipn.php.  Whenever I do testing my orders seem to use the payments_standard file and skip the ipn file, but, maybe 20-25% of orders seem to be doing the opposite.

Is there some easy way to understand which file handles the "processing" of the IPN information?


Two forks diverged in a git, and I— I took the fork traveled by burt, And that has made all the difference.

Share this post


Link to post
Share on other sites

As far as I recall, it depends on one thing; whichever "signal" gets back to the shop first.

If the customer arrives back before the IPN...
-or-
If the IPN arrives before the customer.

 


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

In case you don't know, IPN (instant payment notification) is a feature so paypal automatically contacts your site to tell it about things that happen with payments in paypal - like it's been paid, if it was an echeque that it's cleared, it's been refunded and so on. It's a security feature making it harder for hackers to steal from you by faking paymennts. If you also run an ebay account and you look at your paypal logs in osc you'll see that it tells your site about those payments too!

All of these IPNs trigger the ipn listener in /ext/... if the listener can find a related order it will write a history record that you can see in admin.

Now, sometimes when people pay with paypal they don't come back to your site - maybe they don't wait long enough after hitting pay and rush back to looking at porn or their connection drops or whatever. So if the ipn listener gets notified that the payment is there and the order is in the Preparing status, it will go ahead and complete the order, do the stock adjustments, send the emails and so on. If the order is already in the later status (eg Pending), it will just log the history record.

For the people that do come back to your site and get there before the IPN, when they go through checkout_process that executes the code in the paypal_standard module and changes the order status, stock levels and sends out emails.

So... both files handle setting an order to paid, the stock and so on - but for any given order it was one or the other. If you want to know which it was, you can tell from the history records (if IPN handled it the change of status history is nearly simultaneous with the IPN email).

The IPN listener file always handles processing the IPN notification but it may only write a history if the other got there first

The standard module always handles the user going through checkout_process to checkout_success but it may not do anything for the order if the other got there first

Both routes need to work properly and if you're changing one for some reason you also need to change the other.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
4 hours ago, cdetdi said:

Whenever I do testing my orders seem to use the payments_standard file and skip the ipn file, but, maybe 20-25% of orders seem to be doing the opposite.

Just to highlight something that others have noted in passing but may not have stated explicitly enough.  If you want to test the IPN path, then don't go back to your site after making the payment.  Because if you just click quickly through everything, chances are that you get back to the site before PayPal sends the IPN.  So act like a customer.  When you get to the screen that says something like "Click here to return to the merchant", close the browser window.  Then your test will work like their order.  Because some customers do exactly that. 

Note that both the IPN and the click through flow use the paypal_standard file.  The IPN file also has some logic of its own.  This contrasts to the logic triggered from the checkout_process file. 


Always back up before making changes.

Share this post


Link to post
Share on other sites

Thanks all.


Two forks diverged in a git, and I— I took the fork traveled by burt, And that has made all the difference.

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

×