Esempio n. 1
0
    protected void validateEmail(object sender, ServerValidateEventArgs e)
    {
        Validation validate     = new Validation();
        string     confirmEmail = "";

        e.IsValid = false;

        if (!String.IsNullOrEmpty(tbEmail.Text))
        {
            confirmEmail = tbEmail.Text.Trim().ToLower();
        }

        if (!String.IsNullOrEmpty(tbEmail.Text))
        {
            if (!validate.ValidateEmailAddress(tbEmail.Text))
            {
                ValidationError.AddNewError(PaymentResources.GetStringFromResourceFile("resCCEmailAddressNotValid"));
            }
            else
            {
                if (confirmEmail != tbEmail.Text.Trim().ToLower())
                {
                    ValidationError.AddNewError(PaymentResources.GetStringFromResourceFile("resCCEmailAddressConfirmDoesNotMatch"));
                }
                else
                {
                    e.IsValid = true;
                }
            }
        }
    }
Esempio n. 2
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        string[] cardTypes;

        SetPageExpireNow();

        base.Page_Load(sender, e);
        if (!Page.IsPostBack)
        {
            OfferId = (string)Context.Items["offerId"];

            string[] offerText = GetOfferDescription(OfferId);

            lPackage.Text = String.Format(PaymentResources.GetStringFromResourceFile("resCCPackageSelected"), offerText[2], offerText[1]);

            string contextCardTypes = (string)Context.Items["creditCardTypes"];

            if (contextCardTypes != null)
            {
                cardTypes = contextCardTypes.Split(',');
            }
            else
            {
                cardTypes = (string[])ViewState["cardTypes"];
            }

            ViewState.Add("cardTypes", cardTypes);

            populateCreditCardInfoList(cardTypes);
            tbEmail.Text     = PaymentItemEmailAddressFromViewState;
            lConfirmMsg.Text = String.Format(PaymentResources.GetStringFromResourceFile("resCCConfirmPurchase"), offerText[2], offerText[1]);
        }
    }
Esempio n. 3
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        SetPageExpireNow();

        base.Page_Load(sender, e);
        if (!Page.IsPostBack)
        {
            string         transactionId  = (string)Context.Items["transactionId"];
            CreditCardInfo creditCardInfo = (CreditCardInfo)Context.Items["creditCardInfo"];
            string         offerId        = (string)Context.Items["offerId"];

            lThankYou.Text = PaymentResources.GetStringFromResourceFile("resCCPurchaseThankYou");

            lblTransaction.Text = PaymentResources.GetStringFromResourceFile("resCCTransaction");
            lTransaction.Text   = GetDisplayTransactionID(transactionId);
            lblName.Text        = PaymentResources.GetStringFromResourceFile("resCCName");
            lName.Text          = String.Format("{0} {1}", creditCardInfo.FirstName, creditCardInfo.LastName);
            lblCardType.Text    = PaymentResources.GetStringFromResourceFile("resCCCardType");
            lCardType.Text      = creditCardInfo.CreditCardtype;
            lblExpireDate.Text  = PaymentResources.GetStringFromResourceFile("resCCExpireDate");
            lExpireDate.Text    = String.Format("{0}/{1}", creditCardInfo.ExpireDate.Substring(0, 2), creditCardInfo.ExpireDate.Substring(2));
            lblEmail.Text       = PaymentResources.GetStringFromResourceFile("resCCEmail");
            lEmail.Text         = PaymentItemEmailAddress;

            lblCreditCard.Text = PaymentResources.GetStringFromResourceFile("resCCCreditCard");
            lCreditCard.Text   = GetCreditCardNumberMasked(creditCardInfo.CreditCardnumber);

            lblPackage.Text = PaymentResources.GetStringFromResourceFile("resCCPackage");
            lPackage.Text   = GetOfferDescription(offerId)[0];

            lSupport.Text         = PaymentResources.GetStringFromResourceFile("resCCSupport") + " ";
            hlSupport.Text        = SupportUrl;
            hlSupport.NavigateUrl = "mailto:" + SupportUrl;
        }
    }
Esempio n. 4
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        SetPageExpireNow();

        divResponse.InnerText = ProcessPayPalCallBack(Request, "PaypalCancel");

        lblPayPalCancel.Text = PaymentResources.GetStringFromResourceFile("resPayPalWaitCancel");
    }
Esempio n. 5
0
    protected void validateSecurityCode(object sender, ServerValidateEventArgs e)
    {
        Validation validate = new Validation();

        e.IsValid = validate.ValidateSecurityCode(tbSecurityCode.Text);

        if (e.IsValid == false)
        {
            ValidationError.AddNewError(PaymentResources.GetStringFromResourceFile("resCCSecurityCodeError"));
        }
    }
Esempio n. 6
0
    protected string GetRequiredFieldMessage(ValidatorCollection validatorCollection)
    {
        string message = "";

        foreach (IValidator validator in validatorCollection)
        {
            if (!validator.IsValid)
            {
                message = PaymentResources.GetStringFromResourceFile("resRequiredFieldError");
                break;
            }
        }
        return(message);
    }
Esempio n. 7
0
    private bool CheckForErrors(string offerId, string PaymentItemUserId, string HangoutUserId, string SessionGuid)
    {
        bool   errors  = false;
        string message = "";

        if (String.IsNullOrEmpty(offerId))
        {
            errors  = true;
            message = PaymentResources.GetStringFromResourceFile("resNoOfferSelected");

            if (!String.IsNullOrEmpty(message))
            {
                ErrorMessage(message);
            }
        }

        return(errors);
    }
    public void PopulatePaymentOffersRadioButtons(XmlDocument xmlDoc, string defaultSelectedOfferId)
    {
        mDefaultSelectedOfferId = defaultSelectedOfferId;
        XmlNodeList nodes = xmlDoc.SelectNodes("/Response/offers/Offer");

        DataTable dtOffers = ConvertXmlNodeListToDataTable("Offers", nodes);

        if (dtOffers.Rows.Count > 0)
        {
            DataView viewOffers = dtOffers.DefaultView;
            viewOffers.Sort = "sortValue desc, sortValueMoney desc";

            rptPackage.DataSource = viewOffers;
            rptPackage.DataBind();
        }
        else
        {                       //No Offers available
            headerMsg.Text    = PaymentResources.GetStringFromResourceFile("resDefaultOffers");
            headerMsg.Visible = true;
        }
    }
Esempio n. 9
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        string transactionComplete = "<img width=\"266px\" height=\"36px\" src=\"/Images/transaction_complete.png\" />";

        SetPageExpireNow();

        if (!Page.IsPostBack)
        {
            string message = Request.QueryString["Msg"];
            if (!String.IsNullOrEmpty(message))
            {
                switch (message)
                {
                case "1":
                    lblComplete.Text = transactionComplete;
                    messageId.Text   = PaymentResources.GetStringFromResourceFile("resCreditCardSuccess");
                    break;

                case "2":
                    lblComplete.Text = transactionComplete;
                    messageId.Text   = PaymentResources.GetStringFromResourceFile("resPayPalCompleted");
                    break;

                case "3":
                    lblComplete.Text = transactionComplete;
                    messageId.Text   = PaymentResources.GetStringFromResourceFile("resPayPalCanceled");
                    break;

                case "4":
                    lblComplete.Text = transactionComplete;
                    messageId.Text   = PaymentResources.GetStringFromResourceFile("resZongCompleted");
                    break;
                }
            }
        }
    }