SyntaxError: The string did not match the expected pattern.

php(ver.5.2.17) .
success.php 서 confirm.php
.
Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern.
.
const json = await response.json();

서 confirm.php
$data = ['aaa'=>''... $data = array('aaa'=>".... .
. .


$url = 'https://api.tosspayments.com/v1/payments/confirm';
$data = array('paymentKey' => $paymentKey, 'orderId' => $orderId, 'amount' => $amount);

$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);
Was this page helpful?