eternalone Posted September 14, 2017 Share Posted September 14, 2017 Within the last week I started getting an error on paypal checkout the error is as follows from paypal. I am using PayPalUSA plugin, but my shop is in Canada, is this a problem with prestashop? With the plugin? or with PayPal itself? Here is the error: ------------------------------------------------------------------------------------------------------- There’s a problem with your shipping address. Please return to the merchant and update your information, including your city, state, and ZIP code. First LastName 1031 StreetName Rd undefined Haliburton ON L0ML20 -------------------------------------------------------------------------------------------------------- Note : I changed the names and address for discretion. Notice the "undefined" parameter above, maybe that's the cause of the problem but that seems to be generated by prestashop. Is it doing it wrong? Things I also tried, i tried to use another address for which I used address line number 2 but i put a space there only, no content, that way there is no "undefined" in the address, but still the problem happens. Link to comment Share on other sites More sharing options...
bellini13 Posted September 14, 2017 Share Posted September 14, 2017 Maybe you should contact Paypal support first, so they can explain what exactly is wrong with the address. Link to comment Share on other sites More sharing options...
eternalone Posted September 14, 2017 Author Share Posted September 14, 2017 I've resolved the issue, here is how, it seems PayPal became more strict about addresses, and what happens in Prestashop is this, it does not send the country code, hence people from Canada, Australia, etc having issues, to fix that if you are using PayPalUSA plugin, it does 2 wrong things sends "address2" variable as "undefined" and does NOT send the country code. So here is the fix: Go to /modules/paypalusa/views/templates/hooks/standard.tpl (if you are using standard paypal gateway, if you are using different one you have to edit payment-advanced.tpl or express-checkout.tpl) and edit these lines: line 28-29: {if ($paypal_usa_billing_address->address2 != '')}<input type="hidden" name="address2" value="{$paypal_usa_billing_address->address2|escape:'htmlall':'UTF-8'}" />{/if} to this: {if ($paypal_usa_billing_address->address2 != '')}{/if}<input type="hidden" name="address2" value="{$paypal_usa_billing_address->address2|escape:'htmlall':'UTF-8'}" /> this way the address2 will be in the paypal inputs even if it's empty, so you won't get "undefined" then also add this line for country iso_code to send to paypal, right after address2 line or after state, as you wish: <input type="hidden" name="country" value="{$paypal_usa_billing_address->country->iso_code|escape:'htmlall':'UTF-8'}" /> This will add the country parameters that will be sent to paypal, this way paypal will recognize the address and issue will be resolved. This has fixed the issue for me, hope it fixes it for you! Link to comment Share on other sites More sharing options...
_theLion Posted November 3, 2017 Share Posted November 3, 2017 eternalone You are a life saver, Link to comment Share on other sites More sharing options...
araza Posted November 9, 2017 Share Posted November 9, 2017 (edited) Hi I am using prestashop 1.6.1.17 version I don't see the pathway you mentioned in your answer. I am getting the same error and have attached the screen shot for reference. Here it has only 1 tab that is Configure. Can you please help me with this. Edited November 9, 2017 by araza included personnel info in the file (see edit history) Link to comment Share on other sites More sharing options...
eternalone Posted November 9, 2017 Author Share Posted November 9, 2017 you have to use FTP to access that file, it's not accessible via prestashop admin Link to comment Share on other sites More sharing options...
lanimarie Posted November 22, 2017 Share Posted November 22, 2017 eternalone, Thank you for the PayPal Standard module coding solution, above! I have version 1.6.1.9 and was getting the exact error message. Your solution fixed it for me, too. Awesome Link to comment Share on other sites More sharing options...
oshoot Posted December 21, 2017 Share Posted December 21, 2017 On 9/14/2017 at 11:50 AM, eternalone said: <input type="hidden" name="country" value="{$paypal_usa_billing_address->country->iso_code|escape:'htmlall':'UTF-8'}" /> This will add the country parameters that will be sent to paypal, this way paypal will recognize the address and issue will be resolved. This has fixed the issue for me, hope it fixes it for you! Where does this go? <input type="hidden" name="country" value="{$paypal_usa_billing_address->country->iso_code|escape:'htmlall':'UTF-8'}" /> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now