Developer product not working properly

Hello, whenever I make a test purchase of a developer product, it doesn’t give the coins that it should or does anything really.

ProcessReceipt Script:

local MarketService = game:GetService("MarketplaceService")
local Players = game.Players
local Coins1000ProductID = 1257555750
local Coins5000ProductID = 1257555831
local Coins10000ProductID = 1257555944

local function processReceipt(receiptInfo)
	local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	local playerchar = game.Workspace:FindFirstChild(player.Name)
	
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	
	
	
	if receiptInfo.ProductId == Coins1000ProductID then
		if player then
			playerchar.CoinsValue.Value = playerchar.CoinsValue.Value + 1000
			print(player.Name.." bought 1000 coins!")
		end
	end
	
	if receiptInfo.ProductId == Coins5000ProductID then
		if player then
			playerchar.CoinsValue.Value = playerchar.CoinsValue.Value + 5000
			print(player.Name.." bought 5000 coins!")
		end
	end
	
	if receiptInfo.ProductId == Coins10000ProductID then
		if player then
			playerchar.CoinsValue.Value = playerchar.CoinsValue.Value + 10000
			print(player.Name.." bought 10000 coins!")
		end
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
	
end
MarketService.ProcessReceipt = processReceipt()

One of the Dev products prompt purchase (local script):

local parent = script.Parent

local MarketService = game:GetService("MarketplaceService")

local ProductID = 1257555750

local player = game.Players.LocalPlayer

parent.MouseButton1Click:Connect(function()

MarketService:PromptProductPurchase(player, ProductID)

end)

You’re calling the function instead of assigning it

MarketService.ProcessReceipt = processReceipt

This isn't part of the problem but it's more useful for future cases
local MarketService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local Coins = { -- store the coins in a table to make it easier to update and manage
   [1257555750] = 1000,
   [1257555831] = 5000,
   [1257555944] = 10000,
}

local function processReceipt(receiptInfo)
	local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

    local playerchar = player.Character -- get the character from the "Character" property on the Player instance
    local coins = Coins[receiptInfo.ProductId] -- get the amount of coins to obtain from the productId in the "Coins" tab;e

    if coins then -- check if 'coins' is not nil
        playerchar.CoinsValue.Value += coins -- add the coins to the value
    end
	
    return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketService.ProcessReceipt = processReceipt
1 Like