I noticed that when the user goes through Paypal EC, and I have the setting:
Update billing customer profiles with address information the customer enters at PayPal.
Paypal EC doesn't update the country of the billing information.
So if my addressfield has a default country, it will always save the billing address with the default country even if the Paypal User perhaps was from another country.
Patch is attached. I'm not sure though if my assumption was correct. If it's not, we can just make the country an empty string to make sure no default value is saved.
Actually, now that I think about it... I'm not even sure why we are assuming the default values are safe to load. I use my default values because I assume that most orders in the store would be in a certain country. That way it's easier/faster for most of my users to fill up the form. But it's not an assumption that all of my orders are in that certain country.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2365797-7.patch | 965 bytes | mglaman |
#6 | commerce_paypal-overwrite_billing_country-2365797-6.patch | 1.04 KB | akosipax |
patch-overwrite-billing-country.diff | 1.21 KB | akosipax | |
Comments
Comment #1
dxx CreditAttribution: dxx commentedIt's related to: https://www.drupal.org/node/2036929 ?
Comment #2
dxx CreditAttribution: dxx commentedSorry it's another issue!
Comment #3
dxx CreditAttribution: dxx commentedComment #4
akosipax CreditAttribution: akosipax commentedThis is a different issue. It is official that Paypal does not pass on the billing information as mentioned in https://www.drupal.org/node/2036929#comment-7755279
This is simply talking about default values being saved to the billing information (in this case, my site has a default value for 'Country')
Comment #5
dxx CreditAttribution: dxx commentedYes I confirm that the patch fixes this bug. I was wrong issue sorry, I edited my answer ;)
Comment #6
akosipax CreditAttribution: akosipax commentedMade paths of the patch relative and also used a more proper naming convention for patches.
Comment #7
mglamanCOUNTRYCODE is the payment information's country code, via https://developer.paypal.com/docs/classic/api/merchant/DoExpressCheckout...
Comment #9
mglamanThanks! Committed.