Example #1
0
        /// <summary>
        /// Creates a new instance of the QuickPayClient
        /// </summary>
        /// <param name="baseUrl">URL for API, if null it defaults to QuickPays standard URL</param>
        /// <param name="baseUrlInvoicing">URL for Invoicing API, if null it defaults to QuickPays standard URL</param>
        /// <param name="apiKey"></param>
        /// <param name="privateKey"></param>
        /// <param name="userKey"></param>
        public QuickPayClient(string baseUrl, string baseUrlInvoicing, string apiKey, string privateKey, string userKey)
        {
            _url          = baseUrl ?? "https://api.quickpay.net/";
            _urlInvoicing = baseUrlInvoicing ?? "https://invoicing.quickpay.net/";
            _apiKey       = apiKey;
            _privateKey   = privateKey;
            _userKey      = userKey;
            _httpClient   = BuildHttpClient(_url, _apiKey, null);

            Callbacks     = new CallbacksClient(_privateKey);
            Cards         = new CardsClient(_httpClient);
            Fees          = new FeesClient(_httpClient);
            Invoices      = new InvoicesClient(BuildHttpClient(_urlInvoicing, _userKey, "application/vnd.api+json"));
            Payments      = new PaymentsClient(_httpClient);
            Subscriptions = new SubscriptionsClient(_httpClient);
        }
Example #2
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("Test console started.");

            var client = new FeesClient(new FeesClientSettings {
                ServiceAddress = "http://localhost:5001"
            });

            var cashOperationsFees = await client.CashOperationsFees.GetAllByBrokerId("83829aa1-5888-45e4-997c-b133e58b7ab8");

            var cashOperationsFee = await client.CashOperationsFees.GetByBrokerIdAndAsset("83829aa1-5888-45e4-997c-b133e58b7ab8", "BTC");

            var tradingFees = await client.TradingFees.GetAllByBrokerId("83829aa1-5888-45e4-997c-b133e58b7ab8");

            var tradingFee = await client.TradingFees.GetByBrokerIdAndAssetPair("83829aa1-5888-45e4-997c-b133e58b7ab8", "BTCUSD");

            tradingFee = await client.TradingFees.GetByBrokerIdAndAssetPair("83829aa1-5888-45e4-997c-b133e58b7ab8", null);

            var settings = await client.Settings.GetByBrokerId("83829aa1-5888-45e4-997c-b133e58b7ab8");

            Console.WriteLine("Finished!");
            Console.ReadLine();
        }