MarketplaceService.ProcessReceipt not firing

I have been trying to get MarketPlaceService.ProcessReceipt to fire without any success so far.
Once a purchase is completed, nothing, absolutely nothing happens. Code is below, can anyone tell me why it is not firing? There is only script that calls MarketplaceService.ProcessReceipt by the way and it is a Script

Code:

local mps = game.MarketplaceService
local Players = game.Players
mps.ProcessReceipt = function(receiptInfo)
	local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	if receiptInfo.ProductId == 100309279 then
		print("premium purchased")
	end
	
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

Help would be extremely appreciated!

Add prints to see where it stops

Is the script a serverscript inside ServerScriptService?
Is the developer product under your game, and not another place?

  1. The Script is not inside ServerScriptService
  2. It’s a gamepass, not a dev product

Obviously tried that before, absolutely nothing is happening

Bump

Still needs fixing, pls help

While using a gamepass you don’t use the ProcessReceipt callback function because it has been made for dev-products (and subscriptions i think). You need to use PromptGamePassPurchaseFinished function to handle gamepass purchases.

Example:

MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, wasPurchased)
	if gamepassId == VipGamepassId then
		local success = SomeVipBoughtFunction(player)
		if not success then
			warn("There was an error while buying vip by player of id: ", player.UserId) return
		else
			print("Player of id: ", player.UserId, " has successfully bought vip!")
		end
	end
end)
1 Like

Do research next time, @DudusJestem has your solution

1 Like

That fixed my issue, thanks alot!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.