Merge pull request #145 from riolurs/patch-1

feat: Add additional payment information to Telegram notifications.
This commit is contained in:
Xboard 2024-06-08 21:41:32 +08:00 committed by GitHub
commit cd1bd1109c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,12 +41,22 @@ class PaymentController extends Controller
if (!$orderService->paid($callbackNo)) {
return false;
}
$payment = Payment::where('id', $order->payment_id)->first();
$telegramService = new TelegramService();
$message = sprintf(
"💰成功收款%s元\n———————————————\n订单号:%s",
"💰成功收款%s元\n" .
"———————————————\n" .
"支付接口:%s\n" .
"支付渠道:%s\n" .
"本站订单:`%s`"
,
$order->total_amount / 100,
$payment->payment,
$payment->name,
$order->trade_no
);
$telegramService->sendMessageWithAdmin($message);
return true;
}