public JsonResult get_config()
        {
            string pub_key    = _config.GetSection("Stripe_Publish_Key").Value;
            string sec_key    = _config.GetSection("Stripe_Secret_key").Value;
            string base_price = "10";
            string currency   = "$";

            StripeConfiguration.ApiKey = sec_key;

            //var accounts = Stripe.g
            var options = new AccountListOptions {
                Limit = 10
            };
            var service = new AccountService();
            StripeList <Account> accounts = service.List(options);

            return(new JsonResult(new
            {
                publicKey = pub_key,
                basePrice = base_price,
                currency = currency,
                accounts = accounts
            }));
        }
Beispiel #2
0
 public virtual IEnumerable <Account> ListAutoPaging(AccountListOptions options = null, RequestOptions requestOptions = null)
 {
     return(this.ListEntitiesAutoPaging(options, requestOptions));
 }
Beispiel #3
0
 public virtual Task <StripeList <Account> > ListAsync(AccountListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(this.ListEntitiesAsync(options, requestOptions, cancellationToken));
 }
Beispiel #4
0
 public virtual StripeList <Account> List(AccountListOptions options = null, RequestOptions requestOptions = null)
 {
     return(this.ListEntities(options, requestOptions));
 }
Beispiel #5
0
        public AccountServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new AccountService(this.StripeClient);

            this.createOptions = new AccountCreateOptions
            {
                Type            = AccountType.Custom,
                BusinessProfile = new AccountBusinessProfileOptions
                {
                    Name = "business name",
                },
                BusinessType = "company",
                Capabilities = new AccountCapabilitiesOptions
                {
                    CardPayments = new AccountCapabilitiesCardPaymentsOptions
                    {
                        Requested = true,
                    },
                    Transfers = new AccountCapabilitiesTransfersOptions
                    {
                        Requested = true,
                    },
                },
                Company = new AccountCompanyOptions
                {
                    Address = new AddressOptions
                    {
                        State      = "CA",
                        City       = "City",
                        Line1      = "Line1",
                        Line2      = "Line2",
                        PostalCode = "90210",
                        Country    = "US",
                    },
                    Name         = "Company name",
                    Verification = new AccountCompanyVerificationOptions
                    {
                        Document = new AccountCompanyVerificationDocumentOptions
                        {
                            Back  = "file_back",
                            Front = "file_front",
                        },
                    },
                },
                ExternalAccount = "tok_visa_debit",
                Settings        = new AccountSettingsOptions
                {
                    Branding = new AccountSettingsBrandingOptions
                    {
                        Logo = "file_123",
                    },
                    CardPayments = new AccountSettingsCardPaymentsOptions
                    {
                        DeclineOn = new AccountSettingsCardPaymentsDeclineOnOptions
                        {
                            AvsFailure = true,
                            CvcFailure = true,
                        },
                        StatementDescriptorPrefix = "STR",
                    },
                    Payments = new AccountSettingsPaymentsOptions
                    {
                        StatementDescriptor = "STRIPE 123",
                    },
                    Payouts = new AccountSettingsPayoutsOptions
                    {
                        DebitNegativeBalances = true,
                        Schedule = new AccountSettingsPayoutsScheduleOptions
                        {
                            Interval      = "monthly",
                            MonthlyAnchor = "10",
                        },
                    },
                },
                TosAcceptance = new AccountTosAcceptanceOptions
                {
                    Date      = DateTime.Parse("Mon, 01 Jan 2001 00:00:00Z"),
                    Ip        = "127.0.0.1",
                    UserAgent = "User-Agent",
                },
            };

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

            this.rejectOptions = new AccountRejectOptions
            {
                Reason = "terms_of_service",
            };

            this.listOptions = new AccountListOptions
            {
                Limit = 1,
            };
        }
Beispiel #6
0
 public virtual IAsyncEnumerable <Account> ListAutoPagingAsync(AccountListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
 {
     return(this.ListEntitiesAutoPagingAsync(options, requestOptions, cancellationToken));
 }
Beispiel #7
0
        public AccountServiceTest()
        {
            this.service = new AccountService();

            this.createOptions = new AccountCreateOptions
            {
                Type = AccountType.Custom,
                ExternalAccountId = "tok_visa_debit",
                LegalEntity       = new AccountLegalEntityOptions
                {
                    AdditionalOwners = new List <AccountAdditionalOwner>
                    {
                        new AccountAdditionalOwner
                        {
                            // Verified this is encoded properly but stripe-mock does not
                            // support dob at the moment for additional owners.
                            // Dob = new AccountDobOptions
                            // {
                            //     Day = 1,
                            //     Month = 1,
                            //     Year = 1980,
                            // },
                            FirstName    = "John",
                            LastName     = "Doe",
                            Verification = new AccountVerificationOptions
                            {
                                DocumentBackId = "file_123",
                                DocumentId     = "file_234",
                            },
                        },
                        new AccountAdditionalOwner
                        {
                            Address = new AddressOptions
                            {
                                State      = "CA",
                                City       = "City",
                                Line1      = "Line1",
                                Line2      = "Line2",
                                PostalCode = "90210",
                                Country    = "US",
                            },
                            FirstName = "Jenny",
                            LastName  = "Rosen",
                        }
                    },
                    Verification = new AccountVerificationOptions
                    {
                        DocumentBackId = "file_abc",
                        DocumentId     = "file_bcd",
                    },
                }
            };

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

            this.rejectOptions = new AccountRejectOptions
            {
                Reason = "terms_of_service"
            };

            this.listOptions = new AccountListOptions
            {
                Limit = 1,
            };
        }