From cc3c4cf159f081cfe305f8c9f18ab36cf62d2ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Tue, 4 Jan 2022 15:16:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/AlipayController.php | 23 +++++++++++++++++++ app/Services/AlipayService.php | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/Endpoint/Callback/Http/Controllers/AlipayController.php b/app/Endpoint/Callback/Http/Controllers/AlipayController.php index 6061805c..721cf2d7 100644 --- a/app/Endpoint/Callback/Http/Controllers/AlipayController.php +++ b/app/Endpoint/Callback/Http/Controllers/AlipayController.php @@ -3,10 +3,33 @@ namespace App\Endpoint\Callback\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; class AlipayController extends Controller { + /** + * 支付通知 + * + * @param Request $request + * @return \Illuminate\Http\Response + */ public function paidNotify(Request $request) { + $this->log('paid notify', $request->all()); + } + + /** + * 微信回调日志 + * + * @param string $message + * @param array $context + * @return void + */ + protected function log(string $message, array $context = []) + { + return Log::build([ + 'driver' => 'daily', + 'path' => storage_path('logs/alipay-notify.log'), + ])->info($message, $context); } } diff --git a/app/Services/AlipayService.php b/app/Services/AlipayService.php index 6fc76f5d..4e1d5a0c 100644 --- a/app/Services/AlipayService.php +++ b/app/Services/AlipayService.php @@ -26,6 +26,8 @@ class AlipayService $params['total_amount'], ); - return $result->body; + return [ + 'body' => $result->body, + ]; } }