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
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.