SISP php
This is implementation of a library to process SISP https://www.sisp.cv/ vinti4 https://www.vinti4.cv/ payment in a easy way.
Install
Download the project folder on your project. Or install it using composer:
composer require faxi-online/sisp-php:dev-main
Include in your project
Import the library file;
include "../Sisp.php";
Or include the composer autoload
include "vendor/autoload.php";
Create Transaction Object
Create the transaction object from the Sisp class. You can pass three parameters:
- Your POS Id/Identifier
- The respective POS authentication code
- The VBV api URL, and it is set by default as "https://mc.vinti4net.cv/BizMPIOnUsSisp", remember to define it value in production, without the path "/CardPayment" because it will be added automatically according the transaction code
use Faxi\Sisp;
$payment = new Sisp(
"90000045",
"kfyhhKJH875ndu44"
);
Generate Transaction id
Generate your transaction id, it can be max of 15 characters, after a successful payment you should not reuse that id for new transaction.
// sample to generate id from timestamp
$transaction_id = "T" . date('YmdHms');
Generate the HTML buy form
You can generate the HTML form by calling the buyForm method. It receives three parameters:
- The transaction Id, you will receive it in the transaction callback
- The amount of the transaction
- The callback url, the transaction result will be sent to here
$buyForm = $payment->buyForm(
$transaction_id,
1000,
"http://localhost/sisp-php/src/Faxi/samples/callback-buy.php"
);
Put the form on your HTML page
Just put that form in your HTML page and submit it by calling document.forms[0].submit();
Start Transaction