Download the PHP package coinpay/php-integration without Composer
On this page you can find all versions of the php package coinpay/php-integration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coinpay/php-integration
More information about coinpay/php-integration
Files in coinpay/php-integration
Package php-integration
Short Description php package for coin payment finance
License MIT
Informations about the package php-integration
Coinpay
Safe, fast and instant payments; Anytime, anywhere with CoinPay.
This is CoinPay's official framework-agnostic PHP SDK — plain PHP, zero third-party
dependencies (only ext-curl and ext-json). If you're on Laravel, use
coinpay/laravel-integration instead.
Installation
Install with composer:
Requires PHP 7.4+ or 8.0+, with the curl and json extensions.
Creating a payment
Checking a payment's status
Verifying webhooks
CoinPay notifies your application asynchronously about payment status changes. Since this
package targets plain PHP with no framework/router to pass you a parsed request, read the
raw request body yourself with file_get_contents('php://input') and pull the relevant
headers, then verify before trusting anything in the payload.
Two verification schemes exist:
Current: HMAC-SHA256 signature (X-Coinpay-Signature)
The request carries three headers — X-Coinpay-Signature: v1=<hex-hmac-sha256>,
X-Coinpay-Timestamp: <unix-seconds>, and X-Coinpay-Delivery: <uuid> — and the signature
covers "{timestamp}.{deliveryId}.{rawBody}". CoinPayWebhookVerifier::verify() recomputes
the digest, compares it with hash_equals(), and rejects the request if the timestamp is
more than 300 seconds old or in the future.
Legacy: static shared-secret header (SECRET) — deprecated
Older deliveries may still arrive with a plain SECRET header instead of a signature. This
scheme is deprecated (no payload binding, no timestamp, no replay protection) but CoinPay
still accepts it during the transition window, so a merchant that wants to keep working
without gaps should check for it as a fallback when X-Coinpay-Signature is absent:
Prefer the HMAC path for any new integration; only fall back to the legacy path if you need to support deliveries that predate signature verification.
Exceptions
Every failure — a rejected API request or a network/timeout failure — is thrown as
Coinpay\Finance\Exceptions\CoinPayException, which extends \Exception and additionally
exposes:
getHttpStatusCode(): int— the HTTP status code, or0if no response was ever received.getResponseBody()— the decoded (array) or raw (string) response body, if any.isNetworkError(): bool—truefor connection/timeout failures rather than API rejections.getCurlErrno(): ?int— the curl error number, whenisNetworkError()istrue.
Testing
All versions of php-integration with dependencies
ext-curl Version *
ext-json Version *