Search transactions, only return transaction counts
Identical to the searchTransactions method except only the transaction counts are returned. Like searchTransactions, this method returns TransactionSearchResult. The only difference is that TransactionSearchResult.Transactions is left empty. This method provides a quicker way to determine the size of the result set before starting to retrieve the full search results.
TransactionSearchResult searchTransactionsCount ( ueSecurityToken Token, SearchParam Search, boolean MatchAll, integer Start, integer Limit, string Sort)
Type |
Name |
Description |
Token |
Merchant security token: used to identify merchant and validate transaction. |
|
Search |
Array of search parameters (SearchParam objects) available. |
|
boolean |
MatchAll |
If set to “true,” only results matching all search criteria will be returned, if set to “false,” results matching any of the search criteria will be returned. |
integer |
Start |
Sequence number to start returning on. |
integer |
Limit |
Maximum number of transactions to return in result set. |
string |
Sort |
Comma separated list of fields to sort by. |
Returns the full transaction records for all transactions matching the specified search parameters. |
<?php
try {
// Create search parameter list
$search=array(
'Field'=>'amount',
'Type'=>'eq',
'Value'=>'4.00'),
'Field'=>'created',
'Type'=>'gt',
'Value'=>'2007-03-21'),
'Field'=>'created',
'Type'=>'lt',
'Value'=>'2007-03-22'),
'Field'=>'response',
'Type'=>'eq',
'Value'=>'A')
);
$start=0;
$limit=100;
$matchall=true;
$sort='created';
$res=$client->searchTransactionsCount($token,$search,$matchall,$start,$limit,$sort);
print_r($res);
}
catch(SoapFault $e) {
echo $client->__getLastResponse();
die("Search Transaction Failed :".$e->getMessage());
}
?>
<?php
include './nusoap.php';
// Create Soap Client
$s=new soapclient("./eBizCharge.wsdl",'wsdl');
$tran=$s->getProxy();
// Source Key Setting
$sourcekey='yQbOFkjD8wwlkZ3AhY248k3Lc9PH1l14';
$pin='1234';
// Prep source key
$tmp=$sourcekey . $seed . $pin;
$hash=sha1($tmp);
$token=array('SourceKey'=>$sourcekey, 'PinHash'=>array('Type'=>'sha1', 'Seed'=>$seed,'HashValue'=>$hash));
// Prep Request data
$search=array(
array('Field'=>'amount', 'Type'=>'gt','Value'=>'5.00'),
array('Field'=>'created', 'Type'=>'gt', 'Value'=>'2005-01-01'),
array('Field'=>'response', 'Type'=>'eq', 'Value'=>'A')
);
$start=0;
$limit=10;
$matchall=true;
$sort='created';
$res=$tran->searchTransactionsCount($token,$search,$matchall,$start,$limit,$sort);
if(!$err=$tran->getError()) {
print_r($res);
} else {
echo "Error: $err\n";
echo $tran->request;
}
Dim client As eBizCharge.eBizChargeService = New eBizCharge.eBizChargeService
Dim token As eBizCharge.ueSecurityToken
token = Me.CreateToken("982lz9VsLm87MA54Sv8E582h8OZMArL6", "443311")
Dim MatchAll As Boolean
MatchAll = False
Dim searchParams(1) As eBizCharge.SearchParam
searchParams(0) = New eBizCharge.SearchParam
searchParams(0).Field = "Created"
searchParams(0).Type = "eq"
searchParams(0).Value = "2009-02-19"
Dim SearchResults As eBizCharge.TransactionSearchResult = New eBizCharge.TransactionSearchResult
SearchResults = client.searchTransactionsCount(token, searchParams, MatchAll, 0, 1000, "created")
MsgBox(SearchResults.TransactionsMatched)
Boolean matchAll;
matchAll = true;
string[] fields = new string[3];
eBizCharge.SearchParam[] search = new eBizCharge.SearchParam[2];
search[0] = new eBizCharge.SearchParam();
search[0].Field = "Created";
search[0].Type = "gt";
search[0].Value = "2010-08-08";
eBizCharge.TransactionSearchResult result = new eBizCharge.TransactionSearchResult();
try
{
result = client.searchTransactionsCount(token, search, matchAll, "0", "10", "created");
MessageBox.Show(string.Concat(result.TransactionsMatched));
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}
NOTE: this example has not been tested and is provided as is
<cfscript>
Start = 0;
Limit = 10;
MatchAll=1;
Sort='created';
Search=ArrayNew(1);
Search[1]=structnew();
Search[1].Field='created';
Search[1].Type='gt';
Search[1].Value='2006-09-01';
ws = createObject("webservice", "https://secure.eBizCharge.com/soap/gate/AC5EA536/eBizCharge.wsdl");
Output = ws.searchTransactionsCount(Token, Search, MatchAll, Start, Limit, Sort);
</cfscript>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:eBizCharge" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:searchTransactionsCount>
<Token xsi:type="ns1:ueSecurityToken">
<ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP>
<PinHash xsi:type="ns1:ueHash">
<HashValue xsi:type="xsd:string">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>
<Seed xsi:type="xsd:string">12678150211876663375</Seed>
<Type xsi:type="xsd:string">sha1</Type>
</PinHash>
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
</Token>
<Search SOAP-ENC:arrayType="ns1:SearchParam[1]" xsi:type="ns1:SearchParamArray">
<item xsi:type="ns1:SearchParam">
<Field xsi:type="xsd:string">amount</Field>
<Type xsi:type="xsd:string">eq</Type>
<Value xsi:type="xsd:string">29.00</Value>
</item>
</Search>
<MatchAll xsi:type="xsd:boolean">true</MatchAll>
<Start xsi:type="xsd:integer">0</Start>
<Limit xsi:type="xsd:integer">10</Limit>
<Sort xsi:type="xsd:string">created</Sort>
</ns1:searchTransactionsCount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>