src/Message/QueryRefundRequest.php
public function getData()
    {
        $this->validate('app_id', 'mch_id');

        $queryIdEmpty = ! $this->getTransactionId() && ! $this->getOutTradeNo();
        $queryIdEmpty = ($queryIdEmpty && ! $this->getOutRefundNo() && ! $this->getRefundId());

        if ($queryIdEmpty) {
            $message = "The 'transaction_id' or 'out_trade_no' or 'out_refund_no' or 'refund_id' parameter is required";
            throw new InvalidRequestException($message);
        }

        $data = array(
            'appid'          => $this->getAppId(),
            'mch_id'         => $this->getMchId(),
            'sub_appid'      => $this->getSubAppId(),
            'sub_mch_id'     => $this->getSubMchId(),
            'device_info'    => $this->getDeviceInfo(),
            'transaction_id' => $this->getTransactionId(),
            'out_trade_no'   => $this->getOutTradeNo(),
            'out_refund_no'  => $this->getOutRefundNo(),
            'refund_id'      => $this->getRefundId(),
            'nonce_str'      => md5(uniqid()),
        );

        $data = array_filter($data);

        $data['sign'] = Helper::sign($data, $this->getApiKey());

        return $data;
    }
public function getData()
    {
        $this->validate('app_id', 'mch_id');

        $queryIdEmpty = ! $this->getTransactionId() && ! $this->getOutTradeNo();
        $queryIdEmpty = ($queryIdEmpty && ! $this->getOutRefundNo() && ! $this->getRefundId());

        if ($queryIdEmpty) {
            $message = "The 'transaction_id' or 'out_trade_no' or 'out_refund_no' or 'refund_id' parameter is required";
            throw new InvalidRequestException($message);
        }

        $data = array(
            'appid'          => $this->getAppId(),
            'mch_id'         => $this->getMchId(),
            'sub_appid'      => $this->getSubAppId(),
            'sub_mch_id'     => $this->getSubMchId(),
            'device_info'    => $this->getDeviceInfo(),
            'transaction_id' => $this->getTransactionId(),
            'out_trade_no'   => $this->getOutTradeNo(),
            'out_refund_no'  => $this->getOutRefundNo(),
            'refund_id'      => $this->getRefundId(),
            'nonce_str'      => md5(uniqid()),
        );

        $data = array_filter($data);

        $data['sign'] = Helper::sign($data, $this->getApiKey());

        return $data;
    }
Get the raw data array for this message. The format of this varies from gateway to
gateway, but will usually be either an associative array, or a SimpleXMLElement.
@return mixed
@throws InvalidRequestException