Interface ReceiptService
- All Known Implementing Classes:
SuperuserReceiptService,UserReceiptService
public interface ReceiptService
-
Method Summary
Modifier and TypeMethodDescriptioncreateReceipt(CreateReceiptRequest receipt) Creates a new receipt.voiddeleteReceipt(String receiptId) Deletes an existing receipt.getReceiptById(String id) Gets the receipt with the db id, or throws aNotFoundExceptionif the receipt can't be found.getReceiptBySchemaAndTransactionId(String schema, String originalTransactionId) Gets the receipt with the schema and transaction id, or throws aNotFoundExceptionif the receipt can't be found.getReceipts(String userId, int offset, int count, String search) Gets receipts for a given user specifying the offset and the count.
-
Method Details
-
getReceipts
Gets receipts for a given user specifying the offset and the count.- Parameters:
userId- the id of the user to search foroffset- the offsetcount- the countsearch- Used to filter by scheme if you support multiple IAP providers- Returns:
- a
PaginationofReceiptobjects.
-
getReceiptBySchemaAndTransactionId
Gets the receipt with the schema and transaction id, or throws aNotFoundExceptionif the receipt can't be found.- Parameters:
schema- the schema of the payment processororiginalTransactionId- the original transaction id- Returns:
- the
Receiptthat was requested, never null
-
getReceiptById
Gets the receipt with the db id, or throws aNotFoundExceptionif the receipt can't be found.- Parameters:
id- the db id- Returns:
- the
Receiptthat was requested, never null
-
createReceipt
Creates a new receipt.- Returns:
- the
Receiptas it was written into the database - Throws:
InvalidDataException- if the state of the passed in Receipt is invalidDuplicateException- if the passed in Receipt has a scheme + transaction id that already exists
-
deleteReceipt
Deletes an existing receipt.- Parameters:
receiptId- the db id of the receipt
-