veli games and popok callback identifiers fix
This commit is contained in:
parent
d40bdcf33c
commit
c5fe2b8297
|
|
@ -808,4 +808,4 @@ func calculatePerformanceScore(perf domain.BranchPerformance) float64 {
|
|||
winRateScore := perf.WinRate * 0.1
|
||||
|
||||
return profitScore + customerScore + betScore + winRateScore
|
||||
}
|
||||
}
|
||||
|
|
@ -516,23 +516,22 @@ func (h *Handler) ListFavorites(c *fiber.Ctx) error {
|
|||
func identifyBetProvider(body []byte) (string, error) {
|
||||
// Check for Veli signature fields
|
||||
var veliCheck struct {
|
||||
TransactionID string `json:"transaction_id"`
|
||||
GameID string `json:"game_id"`
|
||||
SessionID string `json:"sessionId"`
|
||||
BrandID string `json:"brandId"`
|
||||
}
|
||||
if json.Unmarshal(body, &veliCheck) == nil {
|
||||
if veliCheck.TransactionID != "" && veliCheck.GameID != "" {
|
||||
if veliCheck.SessionID != "" && veliCheck.BrandID != "" {
|
||||
return "veli", nil
|
||||
}
|
||||
}
|
||||
|
||||
// Check for PopOK signature fields
|
||||
var popokCheck struct {
|
||||
Token string `json:"token"`
|
||||
PlayerID string `json:"player_id"`
|
||||
BetAmount float64 `json:"bet_amount"`
|
||||
Token string `json:"externalToken"`
|
||||
}
|
||||
|
||||
if json.Unmarshal(body, &popokCheck) == nil {
|
||||
if popokCheck.Token != "" && popokCheck.PlayerID != "" {
|
||||
if popokCheck.Token != "" {
|
||||
return "popok", nil
|
||||
}
|
||||
}
|
||||
|
|
@ -544,23 +543,22 @@ func identifyBetProvider(body []byte) (string, error) {
|
|||
func identifyWinProvider(body []byte) (string, error) {
|
||||
// Check for Veli signature fields
|
||||
var veliCheck struct {
|
||||
TransactionID string `json:"transaction_id"`
|
||||
WinAmount float64 `json:"win_amount"`
|
||||
SessionID string `json:"sessionId"`
|
||||
BrandID string `json:"brandId"`
|
||||
}
|
||||
if json.Unmarshal(body, &veliCheck) == nil {
|
||||
if veliCheck.TransactionID != "" && veliCheck.WinAmount > 0 {
|
||||
if veliCheck.SessionID != "" && veliCheck.BrandID != "" {
|
||||
return "veli", nil
|
||||
}
|
||||
}
|
||||
|
||||
// Check for PopOK signature fields
|
||||
var popokCheck struct {
|
||||
Token string `json:"token"`
|
||||
PlayerID string `json:"player_id"`
|
||||
WinAmount float64 `json:"win_amount"`
|
||||
Token string `json:"externalToken"`
|
||||
}
|
||||
|
||||
if json.Unmarshal(body, &popokCheck) == nil {
|
||||
if popokCheck.Token != "" && popokCheck.PlayerID != "" {
|
||||
if popokCheck.Token != "" {
|
||||
return "popok", nil
|
||||
}
|
||||
}
|
||||
|
|
@ -571,24 +569,22 @@ func identifyWinProvider(body []byte) (string, error) {
|
|||
func identifyCancelProvider(body []byte) (string, error) {
|
||||
// Check for Veli cancel signature
|
||||
var veliCheck struct {
|
||||
TransactionID string `json:"transaction_id"`
|
||||
OriginalTxID string `json:"original_transaction_id"`
|
||||
CancelReason string `json:"cancel_reason"`
|
||||
SessionID string `json:"sessionId"`
|
||||
BrandID string `json:"brandId"`
|
||||
}
|
||||
if json.Unmarshal(body, &veliCheck) == nil {
|
||||
if veliCheck.TransactionID != "" && veliCheck.OriginalTxID != "" {
|
||||
if veliCheck.SessionID != "" && veliCheck.BrandID != "" {
|
||||
return "veli", nil
|
||||
}
|
||||
}
|
||||
|
||||
// Check for PopOK cancel signature
|
||||
var popokCheck struct {
|
||||
Token string `json:"token"`
|
||||
PlayerID string `json:"player_id"`
|
||||
OriginalTxID string `json:"original_transaction_id"`
|
||||
Token string `json:"externalToken"`
|
||||
}
|
||||
|
||||
if json.Unmarshal(body, &popokCheck) == nil {
|
||||
if popokCheck.Token != "" && popokCheck.PlayerID != "" && popokCheck.OriginalTxID != "" {
|
||||
if popokCheck.Token != "" {
|
||||
return "popok", nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user