package main

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"time"
)

func main() {

	secret := "{{YOUR_SECRET_KEY}}"
	payoutID := "6778MYP412" // order_id
	path := fmt.Sprintf("api/v1/payout/%s/status", payoutID)
	method := "GET"

	 
	data := []interface{}{} // EMPTY ARRAY (not nil)
	jsonData, _ := json.Marshal(data)

	timestamp := time.Now().UnixNano() / int64(time.Millisecond)

	message := fmt.Sprintf("%s\n%s\n%s\n%d\n",
		method,
		path,
		string(jsonData),
		timestamp,
	)
	fmt.Println("message:", message)

	h := hmac.New(sha256.New, []byte(secret))
	h.Write([]byte(message))
	signature := hex.EncodeToString(h.Sum(nil))

	fmt.Println("signature:", signature)
	fmt.Println("timestamp:", timestamp)
}
