update email template
This commit is contained in:
@@ -83,7 +83,7 @@ class OrderService
|
||||
$this->orderRepo->createItem($order->id, [
|
||||
'product_id' => $product->id,
|
||||
'billing_cycle' => $data['billing_cycle'],
|
||||
'months' => $this->cycleToMonths($data['billing_cycle']),
|
||||
'months' => OrderHelper::cycleToMonths($data['billing_cycle']),
|
||||
'server_name' => $data['server_name'] ?? null,
|
||||
'os_id' => $data['os_id'] ?? null,
|
||||
'quantity' => 1,
|
||||
@@ -151,7 +151,7 @@ class OrderService
|
||||
private function provisionService(Order $order, OrderItem $item, $customer): void
|
||||
{
|
||||
$invoice = $order->invoice;
|
||||
$months = $item->months ?: $this->cycleToMonths($item->billing_cycle);
|
||||
$months = $item->months ?: OrderHelper::cycleToMonths($item->billing_cycle);
|
||||
$expiresAt = now()->addMonths($months);
|
||||
|
||||
$service = Service::create([
|
||||
@@ -253,18 +253,6 @@ class OrderService
|
||||
// Helpers
|
||||
// =========================================================================
|
||||
|
||||
private function cycleToMonths(?string $cycle): int
|
||||
{
|
||||
return match ($cycle) {
|
||||
'monthly' => 1,
|
||||
'quarterly' => 3,
|
||||
'semi_annually' => 6,
|
||||
'annually' => 12,
|
||||
'biennially' => 24,
|
||||
'triennially' => 36,
|
||||
default => 1,
|
||||
};
|
||||
}
|
||||
|
||||
private function dispatchAdminNotification(Order $order, $customer): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user