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
Last revision Both sides next revision
developer:soap-1.1:methods:searchtransactionscustom [2009/06/30 10:38]
charlie
developer:soap-1.1:methods:searchtransactionscustom [2010/09/29 14:36]
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> +
-<?php  +
- +
-include './​nusoap.php';​  +
- +
-// Create Soap Client  +
-$s=new soapclient("​./​usaepay.wsdl",'​wsdl'​);​  +
-$tran=$s->​getProxy();​  +
- +
-// Source Key Setting  +
-$sourcekey='​yQbOFkjD8wwlkZ3AhY248k3Lc9PH1l14';​  +
-$pin='​1234';​  +
- +
-// Prep source key  +
-$seed=mktime() . rand();  +
-$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;  +
- +
-$res=$tran->​searchTransactions($token,​$search,​$matchall,​$start,​$limit);​  +
- +
-if(!$err=$tran->​getError()) {  +
-        print_r($res);​  +
-} else {  +
- +
-        echo "​Error:​ $err\n";​  +
-        echo $tran->​request; ​  +
- +
-}  +
-</​code>​+
  
-==== VB ==== 
 <code vb> <code vb>
-  ​Dim client As usaepay.usaepayService = New usaepay.usaepayService +        ' instantiate client 
-  Dim token As usaepay.ueSecurityToken+        ​Dim client As usaepay.usaepayService = New usaepay.usaepayService
  
-  ​token = Me.CreateToken("​982lz9VsLm87MA54Sv8E582h8OZMArL6",​ "​443311"​)+        ' build security token using sourcekey and pin 
 +        Dim token As usaepay.ueSecurityToken 
 +        ​token = Me.CreateToken("​982lz9VsLm87MA54Sv8E582h8OZMArL6",​ "​443311"​)
  
-  ​Dim MatchAll As Boolean+        ' Search type is AND  (all search parameters must be matched) 
 +        ​Dim MatchAll As Boolean 
 +        MatchAll = True
  
-  MatchAll ​False+        ' List of search parameters 
 +        Dim searchParams(1) As usaepay.SearchParam 
 +        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"​
  
-  ​Dim searchParams(1) ​As usaepay.SearchParam +        ' Result Record to start on 
-    ​searchParams(0) ​New usaepay.SearchParam +        ​Dim start As Integer 
-    searchParams(0).Field = "​Created"​ +        ​start ​1
-    searchParams(0).Type = "​eq"​ +
-    searchParams(0).Value = "​2009-02-19"​+
  
-  ​Dim SearchResults ​As usaepay.TransactionSearchResult ​New usaepay.TransactionSearchResult +        ' List of fields to return 
-  ​SearchResults ​client.searchTransactions(token, searchParams,​ MatchAll, 0, 1000)+        ​Dim FieldList(2) ​As String 
 +        FieldList(0) ​"​Response.RefNum"​ 
 +        ​FieldList(1) ​"​Response.ResultCode"​ 
 +        FieldList(2= "​CustomerID"​
  
-  MsgBox(SearchResults.TransactionsMatched) +        ' limit to 10 results 
-</​code>​+        Dim limit As Integer 
 +        limit = "​10"​
  
 +        Dim SearchResults As String
 +        SearchResults = client.searchTransactionsCustom(token,​ searchParams,​ MatchAll, 0, 1000, FieldList, "​csv"​)
  
- +        ' results are base64 encode 
-==== Coldfusion ==== +        Dim binaryData() As Byte 
- +        ​binaryData ​Convert.FromBase64String(SearchResults
-//NOTE//: this example has not been tested and is provided as is  +        ​MsgBox(Encoding.UTF8.GetString(binaryData))
- +
-<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 247:
 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 267:
 <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 284:
  
 ^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