Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - Devosc

Recommended Posts

hamed, you need to perform the 'alterations' as per step 1 of the install docs.

 

johann, :D point(s) taken, although I'm not totally in favor of PM'ing development discussions - but it would be nice to have a way to more clearly highlight/link to pertinent bits of information.

 

Including the overwrite and run files, as a labor of love, was and is a tricky decision, one reason is that by the time ready to do so (after testing and re-testing the installation docs) is that no guarantee can be given to of correctly extracted all of the files.

 

However, as noted, the contrib has developed into a very consolidated state and is practically a DB class short of being a standalone portable solution.

 

There are a few amendments that need to be made and there are 2 new thoughts that being pondered, [1] better response/customization of the customers return (possible PDT usage) and [2] prestoring the orders into a seperate table so that statistical reports aren't misleading.

 

Thanks for the comments....


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

Share this post


Link to post
Share on other sites

Thanks for your reply

i manage to fix this problem (misundrestanding) but still in the payment method there is no option for the customer to choose

 

Test store

this is my test user

username: test@gholamian.com

password: guest

have a look at this your self and see what happened

when you add something there will be no orders in paypal ipn as well it's like nothing is there

Edited by hamed

If you dig enough you will find it

Share this post


Link to post
Share on other sites

Hey,

It's stevemartis again. I have a new problem. When I receive an order it gets logged in my database. That is good, but it is logged incomplete. When I go to admin>>customers>>orders it shows the order, but when I go into the the order information It shows an X in the customer notified box. And also all the info on top is missing; customer, telephone number, payment method, and ect. Also when I tried to test the cart via module>>payments>>paypal It told me I needed the order signature found in admin>>customers>>orders. I could not find that either. Thanks for any future help!


Thank You,

Steve Martis

I know nothing - except what I do know - which is nothing - Atleast I know something!

Share this post


Link to post
Share on other sites

Didn't get a response so thought I would post again.

 

My "internal error" problem from before was indeed a PayPal problem. Thanks. I'm now able to get to the payment screen, but when I click on the "Return to Merchant" button after paying, I get directed to an empty shopping cart on my site. Here is the code snippet from my checkout_success.php file:

 

require('includes/application_top.php');

// if the customer is not logged on, redirect them to the shopping cart page
if (!tep_session_is_registered('customer_id')) {
  tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) {
  $notify_string = 'action=notify&';
  $notify = $HTTP_POST_VARS['notify'];
  if (!is_array($notify)) $notify = array($notify);
  for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
    $notify_string .= 'notify[]=' . $notify[$i] . '&';
  }
  if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);

//begin PayPal_Shopping_Cart_IPN
  tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
}
else if ((isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'success')) {
  paypal_order::reset_checkout_cart_session();
}
//end PayPal_Shopping_Cart_IPN

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);

 

 

Can anyone see what I might have done wrong? I see the orders show up as pending on my admin screen, but don't see any IPN traffic. Thanks again for all of your help.

Share this post


Link to post
Share on other sites

I got it working. The problem was with the PayPal sandox .... again. It's amazing how much time that thing has cost me. Anyway, thanks so much for the wonderful contribution.

Share this post


Link to post
Share on other sites
It's stevemartis again. I have a new problem. When I receive an order it gets logged in my database. That is good, but it is logged incomplete. When I go to admin>>customers>>orders it shows the order, but when I go into the the order information It shows an X in the customer notified box. And also all the info on top is missing; customer, telephone number, payment method, and ect. Also when I tried to test the cart via module>>payments>>paypal It told me I needed the order signature found in admin>>customers>>orders. I could not find that either. Thanks for any future help!

I am having the same problem! I need to go live...people are streaming in and 2 people have attempted to place orders but I am not sure if this is working because I am having the same exact problem as above. Also, my ORDERS screen looks very different from the install document screen shot. I hope someone can answer this soon!

Share this post


Link to post
Share on other sites

ChrisW123 thank you tons turns out everything WAS configured properly in the Sandbox it just doesn't send you IPNs... Thanks a ton!!


Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Share this post


Link to post
Share on other sites
ChrisW123 thank you tons turns out everything WAS configured properly in the Sandbox it just doesn't send you IPNs... Thanks a ton!!

 

No problem! That was driving me crazy also. I couldn't figure out why it wasn't working. BTW, my other problem where I wanted to highlight "PayPal" in the payment selection screen during checkout, thanks to Greg's reply I was able to find the spot to modify. Others may be interested also, since this is a PayPal thread in a way, so I'll post the change even tho it's not really realated to this AWESOME contribution (Thanks again, Greg):

 

I have two payment options, PayPal and Check/Money Order. I have PayPal sorted (from Admin) so that it is first in the list. Then make these changes which will always highlight the first item no matter how many items you have.

Edit .../includes/classes/payment.php file:

 

Change:

 

if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$payment]) || (isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) ) {

 

And replace "== 1" with ">=1"

 

:rolleyes:

Share this post


Link to post
Share on other sites

BTW, Greg, please post a PayPal link or email address where I can send you a donation, if you are excepting donations... I'm very impressed with this contribution and how much effort you put in to answering people's questions, replying so quickly, etc. Thanks again, -Chris.

Share this post


Link to post
Share on other sites
BTW, Greg, please post a PayPal link or email address where I can send you a donation, if you are excepting donations...  I'm very impressed with this contribution and how much effort you put in to answering people's questions, replying so quickly, etc.  Thanks again, -Chris.

Seems like the donation-buttons in the installation docs need to be bigger :D. Thanks....

 

ecopeia, please see either the FAQs in the first post of this thread, this type of question has been asked before, try the IPN Test Panel first, then look for the debug email, then try via the sandbox or try a $0.01 live transaction, for the lattter (two) ensure that the Primary Email and Business ID fields are configured correctly.

 

Sometimes PayPal's Sandbox is not always reliable, without notice, so a $0.01 live transaction is the best alternative.


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

Share this post


Link to post
Share on other sites

well, greg and all others, a friend of mine has figured out from my name and initials that i supplied the long-winded post a few back and noted greg's reply. he thinks i should offer the same advice i gave him a few months ago.

 

first, let me get the acronyms out of the way for the non-techical amongst the many readers here. in the unix/linux world there are many pieces of software continuosly developed by hordes of individuals that are free to the public to use. many of these are under the aegis of the free software foundation (FSF) and published under the general public license (GPL). you will frequently see GNU associated with these offerings and this relates back to a time some 20 odd years past when there was still some humor and individuality in computers. in fact, there seemed to be some competition amongst MIT computer scientists to devise recursive acronyms (they refer within themselves rather than to an actual abbreviation) so GNU was derived from "Gnu's Not Unix". the general field of revision control in the developer world is referred to as concurrent versions system (CVS) which are command line (think DOS window style) oriented and have a steep learning curve. these are meant for many programmers working with local copies that get updated to a central server (repository). lighter-weight versions meant for as few as one person are generally referred to as revision control systems (RCS). a company called component software has taken the GNU GPL for RCS and added a windows graphical user interface (GUI) and integrated it into windows (all versions) explorer in such a way that its use is virtually intuitive.

 

for instance, i have created an OSC directory (folder) on one of my drives. by right clicking on the OSC directory in windows explorer i see the menu referred to as "context". since i have defined within RCS a project named "OSC" i use the "Add to RCS" option and all 1,012 files in that directory (and sub-directories) are added to the RCS repository. then i copy over greg's "misc" directory as a sub-directory to OSC and it is now automatically added to the RCS repository as a new addition. then i take the "catalog" contents of misc and copy them over the OSC/catalog entries and the RCS repository automatically recognizes the changes.

 

the "so what?" in all this is that i can now right click on, say, the "admin" subdirectory and will see under the "RCS Status" option a listing that shows all the files sorted in the order from new to changed to unchanged. within this listing i could right click on the changed "catalog/admin/orderS.php" and select "RCS Status" and would see the following as an example of the output: RCS Example

 

instead of the simpliistic side-by-side view in which you have to studiously look at both versions to detect the differences, this window is color coded in one window to reflect the original, deletions, and additons -- cumulatively. yet the repository retains a complete history of the changes so that you can step back and un-apply (undo) the changes and start over at some point. you can set milestones in toto or in groups. you can have sub-projects with different milestones. when you are satisfied that you have a stable version you can set a version number. when you make more changes you can have more milestones and more versions and so forth.

 

RCS works for text files (.php, .htm, .txt, .c, ...) and binary files (.gif, .jpg, .bmp, .doc, .xls, .obj, ...) so that you can control programs, web sites, picture galleries, et cetera. it allows you to use window editors, but retains unix-style line endings and eliminates false control-m (^m) insertions so that when you upload the file to your server you do not have programatic glitches. although not an issue in osc, if someone has a new "war and peace" getting ready for the presses, this is the only software i know of that can handle very large files and very quickly. the changes are stored as increments of a few handsful of bytes rather than completely new copies of the original.

 

i hope my efforts to impress you with the capabilities of RCS approach the the actual capabilities of the software -- this is a "must-have" item for even casual code revisioning.

 

BEST OF ALL: IT IS COMPLETELY AND FOREVER FREE! get yours here: Free RCS S/W

 

greg, i think this would be indespenable for you. you could have projects for osc, osc + xyz contribution, osc + abc, osc +xyz + abc, et cetera. those little code snippets you offer on the fly would never get lost and subsequent revisions would be fully documented. it would also make life easier for you because when someone comes in with problems integrating from another contribution you would have them provide their working source as a basis, set this up as a project, and then you could see for yourself how ipn impacts things without the "toing" and "froing" i often see in the posts.

 

once again, i offer server space for any and all downloading capabilities. there could be a stable version site and interim builds as well as other contribution combos. greg, if you ftp your changes, i could set up a cron job to bundle up an .msi or .zip for each site so that they would be available to all almost instantly.

 

one last thing: if the "misc" directory is to be made cumulative: the .sql file should also be copied in there so that it is easily recognized with an update.

 

well, although the last time was not "the last time"; i hope this info proves beneficial. and my friend was right that i should pass this on to everyone. good luck!

Share this post


Link to post
Share on other sites

johann, thanks for that, it is appreciated. I typically use a local Linux box (about year now and at least 5 years gone to waste!) and my Windows machine is in a state of disarray (has been for sometime now - not sure whether to laugh or cry).

 

I've have wanted to look into sorting out some sort of cvs version system to use, because, your right, it is a pain and there are better methods, my main problem at present is time, e.g to figure things out and also learn new methods, and so often end up resorting to doing things manually.

 

Offering the contrib etc from non osc affilated servers and publishing links to them from here is (I think) banned since it drives traffic away.

 

Actually it is not difficult at all to pre-integrate the contrib so that it is immediately available when installing osC from a fresh, in fact its already done.

 

Your observations and comments have been noted and as usual I'm always trying to seek the best possible path and solutions... Thanks for the info.

 

Regards,

Greg.


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

Share this post


Link to post
Share on other sites

greg, sorry to hear about your win sys, but it might well be worth the effort to get it working.

 

when i first started using RCS, i spent about 20 min reading the manual and 5 min setting up my first project. this was my total learning curve! after that everything is accessible from the win explorer including check-in/out, analyses, reports, help (good), et cetera.

 

unfortunately, as you may well know, cvs in linux requires a great deal of time to just get started, let alone proficient. i do not know of a gui cvs that anyone thinks highly of. moreover, i have yet to even hear of one that someone thinks lowly of.

 

as for third-party sites, i was thinking of the provisioning for more rapid updates should someone want them and the source for other combos w/ ipn. i did not realize osc had any ban on the practice since this happens on some other contributions. in fact, one contribution had everything except the download link on another site.

 

do think about the win sys. linux is wonderful and getting better every day, but the gui's oftimes are a tad clunky -- as you already know.

 

johann

Share this post


Link to post
Share on other sites
do think about the win sys. linux is wonderful and getting better every day, but the gui's oftimes are a tad clunky -- as you already know.
The first and main thing I miss(ed) from windows was a decent text editor, and the one I use now is still sort of basic and cumbersome as opposed to others with debugging capabilities.

 

I'll eventually sort out the winbox because it still does have it's benefits, however last year sometime I installed SuSE 9.0 and since then haven't really wanted to look back apart from yahoo voice messenger and the web/image editing tools.

 

Currently I'm trying to figure out xml/xslt with php and republishing the form post data.

 

I'll look more into things soon...

 

Regards,

Greg


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

Share this post


Link to post
Share on other sites

Hello,

 

Thanks very much for a great contribution.

 

I installed the contribution and everything seems to workout great!

Testing is good, Sandbox works, orders return nicely, e-mails get

send, BUT ;-)

 

There *is* something wrong with orders getting collected before

Checkout. The best way to describe it, I guess, is with two

screenshots. It all comes down to orders not being described fully;

I have products that have different sizes, and the orders are there,

but the size is gone. That's to say: it is replaced by a "-:"...

 

Please check the pictures.

good.png

 

bad.png

 

Must be a typo somewhere, but I don't know where to look for it...

Any help, of coarse, is highly appreciated.

 

Cheers,

David.

Share this post


Link to post
Share on other sites

Hi David,

 

Does this problem also occur in the admin for you?

 

In those images you're showing the output of the customer's account_history_info page, the edits by this contribution to the section of code that is primarily used for account_history_info occurred in catalog/includes/modules/classes/order.php.

 

This contrib adds two new fields to the ordered products attributes:

 

products_options_id and products_options_values_id

 

and as well as adding the above fields to the $attributes_query the following related change is also required:

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

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

//begin PayPal_Shopping_Cart_IPN

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

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

//end PayPal_Shopping_Cart_IPN

                                  'option' => $attributes['products_options'],

                                  'value' => $attributes['products_options_values'],

                                  'prefix' => $attributes['price_prefix'],

                                  'price' => $attributes['options_values_price']);

These edits (as specified in the install docs), does not alter any of the existing default osCommerce functionality, have you installed any product attribute contributions?

 

The products purchased and their attributes are prestored when checking out, see includes/modules/payment/paypal/catalog/checkout_process.inc.php the core functionality is the same as the original default osC catalog/checkout_process.php script.


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

Share this post


Link to post
Share on other sites
Does this problem also occur in the admin for you?

Hi Greg,

 

The problem also occurs in the admin.

I do have a product attribute contribution running, called

Attribute Sets

 

However, except for some addition in filenames.php, there is nothing

the 'Attribute Sets' contrib has altered in files that have been

altered by the PayPal_Shopping_Cart_IPN... and changes in the

database were also mere additions as far as I can tell.

Anyway, I will look into it.

 

Something I forgot to mention (but might be important nevertheless):

I noticed that the "Customers who bought this product also purchased"

box never shows anymore.

 

I'm going to do a rerun of the PPSC_IPN contribution - yes, I always

backup ;-) and double-check to not miss anything.

 

Meanwhile, thank you very much for your reply and help so far.

(And allow me to express my gratitude for a your excellent work and a

terrific contribution).

 

Cheers,

David.

Share this post


Link to post
Share on other sites

Quote from my other post:

 

I am trying to isolate this problem and hopefully some one can point me to the right direction.

 

Problem:

 

--All the product options show in the shopping cart properly

 

--After gone through the check out process and arrived to the checkout confirmation page the option attribute is gone all I have is

 

- :

- :

- :

- :

- :

- :

- :

- :

 

The Question:

 

What happen to the date in the shopping cart during the checkout process and what files supplied the data to the confirmation page?

 

Thanks for all your input.

 

 

And also quote from other thread:

 

 

 

Link to other thread regarding the error -:

 

After further investigating I confirm that 2.6a ipn caused the problem "-:" witht the product attribute...I uninstalled the contribution and it work fine.

 

Thanks for the info Greg, Are We going to see any update code soon?

Share this post


Link to post
Share on other sites

Regarding the attributes not showing, I'm suspicious as to whether these are isolated problems, since this is an area that only needed minor coaxing when customizing the original catalog/checkout_process.php.

 

I have tested purchasing products with attributes and have not noticed any problems, I would suggest that a test site using a default MS2-2.2 version of osCommerce be instantiated to determine whether the problem is particular to your site, I've only tested the default products included with a fresh osC install - and this methodology has been used for quite sometime (reserve the right to be mistaken :)).


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

Share this post


Link to post
Share on other sites

When in doubt tested with the stock osC but the reality is no production site using the stock osC. Yes I had serveral mod installed just don't know which one is the culprit :) .

Share this post


Link to post
Share on other sites

Regarding the attributes not showing:

 

I reinstalled the contribution (did all the editing again, went

trough all the steps) then did an 'Optimize table' (All checked) with

phpMyAdmin and now everything works fine. The attributes are back,

instead of the " :- " before.

 

I was thinking; could the optimize alone get the attributes back?

I will probably never know, but maybe others can try that and see if

that works...

 

Cheers,

David.

Share this post


Link to post
Share on other sites

I override the order.php with the stock order.php for testing and the attribute option come back. One thing I notice the option order listed is in revesered. The last option is listed on top in the account history info. I will try to run optimized the database see if it work. Thanks for the info.

Share this post


Link to post
Share on other sites

Hi!

 

Looking for some help.

 

I'm wondering if the Credit Class Gift Voucher contribution isn't compatible with this PayPal gadget. I installed the voucher thing, and everything was working fine. Then I installed this one, and now I can't get through checkout.

 

I'm getting a parse error (whatever that is) on the checkout_process page. Somebody looked at the page for me, and he said he didn't see anything wrong with the code on it. So I don't know what to do about this, other than restoring all my pages that got changed when I put in the PayPal contribution.

 

Any ideas before I trash everything?

 

Thanks a bunch!

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  

×