Implementation of a library to process SISP vinti4 payment in a easy way.

Overview

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
">
<html>
	<head>
		<title>Do paymenttitle>
	head>
	<body>

		<div>

			<h5>Do paymenth5>

			<?= $buyForm ?>
            
                        <button onclick="startTransaction()">
                            Start Transaction
                        button>

		div>

		<script>
			
			function startTransaction()
			{
				document.forms[0].submit();
			}

		script>
	body>
html>

After submitted the form, you should be redirect to a page like the below.
Payment form

Transaction result callback

To process callback result we should use the method onTransactionResult, it receive three parameters:

  • The success callback function
  • The error callback function
  • The cancellation callback function
onTransactionResult( // success callback function ($transaction_id){ echo "

Payment sucessfully for $transaction_id

"; }, // error callback function ($transaction_id, $errorDescription, $errorDetail, $errorAdditionalMessage){ echo "

Error on transaction $transaction_id

"; echo "

Error: description $errorDescription

"; echo "

Error: detail $errorDetail

"; echo "

Error: additional $errorAdditionalMessage

"; }, // cancellation callback function (){ echo "

Transaction cancelled

"; } );">
$payment = new Sisp(
        "90000045",
        "kfyhhKJH875ndu44"
    );

$payment->onTransactionResult(

    // success callback
    function ($transaction_id){

        echo "

Payment sucessfully for $transaction_id

"
; }, // error callback function ($transaction_id, $errorDescription, $errorDetail, $errorAdditionalMessage){ echo "

Error on transaction $transaction_id

"
; echo "

Error: description $errorDescription

"
; echo "

Error: detail $errorDetail

"
; echo "

Error: additional $errorAdditionalMessage

"
; }, // cancellation callback function (){ echo "

Transaction cancelled

"
; } );

Generate phone recharge HTML form

You can generate the HTML form by calling the phoneRechargeForm method. It receives five parameters:

  • The transaction Id, you will receive it in the transaction callback, it can be max of 15 characters
  • The amount of the transaction
  • The phone number you want to recharge
  • The operator id (it will be provided by SISP)
  • The callback url, the transaction result will be sent to here
$buyForm = $payment->phoneRechargeForm(
		$transaction_id,
		1000,
		9112233,
		2,
		"http://localhost/sisp-php/src/Faxi/samples/callback-buy.php"
	);

Generate service payment HTML form

You can generate the HTML form by calling the servicePaymentForm method. It receives five parameters:

  • The transaction Id, you will receive it in the transaction callback, it can be max of 15 characters
  • The amount of the transaction
  • The reference number of the bill you want to pay
  • The enity id (it will be provided by SISP)
  • The callback url, the transaction result will be sent to here
$buyForm = $payment->servicePaymentForm(
		$transaction_id,
		1000,
		"123456789",
		"6",
		"http://localhost/sisp-php/src/Faxi/samples/callback-buy.php"
	);

Internationalization

If you want you can change the language of payment form presented to user, it supports en and pt.

$payment->lang = "pt";
You might also like...
PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

PHP Implementation of the all new Basecamp API

Basecamp SDK for PHP The Basecamp SDK for PHP enables PHP developers to easily integrate 37signals Basecamp all new API into their applications. NOTE:

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

PHP package providing easy and fast access to Twitter API V2.

Twitter API V2 is a PHP package that provides an easy and fast access to Twitter REST API for Version 2 endpoints.

A simple PHP API to make working with SharePoint lists easy.

PHP SharePoint Lists API The PHP SharePoint Lists API is designed to make working with SharePoint Lists in PHP a less painful developer experience. Ra

Easy to install email tracker with gui and telegram api bot with date device & ip tracking,

mail-php-tracking-with-gui 📧 Simple mail tracking program that uses php, html, telegram bot, and a gui The gui The gui lets you create specific links

Toxiproxy PHP Client - Toxiproxy makes it easy and trivial to test network conditions, for example low-bandwidth and high-latency situations

Toxiproxy makes it easy and trivial to test network conditions, for example low-bandwidth and high-latency situations. toxiproxy-php-client includes everything needed to get started with configuring Toxiproxy upstream connection and listen endpoints.

The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-services

Smart-ID PHP client Introduction The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-service

A framework agnostic PHP library to build chat bots
A framework agnostic PHP library to build chat bots

BotMan If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course. About BotMa

Owner
Faxi
Online payment platform in Cape Verde whose main objective is to offer the greatest convenience to users.
Faxi
WeChatPay driver for the Omnipay PHP payment processing library

Omnipay: WechatPay WechatPay driver for the Omnipay PHP payment processing library Omnipay is a framework agnostic, multi-gateway payment processing l

Loki Else 312 Jan 4, 2023
PayPal driver for the Omnipay PHP payment processing library

Omnipay: PayPal PayPal driver for the Omnipay PHP payment processing library Omnipay is a framework agnostic, multi-gateway payment processing library

The League of Extraordinary Packages 276 Dec 9, 2022
WHMCS USDT Payment Gateway.

WHMCS USDT Payment Gateway 支持 TRC-20 USDT 转账交易,系统可完成自动化分配地址,入账等操作,配置简单,无需第三方支付平台中转,所有交易直达您的私人账户。 Requirements PHP 7.2 or greater. WHMCS 8.1 or greater

Licson 59 Jan 7, 2023
API client for ThePay - payment gate API

This is the official highly compatible public package of The Pay SDK which interacts with The Pay's REST API. To get started see examples below.

ThePay.cz s.r.o. 3 Oct 27, 2022
Simple papara payment api that you can use without the need for an activation key

PaparaQrApi Papara QR Api Simple papara payment api that you can use without the need for an activation key. Explore the docs » View Demo About The Pr

Azad 6 Dec 20, 2022
2c2p payment gateway Redirect PHP-SDK

2c2p payment gateway Redirect PHP-SDK

Bilions 2 Oct 1, 2022
PHP library with ready-to-use Yunbi API implementation.

yunbi-client-php A simple PHP client for Crypto Trade Site Yunbi.com Quick example <?php require_once('lib/yunbi-client.php'); try { $client = new

null 6 Dec 2, 2019
A PHP implementation of the Unleash protocol aka Feature Flags in GitLab

A PHP implementation of the Unleash protocol aka Feature Flags in GitLab. You may also be interested in the Symfony Bundle for this package. This impl

Unleash 38 Dec 25, 2022
Implementation of hopper logic for pushing, pulling and picking up items for PocketMine-MP.

VanillaHopper In pm4, hopper blocks were implemented to have an inventory. But the logic for pushing, pulling and picking up items was missing nonethe

Colin 14 Dec 14, 2022
The Kafka Enqueue transport - This is an implementation of Queue Interop specification

Supporting Enqueue Enqueue is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and

Enqueue 40 Oct 6, 2022