This shows you the differences between two versions of the page.
— |
developer:soap-1.6:methods:getcustomerhistory [2012/08/04 10:59] (current) tem created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <embed ..:contents/>====== getCustomerHistory ====== | ||
+ | Pull details of all transactions run for CustNum. | ||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | This method allows you to view all of the transactions completed for a particular customer. | ||
+ | |||
+ | This method requires the use of the CustNum, a unique customer number assigned by the gateway. If you have lost or cannot remember the customer's CustNum, use the [[searchCustomers]] method to find the correct CustNum. | ||
+ | |||
+ | See also [[runCustomerTransaction]], [[enableCustomer]], [[disableCustomer]], [[deleteCustomer]], [[searchCustomerID]], [[getCustomer]], [[searchCustomers]], [[addCustomer]], [[addCustomerPaymentMethod]], [[deleteCustomerPaymentMethod]], [[updateCustomer]], [[quickUpdateCustomer]] | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | [[..:objects:TransactionSearchResult]] **getCustomerHistory** ( [[..:objects:ueSecurityToken]] Token, integer CustNum ) | ||
+ | |||
+ | |||
+ | ===== Arguments ===== | ||
+ | |||
+ | ^Type ^Name ^Description ^ | ||
+ | |[[..:objects:ueSecurityToken]] |Token |Merchant security token: used to identify merchant and validate transaction.| | ||
+ | |integer |CustNum |A unique customer number assigned by the gateway. | | ||
+ | |||
+ | |||
+ | ===== Return Value ===== | ||
+ | |||
+ | |[[..:objects:TransactionSearchResult]] |Returns the results of the customer transaction history search. | | ||
+ | |||
+ | ===== 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 { | ||
+ | |||
+ | $custnum='547'; | ||
+ | print_r($client->getCustomerHistory($token,$custnum)); | ||
+ | |||
+ | } | ||
+ | |||
+ | catch(SoapFault $e) { | ||
+ | |||
+ | echo $e->getMessage(); | ||
+ | |||
+ | } | ||
+ | |||
+ | echo "\n\nRequest: " . $client->__getLastRequest(); | ||
+ | echo "\n\nResponse: " . $client->__getLastResponse(); | ||
+ | |||
+ | ?> | ||
+ | </code> | ||
+ | |||
+ | ==== Java ==== | ||
+ | |||
+ | This example uses the [[developer/javalibrary|USAePay Java library]]. For directions on how to install the library and create the token/client objects, go to either the [[..:howto:javajaxrpc|Java JAX-RPC Howto]] or the [[..:howto:javajaxws|Java JAX-WS Howto]]. | ||
+ | |||
+ | <code java> | ||
+ | try { | ||
+ | //Set CustNum to the Customer Number of customer you | ||
+ | //want to retrieve a transaction history from. | ||
+ | BigInteger CustNum = new BigInteger; | ||
+ | | ||
+ | TransactionSearchResult CustHist = new TransactionSearchResult(); | ||
+ | CustHist = client.getCustomerHistory(token, CustNum); | ||
+ | } catch (Exception e) { | ||
+ | System.out.println("Soap Exception: " + e.getMessage()); | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ==== .NET VB ==== | ||
+ | <code vb> | ||
+ | |||
+ | Dim CustNum As String | ||
+ | CustNum = "103125" | ||
+ | |||
+ | Dim tran As usaepay.TransactionSearchResult | ||
+ | tran = New usaepay.TransactionSearchResult | ||
+ | |||
+ | tran = client.getCustomerHistory(token, CustNum) | ||
+ | MsgBox(tran.SalesCount) | ||
+ | </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> | ||
+ | string CustNum = "89147"; | ||
+ | |||
+ | usaepay.TransactionSearchResult tran = new usaepay.TransactionSearchResult(); | ||
+ | |||
+ | try | ||
+ | { | ||
+ | |||
+ | tran = client.getCustomerHistory(token, CustNum); | ||
+ | MessageBox.Show(string.Concat(tran.SalesCount)); | ||
+ | |||
+ | } | ||
+ | |||
+ | catch (Exception err) | ||
+ | { | ||
+ | MessageBox.Show(err.Message); | ||
+ | } | ||
+ | |||
+ | </code> | ||
+ | |||
+ | ===== Change History ===== | ||
+ | |||
+ | ^ Version ^ Change ^ | ||
+ | | [[developer:soap-1.1:methods:getcustomerhistory|1.1]] | Method added prior to soap-1.1 | |