Interface GooglePlayIapReceiptService

All Known Implementing Classes:
UserGooglePlayIapReceiptService

public interface GooglePlayIapReceiptService
  • Method Details

    • getGooglePlayIapReceipts

      Pagination<GooglePlayIapReceipt> getGooglePlayIapReceipts(User user, int offset, int count)
      Gets receipts for a given user specifying the offset and the count.
      Parameters:
      user - the user
      offset - the offset
      count - the count
      Returns:
      a Pagination of GooglePlayIapReceipt objects.
    • getGooglePlayIapReceipt

      GooglePlayIapReceipt getGooglePlayIapReceipt(String orderId)
      Gets the receipt with the id, or throws a NotFoundException if the receipt can't be found.
      Parameters:
      orderId - the original apple transaction id
      Returns:
      the GooglePlayIapReceipt that was requested, never null
    • getOrCreateGooglePlayIapReceipt

      GooglePlayIapReceipt getOrCreateGooglePlayIapReceipt(GooglePlayIapReceipt googlePlayIapReceipt)
      Finds a receipt in the db, or creates a new one if necessary.
      Returns:
      the GooglePlayIapReceipt as it was written into the database
      Throws:
      InvalidDataException - if the state of the passed in receipt is invalid
      DuplicateException - if the passed in receipt has a name that already exists
    • deleteGooglePlayIapReceipt

      void deleteGooglePlayIapReceipt(String orderId)
      Deletes an existing receipt.
      Parameters:
      orderId - the original order id from Google Play
    • verifyAndCreateGooglePlayIapReceiptIfNeeded

      GooglePlayIapReceipt verifyAndCreateGooglePlayIapReceiptIfNeeded(String packageName, String productId, String purchaseToken)
      Verifies the given purchase data against the Google Play purchase validation services.
      Parameters:
      packageName - the package name of the application, e.g. `com.namazustudios.example_app`.
      productId - the product id purchased by the user, e.g. `com.namazustudios.example_app.pack_10_coins`.
      purchaseToken - the token issued to the user upon successful Google Play purchase transaction.
      Returns:
      the GooglePlayIapReceipt as it was written into the database, or the existing database record.
    • getOrCreateRewardIssuances

      List<RewardIssuance> getOrCreateRewardIssuances(GooglePlayIapReceipt googlePlayIapReceipt)
      Gets or creates a list of RewardIssuances in the db for the given GooglePlayIapReceipt.
      Parameters:
      googlePlayIapReceipt -
      Returns: