Beispiel #1
0
     $tag = get_tag_by_uid($_GET['id']);
     $tag['type'] = get_tag_type($tag['type']);
     unset($tag['keya']);
     $response = array("version" => $version, "response" => $tag);
     echo json_encode($response);
 } elseif ('tags' == $_GET['uri']) {
     send_headers();
     $tags = get_all_tags();
     $response = array("version" => $version, "response" => $tags);
     echo json_encode($response);
 } elseif ('readers' == $_GET['uri'] && isset($_GET['id'])) {
     send_headers();
     $reader = get_reader_by_id($_GET['id']);
     $reader['services'] = get_reader_services_by_id($reader['id']);
     $services = [];
     foreach (get_reader_services_by_id($reader['id']) as $service_id) {
         $services[] = get_reader_service($service_id);
     }
     $reader['services'] = $services;
     $response = array("version" => $version, "response" => $reader);
     echo json_encode($response);
 } elseif ('readers' == $_GET['uri']) {
     send_headers();
     $readers = get_all_readers();
     $response = array("version" => $version, "response" => $readers);
     echo json_encode($response);
 } elseif ('payments' == $_GET['uri'] && isset($_GET['id'])) {
     send_headers();
     $payment = get_all_payments_by_uid($_GET['id']);
     $response = array("version" => $version, "response" => $payment);
     echo json_encode($response);
Beispiel #2
0
function is_payment_reader($id)
{
    $services = get_reader_services_by_id($id);
    if (in_array(1, $services) || $id == 0) {
        return true;
    } else {
        return false;
    }
}