public WebhookEvent(WebhookEventType type, WebhookEventSource source, long timestamp, string mode) { Type = type; Source = source; Timestamp = timestamp; Mode = mode; }
public static string ToWebhookTypeString(this WebhookEventType type) { switch (type) { case WebhookEventType.PackageShipped: return("package_shipped"); case WebhookEventType.PackageReturned: return("package_returned"); case WebhookEventType.OrderFailed: return("order_failed"); case WebhookEventType.OrderCancelled: return("order_canceled"); case WebhookEventType.ProductSynced: return("product_synced"); case WebhookEventType.ProductUpdated: return("product_updated"); case WebhookEventType.StockUpdated: return("stock_updated"); case WebhookEventType.OrderPutOnHold: return("order_put_hold"); case WebhookEventType.OrderRemoveHold: return("order_remove_hold"); default: throw new ArgumentOutOfRangeException(nameof(type), type, "Unrecognised Webhook event type"); } }
public static WebhookInvoiceEvent GetWebhookEvent(WebhookEventType webhookEventType) { switch (webhookEventType) { case WebhookEventType.InvoiceCreated: return(new WebhookInvoiceEvent(WebhookEventType.InvoiceCreated)); case WebhookEventType.InvoiceReceivedPayment: return(new WebhookInvoiceReceivedPaymentEvent(WebhookEventType.InvoiceReceivedPayment)); case WebhookEventType.InvoicePaymentSettled: return(new WebhookInvoicePaymentSettledEvent(WebhookEventType.InvoicePaymentSettled)); case WebhookEventType.InvoiceProcessing: return(new WebhookInvoiceProcessingEvent(WebhookEventType.InvoiceProcessing)); case WebhookEventType.InvoiceExpired: return(new WebhookInvoiceExpiredEvent(WebhookEventType.InvoiceExpired)); case WebhookEventType.InvoiceSettled: return(new WebhookInvoiceSettledEvent(WebhookEventType.InvoiceSettled)); case WebhookEventType.InvoiceInvalid: return(new WebhookInvoiceInvalidEvent(WebhookEventType.InvoiceInvalid)); default: return(new WebhookInvoiceEvent(WebhookEventType.InvoiceCreated)); } }
public static ILineEventDispatcher Create(WebhookEventType eventType) { switch (eventType) { case WebhookEventType.Message: return(new MessageEventDispatcher()); case WebhookEventType.Postback: return(new PostbackEventDispatcher()); case WebhookEventType.Join: return(new JoinEventDispatcher()); case WebhookEventType.Leave: return(new LeaveEventDispatcher()); case WebhookEventType.AccountLink: return(new AccountLinkEventDispatcher()); case WebhookEventType.Beacon: return(new BeaconEventDispatcher()); case WebhookEventType.Follow: return(new FollowEventDispatcher()); case WebhookEventType.Unfollow: return(new UnfollowEventDispatcher()); default: throw new UnsupportedWebhookEventTypeException(); } }
public void WebhookEventTypeSubscribedEventsTest() { var webhookEventTypeList = WebhookEventType.SubscribedEventTypes(TestingUtil.GetApiContext(), "45R80540W07069023"); Assert.IsNotNull(webhookEventTypeList); Assert.IsNotNull(webhookEventTypeList.event_types); Assert.AreEqual(2, webhookEventTypeList.event_types.Count); }
/// <summary> /// Initializes a new instance of the <see cref="Webhook" /> class. /// </summary> /// <param name="Id">unique Signifyd generated integer identifying this webhook.</param> /// <param name="EventType">EventType.</param> /// <param name="EventDisplayText">A more human friendly version of the event type..</param> /// <param name="Url">the URL to which the webhook data should be sent when the event is triggered.</param> /// <param name="Team">Team.</param> public Webhook(int?Id = default(int?), WebhookEventType EventType = default(WebhookEventType), string EventDisplayText = default(string), string Url = default(string), Team Team = default(Team)) { this.Id = Id; this.EventType = EventType; this.EventDisplayText = EventDisplayText; this.Url = Url; this.Team = Team; }
public void WebhookEventTypeAvailableEventsTest() { var webhookEventTypeList = WebhookEventType.AvailableEventTypes(TestingUtil.GetApiContext()); Assert.IsNotNull(webhookEventTypeList); Assert.IsNotNull(webhookEventTypeList.event_types); Assert.IsTrue(webhookEventTypeList.event_types.Count > 2); }
public WebhookEvent(WebhookEventType type, WebhookEventSource source, long timestamp, string mode, string webhookEventId, DeliveryContext deliveryContext) { Type = type; Source = source; Timestamp = timestamp; Mode = mode; WebhookEventId = webhookEventId; DeliveryContext = deliveryContext; }
public static string EnumToString(this WebhookEventType type) { switch (type) { case WebhookEventType.InventoryUpdated: return("INVENTORY_UPDATED"); case WebhookEventType.PaymentUpdated: return("PAYMENT_UPDATED"); case WebhookEventType.TimecardUpdated: return("TIMECARD_UPDATED"); default: throw new ArgumentOutOfRangeException(); } }
private WebhookEvent GetTestWebHook(string storeId, string webhookId, WebhookEventType webhookEventType, Data.WebhookDeliveryData delivery) { var webhookEvent = GetWebhookEvent(webhookEventType); webhookEvent.InvoiceId = "__test__" + Guid.NewGuid().ToString() + "__test__"; webhookEvent.StoreId = storeId; webhookEvent.DeliveryId = delivery.Id; webhookEvent.WebhookId = webhookId; webhookEvent.OriginalDeliveryId = "__test__" + Guid.NewGuid().ToString() + "__test__"; webhookEvent.IsRedelivery = false; webhookEvent.Timestamp = delivery.Timestamp; return(webhookEvent); }
public void WebhookEventTypeAvailableEventsTest() { try { var apiContext = TestingUtil.GetApiContext(); this.RecordConnectionDetails(); var webhookEventTypeList = WebhookEventType.AvailableEventTypes(apiContext); this.RecordConnectionDetails(); Assert.IsNotNull(webhookEventTypeList); Assert.IsNotNull(webhookEventTypeList.event_types); Assert.IsTrue(webhookEventTypeList.event_types.Count > 2); } catch (ConnectionException) { this.RecordConnectionDetails(false); throw; } }
/// <summary> /// Get the event object based on the event type enumeration /// </summary> public Type GetEventObjectType(WebhookEventType eventType) { switch (eventType) { case WebhookEventType.CustomerEvent: return(typeof(customerEvent)); case WebhookEventType.FraudEvent: return(typeof(customerEvent)); case WebhookEventType.PaymentEvent: return(typeof(customerEvent)); case WebhookEventType.PaymentProfileEvent: return(typeof(customerEvent)); case WebhookEventType.SubscriptionEvent: return(typeof(customerEvent)); default: return(null); } }
public async Task <DeliveryResult> TestWebhook(string storeId, string webhookId, WebhookEventType webhookEventType, CancellationToken cancellationToken) { var delivery = NewDelivery(webhookId); var webhook = (await StoreRepository.GetWebhooks(storeId)).FirstOrDefault(w => w.Id == webhookId); var deliveryRequest = new WebhookDeliveryRequest( webhookId, GetTestWebHook(storeId, webhookId, webhookEventType, delivery), delivery, webhook.GetBlob() ); return(await SendDelivery(deliveryRequest, cancellationToken)); }
/// <summary> /// Initializes a new instance of the <see cref="WebhookRequest" /> class. /// </summary> /// <param name="_Event">_Event.</param> /// <param name="Url">the URL to which the webhook data should be sent when the event is triggered.</param> public WebhookRequest(WebhookEventType _Event = default(WebhookEventType), string Url = default(string)) { this._Event = _Event; this.Url = Url; }
public bool Match(WebhookEventType evt) { return(Everything || SpecificEvents.Contains(evt)); }
public WebhookInvoiceReceivedPaymentEvent(WebhookEventType evtType) : base(evtType) { }
public ReplyableEvent(WebhookEventType eventType, WebhookEventSource source, long timestamp, string replyToken) : base(eventType, source, timestamp) { ReplyToken = replyToken; }
public WebhookInvoiceInvalidEvent(WebhookEventType evtType) : base(evtType) { }
public WebhookInvoiceProcessingEvent(WebhookEventType evtType) : base(evtType) { }
public WebhookInvoiceSettledEvent(WebhookEventType evtType) : base(evtType) { }
public WebhookInvoiceEvent(WebhookEventType evtType) { this.Type = evtType; }
public WebhookInvoiceExpiredEvent(WebhookEventType evtType) : base(evtType) { }
public WebhookEvent(WebhookEventType type, WebhookEventSource source, long timestamp) { Type = type; Source = source; Timestamp = timestamp; }
public ReplyableEvent(WebhookEventType eventType, WebhookEventSource source, long timestamp, string replyToken, string mode, string webhookEventId, DeliveryContext deliveryContext) : base(eventType, source, timestamp, mode, webhookEventId, deliveryContext) { ReplyToken = replyToken; }