WorldProductPurchase
WorldProductPurchase represents a completed purchase transaction. Received in Payments.PurchaseHandler when a player makes a purchase. Contains purchase details including product ID, user ID, and timestamp.
Properties
The unique identifier for this purchase transaction.
print("Purchase ID: " .. purchase.id)
The ID of the product that was purchased.
print("Product ID: " .. purchase.product_id)
Unix epoch timestamp (UTC) when the purchase was made. Use os.date() to format into human-readable format.
local purchaseDate = os.date("%Y-%m-%d %H:%M:%S", purchase.purchase_date)
print("Purchased on: " .. purchaseDate)
The user ID of the player who made the purchase.
print("Buyer ID: " .. purchase.user_id)
if purchase.user_id == player.user.id then
print("Purchase belongs to this player")
end
Updated 19 days ago