Recurly.Account.Reopen C# (CSharp) Method

Reopen() public method

Reopen an existing account in Recurly
public Reopen ( ) : void
return void
        public void Reopen()
        {
            Accounts.Reopen(AccountCode);
            if(State.Is(AccountState.Closed))
                State ^= AccountState.Closed;
            State |= AccountState.Active;
        }

Usage Example

        public void ReopenAccount()
        {
            string s = Factories.GetMockAccountName();
            Account acct = new Account(s);
            acct.Create();
            acct.Close();

            acct.Reopen();

            Account test = Account.Get(s);
            Assert.AreEqual(acct.State, Recurly.Account.AccountState.active);
            Assert.AreEqual(test.State, Recurly.Account.AccountState.active);
        }