public async Task CreateAsync(WebHook webHook) { MongoWebHook m = webHook.ToMongo(); await WebHooks.InsertOneAsync(m); webHook.Id = m.Id; }
public HMACAuthAttribute(WebHooks webHooks) { WebHooks = webHooks; if (allowedApps.Count == 0) { allowedApps.Add(webHooks.AppId, webHooks.SharedKey); } }
public SearchApiOptions AddWebHook(string name, string uri) { WebHooks.Add(new WebHookNotification() { Name = name, Uri = uri, }); return(this); }
public static void DisplayItems(WebHooks webHooks) { if (webHooks != null && webHooks.Any()) { foreach (var item in webHooks) { DisplayItem(item); } } }
private void button1_Click(object sender, EventArgs e) { if (_webhooks == null || _webhooks.IsStopped) { StartProcess(_webhooks = new WebHooks(), sender as Button); } else { StopProcess(_webhooks, sender as Button); } }
public async Task <WebHook> GetAsync(Guid id) { MongoWebHook?result = WebHooks.AsQueryable().FirstOrDefault(x => x.Id == id); if (result == null) { throw new Exception(); } return(result.ToModel()); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddAuthorization(); // binding configuration from appsettings.json var webhooks = new WebHooks(); configuration.Bind("WebHooks", webhooks); services.AddSingleton(webhooks); services.AddScoped <AesHelper>(); }
/// <param name="apiKey">Apikey assigned to your commerce. You can find it in Panel.banzilla.com</param> /// <param name="secretKey">Secret Key assigned to your commerce. You can find it in Panel.banzilla.com</param> /// <param name="sandBox">true if you want simulate the charge.</param> public APIRequest(string apiKey, string secretKey, bool sandBox) { _apiKey = apiKey; _secretKey = secretKey; _sandBox = sandBox; Charge = new Charge(apiKey, secretKey, sandBox); Cards = new Cards(apiKey, secretKey, sandBox); BlackList = new BlackList(apiKey, secretKey, sandBox); Plans = new Plans(apiKey, secretKey, sandBox); Subscriptions = new Subscriptions(apiKey, secretKey, sandBox); WebHooks = new WebHooks(apiKey, secretKey, sandBox); }
public async Task <QueryResult <WebHook> > QueryAsync(WebHookQuery query) { IQueryable <MongoWebHook> q = WebHooks.AsQueryable(); if (query.Event != null) { q = q.Where(x => x.EventName == query.Event); } var items = q.ToList().Select(x => x.ToModel()).ToList(); return(new QueryResult <WebHook>() { Items = items }); }
public void ListMyWebHooks() { // List all the WebHooks defined in my Authorize.Net account var webHook = InitWebHook(); WebHooks webhooks = null; try { webhooks = webHook.List(); } catch (Exception err) { common.DisplayError(err); common.DisplayResponse(webHook); Assert.Fail("Exception from WebHook; Please see the output window for more information."); return; } if (webhooks != null && webhooks.Any()) { // see if we got any errors back from Authorize.Net that were not exceptions if (webhooks.AnyError()) { foreach (var webHookEx in webhooks.AllErrors()) { common.DisplayError(webHookEx.Exception); } } else { // no errors, we are good: Display the eventTypes and set the test as successful. common.DisplayItems(webhooks); Assert.IsTrue(true); } } else { Debug.WriteLine("No webhooks found in account."); } common.DisplayResponse(webHook); }
public AesHelper(WebHooks webHooks) { this.webHooks = webHooks; keyValue = Guid.Parse(this.webHooks.AppId).ToString("N"); }
public async Task DeleteAsync(WebHook webHook) { await WebHooks.DeleteOneAsync(Builders <MongoWebHook> .Filter.Eq(x => x.Id, webHook.Id)); }
public async Task UpdateAsync(WebHook webHook) { await WebHooks.ReplaceOneAsync(Builders <MongoWebHook> .Filter.Eq(x => x.Id, webHook.Id), webHook.ToMongo()); }