oneafricamedia / omnipay-pesapal
Pesapal gateway for Omnipay payment processing library
3.0.4
2021-06-01 12:05 UTC
Requires
- php: ^7.3 || ^8.0
- league/omnipay: ^3.1
README
Pesapal driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Pesapal support for Omnipay. https://www.pesapal.com/ refer to the API docs here: http://developer.pesapal.com/
Install
Via Composer
$ composer require oneafricamedia/omnipay-pesapal
Basic Usage
Get the pesapal iframe/redirect URL
use Omnipay\Omnipay; $url = Omnipay::create('Pesapal') ->setCredentials( 'your_key', 'your_secret' ) ->setCallbackUrl('https://example.com/callback') ->getUrl( 'test@example.com', 'my_reference', 'description', 100 );
Check transaction status (from the pesapal ipn)
- configure & setup an endpoint to receive the ipn message from pesapal
- listen for the message and use
getTransactionStatus
(please handle the http GET vars accordingly)
use Omnipay\Omnipay; $status = Omnipay::create('Pesapal') ->setCredentials( 'your_key', 'your_secret' ) ->getTransactionStatus( $_GET['pesapal_notification_type'], $_GET['pesapal_transaction_tracking_id'], $_GET['pesapal_merchant_reference'] );
$status
will be eitherPENDING
,COMPLETED
,FAILED
orINVALID
. Handle these statuses in your application workflow accordingly.
TODO
- Test coverage
- add
QueryPaymentStatusByMerchantRef
support - add
QueryPaymentDetails
support