// Controllers/CheckoutController.cs using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; namespace CheckoutExample.Controllers { [ApiController] [Route("api/[controller]")] public class CheckoutController : ControllerBase { [HttpGet] public IActionResult Get(string products, string coupon) { // Parse products var productQuantities = new Dictionary(); if (!string.IsNullOrEmpty(products)) { foreach (var entry in products.Split(',')) { var parts = entry.Split(':'); if (parts.Length == 2) { if (int.TryParse(parts[1], out int quantity)) { productQuantities.Add(parts[0], quantity); } } } } // Build response var response = new { Products = productQuantities, Coupon = coupon ?? "No coupon applied" }; return Ok(response); } } }
  • Lieferung nach Hause
Einzelnes Ergebnis wird angezeigt

Metz Standfuß

600,00

inkl. 19 % MwSt.

zzgl. Versandkosten

Lieferzeit: 3-5 Werktage

In den Warenkorb
Arrow right icon Group Created with Sketch.