Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

Guest

I've made some changes to get Paypal IPN v2 to work with QTPro.

 

I'm not sure to whom I need to send these changes? The changes are primarily in ipn.php (but there's some tweaks to the database, and to classes/order.php too).

 

It works on my shop, but I'm not confident enough to release it myself as any kind of official patch or anything because I haven't much experience with osCommerce and I'd rather someone better puts it together - but I'll happily talk to the maintainers of either QTPro or Paypal IPN to get it out there - if it's really any good.

 

If whomever wants to PM me to discuss it please go ahead :-)

 

Best Regards,

Steve.

Share this post


Link to post
Share on other sites
Guest
I've made some changes to get Paypal IPN v2 to work with QTPro.

 

I'm not sure to whom I need to send these changes? The changes are primarily in ipn.php (but there's some tweaks to the database, and to classes/order.php too).

 

It works on my shop, but I'm not confident enough to release it myself as any kind of official patch or anything because I haven't much experience with osCommerce and I'd rather someone better puts it together - but I'll happily talk to the maintainers of either QTPro or Paypal IPN to get it out there - if it's really any good.

 

If whomever wants to PM me to discuss it please go ahead :-)

 

Best Regards,

Steve.

 

Hmmm, sorry for making my original post a reply to an unrelated thread - I clearly don't have much experience with this forum system either!

Share this post


Link to post
Share on other sites
Hi Terra, I did not switched on the IPN. I do not have SSL, it's a shared hosting, with PHP 4.3.2.

I added in the mail(....) as mentioned, and still getting nothing. But if i type the full URL of www.xxx.com/ext/modules/payment/paypal_ipn/ipn.php, "mail('xxx@xxx.com', 'testing paypal', 'paypal has found the file');" works.

 

Is it my paypal problem?

 

Hi guys,

 

An update on the issue on nothing from my paypal ipn. I have tested with other server from another web hosting provider, it works perfectly well. Obviously the problem is the setting on the server, which has blocked the message from paypal.

 

Until now the provider is still not able to tell me why it happened and i have moved to another host. Thanks for all the help.

Share this post


Link to post
Share on other sites
I know this IPN isn't userfriendly but believe me if there was a different way, I'd have taken it a long time ago. The only other option is Express checkout. Of course, an optimist may hope that PayPal actually fixes their checkout procedure to something where customers actually return from PayPal but I'm not holding my breath. PayPal's only saving grace is that they are cheap & easy to set up. As for anything else they are way behind their competition and this whole checkout mess just proves my point - no other payment gateway provider has this problem. Not SECPay. Not Protx. Not WorldPay. Not HSBC. Not Barcalys. Only PayPal.

 

all the best - Terra

 

ok I hope I am not totally goofing... but because of Paypal not always returning to the shopping cart at least it's what i think it is... ( I think the person that posted on the contrib 3725 might be right

 

"

(I've made what you said, but it does not (always) work.

 

The reason for is simple:

If you switch Auto Return=on AND PayPal Account Optional=on , PayPal does NOT return if the paying customer is a new one for PayPal - this means he or she is or has not registered himself or herself within PayPal.

 

It is obvious that in this case PayPal wants to show such customers a PayPal window telling them about how good it is to become a PayPal member instead of returning to the calling shop without using this advertisment.

You can find a description of this behaviour in the help text attached to the Auto Return Radio Button:

"Note: If you have turned on Auto Return and have chosen to turn on PayPal Account Optional for new users, a new user will not be automatically directed back to your website, but will be given the option to return."

 

Regards, tuttoBENE

 

Attached file contains the same text.

 

I have more then one issues that have arisen... for instance the CCGV, when a Voucher is used to pay an order or part of an order, the Credit Voucher balance of the customer isn't reduced. So I've had the issue of a customer using the same voucher amount over and over. I've catch it everytime so far but it's really time consuming... so I am trying to figure out a way.

 

So far the only commun point I've found is this...

 

Normally an order that runs it's course properly, this message gets displayed in the comment in the order:

 

Date Added Customer Notified Status Comments

02/14/2007 15:50:20 Pending PayPal IPN Verified [Completed (Verified; $64.90)] (this one has a red X has not sent to the customer)

02/14/2007 15:50:32 Preparing [PayPal IPN] (this one has a green check saying the customer had been notified) I would sure like to understand how it happens that the customer did come back to the shop... and the order is appearing as Pending for me but the last order history entry says Preparing Paypal IPN? would htat make any difference?

 

 

On orders that I am thinking the customer isn't returning to the cart (I have auto return activated in Paypal and most of the time all is well so I am thinking that it might be because my site accepts payments by non-members of Paypal... and I have no choice and Paypal Express CheckOut isn't an option for out of US business accounts at this point I think... so this is what i get on orders where glitches like the on with the Vouchers happen:

 

Date Added Customer Notified Status Comments

02/26/2007 14:39:44 Pending PayPal IPN Verified [Completed (Unverified; $11.49)] with an X for the customer hasn;t been notified Now, if somehow the problem is with the customers not having a Paypal account and just using the secure payment part of it with their credit card, am I to assume they were returned anyway to the shopping cart or not when I get this order history? or could I be lucky and hte problem is something else and fixable?

 

 

Now mind you I am totally dumb when it comes to coding but is there a way to write up something that would kind of count time and after like I don't know 5 min if the customer didn't return automatically to the shopping cart then there would be a forced reroute or something? Hummm I have a feeling this might be impossible but just thought I should ask.

 

Thank for any help

Edited by mariemeh

Share this post


Link to post
Share on other sites

one last question for Terra... sorry to be a bother :rolleyes: ... I remember reading in older posts that version2.x weren't working with CCGV but that was along time ago... any chance the new version released...

 

would my problem of my customer's voucher balance not updating be taken care of if it does?

 

and in the problems remaining you list:

Remaining issues:

-> If force shipping == True, then customers without PayPal account will have to retype their address

 

 

in the latest update it says that the address will transfer... does that include the customers without a Paypal ccount?

 

aslo I just saw another update by Gotti to eliminate the need for download controller... has anyone tried that part yet?

 

thanks again

Share this post


Link to post
Share on other sites

I followed the instructions in the download file and installed the files as follows (using oscommerce v2.2 ms2):

 

oscommerce/ext

oscommerce/includes/modules/payment/paypal_ipn.php

oscommerce/includes/languages/english/modules/payment/paypal_ipn.php

 

in admin under payment modules, the module appears as Credit/Debit card via Paypal - it is installed and enabled.

 

When I place a test order, paypal does not appear in the payment options. Can anybody suggest a fix? does it have to do with database_tables.php in includes?

 

Thanks for any input

Share this post


Link to post
Share on other sites
When I place a test order, paypal does not appear in the payment options. Can anybody suggest a fix? does it have to do with database_tables.php in includes?

Check your sort orders - if two payment modules share the same sort order only one will be displayed. 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
Check your sort orders - if two payment modules share the same sort order only one will be displayed. all the best - Terra

 

all the other modules in admin are not installed. Only paypal ipn is installed and enabled, with sort order of 0. What appear as payment options are cash on delivery, and credit card, but no paypal. Why does cash on delivery appear even though the module is not installed? why does not paypal appear as an option?

Share this post


Link to post
Share on other sites

ok after all the testing we did yesterday... I am back to square one so to say... ALL my Paypal payments... those from Paypal members and those from Paypal non-members... returning or not returning to the store are NOT updating the Credit Voucher Balance... any other form of payment... Check Money Orders, Credit Cards over Phone... all of those are updating nicely... so I am thinking that my install of the CCGV trad was done ok but there is a glitch when it come to it working with Paypal end of story or with Paypal IPN here...

 

I would really really appreciate an answer just to let me know if I am on the right path or if I should just go to the CCGV thread because the problem is there... any advice.... thanks

Share this post


Link to post
Share on other sites

This is my first post so very sorry if i'm asking a very stupid question. I copied over the files listed in the contribution. However the problem is it gives directions to from the admin menu to install the paypal ipn once you've copied over the files. I did this and "paypal ipn" as a payment option never apeared in the admin menu. Looking closer i don't know why it would when it didn't make any changes to the admin folder. Any help is highly appreciated since i'm stuck with the old don't know what they ordered problem until i get this fixed. Thanks for any help!!! Maybe i'm being stup but is there anything else i need to do besides copy the files over into my store to get the ipn option to appear so i can install it. I did copy over both the includes directory from the install and the "ext" directory. Thanks again.

Share this post


Link to post
Share on other sites
all the other modules in admin are not installed. Only paypal ipn is installed and enabled, with sort order of 0. What appear as payment options are cash on delivery, and credit card, but no paypal. Why does cash on delivery appear even though the module is not installed? why does not paypal appear as an option?

 

 

I was also having the same problem. The first question in the IPN admin says

 

Enable PayPal IPN Module

Do you want to accept PayPal IPN payments?

 

you need to choose "Yes". Hope that helps.

Edited by smfh25

Sonia,

Share this post


Link to post
Share on other sites
Looking closer i don't know why it would when it didn't make any changes to the admin folder.

You don't make changes to any admin files as the payment modules are handled by a mix of database and /includes/modules/payment/ files settings. The payment page runs through all available modules and based on their db setting (on / off) displays them on the page. What you should do to install

-> click "install" in your admin .... this will write the module to the db

-> activate the module by setting to "yes" I want to accept PP payments ... this will tell the shop to display the module

-> give it a unique sort order (if in doubt, choose a number other than 0) ... helps if modules conflict

 

Also - the PayPal IPN is called "Pay via PayPal (credit/debit card)" in admin if I remember correctly. If you click on it, it should say "PayPal IPN" in the appearing right-hand column text.

 

all the best - 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
You don't make changes to any admin files as the payment modules are handled by a mix of database and /includes/modules/payment/ files settings. The payment page runs through all available modules and based on their db setting (on / off) displays them on the page. What you should do to install

-> click "install" in your admin .... this will write the module to the db

-> activate the module by setting to "yes" I want to accept PP payments ... this will tell the shop to display the module

-> give it a unique sort order (if in doubt, choose a number other than 0) ... helps if modules conflict

 

Also - the PayPal IPN is called "Pay via PayPal (credit/debit card)" in admin if I remember correctly. If you click on it, it should say "PayPal IPN" in the appearing right-hand column text.

 

all the best - Terra

 

The module is installed, enabled an given a unique sort orer. Still the only payment methods displaye at checkout are cash on delivery, and credit card. No mate what I do these 2 payment methods are the only ones available. I tried installing and enabling other payment modules, but still the only methods shown are the ones I mentioned above. This is turning out to be a nightmare.

Share this post


Link to post
Share on other sites
I've made some changes to get Paypal IPN v2 to work with QTPro.

 

I'm not sure to whom I need to send these changes? The changes are primarily in ipn.php (but there's some tweaks to the database, and to classes/order.php too).

 

It works on my shop, but I'm not confident enough to release it myself as any kind of official patch or anything because I haven't much experience with osCommerce and I'd rather someone better puts it together - but I'll happily talk to the maintainers of either QTPro or Paypal IPN to get it out there - if it's really any good.

 

If whomever wants to PM me to discuss it please go ahead :-)

 

Best Regards,

Steve.

 

I'd be more than happy to know what these changes are. Please let me know.

Thanks a lot! :)

Share this post


Link to post
Share on other sites

Greetings,

 

I had the same problem in which the Paypal module did not appear during the checkout, and found out that if you disable the payment zone (choose empty from the drop down list), then it works as expected.

 

Not sure about the importance of this option, so I'll leave it like this for now.

 

Furthermore, I have managed to install without problems the module and successfully perform payments, but I'm experiencing the classic Error 3005 when I'm trying to enable the encrypted payment.

 

I've search over the two forums (Paypal & oscommerce) but the most answers are for people not being able to perform a payment at all..

 

Well, to sum it up:

 

- I've cleared the cookies

- I've used "openssl genrsa -out my-prvkey.pem 1024" to generate the public key

- I've used "openssl req -new -key my-prvkey.pem -x509 -days 365 -out my-pubcert.pem" for the private

- Created a sandbox business account - verified it and confirmed it

- Downloaded the API Certificate and Uploaded my-pubcert.pem

- Took the Public Cert id and insert it to the module

- Checked permissions for certificates or for temp folder

- Put the same email address in the module and in the business account

- Tried various combinations of the module's options

- Spent 2 days without any success so I've decided to ask for help..!

 

Do anybody know any causes which will prohibit the encrypted payment from being performed???

 

I know that sometimes the solutions are really trivia, but I need it to work really soon and I do not have enough time for further experiments.... :/

 

Please - any help would be really much appreciated...

Giorgos

Share this post


Link to post
Share on other sites
- Downloaded the API Certificate and Uploaded my-pubcert.pem

You downloaded the wrong certificate. Please download the one from Encrypted Payment Settings.


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

what can I say...???? :D

 

Thank you sooooooooooo much :D

 

Worked like a charm :thumbsup: :thumbsup: :thumbsup:

Share this post


Link to post
Share on other sites
HELP.

I installed Paypal IPN v2.1 and everything seemed fine. I had 1 order and now when I try to put an order through whether live or testing I get the following error message. What have I done wrong. It doesn't happen with ordinary paypal

 

1062 - Duplicate entry '0' for key 1

 

insert into orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, currency_value) values ('47', 'fred flintstone', '', '123 fred street', '', 'anytown', 'FL3 5TG', 'somewhere', 'United Kingdom', '001236547896', 'fred@flintstone.com', '1', 'fred flintstone', '', '123 fred street', '', 'anytown', 'FL3 5TG', 'somewhere', 'United Kingdom', '1', 'fred flintstone', '', '123 fred street', '', 'anytown', 'FL3 5TG', 'somewhere', 'United Kingdom', '1', 'Credit/Debit Card (via PayPal)', '', '', '', '', now(), '4', 'GBP', '1.00000000')

 

[TEP STOP]

 

Sorry if this is covered elsewhere in the thread. I did look and couldn't find anything similar

 

Thanks

 

Hi I asked this a few days ago. Can anyone help please? :'(

Thanks

Share this post


Link to post
Share on other sites
Hi I asked this a few days ago. Can anyone help please? :'(

Thanks

The orders_id field in your orders table in database needs to be 'auto_increment'.


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

Hi,

 

I just installed this paypal contribution can't beleive how easy the install was, anyway i have set up all the details required in the admin and enabled it, but it is not showing as an option to use to pay via paypal,, has anyone else come across this issue..? any odea what i am doing wrong..?

 

 

Please help,

Thanks

saj

Share this post


Link to post
Share on other sites

My original post:

Last two replies:

 

Dear Terra and Alex

 

Sorry to go quiet for so long -- I wasn't being intentionally rude and ignoring your replies, I was being chased by the tax man -- all OK now though :)

 

In the paypal_ipn.php file you'll therefore find 2 entries:

$parameters['notify_url'] = tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', 'language=' . $_SESSION['language'], 'SSL', false, false);
$parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

 

My parameters lines in paypal_ipn.php are:

 

$parameters['notify_url'] = tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', '', 'SSL', false, false);

$parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

$parameters['cancel_return'] = tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');

Should the SSL entries be there as I'm not using SSL?

 

 

This is most likely what went wrong. Please check your includes/configure.php and see what you have in the HTTPS_SERVER definition. The line in paypal_ipn.php:

$parameters['notify_url'] = tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', '', 'SSL', false, false);

will put the https url in the button code. If you have had something wrong in the HTTPS_SERVER line of configure.php, IPN would fail.

...

In include/configure.php I have

 

  define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', false); // secure webserver for checkout procedure?

Which looks OK...?

 

 

...

If that is not the case, then you need to check if IPN can reach your ext/modules/payment/paypal_ipn/ipn.php. You can add a mail() function at the top of your ipn.php file as Terra suggested in an earlier post, to send an email to you on each IPN call. If you get that email but no further actions like updating orders status, sending out invoice email...etc, your ipn.php can't 'talk' back to paypal. You will need to find out with your host why ssl connections on port 443 couldn't be established between your host and PayPal, or why curl couldn't get through https to PayPal.

Looks like that's confirmed:

I added a mail(...) at the top of ipn.php, but received no email after placing an order.

 

 

I'd be grateful if you can supply the following information:

-> your exact version of PHP you are running

-> what port 1&1 allow you to use (port 80, port 443). NB: make sure that this info is correct for a site which does not have full SSL.

-> if cURL is enabled

 

If you can post this information we should get a bit closer to finding out what's going wrong. If you don't know the info yourself please ask your hosting provider - without it, I can't help. You can advise 1&1 that this is to debug a payment module which needs to establish a connection with the payment site (hence the port query).

 

from phpinfo():

 

PHP Version 4.4.4

 

Configure Command: ...'--with-curl'...

 

curl

CURL support enabled

CURL Information libcurl/7.10.3 OpenSSL/0.9.6g ipv6 zlib/1.2.1

 

Environment

SERVER_PORT 80

 

No mention of port 443.

If I try to reach my page that has the phpinfo() script in it via https, I get an 'unable to connect' error.

 

 

Thanks again

Alan

Share this post


Link to post
Share on other sites

My only remaining problem is from what I can see just about everybody else's problem is how to ensure that the customer comes back to the shopping cart when they don't have a Paypal account.

 

The problem is that Paypal put a tiny link at the very bottom of the last page. Their come and join us sort of message is so big across the page that it won't cross the customer's mind for one second to scroll down the page to find that tiny link to go back to the cart so they just close the window.

 

I've found this contribution which I htink could help because we would be alerting the customer right before they would get to Paypal:

http://www.oscommerce.com/community/contributions,4737 (I don't know if I am allowed to post the code here)

 

it is supposed to work with the original paypal module... but looking at it I thought if I could just make this work with paypal ipn... I would want to make this popup appear and change the appearance of it. Insert thumbnails of the Paypal pages with a blow up of hte part that really matters to us and tell the customer... watch for this... you HAVE to go click there and return here. I'd be glad to share the graphic once it's done but I need to make the code in the contrib 4737 work with paypal_ipn for it to work. I've already tried replacing "paypal" by "paypal_ipn" and I am probably not good enough and it didn't work.

 

Note that I would be replacing the text and shorthen it and replace with visuals if I can make it work.

Can anyone help me with making the code work?

Share this post


Link to post
Share on other sites
I added a mail(...) at the top of ipn.php, but received no email after placing an order.

So you didn't get any IPN call from PayPal, your notify_url (ext/modules/payment/paypal_ipn/ipn.php) seemed not reachable.


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

Terra, Alex and Tigergirl,

 

So is this the best option you guys think for not driving people away and assure them that you dont really need to have a paypal account to pay and/or complete your order.

 

The reason I ask is that I have also had many folks coming and than calling me that they dont want to use paypal to complete the order.

 

I just want to know what can I edit and which codes to tell people that " YOU DON'T NEED A PAYPAL ACCOUNT TO COMPLETE YOUR ORDER".

 

Please suggest what are the best options and I am going to implement it also.

 

Best regards,

 

Amit

 

Terra, thank you so much for a speedy response. I hadn't thought about all the other files this would affect. I did try your suggestion in inc/lang/eng/checkout_confirmation - it gave the line of text at the top of the page. I wanted the text to be a bit more visible for customers.

 

I decided to try a different option which doesn't affect the other files:

in inc/module/payment/paypal_ipn I altered to:

define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_TITLE', 'Credit/Debit Card (via PayPal)');
 define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_DESCRIPTION', 'PayPal IPN');

 // Sets the text for the "continue" button on the PayPal Payment Complete Page
 // Maximum of 60 characters!  
 define('CONFIRMATION_BUTTON_TEXT', 'RETURN TO XXXX to Complete your Order Confirmation');

 

in inc/lang/english/checkout_payment I altered:

define('TEXT_SELECT_PAYMENT_METHOD', 'Please select the preferred payment method to use on this order. <br>PayPal - use securely with or without PayPal account.');

 

in inc/lang/eng/checkout_confirmation I altered:

define('TEXT_INFORMATION', '<b><font color="#FF0000"> Paying by Debit/ Credit Card?  You DO NOT need to register a PayPal account, use PayPal with or without PayPal account.<br>After paying via PayPal please click on \'RETURN TO XXXX to Complete your Order Confirmation\'.</font></b>');

 

I'm hoping this will make it clear to the customer since PayPal tries to fool people into registering a PayPal account. Hopefully they will return to the store to sign up to product notifications too.

Rob - this post might help you too. The file you wanted was: inc/module/payment/paypal_ipn - paypal_ipn.php,v 2.1.0.0 13/01/2007 (newest version), it's at the top of the file. - Good luck.

Terra, thanks again, and for the superb contrib. I posted earlier about the customer comments in the email confirmation. Are you able to help with that?

 

Kind regards

Tigergirl

Share this post


Link to post
Share on other sites
So you didn't get any IPN call from PayPal, your notify_url (ext/modules/payment/paypal_ipn/ipn.php) seemed not reachable.
It certainly looks that way.

I checked the permissions: ipn.php is 644 and all directories above are 755.

Given also that cURL is enabled, it's puzzling.

 

I'm still concerned about the following:

$parameters['notify_url'] = tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', '', 'SSL', false, false);
$parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
$parameters['cancel_return'] = tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');

All those references to SSL, when I don't have SSL enabled.

Especially the 'return'.

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

×