Jump to content
Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

Excellent contribution. Install went clean and easy per the very good docs. Tested in sandbox and finally live, going well. Using it on https://www.kmpublishers.com

 

Installed this to fix the problem of getting payment but no order processing.

 

Only challenge was with Updated PayPal Payment Screen contrib.

Found the solution to it here. http://forums.oscommerce.com/index.php?act...&pid=975672

 

Thanks again to the whole community.

Share this post


Link to post
Share on other sites
I tried to find out the reason, and the following codes (in ext\modules\payment\paypal_ipn\ipn.php) look strange to me:

:

:

:

I suggest to rename one of them.

Please let me know if i made a mistake. ;)

The $order re-created by assigning a new class object will destory the old data stored. I tested many times and it works, so I post the code in this thread and Terra included it in the update. I don't think there is any problem to reuse that variable.

 

The order status not updated could possibly because the IPN from payapl never been received, or the IPN results were not completed....etc.


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
The OsCommerce version I'm running doesn't have a EXT directory because it is a modification to work with PHP-Nuke called PHP-MultiShop (www.php-multishop.com)

 

Do I need this ext directory?

 

I left blank all these areas in the admin cp:

• Page Style

• Your Private Key

• Your Public Certificate

• PayPals Public Certificate

• Your PayPal Public Certificate ID

• Working Directory

Is that ok ? Because I'm not running SSL since I left PayPal collect payments

 

Should I deactivate the PayPal module if I activate the PayPal IPN module?

 

Sorry for my ignorance. I tested it out by placing in cart and checking out and it sent me to the PayPal paying page so I figured it was ok but I try reading and all it's doing is confusing me more so for now I deactivated the IPN module until I know for sure.

 

Thank you.

Yes - you need the ext directory as that directory contains the file which receives the PayPal notification. When the instructions say "copy over all files" that's not an optional advise ;)

 

No idea btw whether it'll work with PHP-MultiShop - the module was written for the latest osCom version.

 

Leaving the fields blank is okay - if cURL is enabled on your server, you're fine.

 

And whether you de-activate the standard module is up to you although I don't see much point in offering two payment options which both lead to PayPal.

 

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
I tried to find out the reason, and the following codes (in ext\modules\payment\paypal_ipn\ipn.php) look strange to me:

I suggest to rename one of them.

It's working on my server but I see your point regarding naming - I'm currently collecting all feedback / bugs for a version 2.1 realise and have incorporated your suggested change. I will give it a few more days for bugs to surface and then upload the new version.

 

PS: If the order does not update then PayPal can't "talk" with the ipn.php file in the /ext/ directory ... possible causes: wrong directory structure, firewalls, GoDaddy Hosting ... My gut feeling is that the $order naming should not impact on the status updates.

 

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
Now my question: do you remember my request for a small add-on to make this contribution more or less validated voor Dutch laws.

You can find my question to you here (in this topic).

I did give you the solution how to add text to the email - I'll see if I can make this a standard in the next version but just for the record, all you guys need to do is add a Constant to the email string .. now come on, PHP isn't that hard ;)

 

http://forums.oscommerce.com/index.php?s=&...st&p=884539

 

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
Yes - you need the ext directory as that directory contains the file which receives the PayPal notification. When the instructions say "copy over all files" that's not an optional advise ;)

all the best, Terra

 

 

Thanks for the response. Sorry I sound like a moron but I didn't have the ext directory. So I'm going to create this directory and it should work correct? Reason I ask is because I don't see any CHMOD instructions.

 

Thanks again.

Share this post


Link to post
Share on other sites
Thanks for the response. Sorry I sound like a moron but I didn't have the ext directory. So I'm going to create this directory and it should work correct? Reason I ask is because I don't see any CHMOD instructions.

Sorry - first time anybody asked for CHMOD. I've got the standard ones: 755 for folders, 644 for ipn.php file. Will add this to the FAQ section in the user guide. 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
Sorry - first time anybody asked for CHMOD. I've got the standard ones: 755 for folders, 644 for ipn.php file. Will add this to the FAQ section in the user guide. Terra

 

And that's why you're the best! Thank you.

Share this post


Link to post
Share on other sites

Is there a way to override the shipping and handling setting in paypal if you are using your paypal account for more than one website?

 

Thanks

 

Evan


800-541-0740

Healthy Coffee. Healthy Income.

Call Me Today!

Share this post


Link to post
Share on other sites

I was just testing the difference and it looks like version 1.4 of this IPN seperates the Subtotal from the shipping that is giving in the cart.

 

Example v1.4:

 

Subtotal: $3.61 USD

Shipping: $4.20 USD from website

 

Example v2.0:

 

Subtotal: $7.81

Shipping: $5.95 but this comes from my settings in paypal

 

Just wanted to clarify my problem.

 

Hope this helps

 

Evan

Edited by GanodermaCoffee.com

800-541-0740

Healthy Coffee. Healthy Income.

Call Me Today!

Share this post


Link to post
Share on other sites

I have IPN v 1.3.0.0 installed and working (mainly) for a long time now, but I get quite a few customers telling me that when they get to paypal's site to pay, the get a you have timed out message. Any body got any ideas why, and how to fix?

 

Thanks

Share this post


Link to post
Share on other sites
I was just testing the difference and it looks like version 1.4 of this IPN seperates the Subtotal from the shipping that is giving in the cart.

mmh - I did stop the shipping cost being sent to PayPal when it's set to "Aggregate" as it can cause problems with CCGV(trad) when a discount coupon results in a negative sub-total (which PayPal can't handle). Currently the shipping is empty - I will change this to a 0 value being sent to PayPal which should then over-ride the setting in the PayPal account. Please keep an eye out for the next version which will be uploaded in a few days - the new version should solve this.

 

In the meantime you can add

$parameters['shipping'] = '0';

on line 350 (after the } else { line) in the paypal_ipn.php file - that should solve it. Terra

Edited by 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
And that's why you're the best! Thank you.

Yes indeed, thanks for your efforts in improving this contribution Terra :thumbsup:


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

Terra,

 

I am new to the forums and just wanted to be sure my searching didn't fail to turn up the solution I'm looking for! Love your work, and I am impressed with the following you've got here in the forums!

 

I am trying to run my site with the new PayPal IPN (v2.0 I believe) and QTPro 4.3. I saw that you had written an integration file for some older versions and that you had planned on developing one for this.

 

I was curious if that was available yet, and if not, if you had an ETA? Of course, I'll be grateful WHENEVER it is available ;)

 

 

Thanks so much for all of your brilliant work!

 

Anxiously awaiting your reply,

 

Anthony David Adams

Share this post


Link to post
Share on other sites
I am trying to run my site with the new PayPal IPN (v2.0 I believe) and QTPro 4.3. I saw that you had written an integration file for some older versions and that you had planned on developing one for this.

It will be available as I need it myself but I can't make any promises on timescales as January is an extremely busy time for my website design business and paying customers have to come first. 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

Terra,

 

Fantastic!

 

From day one of installing this module (having moved from another payment processor) I was wondering why the module worked the way that it did (i.e. update stock before order sent through to PayPal).

 

Thanks to you its been fixed!

 

Thanks for all your hard work.

Share this post


Link to post
Share on other sites
From day one of installing this module (having moved from another payment processor) I was wondering why the module worked the way that it did (i.e. update stock before order sent through to PayPal).

mmhh - that should never have happened. The older versions updated the stock when the customer returned to the site, with the problem that if the customer did not return, no stock was updated. As far as I know, none of the versions ever deducted stock prior to customer paying. Maybe you used a custom modification? NB: the pre-storing of unpaid orders is still part of the IPN module as it's the only way the order can be saved into the database & then updated upon payment. 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
mmhh - that should never have happened. The older versions updated the stock when the customer returned to the site, with the problem that if the customer did not return, no stock was updated. As far as I know, none of the versions ever deducted stock prior to customer paying. Maybe you used a custom modification?

 

My mistake in wording - I didnt mean update the actual stock count - I meant update the orders table with the stock currently in the cart (whether they actually go to PayPal site or not).

 

 

NB: the pre-storing of unpaid orders is still part of the IPN module as it's the only way the order can be saved into the database & then updated upon payment. Terra

 

Let me just understand this correctly, otherwise I am on the wrong track. Previously, merely going to checkout_confirmation would trigger the order being saved into the database. From my point of view, this is wrong, given that its quite common for many ppl to get to that stage in the checkout and abandon their cart.

 

My understanding is that in the new contribution, the order only gets saved into the database after leaving the checkout_confirmation and being passed onto PayPal. i.e. only after the button_confirm_order has been clicked. If so, this is something that I have been advocating, and does seem to make more sense to me.

 

Or am I on the wrong track?

Share this post


Link to post
Share on other sites
My understanding is that in the new contribution, the order only gets saved into the database after leaving the checkout_confirmation and being passed onto PayPal. i.e. only after the button_confirm_order has been clicked. If so, this is something that I have been advocating, and does seem to make more sense to me. Or am I on the wrong track?

sorry - you are on the wrong track. the order still gets pre-stored on the checkout_confirmation.php page. That's because the module needs the order information in the database so when PayPal sends its payment confirmation it can access it and update it. However, stock is NOT deducted at pre-storing stage, only once payment has been confirmed (so unpaid orders don't deplete the stock levels). Unpaid orders are also quite visible as they have their own order status (Preparing PayPal IPN).

 

Also - the IPN isn't 100% safe. There have been a number of problems reported on the PayPal developer forum where IPN replies were either considerably delayed or failed. The PayPal team itself admitted that the IPN should not be used as the sole checkout process as it's not a guaranteed service and they recommend PayPal express as alternative. Hence, pre-storing is still a good precaution to avoid loosing the order information.

 

PS: storing the order from the paypal ipn reply isn't easy as much of the information available during the checkout process from the customer's sessions variables aren't present. all you have are the parameters sent back by paypal and that's not sufficient to create an order in the oscom db.

 

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
Let me just understand this correctly, otherwise I am on the wrong track. Previously, merely going to checkout_confirmation would trigger the order being saved into the database. From my point of view, this is wrong, given that its quite common for many ppl to get to that stage in the checkout and abandon their cart.

 

My understanding is that in the new contribution, the order only gets saved into the database after leaving the checkout_confirmation and being passed onto PayPal. i.e. only after the button_confirm_order has been clicked. If so, this is something that I have been advocating, and does seem to make more sense to me.

 

Or am I on the wrong track?

The order must be saved before the confirm button been clicked, because customers are not forced to return to complete their orders. If the orders were not saved before sending customers to paypal, and the customers didn't return to store, there won't be any record in database for store owners to deal with.

 

Currently the only way to avoid this custom-not-returning issue is the Express Checkout API, which actually makes transactions in store rather than paypal, and it also has IPN feature built in. Express Checkout API is now available for premier and business accounts as an additional payment method.

Edited by AlexStudio

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 am trying to run my site with the new PayPal IPN (v2.0 I believe) and QTPro 4.3. I saw that you had written an integration file for some older versions and that you had planned on developing one for this

I have replied to your duplicate post in the QTPro support thread.


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

Hiya Guys

 

I was wondering if someone can help me here.

 

I have paypal ipn installed as one of my payment method. ?everything was working fine, orders paid via paypal and customers returning back to site this orders being recorded.

 

A couple of days ago my host upgraded their Mysql so a few modifications had to be made on the site.

 

Now no one that pays via paypal doesn’t come back to the store and their orders are not recorded.

 

Can anyone help in sorting this out. I have no idea as to what part of the contribution is at fault and how to fix it.

 

Much appreciated

 

Costas

Share this post


Link to post
Share on other sites
the order still gets pre-stored on the checkout_confirmation.php page. That's because the module needs the order information in the database so when PayPal sends its payment confirmation it can access it and update it. However, stock is NOT deducted at pre-storing stage, only once payment has been confirmed (so unpaid orders don't deplete the stock levels). Unpaid orders are also quite visible as they have their own order status (Preparing PayPal IPN).

 

Terra, I agree with the logic of this contribution, and think that it deals with Paypal IPN very well. However, wouldn't it be even better to have the pre-storage of the orders and the stock update taking place when people hit the "confirm order" button (rather than when they enter checkout_confirmation)? This way, there would be less trashed carts stored. Just an idea, I have no idea how to implement this.

Share this post


Link to post
Share on other sites
However, wouldn't it be even better to have the pre-storage of the orders and the stock update taking place when people hit the "confirm order" button

I'll check it out - I always thought this wouldn't work but maybe I'm wrong. Oh well - haven't been through the sandbox for 24 hours, so I guess it's time for another test run. Did I mention that this IPN is a pain the backside? 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

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

×