Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - Devosc

Recommended Posts

in 138 pages i see many referrences to trying to install the contribution on a clean osc -- ground zero. is there some reason why an ftp site cannot be set up to cater to these situations. then all a person would have to do to get up and running is copy everything pertinent over ther existing directory structure and configure.

 

if someone wants other contributions added AFTERWARDS, they can go to that support forum instead of making this one bear all the load. it is clear to me that the majority of the support provided by this forum is aiming at moving targets from these other contributions. it seems pointless for someone just getting started to have to wade through all of these other issues when getting started should be a ten minute proposition!

 

johann

hehe right, had that thought too...many times...during troubleshooting many late hours ;)

Share this post


Link to post
Share on other sites
in 138 pages i see many referrences to trying to install the contribution on a clean osc -- ground zero. is there some reason why an ftp site cannot be set up to cater to these situations. then all a person would have to do to get up and running is copy everything pertinent over ther existing directory structure and configure.

 

if someone wants other contributions added AFTERWARDS, they can go to that support forum instead of making this one bear all the load. it is clear to me that the majority of the support provided by this forum is aiming at moving targets from these other contributions. it seems pointless for someone just getting started to have to wade through all of these other issues when getting started should be a ten minute proposition!

 

johann

A couple of problems with your approach. The first is there are lots of people who probably already have other contributions installed to their store. Should they not be able to ask for support here? What if all contribution support threads were like that? Should they all take the same attitude? Then what of the majority of the users who have more than one contribution installed?

 

Most contributions work fine if they are the only one installed, having a bunch of different ones is when it gets tricky.

 

This thread has so many posts because there are so many people using the contribution, the more people using it the more problems there are going to be.


The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Share this post


Link to post
Share on other sites

Hello, Richard, could you please tell me the link to download the guest account??? ;) ...and sorry to post this here


OS-commerce is great, but with other magical contributions, that is just so "COOL"!

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for a nice looking contribution and some informative posts. However, I'm still stuck trying to get PayPal transactions working correctly (I'm trying to use PP as my CC processor to start with for my shop).

 

I got things working up to the point where people can checkout and go pay on the PayPal site (on the Sandbox server for now) but I get issues trying to get their orders treated automatically. I also want them to be able to download any downloadable product right away after paying online. Here are my questions:

 

- Does anybody use the PayPal Sandbox (as I do, had to change a bit of code in the contrib for it) for their testing purposes? Anything to be aware of when doing so?

 

- I get an erroneous return link (http://checkout_success.php/?...) on the PayPal site after the customer has paid by CC. How can I fix that?

 

- What should the orders status change to in the osC admin panel once an order has been made successfully? Should it differ whether "physical" or a downloadable products are in the order? For downloadable products I still get the "will be delivered in 2-5 working days" when returning (manually) to my site after paying on PP... Did I do something wrong?

 

- What is the actual delay before receiving IPNs?

 

- I'm also wondering what "Payment Data Option" should be set to in the PayPal profile options.

 

Thanks a lot for the help, will be very appreciated.

 

 

Fabien

 

 

EDIT: also, I need to mention I don't have any download link showing for customers with PayPal payments... It isn't a problem with the product attributes though for when trying with an other mean of payment it would work. Any idea what to look for to sort this? TA.

Edited by tsyrak

Share this post


Link to post
Share on other sites

Hmm, well I'm happy to say I've found a way to finally receive my IPNs and fix my return URL. So, basically, it seems I've got everything working! I've had to edit includes/modules/payment/paypal.php and change:

 

tep_draw_hidden_field('notify_url', tep_href_link('ipn.php', '', 'SSL',false));

to:

tep_draw_hidden_field('notify_url', tep_href_link('http://www.mysite.com/ipn.php', '', 'SSL',false));

 

as well as:

 

$paypal_fields .= tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=success', 'SSL'));

to:

$paypal_fields .= tep_draw_hidden_field('return', tep_href_link('http://www.mysite.com/' . FILENAME_CHECKOUT_SUCCESS, 'action=success', 'SSL'));

 

Anybody else has had to do it to get things working? Because tbh I find weird that I've had to make these changes in the code. Could this be due to my not using a catalog/ directory in my osC install? Pointers welcome, etc.

 

Looks like my shop can now go live today... I'm so happy I could cry :')

Edited by tsyrak

Share this post


Link to post
Share on other sites

Nevermind, my mistake, I had forgotten to change something in configure.php when stopping use of HTTPS. It reminds me of someone's signature I've read in this thread hehe. Feel free to delete the above posts.

 

Thanks for a great contribution!

Share this post


Link to post
Share on other sites

hello syrak!

 

:huh:

 

i have looked alover for help with my customers NOT receiving a download link but nobody could help.

is that the problem you had too you mean?

And please tell me what things you changed in configure.php to get it to work, because like you said one think that you shouldnt have change the code you mentioned first to get it to work...

 

:ph34r:

Share this post


Link to post
Share on other sites
in 138 pages i see many referrences to trying to install the contribution on a clean osc -- ground zero. is there some reason why an ftp site cannot be set up to cater to these situations. then all a person would have to do to get up and running is copy everything pertinent over ther existing directory structure and configure.

 

if someone wants other contributions added AFTERWARDS, they can go to that support forum instead of making this one bear all the load. it is clear to me that the majority of the support provided by this forum is aiming at moving targets from these other contributions. it seems pointless for someone just getting started to have to wade through all of these other issues when getting started should be a ten minute proposition!

 

johann

A couple of problems with your approach. The first is there are lots of people who probably already have other contributions installed to their store. Should they not be able to ask for support here? What if all contribution support threads were like that? Should they all take the same attitude? Then what of the majority of the users who have more than one contribution installed?

 

Most contributions work fine if they are the only one installed, having a bunch of different ones is when it gets tricky.

 

This thread has so many posts because there are so many people using the contribution, the more people using it the more problems there are going to be.

the governing statement in my post is:

"in 138 pages i see many referrences to trying to install the contribution on a clean osc -- ground zero."

 

this is where i see a major failure in the contribution. obviously there are numerous people with prior contributions added and support here is admirable. what i do not see is a clear, clean, straight-forward, dowloadable solution for someone who wants osc with the ipn contribution and then can go on to other things later -- if so desired.

 

why make osc, and probably php, neophytes (much like myself) fight their way through cutting and pasting with an unlimited variety of text editors that insert "hidden characters" and newlines after ?> and whatever.

 

most obviously a clean install such as i have wondered about exists somewhere and should be made available. this is really my one and only point.

 

johann

Share this post


Link to post
Share on other sites

hello there rmblfish!

 

The problem I had was that I was not receiving the IPNs and that the return URL on the PayPal site was erroneous. To be honest, the problem was that I wasn't understanding properly how the contribution and IPN in general worked (i.e: that you actually had no return URL to set in your PayPal profile and that PayPal itself required 1 file to give the automatic response (transaction failed or done) and an other to take the client, optionally, back to the the shop). Anyway, I've been able to revert to the original code I was posting above after fixing configure.php, setting in it "define('ENABLE_SSL', false);" from true to false. I'll try to help on the other thread.

Share this post


Link to post
Share on other sites
the governing statement in my post is:

"in 138 pages i see many referrences to trying to install the contribution on a clean osc -- ground zero."

 

this is where i see a major failure in the contribution. obviously there are numerous people with prior contributions added and support here is admirable. what i do not see is a clear, clean, straight-forward, dowloadable solution for someone who wants osc with the ipn contribution and then can go on to other things later -- if so desired.

 

why make osc, and probably php, neophytes (much like myself) fight their way through cutting and pasting with an unlimited variety of text editors that insert "hidden characters" and newlines after ?> and whatever.

 

most obviously a clean install such as i have wondered about exists somewhere and should be made available. this is really my one and only point.

 

johann

While it would be nice if everyone who made a contribution went ahead and did an install for you and made it available for you to download where is all that bandwidth going to come from. Are you willing to lease some server space for that purpose?

Your statement

most obviously a clean install such as i have wondered about exists somewhere and should be made available. this is really my one and only point.

 

Why should this be made available for you. Greg has made an excellent set of instructions and if you had installed very many contributions you would know exactly how well written his instructions are compared to a lot of others.

 

If you or anyone else cannot get this working on a clean install or otherwise there is no reason in the world for you to fight with it. You always have the option to pay someone to install it for you. That goes for other contributions as well as this one. I have installed contributions for people and been paid for doing so and there have been things that I wanted done that were either more than I felt comfortable doing or did not have the time to do and paid someone to do for me.

 

Nobody that contributes to this project should do anything. Unless you are paying for something there is no should involved.


The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Share this post


Link to post
Share on other sites

could anyone tell me what I should do (how) if the customer orders using paypal, having trouvle with them and decides then to transfer by bank (without cancelling). I then set the status to payed, but the paypal-ipn status ist still on pending and no chance to delete it...

 

Thanks for your advice

Kai

Share this post


Link to post
Share on other sites
Hmm, well I'm happy to say I've found a way to finally receive my IPNs and fix my return URL. So, basically, it seems I've got everything working! I've had to edit includes/modules/payment/paypal.php and change:

 

tep_draw_hidden_field('notify_url', tep_href_link('ipn.php', '', 'SSL',false));

to:

tep_draw_hidden_field('notify_url', tep_href_link('http://www.mysite.com/ipn.php', '', 'SSL',false));

 

as well as:

 

$paypal_fields .= tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=success', 'SSL'));

to:

$paypal_fields .= tep_draw_hidden_field('return', tep_href_link('http://www.mysite.com/' . FILENAME_CHECKOUT_SUCCESS, 'action=success', 'SSL'));

 

Anybody else has had to do it to get things working? Because tbh I find weird that I've had to make these changes in the code. Could this be due to my not using a catalog/ directory in my osC install? Pointers welcome, etc.

 

Looks like my shop can now go live today... I'm so happy I could cry :')

I just tried this suggestion, didn't work for me. Still no IPN and now my return page isn't working (will fix that back).

 

This is so frustrating. :(

Share this post


Link to post
Share on other sites

yes read my following replies, you don't have to do that code change so change it back to how it was before.

 

an other reason for not receiving any IPN could be using multiple currencies on your site but having the "Cart Test" enabled in the module's options (with, in my case, only one money balance for my paypal account). Then I only receive IPN from users whose currency on the site matches my money balance on PayPal. This is a problem I'm running into atm and which can be easily fixed turning the "Cart Test" OFF but I just don't wanna do that for security reasons...

Share this post


Link to post
Share on other sites
the governing statement in my post is:

"in 138 pages i see many referrences to trying to install the contribution on a clean osc -- ground zero."

 

this is where i see a major failure in the contribution. obviously there are numerous people with prior contributions added and support here is admirable. what i do not see is a clear, clean, straight-forward, dowloadable solution for someone who wants osc with the ipn contribution and then can go on to other things later -- if so desired.

 

why make osc, and probably php, neophytes (much like myself) fight their way through cutting and pasting with an unlimited variety of text editors that insert "hidden characters" and newlines after ?> and whatever.

 

most obviously a clean install such as i have wondered about exists somewhere and should be made available. this is really my one and only point.

 

johann

While it would be nice if everyone who made a contribution went ahead and did an install for you and made it available for you to download where is all that bandwidth going to come from. Are you willing to lease some server space for that purpose?

Your statement

most obviously a clean install such as i have wondered about exists somewhere and should be made available. this is really my one and only point.

 

Why should this be made available for you. Greg has made an excellent set of instructions and if you had installed very many contributions you would know exactly how well written his instructions are compared to a lot of others.

 

If you or anyone else cannot get this working on a clean install or otherwise there is no reason in the world for you to fight with it. You always have the option to pay someone to install it for you. That goes for other contributions as well as this one. I have installed contributions for people and been paid for doing so and there have been things that I wanted done that were either more than I felt comfortable doing or did not have the time to do and paid someone to do for me.

 

Nobody that contributes to this project should do anything. Unless you are paying for something there is no should involved.

the hand-full of files that need changing come to about 40KB -- c. 364,000 bits. the original .zip is c. 1,164,000 bits. the original .zip setup, packetizing, and transmission (100 Mb) by the server takes c. 15.2 milliseconds. the expanded .zip would require c. 19ms.

 

if 500 people a month downloaded this new file, one of my servers would expended c. 9.5 seconds of my 2.628.000 seconds available. therefore,i do not think i will have a problem finding a place for this file.

 

in fact, we need not limit serving only this package. if there are other combinations of ipn and other contributions that are working flawlessly, let us mount them as well.

 

just email the .zip structured with "catalog" as the root (top directory) and instructions in .html and i will mount it and post where it is available.

 

johann

Share this post


Link to post
Share on other sites

I'll offer server space too. Anything to get this up and running without so much confusion.

 

I know a lot of you were able to get it all going with no problems, and many of you were able to get it going after fixing a few server issues... but I am one of the small percentage who just cannot get the module to work. For dummies like me, have the oscommerce and the paypal ipn module already configured would be a Godsend. Especially if it had an easy tutorial to go with it that covered both pieces of the software.

 

I chose oscommerce over other pieces of similar software because it had a handy dandy installation process that didn't require a lot of coding (that I would undoubtably mess up being new to php and mysql). There are so many great modules for oscommerce but after trying 3 (paypal ipn, downloads controller, and template) and failing at all 3 I feel like I've done more behind the scenes work than I would have if I had tried something else. 4 months is a long time to spend on one piece of software.

 

This is such a great product (if I could get it to install finally) and I'll be so happy once it's up and running like it seems to doing for almost everyone else here. If I can help others by offering server space, I'm all for it. Especially since I can't (yet) help out with any expert advice.

Edited by sunsetwebdesign

Share this post


Link to post
Share on other sites

I am getting this error when trying to submit an order:

 

Parse error: parse error, unexpected T_INT_CAST in /home/airuma/public_html/includes/classes/order.php on line 104

 

 

That line reads:

 

$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

while ($orders_products = tep_db_fetch_array($orders_products_query)) {

 

 

What is the error there?

Share this post


Link to post
Share on other sites

when I click on checkout, I get this error:

 

Parse error: parse error, unexpected T_VARIABLE in /home/huskyzco/public_html/catalog/includes/classes/order.php on line 136

 

The offending code is below. I have fiddled and fiddled and tried to do comparisons, but am unable to see the problem. Can anyone help with the code ( I am only a lowly cut and paster, not a coder. I am going live soon, so some timely help would be wonderful.

 

 

//begin PayPal_Shopping_Cart_IPN

$attributes_query = tep_db_query("select products_options_id, products_options,"

$this->products[$index]['attributes'][$subindex] = array('option_id' =>$attributes['products_options_id'],

'value_id' =>

$attributes['products_options_values_id'],

//end PayPal_Shopping_Cart_IPN

 

If only I knew what a t variable was. Well I looked that up before I posted this and I can see no unclosed "" or brackets (line 136 is the 4th line down in this piece of code starting with $this)

 

Or can someone just provide me with a copy of all the code for this file (ipn v2.3)

 

Kind regards

Share this post


Link to post
Share on other sites

I may have missed something along the line but I am testing the IPN and my order status remains as Pending Payment after using the IPN test page from admin. I believe that this is caused by the following line in /catalog/includes/modules/payment/paypal/ipn.php

 

 

if (MODULE_PAYMENT_PAYPAL_IPN_CART_TEST == 'Off') return $valid_payment;

 

 

should this properly read

 

 

if (MODULE_PAYMENT_PAYPAL_IPN_CART_TEST == 'On') return $valid_payment;

 

 

If so then the tests that would folow this condition are not being run when the module is NOT in test mode. Would someone be so kind as to provide some feddback to this since being of limited knowledge I may just be blowing smoke.

 

Thanks in advance for your help everyone!

Share this post


Link to post
Share on other sites
//begin PayPal_Shopping_Cart_IPN

    $attributes_query = tep_db_query("select products_options_id, products_options,"

    $this->products[$index]['attributes'][$subindex] = array('option_id' =>$attributes['products_options_id'],

    'value_id' =>

    $attributes['products_options_values_id'],

//end PayPal_Shopping_Cart_IPN

Battleaxe:

 

was your post edited for length? If not then oyu have some serious problems. The first line is to be a complete tep_dq_query wich should end ultimately in ");

 

 

For example my section there looks like this:

 

 

$attributes_query = tep_db_query("select products_options_id, products_options, products_options_values_id, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");

//end PayPal_Shopping_Cart_IPN

if (tep_db_num_rows($attributes_query)) {

while ($attributes = tep_db_fetch_array($attributes_query)) {

$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],

//begin PayPal_Shopping_Cart_IPN

'option_id' => $attributes['products_options_id'],

'value_id' => $attributes['products_options_values_id'],

//end PayPal_Shopping_Cart_IPN

 

 

You may want to recheck what you copied in (look at your backup of hte file... I hope youmade one first before editing it) and see if it makes sense. Hope this helps.

Share this post


Link to post
Share on other sites

Hi Joe,

 

There's a difference between

 

MODULE_PAYMENT_PAYPAL_IPN_DEBUG_TEST

 

and

 

MODULE_PAYMENT_PAYPAL_IPN_CART_TEST

 

The latter is purely for the cart totals


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

Hi everyone :)

 

I have the contribution installed and seemingly working correctly in that there are no PHP or other scripting errors. Two things I encountered though:

 

1) With the PayPal module's "Transaction Currency" set to "Selected Currency", the PayPal page lists the equivalent amount in US Dollars but the customer was using Canadian $ and was shown this in the osCommerce shopping cart prior to the hand off to PayPal.

 

I went into my PayPal profile online, and made my Primary account the Canadian $ one, yet it still happens. If I change the setting to "Only CAD", then PayPal presents an "Amount" field for the user to enter an amount of their choosing. Any pointers as to what is going wrong here?

 

2) When I used the Test IPN function (which only seemed to work the first time, and then no more), the Status that displays for all orders still says "Pending PayPal Notification". I noticed, however, that clicking on the particular order, the "Payment Status" on the right hand site in the osCommerce Orders had changed to "Completed", did I miss something here?

 

A great contribution, just so many little things to go wrong I guess :)

 

Thanks everyone.

Share this post


Link to post
Share on other sites

Thanks jwbnow'

 

It is sorted, I just overwrote the whole thing with the backup, must have made a big boo boo. Thanks for your help.

 

Anyway have sorted out most things now except

 

1. My shipping amount does not seem to be being called, it is not coming up in the payment process in the catalog nor on the invoice at paypal.

and

2. I am getting a 1146 - Table 'huskyzco_shop.TABLE_PAYPAL' doesn't exist

 

delete from TABLE_PAYPAL where paypal_ipn_id = '0'

 

[TEP STOP]

when I try to delete orders in catalog-->admin

 

Anyway, I am off to spend a few fruiful hours looking for the answers to these. Heaven knows how I am going to spend my time when it is finally running straight.

 

Greg, great contrib, as soon as the store is up and running I am going to press your paypal button ;)

Share this post


Link to post
Share on other sites

OK guys, just solved the missing shipping, it was that old not zero in the add product page weight option. I just added a 1 to the shipping weight and off I went. Strange how I never needed that before I added this ipn contrib. Anyone have a reason? Don't worry, just an idle question.

 

OK going over the wall and back in for the 1146 error, wish me luck! (unless of course anyone wants to take pity on me! :D

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
Sign in to follow this  

×