Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

I have the contribution installed, and will be testing shortly.

After reading through this thread (all 53 pages!), I have 3 questions:

1) One user commented that the sandbox doesn't return an IPN. If this is true, what is the purpose of testing through the sandbox?

 

2) What is the function of the "cart test"? One user commented that it had to be turned off in order for item quantities to be decremented properly, so what is the advantage of having it on. (does it need to be on for the sandbox?)

 

3) What should my testing procedure be, that is, what test results should I expect? And in order to fully test IPN, do

I have to do some live testing, or is a full test possible through the sandbox?

 

Thanks for all of your help.

 

c

Link to comment
Share on other sites

skizzer, its a bit hard to tell without seeing what the error says, in an instance like this, I would possibly suggested uploading the includes/payment/paypal.php and paypal subdirectory again in case the previous ftp did not work correctly.

Because the error seems to be only occuring on checkout_process the above is suggested since none of the edits made during the install are directly related to this section.

 

Pulp, you're a veteran:

1) The Sandbox will return the IPN, it is a working version of the PayPal site for development purposes, the only difference is that sandbox accounts are fictitious, and thus so should the email addresses be also. The latter will then be the only difference between the live PayPal site and using the sandbox domains, e.g the Primary Email and Business ID for the live site are different to those used on the sandbox site and so will still need to be set accordingly and correctly.

 

2)The 'Cart Test' verifies that the customer has paid the right amount, an IPN can be verified by PayPal that it is valid, but they cannot verify that it is the right amount, since the customer could of changed and legitimately paid $0.01.

The main issue that might still be outstanding and will cause the cart test to fail is if the currency used when making the PayPal payment is different from the currency selected during the osC checkout - the debug email will detail this.

 

3) Once the installation is done, then from the osC->admin->modules->payment->paypal config section, launch the IPN Test Panel and also turn the 'Test Mode' on. Perform a Test IPN (see instructions on that page), this will allow you determine whether the installation went correctly, all IPNs and as noted in their debug emails will be invalid since it is not a real transaction.

Testing with the sandbox is optional (since you would have to create dummy accounts etc - see first post of this thread), so you could just create a $0.01 product and use this to test directly via the live PayPal site - remembering to have correctly configured your Primary Email address and Business ID and later refund the $0.01 (however this requires tha ability of having 2 real PayPal accounts, eg. a personal account and a premier/business account).

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

Link to comment
Share on other sites

OK, I uploaded everything again like you said, and when I went through checkout and hit Confirm Order, I got this:

 

Parse error: parse error, unexpected $ in /home/****/public_html/Store/checkout_process.php on line 309

 

309 is the last line:

 

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');
 tep_session_unregister('comments');
   if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
 $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM  

 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

 

(I wonder how much it would cost for a cart that's already setup with all of this stuff.)

Link to comment
Share on other sites

skizzer, something is wrong in that the new catalog/includes/modules/payment/paypal.php file was not correctly uploaded otherwise you wouldn't see that error (going by the line number).

 

Also you would have to diligently perform the same edits required by the ccgv contrib in the correponding includes/modules/payment/paypalcheckout_process.inc.php (or checkout_update.inc.php).

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

Link to comment
Share on other sites

I just want to verify so I don't screw up.

 

Do you mean I have to do the same edits to includes/modules/payment/paypalcheckout_process.inc.php and checkout_update.inc.php that I did to checkout_process when I installed CCGV?

 

Also, I've uploaded catalog/includes/modules/payment/paypal.php three times now, so I don't really know how that can go wrong. Would the fact that my "catalog" folder is called "Store" have anything to do with it? I wouldn't think so, but then what do I know?

 

;)

 

 

Thanks you so much for helping me. You have no idea how much I appreciate it.

Link to comment
Share on other sites

At present I'm not sure whether it's checkout_update or checkout_process, the latter is called prior to transfering the customer to PayPal so it depends on whether the purpose is to apply the credit before or after, after being checkout_update.

 

As long as the path is correct form the root, e.g. includes/modules/payment/... then it doesn't matter whether the root is called catalog or store.

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

Link to comment
Share on other sites

Hi,

 

This probably has been asked here before, but i can't find it. I'm new to phpmyadmin, and i don't know how to make these modifications:

 

ALTER TABLE orders ADD paypal_ipn_id INT( 11 ) DEFAULT '0' NOT NULL;

 

ALTER TABLE orders_products_attributes ADD products_options_id INT( 11 ) DEFAULT '0' NOT NULL;

 

ALTER TABLE orders_products_attributes ADD products_options_values_id INT( 11 ) DEFAULT '0' NOT NULL;

 

I already had to reupload my database 3 times in the last week, and don't want to screw it up again.

 

Please help,

 

Thank you

Link to comment
Share on other sites

p.s. Also another question.

 

I'm planning to offer regular credit card and eventually install a darkblue affiliate code (which has i think only a 1 line modification to checkout success). Is this addon going to interfere in any way with either one?

 

Thanx again

Link to comment
Share on other sites

I know this type of question has been dealt with before, but none of the answers has helped me...

 

When a customer pays using Paypal, I don't get any emails from my site, and the quantities are not updated. The transaction is also not listed in Admin-->Customers-->PayPal IPN, so I'm assuming the problem is that I'm not receiving IPNs from Paypal.

 

Here are my settings for the Paypal module:

 

Enable PayPal Module
True

E-Mail Address
[email protected]

Business ID
[email protected]

Transaction Currency
Only USD

Payment Zone
--none--

Set Pending Notification Status
Pending

Set Order Status
Pending

Synchronize Invoice
False

Sort order of display.
1

Background Color
White

Processing logo
logo.gif

Store logo


PayPal Page Style Name
default

Include a note with payment
No

Shopping Cart Method
Aggregate

Enable PayPal Shipping Address
Yes

Debug Email Notifications
Yes

Digest Key
PayPal_Shopping_Cart_IPN

Test Mode
Off

Cart Test
Off

Notification Address
[email protected]

PayPal Domain
www.paypal.com

Return URL behavior
1

 

In Paypal, Instant Payment Notification is on and the URL is http://cobracards.com/checkout_success.php

 

Any help would be appreciated, thanks!

Link to comment
Share on other sites

OK Greg, thanks.

 

I think maybe this is getting way over my head. I'm afraid that trying to merge the two contributions to work together is going to be a lot more complicated than I can handle. I guess I'll just have to decide which one to keep, which is highly disappointing. I want people to get itemized invoices from PayPal, but I want them to be able to use coupons and such too. But I don't see how I can incorporate both without being a PHP expert. Is there no shopping cart program out there that has all of this stuff built into it and doesn't cost $500? If anybody knows of one, please let me know.

 

Thanks again for all your help.

Link to comment
Share on other sites

Please can somebody help me?

 

I have installed this as instructed, but now i get sql errors when i go into the stores admin section, and some of the text in the paypal options is missing too.

 

 

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/xxxxxx/public_html/shop/admin/includes/filenames.php:56) in /home/xxxxxx/public_html/shop/admin/includes/functions/sessions.php on line 67

 

Thanks, All,

Steve

Link to comment
Share on other sites

steve, you probably have some empty 'white space' in the file(s) you have edited. search the knowledge base for the header error line, it explains your error there.

Link to comment
Share on other sites

Thanks mate.

 

That got it sorted....apart from one thing lol

 

When i go into admin cp, and then to modules. I click on paypal, then edit, and i get the list down the right hand side of options,

But afterthe 'Set order status' option, i get no text, just a few text fields.

Any ideas please?

 

Thanks in advance, Steve

Link to comment
Share on other sites

greg et alii:

 

for those of you struggling with folding in ipn with other contributions, i hope you have fully explored the RCS i mentioned a couple pages back. place a copy of your working files in the repository and then all changes -- additions and deletions -- will be conveniently highlighted for you and makes checking for errors much easier.

 

AND NOW COMES ANOTHER SUGGESTION -- completely free jEdit.

 

this is an editor written in java and originally meant strictly for java programmers. like all open source software it has been expanded well beyond its original concept and it now serves as a premier editor for php, text, xml, html, javascript, and many more. since it is written in java you can use the same program across all o/s's: windows, mac, linux, and unix. but this is not some unfamiliar programmers tool that that require eons to learn to use. a complete neophyte can install it, download some plugins to expand its capabilities, load in a php file and be editing in 10-15 minutes. it has the regular "look and feel" of a windows program and none of the crankiness factor (something you experience when you use it) of a linux/unix program. it has been five years in the making and it is a very mature product. it is highly customizable, but "right-out-of-the-box" it is just fine for the casual user -- except for the needed plugins.

 

it gets its versatility from a wide range of plugins. there is a plugin for php syntax checking. one for ftp so you can edit files on your server directly. another plugin to create automatically a separate error file indicating the line(s) of code in error, the line number, and what was wrong with it -- not some "parse error at line 22", but "missing: ';'" instead. another plugin analyzes your "white space" and put a small colored dot where control characters exist so you can catch the spurious ^m often put after the final "?>" by windows editors. if you use RCS you do not have to worry because it automatically uploads whatever you have edited and puts in the proper unix line-ending and EOF codes in the right places. If you use jEdit, it also has a linux/unix line-ending switch. There is even a plugin allowing you to execute SQL statements on the server's database.

 

there is even light-weight cvs and diff, greg; but i do not use it and cannot say anything about it.

 

in order to use this pgm, i strongly suggest you follow these recommended steps:

 

STEP ONE:

unless you happen to have java 1.4.2_05 on your system, un-install what you have and restart your machine. unless you are a java affectionado, you probably have something from the 1.4.1_0x era. there are some real video issues in some of those versions and 1.4.2 is a better product and _05 is the latest stable version.

 

STEP TWO:

this is the java download page: java 1.4.2 download page

this page has the software developers kit (SDK), run-time (JRE), and documentation (who wants that?!) for downloading. the SDK is nearly 60MB and is extensive over-kill for what jEdit needs (or you at any other time). click on the download for JRE and you get the page with different o/s's if you are using windows they suggest using the "on-line" download because it is smaller. do not bother trying to find it, it is not there. OK, it is there in the form of the one that does not say "offline". anyway, you really want the "offline" version. this will be downloaded to your disk and be available for re-installation if needed. when it finishes it may not start by itself -- depending upon your system configuration. if it does not, use windows explorer to cruise to where you placed it and double-click on the icon to start it and let it rip on the defaults.

 

STEP THREE:

here is the editor: jEdit download page

this page will present you with choices -- again. now i upgraded my early 3.x version to 4.2pre15. this means 15 builds since 4.1 and previous to declaring 4.2 stabilized as a version. this should tell you something: you want 4.1. i have experienced no problems, but i reviewed the revision changes and there is nothing vital missing from 4.1 AND there is the possibility that some plugins will not work in 4.2 since they are only certified for 4.1. Please note: if you select either of the specific linux packages or the special mac package you are not getting the standard java package everyone else will have, so do not expect anyone to help you if problems arise. stick to the pure java implementation and you will not be sorry.

 

STEP FOUR:

you can spend an hour agonizing about which plugins to install and how they inter-relate or you can take my recommendations and get some initial configuration help by going here: jEdit Plugin/Configuration Help

 

STEP FIVE:

ENJOY!

 

i have used jEdit for some time now and had completely forgotten it is written in java. it was not until greg mentioned he did his development on a linux box and missed the bells and whistles of windows editors that i remembered. java is independent of operating systems so programs written in java will execute on any system with the java engine installed. thus, the very same program works everywhere.

 

Until greg's comments woke me from my inattentiveness, i really did not realize that many of the posts here relate to problems people are having because they lack a simple php syntactical tool. jEdit is that and a lot more and i hope anyone wishing to modify osc will jump right on getting it installed.

 

johann

Link to comment
Share on other sites

BUG REPORT:

 

When you have a registered address on osCommerce and change to a different bill to address on the "Payment Information" screen the payment address you changed to is NOT transmitted to paypal, the old address is instead!. Please be advised the payment option is live on my site, so don't let it charge your card...

 

Any ideas to fix this?

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

Link to comment
Share on other sites

johann, thanks, I'll look into it.

 

Keith

BUG REPORT:

 

When you have a registered address on osCommerce and change to a different bill to address on the "Payment Information" screen the payment address you changed to is NOT transmitted to paypal, the old address is instead!. Please be advised the payment option is live on my site, so don't let it charge your card...

 

Any ideas to fix this?

Was wondering how long it would take for something of this to be said, here I'm assuming that what is being refered to is the address details for the customer to sign up and register with PayPal, e.g new PayPal customers.

 

Prior reasoning behind why in catalog/includes/modules/payment/paypal.php in the function _drawCustomerDetails(&$order) that the $order->customer address fields are used instead of $order->billing is that the billing address has no osCommerce Customer associated telephone number, and so the customers default address details are used to pre-populate the new PayPal customers registration field.

 

PayPal only recognizes the address details used in their own registration process and verified where applicable.

 

If you want the billing address details to be passed to PayPal for as their PayPal registration details then change $order->customer to $order->billing (see catalog/includes/classes/order.php for more details). However you may then want to not pass the telephone number since it may not be particular to both addresses etc...

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

Link to comment
Share on other sites

I have php5 installed in my server so I'm getting the error Fatal error:

 

Cannot re-assign $this in /home/wnfaknd/public_html/catalog/includes/modules/payment/paypal.php on line 25

 

Any fixes other than installing php4?

Link to comment
Share on other sites

Thank you to whoever did this module... I'm lovin it. I installed mine in 3 hours.. :D but it's all worth it.. Be carefull when changing stuff for some of the codes you don't need to replace just add ons... :rolleyes:

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...