Interface ReceiptService

All Known Implementing Classes:
SuperuserReceiptService, UserReceiptService

public interface ReceiptService
  • Method Details

    • getReceipts

      Pagination<Receipt> getReceipts(String userId, int offset, int count, String search)
      Gets receipts for a given user specifying the offset and the count.
      Parameters:
      userId - the id of the user to search for
      offset - the offset
      count - the count
      search - Used to filter by scheme if you support multiple IAP providers
      Returns:
      a Pagination of Receipt objects.
    • getReceiptBySchemaAndTransactionId

      Receipt getReceiptBySchemaAndTransactionId(String schema, String originalTransactionId)
      Gets the receipt with the schema and transaction id, or throws a NotFoundException if the receipt can't be found.
      Parameters:
      schema - the schema of the payment processor
      originalTransactionId - the original transaction id
      Returns:
      the Receipt that was requested, never null
    • getReceiptById

      Receipt getReceiptById(String id)
      Gets the receipt with the db id, or throws a NotFoundException if the receipt can't be found.
      Parameters:
      id - the db id
      Returns:
      the Receipt that was requested, never null
    • createReceipt

      Receipt createReceipt(CreateReceiptRequest receipt)
      Creates a new receipt.
      Returns:
      the Receipt 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 scheme + transaction id that already exists
    • deleteReceipt

      void deleteReceipt(String receiptId)
      Deletes an existing receipt.
      Parameters:
      receiptId - the db id of the receipt