constantcontact/.net-sdk — pull request #28 by sergiugirnet (2014-08-11 15:03:48+00:00)
Title: WebHooks notifications implementation

Implemented Webhook Notifications into separare core object

Usage:
```cs
// The secret key provided by ConstantContact along with the API KEY
string sharedSecret = "";
// The HTTP HmacSha256 header ("x-ctct-hmac-sha256")
string ctctHeader = "";
// HTTP body message
string bodyMessage = "Body of the POST";

// Utility class used for validation and parsing the Constant Contact webhooks notifications
CTCTWebhookUtil webhookUtil = new CTCTWebhookUtil(sharedSecret);

// Webhook notification object
BillingChangeNotification notification = null;
try
{
// Get notification object based on the x-ctct-hmac-sha256 header and the request body
notification = webhookUtil.GetBillingChangeNotification(ctctHeader, bodyMessage);

// Make use of notification event type.
BillingChangeNotificationType eventType = notification.EventType;

// Event type check
if (eventType == BillingChangeNotificationType.TierIncrease)
{
// Tier increase action
}
else if (eventType == BillingChangeNotificationType.TierDecrease)
{
// Tier decrease action
}

// Make use of the URL in the notification
string url = notification.Url;

}
catch (CtctException ex)
{
// Webhook notification is corrupt or a parsing error occurred.
}
```