private int AddSubscription() { var request = new Subscribing { TargetUrl = "http://example.org/your_webhook_url", Event = "customer.insert", }; return(Sut.Subscribe(request).Id); }
public void ProcessConnected(IConnection connection) { Log.V("Processing connected, state: {0}", this); if (IsUnsubscribed) { if (!_fsm.MarkAsDeleted) { var next = new Subscribing(this, connection); _awaiter.Succeed(next); } } }
// Here comes the code I want to be executed when the event fires. public void ClickSubscribe() { // I make sure I have any subscribers before invoking the delegate // Then I call all the event handler methods registered with the Subscribing event. Subscribing?.Invoke(); // Same as: //if (Subscribing != null) //{ // Subscribing(); //} Console.WriteLine("You have subscribed to the newsletter."); }
public void should_call_Subscribing() { //arrange var request = new Subscribing { TargetUrl = "http://example.org/your_webhook_url", Event = "customer.insert", }; //act var actual = Sut.Subscribe(request); //assert Assert.AreEqual(201, actual.Code); Assert.IsEmpty(actual.Message); Assert.AreEqual("OK", actual.Status); }
/// <summary> /// Subscribing /// details: https://developer.chargeover.com/apidocs/rest/#subscribe-resthook /// </summary> public IIdentityResponse Subscribe(Subscribing request) { return(Create("/_resthook", request)); }
public void ClickSubscribe() { Subscribing?.Invoke(); Console.WriteLine("You have subscribed to the newsletter."); }