Exemple #1
0
        public CardholderServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new CardholderService(this.StripeClient);

            this.createOptions = new CardholderCreateOptions
            {
                Billing = new BillingOptions
                {
                    Address = new AddressOptions
                    {
                        City       = "city",
                        Country    = "US",
                        Line1      = "line1",
                        PostalCode = "90210",
                        State      = "CA",
                    },
                },
                Company = new CardholderCompanyOptions
                {
                    TaxId = "123",
                },
                Individual = new CardholderIndividualOptions
                {
                    Dob = new CardholderIndividualDobOptions
                    {
                        Day   = 1,
                        Month = 1,
                        Year  = 1980,
                    },
                    FirstName    = "John",
                    LastName     = "Doe",
                    Verification = new CardholderIndividualVerificationOptions
                    {
                        Document = new CardholderIndividualVerificationDocumentOptions
                        {
                            Back  = "file_123",
                            Front = "file_234",
                        },
                    },
                },
                Name = "John Doe",
                Type = "individual",
            };

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

            this.listOptions = new CardholderListOptions
            {
                Limit = 1,
            };
        }
        public NumberOrderServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new NumberOrderService();

            this.createOptions = new NumberOrderCreateOptions()
            {
                PhoneNumbers = new List <PhoneNumber>()
                {
                    new PhoneNumber
                    {
                        Phone_Number = "+13127000090"
                    }
                }
            };

            this.updateOptions = new NumberOrderUpdateOptions
            {
                NumberOrderId = NumberOrderId,
                Body          = new NumberOrder
                {
                    CustomerReference = "MY REF"
                }
            };

            this.requestOptions = new RequestOptions();

            this.cancellationToken = default(CancellationToken);
        }
        public SimCardsServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new SimCardsService();

            this.listOptions = new ListOptions
            {
                PageNumber = 1,
                PageSize   = 20,
            };

            this.baseOptions = new BaseOptions();
            this.baseOptions.AddExtraParam("include_sim_card_group", "true");

            this.requestOptions       = new RequestOptions();
            this.updateSimCardOptions = new UpdateSimCardOptions()
            {
                Id             = "001",
                SimCardGroupId = Guid.NewGuid(),
                Tags           = new List <string>()
                {
                    "personal",
                    "active-customers",
                },
            };

            this.simCardRegisterOptions = new SimCardRegisterOptions
            {
                RegistrationCodes = new string[]
                {
                    "0000000001",
                    "0000000002",
                    "0000000003",
                },
                SimCardGroupId = "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
                Tags           = new string[]
                {
                    "personal",
                    "customers",
                    "active-customers",
                },
            };

            this.simCardBulkNetworkPreferenceUpdateOptions = new SimCardBulkNetworkPreferenceUpdateOptions
            {
                SimCardIds = new string[]
                {
                    "6b14e151-8493-4fa1-8664-1cc4e6d14158",
                    "6b14e151-8493-4fa1-8664-1cc4e6d14158",
                },
                MobileOperatorNetworksPreferences = new List <MobileOperatorNetworksPreferences>()
                {
                    new MobileOperatorNetworksPreferences()
                    {
                        MobileOperatorNetworkId = new Guid("6a09cdc3-8948-47f0-aa62-74ac943d6c58"),
                        Priority = 0,
                    },
                },
            };
        }
        public IssuingDisputeServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new DisputeService(this.StripeClient);

            this.createOptions = new DisputeCreateOptions
            {
                DisputedTransaction = "ipi_123",
                Evidence            = new EvidenceOptions
                {
                    Fraudulent = new EvidenceDetailsOptions
                    {
                        DisputeExplanation = "Explanation",
                        UncategorizedFile  = "file_123",
                    },
                },
                Reason = "fraudulent",
            };

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

            this.listOptions = new DisputeListOptions
            {
                Limit = 1,
            };
        }
Exemple #5
0
        public TelephonyCredentialServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new TelephonyCredentialService();

            this.listOptions = new ListOptions
            {
                PageNumber = 1,
                PageSize   = 20,
            };

            this.baseOptions = new BaseOptions();

            this.requestOptions = new RequestOptions();
            this.createOptions  = new TelephonyCredentialCreateOptions()
            {
                ConnectionId = "1234567890",
                ExpiresAt    = "2018-02-02T22:25:27.521Z",
                Name         = "admin",
            };

            this.updateOptions = new TelephonyCredentialUpdateOptions()
            {
                ConnectionId = "987654321",
                ExpiresAt    = "2018-02-02T22:25:27.521Z",
                Name         = "My Creds",
            };
        }
Exemple #6
0
 public MessagingProfileMetricsServiceTests(MockHttpClientFixture mockHttpClientFixture)
     : base(mockHttpClientFixture)
 {
     service     = new MessagingProfileMetricsService();
     listOptions = null; //null due to mock not allowing params
     getOptions  = null; //null due to mock not allowing params
 }
        public IssuingDisputeServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new DisputeService(this.StripeClient);

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

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

            this.listOptions = new DisputeListOptions
            {
                Limit = 1,
            };
        }
 public VerificationTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture)
 {
     _verificationService = new VerificationService("KEYSUPERSECRET");
     profileListOptions   = new VerifyProfileListOptions
     {
         Filter = "Test"
     };
     profileOptions = new VerifyProfileOptions
     {
         DefaultTimeoutSecs = 300,
         MessagingEnabled   = true,
         MessagingTemplate  = "Hello this is a test {code}",
         Name       = "Test Profile",
         RcsEnabled = false
     };
     verifyOptions = new VerifyOptions
     {
         TimeoutSecs     = 300,
         PhoneNumber     = "+13100000010",
         VerifyProfileId = Guid.NewGuid(),
         Type            = "sms",
     };
     codeOptions = new VerifyCodeOptions
     {
         Code = "2222"
     };
 }
        public ValueListServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new ValueListService(this.StripeClient);

            this.createOptions = new ValueListCreateOptions
            {
                Alias    = "alias",
                ItemType = "ip_address",
                Name     = "name",
            };

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

            this.listOptions = new ValueListListOptions
            {
                Alias = "alias",
                Limit = 1,
            };
        }
        public MessagingSenderIdServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new MessagingSenderIdService();

            this.sendMessageOptions = new NewMessagingSenderId
            {
                From = "+18665552368", // alphanumeric sender id
                To   = "+18665552367",
                Text = "Hello, World!"
            };

            this.sendMessageUsingNumberPoolOptions = new NewMessagingSenderId
            {
                MessagingProfileId = new Guid("dd50eba1-a0c0-4563-9925-b25e842a7cb6"),
                To   = "+18005550199",
                Text = "Hello, World!"
            };

            this.updateOptions = new MessagingSenderIdUpdate
            {
                MessagingProfileId = new Guid("3fa85f64-5717-4562-b3fc-2c963f66afa6")
            };

            this.requestOptions = new RequestOptions();

            this.cancellationToken = default(CancellationToken);
        }
Exemple #11
0
        public MessagingProfileServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service             = new MessagingProfileService();
            this.phoneNumbersService = new MessagingProfilePhoneNumbersService();

            this.createOptions = new NewMessagingProfile
            {
                Name               = "Summer Campaign",
                Enabled            = true,
                NumberPoolSettings = new NumberPoolSettings()
                {
                    Geomatch       = false,
                    LongCodeWeight = new decimal(0.62),
                    SkipUnhealthy  = true,
                    StickySender   = false,
                    TollFreeWeight = new decimal(25),
                },
                UrlShortenerSettings = new UrlShortenerSettings()
                {
                    Domain = "example.ex",
                    Prefix = "abc",
                    ReplaceBlackListOnly = true,
                    SendWebhooks         = false,
                },
                ResourceGroupId    = Guid.NewGuid(),
                WebhookApiVersion  = Telnyx.net.Entities.Enum.WebhookAPIVersion.V2,
                WebhookUrl         = "webhookurl.com",
                WebhookFailoverUrl = "failureurl.com",
            };
            this.updateOptions = new MessagingProfileUpdate
            {
                Name               = "Summer Campaign 2",
                Enabled            = false,
                NumberPoolSettings = new NumberPoolSettings()
                {
                    Geomatch       = false,
                    LongCodeWeight = new decimal(0.63),
                    SkipUnhealthy  = true,
                    StickySender   = false,
                    TollFreeWeight = new decimal(26),
                },
                UrlShortenerSettings = new UrlShortenerSettings()
                {
                    Domain = "example.px",
                    Prefix = "xyz",
                    ReplaceBlackListOnly = false,
                    SendWebhooks         = true,
                },
                WhitelistedDestinations = new List <string>()
                {
                    "US", "CA"
                },
                WebhookApiVersion  = Telnyx.net.Entities.Enum.WebhookAPIVersion.V2,
                WebhookUrl         = "webhookurlupdate.com",
                WebhookFailoverUrl = "failureurlupdate.com",
            };
            this.cancellationToken         = default(CancellationToken);
            this._mockServiceForListMethod = new MockMessagingProfilePhoneNumbersService();
        }
        public ConfigurationServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new ConfigurationService(this.StripeClient);

            this.createOptions = new ConfigurationCreateOptions
            {
                BusinessProfile = new ConfigurationBusinessProfileOptions
                {
                    PrivacyPolicyUrl  = "https://example.com/privacy",
                    TermsOfServiceUrl = "https://example.com/tos",
                },
                Features = new ConfigurationFeaturesOptions
                {
                    CustomerUpdate = new ConfigurationFeaturesCustomerUpdateOptions
                    {
                        AllowedUpdates = new List <string> {
                            "address"
                        },
                        Enabled = true,
                    },
                },
            };
            this.updateOptions = new ConfigurationUpdateOptions
            {
                Active = false,
            };
            this.listOptions = new ConfigurationListOptions
            {
                Active = true,
            };
        }
Exemple #13
0
 public FaxApplicationServiceTest(MockHttpClientFixture mockHttpClientFixture)
     : base(mockHttpClientFixture)
 {
     _faxAppService    = new FaxApplicationService();
     faxappListOptions = new FaxAppListOptions
     {
         Sort = Telnyx.net.Entities.Faxes.Applications.Options.SortOptions.ActiveDESC,
     };
     faxappOptions = new FaxAppOptions
     {
         WebhookEventFailoverUrl = "google.com",
         WebhookEventUrl         = "www.apple.com",
         WebhookTimeoutSecs      = 30,
         Active             = true,
         AnchorsiteOverride = AnchorsiteOverride.AmsterdamNetherlands,
         ApplicationName    = "TestApp",
         Inbound            = new Inbound
         {
             SipSubdomain = "telnyx.com",
             SipSubdomainReceiveSettings = SipSubdomainReceiveSettings.FromAnyone,
             ChannelLimit = 10,
         },
         Outbound = new Outbound
         {
             ChannelLimit           = 2,
             OutboundVoiceProfileId = Guid.NewGuid().ToString(),
         },
     };
 }
Exemple #14
0
 public MessagingProfileMetricsDetailServiceTest(MockHttpClientFixture mockHttpClientFixture)
     : base(mockHttpClientFixture)
 {
     metricsOptions = null;
     requestOptions = null;
     service        = new MessagingProfileMetricsDetailService();
 }
        public MessageServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new MessageService();

            this.createOptions = new NewMessage()
            {
                MessagingProfileId = Guid.NewGuid(),
                MediaUrls          = new List <string>()
                {
                    "example1.com", "example2.com"
                },
                WebhookUrl         = "webhookurl.com",
                WebhookFailoverUrl = "failureurl.com",
                UseProfileWebhooks = true,
                ValidityPeriodSecs = 01,
                IgnoreWireType     = true,
                From = "+18665552368",
                To   = "+18665552367",
                Text = "Hello, World!"
            };

            this.updateOptions = new NumberOrderUpdateOptions();

            this.listOptions = new NumberOrderListOptions();

            this.requestOptions = new RequestOptions();
        }
        public VerificationSessionServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new VerificationSessionService(this.StripeClient);

            this.createOptions = new VerificationSessionCreateOptions
            {
                Type = "id_number",
            };

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

            this.listOptions = new VerificationSessionListOptions
            {
                Limit = 1,
            };
        }
Exemple #17
0
        public IssuingCardServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new CardService(this.StripeClient);

            this.createOptions = new CardCreateOptions
            {
                AuthorizationControls = new AuthorizationControlsOptions
                {
                    MaxAmount = 123,
                },
                Currency = "usd",
                Type     = "virtual",
            };

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

            this.listOptions = new CardListOptions
            {
                Limit = 1,
            };
        }
        public ConnectionsServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new ConnectionService();

            this.listOptions = null;
        }
        public LocationServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new LocationService();

            this.createOptions = new LocationCreateOptions
            {
                Address = new AddressOptions
                {
                    State      = "CA",
                    City       = "City",
                    Line1      = "Line1",
                    Line2      = "Line2",
                    PostalCode = "90210",
                    Country    = "US",
                },
                DisplayName = "my location",
            };

            this.listOptions = new LocationListOptions
            {
            };

            this.updateOptions = new LocationUpdateOptions
            {
                DisplayName = "my_location_update",
            };
        }
 public SimCardBulkNetworkPreferenceServiceTest(MockHttpClientFixture mockHttpClientFixture)
     : base(mockHttpClientFixture)
 {
     this.options = new SimCardBulkNetworkPreferenceUpdateOptions {
         SimCardIds = new string[] { "001", "002" }
     };
     this.service = new SimCardBulkNetworkPreferenceService();
 }
Exemple #21
0
        public ConnectionTokenServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new ConnectionTokenService();

            this.createOptions = new ConnectionTokenCreateOptions
            {
            };
        }
        public ReportTypeServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new ReportTypeService();

            this.listOptions = new ReportTypeListOptions
            {
            };
        }
Exemple #23
0
 public MessagingPhoneNumbersServiceTest(MockHttpClientFixture mockHttpClientFixture)
     : base(mockHttpClientFixture)
 {
     this.service       = new MessagingPhoneNumbersService();
     this.updateOptions = new MessagingPhoneNumberUpdate
     {
         MessagingProfileId = new Guid("3fa85f64-5717-4562-b3fc-2c963f66afa6")
     };
 }
        public SessionServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new SessionService(this.StripeClient);

            this.createOptions = new SessionCreateOptions
            {
                CancelUrl         = "https://stripe.com/cancel",
                ClientReferenceId = "1234",
                LineItems         = new List <SessionLineItemOptions>
                {
                    new SessionLineItemOptions
                    {
                        Amount      = 1234,
                        Currency    = "usd",
                        Description = "item1",
                        Images      = new List <string>
                        {
                            "https://stripe.com/image1",
                        },
                        Name     = "item name",
                        Quantity = 2,
                    },
                },
                PaymentIntentData = new SessionPaymentIntentDataOptions
                {
                    Description = "description",
                    Shipping    = new ChargeShippingOptions
                    {
                        Name    = "name",
                        Phone   = "555-555-5555",
                        Address = new AddressOptions
                        {
                            State      = "CA",
                            City       = "City",
                            Line1      = "Line1",
                            Line2      = "Line2",
                            PostalCode = "90210",
                            Country    = "US",
                        },
                    },
                },
                PaymentMethodTypes = new List <string>
                {
                    "card",
                },
                SuccessUrl = "https://stripe.com/success",
            };

            this.listOptions = new SessionListOptions
            {
                Limit = 1,
            };
        }
 public SimCardNetworkPreferenceServiceTest(MockHttpClientFixture mockHttpClientFixture)
     : base(mockHttpClientFixture)
 {
     this.baseOptions    = new BaseOptions {
     };
     this.requestOptions = new RequestOptions()
     {
     };
     this.service = new SimCardNetworkPreferenceService();
 }
Exemple #26
0
        public InboundChannelServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new Telnyx.net.Services.PhoneNumbers.InboundChannels.InboundChannelService();

            this.updateOptions = new InboundChannelUpdateOptions
            {
                Channels = 7,
            };
        }
        public ConnectionTokenServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new ConnectionTokenService(this.StripeClient);

            this.createOptions = new ConnectionTokenCreateOptions
            {
            };
        }
        public CallControlHangupServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlHangupService();

            this.createOptions = new CallControlHangupOptions()
            {
                ClientState = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId   = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901")
            };
        }
        public ReportTypeServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new ReportTypeService(this.StripeClient);

            this.listOptions = new ReportTypeListOptions
            {
            };
        }
Exemple #30
0
        public EarlyFraudWarningServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new EarlyFraudWarningService();

            this.listOptions = new EarlyFraudWarningListOptions
            {
                Charge = "ch_123",
                Limit  = 1,
            };
        }