Get Transactions

Language: PHP

Created at: 2024-06-25 15:39:36

function get_transactions()
    {
        $this->check_session();
        $userToken = $_SESSION['token'];

        $curl = curl_init();

        curl_setopt_array($curl, array(
            CURLOPT_URL => $this->build_url('/merchant/credit/transactions'), //?pageLimit=10&offset=0
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 0,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET',
            CURLOPT_HTTPHEADER => array(
                'Authorization: Bearer ' . $userToken
            ),
        ));

        $response = curl_exec($curl);

        curl_close($curl);
        $data = json_decode($response);

        return $data;
    }
Back to List