Test yookassa callback
This commit is contained in:
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user