osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Non critical bug somewhere along the Paypal way...?

This is a discussion on Non critical bug somewhere along the Paypal way...? within the Paypal forums, part of the Payment Modules category; Here is a strange one in case someone wants to give it a try and check it out on a ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Features Discussion > Payment Modules > Paypal

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 10-09-2007, 05:37 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 255
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Non critical bug somewhere along the Paypal way...?

Here is a strange one in case someone wants to give it a try and check it out on a plain OSCMAX installation.

When I am looking at an order (edit) from the admin section, and the field "payment_method" for that order on the DB is set exactly to "Paypal" (not case sensitive), I get an error ... ?¿?

I hadn't found out before because until now I the info that was being stored there was "PayPal (Recargo de 0.35E + 4%)" , which is the full name of the payment method customers are seeing. But I changed it to just Paypal (so it would look nicer on invoices), and this is the error I get:





So, the first one has payment method "PayPal (Recargo de 0.35E + 4%)" and can be seen ok, the second one has payment method "Paypal" and breaks.

There is a table "paypal_ipn" on my database, but it is empty. Also, I checked my /admin/includes/database.php , and there was no reference there to TABLE_PAYPAL_IPN , so I added the following line:

define('TABLE_PAYPAL_IPN', 'paypal_ipn');

Reload, and now the error is:



So what is
TABLE_PAYPAL_IPN_TXN_TYPE ...???
I am quite lost here. I am not sure I have paypal_ipn working right now, since my table paypal_ipn contains no information about payments received. But, orders done with paypal_ipn are stored ok, I get the payments done, and they do seem to be working ok. So I might be missing some of the features on this module maybe...?

Since my problem was just a cosmetic one, now the Paypal payments are stored with the "payment_method" PaypaI (yeah, that is a capital i) so this problem is gone for me.

__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 10-09-2007, 06:40 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,170
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Non critical bug somewhere along the Paypal way...?

I think this one is easy... Probably missing the spanish language file for paypal ipn.

Just copy it from the admin panel's english directory to the spanish directory and then translate the text to spanish.
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-10-2007, 12:28 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 255
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Non critical bug somewhere along the Paypal way...?

Hi michael,

You are kinda right and I failed mentioning that part when I did the post, the first time I did the change "PayPal (Recargo de 0.35E + 4%)" to "Paypal", the error it gave me was about a missing language file.

I copied the language file from /english to /spanish , and it changed to the one you can see on the screenshot here.

I searched checked order.php to see where the error might be coming from, and I see there 3 appearences of something like

strtolower($order->info['payment_method']) == 'paypal'

which I changed to

strtolower($order->info['payment_method']) == 'poypal'

to see if it would stop failing, but it didn't. It was kinda late and I really didn't feel like checking any more...

What I do not quite understand either is why the payment method is being checked like that to see if it is paypal, since it is quite possible that people will change the text to someone else.

In fact, the default name for the OSCMAX paypal_ipn module after install was "PayPal (Credit Card / Debit)" , so whatever code is supposed to be running there that is failing me wouldn't work with the default name, and it would work with the normal paypal.php module.
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 10-10-2007, 07:02 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,170
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Non critical bug somewhere along the Paypal way...?

You shouldn't be changing the database. I think just changing the language define in the language file will do the trick.

I think I am not fully understanding what you are doing. What code in what file have you changed to cause this in the first place?
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 10-10-2007, 07:26 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 255
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Non critical bug somewhere along the Paypal way...?

I will try to do better this time

-----
From what I can tell, I have changed no code.

What I did change was the Paypal_ipn name, so instead of being the default text "PayPal (Credit Card / Debit)" it is just "Paypal".

On /includes/languages/whatever/modules/payment/paypal_ipn.php replace:

Code:
  define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_TITLE', 'PayPal (Credit Card / Debit)');
  define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_DESCRIPTION', 'PayPal IPN');
With:

Code:
  define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_TITLE', 'Paypal');
  define('MODULE_PAYMENT_PAYPAL_IPN_TEXT_DESCRIPTION', 'PayPal');
Now when you make an order and pay with this payment module, the field "payment_method" on the order (stored on the table "orders" on the database) will contain just that text, "Paypal".

(NOTE: I also have a field "paypal_ipn_id" on every order, I have no clue what this fields are for. I also have an empty table on my database "paypal_ipn", I have no clue what this table is for)

The fact that the field "payment_method" is exactly "Paypal" (not case sensitive, "PaYpAl" would be the same) triggers something on /admin/orders.php that is giving me the error messages I was showing. You can do a text search for:

Code:
== 'paypal'
on orders.php and will see 3 ocurrences. One of them is:

Code:
  if (strtolower($order->info['payment_method']) == 'paypal') {
    include 'paypal_ipn_order.php';
  } else {
which loads paypal_ipn_order.php , and I really didn't follow any more where the error might be coming from.

So, I guess I do have a few questions:

- /admin/orders.php is using a text comparison on the field "payment_method" to know if an order has been paid with Paypal. I doubt that is a good idea, since many people will change that text to something else, and in fact, by default it already comes as something else.

- I have no clue if my paypal_ipn payment module should be doing "more". I have no information on my "paypal_ipn" database table. I have no "paypal_ipn_id" on my orders, no matter how they are paid for.

- I am using paypal.com, but in spanish. I have no clue if the APIs or whatever they iffer are different. For one, we do not even have verified addresses outside the US.


I have the idea that maybe paypal_ipn is not fully working for me. That maybe when it is used as a payment method, I should be seeing more info on my DB, I should be seeing stored the information passed by Paypal, or whatever. Which in turn might make the orders.php fail, because there's no data in there.

But anyway, the fact of doing a text comparison on orders.php against "paypal" for knowing the payment method, does seem to be a bad approach to me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 10-10-2007, 01:39 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,170
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Non critical bug somewhere along the Paypal way...?

I just tested this on my dev shop, and I was able to reproduce it. Seems to be an issue with the classes/paypal_ipn.php file not getting the paypal constants.
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 10-11-2007, 02:31 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 255
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Non critical bug somewhere along the Paypal way...?

Great, I'm glad my hint wasn't a time waster and there is something to be checked out...

What I found strange was that the method used on /admin/orders.php for knowing if a purchase has been paid with paypal_ipn was to compare the 'payment_method' against the text 'paypal', since by default the name has already been changed to something else.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 10-11-2007, 11:10 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,170
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Non critical bug somewhere along the Paypal way...?

No, I had never seen it before, so definitely worth the effort to report. It is one of those oddities that would never come up in normal usage, since most users leave the text as default for all the payment modules.
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 10-11-2007, 11:22 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 255
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Non critical bug somewhere along the Paypal way...?

I'm glad to help

Feel free to add it yourself on the bugtracker, I wouldn't even be able to know what summary to put on the issue.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to MindTwist For This Useful Post:
BobH (04-04-2008)
Reply



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
paypal ipn or regular paypal mod Deal-Shop Paypal 2 07-31-2007 05:03 AM
PayPal IPN in RC3 - values not being passed to PayPal? SavageSinister osCMax v2 Installation issues 3 02-12-2007 03:57 PM
trying to get pwa working on 1.5 - its critical jloyzaga osCMax v1.7 Discussion 6 09-30-2003 06:23 PM
paypal and paypal IPN, whats the diff? lhotch osCommerce 2.2 Installation Help 1 09-06-2003 06:34 PM


All times are GMT -8. The time now is 12:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax