feat: Implement payment method fields, refactor order creation logic to support detailed order items and VM provisioning, and add admin notifications.
This commit is contained in:
@@ -285,6 +285,22 @@ class CreateVirtualMachineJob implements ShouldQueue
|
||||
]
|
||||
);
|
||||
$this->writeCustomerSuccessLog();
|
||||
|
||||
try {
|
||||
$order = $this->item->order;
|
||||
$customer = $order->customer;
|
||||
broadcast(new \App\Events\OrderProvisioned(
|
||||
orderId: $order->id,
|
||||
orderNum: $order->order_num,
|
||||
customerName: trim($customer->firstname . ' ' . $customer->lastname),
|
||||
vmId: (string) $vmId,
|
||||
success: true,
|
||||
message: 'Máy ảo đã được khởi tạo thành công cho khách hàng ' . trim($customer->firstname . ' ' . $customer->lastname) . ' (Đơn #' . $order->order_num . ')',
|
||||
));
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('Không thể broadcast OrderProvisioned: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user