コード例 #1
0
 /**
  * 退款查询
  * @throws WxPayException
  */
 public function actionRefundQuery()
 {
     $refundQuery = null;
     // 优先级别从上到下
     if (isset($_REQUEST["transaction_id"]) && $_REQUEST["transaction_id"] != "") {
         $transaction_id = $_REQUEST["transaction_id"];
         $input = new WxPayRefundQuery();
         $input->SetTransaction_id($transaction_id);
         $refundQuery = WxPayApi::refundQuery($input);
     }
     if (isset($_REQUEST["out_trade_no"]) && $_REQUEST["out_trade_no"] != "") {
         $out_trade_no = $_REQUEST["out_trade_no"];
         $input = new WxPayRefundQuery();
         $input->SetOut_trade_no($out_trade_no);
         $refundQuery = WxPayApi::refundQuery($input);
     }
     if (isset($_REQUEST["out_refund_no"]) && $_REQUEST["out_refund_no"] != "") {
         $out_refund_no = $_REQUEST["out_refund_no"];
         $input = new WxPayRefundQuery();
         $input->SetOut_refund_no($out_refund_no);
         $refundQuery = WxPayApi::refundQuery($input);
     }
     if (isset($_REQUEST["refund_id"]) && $_REQUEST["refund_id"] != "") {
         $refund_id = $_REQUEST["refund_id"];
         $input = new WxPayRefundQuery();
         $input->SetRefund_id($refund_id);
         $refundQuery = WxPayApi::refundQuery($input);
     }
     echo json_encode($refundQuery);
 }