public async Task <bool> RegisterWebhook(string environment, string url, string userId)
        {
            url = "https://36716537.ngrok.io/account_activity";
            var userCredentials = await CredentialsRetriever.GetUserCredentials(userId);

            var result = await Webhooks.RegisterWebhookAsync(environment, url, userCredentials);

            if (result == null)
            {
                return(false);
            }

            // Register webhook in server
            var webhookEnvironment = Startup.WebhookConfiguration.RegisteredWebhookEnvironments.FirstOrDefault(x =>
                                                                                                               x.Name == environment);

            webhookEnvironment?.AddWebhook(result);

            return(true);
        }
Beispiel #2
0
        public static void RegisterWebHook()
        {
            var task = Webhooks.RegisterWebhookAsync(webHookEnvironmentName, webHooksEndpoint, Auth.Credentials);

            task.Wait();
        }