zahls / zahls-php
zahls.ch PHP SDK
v1.0.0
2026-07-31 14:21 UTC
Requires
- php: ^8.0
- ext-curl: *
Requires (Dev)
- guzzlehttp/guzzle: ^7.0
- pestphp/pest: ^3.8
- phpstan/phpstan: ^2.1
README
PHP library for the zahls.ch payment API.
Requirements
- PHP 8.0+
- ext-curl
Install
composer require zahls/zahls-php
Until the package is on Packagist, add the GitHub repository:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/zahls/zahls-php.git"
}
],
"require": {
"zahls/zahls-php": "dev-main"
}
}
Usage
$zahls = new \Zahls\Zahls($instanceName, $apiSecret); $gateway = new \Zahls\Models\Request\Gateway(); $gateway->setAmount(1000); // in cents $gateway->setCurrency('CHF'); $gateway->setSuccessRedirectUrl('https://www.example.com/success'); $gateway->setFailedRedirectUrl('https://www.example.com/failed'); $gateway->setCancelRedirectUrl('https://www.example.com/cancel'); $response = $zahls->create($gateway);
The default API base domain is zahls.ch (https://api.zahls.ch/...).
Instance name is the subdomain of your account, e.g. example for https://example.zahls.ch.
Examples
See the examples/ directory.
License
MIT