---
title: SKTestTransaction
framework: storekittest
role: symbol
role_heading: Class
path: storekittest/sktesttransaction
---

# SKTestTransaction

A transaction that occurs in the testing environment.

## Declaration

```swift
class SKTestTransaction
```

## Overview

Overview The test transaction represents the test environment’s knowledge of the transaction, including its identifier and the transaction’s state. It represents all the transaction-related configurations you control manually in Xcode for interrupted purchases, Ask to Buy scenarios, and changes to a subscription’s auto-renew state. The test environment creates an SKTestTransaction instance each time your test code calls any method of SKTestSession that affects in-app purchases.

## Topics

### Identifying Transactions and Products

- [identifier](storekittest/sktesttransaction/identifier.md)
- [originalTransactionIdentifier](storekittest/sktesttransaction/originaltransactionidentifier.md)
- [productIdentifier](storekittest/sktesttransaction/productidentifier.md)

### Getting Payment Transaction States

- [state](storekittest/sktesttransaction/state.md)

### Getting Dates

- [purchaseDate](storekittest/sktesttransaction/purchasedate.md)
- [cancelDate](storekittest/sktesttransaction/canceldate.md)
- [expirationDate](storekittest/sktesttransaction/expirationdate.md)

### Getting Test Environment States

- [autoRenewingEnabled](storekittest/sktesttransaction/autorenewingenabled.md)
- [hasPurchaseIssue](storekittest/sktesttransaction/haspurchaseissue.md)
- [isPendingPriceIncreaseConsent](storekittest/sktesttransaction/ispendingpriceincreaseconsent.md)
- [pendingAskToBuyConfirmation](storekittest/sktesttransaction/pendingasktobuyconfirmation.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### StoreKit transaction testing

- [Setting up StoreKit Testing in Xcode](xcode/setting-up-storekit-testing-in-xcode.md)
- [SKTestSession](storekittest/sktestsession.md)
