public StripeAccountServiceTest() { this.service = new StripeAccountService(); this.createOptions = new StripeAccountCreateOptions { Type = StripeAccountType.Custom, ExternalCardAccount = new StripeAccountCardOptions() { TokenId = "tok_visa_debit" }, LegalEntity = new StripeAccountLegalEntityOptions { AdditionalOwners = new List <StripeAccountAdditionalOwner> { new StripeAccountAdditionalOwner { FirstName = "John", LastName = "Doe", BirthDay = 1, BirthMonth = 1, BirthYear = 1980, VerificationDocument = "file_123", VerificationDocumentBack = "file_234", }, new StripeAccountAdditionalOwner { FirstName = "Jenny", LastName = "Rosen", State = "CA", CityOrTown = "City", Line1 = "Line1", Line2 = "Line2", PostalCode = "90210", Country = "US", } }, VerificationDocumentFileId = "file_abc", VerificationDocumentFileBackId = "file_bcd", } }; this.updateOptions = new StripeAccountUpdateOptions() { Metadata = new Dictionary <string, string>() { { "key", "value" }, }, }; this.rejectOptions = new StripeAccountRejectOptions { Reason = "terms_of_service" }; this.listOptions = new StripeAccountListOptions() { Limit = 1, }; }
public account_fixture() { // create a file to attach to the additional owner as a verification document var fileService = new StripeFileUploadService(Cache.ApiKey); var fileStream = GetType().GetTypeInfo().Assembly.GetManifestResourceStream("Stripe.Tests.XUnit._resources.bumble.jpg"); var file = fileService.Create("bumble.jpg", fileStream, StripeFilePurpose.IdentityDocument); AccountCreateOptions = new StripeAccountCreateOptions { BusinessName = "Subtracts", BusinessPrimaryColor = "#" + new Random().Next(0, 6).ToString("D6"), BusinessUrl = "http://subtracts.io", DebitNegativeBalances = true, DeclineChargeOnAvsFailure = false, DeclineChargeOnCvcFailure = true, DefaultCurrency = "usd", Email = "*****@*****.**", Type = StripeAccountType.Custom, ExternalCardAccount = new StripeAccountCardOptions() { TokenId = "tok_visa_debit" }, LegalEntity = new StripeAccountLegalEntityOptions { AdditionalOwners = new List <StripeAccountAdditionalOwner> { new StripeAccountAdditionalOwner { FirstName = "Bumble", LastName = "B", // Ensure the owner is older than 18 to avoid API issues. BirthDay = 29, BirthMonth = 8, BirthYear = 1980, VerificationDocument = file.Id }, new StripeAccountAdditionalOwner { FirstName = "Trouble", LastName = "China", State = "CA", CityOrTown = "RockAndWheat", Line1 = "B", Line2 = "C", PostalCode = "27635", Country = "US" } } } }; AccountUpdateOptions = new StripeAccountUpdateOptions { BusinessUrl = "https://subtracts.io" }; var _rejectOptions = new StripeAccountRejectOptions { Reason = "terms_of_service" }; var service = new StripeAccountService(Cache.ApiKey); Account = service.Create(AccountCreateOptions); AccountUpdated = service.Update(Account.Id, AccountUpdateOptions); AccountRetrieved = service.Get(Account.Id); AccountList = service.List(); AccountRejected = service.Reject(Account.Id, _rejectOptions); }