Skip to content

fix(resellerclub): transfers and registrations send what the API requires - #466

Merged
Panelica merged 3 commits into
Panelica:mainfrom
ertugrulkeyvan:fix/resellerclub-transfer-contacts
Nov 18, 2026
Merged

Panelica merged 3 commits into
Panelica:mainfrom
ertugrulkeyvan:fix/resellerclub-transfer-contacts

Conversation

@ertugrulkeyvan

Copy link
Copy Markdown
Contributor

Built on #459 and #463. Its first two commits are those PRs; the third is this change. I will rebase it once they are merged.

Checked against ResellerClub's API reference: KB answers 752 (register), 758 (transfer) and 794 (default contacts). Reported in the community: https://community.pnlcs.com/t/43

What was wrong, and the change

  • Transfer. domains/transfer.json requires customer-id, the four contact ids and auto-renew. The module sent only the name, the auth code and two example.com nameservers, so a transfer could not be placed. It now:
    • finds or creates the customer from the domain's client;
    • sends the contacts and auto-renew=false;
    • sends the auth code only when there is one, since the API marks it optional;
    • leaves ns out unless the domain has nameservers of its own.
  • Default contacts. contacts/default.json is a POST. It answers per contact type with registrantContactDetails, adminContactDetails and so on, each carrying entity.entityid. The module sent a GET, read a contactid key that does not exist, and fell back to the customer id, which is never a contact id. Now, if there is no default contact, the order stops instead.
  • Registries without some contacts. .uk, .ru and .eu have no admin contact; .uk and .ru have no tech contact; .uk, .ru, .at, .berlin, .ca, .nl and .nz have no billing contact. Those now go as -1, as the transfer reference says. A .uk default contact is requested as UkContact.
  • Register. register.json requires auto-renew and real nameservers. Without nameservers, the registration now stops instead of pointing the domain at ns1.example.com.
  • Customer signup. customers/signup.json returns the new id as a bare integer, as orderid.json does. And the phone always went with country code 1; +44 20 … now gives phone-cc 44.

Tests

tests/Feature/ResellerClubTransferTest.php has 5 tests and fakes the documented answers: a transfer with all the required fields, a .uk transfer with -1 contacts and no code, a registration with real nameservers, no nameservers, and no default contact. Without this change, 4 of the 5 fail; with it, all 5 pass. Full suite: 5,441 passed; the 2 failures (CurrencyAndBackupTest, MailLinkHostTest) fail the same way on main.

…s instead of inventing them

eNom, Namecheap, ResellerClub (customer signup) and Openprovider filled a
missing detail with a placeholder - "Admin", "123 Main St", "Anytown",
CA 90210, US, +1.5555555555 - and registered the domain under it. WHOIS
then names nobody, which breaks registry accuracy rules and can cost the
customer the domain.

App\Support\RegistrantContact lists the details every registrar here
needs (name, email, phone, address, city, country; state and postcode do
not exist in every country). When one is empty the registration stops
before anything is sent and the message names it; the admin can retry
from the domain page once the client's profile is complete.

Fixes Panelica#452.
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.
…ires

From ResellerClub's API reference (KB answers 752 register, 758 transfer,
794 default contacts):

- transfer.json requires customer-id, the four contact ids and auto-renew.
  The module sent only the name, the auth code and two example.com
  nameservers, so a transfer could not be placed. It now finds or creates
  the customer from the domain's client, sends the contacts and
  auto-renew=false, sends the auth code only when there is one (it is
  optional there), and leaves ns out unless the domain has its own.
- contacts/default.json is a POST and answers per type with
  registrantContactDetails, adminContactDetails, ... each carrying
  entity.entityid. The module sent a GET, read a 'contactid' key that does
  not exist and fell back to the customer id, which is never a contact id.
  No default contact now stops the order instead.
- .uk, .ru and .eu have no admin contact, .uk and .ru no tech contact,
  and .uk, .ru, .at, .berlin, .ca, .nl, .nz no billing contact; those go
  as -1. A .uk default contact is asked for as UkContact.
- register.json requires auto-renew and real nameservers. No nameservers
  now stops the registration instead of pointing the domain at
  ns1.example.com.
- customers/signup.json returns the new id as a bare integer (as
  orderid.json does), and the phone went with country code 1 whatever the
  number; '+44 20 ...' now gives phone-cc 44.
@Panelica
Panelica merged commit dc14db4 into Panelica:main Nov 18, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Merged, thank you — this one was carrying a real foot-gun: transfer() sent ns => ['ns1.example.com', 'ns2.example.com'], so a transferred domain's DNS was pointed at example.com, and getDefaultContact() fell back to the customer id, which is never a contact id.

Verified that refusing a registration with no nameservers is a visible failure rather than a silent one: registerOrderedDomain() marks the domain pending, dispatches domain.registration_failed and logs the reason, so the operator hears about it — far better than registering the name against a placeholder.

4 of 5 tests red on 1.29.0, 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.

Two notes for later, neither a blocker:

  • splitPhone() falls back to country code 1 when the number carries no + prefix (the old code hard-coded phone-cc to 1, so this is not a regression). A number stored as 05321234567 for a Turkish customer still goes up as cc 1. The client's country would be a better fallback.
  • The -1 contact lists per TLD come from KB 758; if a registry is missing from them the call fails loudly at the API, which is the right way round.

@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