src/Common/Weixin/Data/Charge/BarChargeData.php
protected function buildData()
    {
        $info = $this->scene_info;
        $sceneInfo = [];
        if ($info && is_array($info)) {
            $sceneInfo['store_info'] = $info;
        }

        $signData = [
            'appid' => trim($this->appId),
            'mch_id'    => trim($this->mchId),
            'device_info'   => $this->terminal_id,
            'nonce_str' => $this->nonceStr,
            'sign_type' => $this->signType,
            'body'  => trim($this->subject),
            //'detail' => json_encode($this->body, JSON_UNESCAPED_UNICODE),
            'attach'    => trim($this->return_param),
            'out_trade_no'  => trim($this->order_no),
            'total_fee' => $this->amount,
            'fee_type'  => $this->feeType,
            'spbill_create_ip'  => trim($this->client_ip),
            //'goods_tag' => '订单优惠标记',
            'limit_pay' => $this->limitPay,  // 指定不使用信用卡
            'auth_code'    => $this->auth_code,
            'scene_info' => $sceneInfo ? json_encode($sceneInfo, JSON_UNESCAPED_UNICODE) : '',

            // 服务商
            'sub_appid' => $this->sub_appid,
            'sub_mch_id' => $this->sub_mch_id,
        ];

        // 移除数组中的空值
        $this->retData = ArrayUtil::paraFilter($signData);
    }
protected function buildData()
    {
        $info = $this->scene_info;
        $sceneInfo = [];
        if ($info && is_array($info)) {
            $sceneInfo['store_info'] = $info;
        }

        $signData = [
            'appid' => trim($this->appId),
            'mch_id'    => trim($this->mchId),
            'device_info'   => $this->terminal_id,
            'nonce_str' => $this->nonceStr,
            'sign_type' => $this->signType,
            'body'  => trim($this->subject),
            //'detail' => json_encode($this->body, JSON_UNESCAPED_UNICODE),
            'attach'    => trim($this->return_param),
            'out_trade_no'  => trim($this->order_no),
            'total_fee' => $this->amount,
            'fee_type'  => $this->feeType,
            'spbill_create_ip'  => trim($this->client_ip),
            //'goods_tag' => '订单优惠标记',
            'limit_pay' => $this->limitPay,  // 指定不使用信用卡
            'auth_code'    => $this->auth_code,
            'scene_info' => $sceneInfo ? json_encode($sceneInfo, JSON_UNESCAPED_UNICODE) : '',

            // 服务商
            'sub_appid' => $this->sub_appid,
            'sub_mch_id' => $this->sub_mch_id,
        ];

        // 移除数组中的空值
        $this->retData = ArrayUtil::paraFilter($signData);
    }
protected function buildData ( ) { $ info = $ this -> scene_info ; $ sceneInfo = [ ] ; if ( $ info && is_array ( $ info ) ) { $ sceneInfo [ 'store_info' ] = $ info ; } $ signData = [ 'appid' => trim ( $ this -> appId ) , 'mch_id' => trim ( $ this -> mchId ) , 'device_info' => $ this -> terminal_id , 'nonce_str' => $ this -> nonceStr , 'sign_type' => $ this -> signType , 'body' => trim ( $ this -> subject ) , //'detail' => json_encode($this->body, JSON_UNESCAPED_UNICODE), 'attach' => trim ( $ this -> return_param ) , 'out_trade_no' => trim ( $ this -> order_no ) , 'total_fee' => $ this -> amount , 'fee_type' => $ this -> feeType , 'spbill_create_ip' => trim ( $ this -> client_ip ) , //'goods_tag' => '订单优惠标记', 'limit_pay' => $ this -> limitPay , // 指定不使用信用卡 'auth_code' => $ this -> auth_code , 'scene_info' => $ sceneInfo ? json_encode ( $ sceneInfo , JSON_UNESCAPED_UNICODE ) : '' , // 服务商 'sub_appid' => $ this -> sub_appid , 'sub_mch_id' => $ this -> sub_mch_id , ] ; // 移除数组中的空值 $ this -> retData = ArrayUtil :: paraFilter ( $ signData ) ; }
生成下单的数据
生成下单的数据