The paypal country code for the United Kingdon is not 'GB', it is 'UK'.

Project:Ubercart Contributions
Component:Code
Category:
Priority:critical
Assigned:Ryan
Status:fixed
Description
Project: 
Ubercart

The paypal country code for the United Kingdon is not 'GB', it is 'UK'.

With 'GB' I get this error:

Unable to process payment. Please contact the merchant as the postal address provided by the merchant is invalid, and the merchant has requested that your order must be delivered to that address.

Changing line 1138 of uc_paypal.module to

'country' => ($country[0]['country_iso_code_2'] == 'GB') ? 'UK' : $country[0]['country_iso_code_2'],

fixes it for me

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: The paypal country code for the United Kingdon is not 'GB',

Very interesting. That kind of stinks. Sticking out tongue (I think they specify using GB for the language code for the login page. Does that mess up with GB also?)

I'll go ahead and add your line into the submit function, though. Thanks!

catorghans@drupal.org's picture
Offline
Joined: 08/16/2007
Juice: 72
Re: The paypal country code for the United Kingdon is not 'GB',
Assigned to:Ryan» catorghans@drupal.org

I did have the same error message.
But this solution did not solve it for me.

I found the next thread:
http://www.paypaldeveloper.com/pdn/board/message?board.id=ipn&message.id...

2 things worked:
changing
'address_override' => 1,
to
'address_override' => 0,

Or not giving a "zone" in the address.

But the UK does have "zones", so I think the "address_override" should be depending on US/non-US shops.

Hans

snelson@drupal.org's picture
Offline
Bug Finder
Joined: 10/04/2007
Juice: 46
Re: Re: The paypal country code for the United Kingdon is not 'G
Assigned to:catorghans@drupal.org» snelson@drupal.org

Please double check this with Paypal. My UK orders were not going through until I reverted the changed line to use GB instead. This is, hower, in sandbox mode. Will report back how it works in live mode. I found this link, though couldn't find any official info on the subject from Paypal.

http://www.paypaldeveloper.com/pdn/board/message?board.id=prouk&message....

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: The paypal country code for the United Kingdon is no
Assigned to:snelson@drupal.org» Ryan

Bummer... this is why PayPal is so hard to develop for. Sticking out tongue I haven't tested this for anything outside the US, so I'll have to rely on input from others. Does anyone else have any experience with this going either way?

snelson@drupal.org's picture
Offline
Bug Finder
Joined: 10/04/2007
Juice: 46
Re: Re: Re: Re: The paypal country code for the United Kingdon i
Assigned to:Ryan» snelson@drupal.org

Well, in live mode with many successful GB and *NOT* UK orders processed everything seems to be working correctly. We should probably patch the module.

Scott

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Re: The paypal country code for the United Kingd
Assigned to:snelson@drupal.org» Ryan

I changed it back to GB pre-Alpha 7e I believe... if not, I'll make sure that it's back now. Smiling