PHP code example of gccm / windcave-client

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

    

gccm / windcave-client example snippets


use Gccm\WindcaveClient\Windcave;
use Gccm\WindcaveClient\exception\WindcaveException;

try {
    $windcave = new Windcave(
        'https://sec.paymentexpress.com/pxaccess/pxpay.aspx',
        'SampleUserId',
        '17ce70a6025d8b925373066d3f71704a1868ea30a8d0485b6d086f722fdd9997'
    );

    $url = $windcave->getPaymentUrl([
        'MerchantReference' => 'Auth Example',
        'TxnType' => 'Auth',
        'AmountInput' => '1.00',
        'CurrencyInput' => 'NZD',
        'TxnData1' => 'John Doe',
        'TxnData2' => '0211111111',
        'TxnData3' => '98 Anzac Ave, Auckland 1010',
        'EmailAddress' => '[email protected]',
        'TxnId' => uniqid(),
        'UrlSuccess' => 'https://demo.paymentexpress.com/SandboxSuccess.aspx',
        'UrlFail' => 'https://demo.paymentexpress.com/SandboxSuccess.aspx',
    ]);

    echo $url;
} catch (WindcaveException $e) {
    // do some stuff with $e
}


use Gccm\WindcaveClient\Windcave;
use Gccm\WindcaveClient\exception\WindcaveException;

try {
    $windcave = new Windcave(
        'https://sec.paymentexpress.com/pxaccess/pxpay.aspx',
        'SampleUserId',
        '17ce70a6025d8b925373066d3f71704a1868ea30a8d0485b6d086f722fdd9997'
    );

    $result = $windcave->getResult('00008400001853747f2bc6ded6012345');

    var_dump($result);
]);
} catch (WindcaveException $e) {
    // do some stuff with $e
}