Career
Career
class OrderPlaceAction extends OrderAction
{
protected function apply(): void
{
$transaction = Transaction::place(
Order: $this->target,
resourceData: $this->validated['payment_data'] ?? [],
);
$this->target->update([
'version' => $this->target->version + 1,
'status' => OrderStatusEnum::Placing,
'ordered_at' => now(),
]);
Stock::queueOrder($this->target);
$this->target = Coupon::chargeCredit($this->target);
try {
$this->target = Order::updateStatus($this->target);
} catch (Exception $exception) {
}
}
}