shippingBreakdown rather than * bumping $cart->shippingTotal directly — the later Lunar\Pipelines\ * Cart\CalculateTax step unconditionally recomputes shippingTotal * (and shipping tax) from shippingBreakdown's item sum, so a value * set only on the plain property is silently discarded before the * cart finishes calculating. * * @param Closure(CartContract): mixed $next */ public function handle(CartContract $cart, Closure $next): mixed { $type = $cart->meta['payment_method'] ?? null; if ($type) { $fee = (int) (PaymentMethod::where('type', $type)->first()?->data['fee'] ?? 0); if ($fee > 0) { $cart->shippingBreakdown->items->put('payment-method-fee', new ShippingBreakdownItem( name: 'Payment method fee', identifier: 'payment-method-fee', price: new Price($fee, $cart->currency, 1), )); } } return $next($cart); } }