$app = Factory::officialAccount([
'app_id' => config('app_id'),
'secret' => config('secret')
]);
$this->card = $app->card;
获取 tTicket
public function getTicket() {
$ret = $this->card->httpGet('/cgi-bin/ticket/getticket', ['type'=>"wx_card"]);
return $ret;
}
/**
* 卡券签名
*
* 2018/6/13
*
* @author XiaoBing <xiaobingby@qq.com>
*/
public function cardSignature($card_id, $api_ticket) {
$time = time();
$nonce_str = time()+1;
$data = array($time, $nonce_str, $card_id, $api_ticket);
asort($data, SORT_STRING); // 排序
$key = implode($data); // 加密
$signature = sha1($key);
return ['signature'=>$signature, 'timestamp'=>$time, 'nonce_str'=>$nonce_str, 'card_id'=>$card_id, 'api_ticket'=>$api_ticket];}
使用了 https://www.easywechat.com SDK
你好,请具体描述问题,是想要解决什么问题呢?
小程序可以使用商户创建的代金券 并将其添加到卡包里面吗。急需答案啊
请问这个问题你解决了嘛
没有,是不可以添加的,只能添加公众号创建的卡劵