Forums / PayPal Express Checkout support / "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

"(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Locked

Views: 32,164

Results 41 to 60 of 74
This thread is locked. New replies are disabled.
26 Jan 2008, 12:53 PM
#41
hedgepig avatar

hedgepig

New Zenner

Join Date:
Oct 2006
Posts:
80
Plugin Contributions:
0

"(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Anyone know of anything happening with this yet? I presume every Uk user is going to be having this problem - that has to make it pretty high priority?

26 Jan 2008, 5:47 PM
#42
fuzion avatar

fuzion

New Zenner

Join Date:
Sep 2006
Posts:
75
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

As far as I am aware, this is still being worked on. Maybe DrByte could post an update when he gets a few moments?

Hopefully not long now, having to hold off on a few sites until this bug is fixed.

Jamie @ Fuzion

www.InkFuzion.co.uk
www.FunFuzion.co.uk - now live (with a few bugs, but getting there!)

28 Jan 2008, 6:42 PM
#43
drbyte avatar

drbyte

Sensei

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

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Are these normal products or downloadable products?

http://www.zen-cart.com/forum/showpost.php?p=483782&postcount=4

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

28 Jan 2008, 6:43 PM
#44
fuzion avatar

fuzion

New Zenner

Join Date:
Sep 2006
Posts:
75
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Hi DrByte,

These are all normal products.

J

Jamie @ Fuzion

www.InkFuzion.co.uk
www.FunFuzion.co.uk - now live (with a few bugs, but getting there!)

28 Jan 2008, 6:55 PM
#45
hedgepig avatar

hedgepig

New Zenner

Join Date:
Oct 2006
Posts:
80
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

All normal products here too

28 Jan 2008, 7:56 PM
#46
devices avatar

devices

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Mine are normal products too.

On more testing I found that if i click the pre checkout EC link i can log into PayPal then when it returns me to my site it comes back with the country United States instead of United Kingdom. I checked my papal address and it is UK.

If i use the PayPal option at checkout i simply get the red box with the following

An error occurred when we tried to contact the payment processor. Please try again, select an alternate payment method, or contact the store owner for assistance. (7) 7 - Field format error: 10731-The field Shipping Address Country is required

:shocking:

Regards

Dave.

beauty is in the eye of the beer holder

28 Jan 2008, 9:05 PM
#47
drbyte avatar

drbyte

Sensei

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

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

hedgepig:

All i do to get this problem is this:

I install a fresh version of zen 1.3.8a and a new empty database
i then use the UK zones paypal compatible module from your download section (could this be causing the problem???)
in my store i set as united kingdom and lancashire - in creat account default country id is set to united kingdom.

I set all necessary details in modules/payment - only paypal website payments pro and paypal express checkout (pro 2.0 payflow uk) are green

I then add one fictional item and picture.

i then add this item to my shopping cart

i create an account for myself using addy in this country (uk)

i then select to checkout - i have two radio buttons,: fill in credit card details (which seem to work fine) or paypal - when i select the paypal and confirm order i then get the error The field Shipping Address Country is requiredLyn,
Thank you for the detailed steps for how-to-recreate this problem.

I think I may have found something that may provide some relief.
Will post shortly ...

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

28 Jan 2008, 9:08 PM
#48
drbyte avatar

drbyte

Sensei

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

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

For v1.3.8a:
/includes/modules/payment/paypal/paypal_curl.php
around line 114 you have a section of code that looks like the following.

Add the additional lines, as shown:```
function SetExpressCheckout($amount, $returnUrl, $cancelUrl, $optional = array()) {
$values = array_merge($optional, array('AMT' => $amount,
'RETURNURL' => urlencode($returnUrl),
'CANCELURL' => urlencode($cancelUrl)));
if ($this->_mode == 'payflow') {
$values = array_merge($values, array('ACTION' => 'S', /* ACTION=S denotes SetExpressCheckout */
'TENDER' => 'P',
'TRXTYPE' => $this->_trxtype,
'RETURNURL' => $returnUrl,
'CANCELURL' => $cancelUrl));
} elseif ($this->_mode == 'nvp') {
if (!isset($values['PAYMENTACTION'])) $values['PAYMENTACTION'] = ($this->_trxtype == 'S' ? 'Sale' : 'Authorization');
}

[B] // convert country code key to proper key name for paypal 2.0 (needed when sending express checkout via payflow gateway, due to PayPal field naming inconsistency)
if ($this->_mode == 'payflow') {
if (!isset($values['SHIPTOCOUNTRY']) && isset($values['SHIPTOCOUNTRYCODE'])) {
$values['SHIPTOCOUNTRY'] = $values['SHIPTOCOUNTRYCODE'];
unset($values['SHIPTOCOUNTRYCODE']);
}
}[/B]

// allow page-styling support -- see language file for definitions
if (defined('MODULE_PAYMENT_PAYPALWPP_PAGE_STYLE'))   $values['PAGESTYLE'] = MODULE_PAYMENT_PAYPALWPP_PAGE_STYLE;

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

29 Jan 2008, 9:20 AM
#49
devices avatar

devices

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

DrByte:

For v1.3.8a:
/includes/modules/payment/paypal/paypal_curl.php
around line 114 you have a section of code that looks like the following.

Thank you very much. :clap:

I still have the wrong shipping country though. I can now succesfully complete checkout using both the pre checkout link and the link on the payment page.

However i still get the incorrect country on the shipping address. I have only 1 address book entry allowed in the cart. My address in my cart and on my buyer paypal account are as follows

My Name
Street Address
Area
City
Post Code
United Kingdom

After completing either of the paypal payment links the shipping address in the cart is

My Name
Street Address
Area
City, City Post Code <---------------- City listed twice
United States <---------------- Wrong Country

When the cart takes me to the PayPal page it does show the postal address with the correct country before returning me to the cart.

I am testing this with a Live Buyer and Live Seller account.
I am using 1.3.8a with the code you just posted added into /includes/modules/payment/paypal/paypal_curl.php.
I have tried this while being logged in on our shop and logged out on our shop.

Regards

Dave.

beauty is in the eye of the beer holder

29 Jan 2008, 8:10 PM
#50
barryboy avatar

barryboy

New Zenner

Join Date:
Jan 2008
Posts:
5
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

MANY THANKS!! Works fine now.

Contribution on it's way.

29 Jan 2008, 10:13 PM
#51
hedgepig avatar

hedgepig

New Zenner

Join Date:
Oct 2006
Posts:
80
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Seems to be working here too - thanks!

Regards

Lyn
https://www.hedgepig.co.uk

29 Jan 2008, 10:34 PM
#52
hedgepig avatar

hedgepig

New Zenner

Join Date:
Oct 2006
Posts:
80
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

I have, on testing more, noticed that the paypal link - once it returns to the cart, charges me the postage to the U.S. rather than postage within the UK - its taking the shipping charge from the zones table - obviously it thinks its in the US for some reason once it comes back? Obviously still a little glitch to iron out but pleased things seem to be progressing now!

regards

Lyn

29 Jan 2008, 10:42 PM
#53
hedgepig avatar

hedgepig

New Zenner

Join Date:
Oct 2006
Posts:
80
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Actually that only seemed to happen with items i had in the shopping basket prior to the change - i cleared out the basket and started again with a new false order and everything seems fine fingers crossed - thanks for the help dr byte - much appreciated

regards
Lyn

29 Jan 2008, 10:45 PM
#54
devices avatar

devices

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

hedgepig:

I have, on testing more, noticed that the paypal link - once it returns to the cart, charges me the postage to the U.S. rather than postage within the UK - its taking the shipping charge from the zones table - obviously it thinks its in the US for some reason once it comes back? Obviously still a little glitch to iron out but pleased things seem to be progressing now!

regards

Lyn

Sounds like the same problem i am having as i described a few posts up.

barryboy:

MANY THANKS!! Works fine now.

Contribution on it's way.

Do you get the same error as hedgepig and I ?

Regards

Dave.

beauty is in the eye of the beer holder

29 Jan 2008, 11:35 PM
#55
fuzion avatar

fuzion

New Zenner

Join Date:
Sep 2006
Posts:
75
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Cheers DrByte, appears to be working fine here now.

I will give it a proper test tomorrow. I want to see if this also stops the error when people who create an account through the PayPal process and the 4 missing fields are present. Will update you as soon as I have tested this properly.

Thanks again,

J

Jamie @ Fuzion

www.InkFuzion.co.uk
www.FunFuzion.co.uk - now live (with a few bugs, but getting there!)

31 Jan 2008, 7:13 PM
#56
devices avatar

devices

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Devices:

Thank you very much.

I still have the wrong shipping country though. I can now succesfully complete checkout using both the pre checkout link and the link on the payment page.

However i still get the incorrect country on the shipping address. I have only 1 address book entry allowed in the cart. My address in my cart and on my buyer paypal account are as follows

My Name
Street Address
Area
City
Post Code
United Kingdom

After completing either of the paypal payment links the shipping address in the cart is

My Name
Street Address
Area
City, City Post Code <---------------- City listed twice
United States <---------------- Wrong Country

When the cart takes me to the PayPal page it does show the postal address with the correct country before returning me to the cart.

I am testing this with a Live Buyer and Live Seller account.
I am using 1.3.8a with the code you just posted added into /includes/modules/payment/paypal/paypal_curl.php.
I have tried this while being logged in on our shop and logged out on our shop.

As i was still suffering the wrong shipping country being returned i decided to make a fresh install and test on that. It still gives me the same error. I tested it on a couple of different PCs using both IE and FF. So i asked my friend to make a purchase with his PayPal account and when returned to the cart he too had the United States instead of United Kingdom for the shipping country.

Regards

Dave.

beauty is in the eye of the beer holder

2 Feb 2008, 3:13 PM
#57
devices avatar

devices

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

After searching the debug emails and trying to learn a little about php scripting i noticed that the script is trying to get data from SHIPTOCOUNTRYNAME but paypal was never returning that field the only field to do with country was SHIPTOCOUNTRY which returns the correct 2 letter country code.

So i changed line 1825 in paypalwpp.php from

'ship_country_name'  => urldecode($response['SHIPTOCOUNTRYNAME']));

to

'ship_country_name'  => urldecode($response['SHIPTOCOUNTRY']));

now it appears to work perfectly.

I have tested it in the sandbox with UK, USA and AUS addresses and also tested it live with my UK account and all seem to be working perfectly.

Can you see any problems with this change ? I am no PHP expert, I am more used to ASP and then thats only basic knowledge.

MODERATOR NOTE: See here for a more efficient fix: http://www.zen-cart.com/forum/showpost.php?p=504386&postcount=62

Regards

Dave.

beauty is in the eye of the beer holder

2 Feb 2008, 8:11 PM
#58
hedgepig avatar

hedgepig

New Zenner

Join Date:
Oct 2006
Posts:
80
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Well done devices - you have been busy!

Tried the change here and all seems well so hopefully that is the end of our woes - until another release of zencart :smile:
At least i now feel confident enough to bring the new version out of development and go live shortly thank goodness.

Thanks again for taking the time (and i know all too well how long this kind of thing takes) to find a solution.

Regards

Lyn

2 Feb 2008, 9:56 PM
#59
devices avatar

devices

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

Was you still getting the problem ? Would be nice to know if it was just me or not. Its been driving me mad for the last few days.

Please just be carefull as i do not know if that change will effect anything else. I have been testing it over a lot and have not found any problems yet.

Hopefully DrByte will pop in and let us know if it is ok or not.

Regards

Dave.

beauty is in the eye of the beer holder

2 Feb 2008, 10:20 PM
#60
drbyte avatar

drbyte

Sensei

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

Re: "(7) 7 - Field format error: 10731-The field Shipping Address Country is required

It's probably okay as long as you don't change your PayPal mode away from UK mode.

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