developer:soap-1.6:methods:searchcustomerscount

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:soap-1.6:methods:searchcustomerscount [2012/08/04 10:57] (current)
tem created
Line 1: Line 1:
 +<embed ..:​contents/>​
 +
 +====== searchCustomersCount ======
 +
 +Search for customers, only return customer counts
 +
 +
 +===== Description =====
 +
 +Identical to the [[searchCustomers]] method except only the customer counts are returned. ​ Like [[searchCustomers]], ​ this method returns [[..:​objects:​CustomerSearchResult]]. ​ The only difference is that CustomerSearchResult.Customers 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.
 +
 +
 +See also [[searchCustomers]],​ [[searchCustomersCustom]]
 +
 +===== Syntax =====
 +
 +[[..:​objects:​CustomerSearchResult]] **searchCustomersCount** ( [[..:​objects:​ueSecurityToken]] Token, [[..:​objects:​SearchParam]] Search, boolean MatchAll, integer Start, integer Limit, string Sort) 
 +
 +
 +===== Arguments =====
 +
 +^Type   ​^Name ​  ​^Description ​  ^
 +|[[..:​objects:​ueSecurityToken]] |Token |Merchant security token: used to identify merchant and validate transaction.|
 +|[[..:​objects:​SearchParam]] |Search |Array of search parameters.|
 +|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 |Start position, defaults to 0 (first customer found).|
 +|integer |Limit |Maximum number of customers to return in result. |
 +|string |Sort |Field name to sort the results by |
 +
 +===== Return Value =====
 +
 +|[[..:​objects:​CustomerSearchResult]] |Returns results of customer search based on parameters set.|
 +
 +===== Examples =====
 +
 +==== PHP ====
 +
 +For directions on how to set up the WSDL link, create "​$token"​ and "​$client",​ go to [[..:​howto:​php|PHP Soap How-to]].
 +
 +<code php>
 +<?​php ​
 +
 +try { 
 +
 +  $search=array( ​
 +    array( ​
 +      '​Field'​=>'​amount',  ​
 +      '​Type'​=>'​gt', ​
 +      '​Value'​=>'​8.00'​), ​
 +
 +    array( ​
 +      '​Field'​=>'​failures',  ​
 +      '​Type'​=>'​gt',  ​
 +      '​Value'​=>'​0'​) ​
 +    ); 
 +  $start=0; ​
 +  $limit=10; ​
 +  $matchall=true; ​
 +  $RefNum=1009411;​
 +  $Sort = "​fname"; ​
 +
 +  $res=$client->​searchCustomersCount($token,​$search,​$matchall,​$start,​$limit,​$Sort); ​
 +  print_r($res); ​             ​
 +
 +
 +catch (SoapFault $e) { 
 +
 +  die("​Search Customers failed :" .$e->​getMessage()); ​
 +
 +
 +
 +?> 
 +</​code>​
 +
 +==== .NET VB ====
 +<code vb>
 +Dim matchAll As Boolean
 +        matchAll = True
 +
 +        Dim search(0) As usaepay.SearchParam
 +
 +        search(0) = New usaepay.SearchParam()
 +
 +        search(0).Field = "​Created"​
 +        search(0).Type = "​Contains"​
 +        search(0).Value = "​2010-09-09"​
 +
 +        Dim response As usaepay.CustomerSearchResult = New usaepay.CustomerSearchResult
 +
 +        response = client.searchCustomersCount(token,​ search, matchAll, "​0",​ "​10",​ "​fname"​)
 +        MsgBox(response.CustomersMatched)
 +</​code>​
 +
 +==== .NET C# ====
 +For directions on how to set up the WSDL link and create the "​token"​ and "​client"​ variables, go to the [[..:​howto:​csharp|C Sharp .Net Soap How-to]].
 +<code c>
 +            Boolean matchAll;
 +            matchAll = true;
 +
 +            string[] fields = new string[3];
 +            usaepay.SearchParam[] search = new usaepay.SearchParam[2];​
 +            search[0] = new usaepay.SearchParam();​
 +
 +            search[0].Field = "​Created";​
 +            search[0].Type = "​Contains";​
 +            search[0].Value = "​2010-08-10";​
 +
 +            usaepay.CustomerSearchResult response = new usaepay.CustomerSearchResult();​
 +
 +            try
 +            {
 +                response = client.searchCustomersCount(token,​ search, matchAll, "​0",​ "​10",​ "​fname"​);​
 +
 +                MessageBox.Show(response.CustomersMatched);​
 +
 +            }
 +
 +
 +            catch (Exception err)
 +            {
 +                MessageBox.Show(err.Message);​
 +            }
 +</​code>​
 +
 +===== Change History =====
 +
 +^Version ^Change ^
 +|[[developer:​soap-1.2:​methods:​searchcustomerscount|1.2]] | Method added in soap 1.2 release |
  
developer/soap-1.6/methods/searchcustomerscount.txt ยท Last modified: 2012/08/04 10:57 by tem

Page Tools