src/Gateways/Wechat.php
public function download(array $params): string
    {
        unset($this->payload['spbill_create_ip']);

        $this->payload = Support::filterPayload($this->payload, $params, true);

        Events::dispatch(Events::METHOD_CALLED, new Events\MethodCalled('Wechat', 'Download', $this->gateway, $this->payload));

        $result = Support::getInstance()->post(
            'pay/downloadbill',
            Support::getInstance()->toXml($this->payload)
        );

        if (is_array($result)) {
            throw new GatewayException('Get Wechat API Error: '.$result['return_msg'], $result);
        }

        return $result;
    }
public function download(array $params): string
    {
        unset($this->payload['spbill_create_ip']);

        $this->payload = Support::filterPayload($this->payload, $params, true);

        Events::dispatch(Events::METHOD_CALLED, new Events\MethodCalled('Wechat', 'Download', $this->gateway, $this->payload));

        $result = Support::getInstance()->post(
            'pay/downloadbill',
            Support::getInstance()->toXml($this->payload)
        );

        if (is_array($result)) {
            throw new GatewayException('Get Wechat API Error: '.$result['return_msg'], $result);
        }

        return $result;
    }
public function download ( array $ params ) : string { unset ( $ this -> payload [ 'spbill_create_ip' ] ) ; $ this -> payload = Support :: filterPayload ( $ this -> payload , $ params , true ) ; Events :: dispatch ( Events :: METHOD_CALLED , new Events \ MethodCalled ( 'Wechat' , 'Download' , $ this -> gateway , $ this -> payload ) ) ; $ result = Support :: getInstance ( ) -> post ( 'pay/downloadbill' , Support :: getInstance ( ) -> toXml ( $ this -> payload ) ) ; if ( is_array ( $ result ) ) { throw new GatewayException ( 'Get Wechat API Error: ' . $ result [ 'return_msg' ] , $ result ) ; } return $ result ; }
Download the bill.

@author yansongda <me@yansongda.cn>

@param array $params

@throws GatewayException
@throws InvalidArgumentException

@return string
Download the bill .