php 에서 success페이지내 오류 문의

php중 success
"Call to undefined function: curl_setopt_array()"
.
php5
는 php 이 4?<?php

$paymentKey = $_GET['paymentKey'];
$orderId = $_GET['orderId'];
$amount = $_GET['amount'];

$secretKey = 'test_ak_ZORzdMaqN3wQd5k6ygr5AkYXQGwy';

//$url = 'https://api.tosspayments.com/v1/payments/' . $paymentKey;
$url = 'https://api.tosspayments.com/v1/payments/confirm';

$data = array('orderId' => $orderId, 'amount' => $amount);

$credential = base64_encode($secretKey . ':');

$curlHandle = curl_init($url);

curl_setopt_array($curlHandle, array(
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => array(
'Authorization: Basic ' . $credential,
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS => json_encode($data)
));

$response = curl_exec($curlHandle);

$httpCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);
$isSuccess = $httpCode == 200;
$responseJson = json_decode($response);

?>
Was this page helpful?