Forums / Bug Reports / [Done v1.3.9b] PayPal Direct Payment State Field Missing

[Done v1.3.9b] PayPal Direct Payment State Field Missing

Locked

Views: 6,285

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
16 Jun 2008, 9:37 AM
#1
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

[Done v1.3.9b] PayPal Direct Payment State Field Missing

On every PayPal direct payment transaction, our state field is missing from the shipping address and billing address. It appears on the customers address. It would seem that it is not being passed to PayPal properly during the checkout process.

We are a UK store running 1.3.8a, with WPP and PEC set to PayFlow UK.

We had a problem regarding country fields not being passed properly and both fixes outlined here: http://www.zen-cart.com/forum/showpost.php?p=526356&postcount=9 have been applied, although these problems don't address the county/state field problem.

We have also applied this probably unrelated bugfix: http://www.zen-cart.com/forum/showthread.php?p=557419

Other info:
This was a 1.3.8a clean install.

We have installed: European Shipping (table), United Kingdom Zone Rates for Couriers, two other UK based zone rate shipping options, and International Shipping (zones).

Add-ons installed: Super Orders 2.0, Admin Notes file, Capitalize Signup Fields 1.0b, Categories Menu Yahoo Tree Menu with Ajax, Google Sitemap Admin, Orders Exporter, Sales report, About Us Page.

VAT of 17.5% is applied to all products and shipping

Any help would be much appreciated.

16 Jun 2008, 9:42 AM
#2
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

PS, it shows as a blank line as follows:

Customer:
Name,
Address,
Address,
County/State,
Postcode
Country

Shipping Address:
Name,
Address,
Address,

Postcode
Country

Billing Address:
Name,
Address,
Address,

Postcode
Country

20 Apr 2010, 10:29 AM
#3
toyseller avatar

toyseller

Zen Follower

Join Date:
Jun 2008
Location:
UK
Posts:
209
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

I too am having the same problem with a blank line for county/state in the shipping and billing address on the invoice, although county/state is filled correctly for the customer address.

Ive applied the 2 fixes for the country code, but as Ive only had native UK buyers in the short time Ive had website payment pro active so I dont know if there is an issue with the country, but I do know that after these 2 fixes I still have a blank county/state, although the county/state is filled for the customer details.

Please can I have some pointers as to what to change to correct this problem.

26 Apr 2010, 11:10 AM
#4
toyseller avatar

toyseller

Zen Follower

Join Date:
Jun 2008
Location:
UK
Posts:
209
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

paypaldp
optionsAll: Array
(
[ITEMAMT] => 25.98
[SHIPPINGAMT] => 3.75
[AMT] => 29.73
[STREET] => 16 Lane Road
[ZIP] => HX3 7XX
[CITY] => Hereford
[STATE] => "blank" .... should be Herefordshire
[COUNTRYCODE] => GB
[EXPDATE] => 022011
[EMAIL] => address##################
[PHONENUM] => 09244087671
[BUTTONSOURCE] => ZenCart-DP_us
[CURRENCY] => GBP
[IPADDRESS] => 99.99.99.99
[CARDISSUE] =>
)

optionsNVP: Array
(
[PAYMENTACTION] => Sale
)

optionsShipArray
(
[SHIPTONAME] => Ricky Smith
[SHIPTOSTREET] => 16 Lane Road
[SHIPTOCITY] => Hereford
[SHIPTOZIP] => HX3 7XX
[SHIPTOSTATE] => Hereford ..... Should be Herefordshire
[SHIPTOCOUNTRYCODE] => GB
)

Rest of data:
99.99 99 99 Ricky Smith MasterCard


The details that are emailed to the customer to confirm their purchase contain the correct shipping and billing address with the county being correct.

The Paypal notification emai is incorrect as the address is as follows ...

Postage Information

Address Ricky Smith
16 Lane Road
Hereford, Hereford ... the 2nd Hereford should be Herefordshire
HX3 7XX
United Kingdom

I am using Zencart 1.3.8 and the version of code in

incl / mod / payment / paypalwpp.php is

  • @version $Id: paypalwpp.php 7620 2007-12-11 19:12:46Z drbyte $

    /****************************************
    * Do EC checkout
    ****************************************/
    // do not allow blank address to be sent to PayPal
    if ($_SESSION['paypal_ec_payer_info']['ship_street_1'] != '' && $_SESSION['paypal_ec_payer_info']['ship_address_status'] != 'None') {
    $options = array_merge($options,
    array('SHIPTONAME' => $_SESSION['paypal_ec_payer_info']['ship_name'],
    'SHIPTOSTREET' => $_SESSION['paypal_ec_payer_info']['ship_street_1'],
    'SHIPTOSTREET2'=> $_SESSION['paypal_ec_payer_info']['ship_street_2'],
    'SHIPTOCITY' => $_SESSION['paypal_ec_payer_info']['ship_city'],
    'SHIPTOSTATE' => $_SESSION['paypal_ec_payer_info']['ship_state'],
    'SHIPTOZIP' => $_SESSION['paypal_ec_payer_info']['ship_postal_code'],
    'SHIPTOCOUNTRYCODE'=> $_SESSION['paypal_ec_payer_info']['ship_country_code'],
    ));
    $this->zcLog('before_process - EC-2', 'address overrides added:' . "\n" . print_r($options, true));
    }

    $this->zcLog('before_process - EC-3', 'address info added:' . "\n" . print_r($options, true));
    
    // If the customer has changed their shipping address, 
    // override the shipping address in PayPal with the shipping
    // address that is selected in Zen Cart.
    if ($order->delivery['street_address'] != $_SESSION['paypal_ec_payer_info']['ship_street_1'] && $_SESSION['paypal_ec_payer_info']['ship_street_1'] != '') {
      $_GET['markflow'] = 2;
      if (($address_arr = $this->getOverrideAddress()) !== false) {
        // set the override var
        $options['ADDROVERRIDE'] = 1;
        // set the address info
        $options['SHIPTONAME']    = $address_arr['entry_firstname'] . ' ' . $address_arr['entry_lastname'];
        $options['SHIPTOSTREET']  = $address_arr['entry_street_address'];
        if ($address_arr['entry_suburb'] != '') $options['SHIPTOSTREET2'] = $address_arr['entry_suburb'];
        $options['SHIPTOCITY']    = $address_arr['entry_city'];
        $options['SHIPTOZIP']     = $address_arr['entry_postcode'];
        $options['SHIPTOSTATE']   = $address_arr['zone_code'];
        $options['SHIPTOCOUNTRYCODE'] = $address_arr['countries_iso_code_2'];
      }
    }
    // if these optional parameters are blank, remove them from transaction
    if (isset($options['SHIPTOSTREET2']) && trim($options['SHIPTOSTREET2']) == '') unset($options['SHIPTOSTREET2']);
    if (isset($options['SHIPTOPHONE']) && trim($options['SHIPTOPHONE']) == '') unset($options['SHIPTOPHONE']);
    
    // if State is not supplied, repeat the city so that it's not blank, otherwise PayPal croaks
    if ((!isset($options['SHIPTOSTATE']) || trim($options['SHIPTOSTATE']) == '') && $options['SHIPTOCITY'] != '') $options['SHIPTOSTATE'] = $options['SHIPTOCITY'];
    

26 Apr 2010, 4:46 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

You're posting in a thread that's talking about Website Payments Pro (Direct Payment), but you've posted code from Express Checkout.
Is this happening when customers do checkout by entering CC details on your site? Or when they pay after first being redirected to PayPal's site?

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

26 Apr 2010, 5:07 PM
#6
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

I'm definitely experiencing this problem with WPP.

To add to my previous post, it's not on all of the transactions, but seems to only affect UK addresses.*

*This statement is based on trawling through our 50 most recent transactions, not from checking them all.

26 Apr 2010, 5:24 PM
#7
toyseller avatar

toyseller

Zen Follower

Join Date:
Jun 2008
Location:
UK
Posts:
209
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

Hi Dr. Byte

I can see now that I have posted the wrong programming code.

The problem of the missing state is happening with paypaldp and the log was taken from a buyer whos state/county was blank and had paid by paypaldp.

Ive just signed up to Paypal to pay the monthly fee for the direct payments.

Every paypaldp transaction has so far had its state/county blank on the shipping and billing information on the
admin / customers / orders.

So far I have only had uk buyers pay by the direct payment option although I do sell to non-uk buyers.

fergusmacdonald has shown the addresses being displayed exactly as they are appearing for me.

26 Apr 2010, 5:30 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

How exactly have you configured things for customers to enter their county? ie: Herefordshire

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

26 Apr 2010, 6:03 PM
#9
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

Unfortunately, It's now been so long that I can't remember exactly.

I have 2 folders in my list of installed add-ons which are:

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=369

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=299

I'm not sure which (or both if possible) have been installed. Since then, we have added a couple of zones as we've seen fit.

We let customers choose the zone via the dropdown.

26 Apr 2010, 6:19 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

Okay, so they're choosing the country from a pulldown, and not keying it free-hand into a text field?

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

26 Apr 2010, 6:21 PM
#11
toyseller avatar

toyseller

Zen Follower

Join Date:
Jun 2008
Location:
UK
Posts:
209
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

When a customer enters their county on the login screen there is a pull-down menu to select Herefordshire and other counties from.

There is no problem with the customers county being set up in customers address.

I have one page checkout by Nunimix and the first time the
shipping and billing address is encountered is on this screen where it is pre-filled, presumably using the county from the customer address.

The county is appearing on the screen correctly for both billing and shipping addresses.

On this same screen the credit card details are entered for the direct payment.

The customers shipping and billing addresses can be edited on this same screen. Most customers have shipped and billed to their own address and I have had a customer mail to a different shipping address. In all cases the shipping and billing address were blank in admin / customers / orders

26 Apr 2010, 10:31 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

Edit /includes/modules/payment/paypaldp.php
around approx line 1383 (in v1.3.9a), you'll see this section. Add the highlighted code as shown:```
case 'CH':
$info['state'] = '';
break;
[B] case 'GB':
break;
[/B] default:
$info['state'] = '';

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

26 Apr 2010, 11:22 PM
#13
toyseller avatar

toyseller

Zen Follower

Join Date:
Jun 2008
Location:
UK
Posts:
209
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

Bingo !!!

Thank you Dr. Byte Ive just put my own credit card transaction through to test the change and the county/state field is now filled correctly in the shipping and billing address and also is filled in the Paypal notification email.

Also, Ive by chance just had a sale go through on a different 1.3.8 zencart website (its this websites first paypaldp transaction ever).
And that website is showing the same missing state problem, so now that can be corrected too.

Thank you so much.

27 Apr 2010, 9:17 AM
#14
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9b] PayPal Direct Payment State Field Missing

Made the change and first order through looks good!

Thanks for your help Dr Byte...I'm glad this has been picked up and resolved.