Even if "PayPal login page language" is set to other than "US" it always redirects to https://www.paypal.com/us/.
I tried it with several languages clearing the cookie of browsers.

CommentFileSizeAuthor
#8 1586424-paypal-default-country-all.patch3.45 KBlongwave
PASSED: [[SimpleTest]]: [MySQL] 2,453 pass(es). View
#7 1586424-paypal-default-country.patch574 byteslongwave
PASSED: [[SimpleTest]]: [MySQL] 2,459 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

longwave’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

The URL you quote is not hardcoded anywhere in Ubercart, and the lc parameter is sent correctly. If you are in the US, perhaps PayPal is performing geolocation and redirecting you based on your IP address? You should try accessing your site through a proxy server located in another country to see if you are redirected differently there.

chinita7’s picture

@longwave Thanks for your response. I'm actually using it in Japan. I tried all the languages listed in "PayPal login page language" but always redirected to the US version.
The exact URL looks like
https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=Ut8Z3gAK2-u6F...

By the way, Is it difficult to hard-code it instead ? I would like to see if it's paypal side thing or not if possible. Which part of the code should I modify for example to make it to just "JP" ?

chinita7’s picture

I eventually paid somebody to fix this problem and he found out that paypal was taking the country of "Billing information".
As I had removed "Billing information" from the checkout pane it was always redirected to "US".

TR’s picture

Can you provide a patch?

chinita7’s picture

Sorry actually there is no patch for this. I just enable the "billing information" pane and set the country to "JP" and then unset it on checkout page just to hide it.

"Sent address selection" in "PayPal Website Payments Standard settings" we are forced to choose one of two options "Send billing address to PayPal" or "Send shipping address to PayPal" and I guess this option should be removed or something..

longwave’s picture

Version: 6.x-2.9 » 7.x-3.x-dev
Category: support » bug
Status: Postponed (maintainer needs more info) » Active

According to http://blog.brains4all.com/brainblog/archives/2008/04/paypal_language.html this is a limitation in PayPal, if you send a country code as part of the address then PayPal uses this in preference to the language parameter.

However, uc_paypal currently defaults to 'US' if the country is not available for any reason. It seems to make sense to alter uc_paypal to send the store default country by default, and also drop the 'lc' parameter entirely.

longwave’s picture

Status: Active » Needs review
FileSize
574 bytes
PASSED: [[SimpleTest]]: [MySQL] 2,459 pass(es). View

This one line patch should ensure that the store default country is used when the billing pane is disabled, instead of defaulting to the US.

longwave’s picture

FileSize
3.45 KB
PASSED: [[SimpleTest]]: [MySQL] 2,453 pass(es). View

This patch removes the PayPal language setting entirely, as it doesn't work when we send the country. Instead, it defaults the country to the store country for all PayPal operations.

janton’s picture

but why do we need to send paypal the country? could we not let paypal deside what country to use, because paypal has a well known idee what language to set the checkout page... (as far as i know paypal knows what language to set there checkout)

I now face this problem, because i have a multilanguage website, i get orders from people all around the world but i only have a english and dutch website... but i also have "Billing information" not enabled on checkout page... so i'm looking for a way to break this code out...

For example a French user is now also shown the US page, because my website is only in English and Dutch. But should paypal not be French then?

TR’s picture

Issue summary: View changes

Marked #2310037: Paypal Login Language as a duplicate.

TR’s picture

Version: 7.x-3.x-dev » 8.x-4.x-dev
Jean-Francois’s picture

My observations with localization on Paypal were as follow (with Ubercart 7.x-3.10):

Our place of business is Montreal, where language is French (FR), and country is Canada (CA).

The Ubercart data transmitted to PayPal can be seen in the PayPal pages HTML code (connexion page and payment page):

1) Setting the PayPal Website Payments Standard "Paypal login page language" (admin/store/settings/payment/method/paypal_wps) to FR sends the following code to PayPal: lc=FR

2) And that the address country field, filled by the customer on checkout sends the following code to PayPal: country=CA

This results in the PayPal UI being French as desired, but the customer's address country field on the PayPal payment page is populated with "France"!

PayPal overrides the customer provided country info with the locale code (I suggested to them that this is a problem).

Here is some of the confused code we find further on their pages as a result of this treatment of the cart data:

"geolocation": "CA"…
"ipcountry": "CA"…
"locality": {
___"country": "FR",
___"lang": "fr"…
"merchant_country": "CA"…
"merchant_locale": "FR"…
"currency": "CAD"…
"shipping_address": {
___"country_code": "CA"…
checkoutSessionLocale=FR&checkoutShippingCountry=CA&ipCountry=CA&merchantCountry=CA"…

I've been told by PayPal that in order to have French as language and Canada as country, the cart should send a 4 letters format localization code to distinguish language from country. In our case this would be "fr_CA" for French Canada.

Otherwise, with two letters locale code, my understanding is that the PayPal page defaults to the language support priority 0 of this code. In the case of FR, the 0 priority sets the locale code to "fr_FR", that is French as language, and France as country.

See their table in this PayPal developers info page:
https://developer.paypal.com/docs/classic/api/locale_codes/

Country.....Country Code.....Language Support Priority.....Locale Code
FRANCE.....FR...................0.......................................fr_FR
FRANCE.....FR...................1.......................................en_US
CANADA....CA...................0.......................................en_US
CANADA....CA...................1.......................................fr_CA

Could uc_paypal send an assembled 4 letters locale code, extracting data from the language of the Drupal site UI (set by the customer in his account) and from the address country info provided by the customer on checkout?