diff --git a/src/Models/NTAKOrder.php b/src/Models/NTAKOrder.php index 480b57d..51bbc49 100644 --- a/src/Models/NTAKOrder.php +++ b/src/Models/NTAKOrder.php @@ -49,7 +49,7 @@ public function __construct( if ($orderType !== NTAKOrderType::NORMAL) { $this->validateIfNotNormal(); } - if ($orderType !== NTAKOrderType::STORNO) { + if ($orderType !== NTAKOrderType::SZTORNO) { $this->validateIfNotStorno(); } @@ -192,7 +192,7 @@ protected function validateIfNotStorno(): void */ protected function calculateTotal(): int { - if ($this->orderType !== NTAKOrderType::STORNO) { + if ($this->orderType !== NTAKOrderType::SZTORNO) { $total = $this->totalOfOrderItems($this->orderItems); return $total + $total * $this->serviceFee / 100; @@ -212,7 +212,7 @@ protected function calculateTotalWithDiscount(): int return $this->total; } - if ($this->orderType !== NTAKOrderType::STORNO) { + if ($this->orderType !== NTAKOrderType::SZTORNO) { $total = $this->totalOfOrderItemsWithDiscount($this->orderItems); return $total + $total * $this->serviceFee / 100; diff --git a/src/NTAK.php b/src/NTAK.php index 12f5242..11b2e0b 100644 --- a/src/NTAK.php +++ b/src/NTAK.php @@ -88,21 +88,21 @@ public function handleOrder(NTAKOrder ...$ntakOrders): string ? null : $ntakOrder->ntakOrderId, 'targynap' => $ntakOrder->end->format('Y-m-d'), - 'rendelesKezdete' => $ntakOrder->orderType === NTAKOrderType::STORNO + 'rendelesKezdete' => $ntakOrder->orderType === NTAKOrderType::SZTORNO ? null : $ntakOrder->start->timezone('Europe/Budapest')->toIso8601String(), - 'rendelesVege' => $ntakOrder->orderType === NTAKOrderType::STORNO + 'rendelesVege' => $ntakOrder->orderType === NTAKOrderType::SZTORNO ? null : $ntakOrder->end->timezone('Europe/Budapest')->toIso8601String(), 'helybenFogyasztott' => $ntakOrder->isAtTheSpot, 'osszesitett' => false, - 'fizetesiInformaciok' => $ntakOrder->orderType === NTAKOrderType::STORNO + 'fizetesiInformaciok' => $ntakOrder->orderType === NTAKOrderType::SZTORNO ? null : [ 'rendelesVegosszegeHUF' => $ntakOrder->totalWithDiscount(), 'fizetesiModok' => $ntakOrder->buildPaymentTypes(), ], - 'rendelesTetelek' => $ntakOrder->orderType === NTAKOrderType::STORNO + 'rendelesTetelek' => $ntakOrder->orderType === NTAKOrderType::SZTORNO ? null : $ntakOrder->buildOrderItems(), ];