osCmax v2.5 User Manual
Results 1 to 9 of 9

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

      
  1. #1
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    7


    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.


  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    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 Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    7


    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.

  4. #4
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    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 Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  5. #5
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    7


    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.

  6. #6
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    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 Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  7. #7
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    7


    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.

  8. #8
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    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 Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  9. #9
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    7


    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.

Similar Threads

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •