PHP SDK
Install and configure the preview PHP client for authenticated Carden v1 server requests.
On this page
Package availability
The planned PHP package identifier is carden/carden-php for Packagist and requires PHP 8.1+. The release catalog marks it preview and unpublished; there is no public version or install command.
Configure the client
Initialize the client only in a trusted server process. Use a Carden key issued for the provider integration and environment this service implements. Keep provider credentials in provider execution code.
<?php
use Carden\Client;
$carden = new Client(
apiKey: $_ENV['CARDEN_API_KEY'],
);The default API origin is https://www.cardenpay.com. Use another base URL only when Carden supplies it for the environment. Set bounded timeouts and retain request IDs in sanitized diagnostics.
Handle client errors
- Treat invalid authentication or permission as configuration failure rather than an infinite retry.
- Correct 400 and 422 input using factual source data; never invent commercial or provider fields.
- Reconcile 409 source, idempotency, event, or cumulative-fact conflicts.
- Retry safe preparation or immutable report delivery after 408, 429, 5xx, timeout, or connection failures.
- Keep payment execution and report delivery in independently idempotent paths.
Open provider usage
Stripe SDK usage
Use this language for Stripe preparation and reporting.
Square SDK usage
Use this language for Square preparation and reporting.
Provider pages preserve the same seven native language examples plus direct HTTP. Package pages intentionally stay focused on installation, client configuration, errors, and release status.