<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ProximityReader",
  "identifier" : "/documentation/ProximityReader/PaymentCardReader/prepare(using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ProximityReader"
    ],
    "preciseIdentifier" : "s:15ProximityReader011PaymentCardB0C7prepare5usingAA0cdB7SessionCAC5TokenV_tYaKF"
  },
  "title" : "prepare(using:)"
}
-->

# prepare(using:)

Configures the pipeline for reading payment or loyalty cards.

```
func prepare(using token: PaymentCardReader.Token) async throws -> PaymentCardReaderSession
```

## Parameters

`token`

Valid and signed token from a participating payment service provider.

## Return Value

[`PaymentCardReaderSession`](/documentation/ProximityReader/PaymentCardReaderSession) when successful.

## Discussion

Call this function to configure Tap to Pay on iPhone on someone’s device.
This method verifies that the device is able to read contactless cards and is
properly configured to process transactions.

Upon successful configuration of the device, this method returns a
[`PaymentCardReaderSession`](/documentation/ProximityReader/PaymentCardReaderSession) object, which you use to read card information.
The session remains active while your app is in the foreground. If you
release the returned session, call this method again before you start
any new read operations.

After calling this method, there are four possible scenarios:

- The method returns an existing [`PaymentCardReaderSession`](/documentation/ProximityReader/PaymentCardReaderSession) immediately
  if that session is still valid.
- The method retrieves and returns a new [`PaymentCardReaderSession`](/documentation/ProximityReader/PaymentCardReaderSession) from
  the server if the device is fully configured.
- The method updates the device’s configuration and delivers progress
  updates to the [`events`](/documentation/ProximityReader/PaymentCardReader/events) attribute. Upon completion, the method returns a new
  [`PaymentCardReaderSession`](/documentation/ProximityReader/PaymentCardReaderSession) for the updated configuration. This process
  can take anywhere from a few seconds to several minutes.
- This method throws a [`PaymentCardReaderError`](/documentation/ProximityReader/PaymentCardReaderError) if a problem occurs.

> throws: ``doc://com.apple.ProximityReader/documentation/ProximityReader/PaymentCardReaderError`` if the method fails to configure the device.

---

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)