PHP code example of zahls / zahls-php

1. Go to this page and download the library: Download zahls/zahls-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zahls / zahls-php example snippets


$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);
bash
composer