klaviyo / klaviyo-api-php

PHP SDK for Klaviyo API
https://developers.klaviyo.com
MIT License
46 stars 21 forks source link

Syntax error in Webhooks API #60

Closed Haggai-Mac closed 2 months ago

Haggai-Mac commented 2 months ago

Hi!

PHP-Version > 8.0 Klaviyo SDK 9.0.0

Code to reproduce:

$klaviyo = new KlaviyoAPI(
    'YOUR_KEY',
    $num_entries = 3,
    $wait_seconds = 3
);

/**
 * @type MetricsApi $metrics
 */
$metrics = $klaviyo->Metrics;

try {
    $response = $metrics->getMetrics();
    echo json_encode($response);
} catch (ApiException $e) {
    echo $e->getCode() . ' ' . $e->getMessage();
}

Results in:

syntax error, unexpected token ",", expecting variable

The Webhooks API has a syntax error in lines 1503, 1505, 1519, 1521, 1685, 1687, 1704, 1707, and 1757. This is causing the whole SDK to fail.

Ian-Montgomery-Klaviyo commented 2 months ago

There was an error in the release, a patch will be out shortly.

Ian-Montgomery-Klaviyo commented 2 months ago

9.0.1 hotfix is now out. A follow up patch will come out with improvements to webhook topics