Download the PHP package zerokyc/zkp-sdk-php without Composer

On this page you can find all versions of the php package zerokyc/zkp-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zkp-sdk-php

zkp-sdk-php

Official PHP SDK for the ZeroKYC Pay crypto payment gateway. Framework-agnostic, no third-party runtime dependencies (requires the PHP JSON and cURL extensions), PHP 8.1+.

WHMCS, WooCommerce, Blesta, Paymenter, FOSSBilling and OpenCart adapters for ZeroKYC are built on this package - if you integrate anything else, build it here too: API client, webhook verification, idempotency and status mapping are done for you.

Install

(If the package is not on Packagist yet, use the VCS repository:

)

Quickstart (sandbox invoice in 5 minutes)

  1. Create an account at console.zerokyc-payments.com and copy a sandbox API key (pk_test_...) from API keys.
  2. Create an invoice and send the buyer to the hosted checkout:

  3. Get paid: ZeroKYC detects the on-chain payment and POSTs a signed webhook to your endpoint. A verified webhook (or a server-side getInvoice()) is the only proof of payment - never a browser success URL.

Full production flow with duplicate protection and payment matching: examples/safe-webhook-handler.php.

Configuration

Key Required Notes
api_key yes pk_test_... sandbox / pk_live_... production
environment no sandbox | production; inferred from the key; mismatch throws
webhook_secret for webhooks whsec_... from console → Webhooks
timeout no per-request HTTP timeout, seconds (default 15)
max_retries no bounded retries, 0-5 (default 2)
base_url tests only overrides the central API base URL

The API base URL is defined centrally by the SDK. Never hard-code URLs in platform adapters.

Status normalization

Raw API statuses never leak into your billing logic:

API (raw) SDK enum
created, pending InvoiceStatus::PENDING
detecting (seen, awaiting confs) InvoiceStatus::CONFIRMING
confirmed InvoiceStatus::PAID
underpaid InvoiceStatus::UNDERPAID
expired InvoiceStatus::EXPIRED
canceled InvoiceStatus::CANCELLED
unknown InvoiceStatus::FAILED (alert)

$invoice->isPaid() / $invoice->isTerminal() answer the common questions.

Idempotency

Always pass a stable idempotency key when creating invoices from an order:

A timeout + retry then returns the same invoice (CreateInvoiceResponse::idempotentReplay === true) instead of a duplicate.

Error handling & retries

Exception HTTP Retried automatically?
AuthenticationException 401 / 403 never
ValidationException 400 / 422 never
RateLimitException 429 yes (honors Retry-After up to 5s, max twice)
ApiException 5xx, 402, 404… only GET / idempotent POST
NetworkException timeout/DNS only GET / idempotent POST
WebhookVerificationException n/a n/a (reason code on $e->reason)

Backoff is bounded exponential (300ms → 600ms → 1200ms, capped by max_retries).

Webhook security checklist

Self-test against the documented vector:

Assets

USDT on seven networks (TRC-20, Polygon, BEP-20 on BSC, ERC-20 on Ethereum, Arbitrum, Solana SPL, TON jetton), USDC/USDT (Polygon, Arbitrum, Solana), native ETH, native BNB, native TRX, LTC, DOGE, BCH, XRP, NEAR, BTC, XMR and native TON. Pass an asset id as payment_currency to pin one (USDT_TRON), or any (default) to let the buyer choose at checkout.

Tests

License

MIT — see LICENSE.


All versions of zkp-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zerokyc/zkp-sdk-php contains the following files

Loading the files please wait ...