Class UserGooglePlayIapReceiptService
java.lang.Object
dev.getelements.elements.service.googleplayiap.UserGooglePlayIapReceiptService
- All Implemented Interfaces:
GooglePlayIapReceiptService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteGooglePlayIapReceipt
(String orderId) Deletes an existing receipt.getGooglePlayIapReceipt
(String orderId) Gets the receipt with the id, or throws aNotFoundException
if the receipt can't be found.getGooglePlayIapReceipts
(User user, int offset, int count) Gets receipts for a given user specifying the offset and the count.com.fasterxml.jackson.databind.ObjectMapper
getOrCreateGooglePlayIapReceipt
(GooglePlayIapReceipt googlePlayIapReceipt) Finds a receipt in the db, or creates a new one if necessary.getOrCreateRewardIssuances
(GooglePlayIapReceipt googlePlayIapReceipt) Gets or creates a list ofRewardIssuance
s in the db for the givenGooglePlayIapReceipt
.getUser()
void
setApplicationConfigurationDao
(ApplicationConfigurationDao applicationConfigurationDao) void
setCurrentProfileSupplier
(Supplier<Profile> currentProfileSupplier) void
setDozerMapper
(MapperRegistry dozerMapperRegistry) void
setGooglePlayIapReceiptDao
(GooglePlayIapReceiptDao googlePlayIapReceiptDao) void
setItemDao
(ItemDao itemDao) void
setRewardIssuanceDao
(RewardIssuanceDao rewardIssuanceDao) void
verifyAndCreateGooglePlayIapReceiptIfNeeded
(String packageName, String productId, String purchaseToken) Verifies the given purchase data against the Google Play purchase validation services.
-
Constructor Details
-
UserGooglePlayIapReceiptService
public UserGooglePlayIapReceiptService()
-
-
Method Details
-
getUser
-
setUser
-
getGooglePlayIapReceiptDao
-
setGooglePlayIapReceiptDao
-
getDozerMapper
-
setDozerMapper
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getRewardIssuanceDao
-
setRewardIssuanceDao
-
getItemDao
-
setItemDao
-
getApplicationConfigurationDao
-
setApplicationConfigurationDao
@Inject public void setApplicationConfigurationDao(ApplicationConfigurationDao applicationConfigurationDao) -
getCurrentProfileSupplier
-
setCurrentProfileSupplier
-
getGooglePlayIapReceipts
Description copied from interface:GooglePlayIapReceiptService
Gets receipts for a given user specifying the offset and the count.- Specified by:
getGooglePlayIapReceipts
in interfaceGooglePlayIapReceiptService
- Parameters:
user
- the useroffset
- the offsetcount
- the count- Returns:
- a
Pagination
ofGooglePlayIapReceipt
objects.
-
getGooglePlayIapReceipt
Description copied from interface:GooglePlayIapReceiptService
Gets the receipt with the id, or throws aNotFoundException
if the receipt can't be found.- Specified by:
getGooglePlayIapReceipt
in interfaceGooglePlayIapReceiptService
- Parameters:
orderId
- the original apple transaction id- Returns:
- the
GooglePlayIapReceipt
that was requested, never null
-
getOrCreateGooglePlayIapReceipt
public GooglePlayIapReceipt getOrCreateGooglePlayIapReceipt(GooglePlayIapReceipt googlePlayIapReceipt) Description copied from interface:GooglePlayIapReceiptService
Finds a receipt in the db, or creates a new one if necessary.- Specified by:
getOrCreateGooglePlayIapReceipt
in interfaceGooglePlayIapReceiptService
- Returns:
- the
GooglePlayIapReceipt
as it was written into the database
-
deleteGooglePlayIapReceipt
Description copied from interface:GooglePlayIapReceiptService
Deletes an existing receipt.- Specified by:
deleteGooglePlayIapReceipt
in interfaceGooglePlayIapReceiptService
- Parameters:
orderId
- the original order id from Google Play
-
verifyAndCreateGooglePlayIapReceiptIfNeeded
public GooglePlayIapReceipt verifyAndCreateGooglePlayIapReceiptIfNeeded(String packageName, String productId, String purchaseToken) Description copied from interface:GooglePlayIapReceiptService
Verifies the given purchase data against the Google Play purchase validation services.- Specified by:
verifyAndCreateGooglePlayIapReceiptIfNeeded
in interfaceGooglePlayIapReceiptService
- 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
Description copied from interface:GooglePlayIapReceiptService
Gets or creates a list ofRewardIssuance
s in the db for the givenGooglePlayIapReceipt
.- Specified by:
getOrCreateRewardIssuances
in interfaceGooglePlayIapReceiptService
- Parameters:
googlePlayIapReceipt
-- Returns:
-
generateGooglePlayIapReceiptMetadata
-