Skip to content
pwnghPublic

About

Payment decline code lookup API, interactive explorer, and offline SDKs (JS, Python, PHP) with cited gateway sources and next steps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

decline

Look up payment response codes by gateway, API, and field. Each match includes a next step, dataset version, and dated sources. Supported processors and fields

Try it

From this folder, run npm start with Node 22.12 or later. Open the API explorer. It opens on a working example. Edit the code or response field to update the result in your browser. Copy the request URL, cURL command, or response JSON directly from the page.

curl -s http://127.0.0.1:3000/v1/authorize.net/transactionResponse.responseCode/4
curl -s http://127.0.0.1:3000/v1/authorize.net/aim-paypal-express/responseReasonCode/2003
curl -s http://127.0.0.1:3000/v1/nacha/returnCode/R11
curl -s http://127.0.0.1:3000/v1/iso8583/39/05
curl -s http://127.0.0.1:3000/v1/stripe/error.decline_code/insufficient_funds
curl -s http://127.0.0.1:3000/v1/stax/status/PENDING
curl -s http://127.0.0.1:3000/v1/checkout.com/response_code/200N7
curl -s http://127.0.0.1:3000/v1/nmi/response_code/261
curl -s http://127.0.0.1:3000/v1/square/errors%5B%5D.code/INSUFFICIENT_FUNDS

Use /v1/{processor}/{api}/{field}/{code} to select the API profile explicitly. The explorer copies this form. The shorter /v1/{processor}/{field}/{code} works when exactly one profile for the processor declares the field. Offline clients use the same rule when you omit api.

The API returns 200 for a match, 404 with the original code for a valid miss, and 400 for invalid or ambiguous input. Input formats follow the selected field. Preserve string-valued codes exactly, including leading zeros. Authorize.net status 4 and status 04 are distinct, and an API message uses a token such as E00007. For a field documented as an integer, use its canonical decimal string, such as 0 for a Portico gateway header decoded as zero. The coverage endpoint counts the distinct codes each field can resolve. A match from a published numeric range includes its bounds and the exact code requested. Coverage as JSON

Use offline

Each client reads the bundled catalog. Run an example from this folder.

node --input-type=module -e 'import { lookup } from "decline"; console.log(lookup({processor:"authorize.net",field:"transactionResponse.responseCode",code:"4"}).reason)'
PYTHONPATH=clients/python python3 -B -c 'from decline import lookup; print(lookup(dict(processor="authorize.net", field="transactionResponse.responseCode", code="4"))["reason"])'
php -r 'require "clients/php/decline.php"; echo Decline\lookup(["processor"=>"authorize.net","field"=>"transactionResponse.responseCode","code"=>"4"])["reason"], PHP_EOL;'

Each prints held_for_review. Run npm test with Node, Python 3, and PHP installed to check the shared cases against the API and three clients. See coverage and gaps, the entry schema and release plan for the data contract and remaining work.

About

Payment decline code lookup API, interactive explorer, and offline SDKs (JS, Python, PHP) with cited gateway sources and next steps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages