public SubscriptionItemServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new SubscriptionItemService(); this.createOptions = new SubscriptionItemCreateOptions { PlanId = "plan_123", Quantity = 1, SubscriptionId = "sub_123", }; this.updateOptions = new SubscriptionItemUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new SubscriptionItemListOptions { Limit = 1, SubscriptionId = "sub_123", }; }
public ChargeServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new ChargeService(this.StripeClient); this.captureOptions = new ChargeCaptureOptions { Amount = 123, }; this.createOptions = new ChargeCreateOptions { Amount = 123, Currency = "usd", Source = "tok_123", }; this.updateOptions = new ChargeUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new ChargeListOptions { Limit = 1, }; }
public PlanServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new PlanService(this.StripeClient); this.createOptions = new PlanCreateOptions { Amount = 123, Currency = "usd", Interval = "month", Nickname = "Plan Nickmame", Product = new PlanProductCreateOptions { Name = "Product Name", }, }; this.updateOptions = new PlanUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new PlanListOptions { Limit = 1, }; }
public TokenServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new TokenService(this.StripeClient); this.createOptions = new TokenCreateOptions { Card = new CreditCardOptions { AddressCity = "City", AddressCountry = "US", AddressLine1 = "Line 1", AddressLine2 = "Line 2", AddressState = "CA", AddressZip = "90210", Cvc = "123", ExpMonth = 10, ExpYear = DateTime.Now.Year + 1, Name = "Name", Number = "4242424242424242", }, }; }
public WebhookEndpointServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new WebhookEndpointService(this.StripeClient); this.createOptions = new WebhookEndpointCreateOptions { EnabledEvents = new List <string> { "charge.succeeded", }, Url = "https://stripe.com", }; this.updateOptions = new WebhookEndpointUpdateOptions { EnabledEvents = new List <string> { "charge.succeeded", }, }; this.listOptions = new WebhookEndpointListOptions { Limit = 1, }; }
public PayoutServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new PayoutService(this.StripeClient); this.createOptions = new PayoutCreateOptions { Amount = 123, Currency = "usd", }; this.updateOptions = new PayoutUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new PayoutListOptions { Limit = 1, }; }
public SubscriptionScheduleServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new SubscriptionScheduleService(); this.cancelOptions = new SubscriptionScheduleCancelOptions { InvoiceNow = true, Prorate = true, }; this.createOptions = new SubscriptionScheduleCreateOptions { CustomerId = "cus_123", }; this.releaseOptions = new SubscriptionScheduleReleaseOptions { PreserveCancelDate = true, }; this.updateOptions = new SubscriptionScheduleUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new SubscriptionScheduleListOptions { Limit = 1, }; }
public ExternalAccountServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new ExternalAccountService(this.StripeClient); this.createOptions = new ExternalAccountCreateOptions { ExternalAccount = "btok_123", }; this.updateOptions = new ExternalAccountUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, Name = "Jenny Rosen", }; this.listOptions = new ExternalAccountListOptions { Limit = 1, }; }
public BankAccountServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new BankAccountService(this.StripeClient); this.createOptions = new BankAccountCreateOptions { Source = "btok_123", }; this.updateOptions = new BankAccountUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new BankAccountListOptions { Limit = 1, }; this.verifyOptions = new BankAccountVerifyOptions { Amounts = new List <long> { 32, 45, } }; }
public CreditNoteServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new CreditNoteService(); this.createOptions = new CreditNoteCreateOptions { Amount = 100, InvoiceId = "in_123", Reason = "duplicate", }; this.updateOptions = new CreditNoteUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new CreditNoteListOptions { Limit = 1, InvoiceId = "in_123", }; this.voidOptions = new CreditNoteVoidOptions { }; }
public InvoiceItemServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new InvoiceItemService(); this.createOptions = new InvoiceItemCreateOptions { Amount = 123, Currency = "usd", CustomerId = "cus_123", }; this.updateOptions = new InvoiceItemUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new InvoiceItemListOptions { Limit = 1, }; }
public FileServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new FileService(this.StripeClient); this.createOptions = new FileCreateOptions { File = typeof(FileServiceTest).GetTypeInfo().Assembly.GetManifestResourceStream(FileName), FileLinkData = new FileLinkDataOptions { Create = true, Metadata = new Dictionary <string, string> { { "key", "value" }, }, }, Purpose = FilePurpose.BusinessLogo, }; this.listOptions = new FileListOptions { Limit = 1, }; }
public ProductServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new ProductService(this.StripeClient); this.createOptions = new ProductCreateOptions { Name = "product name", PackageDimensions = new ProductPackageDimensionsOptions { Height = 100, Length = 100, Weight = 100, Width = 100, }, }; this.updateOptions = new ProductUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new ProductListOptions { Limit = 1, }; }
public CustomerServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new CustomerService(this.StripeClient); this.createOptions = new CustomerCreateOptions { Email = "*****@*****.**", Source = "tok_123", }; this.updateOptions = new CustomerUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new CustomerListOptions { Limit = 1, }; }
public TransferReversalServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new TransferReversalService(this.StripeClient); this.createOptions = new TransferReversalCreateOptions { Amount = 123, }; this.updateOptions = new TransferReversalUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new TransferReversalListOptions { Limit = 1, }; }
public TaxRateServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new TaxRateService(this.StripeClient); this.createOptions = new TaxRateCreateOptions { DisplayName = "Name", Inclusive = true, Percentage = 12.5m, }; this.updateOptions = new TaxRateUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new TaxRateListOptions { Limit = 1, }; }
public PromotionCodeServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new PromotionCodeService(this.StripeClient); this.createOptions = new PromotionCodeCreateOptions { Coupon = "co_123", Code = "TESTCODE", }; this.updateOptions = new PromotionCodeUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new PromotionCodeListOptions { Limit = 1, }; }
public ExternalAccountServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new ExternalAccountService(); this.createOptions = new ExternalAccountCreateOptions { ExternalAccountBankAccount = new AccountBankAccountOptions { AccountNumber = "000123456789", Country = "US", Currency = "usd", RoutingNumber = "110000000", } }; this.updateOptions = new ExternalAccountUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new ExternalAccountListOptions { Limit = 1, }; }
public SubscriptionItemServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new SubscriptionItemService(this.StripeClient); this.createOptions = new SubscriptionItemCreateOptions { Plan = "plan_123", Quantity = 1, Subscription = "sub_123", }; this.deleteOptions = new SubscriptionItemDeleteOptions { ClearUsage = true, }; this.updateOptions = new SubscriptionItemUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new SubscriptionItemListOptions { Limit = 1, Subscription = "sub_123", }; }
public FileLinkServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new FileLinkService(this.StripeClient); this.createOptions = new FileLinkCreateOptions { File = "file_123", }; this.updateOptions = new FileLinkUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new FileLinkListOptions { File = "file_123", Limit = 1, }; }
public CardServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new CardService(this.StripeClient); this.createOptions = new CardCreateOptions { Source = "tok_123", }; this.updateOptions = new CardUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new CardListOptions { Limit = 1, }; }
public CouponServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new CouponService(this.StripeClient); this.createOptions = new CouponCreateOptions { PercentOff = 25, Duration = "forever", }; this.updateOptions = new CouponUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new CouponListOptions { Limit = 1, }; }
public RefundServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new RefundService(this.StripeClient); this.createOptions = new RefundCreateOptions { Amount = 123, ChargeId = "ch_123", }; this.updateOptions = new RefundUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new RefundListOptions { Limit = 1, }; }
public TopupServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new TopupService(this.StripeClient); this.createOptions = new TopupCreateOptions { Amount = 123, Currency = "usd", StatementDescriptor = "descriptor", }; this.updateOptions = new TopupUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new TopupListOptions { Limit = 1, }; }
public ChargeServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new ChargeService(this.StripeClient); this.captureOptions = new ChargeCaptureOptions { Amount = 123, }; this.createOptions = new ChargeCreateOptions { Amount = 123, Currency = "usd", Source = "tok_123", }; this.updateOptions = new ChargeUpdateOptions { FraudDetails = new ChargeFraudDetailsOptions { UserReport = "safe", }, }; this.listOptions = new ChargeListOptions { Limit = 1, }; }
public BalanceServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new BalanceService(this.StripeClient); }
public TransferServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new TransferService(this.StripeClient); this.createOptions = new TransferCreateOptions { Amount = 123, Currency = "usd", Destination = "acct_123", }; this.updateOptions = new TransferUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new TransferListOptions { Limit = 1, }; }
public DiscountServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new DiscountService(this.StripeClient); }
public EventUtilityTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.eventTimestamp = 1533204620; this.secret = "webhook_secret"; this.signature = $"t={this.eventTimestamp},v1=f0bdba6d4eacbd8ad8a3bbadd7248e633ec1477f7899c124c51b39405fa36613,v0=63f3a72374a733066c4be69ed7f8e5ac85c22c9f0a6a612ab9a025a9e4ee7eef"; this.json = GetResourceAsString("event_test_signature.json"); }
public PlanServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new PlanService(this.StripeClient); this.createOptions = new PlanCreateOptions { AmountDecimal = 0.01234567890m, // Ensure decimals work Currency = "usd", Interval = "month", Nickname = "Plan Nickmame", Product = new PlanProductCreateOptions { Name = "Product Name", }, }; this.createDecimalTierOptions = new PlanCreateOptions { Currency = "usd", Interval = "month", Nickname = "Plan Nickmame", Product = new PlanProductCreateOptions { Name = "Product Name", }, Tiers = new List <PlanTierOptions> { new PlanTierOptions { UnitAmountDecimal = 0.04m, UpTo = 10, }, new PlanTierOptions { UnitAmountDecimal = 0.03m, UpTo = PlanTierUpTo.Inf, }, }, }; this.updateOptions = new PlanUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; this.listOptions = new PlanListOptions { Limit = 1, }; }