api

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSignatureInvalid = errors.New("invalid Mercury webhook signature")
	ErrPayloadRead      = errors.New("failed to read webhook payload")
	ErrPayloadParse     = errors.New("failed to parse webhook payload")
)

Functions

func Route

func Route(router router.Router, args ...gin.HandlerFunc)

Route registers Mercury webhook endpoint.

func Webhook

func Webhook(c *gin.Context)

Webhook handles Mercury bank webhook POSTs.

POST /api/v1/mercury/webhook

On transaction.created with direction="credit":

  1. Verify HMAC signature via Mercury-Signature header
  2. Parse reference from externalMemo or note (format: "orgName:orderId")
  3. Look up the order in the org namespace
  4. Mark order as paid if it is pending

Returns 200 OK to Mercury regardless of processing outcome.

Types

This section is empty.

Jump to

Keyboard shortcuts

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