Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


cdetdi

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.

Link to comment
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.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...