webhooks

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL