false, "msg" => "Amount missing" ]); exit; } $amount = (int)$data['amount']; $ch = curl_init("https://yayapay.shop/api/create-order"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", "Authorization: Bearer 458df936b8c35c2e69475b35c97c716d" ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ "amount" => $amount ])); $response = curl_exec($ch); if ($response === false) { echo json_encode([ "status" => false, "msg" => "cURL Error: " . curl_error($ch) ]); curl_close($ch); exit; } curl_close($ch); // Return API response directly echo $response;