Compare commits

...
2 Commits
Author SHA1 Message Date
Yurii b303481b5f removed insertion of transaction into db 2025-07-04 12:46:50 +01:00
Yurii 41cf71a253 made url parametrs hexadecimal encoded 2025-07-01 11:21:34 +01:00
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -310,9 +310,9 @@ func (app *App) startTransaction(w http.ResponseWriter, r *http.Request) {
}
// Insert into DB
if err := payment.InsertTransactionRecord(r.Context(), app.db, result); err != nil {
log.Errorf("DB insert error: %v", err)
}
// if err := payment.InsertTransactionRecord(r.Context(), app.db, result); err != nil {
// log.Errorf("DB insert error: %v", err)
// }
theResponse.Data = payment.BuildRedirectURL(result)
+3 -2
View File
@@ -3,6 +3,7 @@ package payment
import (
"context"
"database/sql"
"encoding/hex"
"encoding/xml"
"fmt"
"net/url"
@@ -261,8 +262,8 @@ func BuildRedirectURL(result map[string]string) string {
// 3) build query params
q := url.Values{}
q.Set("TxnReference", result["REFERENCE"])
q.Set("CardHash", result["CARD_HASH"])
q.Set("CardReference", result["CARD_REFERENCE"])
q.Set("CardHash", hex.EncodeToString([]byte(result["CARD_HASH"])))
q.Set("CardReference", hex.EncodeToString([]byte(result["CARD_REFERENCE"])))
// only append these when non-approved
if msgType != "" {