<?php
 namespace Payment\Common\Weixin\Data\Query; use Payment\Common\PayException; use Payment\Common\Weixin\Data\WxBaseData; use Payment\Utils\ArrayUtil; class ChargeQueryData extends WxBaseData { protected function buildData() { $this->retData = [ 'appid' => $this->appId, 'mch_id' => $this->mchId, 'nonce_str' => $this->nonceStr, 'sign_type' => $this->signType, 'transaction_id' => $this->transaction_id, 'out_trade_no' => $this->out_trade_no, 'sub_appid' => $this->sub_appid, 'sub_mch_id' => $this->sub_mch_id, ]; $this->retData = ArrayUtil::paraFilter($this->retData); } protected function checkDataParam() { $transaction_id = $this->transaction_id; $order_no = $this->out_trade_no; if (empty($transaction_id) && empty($order_no)) { throw new PayException('必须提供微信交易号或商户网站唯一订单号。建议使用微信交易号'); } } } 