Exemplo n.º 1
0
Arquivo: msg.php Projeto: qujian/ydwx
 protected function formatArgs()
 {
     $args = parent::formatArgs();
     $args['touser'] = $args['to'];
     unset($args['to']);
     return $args;
 }
Exemplo n.º 2
0
Arquivo: card.php Projeto: qujian/ydwx
    die;
}
if ($action == "chooseCard") {
    $shopId = $_POST['shopId'];
    $cardType = $_POST['cardType'];
    $cardId = $_POST['cardId'];
    $appid = $_POST['appid'];
    $nonceStr = uniqid();
    $time = time();
    if (YDWX_WEIXIN_COMPONENT_APP_ID) {
        $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_HOST_CARD_JSAPI_TICKET, $appid);
    } else {
        $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_CARD_JSAPI_TICKET);
    }
    $array = array($nonceStr, $card_jsapi_ticket, $time, $shopId, $cardType, $cardId);
    $array = YDWXRequest::ignoreNull($array);
    sort($array);
    $cardSignStr = sha1(join("", $array));
    echo json_encode(ydwx_success(array("shopId" => $shopId, "cardType" => $cardType, "cardId" => $cardId, "nonceStr" => $nonceStr, "time" => $time, "cardSign" => $cardSignStr)));
    die;
}
if ($action == "addCard") {
    $exts = $_POST['exts'];
    $appid = $_POST['appid'];
    if (YDWX_WEIXIN_COMPONENT_APP_ID) {
        $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_HOST_CARD_JSAPI_TICKET, $appid);
    } else {
        $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_CARD_JSAPI_TICKET);
    }
    $array = array();
    foreach ($exts as $ext) {
Exemplo n.º 3
0
Arquivo: zb.php Projeto: qujian/ydwx
 protected function formatArgs()
 {
     $args = parent::formatArgs();
     if (@$args['page_id']) {
         $args['page_id'] = intval($args['page_id']);
     }
     return $args;
 }
Exemplo n.º 4
0
 /**
  * 构建自己的数据结构,默认实现是把所有的非null属性组成数组返回
  * @return multitype:
  */
 protected function formatArgs()
 {
     return YDWXRequest::ignoreNull(get_object_vars($this));
 }
Exemplo n.º 5
0
Arquivo: poi.php Projeto: qujian/ydwx
 protected function formatArgs()
 {
     $args = YDWXRequest::ignoreNull(parent::formatArgs());
     $array = array();
     $args['categories'] = (array) $this->categories;
     $photos = array();
     foreach ((array) $this->photo_list as $photo) {
         $photos[] = array("photo_url" => $photo);
     }
     $args['photo_list'] = $photos;
     $array['business']['base_info'] = $args;
     return $array;
 }
Exemplo n.º 6
0
Arquivo: pay.php Projeto: qujian/ydwx
 public function sign()
 {
     //$long_url 签名用原串,传输需URLencode
     $this->valid();
     $args = YDWXRequest::ignoreNull($this->sortArg());
     $args['long_url'] = urldecode($args['long_url']);
     $str = http_build_query($args);
     $this->sign = strtoupper(md5(urldecode($str) . "&key=" . $this->mch_key));
 }
Exemplo n.º 7
0
 protected function formatArgs()
 {
     if (!$this->nonce_str) {
         $this->nonce_str = uniqid();
     }
     $args = parent::formatArgs();
     $args['total_num'] = 1;
     $args['total_amount'] = intval($args['total_amount']);
     unset($args['mch_key']);
     return $args;
 }
Exemplo n.º 8
0
Arquivo: card.php Projeto: qujian/ydwx
 protected function formatArgs()
 {
     $args = parent::formatArgs();
     return $args;
 }