Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: 24
cache: npm
- run: npm ci
- name: Set up Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v6
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
- run: npm run build
- name: Upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: out

Expand All @@ -45,4 +45,4 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5
2 changes: 1 addition & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Identity tokens.
* Brand red: the ink of a hand-pressed payment stamp. Warm greys and a warm
* near-black carry the page; brass is the one secondary accent.
* The five status colours come from the spec's typed statuses. FAILED uses
* The status colours come from the spec's typed statuses. FAILED uses
* rose, not the brand red, so an error never looks like a link or a button.
* Text pairs meet WCAG AA in both themes.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/landing/features.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function Features() {
<BentoCard
className="md:col-span-2 lg:col-span-2"
name="Typed results"
description="The result code alone decides one of five statuses. You also get the gateway's code, text, HTTP status and raw body."
description="The result code alone decides one of the typed statuses. You also get the gateway's code, text, HTTP status and raw body."
href="/spec/results"
cta="See how results are classified"
>
Expand Down
2 changes: 1 addition & 1 deletion components/landing/flow-diagram.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const steps = [
{ icon: AppWindow, title: 'Your app', text: 'Calls one typed method, for example createOrder.' },
{ icon: Package, title: 'Client', text: 'Checks the fields and keeps them in the order you gave.' },
{ icon: Stamp, title: 'Signed request', text: 'HS256 digest over every field it sends, with a fresh timestamp.' },
{ icon: Server, title: 'Selcom gateway', text: 'Answers with a result code that becomes one of five statuses.' },
{ icon: Server, title: 'Selcom gateway', text: 'Answers with a result code that becomes one of the typed statuses.' },
{ icon: Webhook, title: 'Webhook', text: 'Tells your app that a payment changed. A hint, not proof.' },
{ icon: SearchCheck, title: 'Order status', text: 'Confirms the payment and the amount before you fulfil.' }
]
Expand Down
2 changes: 1 addition & 1 deletion components/landing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export async function Landing() {
<Section
id="same-spec"
title="Same spec, multiple languages"
lead="The clients differ in idiom, not in behaviour. They take the same settings, return the same five statuses and pass the same test vectors."
lead="The clients differ in idiom, not in behaviour. They take the same settings, return the same typed statuses and pass the same test vectors."
>
<SameSpec />
</Section>
Expand Down
4 changes: 2 additions & 2 deletions content/clients/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (order.status() == Status.SUCCESS) {
Result<Responses.OrderStatusData> status = client.orderStatus(new Requests.OrderStatus("ORD-1001"));
```

The environment is required and has no default. Every method returns a `Result` with one of five statuses: `SUCCESS`, `PENDING`, `AMBIGUOUS`, `FAILED` or `NOT_FOUND`.
The environment is required and has no default. Every method returns a `Result` with one of the typed statuses: `SUCCESS`, `PENDING`, `AMBIGUOUS`, `FAILED` or `NOT_FOUND`.

The [README](https://github.com/selcom-developers/selcom4j#readme) covers configuration, every operation, error handling, idempotency, webhooks and using each layer on its own.

Expand All @@ -76,7 +76,7 @@ The client follows the [shared spec](/spec). These pages explain what it does:

<LinkCards>
<LinkCard href="/spec/signing" title="Request signing">How every request is signed, with worked examples.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The five typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/webhooks" title="Webhooks">Verify a delivery, then confirm it with order status.</LinkCard>
<LinkCard href="/spec/client-requirements" title="Client requirements">What every client does, in every language.</LinkCard>
</LinkCards>
Expand Down
2 changes: 1 addition & 1 deletion content/clients/laravel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The client follows the [shared spec](/spec). These pages explain what it does:

<LinkCards>
<LinkCard href="/spec/signing" title="Request signing">How every request is signed, with worked examples.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The five typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/webhooks" title="Webhooks">Verify a delivery, then confirm it with order status.</LinkCard>
<LinkCard href="/spec/client-requirements" title="Client requirements">What every client does, in every language.</LinkCard>
</LinkCards>
Expand Down
4 changes: 2 additions & 2 deletions content/clients/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const push = await selcom.walletPayment({
// push.status is normally "PENDING": the outcome arrives by webhook and is confirmed with orderStatus.
```

The environment is required and has no default. Every operation returns a result with one of five statuses: `SUCCESS`, `PENDING`, `AMBIGUOUS`, `FAILED` or `NOT_FOUND`.
The environment is required and has no default. Every operation returns a result with one of the typed statuses: `SUCCESS`, `PENDING`, `AMBIGUOUS`, `FAILED` or `NOT_FOUND`.

The [README](https://github.com/selcom-developers/selcom-node#readme) covers configuration, every operation, error handling, idempotency, webhooks, signing on its own and replacing the transport.

Expand All @@ -61,7 +61,7 @@ The client follows the [shared spec](/spec). These pages explain what it does:

<LinkCards>
<LinkCard href="/spec/signing" title="Request signing">How every request is signed, with worked examples.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The five typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/webhooks" title="Webhooks">Verify a delivery, then confirm it with order status.</LinkCard>
<LinkCard href="/spec/client-requirements" title="Client requirements">What every client does, in every language.</LinkCard>
</LinkCards>
Expand Down
2 changes: 1 addition & 1 deletion content/clients/php.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The client follows the [shared spec](/spec). These pages explain what it does:

<LinkCards>
<LinkCard href="/spec/signing" title="Request signing">How every request is signed, with worked examples.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The five typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">The typed statuses, idempotency and when to query.</LinkCard>
<LinkCard href="/spec/webhooks" title="Webhooks">Verify a delivery, then confirm it with order status.</LinkCard>
<LinkCard href="/spec/client-requirements" title="Client requirements">What every client does, in every language.</LinkCard>
</LinkCards>
Expand Down
2 changes: 1 addition & 1 deletion content/spec/api-v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: The checkout and payout operations covered by v1.

# API scope for v1

Version 1 of the community clients covers checkout and payouts: 16 operations plus the checkout webhook. Everything else on Selcom's developer portal (bank transfers, Selcom Pesa, agent cash-out, virtual cards, C2B collections, international transfers, POS) is out of scope for v1.
Version 1 of the community clients covers checkout and payouts, plus the checkout webhook. Everything else on Selcom's developer portal (bank transfers, Selcom Pesa, agent cash-out, virtual cards, C2B collections, international transfers, POS) is out of scope for v1.

This page describes each operation in our own words. Selcom's portal at [https://developers.selcommobile.com/](https://developers.selcommobile.com/) is the authority on the API; where it and this page disagree, the portal wins and this page should be fixed.

Expand Down
8 changes: 4 additions & 4 deletions content/spec/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The spec is not affiliated with, endorsed by or supported by Selcom Paytech Ltd.

<LinkCards>
<LinkCard href="/spec/signing" title="Request signing">The exact signing algorithm, with worked examples and pitfalls.</LinkCard>
<LinkCard href="/spec/api-v1" title="API v1 operations">Checkout and payouts: 16 operations plus the webhook.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">Result codes, the five typed statuses, idempotency.</LinkCard>
<LinkCard href="/spec/api-v1" title="API v1 operations">Checkout and payouts, plus the webhook.</LinkCard>
<LinkCard href="/spec/results" title="Results and retries">Result codes, the typed statuses, idempotency.</LinkCard>
<LinkCard href="/spec/webhooks" title="Webhooks">Verifying and handling checkout webhooks.</LinkCard>
<LinkCard href="/spec/client-requirements" title="Client requirements">What every client must do.</LinkCard>
</LinkCards>
Expand All @@ -27,8 +27,8 @@ The spec is not affiliated with, endorsed by or supported by Selcom Paytech Ltd.

The spec ships test vectors that every client must pass:

- `vectors/signing.json`: 20 signing cases and 11 rejects.
- `vectors/responses/`: 120 response scenarios across the 16 operations, and 15 webhook samples.
- `vectors/signing.json`: signing cases and cases that must be rejected.
- `vectors/responses/`: response scenarios for every operation, and webhook samples.
- `tools/`: the Python reference implementation that generates them.

All credentials in the vectors are sample values or made up. None of them works against the gateway.
Expand Down
6 changes: 3 additions & 3 deletions content/spec/results.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Result codes, typed statuses, idempotency and retries.

# Results, statuses and retries

Every client turns a gateway response into one of five typed statuses. Getting this wrong costs real money: reading "in progress" or "unknown" as "failed", then trying again under a new ID, pays the same person twice. This page is the rule; `classify()` in `tools/selcom_reference.py` is the executable version, and `vectors/responses/` holds the cases.
Every client turns a gateway response into one of the typed statuses. Getting this wrong costs real money: reading "in progress" or "unknown" as "failed", then trying again under a new ID, pays the same person twice. This page is the rule; `classify()` in `tools/selcom_reference.py` is the executable version, and `vectors/responses/` holds the cases.

## Result codes

Expand Down Expand Up @@ -34,7 +34,7 @@ The HTTP status does not decide the verdict: business errors come back in the bo
| `FAILED` | It did not happen | yes | Report the failure. A new attempt is a new transaction with a new ID, and it is the caller's decision, never the client's |
| `NOT_FOUND` | The gateway has no record of the ID | yes, for that query | The only case in which the same ID may be submitted again |

Every client returns these five names, spelled exactly like this, from every operation.
Every client returns these names, spelled exactly like this, from every operation.

## Classification

Expand Down Expand Up @@ -99,7 +99,7 @@ Every operation returns, at least:

| Field | Content |
|---|---|
| `status` | One of the five typed statuses |
| `status` | One of the typed statuses |
| `resultcode` | The normalised code, or none when there was no verdict |
| `result`, `message` | The gateway's text, unchanged |
| `reference` | The gateway's reference, when present |
Expand Down