예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // No payment provider loaded -> skip payment
        if (ShoppingCartControl.PaymentGatewayProvider == null)
        {
            // Clean current order payment result when editing existing order and payment was skipped
            if ((ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskOrderItems) &&
                !ShoppingCartControl.IsCurrentStepPostBack)
            {
                CleanUpOrderPaymentResult();
            }

            // Raise payment skipped
            ShoppingCartControl.RaisePaymentSkippedEvent();

            // When on the live site
            if (!ShoppingCartControl.IsInternalOrder)
            {
                // Get Url the user should be redirected to
                string url = ShoppingCartControl.GetRedirectAfterPurchaseUrl();

                // Remove shopping cart data from database and from session
                ShoppingCartControl.CleanUpShoppingCart();

                URLHelper.Redirect(UrlResolver.ResolveUrl(!string.IsNullOrEmpty(url) ? url : ShoppingCartControl.PreviousPageUrl));
            }
        }
        else if (ShoppingCart != null)
        {
            LoadData();
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        p.LogEvent("I", DateTime.Now, "ShoppingCartPaymentGateway ", "");
        // No payment provider loaded -> skip payment
        if (ShoppingCartControl.PaymentGatewayProvider == null)
        {
            // Clean current order payment result when editing existing order and payment was skipped
            if ((ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskOrderItems) &&
                !ShoppingCartControl.IsCurrentStepPostBack)
            {
                p.LogEvent("I", DateTime.Now, "CleanUpOrderPaymentResult ", "");
                CleanUpOrderPaymentResult();
            }

            // Raise payment skipped
            ShoppingCartControl.RaisePaymentSkippedEvent();

            // When on the live site
            if (!ShoppingCartControl.IsInternalOrder)
            {
                // Get Url the user should be redirected to
                string url = ShoppingCartControl.GetRedirectAfterPurchaseUrl();

                // Remove shopping cart data from database and from session
                ShoppingCartControl.CleanUpShoppingCart();

                if (!string.IsNullOrEmpty(url))
                {
                    URLHelper.Redirect(url);
                }
                else
                {
                    URLHelper.Redirect(ShoppingCartControl.PreviousPageUrl);
                }
            }
            return;
        }
        else if (ShoppingCart != null)
        {
            p.LogEvent("I", DateTime.Now, "ShoppingCartControl.PaymentGatewayProvider != null ", "");
            LoadData();
        }

        lblTitle.Text      = GetString("PaymentSummary.Title");
        lblTotalPrice.Text = GetString("PaymentSummary.TotalPrice");
        lblOrderId.Text    = GetString("PaymentSummary.OrderId");
        lblPayment.Text    = GetString("PaymentSummary.Payment");
        this.ShoppingCartControl.ButtonNextClickAction();
    }