feat(hardlink): unify kiosk payments and finalize legacy cleanup

This commit is contained in:
2026-11-04 17:43:10 +00:00
parent 568adc034b
commit 814d87768d
57 changed files with 3624 additions and 1762 deletions
+38
View File
@@ -0,0 +1,38 @@
package paymentsvc
import (
"context"
"encoding/json"
"errors"
"io"
"net"
)
// SafeErrorCategory describes a failure without exposing URLs, payloads or credentials.
// It is diagnostic only and must not determine financial outcomes or retry eligibility.
func SafeErrorCategory(err error) string {
if err == nil {
return "unresolved_result"
}
switch {
case errors.Is(err, context.DeadlineExceeded):
return "timeout"
case errors.Is(err, context.Canceled):
return "cancelled"
case errors.Is(err, io.EOF), errors.Is(err, io.ErrUnexpectedEOF):
return "response_lost"
}
var networkError net.Error
if errors.As(err, &networkError) {
if networkError.Timeout() {
return "timeout"
}
return "connection_failure"
}
var syntaxError *json.SyntaxError
var typeError *json.UnmarshalTypeError
if errors.As(err, &syntaxError) || errors.As(err, &typeError) {
return "invalid_response"
}
return "provider_error"
}