PayPal Direct/Express Error - Invalid State field (for non-US customers?)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
We are currently unable to complete transactions for non-US (that is, all of our) customers through PayPal - at the penultimate step of the checkout process there is an error message to the effect that the State field is invalid.

This error message appears to originate from the PayPal API (it is one of the messages listed on their website) and it prevents transactions going to completion.

However, the customers address is correct, so we suspect that there is a problem with nopCommerce transmitting a suitable value for State for non-US addresses (which do not have a State in that sense, but instead has the user select "Other (non-US)" for that field).

We presume a lot of people must have encountered this problem and solved it already - so anyone have a solution for this?

We do have limited access to a programmer/database expert, so technical descriptions of code/data that must be altered are welcome (we hope to save him some time in tracking it down, especially if the problem is already known and solved).

Thanks.
14 years ago
OK, so our programmer friend has had a quick look and it appears to be a bug in nopCommerce.

The PayPal Direct handler is explicitly coded to throw an exception when a State is not selected for billing address, so it cannot work for non-US customers at all.  As it is not clear from the PayPal documentation what State code should be used for non-US states, and it will not accept a Null (or a dummy US-state value to be hopefully overridden by the country code), this is not a trivial problem.

Hopefully someone will address it in the near future?

We can manage with PayPal Standard for now (as we have just upgraded nopCommerce to fix this) and we will look into eWay, but PayPal Standard is incredibly fragile (the user can really muck it up if they press the browser back button or cancel/close at the wrong time).  We were a little stunned to discover that both PayPal methods for Credit Card payments were broken in the version of nopCommerce we initially installed (it took a lot of work to set up the product catalog - I guess we should have thought to test PayPal first, but we assumed it would be working).

Is there a better way to file this bug than simply posting to this forum, or is this the recommended action?

Other than this, we are very pleased with nopCommerce and grateful to those who have provided it - we are just having a bit of teething trouble getting the site to accept Credit Card payments.
9 years ago
Hi, just in case there is somebody else having this issue...

PayPal will check for the correctness of the province for some countries, but, by default nopCommerce only includes state names for US, so you will need to populate the list yourself.

There is some on-going effort to include these lists in nopCommerce by default as it can be read here... but provinces have to match those from pay pal.

You can find a list of the official paypal names and matches https://go.developer.ebay.com/developers/paypal/forums/paypal-sample-code/province-drop-down here. AFAIK is correct.
9 years ago
Can anybody update me on the latest state of play with this? I am getting ready to go live with my site, on nopCommerce 3.20, and need to use PayPal Direct and expect/hope for non-US customers. The reason I have stayed with 3.20 is because 3.30 will not allow embedding of href="javascript:javascript:history.go(-1)" to go back to previous page, which I need. Is the "go back to previous page" fixed at 3.40 if I need to upgrade for the PayPal Direct Invalid State field problem?
9 years ago
nopCommerce 3.40 doesn't solve the invalid state field for non-us customers using paypal direct plugin. The only solution AFAIK is to add the proper values to the stateprovince table. You can find a link to this list in my previous post.
9 years ago
Thanks for that. Seems I have some work to do before I can go live. I like nopCommerce but my it is pain to get up and running.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.