Skip to content

porkbun: registration spends prepaid credit, and balance is pennies - #33

Merged
ralyodio merged 1 commit into
masterfrom
porkbun-credit-fix
Aug 29, 2026
Merged

porkbun: registration spends prepaid credit, and balance is pennies#33
ralyodio merged 1 commit into
masterfrom
porkbun-credit-fix

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Two corrections, both found by reading llms-full.txt (the full API reference) instead of the overview page.

There is no card

register told users it "pays from the account balance, topping up the card on file if that is short." That is wrong. /domain/create spends prepaid account credit and refuses outright when the balance won't cover the price:

Register a domain using account credit. Requirements:

  • Account email and phone must be verified
  • Account must have sufficient credit
  • Account must have placed at least one previous domain registration
  • Premium domains cannot be registered via API

The overview's "auto top-up on API spend" is an opt-in guardrail on the API settings page, not the default funding path. An account at $0.00 cannot register anything, so short funds is now a stop that names the shortfall rather than a note promising a charge that would never happen.

balance is pennies, as a number

The dry-run preview returns "balance": 5000 meaning $50.00 — an integer, not a rendered string. It was parsed with a typeof === 'string' guard, so it evaluated to null for every account on every call, and the CLI printed balance: unknown unconditionally. That is the worst shape of bug: it reads as "the API didn't tell us" rather than as something broken, so it would have sat there indefinitely.

Now parsed as pennies, with both balanceCents and a rendered balance. The preview also keeps Porkbun's own message, which is worth printing verbatim on a refusal.

Documented gates

The three account facts Porkbun requires that no read endpoint exposes are now recorded in the README and --help: a verified email and phone, at least one registration placed previously, and the name not being premium (premium is website-only at any price).

Testing

Why this surfaced

Registering diskpush.com is blocked on VERIFICATION_REQUIRED, so the pre-flight path had never actually run to completion against a live account — which is exactly how a null-for-everyone parse and a wrong sentence about billing both survived review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QLFd9jDQ4D5UpHCWFJi8YM

Two corrections, both from reading the full API reference rather than the
overview page.

`register` claimed it "pays from the account balance, topping up the card on
file if that is short". There is no card. `/domain/create` spends **prepaid
account credit** and refuses outright when the balance will not cover the
price — the overview's "auto top-up on API spend" is an opt-in guardrail on the
API settings page, not the default funding path. An account sitting at $0.00
cannot register anything, so short funds is now a stop that names the shortfall
rather than a note promising a charge that will never happen.

`balance` in the dry-run preview is **pennies as a number** (5000 meaning
$50.00), not a rendered string. It was being read with a `typeof === 'string'`
guard, so it came back null for every account on every call — the kind of
nothing that reads as "the API didn't say" rather than as a bug. The CLI
printed `balance: unknown` and would have gone on doing so forever.

Also records the three account gates the reference documents and no read
endpoint exposes: verified email *and* phone, at least one previous
registration, and premium names being website-only at any price.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLFd9jDQ4D5UpHCWFJi8YM
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

16 finding(s)

HIGH/CRITICAL: 5 | MEDIUM: 2 | LOW: 9

Severity Rule Location
HIGH sh-remote-script-execution root-ubuntu.sh:134
HIGH sh-remote-script-execution root-ubuntu.sh:2597
HIGH sh-remote-script-execution root-ubuntu.sh:2601
HIGH sh-remote-script-execution root-ubuntu.sh:2654
HIGH sh-remote-script-execution root-ubuntu.sh:3683
MEDIUM redos-nested-quantifier src/domain-free.ts:56
MEDIUM redos-nested-quantifier src/porkbun.ts:506
LOW secret-generic-credential src/credentials.ts:36
LOW insecure-temp-file test/blog.test.ts:73
LOW insecure-temp-file test/blog.test.ts:74
LOW insecure-temp-file test/credentials.test.ts:43
LOW insecure-temp-file test/credentials.test.ts:44
LOW secret-generic-api-key test/credentials.test.ts:208
LOW insecure-temp-file test/download.test.ts:99
LOW insecure-temp-file test/download.test.ts:100
LOW secret-generic-credential test/shorten.test.ts:36

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit db8361d into master Aug 29, 2026
5 checks passed
@ralyodio
ralyodio deleted the porkbun-credit-fix branch August 29, 2026 17:26
ralyodio added a commit that referenced this pull request Aug 30, 2026
Eight commits since 0.15.0, one of them a new command, so the minor moves.

- sysupdate: apt lists, apt packages and snaps in one command, reachable
  from the pit as /update (#37)
- root-ubuntu.sh: a 2G swapfile on a box with no swap at all, plus
  vm.swappiness=10 (#36)
- root-ubuntu.sh: one ssh-agent per user under systemd (#35)
- root-ubuntu.sh: lm-sensors, smartmontools and the rest of the hardware
  inventory set, with sensor detection on bare metal
- companions: diskpush, and installers that are not npm (#34)
- porkbun: Porkbun's own pre-flight, structured refusals, and the fact that
  registration spends prepaid credit rather than a card (#32, #33)


Claude-Session: https://claude.ai/code/session_013TerE4nvNU3jvS51nRR6Pd

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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