Currently the 'lc' property value is provided by the payment method configuration and is limited to a small number of hardcoded countries. The list of PayPal supported countries is big:

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=develo...

However, I wonder if we shouldn't get this from user's billing information if any and have the setting as a fallback.

What do others think?

Comments

recidive’s picture

Just to clarify, on the WPS documentation, there are 2 places where lc parameter is explained. The first on the "Table 7" section it says:

The language of the login or sign-up page that subscribers see when they click the Subscribe button. If unspecified, the language is determined by a PayPal cookie in the subscriber’s browser. If there is no PayPal cookie, the default language is U.S. English.
For allowable values, see .

The "see" was missing a link.

And the other is in the "Table 8" section:

Sets the payer’s language for the billing information/log-in page only. The default is US.
For allowable values, see Countries and Regions Supported by PayPal.

The latter is where it's linked to the list of countries I've post on the issue description.

recidive’s picture

I did some tests, changing country to Belgium and Brazil. See screenshots attached.

Attached is also a patch that adds the missing countries to the list and also make it display actual country names rather than codes on the payment method settings form.

recidive’s picture

Status: Active » Needs review

Hmm...

summit’s picture

Hi,
Patch works fine, can it be committed please? Should I set it to reviewed and tested?
Can may be otherwise anybody else test it?

Greetings, Martijn

recidive’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Bumping.

andyg5000’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.28 KB

I received a call to undefined function country_get_list() without including the DRUPAL_ROOT . '/includes/locale.inc' file. Patch attached.

rszrama’s picture

Title: Language Code » Update WPS language codes to the full currently supported list
Priority: Major » Normal
Status: Needs review » Fixed

I did some digging on this while I was updating the modules to use the proper currency codes, and I noticed that we were missing some countries. However, the page linked to does not correspond to the allowed values listed in the PayPal Payments Standard API guide. You can see the HTML list here:

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=develo...

I've made a commit that updated the languages function to return the proper available languages grouped by locale or specific language. Honestly, it's a bit odd, and PayPal is anything but consistent in its documentation, but I think our best bet is to just go with this list. I hardcoded the whole thing into the module so I could use the precise labels from PayPal. They may support payments from other countries, but that doesn't mean they have specific login pages for them, which the lc parameter dictates.

Commit: http://drupalcode.org/project/commerce_paypal.git/commitdiff/74e2fda

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.