# Go-live checklist

> Check your NorthechPay integration before launch. Production is not enabled, and completing this list is not production approval.

> **Test mode:** Production payments are not enabled in this build. This checklist tells you whether your integration is ready. It does not approve you, the merchant or NorthechPay for live payments, and finishing it does not turn production on.

## Keys and configuration

- The API key is stored only on your server, in environment variables or a secrets manager.
- The key has only the abilities it needs. A website checkout key has `merchant:read`, `checkouts:read`, `checkouts:write` and `transactions:read`.
- Back-office keys with `refunds:write` or `payouts:write` are separate from the website key.
- `GET /me` at deploy time returns the expected merchant and abilities.
- The API host comes from configuration, not hard-coded.
- The webhook signing secret is stored only on your server.
- You know how to rotate and revoke keys and the webhook secret, and who does it.

## Creating checkouts

- Checkouts are created only from your server.
- Every create sends a valid `Idempotency-Key`, saved with the order before the call.
- Retries, double clicks and timeouts reuse the same key.
- A new key is used only after `expired`, `disabled` or `creation_failed`, or when the order changes.
- `amount` is in integer cents and matches the line items, if you send them.
- `merchant_reference` is your order ID.
- A `checkout_url` of `null` (status `creating`) is handled without redirecting.

## Payment state

- An order becomes paid only from a verified `checkout.paid` webhook or a server-side read with `paid: true`.
- The amount and currency are compared with the order before fulfilment.
- `authorized` is shown as "approved, confirming", never as paid.
- The order page never trusts the URL or the browser for payment state.
- Fulfilment runs once, even if the paid signal arrives several times.
- Orders never move backwards because of a late event.

## Webhooks

- The endpoint is public HTTPS, with no redirect.
- The signature is verified against the raw body, with a constant-time compare and the 300-second check.
- Invalid signatures get `400` and change nothing.
- Event IDs are stored with a unique index. Duplicates are ignored.
- The endpoint answers `2xx` within 10 seconds and does the work in the background.
- You subscribed to the events you handle, at least `checkout.paid`, `checkout.failed` and `checkout.expired`.
- A `webhook.test` event from the dashboard reaches your endpoint and verifies.

## Reconciliation and errors

- A scheduled job re-reads orders still awaiting payment.
- A daily check compares completed transactions with paid orders.
- `429` responses wait for `Retry-After`.
- `503` and `504` responses are retried with the same key, or the resource is read first.
- `error.code` and `X-Request-Id` are logged for every failed call. Keys and secrets are never logged.

## Refunds, disputes and payouts (if you use them)

- Refunds use one idempotency key per intended refund, and the result is confirmed with `refunded_amount`.
- Disputed payments are not refunded. Someone watches `dispute.updated` and responds before `respond_by`.
- Payouts are not retried with a new key after `outcome_unknown`.

## Test runs passed

Run each scenario and keep the evidence (order ID, checkout ID, `X-Request-Id`):

| Scenario                             | Result                                               |
| ------------------------------------ | ---------------------------------------------------- |
| Approved card `4111 1111 1111 1111`  | `authorized`, then `paid`. Fulfilled once.           |
| Declined card `4000 0200 0000 0000`  | `failed`. Unpaid. The buyer can retry.               |
| Double click on "Pay"                | One checkout.                                        |
| Wrong webhook signature              | `400`, no change.                                    |
| Same event delivered twice           | Processed once.                                      |
| Webhook endpoint down during payment | The scheduled job catches up.                        |
| Expired checkout                     | Order shows it closed. A new attempt uses a new key. |
| Partial refund (if used)             | `refunded_amount` and `partially_refunded` match.    |

## Production (not available)

For reference only. Live payments would need, at least, Moov approval of the platform and each merchant (identity and business checks, underwriting and agreements), production credentials and webhooks set up by the platform operator, and written approval from the NorthechPay owner. None of this can be done from the API or the dashboard in this build.
