Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Initialize controls
        lblTitle.Text = ResHelper.GetString("CreditPayment.lblTitle");

        if ((ShoppingCartControl != null) &&
            (ShoppingCartControl.PaymentGatewayProvider != null) &&
            (ShoppingCartInfoObj != null))
        {
            CMSCreditPaymentProvider provider = (CMSCreditPaymentProvider)ShoppingCartControl.PaymentGatewayProvider;

            // If user is not authorized to finish payment
            if (!provider.IsUserAuthorizedToFinishPayment())
            {
                // Display error message
                lblError.Visible = true;
                lblError.Text    = provider.ErrorMessage;

                // Disable payment processing
                ShoppingCartControl.ButtonNext.Enabled = false;
            }
            else
            {
                // Reloads available credit
                provider.ReloadPaymentData();

                // Displays available credit
                DisplayAvailableCredit();
            }
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CMSCreditPaymentProvider provider = PaymentProvider as CMSCreditPaymentProvider;

        if (provider != null)
        {
            // If user is not authorized to finish payment
            if (!provider.IsUserAuthorizedToFinishPayment(!IsLiveSite))
            {
                // Display error message
                lblError.Visible = true;
                lblError.Text    = provider.ErrorMessage;
            }
            else
            {
                // Reloads available credit
                provider.ReloadPaymentData();
                DisplayAvailableCredit();
            }
        }
    }