update fix deadcode, security
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Repositories\Api\Order;
|
||||
|
||||
use App\Enums\Invoice\InvoiceStatus;
|
||||
use App\Enums\Order\OrderStatus;
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderItem;
|
||||
@@ -30,28 +29,6 @@ class OrderRepository extends BaseApiRepository implements OrderRepositoryInterf
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// processPayment
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public function processPayment(Order $order, string $method): Order
|
||||
{
|
||||
$order->update([
|
||||
'status' => OrderStatus::ACTIVE->value,
|
||||
'payment_method' => $method,
|
||||
]);
|
||||
|
||||
if ($order->invoice) {
|
||||
$order->invoice->update([
|
||||
'status' => InvoiceStatus::PAID->value,
|
||||
'payment_method' => $method,
|
||||
'paid_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
return $order->fresh(['orderItems', 'invoice', 'customer']);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// hasPendingOrder
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user