orderPay = $orderPay; } /** * @throws AppException */ public function handle() { $result = $this->orderPay->fastRefund(); if ($result['status']) { $this->message[]="{$this->orderPay->pay_type_name}[{$this->orderPay->pay_type_id}]退款成功"; } else { $this->message[]="{$this->orderPay->pay_type_name}[{$this->orderPay->pay_type_id}]退款失败:{$result['msg']}"; return false; } return $this->message; } /** * @throws AppException */ public function check() { if ($this->orderPay != OrderPay::STATUS_PAID){ throw new AppException($this->orderPay->status_name.'的支付单无法退款'); } //todo 对应的订单已经支付 //todo 对应的订单有其他有效的支付记录 } }