v0.1.2
Two merchant integrations of Hosted Fields — the same payment on a Go server and on a Node.js
one, with a browser half that is byte-for-byte identical between them.
See the README for screenshots and
a walk through the code.
Download
| Example | Platform | File |
|---|---|---|
| Go | Linux x86-64 | hosted-fields-examples-go_linux_amd64.tar.gz |
| Go | Linux arm64 | hosted-fields-examples-go_linux_arm64.tar.gz |
| Go | macOS Apple silicon | hosted-fields-examples-go_darwin_arm64.tar.gz |
| Go | Windows x64 | hosted-fields-examples-go_windows_amd64.zip |
| Node.js | any | hosted-fields-examples-nodejs-express-js.tar.gz |
The Go archives hold one static binary with the pages compiled in and need no runtime. The Node
archive holds a bundled server.js and needs Node 20+, but no npm install.
Verify with sha256sum -c SHA256SUMS.
The Linux archives also carry deploy/ with a systemd unit, an nginx snippet and an environment
template. The macOS and Windows builds do not: those are for trying the example on a laptop.
The macOS binary is not signed or notarised. Downloaded through a browser it arrives quarantined,
and Gatekeeper will refuse to start it until the attribute is cleared:
xattr -d com.apple.quarantine hosted-fields-examples-go
Running one
Every setting comes from the environment and none of them has a default: the app refuses to start
until the gateway URLs, the endpoint, the merchant login, the control key and the RSA private key
are all provided. See deploy/*.env.example in the Linux archive, and the README for what to ask
the gateway for.
Each app mounts everything under a URL prefix, so several of them fit behind one nginx.
Notes
- The RSA key signs the server calls and never leaves the server. It is not in this repository
and must not be committed. - Field validation messages the payer sees come from the SDK the gateway serves, not from this
code. To show them in a language of your own, switch onerror.coderather than printing
error.payerMessage.
Changes since v0.1.1
- Release archives no longer carry the version in their file name, so a link to
releases/latest/download/<name>keeps working across releases. The directory inside the
archive still names the version. - The README now opens with the two examples, screenshots of both screens, and a download table.