colinbm / sagepayadminapi-php
Installs: 77 597
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 3
Open Issues: 0
Type:script
This package is not auto-updated.
Last update: 2025-06-14 00:11:15 UTC
README
Provides an easy way to access the Admin API. You can use any command specified in the Reporting and Admin API documentation as a method. Pass an array of elements to send, as detailed in the document.
Examples
Get a single transaction
$adminapi = new SagePayAdminApi('vendor', 'username', 'password'); $transaction = $adminapi->getTransactionDetail(array('vendortxcode' => '12345678')); echo "Third Man Status: {$transaction->t3maction} ({$transaction->t3mscore})\n";
Get Visa and MasterCard refunds from March 2014
$adminapi = new SagePayAdminApi('vendor', 'username', 'password'); // SagePay will only return 50 rows at a time so loop until we have them all. do { $list = $adminapi->getTransactionList(array( 'startdate' => '01/03/2014 00:00:00', 'enddate' => '01/04/2014 00:00:00', 'startrow' => $end_row + 1, 'txtypes' => array( 'txtype' => 'REFUND', ), 'paymentsystems' => array( 'paymentsystem' => array( 'MC', 'Visa', ) ), ) ); // Check response is OK if ( '0000' != $list->errorcode ) { die( $list->errorcode . ' : ' . $list->error ); } $total_rows = (int) $list->transactions->totalrows; $end_row = (int) $list->transactions->endrow; foreach ( $list->transactions->transaction as $transaction ) { var_dump( $transaction ); } } while ( $end_row < $total_rows );