Jump to content

PayPal PayPalUSA problem with shipping address


eternalone

Recommended Posts

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

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

  • 1 month later...

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. image.png.e2bf071a9de5d11fddcc9d387c994217.png

Here it has only 1 tab that is Configure. Can you please help me with this.

 

Edited by araza
included personnel info in the file (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 5 weeks later...
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...