//array(1) { ["url"]=> string(121) "http://mmbiz.qpic.cn/mmbiz/ibuYxPHqeXePNTW4ATKyias1Cf3zTKiars9PFPzF1k5icvXD7xW0kXUAxHDzkEPd9micCMCN0dcTJfW6Tnm93MiaAfRQ/0" }
}
/*******************************************************
* 微信卡券:获取颜色
*******************************************************/
public function wxCardColor(){
$wxAccessToken = $this->wxAccessToken();
$url = "https://api.weixin.qq.com/card/getcolors?access_token=".$wxAccessToken;
$result = $this->wxHttpsRequest($url);
$jsoninfo = json_decode($result, true);
return $jsoninfo;
}
/*******************************************************
* 微信卡券:创建卡券
*******************************************************/
public function wxCardCreated($jsonData) {
$wxAccessToken = $this->wxAccessToken();
$url = "https://api.weixin.qq.com/card/create?access_token=" . $wxAccessToken;
$result = $this->wxHttpsRequest($url,$jsonData);
$jsoninfo = json_decode($result, true);
return $jsoninfo;
}
/*******************************************************
* 微信卡券:JSAPI 卡券Package - 基础参数没有附带任何值 - 再生产环境中需要根据实际情况进行修改
*******************************************************/
public function wxCardPackage($cardId){
$timestamp = time();
$api_ticket = $this->wxJsApiTicket();
$cardId = $cardId;
$arrays = array($api_ticket,$timestamp,$cardId);
sort($arrays);
$string = sha1(implode("",$arrays));
$resultArray['card_id'] = $cardId;
$resultArray['card_ext'] = array();
$resultArray['card_ext']['openid'] = 'oOmn4s9MiwqHSNNvPn0dBtU23toA';
$resultArray['card_ext']['timestamp'] = $timestamp;
$resultArray['card_ext']['signature'] = $string;
return $resultArray;
}
}
4. [代码]微信JSAPI
<?php
require_once 'lib.inc.php';
$wx = new WxApi();
//通过网页获取openid
//if(!isset($_GET['code'])){