Payfort 지불 Api를 구현하기 위해 (https://docs.start.payfort.com/references/api/) 설명서를 따르고 있지만 문제점을 직면하고 있습니다.이 문제를 해결할 수있는 사람이 있습니까?PHP에서 payfort api를 통합 할 때 문제가 발생합니다
내가 API의 코드 아래 사용하고 있습니다 :
<?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" => "4242424242424242",
"exp_month" => 06,
"exp_year" => 2018,
"cvc" => "123",
"name" => "Abdullah Mohammed"
));
echo "<pre>"; print_r($token); exit;
$result = Start_Charge::create(array(
"amount" => 1000,
"currency" => "aed",
"metadata" => array(
"reference_id" => "1234567890",
"tag" => "new"
),
"card" => array(
"name" => "Abdullah Ahmed",
"number" => "4242424242424242",
"exp_month" => 06,
"exp_year" => 2018,
"cvc" => "123"
),
"description" => "Two widgets ([email protected])",
"email" => "[email protected]"
));
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->getHttpStatus() . "\n");
print('Code is:' . $e->getErrorCode() . "\n");
print('Message is:' . $e->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
}
?>
을 위의 코드에서 나는 변수 세부 사항을 인쇄 인 print_r() 종료를 사용하지만 같은 오류가 발생했습니다 :
<b>Fatal error</b>: Uncaught exception 'Start_Error_Authentication' with message 'Request can only be authenticated with an open API Key.'
에 제발 도와주세요 이 문제를 해결하십시오. 미리 알려 주셔서 감사합니다.