Skip to content

Send steamid as a string and allow transactions without a channel - #21

Merged
DarkGL merged 2 commits into
mainfrom
fix/steamid-string-optional-channel
Nov 30, 2026
Merged

DarkGL merged 2 commits into
mainfrom
fix/steamid-string-optional-channel

Conversation

@DarkGL

@DarkGL DarkGL commented Nov 30, 2026

Copy link
Copy Markdown
Member
  1. Antifraud miał ?int $steamid. api (Payment/Transactions/StoreRequest) waliduje antifraud.steamid jako string, więc płatność z podanym STEAMID64 kończyła się błędem 422. Konstruktor przyjmuje teraz int albo string (bez typu w sygnaturze, bo SDK wspiera PHP 7.4) i zawsze wysyła string. Dotychczasowe wywołania z intem działają dalej.
  2. PaymentTransaction::$channel był string, a api (TransactionResource) zwraca channel: null, dopóki płacący nie wybierze kanału. paymentGetTransaction() rzucał wtedy TypeError. Teraz ?string, a control i description używają ?? null.

Dwa nowe testy padają na starym kodzie i przechodzą po poprawce. composer test 27 OK, phpstan bez błędów. ecs zgłasza 4 pliki, których ten PR nie dotyka; tak samo jest na main.

Rafał Więcek added 2 commits November 30, 2026 10:24
The API validates antifraud.steamid as a string, so the int property made
every payment with a STEAMID64 fail with 422. Antifraud now accepts an
int or a string and always sends a string.

The API returns channel null until the payer picks a channel, and
PaymentTransaction required a string, so paymentGetTransaction threw a
TypeError for pending transactions.
The Guzzle client had no timeout, so a stalled connection blocked the
caller indefinitely. Connecting now gives up after 10 seconds and the
whole request after 30.
@DarkGL

DarkGL commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Dodałem też timeouty HTTP (połączenie 10 s, całe żądanie 30 s) w HttpClientFactory, z testem, który pada na starym kodzie. 28 testów OK, phpstan bez błędów.

@DarkGL
DarkGL merged commit 1d884a3 into main Nov 30, 2026
7 checks passed
@DarkGL
DarkGL deleted the fix/steamid-string-optional-channel branch November 30, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant