Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

I just installed PayPal_Shopping_Cart_IPN and it really works great, however, the customer's shipping information cannot send to Paypal. In my Paypal account, I'm able to create shipping label through Paypal, but all name and address information must input manually. Any one else has the same problem as I got? Any help, please?

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

Hello,

 

I installed the last version of this contribution (v2.8) but I am having trouble with IPN.

I read the previous post and tried everything I can think of, but am still unable to get IPN working.

The IPN test panel just returns a blank page despite I uncommented the error_reporting variable in paypal/application_top.inc.php and the debugWriteFile function in ipn.php. As for the ipn.txt that is supposed to log where the process stopped, there is nothing usefull here. It just display the IPN testing form fields and end with "submit = Test IPN".

 

One thing I noted is that the IPN Test panel page instructs to copy the order Transaction Signature into the Custom field and into the Transaction ID field. However the max size of the Transaction ID filed is shorter than the Transaction Signature length. Can this be the problem ?

 

Any tips are welcome B)

 

Regards,

 

Fabien

Link to comment
Share on other sites

ilia, I haven't had to time go through and look at exactly what needs to be changed. Something like the below might need to be worked in:

 

$totalAmount = !($this->amount($this->currency())) ? '0.10' : $this->amount($this->currency());

 

But there are at least three places for this to be addressed and the one in the sendMoney function needs to be revised completely, you may even beable to get awya with just making the change in the amount function, but as said the sendMoney function needs to be revised, and in paypal/checkout_process you'd need to add the '0.10' to the shipping_cost.

 

Fabien,

yongxin,

// set the level of error reporting
   error_reporting(E_ALL & ~E_NOTICE);
//    error_reporting(0);

 

Fireman, which sql script did you run, if migrating from 2.4 etc, then you should just run paypal.sql.

 

The above will allow you to see any error(s) while using the IPN T.P (the transaction field is correct). However I'm going to take a guess that something similiar to the below needs to be done (click the snapback link to see the couple of other posts that followed this one).

In paypal/application_top.inc.php (at the bottom) change:

 

  if(isset($PayCash_osC_Order->language)) {
   // include the language translations
   include(DIR_WS_LANGUAGES . $PayCash_osC_Order->language . '.php');
 } else {

To:

royalfunk, your first if statement is missing it's closing bracket (unless it wasn't posted here).

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

Link to comment
Share on other sites

Thanks a lot Gregory.

 

I had indeed uncommented error_reporting(E_ALL & ~E_NOTICE)

but forgot to comment error_reporting(0)

 

Once done I have been able to view what was causing the script to stop and to correct the issue I had.

It now works perfectly.

 

May thanks. :thumbsup:

 

Fabien

Link to comment
Share on other sites

OK - I have made some hacks to the payment/paypa.php file and it seems to work for me now with CCGV.

 

(If anyone needs it let me know)

 

I also made some changes to the information passed to paypal so it does not say the Company Name but these are not essential to the fix.

 

But one thing that I still need to figure out is the update to teh GV.  Using PP IPN leave the gift voucher in the persons account.  I have not checked the CC to see if updates the use of it.

 

I am pretty tired so if anyone has the answers to that - great.

 

Chris

 

 

Chris, I could really use the hack info you mentioned. Ive tried everything, including the sort order mentioned and still I cant get the correct amount passed to paypal. If you could please post here or email me I'd really appreciate it!

 

thanks

tammy

Link to comment
Share on other sites

Not sure if this has been covered but is there anyway of putting the total amount of the order automaticly into the paypal side instead of having the user type it in.

 

They could just put in 10p or something and obivoulsy i wont ship with that, but have i missed something which does it for you

 

Many thanks for any help :)

Edited by Jezthomp
Link to comment
Share on other sites

Sorry forgot to mention my IPN link is not working in the admin pamyent module. The

Test Mode

Set test mode [iPN Test Panel]

 

I put the ipn.php into the catalog folder during installation and followed everything so dont know why it is not working.

 

Strange the link at the top

Enable PayPal Module

Do you want to accept PayPal payments? (Help)

doesnt work either?!

 

Any ideas anyone would be very much appriciated.

 

Sorry for the double post as well

 

:)

Link to comment
Share on other sites

I have exactly the same problem. Shipping and address doesn't pass to Paypal.

 

I also have another question. I have to set my shopping cart to 3 decimal points because the unit price of some items is really small. Now when I choose Aggregate mode, there is an error message says incorrect format amount and I'm pretty sure it means the 3rd decimal point. Can someone tell me where to fix this problem? I don't have this problem when in Itemized mode but shipping and address don't pass.

 

Thanks.

 

Wendy

 

I just installed PayPal_Shopping_Cart_IPN and it really works great, however, the customer's shipping information cannot send to Paypal. In my Paypal account, I'm able to create shipping label through Paypal, but all name and address information must input manually. Any one else has the same problem as I got? Any help, please?

Link to comment
Share on other sites

Ok, I fooled the shopping cart by choosing the global decimal place to 2 and tested the Aggregated mode. It works fine in terms of passing the shipping charge and customer's address to Paypal. I do wonder why the Itemized mode doesn't work.

 

Now I do need to find out where to change the decimal place for the order total when it's passed to Paypal. I have to keep the global setting to 3 and only change the total to 2 in order to make it Paypal acceptable format. Anyone know where to change it?

 

A new problem I'm running into is that IPN doesn't work. In live mode, I can make Paypal payment but after I click "continue" at the paypal site, it doesn't go back to the checkout_success page. And the order is still in Pending status. Could someone pls help me on this?

 

Thanks.

 

Wendy

I have exactly the same problem.  Shipping and address doesn't pass to Paypal.

 

I also have another question.  I have to set my shopping cart to 3 decimal points because the unit price of some items is really small.  Now when I choose Aggregate mode, there is an error message says incorrect format amount and I'm pretty sure it means the 3rd decimal point.  Can someone tell me where to fix this problem?  I don't have this problem when in Itemized mode but shipping and address don't pass.

 

Thanks.

 

Wendy

Link to comment
Share on other sites

Thanks for the great contribution!

 

In admin area, after the purchase is complete, in "Paypal Transaction Activity" box within the orders.php (order detail page) contains "No PayPal Transaction Information Available ()".

 

The IPN is being posted and linked to the right order if I click on it. It just not posting info to the order detail page.

 

Do you know how to fix this? >_<

Link to comment
Share on other sites

Hi,

 

I'm still trying to find the cause of no IPN. :(

I can go through paypal process and complete payment. But there is no IPN sent back to my system and the order still showing Pending. On the order details page, there is NO Paypal IPN.

 

I'm trying to do some testing. But seems like my testing is a little weird. I had Paypal IPN v0.981 before so on the Admin left column side, there is a box saying Paypal IPN and that's the v0.981 one. Now with the addition of this mod, the only change I can see is that Paypal IPN is added under the Customer Box, is this correct?

 

The only place I can launch the Test IPN panel is by editing the Paypal settings under the Modules-->Payment section and click the Test Panel pop up. Is this correct?

 

I then followed Greg's instruction posted earlier on how to test:

[1] Checkout via the store and stop when you get to PayPal.

Done

[1a] Look at the db table orders_session_info you will see the transaction details there such as the customers first and last name, the transaction signature, and the payment amounts (bear in mind these amount may of been converted due to PayPal currency settings etc).

Yes, I do see the transaction recorded in the table.

 

[2] Go into osC-Admin and find that order, it will be in a Pending 'Order Status' and will say no transaction history available but will give the digest transaction signature.

Done

This transaction signature should be the same as whats in the orders_session_info table for that txn.

 

[3] Higlight and copy the txn signature

 

[4]Go to the IPN Test Panel (making sure that Test Mode is On).

I can only access the Test panel by editing the parameters of this mod.

 

[5] Select the Transaction type, choose 'cart'

Done

[6] Paste the transaction signature copied in [3] into the Custom field

Done

[7] Paste it again into the Transaction ID field.

done. The transaction ID field holds less digits of number than the Customers ID.

Note that Payment Status is already set to Completed.

No, I don't see the payment status being changed. Here I just copy/pasted some numbers and haven't hit the submit key. How could the order status being changed to complete?

 

[8] Now enter the Gross amount that is to be Paid to PayPal for this you need to look at the orders_session_info table because the amounts may have been converted etc...

Done

[9] Submit the Test IPN.

After click the Test IPN, the page becomes blank and the URL shows:http://www.mysite.com/catalog/ipn.php

 

No changes to the order status and no record under the Paypal IPN.

Please help me on this.

 

Thanks.

 

Wendy

Link to comment
Share on other sites

Greg,

 

Thanks so much for your quick reply.

 

I did uncomment the error reporting code and the error message I got after submit Test IPN becomes:

Warning: main(includes/languages//shoppe_enhancement_controller_languages.php): failed to open stream: No such file or directory in /catalog/includes/languages/shoppe_enhancement_controller.php on line 158

 

Fatal error: main(): Failed opening required 'includes/languages//shoppe_enhancement_controller_languages.php' (include_path='.:/usr/local/lib/php:/usr/lib/php:/home/lavozde/public_html/') in /catalog/includes/languages/shoppe_enhancement_controller.php on line 158

 

It's rather weird since the URL for this page is IPN.php and has nothing to do with the shoppe-enhancement mod.

 

The line 158 is

As I mentioned before that I do have the Paypal IPN v0.981 and it was bundled with the Shoppe Enhancement Mod.  I have uninstalled it already.  

 

This file does exit.

 

I really want your mod to work out and your help is truely appreciated.

 

Thanks.

 

Wendy

 

Hi Wendy,

 

See here for how to enable error reporting when having the blnak white screen reponse for when sending a Test IPN.

 

PayPal's 'Completed' 'Payment Status' is different from osC's 'Order Status' otherwise everything else from above sounds ok.

Link to comment
Share on other sites

Follow the links from this post.

 

Basically $language = $PayPal_osC_Order-> language; needs to be placed just above

 

include(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '.php');

 

in paypal/application_top.inc.php

 

eg should now be

 

  if(isset($PayPal_osC_Order->language)) {
   // include the language translations
   $language = $PayPal_osC_Order->language;
   include(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '.php');
 } else {
   //later on change to Store Default
   include(DIR_WS_INCLUDES . 'modules/payment/paypal/languages/english.php');
 }

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

Link to comment
Share on other sites

Greg,

 

Yeah, it worked. I got all the infomation rather than a blank page and the order status is changed to complete.

 

Then I switched my cart to Live mod and completely the transaction. However, after click the continue at the end of Paypal session, I got this message:

1146 - Table 'paypalipn_txn' doesn't exist

 

select o.orders_status,p.* from orders o LEFT JOIN paypalipn_txn p on p.item_number = o.orders_id AND o.customers_id = '2' order by o.date_purchased desc limit 1

 

This table is the v0.981 table and it seems like Paypal is trying to send the IPN to this table rather than the Paypal table. Will should I fix this?

 

One more question regarding the decimal place. My live shop needs 3 decimal places and now I only set it to 2 for easy testing. The trick I used in the v0.981 Paypal IPN was to change the hard code to 2 in the Paypal file rather than getting the global setting. It worked fine. When I tried it on this mod in the Paypal.php file (for both the order total and the shipping), the shipping charge doesn't pass to Paypal. So only the total is passed. Is there anyway to solve this problem?

 

Thanks so much.

 

 

Wendy

 

Follow the links from this post.

 

Basically $language = $PayPal_osC_Order-> language; needs to be placed just above

 

include(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '.php');

 

in paypal/application_top.inc.php

 

eg should now be

 

 ?if(isset($PayPal_osC_Order->language)) {
? ?// include the language translations
? ?$language = $PayPal_osC_Order->language;
? ?include(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '.php');
?} else {
? ?//later on change to Store Default
? ?include(DIR_WS_INCLUDES . 'modules/payment/paypal/languages/english.php');
?}

Link to comment
Share on other sites

anyone know how i would go about changing the background and font colours which are passed to paypal. where is it in the contribution??? i've been searching around looking for a quick hack to no avail.

 

still searching...

 

dag

Link to comment
Share on other sites

Thanks for you help Greg, i uploaded the v2.7 sql in phpmyadmin and that worked fine.

 

However, i need to update that with the new sql from v2.9 like u suggested but i get the following error.

Error

SQL-query:

 

# osCommerce, Open Source E-Commerce Solutions

# http://www.oscommerce.com

#

# DevosC, Developing open source Code

# http://www.devosc.com

#

# Copyright © 2003 osCommerce

# Copyright © 2004 DevosC.com

#

# Released under the GNU General Public License

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

MySQL said: 

 

#1060 - Duplicate column name 'payment_id'

 

I assume i have to delete the other sql how do i go about doing that or getting it to work.

 

Also i only have to change the includes\modules\payment paypal folder with the new one is that correct?

 

Thanks for any help :)

Link to comment
Share on other sites

dag, you can explicitly set the bg color to black or white in the osc admin paypal config, or there you can specify the style name you've configured via your paypal profile account.

 

Jez, comment out the alter line you showed with a #

 

Wendy, Sounds like you still have the old v0.981 contrib installed, in particular the paypal_ipn file in modules/paypal, and so during checkout you probably clicked on PayPal IPN rather than PayPal for the payment option. In regard to the 2 d.p. issue if done correctly shouldn't really have a problem, but you may also have to make this numercial formatting change in paypal/catalog/checkout_process.inc.php

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

Link to comment
Share on other sites

Thanks greg changed that:

ALTER TABLE orders ADD payment_id

to

ALTER TABLE orders ADD #payment_id

 

and got this in the sql phpmyadmin error

 

# osCommerce, Open Source E-Commerce Solutions

# http://www.oscommerce.com

#

# DevosC, Developing open source Code

# http://www.devosc.com

#

# Copyright © 2003 osCommerce

# Copyright © 2004 DevosC.com

#

# Released under the GNU General Public License

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

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

 

Did i do something wrong?

 

Many thanks :)

Link to comment
Share on other sites

dag, you can explicitly set the bg color to black or white in the osc admin paypal config, or there you can specify the style name you've configured via your paypal profile account.

 

hi, thanks for responding,

 

I have set a profile in paypal in a nice brown shade matching my website in which the default black font colour looks dreadfull.

 

upon playing with your settings in the admin panel I notised that you are passing a white font colour when switchd to the black background colour. The white font colour looks much better with my site.

 

What im trying to do, is source how you are passing the font colour and background colour to paypal and make a hack for my needs. Its quite a contribution you have made, (as im still digging through the code) I thought i would get it from the horses mouth! as they say.

 

one thing i did notice though was upon changing the background colour to black, the setting has overwritten my custom paypal background colour which could prove a problem.

 

thanking you.

 

dag

Link to comment
Share on other sites

I've been using the 0.98 module for a little while now and I'd like to "upgrade" to the V2.8 Paypal_Shopping_Cart_IPN. I'm quite worried about screwing everything up!

 

Can someone help me out with UNINSTALLING the old version of the Paypal IPN (.98)? I don't mind losing the records of the orders in the IPN list because I have all the emails and the PayPal history, but if there is some way to keep it, that would be great.

 

I'm really just not sure how to "undo" the installation in a safe manner... I want someone to hold my hand :)

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