/** * 发起hpp请求流程,加密解密 * @param $url * @param BaseApiRequest $requestObj * @param $timeout * @return mixed * @throws ServiceException */ private static function makeHppRequest($url, BaseApiRequest $requestObj, $timeout) { //AES加密 $encrypted = AesUtils::encrypt($requestObj->toJsonString(), Config::SIGN_TOKEN); //响应,解密 $rawResp = self::postBodyRequest($url, $encrypted, ["X-mt-sno: " . Config::X_MT_SNO, 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'], $timeout); $responseObj = json_decode(AesUtils::decrypt($rawResp, Config::SIGN_TOKEN), true); return $responseObj; }