Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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());
 }
Exemplo n.º 4
0
 /// <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;
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 /// <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)
 {
 }
Exemplo n.º 9
0
 /// <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)
 {
 }
Exemplo n.º 10
0
 /// <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)
 {
 }
Exemplo n.º 11
0
 /// <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)
 {
 }
Exemplo n.º 12
0
 /// <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)
 {
 }
Exemplo n.º 13
0
 /// <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)
 {
 }
Exemplo n.º 14
0
 /// <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)
 {
 }
Exemplo n.º 15
0
 /// <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)
 {
 }
Exemplo n.º 16
0
 /// <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)
 {
 }
Exemplo n.º 17
0
 public void ApiAndUsersConstructionTest()
 {
     MangoPayApi api = new MangoPayApi();
     Assert.IsNotNull(api);
     Assert.IsNotNull(api.Users);
 }
Exemplo n.º 18
0
 /// <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)
 {
 }
Exemplo n.º 19
0
 /// <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)
 {
 }
Exemplo n.º 20
0
 /// <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;
 }
Exemplo n.º 22
0
 /// <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)
 {
 }
Exemplo n.º 23
0
 /// <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)
 {
 }
Exemplo n.º 24
0
 /// <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)
 {
 }
Exemplo n.º 25
0
 /// <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)
 {
 }
Exemplo n.º 26
0
 /// <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)
 {
 }
Exemplo n.º 29
0
 /// <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)
 {
 }
Exemplo n.º 30
0
 /// <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)
 {
 }
Exemplo n.º 31
0
 /// <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 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 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)
 {
 }
Exemplo n.º 36
0
 /// <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>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 ApiCardRegistration object.</summary>
 /// <param name="root">Root/parent instance that holds the OAuthToken and Configuration instance.</param>
 public ApiCardRegistrations(MangoPayApi root)
     : base(root)
 {
 }
Exemplo n.º 39
0
 /// <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;
 }
Exemplo n.º 40
0
 /// <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)
 {
 }
Exemplo n.º 41
0
 /// <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)
 {
 }
Exemplo n.º 42
0
 /// <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;
 }
Exemplo n.º 43
0
 /// <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());
 }
Exemplo n.º 44
0
 /// <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)
 {
 }
Exemplo n.º 45
0
 public BaseTest()
 {
     this.Api = BuildNewMangoPayApi();
 }
Exemplo n.º 46
0
 /// <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)
 {
 }
 public ApiUboDeclarations(MangoPayApi root)
     : base(root)
 {
 }
Exemplo n.º 48
0
 /// <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;
 }
Exemplo n.º 49
0
 /// <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)
 {
 }