Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2006
    Posts
    13
    Plugin Contributions
    0

    Default PayPal module send wrong phone number

    Not sure why i can't find a post about this - but i seem to have fixed my own problem so i figured i would document it.

    - e.g. phone number entered for my Zencart user: 123-456-7890

    - zencart'; paypal.php seems to split this into:
    day_phone_a, b, c as 123, 456, and 7890 respectively

    - when info gets passed over to paypal it seems to only pick up day_phone_b or 456 in my example.

    - i think that PayPal API is expecting a variable named H_PhoneNumber - which if i add to paypal.php as the concatenation (and adding "-") of the 3 partial bits - it seems to work correctly

    so in other words:

    - in paypal.php i set H_PhoneNumber = day_phone_a + "-" + day_phone_b + "-" + day_phone_c

    OR

    123-456-7890 in my example

    and this seems to pass correctly.

    Again not sure why i couldnt find post about this????

    cheers,

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PayPal module send wrong phone number

    I'm not sure where you're getting your information from.

    I see no reference to "H_PhoneNumber" in any of PayPal's documentation.

    Again not sure why i couldnt find post about this????
    Nobody's reported a problem ... probably because they haven't encountered one (or maybe just haven't noticed).


    Maybe PayPal has recently changed something without regard for backwards compatibility or consistency with their own documentation. Wouldn't be the first time.

    Last time I tested a PayPal transaction (couple days ago), I had no problem with the code as it is written.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    yea.. i didnt see it either... but i did a view source of the paypal page with the form on it and the field is named that... on a hunch i figured i would try passing it a variable with the same name...

    seems to work fine.

    go figure.

  4. #4
    Join Date
    Sep 2006
    Posts
    11
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    ptalindstrom

    I'm having the same problem with my phone numbers and Paypal. Can you post the exact lines of code that you inserted into paypal.php? I tried to do it myself, but I don't really know what I'm doing and it still doesn't work.

    Thanks
    Peter

  5. #5
    Join Date
    Sep 2006
    Posts
    11
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    Please ignore the previous post. Here is my solution:

    1. In paypal.php after the following line

    $telephone = preg_replace('/\D/', '', $order->customer['telephone']);
    insert the following code:

    $phonenumber = substr($telephone,0,3)."-".substr($telephone,3,3)."-".substr($telephone,6,4);
    2. In paypal.php after the following line

    zen_draw_hidden_field('day_phone_c',substr($telephone,6,4)) .
    insert the following code:

    zen_draw_hidden_field('H_PhoneNumber', $phonenumber) .
    Many thanks to ptalindstrom for pointing me in the right direction.

    Peter

  6. #6
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    Yep, this seems to be happening with paypal.co.uk too.

    For UK phone numbers, comment out the existing 'substr( ...' lines and just add below:

    PHP Code:
     zen_draw_hidden_field('H_PhoneNumber'$phonenumber) . 
    and that will send Paypal the phone number the customer has entered when they created an account.

    Although this seems to be a change on Paypal's part rather than a bug in zen, perhaps this thread should be moved to the Bug Forum?

  7. #7
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    Ooops - I wasn't paying attention there ...

    That line should be:

    Code:
    zen_draw_hidden_field('H_PhoneNumber', $telephone) . 

  8. #8
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    Hmmm ... Paypal seems to have changed it again - 'H_PhoneNumber' doesn't seem to be working anymore if you pass it as a variable, although it still shows if you do a 'view source' of the payment page.

    Looking at this info here:

    https://www.paypal.com/uk/cgi-bin/we...signup-outside

    For the UK, it seems you now have to pass the phone number as:

    PHP Code:
    zen_draw_hidden_field('night_phone_b',$telephone) . 
    to get it to work (confirmed).


    Info from the link above:

    night_phone_a:

    The area code for US phone numbers, or the country code for non-US phone numbers. This will prepopulate the buyer's home phone number. (Numeric characters only. Max. length = 3)

    night_phone_b:

    The three-digit prefix for US phone numbers, or the entire phone number for non-US phone numbers, excluding country code. This will prepopulate the buyer's home phone number. (Numeric characters only. Max. length = 16)

    (Which would also seem a bit confusing for US numbers, since it now doesn't list 'night_phone_c' for the last 4 digits, suggesting that the last 7 digits might need to be passed as 'night_phone_b')

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PayPal module send wrong phone number

    Is any of this preventing orders from being processed by PayPal, or is this simply an issue where PayPal doesn't store the phone number properly because it's not recognizing all of the phone-number content?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: PayPal module send wrong phone number

    Using the standard zen paypal module, the last 4 digits of the phone number (night_phone_c) apparently isn't now being received/processed by Paypal, so the phone number display is truncated on the payment page.

    IIRC, the order will still go through - ie. I don't think Paypal checks the number of digits (but I may be wrong).

    It just looks to the customer that something isn't quite right when only part of the phone number appears - ie. not exactly inspiring confidence in the website's handling of the customer's data, maybe ...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Paypal Express Checkout requires phone number?
    By bft76 in forum PayPal Express Checkout support
    Replies: 4
    Last Post: 16 Oct 2017, 04:29 PM
  2. v150 Add Phone Number to Contact Us - phone number is not on the emails?
    By ljdream00 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 18 Apr 2012, 10:37 PM
  3. Wrong phone number format = issues when sent to Paypal
    By stride-r in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 1 Oct 2008, 09:23 PM
  4. Wrong phone number appearing in Paypal Credit Card Payment
    By mike1969 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 5 May 2008, 11:57 PM
  5. office use only doesnt send "phone number"
    By censon in forum General Questions
    Replies: 3
    Last Post: 10 Sep 2007, 08:18 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR