예제 #1
0
        public ActionResult ThreeDSecure()
        {
            //Braintree has its own 3dSecure form
            if (AppLogic.ActivePaymentGatewayCleaned() == Gateway.ro_GWBRAINTREE)
            {
                var customer = HttpContext.GetCustomer();
                var context  = PersistedCheckoutContextProvider.LoadCheckoutContext(customer);
                var cart     = new ShoppingCart(customer.SkinID, customer, CartTypeEnum.ShoppingCart, 0, false);

                var braintreeModel = new BraintreeThreeDSecureViewModel(
                    nonce: context.Braintree.Nonce,
                    scriptUrl: AppLogic.AppConfig("Braintree.ScriptUrl"),
                    token: context.Braintree.Token,
                    total: cart.Total(true).ToString());

                return(View(ViewNames.BraintreeThreeDSecureForm, braintreeModel));
            }
            else
            {
                var threeDSecureModel = new ThreeDSecureFrameViewModel
                {
                    FrameUrl = Url.Action(ActionNames.ThreeDSecureForm, ControllerNames.ThreeDSecure, null, this.Request.Url.Scheme)
                };

                return(View(threeDSecureModel));
            }
        }
        public ActionResult ThreeDSecure()
        {
            //Braintree has its own 3dSecure form
            if (AppLogic.ActivePaymentGatewayCleaned() == Gateway.ro_GWBRAINTREE)
            {
                var customer = HttpContext.GetCustomer();
                var context  = PersistedCheckoutContextProvider.LoadCheckoutContext(customer);
                var cart     = new ShoppingCart(customer.SkinID, customer, CartTypeEnum.ShoppingCart, 0, false);

                var braintreeModel = new BraintreeThreeDSecureViewModel(
                    nonce: context.Braintree.Nonce,
                    scriptUrl: AppConfigProvider.GetAppConfigValue("Braintree.ScriptUrl"),
                    token: context.Braintree.Token,
                    total: cart.Total(true).ToString());

                return(View(ViewNames.BraintreeThreeDSecureForm, braintreeModel));
            }
            //Sage Pay PI has its own 3dSecure form
            if (AppLogic.ActivePaymentGatewayCleaned() == Gateway.ro_GWSAGEPAYPI)
            {
                var customer = HttpContext.GetCustomer();
                var sagePayPiThreeDSecureViewModel = new SagePayPiThreeDSecureViewModel(
                    paReq: customer.ThisCustomerSession[AppLogic.SagePayPiPaReq],
                    termUrl: customer.ThisCustomerSession[AppLogic.SagePayPiTermUrl],
                    md: customer.ThisCustomerSession[AppLogic.SagePayPiMd],
                    acsUrl: customer.ThisCustomerSession[AppLogic.SagePayPiAcsUrl]
                    );

                return(View(ViewNames.SagePayPiThreeDSecureForm, sagePayPiThreeDSecureViewModel));
            }

            var threeDSecureModel = new ThreeDSecureFrameViewModel
            {
                FrameUrl = Url.Action(ActionNames.ThreeDSecureForm, ControllerNames.ThreeDSecure, null, this.Request.Url.Scheme)
            };

            return(View(threeDSecureModel));
        }