---
title: onpaymentauthorized
framework: applepayontheweb
role: symbol
role_heading: Instance Property
path: applepayontheweb/applepaysession/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.

## Declaration

```data
attribute EventHandler onpaymentauthorized;
```

## Discussion

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 (ApplePayPayment) attribute. The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout, after which a message appears stating that the payment couldn’t be completed.

## See Also

### Handling payment authorization

- [completePayment](applepayontheweb/applepaysession/completepayment.md)
- [ApplePayPaymentAuthorizedEvent](applepayontheweb/applepaypaymentauthorizedevent.md)
- [ApplePayPayment](applepayontheweb/applepaypayment.md)
- [ApplePayPaymentAuthorizationResult](applepayontheweb/applepaypaymentauthorizationresult.md)
