Zen Cart Logo
Forums / PayPal Express Checkout support / What happens if country doesn't match?

What happens if country doesn't match?

Views: 1,014

Results 1 to 7 of 7
28 Oct 2015, 2:05 AM
#1
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

What happens if country doesn't match?

How does ZC consolidate country info with PPE? Let's say a customer enters their address as "Kampuchea" at PayPal while ZC recognizes it as "Cambodia"... what happens? Is there a rejection or does ZC not care and just record it however it is entered? Same question about a non-existant country (as far as ZC is concerned). Take Kosovo, as an example... it doesn't exist from ZC's point of view. But it does exist.

I'm going to presume the answer is that it gets stored as text and it really doesn't matter... but then how's that work for a) interaction with shipping modules and b) if they click "edit address" and their stored country is not in the drop-down.

I might be able to test and find out using SandBox and forcing, say, Canada to be "Kanada" and see what happens. But I figured I'd ask.

28 Oct 2015, 2:08 AM
#2
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: What happens if country doesn't match?

OK, well a couple of my scenarios go out the window since PPE uses drop-downs too... so as long as ZC stays consistent with PP it should be a non issue.

Nevermind :) (actually I'm going to check now if PPE is consistent with ZC on the list)

28 Oct 2015, 2:12 AM
#3
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: What happens if country doesn't match?

OK I can see immediately it has nothing to do with the name, but rather the code I guess. I changed "Canada" to "Mars" in ZC and then checked out using PPE and a Canadian address... it worked fine and then records the order with a country of "Mars".

Now, what if a new country is added or the code changes? My experimentation continues...

28 Oct 2015, 2:17 AM
#4
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: What happens if country doesn't match?

OK, not elegant but effective (though confusing). I deactivated "Mars" and did the checkout again. Coming back from PPE, the customer is presented BRIEFLY with a warning about the country not being supported (or something, I don't have time to read it) before it is redirected to a blank page. Probably a server error. I'll go check the logs. (edit: nothing in logs)

28 Oct 2015, 5:18 AM
#5
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: What happens if country doesn't match?

That was an annoying wild goose chase.

The redirect to a blank page was an issue with my template and has been resolved.

Now back to tracking down how countries work :)

My goal is to reconcile the country list that PayPal/Zen uses with the one my shipping service uses... they are not at all the same. That led me to wondering how we keep up with geopolitical changes in the world at the EXACT same rate that PayPal does? I mean, when/if PayPal decides to recognize Fakeplaceekstan as a country, what happens when a Fakeplacekstanian tries to order from us? The country data in the 1.5.4 set is woefully out of date. Sure, I can keep it up to date manually... but is PayPal up to date?

I'm talking to myself, aren't I?

28 Oct 2015, 6:15 AM
#6
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Re: What happens if country doesn't match?

Not exactly :). I'm listening but don't know the answer so we will both wait for an answer.

28 Oct 2015, 7:14 AM
#7
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: What happens if country doesn't match?

OK, well here's what I figured out tonight.

a) There's nothing in place to keep us up to date
b) The world is a changing place
c) PayPal isn't right up to date either, contains a subset of what ZC does, but is more up to date than ZC is

The good news is that it doesn't change very fast, at least as it relates to PayPal (which is my concern because I only deal with PayPal). There are 129 differences between a clean ZC install and proper ISO data (whether it be names, or codes) but if we don't care so much about names and focus just on the codes, and just on PayPal used ones... it boils down to exactly 1 change and 1 addition. They are:

  • China needs to have its 2-letter code changed from CN to C2 UNLESS the store is also in China, then it stays as CN
  • Add the country "DEMOCRATIC REPUBLIC OF CONGO" with the code CD. Not to be confused with "CONGO" with code of CG, which remains as-is

I imagine this is because PayPal is doing business in the less politically / financially volatile countries and the changes have mostly been in those that aren't stable. In my case, I really doubt I'm losing many customers by avoiding those nations, so I want to disable all countries with which I'm unable to do business due to PayPal's limitations. I did that manually, one by one and man that was a headache, so if anyone else is looking to do the same, here's some SQL for you (note: assumes above 2 changes are also made first):

UPDATE countries SET status=0;
UPDATE countries SET status=1 WHERE countries_iso_code_2 IN ("AD","AE","AG","AL","AM","AN","AO","AR","AT","AU","AW","AZ","BA","BB","BE","BF","BG","BH","BI","BJ","BM","BN","BO","BR","BS","BT","BW","BY","BZ","C2","CA","CD","CG","CH","CK","CL","CM","CO","CR","CV","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GI","GL","GM","GN","GP","GR","GT","GU","GW","GY","HK","HN","HR","HU","ID","IE","IL","IN","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KR","KW","KY","KZ","LA","LC","LI","LK","LS","LT","LU","LV","MA","MC","MD","ME","MG","MH","MK","ML","MM","MN","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PL","PM","PN","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SE","SG","SH","SI","SK","SL","SM","SN","SO","SR","ST","SV","SZ","TC","TD","TG","TH","TJ","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","VA","VC","VE","VG","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW");

Of course, that's only accurate up until right now :)