Skip to content

Instantly share code, notes, and snippets.

@ak4bento
Last active January 27, 2020 08:42
Show Gist options
  • Save ak4bento/5b9073e61a7ac049403b5bcef01cf30a to your computer and use it in GitHub Desktop.
Save ak4bento/5b9073e61a7ac049403b5bcef01cf30a to your computer and use it in GitHub Desktop.
public function index(){
$HTTPMethod = 'GET';
$RelativeUrl = '/banking/v3/corporates/h2hauto008/accounts/0613006572/statements?EndDate=2020-01-21&StartDate=2020-01-15';
$AccessToken = $_GET['token'];
$Timestamp = '2020-01-23T13:11:00.000+07:00';
$RequestBody = '';
$StringToSign =
$HTTPMethod .":" .
$RelativeUrl .":" .
$AccessToken .":" .
strtolower(hash('sha256',$RequestBody)) .":" .
$Timestamp;
$hash = hash_hmac ('sha256', $StringToSign, '5e636b16-df7f-4a53-afbe-497e6fe07edc');
return array(
'hash_hmac' => $hash,
'Stringtosign' => $StringToSign
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment