Getting Problems to integrate payfort api in php
<p>I am following (<a href="https://docs.start.payfort.com/references/api/" rel="nofollow noreferrer">https://docs.start.payfort.com/references/api/</a>) documentation to implement Payfort payment Api but I am facing issues.Can anyone help me to resolve these?</p>

<p>I am using below code in Api:</p>

<pre><code>&lt;?php
require_once('lib/Start.php');

// Enter secret key here
Start::setApiKey('test_sec_k_9d19ef5bd543507e333ba7b');

//Create a new token for customer
$token = Start_Token::create(array(
  "number" =&gt; "4242424242424242",
  "exp_month" =&gt; 06,
  "exp_year" =&gt; 2018,
  "cvc" =&gt; "123",
  "name" =&gt; "Abdullah Mohammed"
));

echo "&lt;pre&gt;"; print_r($token); exit;

$result = Start_Charge::create(array(
  "amount" =&gt; 1000,
  "currency" =&gt; "aed",
  "metadata" =&gt; array(
    "reference_id" =&gt; "1234567890",
    "tag" =&gt; "new"
  ),
  "card" =&gt; array(
    "name" =&gt; "Abdullah Ahmed",
    "number" =&gt; "4242424242424242",
    "exp_month" =&gt; 06,
    "exp_year" =&gt; 2018,
    "cvc" =&gt; "123"
  ),
  "description" =&gt; "Two widgets (test@example.com)",
  "email" =&gt; "abc@gmail.com"
));

try {
  // Use Start's bindings...
} catch(Start_Error_Banking $e) {
  // Since it's a decline, Start_Error_Banking will be caught
  print('Status is:' . $e-&gt;getHttpStatus() . "\n");
  print('Code is:' . $e-&gt;getErrorCode() . "\n");
  print('Message is:' . $e-&gt;getMessage() . "\n");

} catch (Start_Error_Request $e) {
  // Invalid parameters were supplied to Start's API

} catch (Start_Error_Authentication $e) {
  // Invalid API key

} catch (Start_Error_Processing $e) {
  // Something wrong on Start's end

} catch (Start_Error $e) {
  // Display a very generic error to the user, and maybe send
  // yourself an email

} catch (Exception $e) {
  // Something else happened, completely unrelated to Start

}
?&gt;
</code></pre>

<p>In above code I used print_r() and exit to print variable details but I got error like:</p>

<pre><code>&lt;b&gt;Fatal error&lt;/b&gt;:  Uncaught exception 'Start_Error_Authentication' with message 'Request can only be authenticated with an open API Key.'
</code></pre>

<p>Please help me to resolve this problem.
Thanks in advance for your attention.</p>