move api/server to api/edge/bff

This commit is contained in:
Stephan D
2026-02-28 00:39:20 +01:00
parent 34182af3b8
commit 98db0e4e9e
248 changed files with 406 additions and 18 deletions

View File

@@ -0,0 +1,25 @@
package paymentapiimp
import (
"net"
"strings"
"github.com/tech/sendico/server/interface/api/srequest"
)
func applyCustomerIP(intent *srequest.PaymentIntent, remoteAddr string) {
if intent == nil {
return
}
ip := strings.TrimSpace(remoteAddr)
if ip == "" {
return
}
if host, _, err := net.SplitHostPort(ip); err == nil && host != "" {
ip = host
}
if intent.Customer == nil {
intent.Customer = &srequest.Customer{}
}
intent.Customer.IP = strings.TrimSpace(ip)
}