diff --git a/src/Model/Route/CreateResponse.php b/src/Model/Route/CreateResponse.php index 7b7c1f0..e0e0d0b 100644 --- a/src/Model/Route/CreateResponse.php +++ b/src/Model/Route/CreateResponse.php @@ -25,7 +25,7 @@ final class CreateResponse implements ApiResponse { $model = new self(); $model->message = $data['message'] ?? null; - $model->route = isset($data['id']) ? Route::create($data) : null; + $model->route = isset($data['route']) ? Route::create($data['route']) : null; return $model; } diff --git a/tests/Message/BatchMessageTest.php b/tests/Message/BatchMessageTest.php index 5923205..487e1c8 100644 --- a/tests/Message/BatchMessageTest.php +++ b/tests/Message/BatchMessageTest.php @@ -32,7 +32,7 @@ class BatchMessageTest extends MailgunTestCase ->setMethods(['send', 'sendMime', 'show']) ->getMock(); $messageApi->method('send') - ->willReturn(SendResponse::create(['id' => 4711, 'message' => 'Message sent'])); + ->willReturn(SendResponse::create(['id' => '4711', 'message' => 'Message sent'])); $this->batchMessage = $messageApi->getBatchMessage('example.com'); }