|
|
@@ -441,7 +441,7 @@ class API extends AbstractAPI
|
|
|
*
|
|
|
* @return \EasyWeChat\Support\Collection|\Psr\Http\Message\ResponseInterface
|
|
|
*/
|
|
|
- protected function request($api, array $params, $method = 'post', array $options = [], $returnResponse = false)
|
|
|
+ protected function request($api, array $params, $method = 'post', array $options = [], $returnResponse = false, $sign_type = 'md5')
|
|
|
{
|
|
|
$params = array_merge($params, $this->merchant->only(['sub_appid', 'sub_mch_id']));
|
|
|
|
|
|
@@ -451,7 +451,7 @@ class API extends AbstractAPI
|
|
|
$params['nonce_str'] = uniqid();
|
|
|
$params = array_filter($params);
|
|
|
|
|
|
- $params['sign'] = generate_sign($params, $this->getSignkey($api), 'md5');
|
|
|
+ $params['sign'] = generate_sign($params, $this->getSignkey($api), $sign_type);
|
|
|
|
|
|
$options = array_merge([
|
|
|
'body' => XML::build($params),
|
|
|
@@ -483,14 +483,14 @@ class API extends AbstractAPI
|
|
|
*
|
|
|
* @return \EasyWeChat\Support\Collection
|
|
|
*/
|
|
|
- protected function safeRequest($api, array $params, $method = 'post')
|
|
|
+ protected function safeRequest($api, array $params, $method = 'post', $sign_type = 'md5')
|
|
|
{
|
|
|
$options = [
|
|
|
'cert' => $this->merchant->get('cert_path'),
|
|
|
'ssl_key' => $this->merchant->get('key_path'),
|
|
|
];
|
|
|
|
|
|
- return $this->request($api, $params, $method, $options);
|
|
|
+ return $this->request($api, $params, $method, $options,false, $sign_type);
|
|
|
}
|
|
|
|
|
|
/**
|