コード例 #1
0
        public IActionResult OrderConfirmed(string klarna_order_id)
        {
            string stdUri = "https://checkout.testdrive.klarna.com/checkout/orders";

            Klarna k       = new Klarna();
            var    snippet = k.GetRequest(stdUri + "/" + klarna_order_id);

            ShoppingCart.EmptyCartCookie(HttpContext);

            ViewBag.snippet = snippet;

            return(View("OrderConfirmed", snippet));
        }
コード例 #2
0
        public IActionResult CheckOut()
        {
            var    cart = ShoppingCart.GetCart(_context, HttpContext);
            Klarna k    = new Klarna();

            var response = k.PostRequest(k.createJsonData(cart));

            var snippet = "";

            if (response.StatusCode == System.Net.HttpStatusCode.Created)
            {
                var location = response.Headers.Location.AbsoluteUri;

                //hämta ordern

                snippet = k.GetRequest(location);
            }

            ViewBag.snippet = snippet;

            return(View("CheckOut", snippet));
        }