Download the PHP package paykrypt/paykrypt-php-sdk without Composer
On this page you can find all versions of the php package paykrypt/paykrypt-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paykrypt/paykrypt-php-sdk
More information about paykrypt/paykrypt-php-sdk
Files in paykrypt/paykrypt-php-sdk
Package paykrypt-php-sdk
Short Description Official PHP SDK for the PayKrypt crypto payment gateway API.
License MIT
Homepage https://docs.paykrypt.io
Informations about the package paykrypt-php-sdk
PayKrypt PHP SDK
Official PHP SDK for the PayKrypt crypto payment gateway API.
Installation
The SDK is framework-agnostic and uses PSR-18 HTTP clients. If no PSR-18 client can be auto-discovered, install one such as guzzlehttp/guzzle or symfony/http-client.
Requires PHP 8.1 or newer.
Quick Start
Configuration
All merchant API calls use:
The key decides which mode you are in, not baseUrl. A pk_test_<prefix>_<secret> key resolves
to your sandbox merchant and a pk_<prefix>_<secret> key resolves to your live one, against the
same host. The two cannot cross: a test key authenticating against a live merchant is rejected,
and so is the reverse.
baseUrl exists to point the client at a self-hosted or local PayKrypt instance. It is not how
you reach test mode.
See Test mode below.
Idempotency
PayKrypt requires an Idempotency-Key on value-creating POST endpoints. The SDK generates one automatically for:
paymentIntents->create()payouts->create()payouts->createWithVerification()refunds->create()refunds->createWithVerification()conversions->convert()
Pass your own stable key when retrying the same app-level action:
Resources
Responses are returned as associative arrays to stay compatible with PayKrypt's evolving API response shapes.
Test mode
A pk_test_ key puts every call into your sandbox merchant. Payments there run through the real
settlement pipeline, so you get the same status transitions, ledger postings and webhooks, with
no blockchain involved and nothing moving on-chain.
Your sandbox key is created with your account and is permanently viewable in the dashboard, so there is no setup step.
Scenarios: detect, confirm, underpay, overpay, reject. Call pay() twice with the same
txId to simulate a redelivered event and check your handler is idempotent, or twice without one
to build up a multi-transaction payment.
Two things to know about these four methods:
- They are unauthenticated, and the gate is the target rather than the caller. Each resolves
the intent, payout or refund and refuses with
403unless the merchant behind it is in test mode. A403therefore means the resource you named belongs to a live business, most often because it was created with a live key. Your key is not sent on these calls. - They are limited to 10 requests per minute per calling IP address. The client retries a
429with backoff and honoursRetry-After, but a suite that fans out will still feel it.
Conversions are refused in test mode with an explanatory error rather than faked, because faking hedge accounting would report numbers that do not mean anything.
Full reference: https://docs.paykrypt.io/api/test-mode
Webhook Verification
PayKrypt signs webhook deliveries with X-PayKrypt-Signature and X-PayKrypt-Timestamp.
Use the secret returned from webhooks->register(...) as PAYKRYPT_WEBHOOK_SECRET.
The signature payload is:
The SDK also accepts the older documented aliases Paykrypt-Signature and Paykrypt-Timestamp.
Error Handling
Development
Publishing To Packagist
- Push
maintohttps://github.com/PayKrypt/paykrypt-php-sdk. - Submit the public repository URL to Packagist once under
paykrypt/paykrypt-php-sdk. - Enable Packagist auto-updates through the GitHub app, or configure a GitHub webhook manually:
payload URL
https://packagist.org/api/github?username=PACKAGIST_USERNAME, content typeapplication/json, secret set to your Packagist API token, and push events only. - Tag releases with semantic version tags such as
v1.0.0; Composer reads package versions from VCS tags, so do not add aversionfield tocomposer.json. - Create a GitHub Release from the tag and verify Packagist indexed the new version.
License
MIT
All versions of paykrypt-php-sdk with dependencies
ext-json Version *
php-http/discovery Version ^1.20
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^1.1