SKPaymentTransaction Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/StoreKit.framework |
| Availability | Available in OS X v10.7 and later. |
| Companion guide | |
| Declared in | SKPaymentTransaction.h |
Overview
The SKPaymentTransaction class defines objects residing in the payment queue. A payment transaction is created whenever a payment is added to the payment queue. Transactions are delivered to your application when the App Store has finished processing the payment. Completed transactions provide a receipt and transaction identifier that your application can use to save a permanent record of the processed payment.
Tasks
Getting Information About the Transaction
-
errorproperty -
paymentproperty -
transactionStateproperty -
transactionIdentifierproperty -
transactionDateproperty
Getting Information About the Transaction’s Downloadable Content
-
downloadsproperty
Restored Transactions
-
originalTransactionproperty
Properties
downloads
An array of download objects representing the downloadable content associated with the transaction. (read-only)
Discussion
The contents of this property are undefined except when transactionState is set to SKPaymentTransactionStatePurchased. The SKDownload objects stored in this property must be used to download the transaction’s content before the transaction is finished. After the transaction is finished, the download objects are no longer queueable.
Availability
- Available in OS X v10.8 and later.
Declared In
SKPaymentTransaction.herror
An object describing the error that occurred while processing the transaction. (read-only)
Discussion
The error property is undefined except when transactionState is set to SKPaymentTransactionStateFailed. Your application can read the error property to determine why the transaction failed.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPaymentTransaction.horiginalTransaction
The transaction that was restored by the App Store. (read-only)
Discussion
The contents of this property are undefined except when transactionState is set to SKPaymentTransactionStateRestored. When a transaction is restored, the current transaction holds a new transaction identifier, receipt, and so on. Your application will read this property to retrieve the restored transaction.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPaymentTransaction.hpayment
The payment for the transaction. (read-only)
Discussion
Each payment transaction is created in response to a payment that your application added to the payment queue.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPaymentTransaction.htransactionDate
The date the transaction was added to the App Store’s payment queue. (read-only)
Discussion
The contents of this property are undefined except when transactionState is set to SKPaymentTransactionStatePurchased or SKPaymentTransactionStateRestored.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPaymentTransaction.htransactionIdentifier
A string that uniquely identifies a successful payment transaction. (read-only)
Discussion
The contents of this property are undefined except when transactionState is set to SKPaymentTransactionStatePurchased or SKPaymentTransactionStateRestored. The transactionIdentifier is a string that uniquely identifies the processed payment. Your application may wish to record this string as part of an audit trail for App Store purchases. See In-App Purchase Programming Guide for more information.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPaymentTransaction.htransactionState
The current state of the transaction. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
SKPaymentTransaction.hConstants
Payment Transaction States
The state of a transaction.
enum {
SKPaymentTransactionStatePurchasing,
SKPaymentTransactionStatePurchased,
SKPaymentTransactionStateFailed,
SKPaymentTransactionStateRestored
};
typedef NSInteger SKPaymentTransactionState;
Constants
SKPaymentTransactionStatePurchasingThe transaction is being processed by the App Store.
Available in OS X v10.7 and later.
Declared in
SKPaymentTransaction.h.SKPaymentTransactionStatePurchasedThe App Store successfully processed payment. Your application should provide the content the user purchased.
Available in OS X v10.7 and later.
Declared in
SKPaymentTransaction.h.SKPaymentTransactionStateFailedThe transaction failed. Check the
errorproperty to determine what happened.Available in OS X v10.7 and later.
Declared in
SKPaymentTransaction.h.SKPaymentTransactionStateRestoredThis transaction restores content previously purchased by the user. Read the
originalTransactionproperty to obtain information about the original purchase.Available in OS X v10.7 and later.
Declared in
SKPaymentTransaction.h.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)