Exemple #1
0
        public void CloseAccount()
        {
            RecurlyAccount acct = Factories.NewAccount("Close Account");

            acct.Create();

            acct.CloseAccount();
        }
        public void LookupMissingInfo()
        {
            RecurlyAccount newAcct = Factories.NewAccount("Lookup Missing Billing Info");

            newAcct.Create();

            RecurlyBillingInfo billingInfo = RecurlyBillingInfo.Get(newAcct.AccountCode);

            Assert.IsNull(billingInfo);
        }
        public void UpdateBillingInfo()
        {
            RecurlyAccount acct = Factories.NewAccount("Update Billing Info");

            acct.Create();

            RecurlyBillingInfo billingInfo = Factories.NewBillingInfo(acct);

            billingInfo.Update();
        }
Exemple #4
0
        public static RecurlyAccount NewAccount(string testName)
        {
            RecurlyAccount acct = new RecurlyAccount(DateTime.Now.Millisecond.ToString() + "-acct");

            acct.FirstName   = "Verena";
            acct.LastName    = "Test";
            acct.CompanyName = testName;
            acct.Email       = "*****@*****.**";
            return(acct);
        }
        public void CreateCharge()
        {
            RecurlyAccount acct = Factories.NewAccount("Create Charge");

            acct.Create();

            RecurlyCharge charge = RecurlyCharge.ChargeAccount(acct.AccountCode, 512, "$5.12 test charge");

            Assert.IsNotNull(charge);
        }
Exemple #6
0
        public void LookupAccount()
        {
            RecurlyAccount newAcct = Factories.NewAccount("Lookup Account");

            newAcct.Create();

            RecurlyAccount acct = RecurlyAccount.Get(newAcct.AccountCode);

            Assert.IsNotNull(acct);
            Assert.AreEqual(acct.AccountCode, newAcct.AccountCode);
            Assert.IsNotNullOrEmpty(acct.Email);
        }
        public void ClearBillingInfo()
        {
            RecurlyAccount newAcct = Factories.NewAccount("Clear Billing Info");

            newAcct.Create();

            RecurlyBillingInfo billingInfo = Factories.NewBillingInfo(newAcct);

            billingInfo.Update();

            billingInfo.ClearBillingInfo();
        }
Exemple #8
0
        public void UpdateAccount()
        {
            RecurlyAccount acct = Factories.NewAccount("Update Account");

            acct.Create();

            acct.LastName = "UpdateTest123";
            acct.Update();

            RecurlyAccount getAcct = RecurlyAccount.Get(acct.AccountCode);

            Assert.AreEqual(acct.LastName, getAcct.LastName);
        }
        public void LookupBillingInfo()
        {
            RecurlyAccount newAcct = Factories.NewAccount("Lookup Billing Info");

            newAcct.Create();

            RecurlyBillingInfo billingInfo = Factories.NewBillingInfo(newAcct);

            billingInfo.Update();

            RecurlyBillingInfo lookupBilling = RecurlyBillingInfo.Get(newAcct.AccountCode);

            Assert.AreEqual(billingInfo.Address1, lookupBilling.Address1);
            Assert.AreEqual(billingInfo.PostalCode, lookupBilling.PostalCode);
            Assert.IsNotNullOrEmpty(billingInfo.CreditCard.CreditCardType);
        }
Exemple #10
0
        public static RecurlyBillingInfo NewBillingInfo(RecurlyAccount account)
        {
            RecurlyBillingInfo billingInfo = new RecurlyBillingInfo(account);

            billingInfo.FirstName  = account.FirstName;
            billingInfo.LastName   = account.LastName;
            billingInfo.Address1   = "123 Test St";
            billingInfo.City       = "San Francsico";
            billingInfo.State      = "CA";
            billingInfo.Country    = "US";
            billingInfo.PostalCode = "94105";
            billingInfo.CreditCard.ExpirationMonth   = DateTime.Now.Month;
            billingInfo.CreditCard.ExpirationYear    = DateTime.Now.Year + 1;
            billingInfo.CreditCard.Number            = "1";
            billingInfo.CreditCard.VerificationValue = "123";

            return(billingInfo);
        }
Exemple #11
0
 public void FindNonExistantAccount()
 {
     RecurlyAccount acct = RecurlyAccount.Get("totallynotfound!@#$");
 }