meta['payment_method'] ?? null) === 'cash-on-delivery') { $fee = (int) (PaymentMethod::where('type', 'cash-on-delivery')->value('data->fee') ?? 0); $cart->shippingTotal = new Price( ($cart->shippingTotal?->value ?? 0) + $fee, $cart->currency, 1 ); } return $next($cart); } }