Marketplace not working

Hi, I have donation buttons in my game, but they don’t seem to work when purchasing a donation. These are developer products that belong to another group I own, and while I have this game under personal ownership, I’d like the donations to go towards the group.

However, the purchase prompt works perfectly fine but when you click to buy, it says an error.

Here is the script regarding donations:

local Main = script.Parent
local MarketplaceService = game:GetService("MarketplaceService")

Main.Donations.ClickDetector.MouseClick:connect(function(p)
	MarketplaceService:PromptProductPurchase(p,1122190744)
end)

Main.LargerDonations.ClickDetector.MouseClick:connect(function(p)
	MarketplaceService:PromptProductPurchase(p,1128049373)
end)

Main.GrandDonations.ClickDetector.MouseClick:connect(function(p)
	MarketplaceService:PromptProductPurchase(p,1128049411)
end)

MarketplaceService.ProcessReceipt = function(info)
	print("purchase called");
	return Enum.ProductPurchaseDecision.PurchaseGranted;
end

Am I doing something wrong or are developer products unable to be purchased from other games? How else can I go about this?

What is the error? I think is the error is that you didn’t define p, which is I’m guessing the player

Another is that maybe 3rd party purchases isn’t enabled (you can do so by going to workspace’s properties. You’ll find it there).

p is defined, and 3rd party purchases are enabled.

Here is the error I am talking about:
https://gyazo.com/def4694714f12eb24aa0c033d943aa32

ClickDetector.MouseClick gives you the player object that triggered the event.

You don’t need 3rd party purchases to be enabled if you own the product you’re trying to sell.

You should take a look at the documentation for ProcessReceipt and set up error handling. There’s sample code you can look at towards the bottom of the page.

I tested it in a blank Baseplate template. It works perfectly fine for me.
You have to enable Third Party Sales from either the settings or a property in workspace.

Also, I don’t think that the ProcessReceipt would matter, since it’s just a donation, and the player doesn’t have to be granted anything.

It may work on studio testing, but in-game it doesn’t work.

Now I see. Hmm, that is strange. I’ve never seen that error before. Maybe try HTTP Services enabled? I am not sure.

My advise is to use processReciept to see how this internally failed,

Everything is enabled.
I have made up a temporary solution by making it a game pass instead of developer product, but the bad thing is they can’t really repurchase it. It’ll have to do for now.