[FIX] payment_paypal: country and state code required for paypal

As explained in:

-https://developer.paypal.com/docs/classic/api/country_codes/
-https://developer.paypal.com/docs/classic/api/state_codes/

The country and state code is required to create a paypal transaction.

But in some cases, the complete name of the state/province is required.
For example, for India, sometimes the complete name of the state is required.
Check the list of those state/province in the documentation.

Hint: form_preprocess_values

opw:682872
This commit is contained in:
Goffin Simon 2016-07-12 15:47:45 +02:00
parent 245e38d242
commit dbf44a9680
1 changed files with 2 additions and 2 deletions

View File

@ -119,8 +119,8 @@ class AcquirerPaypal(osv.Model):
'currency_code': tx_values['currency'] and tx_values['currency'].name or '',
'address1': partner_values['address'],
'city': partner_values['city'],
'country': partner_values['country'] and partner_values['country'].name or '',
'state': partner_values['state'] and partner_values['state'].name or '',
'country': partner_values['country'] and partner_values['country'].code or '',
'state': partner_values['state'] and (partner_values['state'].code or partner_values['state'].name) or '',
'email': partner_values['email'],
'zip': partner_values['zip'],
'first_name': partner_values['first_name'],