iOS Developer Library

Developer

StoreKit Framework Reference SKMutablePayment Class Reference

Options
Deployment Target:

On This Page
Language:

SKMutablePayment

The SKMutablePayment 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 that item the user would like to purchase.

When a mutable payment is added to the payment queue, the payment queue copies the contents into an immutable request before queueing the request. Your application can safely change the contents of the mutable payment object.

  • A string that identifies a product that can be purchased from within your application.

    Declaration

    Swift

    var productIdentifier: String

    Objective-C

    @property(nonatomic, copy, readwrite) NSString *productIdentifier

    Discussion

    The product identifier is a string previously agreed on between your application and the Apple App Store.

    Availability

    Available in iOS 3.0 and later.

  • The number of items the user wants to purchase.

    Declaration

    Swift

    var quantity: Int

    Objective-C

    @property(nonatomic, readwrite) NSInteger quantity

    Discussion

    The quantity property must be greater than 0.

    Availability

    Available in iOS 3.0 and later.

  • Reserved for future use. (read-only)

    Declaration

    Swift

    @NSCopying var requestData: NSData?

    Objective-C

    @property(nonatomic, copy, readwrite) 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 iOS 3.0 and later.

  • An opaque identifier for the user’s account on your system.

    Declaration

    Swift

    var applicationUsername: String

    Objective-C

    @property(nonatomic, copy, readwrite) NSString *applicationUsername

    Discussion

    Use this property to help the store detect irregular activity. For example, in a game, it would be unusual for dozens of different iTunes Store accounts to make purchases on behalf of the same in-game character.

    The recommended implementation is to use a one-way hash of the user’s account name to calculate the value for this property.

    Availability

    Available in iOS 7.0 and later.

  • A Boolean value that produces an "ask to buy" flow for this payment in the sandbox.

    Declaration

    Swift

    var simulatesAskToBuyInSandbox: Bool

    Objective-C

    @property(nonatomic, readwrite) BOOL simulatesAskToBuyInSandbox

    Availability

    Available in iOS 8.3 and later.