Skip to content
Baggers edited this page Sep 14, 2016 · 8 revisions

Data Layouts

These are actually just plain old objects with fields, but we give them names here for convenience.

enum - TransactionState

One of the following strings:

  • "Purchasing"
  • "Purchased"
  • "Failed"
  • "Restored"
  • "Deferred"

Data - SKPaymentInfo

  • productIdentifier: string
  • quantity: int
  • applicationUsername: string

Data - SKPaymentTransactionInfo

An object with the following fields

  • payment: A SKPaymentInfo object
  • transactionState: a TransactionState string
  • transactionIdentifier: string
  • transactionDateUTC: string UTC time in ISO-8601 format
  • error: null or a string

Data - ReceiptTransactionInfo

An object with the following fields

  • quantity: int
  • productIdentifier: string
  • transactionIdentifier: string
  • originalTransactionIdentifier: `string
  • purchaseDate: string UTC time in ISO-8601 format
  • originalPurchaseDate: string UTC time in ISO-8601 format
  • subscriptionExpirationDate: string UTC time in ISO-8601 format
  • cancellationDate: string UTC time in ISO-8601 format
  • webOrderLineItemID: int

Data - SKProductInformation

An object with the following fields

  • price: string
  • priceLocale: string
  • localizedDescription: string
  • productIdentifier: string
  • localizedTitle: string

Data - RequestProductResult

An object with the following fields:

  • valid: an array of SKProductInformation. These are the successfully validated products
  • invalid: an array of strings. These are the ids of the invalid products

Functions

Function - canMakePayments() -> bool

Function - getReceiptTransactions() -> array of ReceiptTransactionInfo objects

Function - requestProducts(productID0, productID1, .. etc) -> RequestProductResult object

Function - addPayment(productID) -> Promise

Function - addPayment(productID, applicationUserName) -> Promise

Function - restoreTransactions() -> Promise<Array>

Function - restoreTransactions(applicationUserName) -> Promise<Array>

Function - refreshReciept() -> Promise

The string will be success on success and can be safely ignored

Clone this wiki locally