|
@@ -75,16 +75,16 @@ class BaseClient
|
|
|
if ($endpoint=='papay/deletecontract'){
|
|
|
unset($base['nonce_str']);
|
|
|
}
|
|
|
- @file_put_contents("quanju.txt", $endpoint . "-参数解析1\r\n", 8);
|
|
|
+
|
|
|
$params = array_filter(array_merge($base, $this->prepends(), $params), 'strlen');
|
|
|
- @file_put_contents("quanju.txt", json_encode($params) . "-参数解析2\r\n", 8);
|
|
|
+
|
|
|
$secretKey = $this->app->getKey($endpoint);
|
|
|
- @file_put_contents("quanju.txt", $secretKey . "-参数解析3\r\n", 8);
|
|
|
+
|
|
|
$encryptMethod = Support\get_encrypt_method(Support\Arr::get($params, 'sign_type', 'MD5'), $secretKey);
|
|
|
- @file_put_contents("quanju.txt", $encryptMethod . "-参数解析4\r\n", 8);
|
|
|
+
|
|
|
$params['sign'] = Support\generate_sign($params, $secretKey, $encryptMethod);
|
|
|
- @file_put_contents("quanju.txt", $params['sign'] . "-参数解析5\r\n", 8);
|
|
|
- @file_put_contents("quanju.txt", json_encode($params) . "-参数解析6\r\n", 8);
|
|
|
+
|
|
|
+
|
|
|
$options = array_merge([
|
|
|
'body' => Support\XML::build($params),
|
|
|
], $options);
|
|
@@ -92,8 +92,8 @@ class BaseClient
|
|
|
$this->pushMiddleware($this->logMiddleware(), 'log');
|
|
|
|
|
|
$response = $this->performRequest($endpoint, $method, $options);
|
|
|
- @file_put_contents("quanju.txt", json_encode($response) . "-参数解析7\r\n", 8);
|
|
|
- @file_put_contents("quanju.txt", $this->app->config->get('response_type') . "-参数解析8\r\n", 8);
|
|
|
+
|
|
|
+
|
|
|
return $returnResponse ? $response : $this->castResponseToType($response, $this->app->config->get('response_type'));
|
|
|
}
|
|
|
|