mirror of
https://github.com/v2board/v2board.git
synced 2025-06-15 14:17:48 +08:00
telegram: order notify
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Guest;
|
||||
|
||||
use App\Services\OrderService;
|
||||
use App\Services\TelegramService;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Order;
|
||||
@ -160,6 +161,16 @@ class OrderController extends Controller
|
||||
abort(500, 'order is not found');
|
||||
}
|
||||
$orderService = new OrderService($order);
|
||||
return $orderService->success($callbackNo);
|
||||
if (!$orderService->success($callbackNo)) {
|
||||
return false;
|
||||
}
|
||||
$telegramService = new TelegramService();
|
||||
$message = sprintf(
|
||||
"💰成功收款%s元\n———————————————\n订单号:%s",
|
||||
$order->total_amount / 100,
|
||||
$order->trade_no
|
||||
);
|
||||
$telegramService->sendMessageWithAdmin($message);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user