API

On release 1.1.17 we have introduced a new feature for API calls. Our module's data is exposed on three calls for SOAP/XMLRpc APIs.
Since our module extends Magento's CORE API, you need to setup first, please see here for more information.

The available calls are:

sage_pay_transaction.list
Gets transaction data from the sagepaysuite_transaction database table, you can filter the data to suite your needs.

sage_pay_transaction.info
Gets specific transacton data from the sagepaysuite_transaction table for a given VpsTxId (Sage Pay Unique Transction Id)

sage_pay_reporting.info
Gets specific transacton data from Sage Pay's Reporting & Admin API for a given VpsTxId (Sage Pay Unique Transction Id)

sage_pay_reporting.fraud_detail
Gets specific transacton fraud detailed data from Sage Pay's Reporting & Admin API for a given VpsTxId (Sage Pay Unique Transction Id)

Example calls are for SOAP services.

$client = new SoapClient('http://magentohost/index.php/api/soap/?wsdl');

// If somestuff requires api authentification,
// then get a session token
$session = $client->login('apiUser', 'apiKey');


//Getting all transactions from database table
$result = $client->call($session, 'sage_pay_transaction.list');

//Getting transaction list filtered
$result = $client->call($session, 'sage_pay_transaction.list', array( array('vps_tx_id' => array('eq'=>'{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}')) ) );

//Getting information from SagePay's API for given VpsTxId
$result = $client->call($session, 'sage_pay_reporting.info', '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}');

//Getting fraud information detail from SagePay's API for given VpsTxId
$result = $client->call($session, 'sage_pay_reporting.fraud_detail', '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}');

// If you don't need the session anymore
$client->endSession($session);
Comments