Shared API notes, rules and test vectors for the community Selcom API clients: Java, Node/TypeScript, framework-agnostic PHP, and a Laravel package.
Documentation: https://selcom-developers.github.io/
The community clients must sign requests identically, read results identically, and pass the same test vectors.
Not affiliated with Selcom Paytech Ltd. For API access, credentials, contracts and support, go to Selcom: https://developers.selcommobile.com/.
| Path | What it is |
|---|---|
| docs/signing.md | The exact request-signing algorithm, with worked examples and pitfalls |
| docs/api-v1.md | The operations in scope for v1: checkout and payouts |
| docs/results.md | Result codes, the typed statuses, and the retry and idempotency rules |
| docs/webhooks.md | Verifying and handling checkout webhooks |
| docs/client-requirements.md | What every client must do |
| vectors/signing.json | Signing test vectors (generated) |
| vectors/responses/ | Response fixtures for each v1 operation, and webhook samples |
| tools/ | The Python reference implementation, the vector generator and the fixture checker |
Bring this repository into the client's tests at a pinned version: a git submodule, or a copy refreshed by a script, recorded with the commit SHA or tag it came from. Then:
vectors/signing.json
- For each entry in
cases, call the client's pure signing function withparams,timestamp,api_keyandsecret(andmethod). Assert that the result matchesexpected.flattened,signed_fields,signing_string,digestandauthorization. - For GET and DELETE cases, assert the query string equals
expected.query. - For POST cases, parse
expected.bodyand the client's body and assert the same keys, in the same order, with the same values and JSON types. The bytes may differ in whitespace and string escaping. paramsis an ordered JSON object: read it with a parser that keeps key order.expected.flattenedis a list of[key, value]pairs and is ordered whatever the parser does.- For each entry in
rejects, assert that the signer raises and that no request is built. Matching theerrorcode is recommended but not required. - Entries with
"known": truehold values that are fixed outside this repository. They never change. - Entries with
"scope": "signer"test the signer alone and are not real requests.
vectors/responses/<operation>.json
- Each file describes one operation and its
kind. For each scenario, feedhttp_statusand the body (raw_bodyas-is, orbodyserialised as JSON) to the client's response handling for that operation. Assert the typed status equalsexpected_status, or that the client raises the error inexpected_error. checkout.webhook.jsonholds webhook deliveries. Run the samples in order through one replay store, with the secret, clock and window fromverification. Assert eachexpected_verificationverdict andexpected_amount_tzs.
All credentials in this repository are the sample values printed in Selcom's public documentation, or made up. None of them works against the gateway. All other data is fake: phone numbers in the 2557000000xx range, e-mail addresses on example.com, vendor TILL123.
- Change the doc in
docs/and the reference intools/selcom_reference.pyin the same pull request. - Regenerate the vectors:
python tools/generate_vectors.py. Never editvectors/signing.jsonby hand. - Add or update fixtures in
vectors/responses/and runpython tools/check_fixtures.py. - Open issues in each client for the change.
CI runs python tools/generate_vectors.py --check and python tools/check_fixtures.py and fails if the committed vectors drift from the reference or a fixture breaks the rules. The tools need Python 3.10 or later and nothing outside the standard library.
Never commit real credentials, real customer data, or details of any merchant's integration.
Apache License 2.0. Copyright The Selcom Developers community contributors.