feat: stream CreditCall payment progress and results
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user