Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

Log in to vote
0
Answered by 7 years ago

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.

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\ SocialENTRcoRSE 21 — 7y
Ad

Answer this question