Download the PHP package utopia-payments/utopia-php without Composer
On this page you can find all versions of the php package utopia-payments/utopia-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download utopia-payments/utopia-php
More information about utopia-payments/utopia-php
Files in utopia-payments/utopia-php
Package utopia-php
Short Description Official PHP library for the Utopia Payments API: hosted checkout, subscriptions and signed webhooks.
License MIT
Homepage https://utopia-payments.com/docs/api
Informations about the package utopia-php
Utopia Payments for PHP
The official PHP library for the Utopia Payments API: hosted checkout, subscriptions with automatic renewals, and signed webhooks.
- PHP 8.1+, cURL, no other dependencies
- Every create sends an
Idempotency-Key, so retries never double-charge - Network errors,
429and5xxare retried with backoff all()walks every page of a listWebhook::verify()checks Standard Webhooks signatures
Install
Composer installs the tagged release from Packagist.
Quick start
Create a secret key in Dashboard → Developers and keep it on your server.
Amounts are integers in minor units: 34900 is AED 349.00. Responses are
associative arrays shaped like the API's JSON.
Carts that don't map to saved products can price items inline:
Subscriptions
Webhooks
Verify every delivery against the raw body before trusting it:
Laravel, in routes/api.php (a POST in routes/web.php is rejected by CSRF
verification before it reaches your handler):
Webhook::verify() accepts a delivery whose webhook-timestamp is within 300
seconds of now; pass a fourth argument to change that window.
A delivery is attempted eight times over about 28 hours until you answer with a
2xx, then abandoned. Use $event['id'] to ignore duplicates.
Lists
Errors
Exception classes: InvalidRequestException, AuthenticationException,
PermissionDeniedException, NotFoundException, ConflictException,
RateLimitException, ApiException, ApiConnectionException,
WebhookVerificationException.
Options
$utopia->isLivemode() returns true for an sk_live_ key and false for an
sk_test_ one.
All versions of utopia-php with dependencies
ext-curl Version *
ext-json Version *