$data['order_id'], ]; $res = $pay->wechat->query($order); if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') { if(isset($data['pay_type']) && $data['pay_type']=='recharge'){ PayNotifyLogic::handle('recharge', $res['out_trade_no'], $res); } } } // 消费失败时 public function onConsumeFailure(\Throwable $exception, $package) { return $package; } }