SDKs and plugins
SDKs
The official libraries cover every /v1 endpoint and take care of retries, idempotency keys, pagination and webhook signature verification for you.
Installation
npm install https://hisarpay.com/downloads/hisarpay-node-1.0.0.tgzcomposer config repositories.hisarpay composer https://hisarpay.com/downloads
composer require hisarpay/hisarpay-phppip install https://hisarpay.com/downloads/hisarpay-1.0.0-py3-none-any.whl| Library | Requirements | Package |
|---|---|---|
| Node.js | Node 18+ · ESM and CommonJS · no dependencies | @hisarpay/node |
| PHP | PHP 8.1+ · ext-curl, ext-json | hisarpay/hisarpay-php |
| Python | Python 3.9+ · httpx · sync and async clients | hisarpay |
Configuration
import { HisarPay } from '@hisarpay/node';
const hisarpay = new HisarPay(process.env.HISARPAY_API_KEY!, {
timeoutMs: 30_000, // per attempt
maxRetries: 2, // network errors, 408, 429, 5xx
});$hisarpay = new \HisarPay\HisarPay(getenv('HISARPAY_API_KEY'), [
'timeout' => 30, // seconds per attempt
'maxRetries' => 2,
]);from hisarpay import AsyncHisarPay, HisarPay
client = HisarPay(os.environ["HISARPAY_API_KEY"]) # sync
async_client = AsyncHisarPay(os.environ["HISARPAY_API_KEY"]) # asyncioEvery method also takes options for that call only (timeout, retries, idempotency key). The packages’ READMEs have the details.
What they share
- Retries: network errors,
408,429,5xxand409 request_in_progressare retried twice by default, with delays growing from 0.5 s to 8 s;Retry-Afteris honoured. - Idempotency: every
POSTcarries an automaticIdempotency-Key, reused on retries. - Webhooks:
constructEvent/construct_eventchecks the signature, the time tolerance and secret rotation, then returns the event. - Pagination:
listAll/list_allwalks every page in order. - Types: the Node.js package ships TypeScript types, the Python package
TypedDictdefinitions. - Errors: each HTTP status has its own error class, and all of them carry
codeandrequest_id.
Other languages
In a language without an official library, use the API directly over HTTP: a JSON body, a Bearer key and an Idempotency-Key header are all it takes. Every endpoint is in the API reference, and signature verification in the Webhooks guide.