Download the PHP package coinpay/laravel-integration without Composer
On this page you can find all versions of the php package coinpay/laravel-integration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coinpay/laravel-integration
More information about coinpay/laravel-integration
Files in coinpay/laravel-integration
Package laravel-integration
Short Description laravel-integration-package for https://coinpay.finance/en
License MIT
Informations about the package laravel-integration
CoinPay
Safe, fast and instant payments; Anytime, anywhere with CoinPay.
Official Laravel SDK for integrating CoinPay cryptocurrency payments into your Laravel application. Supports Laravel 10, 11, 12 and 13.
Installation
Install with composer:
Publish the config file:
Configuration
After publishing, config/coinpay.php will be available. Set at least your API key, webhook secret, and redirect URL in your .env file:
Optional tuning:
See config/coinpay.php for the full list of options and their doc comments.
Usage
Creating a Payment
Checking a Payment's Status
Note:
checkStatus()callsGET {base_url}(the bare base URL, no additional path segment) withtransaction_idas a query parameter. This is unusual for a REST API but is what the CoinPay platform actually expects today — it is intentionally preserved as-is rather than "corrected" to a guessed path. SeeCoinPayGateway::checkStatus()for details.
Handling Webhooks
Incoming webhook requests to your configured webhook_route are protected by the VerifyCoinPayWebhookSignature middleware (applied automatically to the package's route), which supports two schemes:
- Current (HMAC-SHA256) — CoinPay sends
X-Coinpay-Signature: v1=<hex-hmac-sha256>,X-Coinpay-Timestamp: <unix-seconds>andX-Coinpay-Delivery: <uuid>headers. The signature covers"{timestamp}.{deliveryId}.{rawBody}", HMAC'd with yourCOINPAY_WEBHOOK_SECRET. Requests older/newer thanwebhook_signature_toleranceseconds, or with a delivery id already seen within that window, are rejected. - Legacy (deprecated, fallback only) — a static
SECRETheader compared againstCOINPAY_WEBHOOK_SECRET. No payload binding or replay protection. Only evaluated when none of the HMAC headers are present; kept for merchants who haven't moved to signature verification yet.
By the time your webhook logic runs, the request is already verified — you only need to process the payload. Implement WebhookServiceInterface and point coinpay.webhook_service at your class:
Notes
- Always use
route('coinpay.webhook')for the webhook callback URL to respect any custom route defined by the user. - The
redirect_urlis fetched from the config, so you can change it per environment without editing code. - The Guzzle client used for CoinPay API calls has connect/request timeouts set (
connect_timeout/timeoutconfig keys) so a hung upstream call can't hang your application's request indefinitely.
Testing this package
Tests use Orchestra Testbench to boot a minimal Laravel application for the package.