1. Go to this page and download the library: Download softiran-org/pas 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/ */
softiran-org / pas example snippets
use Pas\Pas;
nds \PHPUnit\Framework\TestCase
{
private $pas;
public function __construct($name = null, array $data = [], $dataName = '')
{
$this->pas = new Pas('XXXXXXXX');
parent::__construct($name, $data, $dataName);
}
public function testRequest()
{
$payload = array(
'amount'=>1000,//your amount
'callback_url'=>'http://www.site.com',//your callback_url
'invoiceID'=>12345,//your invoiceID
);
$res= $this->pas->request($payload);
if($res['Status'] == '0')
{
//TODO: store $res['Accesstoken'] in DB
$this->pas->redirect($res['Accesstoken']);
}else
{
echo $res['Status'];//error description
}
}
public function testVerify()
{
$digitalreceipt = $_GET['digitalreceipt'];
$res = $this->pas->verify($digitalreceipt);
if (strtoupper($res['Status']) == 'OK')
{
if(floatval($result['ReturnId']) == floatval(1000))
{
return true;
}
}else
{
echo $_GET['respmsg'];//error description
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.