Beispiel #1
0
        // GET: /ShoppingCart/Pay
        public ActionResult Pay(int id)
        {
            string currectScheme = Request.IsHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp;

            var orderDb = new OrderDb();
            var order   = orderDb.GetNewOrder();

            var paymentUrl = new PaymentUrl()
            {
                Success = Url.Action("PaymentSuccess", "ShoppingCart", null, currectScheme),
                Fail    = Url.Action("PaymentFail", "ShoppingCart", null, currectScheme)
            };

            var paymentProvider      = new PaymentProvider(_optionsAccessor);
            var hostOnlinePaymentUrl =
                paymentProvider.GetPaymentExpressHostUrl(paymentUrl, order);

            return(Redirect(hostOnlinePaymentUrl));
        }