PHP code example of kowts / sisp-cv

1. Go to this page and download the library: Download kowts/sisp-cv 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/ */

    

kowts / sisp-cv example snippets




use Kowts\Sisp\Config\SispConfig;
use Kowts\Sisp\SispFactory;

etenv('SISP_POS_ID'),
    'posAutCode' => getenv('SISP_POS_AUT_CODE'),
    'url' => getenv('SISP_URL'),
    'urlMerchantResponse' => getenv('SISP_CALLBACK_URL'),
]));

$request = $sisp->payment()
    ->amount('1500.00')
    ->merchantRef('ORDER-20260714-001')
    ->merchantSession('CHECKOUT-20260714-001')
    ->build();

echo $sisp->renderPaymentForm($request);

$pdo = new PDO(
    'mysql:host=127.0.0.1;dbname=sisp;charset=utf8mb4',
    getenv('SISP_DB_USER'),
    getenv('SISP_DB_PASSWORD'),
    [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
);

$sisp = SispFactory::create(SispConfig::fromArray([
    'posId' => getenv('SISP_POS_ID'),
    'posAutCode' => getenv('SISP_POS_AUT_CODE'),
    'url' => getenv('SISP_URL'),
    'urlMerchantResponse' => getenv('SISP_CALLBACK_URL'),
    'pdo' => $pdo,
]));