func RegisterEventHandler(event string, handleFunc eventHandler) {
	EventHandlers[event] = handleFunc
}
RegisterEventHandler adds the handler to the list of handlers
It will overwrite handler if one exists for event already
package events
import (
	"errors"
	"fmt"
	"github.com/stripe/stripe-go"
	"github.com/stripe/stripe-go/event"
)
type eventHandler func(hook *stripe.Event) (err error)
type validateHandler func(hook *stripe.Event) (event *stripe.Event, err error)
var EventHandlers = make(map[string]eventHandler)
var ValidationHandler validateHandler
func RegisterEventHandlers() {
	RegisterEventHandler("invoice.payment_succeeded", func(event *stripe.Event) error {
		customer, ok := event.Data.Obj["customer"]
		if !ok {
			return errors.New("Could not find customer in event")
		}
		customer, ok = customer.(string)
		if !ok {
			return errors.New("Customer field was not expected type")
		}
		fmt.Printf("Event %s handled, type %s for customer %s\n", event.ID, event.Type, customer)
		return nil
	})
	RegisterEventHandler("invoice.payment_failed", func(event *stripe.Event) error {
		return nil
	})
}