3

We've encountered a strange crash in our apps logs : PKPaymentAuthorizationControllerExportedObject authorizationDidFinishWithError Has anyone encountered this problem, or has any helpful tip? Seems that this crash comes a while after payment

It might be noteworthy that we don't integrate Apple Pay directly, we use Braintree framework that does this work for us..

janh
  • 232
  • 2
  • 9
  • I had something similar to this (getting an EXC_BAD_ACCESS) -- you should double check that whoever is acting as your PKPaymentAuthorizationViewControllerDelegate isn't getting released too soon, or at least that you're nil'ing out the PKPaymentAuthorizationViewController's delegate when appropriate. – Sean Danzeiser Apr 15 '15 at 17:09
  • Thanks for your comment, unfortunately I haven't found anything suspicious. Started Braintree issue on github [here](https://github.com/braintree/braintree_ios/issues/117), if anyone should have the same problem. – janh Apr 19 '15 at 19:28
  • FYI I opened a radar for this here: http://www.openradar.appspot.com/19767271 – Glen T Jul 09 '15 at 00:08

1 Answers1

0

I've also had to diagnose this error when working with Braintree and Apple Pay. Keep in mind telling me you use the Braintree framework doesn't quite tell the whole story as Braintree has two methods with which you can integrate Apple Pay, BTPaymentProvider and PKPaymentRequest. In my case, I encountered the error PKPaymentAuthorizationControllerExportedObject authorizationDidFinishWithError while using PKPaymentRequest. Specifically, it would crash on the second purchase, when everything worked fine with Apple Pay the first time it was used. Eventually, I traced it to the completion block:

completion(PKPaymentAuthorizationStatusSuccess);

In my case, removing the completion block call by commenting out the above code prevented this crash and restored the expected behavior, allowing Apple Pay to be successfully used without crashes.

It works better than blaming Eve, Adam or the snake for the Apple Pay, Braintree error. ;)

Ryan Davis
  • 194
  • 1
  • 5
  • Well, we use the other way, _BTPaymentProvider_, meaning that this completion callback is inaccessible as it is in the Braintree implementation (pod). But I'll look into it, thanks for your response. – janh Mar 25 '15 at 07:39