zahls/zahls-php

zahls.ch PHP SDK

Maintainers

Package info

github.com/zahls/zahls-php

Homepage

pkg:composer/zahls/zahls-php

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.0 2026-07-31 14:21 UTC

This package is auto-updated.

Last update: 2026-07-31 15:03:26 UTC


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