diff --git a/src/ClickatellClient.php b/src/ClickatellClient.php index ee3cb25..5939fec 100644 --- a/src/ClickatellClient.php +++ b/src/ClickatellClient.php @@ -57,12 +57,12 @@ public function send($to, $message) */ protected function handleProviderResponses(array $responses) { - collect($responses)->each(function (stdClass $response) { - $errorCode = (int) $response->errorCode; + collect($responses['messages'])->each(function ($response) { + $errorCode = (int) $response['errorCode']; if ($errorCode != self::SUCCESSFUL_SEND) { throw CouldNotSendNotification::serviceRespondedWithAnError( - (string) $response->error, + $response['error'], $errorCode ); }