Documentation ¶
Overview ¶
Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
Index ¶
Constants ¶
View Source
const SIGNATURE_HEADER = "lightspark-signature"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebhookEvent ¶
type WebhookEvent struct { EventType objects.WebhookEventType EventId string Timestamp time.Time EntityId string WalletId *string Data *map[string]interface{} }
func Parse ¶
func Parse(data []byte) (*WebhookEvent, error)
Parse Parses the message into a WebhookEvent object.
Args:
data: the POST message body received by the webhook.
func VerifyAndParse ¶
func VerifyAndParse(data []byte, hexdigest string, webhookSecret string) (*WebhookEvent, error)
VerifyAndParse Verifies the signature and parses the message into a WebhookEvent object.
Args:
data: the POST message body received by the webhook. hexdigest: the message signature sent in the `lightspark-signature` header. webhookSecret: the webhook secret configured at the Lightspark API configuration.
Click to show internal directories.
Click to hide internal directories.