예제 #1
0
    public override bool ProcessStep()
    {
        if (ShoppingCartControl.PaymentGatewayProvider != null)
        {
            // Skip payment when already paid except when editing existing order or user is not authorized
            if (((!IsPaymentCompletedOrAuthorized()) || (ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskOrderItems)) &&
                ShoppingCartControl.PaymentGatewayProvider.IsUserAuthorizedToFinishPayment(MembershipContext.AuthenticatedUser, ShoppingCartControl.ShoppingCartInfoObj, !IsLiveSite))
            {
                var data = mPaymentDataForm.GetPaymentGatewayData();
                mPaymentResult = Service.Resolve <IPaymentGatewayProcessor>().ProcessPayment(ShoppingCartControl.PaymentGatewayProvider, data);
            }

            // Show info message
            if (!string.IsNullOrEmpty(ShoppingCartControl.PaymentGatewayProvider.InfoMessage))
            {
                lblInfo.Visible = true;
                lblInfo.Text    = ShoppingCartControl.PaymentGatewayProvider.InfoMessage;
            }

            // Show error message
            if (!string.IsNullOrEmpty(ShoppingCartControl.PaymentGatewayProvider.ErrorMessage))
            {
                lblError.Visible = true;
                lblError.Text    = ShoppingCartControl.PaymentGatewayProvider.ErrorMessage;
                return(false);
            }

            if (IsPaymentCompleted())
            {
                // Delete current shopping cart after successful payment attempt
                ShoppingCartControl.CleanUpShoppingCart();

                // Raise payment completed event
                ShoppingCartControl.RaisePaymentCompletedEvent();

                return(true);
            }

            if (IsPaymentAuthorized())
            {
                ShoppingCartControl.CleanUpShoppingCart();

                return(true);
            }
        }

        return(false);
    }
예제 #2
0
    public override bool ProcessStep()
    {
        if (ShoppingCartControl.PaymentGatewayProvider != null)
        {
            // Process current step payment gateway custom data
            ShoppingCartControl.PaymentGatewayProvider.ProcessCustomData();

            // Skip payment when already paid except when editing existing order or user is not authorized
            if (((!ShoppingCartControl.PaymentGatewayProvider.IsPaymentCompleted) ||
                 (ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskOrderItems)) &&
                ShoppingCartControl.PaymentGatewayProvider.IsUserAuthorizedToFinishPayment(MembershipContext.AuthenticatedUser, ShoppingCartControl.ShoppingCartInfoObj, !IsLiveSite))
            {
                // Process payment
                ShoppingCartControl.PaymentGatewayProvider.ProcessPayment();
            }

            // Show info message
            if (ShoppingCartControl.PaymentGatewayProvider.InfoMessage != "")
            {
                lblInfo.Visible = true;
                lblInfo.Text    = ShoppingCartControl.PaymentGatewayProvider.InfoMessage;
            }

            // Show error message
            if (ShoppingCartControl.PaymentGatewayProvider.ErrorMessage != "")
            {
                lblError.Visible = true;
                lblError.Text    = ShoppingCartControl.PaymentGatewayProvider.ErrorMessage;
                return(false);
            }

            if (ShoppingCartControl.PaymentGatewayProvider.IsPaymentCompleted)
            {
                // Delete current shopping cart after successful payment attempt
                ShoppingCartControl.CleanUpShoppingCart();
                // Raise payment completed event
                ShoppingCartControl.RaisePaymentCompletedEvent();
                return(true);
            }
        }

        return(false);
    }
    public override bool ProcessStep()
    {
        if (ShoppingCartControl.PaymentGatewayProvider != null)
        {
            // Proces current step payment gateway custom data
            ShoppingCartControl.PaymentGatewayProvider.ProcessCustomData();

            // Skip payment when already payed except when editing existing order
            if ((!ShoppingCartControl.PaymentGatewayProvider.IsPaymentCompleted) ||
                (ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskOrderItems))
            {
                // Process payment
                ShoppingCartControl.PaymentGatewayProvider.ProcessPayment();
            }

            // Show info message
            if (ShoppingCartControl.PaymentGatewayProvider.InfoMessage != "")
            {
                lblInfo.Visible = true;
                lblInfo.Text    = ShoppingCartControl.PaymentGatewayProvider.InfoMessage;
            }

            // Show error message
            if (ShoppingCartControl.PaymentGatewayProvider.ErrorMessage != "")
            {
                lblError.Visible = true;
                lblError.Text    = ShoppingCartControl.PaymentGatewayProvider.ErrorMessage;
                return(false);
            }

            if (ShoppingCartControl.PaymentGatewayProvider.IsPaymentCompleted)
            {
                // Raise payment completed event
                ShoppingCartControl.RaisePaymentCompletedEvent();
                return(true);
            }
        }
        return(false);
    }
 protected void btnFakeClick(object sender, EventArgs e)
 {
     ShoppingCartControl.RaisePaymentCompletedEvent();
     ShoppingCartControl.CleanUpShoppingCart();
     Response.Redirect("http://www.google.fr");
 }