public adding_additional_owner_verification_document()
        {
            // create a file
            var fileService = new StripeFileUploadService(_stripe_api_key);
            var fileStream  = GetType().GetTypeInfo().Assembly.GetManifestResourceStream("Stripe.Tests.Xunit._resources.bumble.jpg");
            var file        = fileService.Create("bumble.jpg", fileStream, StripeFilePurpose.IdentityDocument);

            // create the new account with the file as the verification document
            Account = new StripeAccountService(_stripe_api_key).Create(
                new StripeAccountCreateOptions
            {
                Email       = $"*****@*****.**",
                Managed     = true,
                LegalEntity = new StripeAccountLegalEntityOptions
                {
                    AdditionalOwners = new List <StripeAccountAdditionalOwner>
                    {
                        new StripeAccountAdditionalOwner
                        {
                            FirstName            = "Bumble",
                            VerificationDocument = file.Id
                        },
                    }
                }
            }
                );
        }
        public StripeFileUploadServiceTest()
        {
            this.service = new StripeFileUploadService();

            this.stream = typeof(StripeFileUploadServiceTest).GetTypeInfo().Assembly.GetManifestResourceStream(FileName);

            this.listOptions = new StripeFileUploadListOptions()
            {
                Limit = 1,
            };
        }
        public PaymentStripeService(
            StripeSourceService stripeSourceService,
            StripeChargeService stripeChargeService,
            StripeAccountService stripeAccountService,
            StripeFileUploadService stripeFileUploadService,
            StripeExternalAccountService externalAccountService)
        {
            // Set your secret key: remember to change this to your live secret key in production
            // See your keys here: https://dashboard.stripe.com/account/apikeys
            StripeConfiguration.SetApiKey(_privateKey);

            _stripeSourceService     = stripeSourceService;
            _stripeChargeService     = stripeChargeService;
            _stripeAccountService    = stripeAccountService;
            _stripeFileUploadService = stripeFileUploadService;
            _externalAccountService  = externalAccountService;
        }
Пример #4
0
        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               = "*****@*****.**",
                Managed             = true,
                ExternalCardAccount = new StripeAccountCardOptions()
                {
                    AddressCountry     = "US",
                    AddressLine1       = "24 Main St",
                    AddressLine2       = "Apt 24",
                    AddressCity        = "Raleigh",
                    AddressState       = "NC",
                    AddressZip         = "27617",
                    Cvc                = "1223",
                    ExpirationMonth    = "10",
                    ExpirationYear     = "2021",
                    Name               = "Julius Turing",
                    Number             = "4000056655665556",
                    Currency           = "usd",
                    DefaultForCurrency = true
                },
                LegalEntity = new StripeAccountLegalEntityOptions
                {
                    AdditionalOwners = new List <StripeAccountAdditionalOwner>
                    {
                        new StripeAccountAdditionalOwner
                        {
                            FirstName            = "Bumble", LastName = "B",
                            BirthDay             = 29, BirthMonth = 8, BirthYear = 2013,
                            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 service = new StripeAccountService(Cache.ApiKey);

            Account          = service.Create(AccountCreateOptions);
            AccountUpdated   = service.Update(Account.Id, AccountUpdateOptions);
            AccountRetrieved = service.Get(Account.Id);
            AccountList      = service.List();
        }
Пример #5
0
        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);
        }