Price Garrett Price Garrett - 1 year ago 78
Swift Question

Xcode Apple Pay - PKPaymentAuthorizationViewControllerDelegate issues

I am trying to implement Apple Pay into my application. I am having an issue even establishing the

into my

Most code samples have shown it as:
class ViewController: UITableViewController, PKPaymentAuthorizationViewControllerDelegate

Here is my code:

class ApplePayVC: UIViewController, PKPaymentAuthorizationViewControllerDelegate {


Answer Source

That because you must implement some of the functions of the delegate.

See in the Apple Documentation :

Two functions are required :

  • paymentAuthorizationViewController(_:didAuthorizePayment:completion:)
  • paymentAuthorizationViewControllerDidFinish(_:)

You must override them, and then, the error will disappear from Xcode

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download