/** * 使用SDK执行接口请求 * @param unknown $request * @param string $token * @return Ambigous <boolean, mixed> */ function aopclient_request_execute($request, $token = NULL) { $config = (require 'alipay.openapi.config.php'); $aop = new Client($config); $result = $aop->execute($request, $token); // writeLog("response: ".var_export($result,true)); return $result; }
<?php namespace Tests; require "TestCase.php"; /** * Created by PhpStorm. * User: wu * Date: 2016/2/29 * Time: 15:18 */ use Alipay\OpenApi\Client; echo "test log?"; $client = new Client([]); $client->logCommunicationError('what', 'asd', '404', 'I don\'t know');