Sleitnick / AeroGameFramework

AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
https://sleitnick.github.io/AeroGameFramework/
MIT License
216 stars 57 forks source link

StoreService Doesn't allow returning NotProcessedYet #144

Closed catgirlinspace closed 4 years ago

catgirlinspace commented 4 years ago

On the Roblox Developer Hub, it says

Do not return PurchaseGranted if the product could not be granted.

AeroGameFramework does not allow this with the current implementation. There are many use cases for not returning PurchaseGranted. One use case is for starter packs with a timer on them. You need to be able to return NotProcessedYet if the starter pack was already purchased or if the starter pack expires. Another use case if for round based games where players can purchase boosts before the round begins. You need to be able to return NotProcessedYet if the round starts before the player purchases it.

I think something like StoreService:RegisterProductCallback(productId: number, callbackFunction: (player, receiptInfo) => Enum.ProductPurchaseDecision) would solve this. The current StoreService.PromptPurchaseFinished event would still fire even if a product callback is registered for the product to allow for analytics, such as sending the data to GameAnalytics or Google Analytics.

catgirlinspace commented 4 years ago

Should I start a pull request to start adding this?

Sleitnick commented 4 years ago

TBH I'm thinking about removing the StoreService. It forces devs into a very precise model that might not work for everyone.

Sleitnick commented 4 years ago

StoreService will be removed