Loading Apple Pay Shipping Address No Street

后端 未结 1 1387
夕颜
夕颜 2021-01-01 06:18

I\'m trying to get a shipping address extracted from the ABRecordRef provided by Apple. I have the following but my street is always returning as nil

相关标签:
1条回答
  • 2021-01-01 07:07

    Turns out Apple's docs on this weren't that great but the issue is that in the delegate callback for paymentAuthorizationViewController:didSelectShippingAddress:completion: a partial address is always returned. The fix is to also set it in the callback from:

    - (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
                           didAuthorizePayment:(PKPayment *)payment
                                    completion:(void (^)(PKPaymentAuthorizationStatus))completion
    {
        // Use this instead.
        [payment shippingAddress];
    }
    

    I also removed a call to setting the required billing addresses (maybe a separate bug).

    0 讨论(0)
提交回复
热议问题