Class ReceiptUtility

java.lang.Object
com.apple.itunes.storekit.migration.ReceiptUtility

public class ReceiptUtility extends Object
  • Constructor Details

    • ReceiptUtility

      public ReceiptUtility()
  • Method Details

    • extractTransactionIdFromAppReceipt

      public String extractTransactionIdFromAppReceipt(String appReceipt) throws IOException
      Extracts a transaction id from an encoded App Receipt. Throws if the receipt does not match the expected format. *NO validation* is performed on the receipt, and any data returned should only be used to call the App Store Server API.
      Parameters:
      appReceipt - The unmodified app receipt
      Returns:
      A transaction id from the array of in-app purchases, null if the receipt contains no in-app purchases.
      Throws:
      IOException - If the receipt was malformed
      IllegalArgumentException - If the receipt could not be parsed or did not match the expected format
    • extractTransactionIdFromTransactionReceipt

      public String extractTransactionIdFromTransactionReceipt(String transactionReceipt)
      Extracts a transaction id from an encoded transactional receipt. Throws if the receipt does not match the expected format. *NO validation* is performed on the receipt, and any data returned should only be used to call the App Store Server API.
      Parameters:
      transactionReceipt - The unmodified transactionReceipt
      Returns:
      A transaction id, or null if no transactionId is found in the receipt
      Throws:
      IllegalArgumentException - If the receipt could not be parsed or did not match the expected format