Exemplo n.º 1
0
        public connect_fixture()
        {
            var accountService       = new StripeAccountService(Cache.ApiKey);
            var accountCreateOptions = new StripeAccountCreateOptions
            {
                DefaultCurrency = "usd",
                Email           = "*****@*****.**",
                Type            = StripeAccountType.Custom
            };

            Account = accountService.Create(accountCreateOptions);

            var chargeService = new StripeChargeService(Cache.ApiKey);

            chargeService.ExpandApplication    = true;
            chargeService.ExpandApplicationFee = true;
            Charge = chargeService.Create(
                new StripeChargeCreateOptions
            {
                SourceTokenOrExistingSourceId = "tok_visa",
                ApplicationFee = 10,
                Amount         = 100,
                Currency       = "usd"
            },
                new StripeRequestOptions
            {
                StripeConnectAccountId = Account.Id
            }
                );

            var applicationFeeService = new StripeApplicationFeeService(Cache.ApiKey);

            applicationFeeService.ExpandApplication = true;
            ApplicationFee = applicationFeeService.Get(Charge.ApplicationFeeId);
        }
Exemplo n.º 2
0
        public charging_from_another_account()
        {
            var anotherAccount = new StripeAccountService(Cache.ApiKey).Create(new StripeAccountCreateOptions
            {
                DefaultCurrency = "usd",
                Email           = "*****@*****.**",
                Managed         = true
            }
                                                                               );

            var chargeService = new StripeChargeService(Cache.ApiKey);

            chargeService.ExpandApplicationFee = true;

            var charge = chargeService.Create(
                new StripeChargeCreateOptions
            {
                SourceTokenOrExistingSourceId = Cache.GetToken().Id,
                ApplicationFee = 10,
                Amount         = 100,
                Currency       = "usd"
            },
                new StripeRequestOptions
            {
                StripeConnectAccountId = anotherAccount.Id
            }
                );

            var appFeeService = new StripeApplicationFeeService(Cache.ApiKey);

            appFeeService.ExpandApplication = true;

            _appFee = appFeeService.Get(charge.ApplicationFeeId);
        }
        public StripeApplicationFeeServiceTest()
        {
            this.service = new StripeApplicationFeeService();

            this.listOptions = new StripeApplicationFeeListOptions()
            {
                Limit = 1,
            };
        }