Skip to content

fix(resellerclub): read the order id the API returns as a bare integer - #459

Merged
Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:fix/resellerclub-order-id
Nov 18, 2026
Merged

Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:fix/resellerclub-order-id

Conversation

@ertugrulkeyvan

Copy link
Copy Markdown
Contributor

What was wrong

Every ResellerClub command that works on an existing domain looks the order up first with domains/orderid.json. ResellerClub documents the answer as the order id, a plain integer ("Returns the Order Id (Integer) associated with a registered domain name", KB answer 763).

call() is typed to return an array, so the decoded integer raised a TypeError. The catch in call() turned it into an ERROR response, and getOrderId() returned null. So for every ResellerClub domain:

  • renew failed with "Domain order not found at ResellerClub."
  • nameserver changes and the lock toggle returned false
  • the EPP code showed "(Not available)"

The existing renew test passed only because its fake answered ["12345678"], an array the API does not send.

Reported in the community: https://community.pnlcs.com/t/43

The change

  • call() wraps a non-array JSON answer as ['value' => …], so the return type holds.
  • getOrderId() reads that value. The old [0] form still works.
  • getNameservers() returned the ns1 string from a method typed array. That TypeError was not caught. It now collects ns1…ns13 into a list, the same way syncDomain() reads them.

Tests

tests/Feature/ResellerClubOrderIdTest.php fakes the documented bare integer. On main, 3 of its 4 tests fail: renew, the EPP code with nameserver save and lock, and the nameserver list. With the change, all 4 pass. Full suite: 5,430 passed; the 2 failures (CurrencyAndBackupTest, MailLinkHostTest) fail the same way on main.

domains/orderid.json answers with the order id as a plain integer. The
shared call() helper is typed to return an array, so the decoded integer
raised a TypeError, the catch turned it into an ERROR response and
getOrderId() returned null. Every command that looks the order up first
failed: renew ("Domain order not found"), nameserver changes, the lock
toggle and the EPP code.

call() now wraps a non-array JSON answer as ['value' => ...] and
getOrderId() reads it. getNameservers() also returned the ns1 string from
an array method; it now collects the ns1..ns13 keys into a list.
@Panelica
Panelica merged commit f1ba3b0 into Panelica:main Nov 18, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Merged, thank you.

Verified before merging: call() is declared : array, so the bare integer domains/orderid.json answers made the return $response->json() line throw a TypeError that the method's own catch (\Throwable) swallowed into ['status' => 'ERROR'] — every lookup then read as "order not found". getNameservers() had the same shape: it returned $response['ns1'], a string, from a method declared : array.

Your tests, run on 1.29.0 before the merge: 3 of 4 red (the fourth is the guard that an unknown domain is still reported as not found). All green after. Measured on the merge result: the full suite is green — 5463 passed in parallel (--exclude-group=serial, 4 processes) plus the 17 serial installer tests, 5 skipped, 0 failed.

@Panelica

Copy link
Copy Markdown
Owner

Released in 1.30.0, the stable channel, offered to every installation.

Gates on the tag and that package: full suite 5463 passed in parallel plus the 17 serial installer tests (0 failed, 5 skipped); 276 translation and parity tests green; the update lab 14 scenarios ALL GREEN; the real package updated the last stable (1.29.0 → 1.30.0, 13 checks) and the last beta (1.25.1-beta.1 → 1.30.0, 14 checks), each installed from its published package in the published runtime image with the signature checked by the key built into the application; the three uploaded assets re-downloaded and compared byte for byte before publishing.

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.

2 participants