Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I know if my purchases are being recorded and how to view them?

From what I believe, I have implemented the DataStore and PurchaseHistory correctly to record the transactions that are purchased from my developer products. How would I be able to verify it's working and also is there a way to view those transactions?

Here is my script for verification. Any help would be appreciated.

local mpService = game:GetService("MarketplaceService")
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

mpService.ProcessReceipt = function(receiptInfo)
	local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId
	if PurchaseHistory:GetAsync(playerProductKey) then
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
	
    local plr = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
    if not plr then
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end

    if receiptInfo.ProductId == 55131820 then
        local Lives = plr.leaderstats.Souls;
        Lives.Value = Lives.Value +1
    elseif receiptInfo.ProductId == 55131892 then
        local Lives = plr.leaderstats.Souls;
        Lives.Value = Lives.Value +5
    elseif receiptInfo.ProductId == 55131917 then
        local Lives = plr.leaderstats.Souls;
        Lives.Value = Lives.Value +10
elseif receiptInfo.ProductId == 55131947 then
        local Lives = plr.leaderstats.Souls;
        Lives.Value = Lives.Value +15
elseif receiptInfo.ProductId == 55131997 then
        local Lives = plr.leaderstats.Souls;
        Lives.Value = Lives.Value +25
    end

	PurchaseHistory:SetAsync(playerProductKey, true)	
	return Enum.ProductPurchaseDecision.PurchaseGranted		
end

1 answer

✓ Accepted answer

In order to verify, you'll need a service such as Google Analytics. You may get the Google Analytics Model which is made by ROBLOX. It will have everything you need right there. Using Google Analytics, you can see when someone has bought a developer product, and if it has worked. If you do not use Google Analytics, you could use Trello as an alternative.

1 comment

0

I am in google Analytics and it is showing that one user is there but I can't seem to find any data showing a purchase was made\

This discussion is preserved as it was. New answers, comments, and votes are closed.