refactor: simplify listing fee to fixed 1 USD, remove multi-currency logic

This commit is contained in:
2026-02-11 17:54:00 +01:00
parent 231f7b29ba
commit 3bbd777fe1
4 changed files with 7 additions and 17 deletions

View File

@@ -10,7 +10,6 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
$input = json_decode(file_get_contents('php://input'), true);
$listingId = $input['listingId'] ?? null;
$currency = $input['currency'] ?? 'EUR';
if (!$listingId) {
http_response_code(400);
@@ -18,18 +17,9 @@ if (!$listingId) {
exit;
}
$fees = LISTING_FEE;
if (!isset($fees[$currency])) {
http_response_code(400);
echo json_encode(['error' => 'Unsupported currency', 'supported' => array_keys($fees)]);
exit;
}
$amount = $fees[$currency];
$payload = json_encode([
'amount' => $amount,
'currency' => $currency,
'amount' => LISTING_FEE,
'currency' => LISTING_FEE_CURRENCY,
'metadata' => [
'listingId' => $listingId,
'orderId' => 'listing-' . $listingId,

View File

@@ -7,7 +7,8 @@ define('BTCPAY_BASE_URL', getenv('BTCPAY_BASE_URL') ?: 'https://pay.xmr.rocks');
define('BTCPAY_API_KEY', getenv('BTCPAY_API_KEY') ?: 'CHANGE_ME');
define('BTCPAY_STORE_ID', getenv('BTCPAY_STORE_ID') ?: 'CHANGE_ME');
define('BTCPAY_WEBHOOK_SECRET', getenv('BTCPAY_WEBHOOK_SECRET') ?: '');
define('LISTING_FEE', ['EUR' => 1, 'USD' => 1, 'CHF' => 1, 'GBP' => 1, 'JPY' => 200]);
define('LISTING_FEE', 1);
define('LISTING_FEE_CURRENCY', 'USD');
define('DIRECTUS_URL', getenv('DIRECTUS_URL') ?: 'https://api.kashilo.com');
define('DIRECTUS_TOKEN', getenv('DIRECTUS_TOKEN') ?: 'CHANGE_ME');