Esempio n. 1
0
        public MChatScanPayment(MChatScanPaymentBuilder configBuilder)
        {
            this.configBuilder = configBuilder;
            httpClient.DefaultRequestHeaders.Clear();
            httpClient.DefaultRequestHeaders.Add("Authorization", "WorkerKey " + this.configBuilder.workerKey);
            httpClient.DefaultRequestHeaders.Add("Api-Key", this.configBuilder.apiKey);
            MChatBusinessNotificationServiceBuilder builder = new MChatBusinessNotificationServiceBuilder();

            builder.domain  = "biznot.mongolchat.com";
            builder.port    = 8790;
            builder.apiKey  = this.configBuilder.apiKey;
            builder.timeout = this.configBuilder.timeout;
            this.businessNotificationService = builder.Build();
        }
Esempio n. 2
0
        public MChatWorkerClient()
        {
            MChatWorkerConfiguration.Instance.CheckIsConfigured();
            if (MChatWorkerConfiguration.Instance.workerType == MChatWorkerConfiguration.MChatWorkerType.MChatWorkerBasic)
            {
                httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + MChatWorkerConfiguration.Instance.authorization);
            }
            else if (MChatWorkerConfiguration.Instance.workerType == MChatWorkerConfiguration.MChatWorkerType.MChatWorkerKey)
            {
                httpClient.DefaultRequestHeaders.Add("Authorization", "WorkerKey " + MChatWorkerConfiguration.Instance.authorization);
            }
            httpClient.DefaultRequestHeaders.Add("Api-Key", MChatWorkerConfiguration.Instance.apiKey);
            MChatBusinessNotificationServiceBuilder builder = new MChatBusinessNotificationServiceBuilder();

            builder.domain  = env_test ? "local.mongolchat.com" : "biznot.mongolchat.com";
            builder.port    = 8790;
            builder.apiKey  = MChatWorkerConfiguration.Instance.apiKey;
            builder.timeout = MChatWorkerConfiguration.Instance.bnsTimeout == 0 ? 120000 : MChatWorkerConfiguration.Instance.bnsTimeout;
            this.businessNotificationService = builder.Build();
        }