title: Error while making payments using Mollie API in php
body: <p>I am making payments using mollie API in php. But its giving me some errors . I have posted my code and screenshot of the errors.</p>
  <p>THIS IS MY CODE:</p>
  <pre><code>&lt;?php
  ini_set('display_errors', 1);
  ini_set('display_startup_errors', 1);
  error_reporting(E_ALL);
  
  try {
      require_once &quot;vendor/autoload.php&quot;;
  
      $mollie = new \Mollie\Api\MollieApiClient();
      $mollie-&gt;setApiKey(&quot;test_XXXX&quot;);
  
      $orderId = time();
  
      $amount = $_POST['amount'];
      $payment = $mollie-&gt;payments-&gt;create([
          &quot;amount&quot; =&gt; [
              &quot;currency&quot; =&gt; &quot;EUR&quot;,
              &quot;value&quot; =&gt; &quot;$amount&quot;, // You must send the correct number of decimals, thus we enforce the use of strings
          ],
          &quot;description&quot; =&gt; &quot;Order #{$orderId}&quot;,
          &quot;redirectUrl&quot; =&gt; &quot;https://example.com/Mollie/return/&quot;.$orderId.&quot;/&quot;,
          &quot;webhookUrl&quot; =&gt; &quot;https://example.com/Mollie/webhook/&quot;,
          &quot;metadata&quot; =&gt; [
              &quot;order_id&quot; =&gt; $orderId,
          ],
      ]);
      print_r($payment);
  
      $payment_data = array(
              'payment_id' =&gt; $payment-&gt;id,
              'user_id' =&gt; $_POST['user_id'],
              'order_id' =&gt; $orderId,
              'mode' =&gt; $payment-&gt;mode,
              'description' =&gt; $payment-&gt;description,
              'status' =&gt; $payment-&gt;status,
              'added_date' =&gt; date('Y-m-d'),
              'added_time' =&gt; date('H:i:s')
      );
      print_r($payment_data);
  
      header(&quot;Location: &quot; . $payment-&gt;getCheckoutUrl(), true, 303);
  
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
      echo &quot;API call failed: &quot;. htmlspecialchars($e-&gt;getMessage());
  }
  </code></pre>
  <p>THE SCREENSHOT:</p>
  <ol>
  <li>The first image shows &quot;Uncaught SyntaxError: Unexpected token M in JSON at position 0&quot; in RED color.</li>
  <li>The second image is the warning I am getting</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/BCnYW.jpg" rel="nofollow noreferrer">First image</a></p>
  <p><a href="https://i.stack.imgur.com/NnPd2.jpg" rel="nofollow noreferrer">Second Image</a></p>