PHP code example of ange007 / omnipay-interkassa
1. Go to this page and download the library: Download ange007/omnipay-interkassa 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/ */
ange007 / omnipay-interkassa example snippets
public function payResponse( $serviceID, $status, $data )
{
// Load Gateway
$gateway = Omnipay::gateway( $serviceID );
// Read data
if( $status === 'notify' && $gateway->supportsAcceptNotification( ) ) { $request = $gateway->acceptNotification( $data ); }
else if( $gateway->supportsCompleteAuthorize( ) ) { $request = $gateway->completeAuthorize( $data ); }
else if( $gateway->supportsCompletePurchase( ) ) { $request = $gateway->completePurchase( $data ); }
// Send request
try { $response = $request->send( ); }
catch( Exception $ex ) { }
// Need wait server notification
if( $response->isPending( ) )
{
//...
}
// Paid successful
else if( $response->isSuccessful( ) )
{
$payID = $response->getTransactionId( );
//...
}
// Pay cancelled from user
else if( $request->isCancelled( ) )
{
//...
}
// Error or other
else
{
$message = $response->getMessage( );
//...
}
}
sh
php composer.phar