Test yookassa callback

This commit is contained in:
2026-03-14 15:47:55 +03:00
parent 970e64745b
commit e4bfb49f21
2 changed files with 27 additions and 2 deletions

View File

@@ -1,7 +1,10 @@
package payout
import (
"encoding/json"
"errors"
"fmt"
"log/slog"
"net/http"
"regexp"
@@ -15,7 +18,7 @@ import (
)
const (
BaseRoute = "/payment"
BaseRoute = "/payout"
CreateRoute = "/create"
CallbackRoute = "/callback"
BanksRoute = "/sbp/banks"
@@ -87,5 +90,10 @@ func (p *payoutHandler) PayoutCreate(w http.ResponseWriter, r *http.Request) {
}
// PaymentCallback implements [Handler].
func (p *payoutHandler) PayoutCallback(http.ResponseWriter, *http.Request) {
func (p *payoutHandler) PayoutCallback(w http.ResponseWriter, r *http.Request) {
inData := map[string]any{}
decoder := json.NewDecoder(r.Body)
decoder.Decode(&inData)
slog.Info(fmt.Sprintf("Received callback from %s with object %v with headers %v", r.RemoteAddr, inData, r.Header))
}