refactor: simplify listing fee to fixed 1 USD, remove multi-currency logic
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user