feat: stream CreditCall payment progress and results

This commit is contained in:
2026-09-08 13:41:29 +01:00
parent ea578fe03e
commit 93ff67fbb1
12 changed files with 1099 additions and 108 deletions
+10 -3
View File
@@ -168,9 +168,7 @@ func BuildSuccessURL(result map[string]string) string {
func BuildFailureURL(msgType, description string) string {
q := url.Values{}
if msgType != "" {
description = fmt.Sprintf("Transaction %s", strings.ToLower(msgType))
}
description = FailureDescription(msgType, description)
if description != "" {
msgType = types.ResultError
}
@@ -185,3 +183,12 @@ func BuildFailureURL(msgType, description string) string {
RawQuery: q.Encode(),
}).String()
}
// FailureDescription preserves the description used by the legacy payment flow
// without requiring structured consumers to construct a redirect URL.
func FailureDescription(msgType, description string) string {
if msgType != "" {
return fmt.Sprintf("Transaction %s", strings.ToLower(msgType))
}
return description
}