Repositories | Polyback | Log in to see private repositories


polyback-website / b0d92d543d33db09acbae728aa0eb9b4a0a682ce / api/games/products.php

668 bytes | parent directory

<?php require $_SERVER['DOCUMENT_ROOT'].'/api/private/core.php';

// What a place sells, for MarketplaceService:GetDeveloperProductsAsync(). Anybody may look.
//   ?placeId=9 -> {"success":true,"products":[{"ProductId","Name","Description","PriceInRobux"}]}
// (the API keeps Roblox's names; the prices are Pizzas)

use pizzaboxer\ProjectPolygon\Products;

header("content-type: application/json");
$list = [];
foreach (Products::ForPlace((int) ($_GET["placeId"] ?? 0)) as $p)
	$list[] = ["ProductId" => (int) $p->ID, "Name" => $p->Name, "Description" => $p->Description, "PriceInRobux" => (int) $p->Price];
die(json_encode(["success" => true, "products" => $list]));