SKPayment 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 | SKPayment.h |
Overview
The SKPayment class defines a request to the Apple App Store to process payment for additional functionality offered by your application. A payment encapsulates a string that identifies a particular product and the quantity of those items the user would like to purchase.
Tasks
Creating Instances
Getting Attributes
-
productIdentifierproperty -
quantityproperty -
requestDataproperty
Properties
productIdentifier
A string used to identify a product that can be purchased from within your application. (read-only)
Discussion
The product identifier is a string previously agreed on between your application and the Apple App Store.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPayment.hquantity
The number of items the user wants to purchase. (read-only)
Discussion
Default value is 1. Maximum value is 10.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPayment.hrequestData
Reserved for future use. (read-only)
Discussion
The default value is nil. If requestData is not nil, your payment will be rejected by the Apple App Store.
Availability
- Available in OS X v10.7 and later.
Declared In
SKPayment.hClass Methods
paymentWithProduct:
Returns a new payment for the specified product.
Parameters
- product
The product the user wishes to purchase.
Return Value
A new payment object.
Discussion
This factory method uses the productIdentifier property obtained from the product parameter to create and return a new payment with that identifier. The quantity property defaults to 1.
To create a SKPayment object with a quantity greater than 1, create a SKMutablePayment object, adjust its quantity property and then add it to the payment queue.
SKMutablePayment *myPayment = [SKMutablePayment paymentWithProduct: myProduct]; |
myPayment.quantity = 2; |
[[SKPaymentQueue defaultQueue] addPayment:myPayment]; |
Availability
- Available in OS X v10.7 and later.
Declared In
SKPayment.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-02-16)