I am using XERO API to integrate with my project, while authentication i am using consumer_key, consumer_secret, rsa_private_key, rsa_public_key to authenticate with xero account, i was generate rsa_private_key and rsa_public_key and placed in storage/app/certificates directory while fetching these keys i am using file_get_contents function to get the keys but facing the error file_get_contents(): Filename cannot be empty, how can i resolve this?
My File paths
Xero.php
private static function get_config(){
return $config = [
'oauth' => [
'callback' => '',
'consumer_key' => config('constants.XERO_CONSUMER_KEY'),
'consumer_secret' => config('constants.XERO_CONSUMER_SECRET'),
'rsa_private_key' => file_get_contents(config('constants.XERO_PRIVATE_KEY_CERTIFICATE_FILE_PATH')),
'rsa_public_key' => file_get_contents(config('constants.XERO_PUBLIC_KEY_CERTIFICATE_FILE_PATH')),
],
];
}
config/constants/dev_constants.php
<?php
$xero_constants = [
"XERO_CONSUMER_KEY" => "***",
"XERO_CONSUMER_SECRET" => "***",
"XERO_PRIVATE_KEY_CERTIFICATE_FILE_PATH" => dirname(__FILE__,3)."/storage/app/certificates/privatekey.pem",
"XERO_PUBLIC_KEY_CERTIFICATE_FILE_PATH" => dirname(__FILE__,3)."/storage/app/certificates/publickey.cer",
];
?>