public function sendRequest($biz_content) { $custom_send = new AlipayMobilePublicMessageCustomSendRequest(); $custom_send->setBizContent($biz_content); require FUWU_PATH . 'config.php'; $aop = new AopClient(); $aop->appId = FUWU_APPID; $aop->rsaPrivateKeyFilePath = $config['merchant_private_key_file']; $result = $aop->execute($custom_send); return $result; }
public function getAlipayMobilePublicMessagePushRequest($bizcontent) { $c = new AopClient(); $c->appId = self::appId; $c->rsaPrivateKeyFilePath = dirname(__FILE__) . self::rsaPrivateKeyFilePath; $c->format = 'json'; $req = new AlipayMobilePublicMessagePushRequest(); $req->setBizContent($bizcontent); $resp = $c->execute($req); return $resp; }
/** * 使用SDK执行接口请求 * @param unknown $request * @param string $token * @return Ambigous <boolean, mixed> */ function aopclient_request_execute($request, $token = NULL) { require 'config.php'; $aop = new AopClient(); $aop->gatewayUrl = $config['gatewayUrl']; $aop->appId = $config['app_id']; $aop->rsaPrivateKeyFilePath = $config['merchant_private_key_file']; $aop->apiVersion = "1.0"; $result = $aop->execute($request, $token); writeLog("response: " . var_export($result, true)); return $result; }