Why ProcessReceipt shouldn't check the Robux price

With regional pricing and price tests, players pay different prices for the same product. How to grant by ProductId so every buyer gets what they paid for.

warningLuaudit check: fixed-price-receipts

What it looks like

ProcessReceipt decides what to grant from the Robux the player spent. It refuses receipts below the price the developer set, or works out the reward from CurrencySpent, as if every player paid the same.

Luau
if receipt.CurrencySpent < pack.price then
	return Enum.ProductPurchaseDecision.NotProcessedYet
end

What an exploiter could do

No exploit is needed, and paying players are the ones who lose out. Once regional prices or a price test apply to the product, players charged the lower price never get what they bought, or get less than the shop promised, and Roblox keeps handing the stuck receipt back.

How to fix it

  • Decide what each receipt grants from receipt.ProductId only, from the server's own table.
  • Use CurrencySpent only to record what the player actually paid, for example for a top supporters board or your own analytics.
  • Show prices in the shop with GetProductInfoAsync or GetDeveloperProductsAsync on the client, so each player sees the price they'll be charged, rather than a number written into the game.

Vulnerable example

Vulnerable
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local PlayerData = require(script.Parent.PlayerData)

local coinsPerRobux = 10

MarketplaceService.ProcessReceipt = function(receipt)
	local player = Players:GetPlayerByUserId(receipt.PlayerId)
	local profile = player and PlayerData.get(player)
	if not profile then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	local key = "Purchase:" .. receipt.PurchaseId
	if not profile.Claimed[key] then
		profile.Claimed[key] = true
		profile.Coins += receipt.CurrencySpent * coinsPerRobux
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

Fixed example

Fixed
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local PlayerData = require(script.Parent.PlayerData)

local coinPacks: { [number]: number } = {
	[1111111] = 500,
	[2222222] = 2500,
}

MarketplaceService.ProcessReceipt = function(receipt)
	local coins = coinPacks[receipt.ProductId]
	local player = Players:GetPlayerByUserId(receipt.PlayerId)
	local profile = player and PlayerData.get(player)
	if not coins or not profile then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	local key = "Purchase:" .. receipt.PurchaseId
	if not profile.Claimed[key] then
		profile.Claimed[key] = true
		profile.Coins += coins
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

How to spot this in your own scripts, and the cases that only look like it, are part of the Luaudit check your AI runs.