Commit 927a9718 authored by hangjun83's avatar hangjun83

财务开票模块更新

parent 1eb3d587
...@@ -212,11 +212,16 @@ class BaiwangApiService extends PlatformAbstractService ...@@ -212,11 +212,16 @@ class BaiwangApiService extends PlatformAbstractService
'host' => $host, 'host' => $host,
'x-htjs-nonce' => $nonce, 'x-htjs-nonce' => $nonce,
'x-htjs-ua' => $ua, 'x-htjs-ua' => $ua,
'Authorization' => 'hmac username="'.$key.'", algorithm="hmac-sha256", headers="request-line date host x-htjs-nonce x-htjs-ua", signature="'.urlencode($signature).'"' 'Authorization' => 'hmac username="'.$key.'", algorithm="hmac-sha256", headers="request-line date host x-htjs-nonce x-htjs-ua", signature="'.$this->base64UrlEncode($signature).'"'
]; ];
} }
private function base64UrlEncode($str)
{
return rtrim(strtr(base64_encode($str), "+/", "-_"), "=");
}
private function uuid() private function uuid()
{ {
$chars = md5(uniqid(mt_rand(), true)); $chars = md5(uniqid(mt_rand(), true));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment