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 comment
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\