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

    Default PayPal module sends wrong state

    Similar to my post about paypal.php sending wrong phone number - it also seems to be sending wrong "state" info.

    The formula used in paypal.php is:

    Code:
    zen_draw_hidden_field('state',zen_get_zone_code($order->customer['country']['id'], $order->customer['zone_id'],$order->customer['zone_id'])) .
    which i think likely figures out a state/prvince code??? I amnot sure but i know for Canada at least - this doesnt work - can someone verify if maybe this is right for US

    for Canada paypal actually wants the name of the province passed

    so, when i changed code to this:

    Code:
    zen_draw_hidden_field('state',$order->customer['state']) .
    it actually sends (in my test case) "Ontario" which passes correctly to the credit card info page in PayPal.

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

    Default Re: PayPal module sends wrong state

    ok, so i tried this with a US shipping address and i suspect the code that i replaced would do the right thing now - that is it likely sends the state code rather than the full province name.

    so basically, the problem is with PayPal consistency - for US they expect state codes and for Canada they expect provionce full names.

    well unlikely that PayPal will fix anything.. EVER!!! so i likely need to modify paypal.php to be cuontry smart when it calculates state/prov info to pass to paypal.

    peter...

  3. #3
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: PayPal module sends wrong state

    Peter, Others are using paypal without issue,
    Zen cart PCI compliant Hosting

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

    Default Re: PayPal module sends wrong state

    hmmm.. well i guess they all have either all US customers or are ok letting the customer just "re-enter" their province info in the paypal form.

    It likely isnt seen as that big a deal to just let customers enter their province - they are likely happy that they dont need to re-enter all their info.

    but.. all that being said.. pretty sure i am right.. it really doesnt work correctly.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PayPal module sends wrong state

    Haven't had a problem myself.

    PayPal's documentation says:

    Variable: state
    Description: State
    Requirements: Must be two-character official U.S. or Canadian abbreviation.
    Character Limit: 2

    Zen Cart currently sends the 2-letter code for the state/province as defined in Admin->Localization/Taxes->Zones for the zone associated with the customer's address ... which by default, matches ISO standards, which, fortunately, PayPal uses.
    .

    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.

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

    Default Re: PayPal module sends wrong state

    Once again, I am having the same problem. Let us know if you find a solution.

    Peter

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

    Default Re: PayPal module sends wrong state

    Which paypal account and service are you using?
    .

    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.

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

    Default Re: PayPal module sends wrong state

    All right, here's my solution:

    In paypal.php

    1 After the following line

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

    $customerstate=zen_get_zone_code($order->customer['country']['id'], $order->customer['zone_id'],$order->customer['zone_id']);
    $customercountry=($order->customer['country']['iso_code_2']);
    if ($customercountry=="CA")
    $customerstate=$order->customer['state'];
    2. Replace the following line:

    zen_draw_hidden_field('state',zen_get_zone_code($order->customer['country']['id'], $order->customer['zone_id'],$order->customer['zone_id'])) .
    with

    zen_draw_hidden_field('state', $customerstate) .
    Let me know if this works for you. After solving the phone number, address line 2 and province bugs when transferring to paypal, I now get all my fields transferring correctly.

    Take care,
    Peter
    Last edited by peliopoulos; 29 Sep 2006 at 06:26 AM.

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

    Default Re: PayPal module sends wrong state

    I still don't understand why you say you're needing to do this.

    Which paypal account and service are you using?
    Which country is your paypal account domiciled in ?
    .

    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
    Sep 2006
    Posts
    11
    Plugin Contributions
    0

    Default Re: PayPal module sends wrong state

    Hi DrByte,

    The paypal account is a Premier Account domiciled in Canada. I don't know if that's different from yours DrByte but I wonder if that's why few people seem to have these problems.

    Peter

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. State dropdown not showing when entered state wrong
    By xavierpages in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 May 2011, 11:17 AM
  2. credit card module always sends middle digits.
    By tehcronage in forum Built-in Shipping and Payment Modules
    Replies: 13
    Last Post: 25 Jun 2008, 08:47 PM
  3. Paypal sends me to checkout payment not confirmation
    By voltage in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 24 Jun 2008, 09:18 AM
  4. PayPal module send wrong phone number
    By ptalindstrom in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 27 Dec 2006, 02:07 AM

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