protected function buildData()
    {
        $bizContent = $this->getBizContent();
        $bizContent = ArrayUtil::paraFilter($bizContent);// 过滤掉空值，下面不用在检查是否为空

        $signData = [
            // 公共参数
            'app_id'        => $this->appId,
            'method'        => $this->method,
            'format'        => $this->format,
            'charset'       => $this->charset,
            'sign_type'     => $this->signType,
            'timestamp'     => $this->timestamp,
            'version'       => $this->version,
            'notify_url'    => $this->notifyUrl,

            // 业务参数
            'biz_content'   => json_encode($bizContent, JSON_UNESCAPED_UNICODE),
        ];

        // 电脑支付  wap支付添加额外参数
        if (in_array($this->method, ['alipay.trade.page.pay', 'alipay.trade.wap.pay'])) {
            $signData['return_url'] = $this->returnUrl;
        }

        // 移除数组中的空值
        $this->retData = ArrayUtil::paraFilter($signData);
    }
protected function buildData()
    {
        $bizContent = $this->getBizContent();
        $bizContent = ArrayUtil::paraFilter($bizContent);

        $signData = [
            
            'app_id'        => $this->appId,
            'method'        => $this->method,
            'format'        => $this->format,
            'charset'       => $this->charset,
            'sign_type'     => $this->signType,
            'timestamp'     => $this->timestamp,
            'version'       => $this->version,
            'notify_url'    => $this->notifyUrl,

            
            'biz_content'   => json_encode($bizContent, JSON_UNESCAPED_UNICODE),
        ];

        
        if (in_array($this->method, ['alipay.trade.page.pay', 'alipay.trade.wap.pay'])) {
            $signData['return_url'] = $this->returnUrl;
        }

        
        $this->retData = ArrayUtil::paraFilter($signData);
    }
protected function buildData ( ) { $ bizContent = $ this -> getBizContent ( ) ; $ bizContent = ArrayUtil :: paraFilter ( $ bizContent ) ; // 过滤掉空值，下面不用在检查是否为空 $ signData = [ // 公共参数 'app_id' => $ this -> appId , 'method' => $ this -> method , 'format' => $ this -> format , 'charset' => $ this -> charset , 'sign_type' => $ this -> signType , 'timestamp' => $ this -> timestamp , 'version' => $ this -> version , 'notify_url' => $ this -> notifyUrl , // 业务参数 'biz_content' => json_encode ( $ bizContent , JSON_UNESCAPED_UNICODE ) , ] ; // 电脑支付  wap支付添加额外参数 if ( in_array ( $ this -> method , [ 'alipay.trade.page.pay' , 'alipay.trade.wap.pay' ] ) ) { $ signData [ 'return_url' ] = $ this -> returnUrl ; } // 移除数组中的空值 $ this -> retData = ArrayUtil :: paraFilter ( $ signData ) ; }
构建 支付 加密数据
@author helei
构建 支付 加密数据