PHP code example of badinansoft / fib-php-sdk

1. Go to this page and download the library: Download badinansoft/fib-php-sdk 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/ */

    

badinansoft / fib-php-sdk example snippets


// create object instance of class

$fib = new \Badinansoft\FIB\FIB(client_id: '', client_secret:'');



//create a payment
$payment = $fib->payments()
    ->createPayment(amount: 20,
				    currency: 'IQD',
				    description: 'Host Invoice #2832',
				    statusCallbackUrl: 'https://.....')
				    

	//return all data as stdClass Object 
	$payment->getData();

//Check payment status
$fib->payments()
    ->paymentStatus(paymentId: '9dfa724f-4784-4487-811b-63057b540503')
	->getData();

//Cancel Payment
$fib->payments()
    ->cancelPayment(paymentId: '9dfa724f-4784-4487-811b-63057b540503');
bash
composer