Skip to content

Commit cba2049

Browse files
authored
Merge pull request #5 from q326066766/patch-1
Update WechatCard.php
2 parents df1efc8 + 8fde212 commit cba2049

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

Wechat/WechatCard.php

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ class WechatCard extends Common {
4242
const CARD_BOARDINGPASS_CHECKIN = '/card/boardingpass/checkin?'; //飞机票-在线选座(未加方法)
4343
/** 更新红包金额 */
4444
const CARD_LUCKYMONEY_UPDATE = '/card/luckymoney/updateuserbalance?';
45-
45+
/*买单接口*/
46+
const CARD_PAYCELL_SET = '/card/paycell/set?';
47+
/*设置开卡字段接口*/
48+
const CARD_MEMBERCARD_ACTIVATEUSERFORM_SET = '/card/membercard/activateuserform/set?';
4649
/**
4750
* 获取微信卡券 api_ticket
4851
* @param string $appid
@@ -719,5 +722,53 @@ public function setSelfconsumecell($card_id, $is_openid = false, $need_verify_co
719722
}
720723
return false;
721724
}
725+
/**
726+
* 设置买单接口
727+
* @DateTime 2016-12-02T19:19:45+0800
728+
* @param [type] $card_id [description]
729+
* @param boolean $is_openid [description]
730+
*/
731+
public function setPaycell($card_id,$is_openid = true){
732+
if (!$this->access_token && !$this->getAccessToken()) {
733+
return false;
734+
}
735+
$data = array(
736+
'card_id' => $card_id,
737+
'is_open' => $is_openid,
738+
);
739+
$result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_PAYCELL_SET . "access_token={$this->access_token}", Tools::json_encode($data));
740+
if ($result) {
741+
$json = json_decode($result, true);
742+
if (!$json || !empty($json['errcode'])) {
743+
$this->errCode = $json['errcode'];
744+
$this->errMsg = $json['errmsg'];
745+
return $this->checkRetry(__FUNCTION__, func_get_args());
746+
}
747+
return $json;
748+
}
749+
return false;
750+
}
751+
752+
/**
753+
* 设置开卡字段信息接口
754+
* @DateTime 2016-12-02T20:31:43+0800
755+
* @param [type] $data [description]
756+
*/
757+
public function setMembercardActivateuserform($data){
758+
if (!$this->access_token && !$this->getAccessToken()) {
759+
return false;
760+
}
761+
$result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATEUSERFORM_SET . "access_token={$this->access_token}", Tools::json_encode($data));
762+
if ($result) {
763+
$json = json_decode($result, true);
764+
if (!$json || !empty($json['errcode'])) {
765+
$this->errCode = $json['errcode'];
766+
$this->errMsg = $json['errmsg'];
767+
return $this->checkRetry(__FUNCTION__, func_get_args());
768+
}
769+
return $json;
770+
}
771+
return false;
772+
}
722773

723774
}

0 commit comments

Comments
 (0)