feat(hardlink): unify kiosk payments and finalize legacy cleanup
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package creditcall
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.futuresens.co.uk/futuresens/hardlink/internal/types"
|
||||
@@ -23,12 +22,12 @@ func TestPreauthLegacyDecision(t *testing.T) {
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
fields := map[string]string{types.TransactionResult: tc.result, types.TransactionType: tc.kind, types.Errors: "provider detail"}
|
||||
redirect, save := BuildPreauthRedirectURL(fields)
|
||||
if strings.HasPrefix(redirect, "/successful?") != tc.approved || save != tc.save {
|
||||
t.Errorf("BuildPreauthRedirectURL(%v) = %q,%t, want approved=%t save=%t", fields, redirect, save, tc.approved, tc.save)
|
||||
approved, save := PreauthDecision(fields)
|
||||
if approved != tc.approved || save != tc.save {
|
||||
t.Errorf("PreauthDecision(%v) = %t,%t, want approved=%t save=%t", fields, approved, save, tc.approved, tc.save)
|
||||
}
|
||||
if _, ok := fields[types.TotalAmount]; ok {
|
||||
t.Error("BuildPreauthRedirectURL fabricated TOTAL_AMOUNT")
|
||||
t.Error("PreauthDecision fabricated TOTAL_AMOUNT")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user