public void SettingSandboxModeShouldUseSandboxUrl() { var expectedSandboxUrl = "https://sandbox.gateway.sezzle.com/v1/"; var config = new SezzleConfig(String.Empty, String.Empty, true); Assert.AreEqual(expectedSandboxUrl, config.ApiUrl); }
public void NotSettingSandboxModeShouldUseProductionUrl() { var expectedProductionUrl = "https://gateway.sezzle.com/v1/"; var config = new SezzleConfig(String.Empty, String.Empty, false); Assert.AreEqual(expectedProductionUrl, config.ApiUrl); }
public async Task Setup() { var appSettings = ConfigurationManager.AppSettings; var publicKey = appSettings["SezzleApiPublicKey"]; var privateKey = appSettings["SezzleApiPrivateKey"]; SezzleConfig = new SezzleConfig(publicKey, privateKey, true); var auth = new Auth(SezzleConfig); AuthResponse = await auth.RequestToken(); }
public async Task CanGetTokenWithPublicAndPrivateKeys() { var appSettings = ConfigurationManager.AppSettings; var publicKey = appSettings["SezzleApiPublicKey"]; var privateKey = appSettings["SezzleApiPrivateKey"]; var config = new SezzleConfig(publicKey, privateKey, true); var auth = new Auth(config); var authResponse = await auth.RequestToken(); Assert.IsNotNull(authResponse); Assert.IsNotEmpty(authResponse.Token); Console.WriteLine(authResponse.Token); Console.WriteLine(authResponse.ExpirationDate); }
protected SezzleApi(string endpoint, SezzleConfig sezzleConfig, AuthResponse authResponse) { SezzleConfig = sezzleConfig; AuthResponse = authResponse; var handler = new HttpClientHandler(); if (handler.SupportsAutomaticDecompression) { handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; } Client = new HttpClient(handler) { BaseAddress = new Uri(new Uri(SezzleConfig.ApiUrl), endpoint) }; }
public Configuration(string endpoint, SezzleConfig sezzleConfig, AuthResponse authResponse) : base(endpoint, sezzleConfig, authResponse) { }
public Configuration(SezzleConfig config, AuthResponse auth) : base("configuration/", config, auth) { }
public Configuration(SezzleConfig config) : this(config, null) { }
internal SezzleApi(string endpoint, SezzleConfig sezzleConfig) : this(endpoint, sezzleConfig, null) { }
public Checkouts(string endpoint, SezzleConfig sezzleConfig, AuthResponse authResponse) : base(endpoint, sezzleConfig, authResponse) { }
public Checkouts(SezzleConfig config, AuthResponse auth) : base("checkouts/", config, auth) { }
public Checkouts(SezzleConfig config) : this(config, null) { }
public Orders(string endpoint, SezzleConfig sezzleConfig, AuthResponse authResponse) : base(endpoint, sezzleConfig, authResponse) { }
public Orders(SezzleConfig config, AuthResponse auth) : base("orders/", config, auth) { }
public Orders(SezzleConfig config) : this(config, null) { }