コード例 #1
0
 protected void DoMakePurchase(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         if (!VerifyExpDateInFuture())
         {
             InsertValidationErrorMessage("Please choose an expiraton in the future.");
             return;
         }
         AccountInfoUpdate update = new AccountInfoUpdate();
         update.StreetAddress.Value = Input_StreetAddress.Text.Trim();
         update.SubStreetAddress.Value = Input_SubStreet.Text.Trim();
         update.City.Value = Input_City.Text.Trim();
         update.State = Input_State.SelectedValue;
         update.PostalCode.Value = Input_PostalCode.Text.Trim();
         update.Phone = Input_Phone.Text.Trim();
         NysfSession session = BrowserUtility.GetSession();
         session.UpdateAccountInfo(update);
         Cart cart = session.GetCart();
         if (session.CartExpireTime.HasValue && session.CartExpireTime < DateTime.Now)
         {
             Response.Redirect(ConfigSection.Settings.StandardPages.Expired);
         }
         CheckoutResult result = session.Checkout(
             cart.BalanceToCharge.Value, Int32.Parse(Input_ShippingMethod.SelectedValue),
             Input_CardHolder.Text, Input_CardNum.Text,
             Int32.Parse(Input_CardType.SelectedValue),
             Int32.Parse(Input_ExpMonth.SelectedValue),
             Int32.Parse(Input_ExpYear.SelectedValue),
             Input_SecurityCode.Text.Trim());
         if (result == CheckoutResult.Succeeded)
         {
             session.RecordFinalizedContributions(cart.Contributions);
             session.SendOrderConfirmationEmail(cart.OrderId.Value, EmailTemplateId);
             Response.Redirect(ConfigSection.Settings.StandardPages.PostCheckout);
         }
         else
         {
             InsertValidationErrorMessage(
                     "Your credit card was not accepted. Please check your information and try again.");
         }
     }
 }
コード例 #2
0
ファイル: NysfSession.cs プロジェクト: ThePublicTheater/NYSF
        public RegisterResult Register(string firstName, string lastName, string email,
				string password, bool emailOptIn, Dictionary<string,string> attributeValuePairs,
				bool sendConfirmationEmail, int emailTemplateId)
        {
            RegisterResult result = Register(firstName, lastName, email, email, password);
            if (result != RegisterResult.Success)
            {
                return result;
            }
            if (emailOptIn)
            {
                if (attributeValuePairs != null)
                {
                    AddAttributes(attributeValuePairs);
                }
            }
            else
            {
                AccountInfoUpdate update = new AccountInfoUpdate();
                update.EmailRestrictionId = 2;
                UpdateAccountInfo(update);
            }
            if (sendConfirmationEmail)
            {
                SendGeneralAccountEmail(email, emailTemplateId);
            }
            return result;
        }
コード例 #3
0
ファイル: NysfSession.cs プロジェクト: ThePublicTheater/NYSF
 public new UpdateAccountInfoResult UpdateAccountInfo(AccountInfoUpdate update)
 {
     if (update.Email.Delete || update.Email.Value != null)
     {
         // TODO: build in email update capacity based on UpdateLogin
         throw new ApplicationException(
                 "NysfSession is not able to update an account's email address via UpdateAccountInfo.");
     }
     return base.UpdateAccountInfo(update);
 }
コード例 #4
0
ファイル: Tess.cs プロジェクト: ThePublicTheater/NYSF
        public static UpdateAccountInfoResult UpdateAccountInfo(string sessionKey,
				AccountInfoUpdate updates)
        {
            return UpdateAccountInfo(
                    sessionKey: sessionKey,
                    email: updates.Email.Value,
                    phone: updates.Phone,
                    streetAddress: updates.StreetAddress.Value,
                    subStreetAddress: updates.SubStreetAddress.Value,
                    city: updates.City.Value,
                    state: updates.State,
                    postalCode: updates.PostalCode.Value,
                    countryId: updates.CountryId,
                    //phone2: updates.Phone2,
                    //phone2TypeId: updates.Phone2TypeId,
                    fax: updates.Fax,
                    firstName: updates.FirstName.Value,
                    middleName: updates.MiddleName.Value,
                    lastName: updates.LastName.Value,
                    prefix: updates.Prefix.Value,
                    suffix: updates.Suffix.Value,
                    businessTitle: updates.BusinessTitle.Value,
                    emailRestrictionId: updates.EmailRestrictionId,
                    mailRestrictionId: updates.MailRestrictionId,
                    phoneRestrictionId: updates.PhoneRestrictionId,
                    acceptsHtmlEmail: updates.AcceptsHtmlEmail,
                    gender: updates.Gender.Value,
                    gender2: updates.Gender2.Value,
                    firstName2: updates.FirstName2.Value,
                    middleName2: updates.MiddleName2.Value,
                    lastName2: updates.LastName2.Value,
                    prefix2: updates.Prefix2.Value,
                    suffix2: updates.Suffix2.Value,
                    originalSourceId: updates.OriginalSourceId,
                    allowChangesToSalutations: updates.AllowChangesToSalutationsAndBusinessTitle,
                    addressTypeId: updates.AddressTypeId,
                    emailAddressTypeId: updates.EmailAddressTypeId,
                    salutationLine1: updates.SalutationLine1.Value,
                    salutationLine2: updates.SalutationLine2.Value,
                    letterSalutation: updates.LetterSalutation.Value,
                    constituentTypeId: updates.ConstituentTypeId,
                    nameStatusId: updates.NameStatusId,
                    name2StatusId: updates.Name2StatusId);
        }
コード例 #5
0
ファイル: TessSession.cs プロジェクト: ThePublicTheater/NYSF
 public UpdateAccountInfoResult UpdateAccountInfo(AccountInfoUpdate newInfo)
 {
     return Tess.UpdateAccountInfo(Key, newInfo);
 }