|
|
@ -187,6 +187,23 @@ class AppClient extends BaseClient |
|
|
|
return new Collection($content); |
|
|
|
return new Collection($content); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @param AppRequest $request |
|
|
|
|
|
|
|
* @return string |
|
|
|
|
|
|
|
* @throws InvalidConfigException |
|
|
|
|
|
|
|
* @throws \Exception |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function sdkExecute(AppRequest $request) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->setupCharsets($request); |
|
|
|
|
|
|
|
$sysParams = $this->buildParams($request); |
|
|
|
|
|
|
|
$apiParams = $request->getApiParas(); |
|
|
|
|
|
|
|
$sysParams = array_merge($sysParams, $apiParams); |
|
|
|
|
|
|
|
ksort($sysParams); |
|
|
|
|
|
|
|
$sysParams["sign"] = $this->generateSign($sysParams, $this->signType); |
|
|
|
|
|
|
|
return http_build_query($sysParams); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param AppRequest $request |
|
|
|
* @param AppRequest $request |
|
|
|
* @return array |
|
|
|
* @return array |
|
|
@ -206,12 +223,17 @@ class AppClient extends BaseClient |
|
|
|
$sysParams["method"] = $request->getApiMethodName(); |
|
|
|
$sysParams["method"] = $request->getApiMethodName(); |
|
|
|
$sysParams["timestamp"] = date("Y-m-d H:i:s"); |
|
|
|
$sysParams["timestamp"] = date("Y-m-d H:i:s"); |
|
|
|
$sysParams["alipay_sdk"] = $this->alipaySdkVersion; |
|
|
|
$sysParams["alipay_sdk"] = $this->alipaySdkVersion; |
|
|
|
|
|
|
|
if ($request->getTerminalType()) { |
|
|
|
$sysParams["terminal_type"] = $request->getTerminalType(); |
|
|
|
$sysParams["terminal_type"] = $request->getTerminalType(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($request->getTerminalInfo()) { |
|
|
|
$sysParams["terminal_info"] = $request->getTerminalInfo(); |
|
|
|
$sysParams["terminal_info"] = $request->getTerminalInfo(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($request->getProdCode()) { |
|
|
|
$sysParams["prod_code"] = $request->getProdCode(); |
|
|
|
$sysParams["prod_code"] = $request->getProdCode(); |
|
|
|
|
|
|
|
} |
|
|
|
$sysParams["notify_url"] = $request->getNotifyUrl(); |
|
|
|
$sysParams["notify_url"] = $request->getNotifyUrl(); |
|
|
|
$sysParams["charset"] = $this->postCharset; |
|
|
|
$sysParams["charset"] = $this->postCharset; |
|
|
|
|
|
|
|
|
|
|
|
if (isset($this->config['auth_token'])) { |
|
|
|
if (isset($this->config['auth_token'])) { |
|
|
|
$sysParams["auth_token"] = $this->config['auth_token']; |
|
|
|
$sysParams["auth_token"] = $this->config['auth_token']; |
|
|
|
} |
|
|
|
} |
|
|
|