Apple Pay passes a partial postal code for Canada & UK addresses

Originator:fred
Number:rdar://30757800 Date Originated:2/28/2016
Status:Open Resolved:
Product:Safari/PassKit on macOS Sierra Product Version:Safari 10.0.1 on macOS Sierra, Safari Technical Preview
Classification: Reproducible:Always
 
Summary:
When entering a non-US address on macOS Sierra, the postal code is truncated to the first 4 characters when sent to the onShippingContactSelected callback. This makes it impossible to use this address to, for example, dynamically determine a shipping cost.

Steps to Reproduce:
Create a page that integrates Apple Pay. On the ApplePaySession, set this event handler:

applePaySession.onshippingcontactselected = function( shipping )
{ console.log( shipping.shippingContact ); }


Open this page in Safari on Sierra, open the web inspector (console view), then trigger the Apple Pay payment sheet. Enter a Canadian or UK address for the shipping contact per the example in my screenshot:

Test Testerson
123 Some Street
3G


Expected Results:
I expected the full postal code to be passed back to the page.

Actual Results:
Watch what gets logged in the console—you'll see the truncated address. I believe this also affects the address passed to the ApplePaySession's onPaymentAuthorized event.

Version:
Tested in Safari Technology Preview Release 24, as well as Safari 10.0.1.


Notes:
No current workaround, and as a result collecting shipping information Apple Pay does not work for international customers. This affects GB / UK addresses, Nederland addresses, etc—any country that uses a combination of numbers and letters and has a space in the postal code.

I'm unsure whether this is a bug in Safari or PassKit.

Configuration:
This always occurs. I'm unaware of any ApplePay settings that would affect this.

https://cl.ly/0s0g103g2L08/Screen%20Shot%202017-02-27%20at%209.33.59%20AM.png
https://cl.ly/091g2d2z1T2F/Screen%20Shot%202017-02-27%20at%209.33.48%20AM.png

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!