Currently it’s impossible for third party applications to process receipts within experiences without over-writing the places receipt handler.
Similar to how platforms like Stripe have streamlined payment handling on the web, third-party applications have the potential to do the same for Roblox experiences. The less time spent worrying about monetization means developers can dedicate more time making their experiences as enjoyable as possible.
For example, this could function as followed:
local ARRAY_OF_PRODUCTS = {123, 456, 789}
MarketplaceService:ProcessSpecificReceipts(ARRAY_OF_PRODUCTS, function(receiptInfo)
-- Handle logic
if success then
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end)
You might ask: why not just over-write the current receipt handler then call that within the third-party receipt handler? Firstly that doesn’t scale for multiple third party applications, and secondly if you attempt to do that the following error is produced:
-- Pretend this is set by the game owner
MarketplaceService.ProcessReceipt = function()
-- Handle logic
print("Processed game receipt!")
return Enum.ProductPurchaseDecision.PurchaseGranted
end
-- This would then be set by the third party application (but currently throws an error)
MarketplaceService.ProcessReceipt = function()
local gameReceiptCallback = MarketplaceService.ProcessReceipt
if isAThirdPartyProduct then
-- Handle logic
print("Processed third-party receipt")
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return gameReceiptCallback()
end
end
ProcessReceipt is a callback member of MarketplaceService; you can only set the callback value, get is not available