$url = "https://tapproval.smartropay.co.kr/payment/approval/urlCallApproval.do"; // Å×½ºÆ® //$url = "https://approval.smartropay.co.kr/payment/approval/urlCallApproval.do"; // ¿î¿µ $approval_data = array( 'Tid' => $_REQUEST['Tid'], 'TrAuthKey' => $_REQUEST['TrAuthKey'] ); // json data $json = json_encode($approval_data); $http_status = 0; // https Åë½Å $ret = Curl($url, $json, $http_status); function Curl($url, $post_data, &$http_status, &$header = null) { $ch=curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $url); // post_data curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json')); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); $body = null; // error if (!$response) { $body = curl_error($ch); // HostNotFound, No route to Host, etc Network related error $http_status = -1; Log::error("CURL Error: = " . $body); } else { //parsing http status code $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (!is_null($header)) { $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); } else { $body = $response; } } curl_close($ch); return $body; }