From 6730f06c2b70a61b547a977d88da32308cdb3466 Mon Sep 17 00:00:00 2001 From: Martijn Smit Date: Fri, 27 Jul 2018 11:04:00 +0200 Subject: [PATCH] Only json_encode data when there is data. Fixes #51 --- src/Message/Request/AbstractMollieRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/Request/AbstractMollieRequest.php b/src/Message/Request/AbstractMollieRequest.php index d66d7ae..77f5579 100755 --- a/src/Message/Request/AbstractMollieRequest.php +++ b/src/Message/Request/AbstractMollieRequest.php @@ -72,7 +72,7 @@ protected function sendRequest($method, $endpoint, array $data = null) [ 'Authorization' => 'Bearer ' . $this->getApiKey() ], - json_encode($data) + ($data === null) ? null : json_encode($data) ); return json_decode($response->getBody(), true);