16 lines
368 B
PHP
16 lines
368 B
PHP
<?php
|
|
|
|
function get_api_credentials() {
|
|
$key_file = __DIR__ . '/../.keys/api_credentials.json';
|
|
if (!file_exists($key_file)) {
|
|
return null;
|
|
}
|
|
$creds_json = file_get_contents($key_file);
|
|
return json_decode($creds_json, true);
|
|
}
|
|
|
|
function sign_request($secret, $payload) {
|
|
return hash_hmac('sha256', json_encode($payload), $secret);
|
|
}
|
|
|
|
?>
|