Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b303481b5f | ||
|
|
41cf71a253 |
@@ -310,9 +310,9 @@ func (app *App) startTransaction(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Insert into DB
|
// Insert into DB
|
||||||
if err := payment.InsertTransactionRecord(r.Context(), app.db, result); err != nil {
|
// if err := payment.InsertTransactionRecord(r.Context(), app.db, result); err != nil {
|
||||||
log.Errorf("DB insert error: %v", err)
|
// log.Errorf("DB insert error: %v", err)
|
||||||
}
|
// }
|
||||||
|
|
||||||
theResponse.Data = payment.BuildRedirectURL(result)
|
theResponse.Data = payment.BuildRedirectURL(result)
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package payment
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"encoding/hex"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -261,8 +262,8 @@ func BuildRedirectURL(result map[string]string) string {
|
|||||||
// 3) build query params
|
// 3) build query params
|
||||||
q := url.Values{}
|
q := url.Values{}
|
||||||
q.Set("TxnReference", result["REFERENCE"])
|
q.Set("TxnReference", result["REFERENCE"])
|
||||||
q.Set("CardHash", result["CARD_HASH"])
|
q.Set("CardHash", hex.EncodeToString([]byte(result["CARD_HASH"])))
|
||||||
q.Set("CardReference", result["CARD_REFERENCE"])
|
q.Set("CardReference", hex.EncodeToString([]byte(result["CARD_REFERENCE"])))
|
||||||
|
|
||||||
// only append these when non-approved
|
// only append these when non-approved
|
||||||
if msgType != "" {
|
if msgType != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user