veli games and popok callback identifiers fix

This commit is contained in:
Yared Yemane 2025-08-19 17:50:30 +03:00
parent d40bdcf33c
commit c5fe2b8297
2 changed files with 19 additions and 23 deletions

View File

@ -516,23 +516,22 @@ func (h *Handler) ListFavorites(c *fiber.Ctx) error {
func identifyBetProvider(body []byte) (string, error) { func identifyBetProvider(body []byte) (string, error) {
// Check for Veli signature fields // Check for Veli signature fields
var veliCheck struct { var veliCheck struct {
TransactionID string `json:"transaction_id"` SessionID string `json:"sessionId"`
GameID string `json:"game_id"` BrandID string `json:"brandId"`
} }
if json.Unmarshal(body, &veliCheck) == nil { if json.Unmarshal(body, &veliCheck) == nil {
if veliCheck.TransactionID != "" && veliCheck.GameID != "" { if veliCheck.SessionID != "" && veliCheck.BrandID != "" {
return "veli", nil return "veli", nil
} }
} }
// Check for PopOK signature fields // Check for PopOK signature fields
var popokCheck struct { var popokCheck struct {
Token string `json:"token"` Token string `json:"externalToken"`
PlayerID string `json:"player_id"`
BetAmount float64 `json:"bet_amount"`
} }
if json.Unmarshal(body, &popokCheck) == nil { if json.Unmarshal(body, &popokCheck) == nil {
if popokCheck.Token != "" && popokCheck.PlayerID != "" { if popokCheck.Token != "" {
return "popok", nil return "popok", nil
} }
} }
@ -544,23 +543,22 @@ func identifyBetProvider(body []byte) (string, error) {
func identifyWinProvider(body []byte) (string, error) { func identifyWinProvider(body []byte) (string, error) {
// Check for Veli signature fields // Check for Veli signature fields
var veliCheck struct { var veliCheck struct {
TransactionID string `json:"transaction_id"` SessionID string `json:"sessionId"`
WinAmount float64 `json:"win_amount"` BrandID string `json:"brandId"`
} }
if json.Unmarshal(body, &veliCheck) == nil { if json.Unmarshal(body, &veliCheck) == nil {
if veliCheck.TransactionID != "" && veliCheck.WinAmount > 0 { if veliCheck.SessionID != "" && veliCheck.BrandID != "" {
return "veli", nil return "veli", nil
} }
} }
// Check for PopOK signature fields // Check for PopOK signature fields
var popokCheck struct { var popokCheck struct {
Token string `json:"token"` Token string `json:"externalToken"`
PlayerID string `json:"player_id"`
WinAmount float64 `json:"win_amount"`
} }
if json.Unmarshal(body, &popokCheck) == nil { if json.Unmarshal(body, &popokCheck) == nil {
if popokCheck.Token != "" && popokCheck.PlayerID != "" { if popokCheck.Token != "" {
return "popok", nil return "popok", nil
} }
} }
@ -571,24 +569,22 @@ func identifyWinProvider(body []byte) (string, error) {
func identifyCancelProvider(body []byte) (string, error) { func identifyCancelProvider(body []byte) (string, error) {
// Check for Veli cancel signature // Check for Veli cancel signature
var veliCheck struct { var veliCheck struct {
TransactionID string `json:"transaction_id"` SessionID string `json:"sessionId"`
OriginalTxID string `json:"original_transaction_id"` BrandID string `json:"brandId"`
CancelReason string `json:"cancel_reason"`
} }
if json.Unmarshal(body, &veliCheck) == nil { if json.Unmarshal(body, &veliCheck) == nil {
if veliCheck.TransactionID != "" && veliCheck.OriginalTxID != "" { if veliCheck.SessionID != "" && veliCheck.BrandID != "" {
return "veli", nil return "veli", nil
} }
} }
// Check for PopOK cancel signature // Check for PopOK cancel signature
var popokCheck struct { var popokCheck struct {
Token string `json:"token"` Token string `json:"externalToken"`
PlayerID string `json:"player_id"`
OriginalTxID string `json:"original_transaction_id"`
} }
if json.Unmarshal(body, &popokCheck) == nil { if json.Unmarshal(body, &popokCheck) == nil {
if popokCheck.Token != "" && popokCheck.PlayerID != "" && popokCheck.OriginalTxID != "" { if popokCheck.Token != "" {
return "popok", nil return "popok", nil
} }
} }