Package dev.getelements.elements.sdk.dao
Interface ReceiptDao
- All Known Implementing Classes:
MongoReceiptDao
public interface ReceiptDao
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateReceipt(Receipt receipt) Creates a new receipt.voiddeleteReceipt(String receiptId) Deletes an existing receipt.getReceipt(String id) Gets the receipt with the matching database id, or throws aNotFoundExceptionif the receipt can't be found.getReceipt(String schema, String originalTransactionId) Gets the receipt with the matching schema and transaction id, or throws aNotFoundExceptionif the receipt can't be found.getReceipts(User user, int offset, int count) Gets receipts for a given user specifying the offset and the count.getReceipts(User user, int offset, int count, String search) Gets receipts for a given user specifying the offset and the count.
-
Field Details
-
RECEIPT_CREATED
- See Also:
-
-
Method Details
-
getReceipts
Gets receipts for a given user specifying the offset and the count.- Parameters:
user- the useroffset- the offsetcount- the countsearch- Used to filter by scheme if you support multiple IAP providers- Returns:
- a
PaginationofReceiptobjects.
-
getReceipts
Gets receipts for a given user specifying the offset and the count.- Parameters:
user- the useroffset- the offsetcount- the count- Returns:
- a
PaginationofReceiptobjects.
-
getReceipt
Gets the receipt with the matching database id, or throws aNotFoundExceptionif the receipt can't be found.- Parameters:
id- the database id- Returns:
- the
Receiptthat was requested, never null
-
getReceipt
Gets the receipt with the matching schema and transaction id, or throws aNotFoundExceptionif the receipt can't be found.- Parameters:
originalTransactionId- the original transaction 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 schema + id that already exists
-
deleteReceipt
Deletes an existing receipt.- Parameters:
receiptId- the db id of the receipt
-