Пример #1
0
        public StripeExternalAccountServiceTest()
        {
            this.service = new StripeExternalAccountService();

            this.createOptions = new StripeExternalAccountCreateOptions
            {
                ExternalAccountBankAccount = new StripeAccountBankAccountOptions
                {
                    AccountNumber = "000123456789",
                    Country       = "US",
                    Currency      = "usd",
                    RoutingNumber = "110000000",
                }
            };

            this.updateOptions = new StripeExternalAccountUpdateOptions()
            {
                Metadata = new Dictionary <string, string>()
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new StripeExternalAccountListOptions()
            {
                Limit = 1,
            };
        }
Пример #2
0
        public external_account_fixture()
        {
            Account = new StripeAccountService(Cache.ApiKey).Create(new StripeAccountCreateOptions
            {
                Country = "US",
                Type    = StripeAccountType.Custom
            });

            ExernalAccountCreateOptionsBankAccount = new StripeExternalAccountCreateOptions
            {
                ExternalAccountBankAccount = new StripeAccountBankAccountOptions
                {
                    AccountNumber = "000123456789",
                    Country       = "US",
                    Currency      = "usd",
                    RoutingNumber = "110000000"
                }
            };

            ExernalAccountBankAccountUpdateOptions = new StripeExternalAccountUpdateOptions
            {
                Metadata = new Dictionary <string, string>()
                {
                    { "key", "value" }
                }
            };

            ExernalAccountCardUpdateOptions = new StripeExternalAccountUpdateOptions
            {
                ExternalAccountCard = new StripeExternalAccountCardUpdateOptions
                {
                    ExpirationMonth = 01,
                    ExpirationYear  = 2028,
                    Name            = "Updated Name"
                }
            };

            var service = new StripeExternalAccountService(Cache.ApiKey);

            ExternalAccountCard = service.Create(Account.Id, new StripeExternalAccountCreateOptions
            {
                ExternalAccountTokenId = "tok_visa_debit"
            });
            ExternalAccountBankAccount        = service.Create(Account.Id, ExernalAccountCreateOptionsBankAccount);
            ExternalAccountBankAccountUpdated = service.Update(Account.Id, ExternalAccountBankAccount.Id, ExernalAccountBankAccountUpdateOptions);
            ExternalAccountCardUpdated        = service.Update(Account.Id, ExternalAccountCard.Id, ExernalAccountCardUpdateOptions);
            ExternalAccountRetrieved          = service.Get(Account.Id, ExternalAccountCard.Id);
            ExternalAccountList    = service.List(Account.Id);
            ExternalAccountDeleted = service.Delete(Account.Id, ExternalAccountBankAccount.Id);
        }