---
title: "capturePIN(using:cardReaderTransactionID:)"
framework: proximityreader
role: symbol
role_heading: Instance Method
path: "proximityreader/paymentcardreadersession/capturepin(using:cardreadertransactionid:)"
---

# capturePIN(using:cardReaderTransactionID:)

Presents a sheet to capture the PIN when required by the payment card issuer, and returns the previously encrypted card data including newly captured PIN data.

## Declaration

```swift
func capturePIN(using token: PaymentCardReaderSession.PINToken, cardReaderTransactionID: String) async throws -> PaymentCardReadResult
```

## Parameters

- `token`: Valid and signed PIN token from a participating payment service provider.
- `cardReaderTransactionID`: The doc://com.apple.ProximityReader/documentation/ProximityReader/PaymentCardReadResult/id of the previous read.

## Mentioned in

Adding support for Tap to Pay on iPhone to your app

## Return Value

Return Value PaymentCardReadResult if the PIN was successfully captured.

## Discussion

Discussion Call this method when the payment card issuer requests a PIN for the current transaction. When you call this method, the system displays UI with instructions on what the person needs to do. This UI remains onscreen until the system reads the person’s PIN, you cancel the operation, or an error occurs. important: The encrypted payment card data are only kept 55 seconds after previous read if the PIN was not requested by the card. After this delay, this method will return PaymentCardReaderSession.ReadError.pinEntryFailed note: This method throws a PaymentCardReaderSession.ReadError if a person dismisses the sheet or the sheet fails to appear.

## See Also

### Requesting the PIN

- [PaymentCardReaderSession.PINToken](proximityreader/paymentcardreadersession/pintoken.md)
