PHP code example of gcgov / payjunction

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

    

gcgov / payjunction example snippets


$config = new \gcgov\payjunction\config( 'username', 'password', 'apiKey', 'terminalId', 'merchantId' );
$smartTerminalApi = new \gcgov\payjunction\smartTerminal( $config );

//Methods available for interacting with Smart Terminal
$smartTerminalApi->reset();
$smartTerminalApi->status( 'request-id-from-response');
$smartTerminalApi->requestPayment( 100.25 );
$smartTerminalApi->requestSignature( 'Terms and conditions to display on screen');
$smartTerminalApi->signatureImage( 'signature-id-from-response');

$config = new \gcgov\payjunction\config( 'username', 'password', 'apiKey', 'terminalId', 'merchantId' );
$transactionApi = new \gcgov\payjunction\smartTerminal( $config );

//Methods available for interacting with Smart Terminal
$transactionApi->getTransaction( $transactionId );