$paymentKey, 'orderId' => $orderId, 'amount' => $amount]; $secretKey = '****************************'; $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; $responseJson = json_decode($response); include "config/common.inc"; include "config/dbconn.inc"; if(!isset($_SESSION['slogin_email'])) { $slogin_email = NULL; } else { $slogin_email = $_SESSION['slogin_email']; } if(!isset($_SESSION['slogin_code'])) { $slogin_code = NULL; } else { $slogin_code = $_SESSION['slogin_code']; } $new_postdates = date('YmdHis ', $signdate); // Update booking data if ($isSuccess) { $query = "UPDATE shop_service_booking SET status = ?, pay_date = ? WHERE branch_code = ? AND user_email = ?"; $stmt = mysqli_prepare($dbconn, $query); if (!$stmt) { error("QUERY_ERROR"); exit; } $new_branch_code = "0002"; $new_status = "2"; $new_pay_date = $new_postdates; $new_user_email = $slogin_emaill mysqli_stmt_bind_param($stmt, 'ssss', $new_status, $new_pay_date, $new_branch_code, $new_user_email); $result = mysqli_stmt_execute($stmt); if (!$result) { error("QUERY_ERROR"); exit; } } ?> 토스페이먼츠 샘플페이지-결제결과

결제 성공

상품명 : orderName ?>

결제수단 : method ?> ( method === "카드") { echo $responseJson->card->number;} ?> method === "가상계좌") { echo $responseJson->virtualAccount->accountNumber;} ?> method === "계좌이체") { echo $responseJson->transfer->bank;} ?> method === "휴대폰") { echo $responseJson->mobilePhone->customerMobilePhone;} ?> )

Response Data :
                
              

결제 실패

에러메시지 : message ?>

에러코드: code ?>