I am implementing the new Contacts-backed API for Apple Pay with the following delegate method:
-(void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingContact:(PKContact *)contact completion:(void (^)(PKPaymentAuthorizationStatus, NSArray<PKShippingMethod *> * _Nonnull, NSArray<PKPaymentSummaryItem *> * _Nonnull))completion;
The postal code I obtain via `contact.postalAddress.postalCode` is missing characters. I have tried with addresses containing the following postal codes `M5V 2J4` and `M5V2J4`, but in both cases I am left with only the first three characters (the former adds a space after `M5V`).
In order to calculate shipping rates we required the entire postal code to be present. I am wondering whether this is new and expected behaviour or whether this might be a bug that I should report?
The deprecated delegate method pre-iOS 9.0:
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingAddress:(ABRecordRef)address completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray *shippingMethods, NSArray *summaryItems))completion
returns the correct, complete postal code, which allows us to calculate shipping costs.
The whole postal code is most likely required for rural areas, because the first three characters may cover a huge area of a province, for exmaple: https://www.google.ca/maps/place/Qu%C3%A9bec+J0M/@56.6593609,-71.5404229,5z/data=!3m1!4b1!4m2!3m1!1s0x4c5215bdb7c7ac5b:0xab4d091e3aa479f3
Thanks
UPDATE: Just to be clear, on iOS 9, both the old and new delegate methods return an incomplete postal code.