결제위젯 결제승인 API 호출후
github 에 있는 payment-samples 의 success.php 를 동일하게 사용하여 시험 중 입니다 만,
isSuccess 가 not true 로 되어 지네요...
secretKey 는 계약전 연동시험시 사용하라고 알려준 키를 사용 하고있습니다.
고맙습니다.
----------------------------------------------------------------------------
$url = 'https://api.tosspayments.com/v1/payments/confirm';
$data = ['paymentKey' => $paymentKey, 'orderId' => $orderId, 'amount' => $amount];
//$secretKey = 'test_ak_ZORzdMaqN3wQd5k6ygr5AkYXQGwy';
$secretKey = 'test_sk_zXLkKEypNArWmo50nX3lmeaxYG5R';
$credential = base64_encode($secretKey . ':');
$curlHandle = curl_init($url);
curl_setopt_array($curlHandle, [
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => [
'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;
isSuccess 가 not true 로 되어 지네요...
secretKey 는 계약전 연동시험시 사용하라고 알려준 키를 사용 하고있습니다.
고맙습니다.
----------------------------------------------------------------------------
$url = 'https://api.tosspayments.com/v1/payments/confirm';
$data = ['paymentKey' => $paymentKey, 'orderId' => $orderId, 'amount' => $amount];
//$secretKey = 'test_ak_ZORzdMaqN3wQd5k6ygr5AkYXQGwy';
$secretKey = 'test_sk_zXLkKEypNArWmo50nX3lmeaxYG5R';
$credential = base64_encode($secretKey . ':');
$curlHandle = curl_init($url);
curl_setopt_array($curlHandle, [
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => [
'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;
