Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal_Shopping_Cart_IPN


devosc

Recommended Posts

Hallo and first of all: thanks for such a great contribution.

 

I installed the 2.2 becuase I have had some problems with outoreturn to my shop with the 1.7. I thoght I can solve tohose problems with the 2.2.

 

I think the out return from paypal to my shop is ok now....

 

BUT now OSC dose not send out the Mail to the customer with his orderinformations and I (the webmaster) also get no mail. I only get the paypal mails.

 

Can somebody help me?!

Thanks Matthias

Link to comment
Share on other sites

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

HI Matthias,

 

First try a test IPN, via the IPN Test Panel in the admin PayPal config. There are some instructions.

 

If successful you should see a success page. Otherwise in payments/paypal/application_top.php comment out the error_reporting(0) line and uncomment the line above and then run the Test and see what happens.

 

Depending on your currency, you may have to switch off the Cart Test (do so for now).

 

The first objective is to start receiving debug emails, and then to receive one whilst in Live mode.

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

Link to comment
Share on other sites

right now i am getting this error under Admin>Customers>Paypal IPN:

 

1054 - Unknown column 'o.paypal_ipn_id' in 'on clause'

select count(*) as total from paypal as p left join orders as o on p.paypal_ipn_id=o.paypal_ipn_id

[TEP STOP]

 

 

Also my paypal payment option doesnt show up when customers want to check out. All the other payment options will show up or not, but when paypal option is enabled theres nothing there.

Link to comment
Share on other sites

Justin,

 

the field paypal_ipn_needs to be added to the orders db table, this was one of the very first steps (see the 'alter' statements).

 

With the other problem it is hard to say, what did yo do with the old PaPal modoule in catalog/includes/modules/payment/ (paypal.php) you need to remove or rename the '.php' extension to '.phpX' it cannot be '.php'. If your still having problems put the old one back in and then check to see if the problem still exists, and possibly start again.

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

Link to comment
Share on other sites

Justin,

 

the field paypal_ipn_needs to be added to the orders db table, this was one of the very first steps (see the 'alter' statements).

 

With the other problem it is hard to say, what did yo do with the old PaPal modoule in catalog/includes/modules/payment/ (paypal.php) you need to remove or rename the '.php' extension to '.phpX' it cannot be '.php'. If your still having problems put the old one back in and then check to see if the problem still exists, and possibly start again.

yeah it looks like i overlooked it, sorry for bothering, i've been working on osc the past 2 days for 12 hrs straight.

 

For the paypal payment not showing up, ill try uploading a fresh , if i changed the paypal.php to something like paypal.phpx ill get this error:

 

Warning: payment(includes/modules/payment/paypal.php): failed to open stream: No such file or directory in d:\www\i\m\istoreparts.com\www\catalog\includes\classes\payment.php on line 39

Warning: payment(): Failed opening 'includes/modules/payment/paypal.php' for inclusion (include_path='.;c:\php4\pear') in d:\www\i\m\istoreparts\www\catalog\includes\classes\payment.php on line 39

Fatal error: Cannot instantiate non-existent class: paypal in d:\www\i\m\istoreparts\www\catalog\includes\classes\payment.php on line 41

 

i'll let you know how this goes in a couple hours, and post a new reply to let you know if it fixed the problem.

Link to comment
Share on other sites

HI Matthias,

 

First try a test IPN, via the IPN Test Panel in the admin PayPal config. There are some instructions.

 

If successful you should see a success page. Otherwise in payments/paypal/application_top.php comment out the error_reporting(0) line and uncomment the line above and then run the Test and see what happens.

 

Depending on your currency, you may have to switch off the Cart Test (do so for now).

 

The first objective is to start receiving debug emails, and then to receive one whilst in Live mode.

OK I made the test... everything looks ok. I have a resultpage "IPN Test Results" and "Test Complete! " No error is reportet. I get NO mails.

 

But I will try to explain my problem.

 

Normaly I get two mails during the orderprocess. One is: NEW CUSTOMER and the second is a copy of the order. Also I get a copy to the adress I defined in admin where to send a copy of the order. Ok... that the normal way we all know

 

After the installation of the version 2.2 of PP IPN with autoreturn to my page:

 

1. I have a order in my shop with the status "pending......"

2. I get a mail from paypal, that I have get a payment

3. I get a mail from paypal to my testaccount with the details of my own order

 

But I don't get the order to the shopowner emailadress and i don't get the mail to my customeradress.

 

Perhaps you can help better now.... ??!! Thanks

Thanks Matthias

Link to comment
Share on other sites

Matthias, did you switch the Cart Test Off?

Thanks... :) I turned off the TestCart and now I get mails:

 

1. to webmaster NEW ORDER

2. to the defined mailadress a copy of NEW ORDER

3. from PayPal to webmaster

4. from PayPal to the customer

5. And also the Ordermail from OSC to the customer

 

But now the Mail to the customer is in plain text. The Mail to the webmaster from osc ist well formatete. The Mail to the customer contains the information you normaly see if you look at the options and details of a mail. It's not formatet anymore.

 

 

:o AND The content of the mail is not the same like before. Is there a new place where the mail is generated ? I have changed the mails which are send out to the customer .

 

 

Perhaps you can help here too, because that is also a new problem since I#ve installed the contribution.

Edited by bodyfeelings

Thanks Matthias

Link to comment
Share on other sites

I'm assuming that you made changes to your original catalog/checkout_process.php script in regard to the emails.

 

If you look in catalog/includes/modules/payment/paypal/checkout_update.php towards the bottom you'll see the email bits defined like in the orginal osC MS2-2.2 catalog/checkout_process.php script, I tried to keep it all the same so that it is easily identifiable but still exercise some caution to match the variables used.

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

Link to comment
Share on other sites

Yes I made some changes. But why is the mail to the webmaster well formated and the one to the customer not. In that mail of the customer you have something like this:

 

Return-Path: <[email protected]>
Received: from server02.rns24.de ([62.146.91.106]) by mailin02.sul.t-online.de
with esmtp id 1BIkDF-0jRk9Y0; Wed, 28 Apr 2004 10:14:37 +0200
Received: (from wwwrun@localhost)
by server02.rns24.de (8.11.6/8.11.6/SuSE Linux 0.5) id i3S8Eg231084;
Wed, 28 Apr 2004 10:14:42 +0200
Date: Wed, 28 Apr 2004 10:14:42 +0200
Message-Id: <[email protected]>
To: " " <[email protected]>
Subject: Bestellung
From: "Bodyfeelings" <[email protected]>
MIME-Version: 1.0
X-Mailer: osCommerce Mailer
Content-Type: multipart/alternative;
boundary="=_b84d948e7e02fb627712cdac11737ce2"
X-Seen: false
X-TOI-SPAM: n;0;2004-04-28T08:14:53Z
X-NAS-Classification: 0
X-NAS-MessageID: 11838
X-NAS-Validation: {13A0351C-8EF3-40C3-BF9A-E27FFEDBCB00}


--=_b84d948e7e02fb627712cdac11737ce2
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Bodyfeelings
------------------------------------------------------
Bestellnummer: 260

and so on....

Thanks Matthias

Link to comment
Share on other sites

I don't know right now, maybe it is something to do with the Mime Type and sending HTML emails? both emails are sent via the same function (unless you changed that), so it is strange, someone else may of been talking about this same issue a few weeks ago, but I've tested the contrib on a couple of different servers and have not noticed a problem, but here the emails were plain text, which you might want to try to test. Did you make any changes in the original catalog/includes/application_top.php script in regards to using a different email class other than the original osCommerce version?.

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

Link to comment
Share on other sites

No I only changed the content of the mails, but I don't change the settings around that.

 

I also wondering about because the copy of the mail is ok and only the (same) mail send out to the customer is hacked......

 

Is it not possible to leave the message in it's origainal files an only call them from a new file. In this case checkout_update.php.

 

I know more users changed the mailcontent too and it would be easier for the webmaster of a shop to admin if there are not two places for the mail (depending on payment with paypal or not).

Thanks Matthias

Link to comment
Share on other sites

The problem with the mails to the customer is not solved until now....

 

I think the best is to try to use the original checkout_process.php instad of the checkout_update.php.

 

But during the testing I deleted some orders made over PP IPN and I saw, that the table for "PayPal Instant Payment Notifications" is not deleted.

Thanks Matthias

Link to comment
Share on other sites

The only difference between the mail stuff in checkout_update.php and checkout_process.php is

EMAIL_TEXT_ORDER_NUMBER . ' ' . $orders_id . "\n" .

i.e in checkout_process.php $insert_id == $orders_id

 

Is it not possible to leave the message in it's origainal files an only call them from a new file. In this case checkout_update.php.

It is possible, you can do it yourself, but since here this a contribution, changes to the original osC files are tried to be kept to a minimum, as said it should be easy to identify the similarities in the script where the only thing that changed is the above mentioned $insert_id.

 

But during the testing I deleted some orders made over PP IPN and I saw, that the table for "PayPal Instant Payment Notifications" is not deleted.

I'm not sure that I understand, are you removing the contrib, then you would need to delete the tables listed in the documentation and reverse the install steps. If you had a previous version of this contrib there will be some redundant tables starting with the prefix 'paypal_ipn' these can be removed (I would suggest you back up the db first).

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

Link to comment
Share on other sites

QUOTE 

But during the testing I deleted some orders made over PP IPN and I saw, that the table for "PayPal Instant Payment Notifications" is not deleted.

 

 

I'm not sure that I understand, are you removing the contrib, then you would need to delete the tables listed in the documentation and reverse the install steps. If you had a previous version of this contrib there will be some redundant tables starting with the prefix 'paypal_ipn' these can be removed (I would suggest you back up the db first).

 

No I deleted an order I have made over PayPal. And than the content of the tabel is not deleted. The IPN - you know ? Normaly if I delete an order the related content in other tables will be deleted too.

 

The only difference between the mail stuff in checkout_update.php and checkout_process.php is

CODE 

EMAIL_TEXT_ORDER_NUMBER . ' ' . $orders_id . "\n" .

 

i.e in checkout_process.php $insert_id == $orders_id

 

Yes that's write... but there must be a different, because without the contribution

all mails were ok. Could it be, that one file that is necessary is not included ore linked ?

 

I had the IP adress of the customer in my mails. No the varibale is existing anymore. It is no problem with the original checkout_process. I assume that there are a problem with missing not global variables. But I'm not a PHP programmer !?

 

But anyway.... it looks not very good in the customers mail when there is the all the text in the body of the mail which normaly is not visible.

Thanks Matthias

Link to comment
Share on other sites

Did you perform the install step in regard to the tep_remove_order function admin/includes/functions/general.php? The PayPal database tables have changed (names also).

 

Both email.php and mime.php classes are included as in the original includes/application_top.php. When I get a chance I will test HTML emails.

 

If your using additional session info from what osCommerce usually uses (I can't explicitly account for that in developing the contrib :) ). You'd need to make some changes in paypal/checkout_process.php, paypal/application_top.php and paypal/checkout_update.php if you are using additional session info. Try and follow through what is happening to $sendto and you should be able to implement the same for (for example) $ip_address.

This would be required so that when it comes to time to send the emails etc, the application (osC) knows what information to use (since the checkout is not done all at the same time), this session info is stored in the db table 'orders_session_info'.

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

Link to comment
Share on other sites

Did you perform the install step in regard to the tep_remove_order function admin/includes/functions/general.php? The PayPal database tables have changed (names also).

Uups... that was my fault. I've done the step but between the two {.

OK That problem is solved.

 

Now back to my other problems with the mail and missing varibales.

 

I have installed teh contribution Order IP Adress.

IP Adress Collector Contribution

 

From this contribution I get the IP of the customer. But if I make an order over PP IPN the IP is missing. It's the same problem with my mail where I send the customer IP adress within. The varibale is not existing in the new files from PP IPN.

 

I'm not good enogh in php to solve this problem .....

 

I think that there must be something, what goes wrong also with the mail to the customers ? I will make another test an change my settings in the admin from html mail to false. But that only can be a workaorund not a bugfix.

Thanks Matthias

Link to comment
Share on other sites

OK it's me again.

 

With my malproblem I don't find a solution I need help !?

 

But what I have now found is that on the process site the following has a broken link as result.

 

    <div><?php $logo = (MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME) ? MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME : STORE_LOGO; echo tep_image( DIR_WS_IMAGES . $logo ); ?></div>

 

But the image is existing. If I look at the settings of the broken link the varibale "MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME" is not filled with the name..... where could I look after the problem ??

Thanks Matthias

Link to comment
Share on other sites

Quick question. I know someone in this thread will be able to help me. What page are you guys/gals using as you "success" page to return from paypal after a payment is completed? This is part of the new PayPal checkout process.

 

checkoutsuccess.php?

 

Thanks,

matt

Link to comment
Share on other sites

Change

<div><?php $logo = (MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME) ? MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME : STORE_LOGO; echo tep_image( DIR_WS_IMAGES . $logo ); ?></div>

To:

<div><?php $logo = (MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME != '') ? MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME : STORE_LOGO; echo tep_image( DIR_WS_IMAGES . $logo ); ?></div>

BTW, I just tested HTML emails and they seemed fine on my system (i.e. I enabled HTML emails via the admin).

 

checkout_success.php?action=success

is now the return url upon successful completion of the PayPal payment process, see the FAQs for further info.

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

Link to comment
Share on other sites

Hallo Gregory,

 

that dose not solve my Problem:

 

div><?php $logo = (MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME != '') ? MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME : STORE_LOGO; echo tep_image( DIR_WS_IMAGES . $logo ); ?></div>

 

After changing the code I looked at the broken link again. That's what I can see there.

http://www.mydomain.de/catalog/images/MODU...LOGO_IMAGE_NAME

 

The variable MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME is not set.

 

Perhaps that is not only the problem for this silly picture... it is perhaps the problem of my html mail too.

Thanks Matthias

Link to comment
Share on other sites

OK, now back again to the mailproblem.

I have tested it with and without html and in both cases the copy of the mail to the webmaster is well formated and the importand message to the customer has the "backgroundinfos" on the top of the mail.

 

here again an exampel of a mail.

 

Return-Path: <[email protected]>
Received: from server02.rns24.de ([62.146.91.106]) by mailin04.sul.t-online.de
with esmtp id 1BIoW1-1AG0nY0; Wed, 28 Apr 2004 14:50:17 +0200
Received: (from wwwrun@localhost)
by server02.rns24.de (8.11.6/8.11.6/SuSE Linux 0.5) id i3SCoOk27041;
Wed, 28 Apr 2004 14:50:24 +0200
Date: Wed, 28 Apr 2004 14:50:24 +0200
Message-Id: <[email protected]>
To: " " <[email protected]>
Subject: Bestellung
From: "Bodyfeelings" <[email protected]>
MIME-Version: 1.0
X-Mailer: osCommerce Mailer
Content-Type: multipart/alternative;
boundary="=_d304acc5a098a41f213de9de2c8df770"
X-Seen: false
X-TOI-SPAM: n;0;2004-04-28T12:50:23Z
X-NAS-Classification: 0
X-NAS-MessageID: 11888
X-NAS-Validation: {13A0351C-8EF3-40C3-BF9A-E27FFEDBCB00}


--=_d304acc5a098a41f213de9de2c8df770
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Bodyfeelings
------------------------------------------------------
Bestellnummer: 265
Detailierte Bestellübersicht: http://www.bodyfeelings.de/catalog/account_history_info.php/order_id/265
Bestelldatum: Mittwoch, 28. April 2004

Artikel
------------------------------------------------------
6 x Party-Overall (Angebot) (r201650) = 120,00EUR
Gr??e lt. Gr??entabelle M
------------------------------------------------------
Zwischensumme: 120,00EUR
Versandkosten: 0,00EUR
Summe: 120,00EUR

Lieferanschrift
------------------------------------------------------
Matthias Fxxxxx
Flixxxxxx. 14
88886 Gxxxx
Deutschland

Rechnungsanschrift
------------------------------------------------------
Matthias Fxxxx
Flixxxxxrx. 14
88888 Gxxxx
Deutschland

Zahlungsweise
------------------------------------------------------
PayPal


--=_d304acc5a098a41f213de9de2c8df770
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Bodyfeelings<br>------------------------------------------------------<br>B=
estellnummer: 265<br>Detailierte Bestellübersicht: http://www.bodyfeel=
ings.de/catalog/account_history_info.php/order_id/265<br>Bestelldatum: Mitt=
woch, 28. April 2004<br><br>Artikel<br>------------------------------------=
------------------<br>6 x Party-Overall (Angebot) (r201650) =3D 120,00EUR<b=
r>	Gr=F6=DFe lt. Gr=F6=DFentabelle M<br>-----------------------------------=
-------------------<br>Zwischensumme: 120,00EUR<br>Versandkosten: 0,00EUR<b=
r>Summe: 120,00EUR<br><br>Lieferanschrift<br>------------------------------=
------------------------<br>Matthias F<br>Meine Strasse. 14<br>88886 City<br>Deutschland<br><br>Rechnungsanschrift<br>----------------------------=
--------------------------<br>Matthias F<br>Mystreet. 14<br>86888 Gr=
nen<br>Deutschland<br><br>Zahlungsweise<br>-------------------------------=
-----------------------<br>PayPal<br><br>
--=_d304acc5a098a41f213de9de2c8df770--

 

And it makes no different sending the with or without html. It looks the same.

Thanks Matthias

Link to comment
Share on other sites

Hi Matthias,

 

MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME

Is a configuration value set by the PayPal Module when it is installed, this value is entered into the db tabel 'configuration'.

 

What I suggest is that you uninstall the PayPal module via the admin. Now using phpMyAdmin look at the 'configuration' table and sort the table by the 'configuration_key' column, look for values starting with 'MODULE_PAYMENT_PAYPAL', delete these values.

Now via the osC admin re-install the PayPal module, you should then check the db table to ensure that 'MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME' now exists, chances are is that it will.

 

The above value is used to specify the logo to be displayed during the checkout process and on the PayPal payment page.

 

Your emails, the bit that might be indentifying the problem is

Content-Type: multipart/alternative;
I'm not very familar with Mime types but a 'google' search suggests that this mime type 'might' be associated to email 'attachments' which is not what I think you're intending.

 

I'm not too sure what to suggest at this stage, you might need someone to have a look at your site. But I would first suggest that you verify that you're running v2.2 of this contrib, look at the first line in catalog/ipn.php to make sure, if so then re-copy/upload the files for the directory catalog/includes/modules/payment/paypal just to be on the safe side.

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

Link to comment
Share on other sites

QUOTE 

MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME

 

 

Is a configuration value set by the PayPal Module when it is installed, this value is entered into the db tabel 'configuration'.

 

What I suggest is that you uninstall the PayPal module via the admin. Now using phpMyAdmin look at the 'configuration' table and sort the table by the 'configuration_key' column, look for values starting with 'MODULE_PAYMENT_PAYPAL', delete these values.

Now via the osC admin re-install the PayPal module, you should then check the db table to ensure that 'MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME' now exists, chances are is that it will.

 

The above value is used to specify the logo to be displayed during the checkout process and on the PayPal payment page.

 

Hmmm,

 

i#ve done everything and the entry was missing before and after reinstallation.

The only thing I have in the configuration is MODULE_PAYMENT_PAYPAL_STORE_LOGO but not MODULE_PAYMENT_PAYPAL_STORE_LOGO_IMAGE_NAME

 

And the value of MODULE_PAYMENT_PAYPAL_STORE_LOGO is oscommerce.gif which is my storelogo.

Thanks Matthias

Link to comment
Share on other sites

I'm not too sure what to suggest at this stage, you might need someone to have a look at your site. But I would first suggest that you verify that you're running v2.2 of this contrib, look at the first line in catalog/ipn.php to make sure, if so then re-copy/upload the files for the directory catalog/includes/modules/payment/paypal just to be on the safe side.

 

I checked the version and everything is ok. It's 2.2 and also the files in catalog/includes/modules/payment/paypal are the right ones. I compared evereything with "Beyond Compare"

 

 

 

Your emails, the bit that might be indentifying the problem is

QUOTE 

Content-Type: multipart/alternative;

 

I'm not very familar with Mime types but a 'google' search suggests that this mime type 'might' be associated to email 'attachments' which is not what I think you're intending.

 

Can I influence the value of that ?

And why dose the Mailproblem only comes up if I have a PayPal payment ?!

If I make an order with an other paymenttype all the mails are correct.

 

The mails were also correct with the version 1.7 (but I think that version have different mailhandling because it is using the osc mailsettings and don't have a own one)

 

:unsure: :(

Thanks Matthias

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...