badinansoft/fib-php-sdk

FIB Online payments service PHP SDK

1.0.1 2023-06-26 12:57 UTC

This package is auto-updated.

Last update: 2024-10-26 16:07:44 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

The PHP SDK for First Iraqi Bank's online payment is a library that allows you to integrate First Iraqi Bank's online payment system into your PHP application. The SDK provides a simple and easy-to-use API that allows you to create, status check, and cancel payments.

Features

  • User Authentication: Verifying the user's identity and credentials and generating an access token for future requests.
  • Payment Creation: Generating QR codes and dynamic links to direct the user to the payment screen when creating a payment.
  • Payment Status Check: Checking the current status of a payment.
  • Payment Cancellation: Canceling an active payment that has not yet been paid.

Installation

You can install the package via composer:

composer require badinansoft/fib-php-sdk

Usage

// 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();
Expected Response
//Check payment status
$fib->payments()
    ->paymentStatus(paymentId: '9dfa724f-4784-4487-811b-63057b540503')
	->getData();
Expected Response
//Cancel Payment
$fib->payments()
    ->cancelPayment(paymentId: '9dfa724f-4784-4487-811b-63057b540503');

Testing

composer tests

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email me@shahabzebari.net instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.