'client_credentials', 'client_id' => $client_id, 'client_secret' => $client_secret ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $responseData = json_decode($response, true); $access_token = $responseData['access_token']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.sumup.com/v0.1/checkouts/$id"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer $access_token", "Content-Type: application/json" ]); $response = curl_exec($ch); curl_close($ch); $responseData = json_decode($response, true); foreach ($responseData as $key=>$value) { echo "
$key : $value"; } ?>