veli games signature extraData field issue fix

This commit is contained in:
Yared Yemane 2025-08-13 18:15:15 +03:00
parent 3310e01ccc
commit 7d2db5801c
2 changed files with 13 additions and 7 deletions

View File

@ -2,7 +2,7 @@ package domain
type ProviderRequest struct {
BrandID string `json:"brandId"`
ExtraData bool `json:"extraData,omitempty"`
ExtraData bool `json:"extraData"`
Size int `json:"size,omitempty"`
Page int `json:"page,omitempty"`
}

View File

@ -79,18 +79,24 @@ func (c *Client) post(ctx context.Context, path string, body any, sigParams map[
req.Header.Set("Content-Type", "application/json")
req.Header.Set("signature", sig)
// Print request info
fmt.Println("Request URL:", c.BaseURL+path)
fmt.Println("Request Headers:")
for k, v := range req.Header {
for _, val := range v {
fmt.Printf(" %s: %s\n", k, val)
}
}
fmt.Println("Request Body:", string(data))
// Send request
res, err := c.http.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
fmt.Println("Request URL:", c.BaseURL+path)
fmt.Println("Request Headers:")
fmt.Println(" Content-Type: application/json")
fmt.Println(" signature:", sig)
fmt.Println("Request Body:", string(data))
// Read response
b, _ := io.ReadAll(res.Body)
if res.StatusCode >= 400 {
return fmt.Errorf("error: %s", b)