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

Properties

productIdentifier

A string used to identify a product that can be purchased from within your application. (read-only)

@property(nonatomic, copy, readonly) NSString *productIdentifier
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.h

quantity

The number of items the user wants to purchase. (read-only)

@property(nonatomic, readonly) NSInteger quantity
Discussion

Default value is 1. Maximum value is 10.

Availability
  • Available in OS X v10.7 and later.
Declared In
SKPayment.h

requestData

Reserved for future use. (read-only)

@property(nonatomic, copy, readonly) NSData *requestData
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.h

Class Methods

paymentWithProduct:

Returns a new payment for the specified product.

+ (id)paymentWithProduct:(SKProduct *)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

Did this document help you? Yes It's good, but... Not helpful...