<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "ApplePayontheWeb",
  "identifier" : "/documentation/ApplePayontheWeb/ApplePaySession/onpaymentauthorized",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Apple Pay on the Web"
    ],
    "preciseIdentifier" : "instp/ApplePaySession/onpaymentauthorized"
  },
  "title" : "onpaymentauthorized"
}
-->

# onpaymentauthorized

An event handler the system calls when the user has authorized the Apple Pay payment with Touch ID, Face ID, or a passcode.

```
attribute EventHandler onpaymentauthorized;
```

## Discussion

This attribute must be set to a function that accepts an `events` argument; for example, `session.onpaymentauthorized = function(event) {}`.

The event parameter contains the [`payment`](/documentation/ApplePayontheWeb/ApplePayPaymentAuthorizedEvent/payment) ([`ApplePayPayment`](/documentation/ApplePayontheWeb/ApplePayPayment)) attribute.

The [`onpaymentauthorized`](/documentation/ApplePayontheWeb/ApplePaySession/onpaymentauthorized) function must complete the payment and respond by calling [`completePayment`](/documentation/ApplePayontheWeb/ApplePaySession/completePayment) before the 30 second timeout, after which a message appears stating that the payment couldn’t be completed.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)