PHP code example of hosannahighertech / gateway-php

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

    

hosannahighertech / gateway-php example snippets




use hosannahighertech\gateway\Gateway;
use hosannahighertech\gateway\samples\SampleConfigurations; //Your configuration file

$gateway = new Gateway(new SampleConfigurations());

use hosannahighertech\Gateway\PaymentRequest;

$request = new PaymentRequest();
$request = $request->setCard('1234565432789054')
				 ->setDescription('Buying some soda')
				 ->setAmount(1500)
				 ->setCurrency("TZS")
				 ->setCompany(1)
				 ->setTransferTo(1234567890987654);
				 
$reqReceipt = $gateway->sendRequest($request);
if($reqReceipt === null)
{
	echo $gateway->getError());
}
else
{
	//succesfully. Do something with Request Receipt
}


$paymentReceipt = $gateway->confirmPayment($reqReceipt->getReceipt());
if($paymentReceipt === null)
{
	echo $gateway->getError());
}
else
{
	//succesfully. Do something with Payment Receipt
}
bash
composer