Verifying developerproduct purchases not working

code for serverscript to handle the receipt

local MarketplaceService = game:GetService("MarketplaceService")

local productId = 1617205413 -- Change this to your developer product ID
local speedBoostAmount = 10

MarketplaceService.PromptProductPurchaseFinished:Connect(function(player, purchaseInfo)
    if purchaseInfo.ProductId == productId then
        local character = player.Character
        if character then
            local humanoid = character:FindFirstChild("Humanoid")
            if humanoid then
                humanoid.WalkSpeed = humanoid.WalkSpeed + speedBoostAmount
            end
        end
    end
end)

code for localscript

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local productId = 1617205413 -- Change this to your developer product ID

local function promptPurchase()
	MarketplaceService:PromptProductPurchase(player, productId)
end

script.Parent.MouseButton1Click:Connect(promptPurchase)

Error:

  23:29:51.858  ServerScriptService.Script:7: attempt to index number with 'ProductId'  -  Server - Script:7

I think what you’re looking for is the ProcessReceipt function, instead of PromptProductPurchaseFinished.

This unfortunately didn’t resolve my problem, I read through the api documentation and couldn’t find anything that fit my needs