local A=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local v=game:GetService("\077\097\114\107\101\116\112\108\097\099\101\083\101\114\118\105\099\101")local Y=game:GetService("\080\108\097\121\101\114\115")local i=A:WaitForChild("\099\111\109\109\111\110")local C=A:WaitForChild("\108\105\098")local R=require(C:WaitForChild("\080\105\122\122\097\065\108\112\097\099\097"))local M=require(i:WaitForChild("\068\101\118\080\114\111\100\117\099\116\115"))local k=R.GameModule:extend("\067\097\115\104\105\101\114")function k.promptPurchase(i,A,Y)local C=M.byId[Y]if C then v:PromptProductPurchase(A,C.productId)end end function k.init(A)v.ProcessReceipt=function(v)local i=Y:GetPlayerByUserId(v.PlayerId)if not i then return Enum.ProductPurchaseDecision.NotProcessedYet end local C=v.ProductId local R=M.byProductId[C]if R.onProductPurchase(i,A.core)then return Enum.ProductPurchaseDecision.PurchaseGranted end end end return k
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local common = ReplicatedStorage:WaitForChild("common")
local lib = ReplicatedStorage:WaitForChild("lib")

local PizzaAlpaca = require(lib:WaitForChild("PizzaAlpaca"))
local DevProducts = require(common:WaitForChild("DevProducts"))

local Cashier = PizzaAlpaca.GameModule:extend("Cashier")

function Cashier:promptPurchase(player,devproductId)
    local product = DevProducts.byId[devproductId]
    if product then
        MarketplaceService:PromptProductPurchase(player, product.productId)
    end
end

function Cashier:init()
    MarketplaceService.ProcessReceipt = function(recieptInfo)
        local player = Players:GetPlayerByUserId(recieptInfo.PlayerId)
        if not player then
            return Enum.ProductPurchaseDecision.NotProcessedYet
        end

        local productAssetId = recieptInfo.ProductId
        local product = DevProducts.byProductId[productAssetId]

        if product.onProductPurchase(player,self.core) then
            return Enum.ProductPurchaseDecision.PurchaseGranted
        end
    end
end

return Cashier