public async Task Test_IsolateTokensBetweenEnvironments() { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "sdk-unit-tests"; api.Config.ClientPassword = "******"; api.Config.BaseUrl = "https://api.sandbox.mangopay.com"; OAuthTokenDTO token1 = await api.OAuthTokenManager.GetToken(); api.Config.ClientId = "sdk_example"; api.Config.ClientPassword = "******"; api.Config.BaseUrl = "https://api.sandbox.mangopay.com"; OAuthTokenDTO token2 = await api.OAuthTokenManager.GetToken(); Assert.AreNotEqual(token1.access_token, token2.access_token); api.Config.ClientId = "sdk-unit-tests"; api.Config.ClientPassword = "******"; api.Config.BaseUrl = "https://api.sandbox.mangopay.com"; OAuthTokenDTO token3 = await api.OAuthTokenManager.GetToken(); Assert.AreEqual(token1.access_token, token3.access_token); }
public void ApiAndUsersConstructionTest() { MangoPayApi api = new MangoPayApi(); Assert.IsNotNull(api); Assert.IsNotNull(api.Users); }
/// <summary>Instantiates new RestTool object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> /// <param name="authRequired">Defines whether request authentication is required.</param> public RestTool(MangoPayApi root, bool authRequired) { this._root = root; this._authRequired = authRequired; LogManager.Adapter = this._root.Config.LoggerFactoryAdapter; this._log = LogManager.GetLogger(this._root.Config.LoggerFactoryAdapter.GetType()); }
/// <summary>Instantiates new RestTool object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> /// <param name="authRequired">Defines whether request authentication is required.</param> public RestTool(MangoPayApi root, bool authRequired) { this._root = root; this._authRequired = authRequired; LogManager.Adapter = this._root.Config.LoggerFactoryAdapter; this._log = LogManager.GetLogger(this._root.Config.LoggerFactoryAdapter.GetType()); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; }
public void Test_ShareTokenBetweenInstances() { MangoPayApi api = this.BuildNewMangoPayApi(); OAuthTokenDTO token1 = this.Api.OAuthTokenManager.GetToken(); OAuthTokenDTO token2 = api.OAuthTokenManager.GetToken(); Assert.AreEqual(token1.access_token, token2.access_token); }
public async Task Test_ShareTokenBetweenInstances() { MangoPayApi api = this.BuildNewMangoPayApi(); OAuthTokenDTO token1 = await this.Api.OAuthTokenManager.GetTokenAsync(); OAuthTokenDTO token2 = await api.OAuthTokenManager.GetTokenAsync(); Assert.AreEqual(token1.access_token, token2.access_token); }
protected MangoPayApi BuildNewMangoPayApi() { MangoPayApi api = new MangoPayApi(); // use test client credentails api.Config.ClientId = "sdk-unit-tests"; api.Config.ClientPassword = "******"; api.Config.BaseUrl = "https://api.sandbox.mangopay.com"; api.Config.LoggerFactoryAdapter = new ConsoleOutLoggerFactoryAdapter(); // register storage strategy for tests api.OAuthTokenManager.RegisterCustomStorageStrategy(new DefaultStorageStrategyForTests()); return(api); }
/// <summary>Instantiates new ApiRefunds object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiRefunds(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiCards object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiCards(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiWallets object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiWallets(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiWallets object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiBankingAliases(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiEvents object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiEvents(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiUsers object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiUsers(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiOAuth object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiOAuth(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiDisputes object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiDisputes(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiPayIns object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiPayIns(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new AuthenticationHelper object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public AuthenticationHelper(MangoPayApi root) { this._root = root; }
/// <summary>Instantiates new ApiHooks object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiHooks(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiPayOuts object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiPayOuts(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiClients object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiClients(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiTransfers object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiTransfers(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new AuthorizationTokenManager object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instances.</param> public AuthorizationTokenManager(MangoPayApi root) : base(root) { this.RegisterCustomStorageStrategy(new DefaultStorageStrategy()); }
/// <summary>Instantiates new ApiCardRegistration object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiCardRegistrations(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiKyc object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiKyc(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiIdempotency object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiIdempotency(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiCardPreAuthorizations object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiCardPreAuthorizations(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiMandates object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiMandates(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new ApiReports object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiReports(MangoPayApi root) : base(root) { }
/// <summary>Creates new API instance.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiBase(MangoPayApi root) { _root = root; }
/// <summary>Instantiates new ApiPermissionGroups object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public ApiPermissionGroups(MangoPayApi root) : base(root) { }
/// <summary>Instantiates new UrlTool object.</summary> /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param> public UrlTool(MangoPayApi root) { this._root = root; }
public BaseTest() { this.Api = BuildNewMangoPayApi(); }
public ApiUboDeclarations(MangoPayApi root) : base(root) { }