function execMonthlyPayment($member_id, $order_id, $amount)
{
    global $log;
    $log = new Log("payment_api");
    try {
        //search member
        $result = searchMember($member_id, true);
        if ($result == false) {
            return false;
        }
        // search Card
        $result = searchCard($member_id, true);
        if ($result == false) {
            return false;
        }
        // entry & exec tran
        execTran($member_id, $order_id, $amount);
    } catch (Exception $e) {
        $log->error("execMonthlyPaiment ERROR_CODE=" . $e->getMessage());
        $log->error(serialize($e));
        return $e->getMessage();
    }
}
<?php

include "datasource.php";
$id_peserta = @$_POST['id'];
$response = array('success' => false, 'message' => 'Tidak terdaftar');
if (isset($_POST['send'])) {
    $row = searchMember($id_peserta);
    if (isset($row)) {
        $response = array('success' => true, 'message' => 'Absensi diterima', 'detail' => $row);
    }
}
echo json_encode($response);