developer:soap-1.1:methods:searchtransactionscustom

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developer:soap-1.1:methods:searchtransactionscustom [2009/06/30 10:38]
charlie
developer:soap-1.1:methods:searchtransactionscustom [2010/09/29 14:37]
irina
Line 1: Line 1:
-====== searchTransactions ======+<embed ..:​contents/>​
  
-Search transactions and return ​full transaction records.+====== searchTransactionsCustom ====== 
 + 
 +Search transactions and return ​only specific fields.
  
 ===== Description ===== ===== Description =====
  
-This method ​allows ​you to find transactions ​even if you have misplaced or can't remember ​the transaction'​s RefNum (a unique number assigned to each transaction by the gateway).+Use this method ​if you only need to view a few select fields of the transactions you are searching for. Since it will only return ​the fields you specify, it is more efficient than the [[searchTransactions]] method.
  
-The following fields may be used to search the database and return transaction details: ​+See also [[getTransaction]],​ [[getTransactionStatus]],​ [[getTransactionCustom]],​ [[searchTransactions]],​ [[getTransactionReport]] ​
  
-  * TransID  +===== Search, Sort and Return Fields =====
-  * BatchID  +
-  * Type  +
-  * Status  +
-  * Response  +
-  * AuthCode  +
-  * AvsResult  +
-  * CvcResult  +
-  * Reason  +
-  * ErrorCode  +
-  * Created  +
-  * CreateDate  +
-  * CreateTime  +
-  * Invoice  +
-  * OrderID  +
-  * PoNum  +
-  * CustID  +
-  * RecCustID  +
-  * Description  +
-  * Amount  +
-  * Currency  +
-  * RawAmount  +
-  * Tax  +
-  * Tip  +
-  * Shipping  +
-  * Discount  +
-  * Subtotal  +
-  * Cardholder  +
-  * CCNum  +
-  * CCNum4First  +
-  * AvsStreet  +
-  * AvsZip  +
-  * User  +
-  * Clerk  +
-  * TranTerm  +
-  * Rest_Table  +
-  * Sources.Name  +
-  * ServerIP  +
-  * ClientIP  +
-  * CheckNum  +
-  * VCAccount  +
-  * VCRouting  +
-  * VCChecks.Effective  +
-  * VCChecks.Settled  +
-  * VCChecks.Processed  +
-  * VCChecks.Returned  +
-  * VCChecks.Banknote  +
-  * Billing_FName  +
-  * Billing_LName  +
-  * Billing_Company  +
-  * Billing_Street  +
-  * Billing_Street2  +
-  * Billing_City  +
-  * Billing_State  +
-  * Billing_Zip  +
-  * Billing_Country  +
-  * Billing_Phone  +
-  * Email  +
-  * Fax  +
-  * Website  +
-  * Shipping_FName  +
-  * Shipping_LName  +
-  * Shipping_Company  +
-  * Shipping_Street  +
-  * Shipping_Street2  +
-  * Shipping_City  +
-  * Shipping_State  +
-  * Shipping_Zip  +
-  * Shipping_Country  +
-  * Shipping_Phone+
  
 +The following fields may be used in the SearchParam,​ Sort and FieldList parameters:
  
-See also [[getTransaction]],​ [[getTransactionStatus]],​ [[getTransactionCustom]],​ [[searchTransactions]],​ [[getTransactionReport]] ​+  *transactiontype 
 +  *response.authcode 
 +  *response.avsresult 
 +  *response.avsresultcode 
 +  *response.batchnum 
 +  *response.batchrefnum 
 +  *response.cardcoderesult 
 +  *response.cardcoderesultcode 
 +  *response.conversionrate 
 +  *response.convertedamount 
 +  *response.convertedamountcurrency 
 +  *response.custnum 
 +  *response.error 
 +  *response.errorcode 
 +  *response.refnum 
 +  *response.result 
 +  *response.resultcode 
 +  *response.status 
 +  *response.statuscode 
 + 
 +  *checktrace.trackingnum 
 +  *checktrace.effective 
 +  *checktrace.processed 
 +  *checktrace.settled 
 +  *checktrace.returned 
 +  *checktrace.banknote 
 +  *datetime 
 +  *accountholder
  
 +  *details.invoice
 +  *details.ponum
 +  *details.orderid
 +  *details.clerk
 +  *details.terminal
 +  *details.table
 +  *details.description
 +  *details.amount
 +  *details.currency
 +  *details.tax
 +  *details.tip
 +  *details.nontax
 +  *details.shipping
 +  *details.discount
 +  *details.subtotal
  
 +  *creditcarddata.cardtype
 +  *creditcarddata.cardnumber
 +  *creditcarddata.cardexpiration
 +  *creditcarddata.cardcode
 +  *creditcarddata.avsstreet
 +  *creditcarddata.avszip
 +  *creditcarddata.cardpresent
 +  *checkdata.checknumber
 +  *checkdata.routing
 +  *checkdata.account
 +  *checkdata.ssn
 +  *checkdata.driverslicense
 +  *checkdata.driverslicensestate
 +  *checkdata.recordtype
 +  *user
 +  *source
 +  *serverip
 +  *clientip
 +  *customerid
 +  *billingaddress.firstname
 +  *billingaddress.lastname
 +  *billingaddress.company
 +  *billingaddress.street
 +  *billingaddress.street2
 +  *billingaddress.city
 +  *billingaddress.state
 +  *billingaddress.zip
 +  *billingaddress.country
 +  *billingaddress.phone
 +  *billingaddress.fax
 +  *billingaddress.email
 +  *shippingaddress.firstname
 +  *shippingaddress.lastname
 +  *shippingaddress.company
 +  *shippingaddress.street
 +  *shippingaddress.street2
 +  *shippingaddress.city
 +  *shippingaddress.state
 +  *shippingaddress.zip
 +  *shippingaddress.country
 +  *shippingaddress.phone
 +  *shippingaddress.fax
 +  *shippingaddress.email
  
 ===== Syntax ===== ===== Syntax =====
  
-[[developer:​soap:​objects:​TransactionSearchResult]] ​**searchTransactions** ( [[developer:​soap:​objects:​ueSecurityToken]] Token, [[developer:​soap:​objects:​SearchParam]] Search, boolean MatchAll, integer Start, integer Limit )  +string ​**searchTransactionsCustom** (  
- +[[developer:​soap:​objects:​ueSecurityToken]] Token, ​ 
- +[[developer:​soap:​objects:​SearchParam]] Search, ​ 
 +boolean MatchAll, ​ 
 +integer Start, integer Limit, string FieldList, string Format ​
  
  
Line 96: Line 116:
  
 ^Type   ​^Name ​  ​^Description ​  ^ ^Type   ​^Name ​  ​^Description ​  ^
-|[[developer:​soap:​objects:​ueSecurityToken]] |Token |Merchant security token: used to identify merchant and validate transaction.| +| [[developer:​soap:​objects:​ueSecurityToken]] | Token  |Merchant security token: used to identify merchant and validate transaction. | 
-|[[developer:​soap:​objects:​SearchParam]] |Search |Array of search parameters (SearchParam objects) available.| +| [[developer:​soap:​objects:​SearchParam]] ​ | 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.| +| 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 | Start | Sequence number to start returning on. | 
-|integer |Limit |Maximum number of transactions to return in result set. |+| integer | Limit | Maximum number of transactions to return in result set. | 
 +| string ​ | FieldList | String Array of fields to return in search. | 
 +| string ​ | Format | Specify format of return data. Possible formats include: csv, tab, xml. |
  
  
 ===== Return Value ===== ===== Return Value =====
  
-|[[developer:​soap:​objects:​TransactionSearchResult]] ​|Returns ​the full transaction records for all transactions matching ​the specified ​search parameters. |+string ​Base64 encode result set. Returns all of the fields from any transactions matching ​your search parameters. |  
  
 ===== Examples ===== ===== Examples =====
  
  
 +==== PHP ====
  
- 
-==== PHP 5 ==== 
 For directions on how to set up the WSDL link, create "​$token"​ and "​$client",​ go to [[developer:​soap:​howto:​php|PHP Soap How-to]]. For directions on how to set up the WSDL link, create "​$token"​ and "​$client",​ go to [[developer:​soap:​howto:​php|PHP Soap How-to]].
  
 <code php> <code php>
- 
 <?​php ​ <?​php ​
  
 try {  try { 
  
-  ​// Create ​search ​parameter list +// make sure you prep data to search ​on  
   $search=array( ​   $search=array( ​
     array( ​     array( ​
-      '​Field'​=>'​amount', ​  ​+      '​Field'​=>'​amount', ​ 
       '​Type'​=>'​eq', ​       '​Type'​=>'​eq', ​
-      '​Value'​=>'​4.00'​), ​+      '​Value'​=>'​3.83'​), ​
     array( ​     array( ​
       '​Field'​=>'​created',  ​       '​Field'​=>'​created',  ​
       '​Type'​=>'​gt',  ​       '​Type'​=>'​gt',  ​
-      '​Value'​=>'​2007-03-21'​), ​+      '​Value'​=>'​2007-05-09'​), ​
     array( ​     array( ​
       '​Field'​=>'​created',  ​       '​Field'​=>'​created',  ​
       '​Type'​=>'​lt',  ​       '​Type'​=>'​lt',  ​
-      '​Value'​=>'​2007-03-22'​), ​+      '​Value'​=>'​2007-05-22'​), ​
     array( ​     array( ​
       '​Field'​=>'​response',  ​       '​Field'​=>'​response',  ​
Line 140: Line 162:
       '​Value'​=>'​A'​) ​       '​Value'​=>'​A'​) ​
     );      ); 
 +
   $start=0; ​   $start=0; ​
   $limit=100; ​   $limit=100; ​
   $matchall=true; ​   $matchall=true; ​
  
-  $res=$client->​searchTransactions($token,$search,$matchall,​$start,​$limit); +  $fieldList=array 
 +    '​Details.Amount'​  
 +    '​AccountHolder'​  
 +    '​CheckTrace.TrackingNum'​); 
  
 +  $format ='​csv'; ​
 +    ​
 +  $res=$client->​searchTransactionsCustom($token,​$search,​$matchall,​$start,​$limit,​$fieldList,​$format); ​
 +
 +  $res=base64_decode($res); ​
   print_r($res); ​   print_r($res); ​
                            
  
 +
 catch(SoapFault $e) {  catch(SoapFault $e) { 
   echo $client->​__getLastResponse(); ​   echo $client->​__getLastResponse(); ​
-  die("Search ​Transaction Failed :"​.$e->​getMessage());​  +  die("Serach ​Transaction Failed :"​.$e->​getMessage());​  
-+  
  
 ?>  ?> 
 </​code>​ </​code>​
  
-==== PHP 4 (NuSOAP) ​====+==== VB.Net ​====
  
-<​code ​php+<​code ​vb
-<?​php ​+        '​ instantiate client 
 +        Dim client As usaepay.usaepayService = New usaepay.usaepayService
  
-include ​'./nusoap.php'; ​+        ​' ​build security token using sourcekey and pin 
 +        Dim token As usaepay.ueSecurityToken 
 +        token = Me.CreateToken("​982lz9VsLm87MA54Sv8E582h8OZMArL6",​ "​443311"​)
  
-// Create Soap Client  +        ' Search type is AND  ​(all search parameters must be matched
-$s=new soapclient("​./​usaepay.wsdl",'​wsdl'​) +        Dim MatchAll As Boolean 
-$tran=$s->​getProxy(); ​+        MatchAll ​True
  
-// Source Key Setting ​ +        ' List of search parameters 
-$sourcekey='​yQbOFkjD8wwlkZ3AhY248k3Lc9PH1l14'; ​ +        Dim searchParams(1) As usaepay.SearchParam 
-$pin='​1234'; ​+        searchParams(0) ​New usaepay.SearchParam 
 +        ​searchParams(0).Field ​"​Created"​ 
 +        searchParams(0).Type = "​gt"​ 
 +        searchParams(0).Value = "​2009-05-13 00:​00:​00"​ 
 +        searchParams(1) = New usaepay.SearchParam 
 +        searchParams(1).Field = "​reccustid"​ 
 +        searchParams(1).Type = "​gt"​ 
 +        searchParams(1).Value = "​0"​
  
-// Prep source key  +        ' Result Record to start on 
-$seed=mktime() . rand(); ​ +        Dim start As Integer 
-$tmp=$sourcekey . $seed . $pin;  +        ​start ​1
-$hash=sha1($tmp);​  +
-$token=array('​SourceKey'​=>​$sourcekey,​ '​PinHash'​=>​array('​Type'​=>'​sha1',​ '​Seed'​=>​$seed,'​HashValue'​=>​$hash)); ​+
  
 +        ' List of fields to return
 +        Dim FieldList(2) As String
 +        FieldList(0) = "​Response.RefNum"​
 +        FieldList(1) = "​Response.ResultCode"​
 +        FieldList(2) = "​CustomerID"​
  
-// Prep Request data  +        ​' ​limit to 10 results 
-$search=array(  +        Dim limit As Integer 
-      array('Field'​=>'​amount',​ '​Type'​=>'​gt','​Value'​=>'​5.00'​), ​ +        limit = "10"
-      ​array('​Field'​=>'​created',​ '​Type'​=>'​gt',​ '​Value'​=>'​2005-01-01'​), ​ +
-      ​array('​Field'​=>'​response',​ '​Type'​=>'​eq',​ '​Value'​=>'​A'​)  +
-);  +
-$start=0;  +
-$limit=10;  +
-$matchall=true; ​+
  
-$res=$tran->​searchTransactions($token,$search,$matchall,$start,$limit)+        Dim SearchResults As String 
 +        SearchResults ​client.searchTransactionsCustom(token, ​searchParamsMatchAll01000, FieldList, "​csv"​)
  
-if(!$err=$tran->​getError()) {  +        ' results are base64 encode 
-        ​print_r($res);  +        Dim binaryData() As Byte 
-} else {  +        binaryData ​Convert.FromBase64String(SearchResults
- +        ​MsgBox(Encoding.UTF8.GetString(binaryData))
-        echo "​Error:​ $err\n";​  +
-        echo $tran->​request; ​  +
- +
-+
 </​code>​ </​code>​
  
-==== VB ==== +==== .NET C# ==== 
-<​code ​vb+<​code ​c
-  Dim client As usaepay.usaepayService ​New usaepay.usaepayService +Boolean matchAll; 
-  Dim token As usaepay.ueSecurityToken+            matchAll ​true;
  
-  token Me.CreateToken("​982lz9VsLm87MA54Sv8E582h8OZMArL6",​ "​443311"​)+            string[] fields ​new string[3];​ 
 +            usaepay.SearchParam[] search = new usaepay.SearchParam[2];​ 
 +            search[0] = new usaepay.SearchParam();
  
-  Dim MatchAll As Boolean+            search[0].Field = "​Created";​ 
 +            search[0].Type = "​Contains";​ 
 +            search[0].Value = "​2010-08-09";​
  
-  MatchAll ​False+            string[] FieldList ​new string[3];​ 
 +            FieldList[0] = "​Response.RefNum";​ 
 +            FieldList[1] = "​Response.ResultCode";​ 
 +            FieldList[2] = "​CustomerID";​
  
-  Dim searchParams(1) As usaepay.SearchParam +            string result;
-    searchParams(0) = New usaepay.SearchParam +
-    searchParams(0).Field = "​Created"​ +
-    searchParams(0).Type = "​eq"​ +
-    searchParams(0).Value = "​2009-02-19"​+
  
-  Dim SearchResults As usaepay.TransactionSearchResult = New usaepay.TransactionSearchResult +            try 
-  ​SearchResults ​= client.searchTransactions(token, ​searchParamsMatchAll, 0, 1000)+            { 
 +                result ​= client.searchTransactionsCustom(token, ​searchmatchAll"0""​10",​ FieldList, "​csv"​);​ 
 +                Byte[] binaryData = new Byte[3]; 
 +                binaryData = Convert.FromBase64String(result);
  
-  MsgBox(SearchResults.TransactionsMatched) +                MessageBox.Show(Encoding.UTF8.GetString(binaryData));
-</​code>​+
  
 +            }
  
  
-==== Coldfusion ==== +            catch (Exception err
- +            { 
-//NOTE//: this example has not been tested and is provided as is  +                ​MessageBox.Show(err.Message); 
- +            }
-<code cfm> +
-<​cfscript>​  +
-Start = 0;  +
-Limit = 10;  +
-MatchAll=1;  +
-Search=ArrayNew(1) +
-Search[1]=structnew(); ​ +
-Search[1].Field='​created';​  +
-Search[1].Type='​gt';​  +
-Search[1].Value='​2006-09-01';​  +
- +
-ws = createObject("​webservice",​ "​https://​www.usaepay.com/​soap/​gate/​AC5EA536/​usaepay.wsdl"​);​  +
-Output = ws.searchTransactions(Token,​ Search, MatchAll, Start, Limit);  +
-</​cfscript> ​+
 </​code>​ </​code>​
- 
  
 ==== XML ==== ==== XML ====
Line 257: Line 284:
 SOAP-ENV:​encodingStyle="​http://​schemas.xmlsoap.org/​soap/​encoding/"> ​ SOAP-ENV:​encodingStyle="​http://​schemas.xmlsoap.org/​soap/​encoding/"> ​
 <​SOAP-ENV:​Body> ​ <​SOAP-ENV:​Body> ​
-<ns1:searchTransactions+<ns1:searchTransactionsCustom
 <Token xsi:​type="​ns1:​ueSecurityToken"> ​ <Token xsi:​type="​ns1:​ueSecurityToken"> ​
 <​ClientIP xsi:​type="​xsd:​string">​192.168.0.1</​ClientIP> ​ <​ClientIP xsi:​type="​xsd:​string">​192.168.0.1</​ClientIP> ​
 <PinHash xsi:​type="​ns1:​ueHash"> ​ <PinHash xsi:​type="​ns1:​ueHash"> ​
-<​HashValue xsi:​type="​xsd:​string">​34108e1b91894ab1da5ecdc213341c6d757217c1</​HashValue>​  +<​HashValue xsi:​type="​xsd:​string">​c5948b425ee3593afc689aa4129b580e64d28fa3</​HashValue>​  
-<Seed xsi:​type="​xsd:​string">​11936961311067412713</​Seed> ​+<Seed xsi:​type="​xsd:​string">​11936964681053228515</​Seed> ​
 <Type xsi:​type="​xsd:​string">​sha1</​Type> ​ <Type xsi:​type="​xsd:​string">​sha1</​Type> ​
 </​PinHash> ​ </​PinHash> ​
Line 277: Line 304:
 <Start xsi:​type="​xsd:​integer">​0</​Start> ​ <Start xsi:​type="​xsd:​integer">​0</​Start> ​
 <Limit xsi:​type="​xsd:​integer">​10</​Limit> ​ <Limit xsi:​type="​xsd:​integer">​10</​Limit> ​
-</ns1:searchTransactions+<​FieldList SOAP-ENC:​arrayType="​xsd:​string[5]"​ xsi:​type="​ns1:​stringArray">​  
 +<item xsi:​type="​xsd:​string">​Response.AvsResult</​item>​  
 +<item xsi:​type="​xsd:​string">​Response.AvsResultCode</​item>​  
 +<item xsi:​type="​xsd:​string">​DateTime</​item>​  
 +<item xsi:​type="​xsd:​string">​Response.Error</​item>​  
 +<item xsi:​type="​xsd:​string">​Details.Invoice</​item>​  
 +</​FieldList>​  
 +<Format xsi:​type="​xsd:​string">​xml</​Format>​  
 +</ns1:searchTransactionsCustom
 </​SOAP-ENV:​Body> ​ </​SOAP-ENV:​Body> ​
 </​SOAP-ENV:​Envelope> ​ </​SOAP-ENV:​Envelope> ​
Line 286: Line 321:
  
 ^Version ^Change ^ ^Version ^Change ^
-|[[pending:​soap:​methods:​searchtransactions|1.2]] | Added Sort Parameter | +|[[developer:soap-1.1:methods:searchtransactionscustom|1.1]] | Soap 1.1 Release |
-|1.1 | Soap 1.1 Release |+
  
developer/soap-1.1/methods/searchtransactionscustom.txt · Last modified: 2010/09/29 14:37 by irina

Page Tools