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

Why isn't this developer product transaction going through? (Access forbidden?) [Help required]

Asked by 9 years ago
local MarketplaceService = game:GetService("MarketplaceService")
local buy = script.Parent
productID = 20518668

buy.MouseButton1Click:connect(function()
    MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, productID)
end)

So I've made a purchase button. This is a localscript within the purchase button. I have another NORMAL script that handles the transaction afterwards, of course.

The problem is that Roblox isn't letting it go through. I get this error: PurchasePromptScript: onAcceptPurchase() failed because HTTP 403 (HTTP/1.1 403 Forbidden)

So ROBLOX is kicking me out before I can do anything... It forbids access for the transaction. Please shed some light on this issue.

Oh, and in case you need it, here's my server-sided script that handles the transaction:

local MarketplaceService = game:GetService("MarketplaceService") local ds = game:GetService("DataStoreService"):GetDataStore("countdowncreditservice") local productID = 20518668

local buy = game.Players.LocalPlayer.PlayerGui.shopui.shopframe.creditwindow.credit

MarketplaceService.ProcessReceipt = function(receiptInfo)
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == productID then
                player.statistics.credits.Value = player.statistics.creditsValue + 1
                local key = "plry-"..player.userId
                local savedvalue = {player.satistics.credits.Value}
                ds:SetAsync(key, savedvalue)

                return Enum.ProductPurchaseDecision.PurchaseGranted
            end
        end
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted     
end

It is vital that this is resolved. Thank you.

Answer this question