src/PaymentGateway.php
private function __sendCurl($urlPath, $method, $param)
    {
        $url = trim($this->apiBaseUrl, '/') . '/' . trim($urlPath, '/');

        if ($method == 'GET') {
            $query = http_build_query($param);
            $url = $url . '?' . $query;
        }

        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_CUSTOMREQUEST => $method,
            CURLOPT_POSTFIELDS => $method == 'POST' ? json_encode($param) : '',
            CURLOPT_HTTPHEADER => array(
                "Cache-Control: no-cache",
                "Content-Type: application/json",
            ),
        ));

        $response = curl_exec($curl);
        $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $error = curl_error($curl);
        curl_close($curl);

        return (object)array(
            'code' => $httpCode,
            'response' => $error ? $error : json_decode($response),
        );

    }
private function __sendCurl($urlPath, $method, $param)
    {
        $url = trim($this->apiBaseUrl, '/') . '/' . trim($urlPath, '/');

        if ($method == 'GET') {
            $query = http_build_query($param);
            $url = $url . '?' . $query;
        }

        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_CUSTOMREQUEST => $method,
            CURLOPT_POSTFIELDS => $method == 'POST' ? json_encode($param) : '',
            CURLOPT_HTTPHEADER => array(
                "Cache-Control: no-cache",
                "Content-Type: application/json",
            ),
        ));

        $response = curl_exec($curl);
        $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $error = curl_error($curl);
        curl_close($curl);

        return (object)array(
            'code' => $httpCode,
            'response' => $error ? $error : json_decode($response),
        );

    }
private function __sendCurl ( $ urlPath , $ method , $ param ) { $ url = trim ( $ this -> apiBaseUrl , '/' ) . '/' . trim ( $ urlPath , '/' ) ; if ( $ method == 'GET' ) { $ query = http_build_query ( $ param ) ; $ url = $ url . '?' . $ query ; } $ curl = curl_init ( ) ; curl_setopt_array ( $ curl , array ( CURLOPT_URL => $ url , CURLOPT_RETURNTRANSFER => true , CURLOPT_MAXREDIRS => 10 , CURLOPT_TIMEOUT => 30 , CURLOPT_CUSTOMREQUEST => $ method , CURLOPT_POSTFIELDS => $ method == 'POST' ? json_encode ( $ param ) : '' , CURLOPT_HTTPHEADER => array ( "Cache-Control: no-cache" , "Content-Type: application/json" , ) , ) ) ; $ response = curl_exec ( $ curl ) ; $ httpCode = curl_getinfo ( $ curl , CURLINFO_HTTP_CODE ) ; $ error = curl_error ( $ curl ) ; curl_close ( $ curl ) ; return ( object ) array ( 'code' => $ httpCode , 'response' => $ error ? $ error : json_decode ( $ response ) , ) ; }
Use Curl function for Send request

@param string $urlPath
@param string $method request method type , POST|GET
@param array  $param request parameters
@return object
Use Curl function for Send request