developer:soap:methods:runcheckcredit

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:methods:runcheckcredit [2009/07/31 10:47]
charlie
developer:soap:methods:runcheckcredit [2009/09/10 12:44]
charlie
Line 70: Line 70:
 </​code>​ </​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 {
 +
 +  TransactionRequestObject params = new TransactionRequestObject();​
 +
 +  //set account holder name
 +    params.setAccountHolder("​Test Joe");
 +
 +    // populate transaction details
 +    TransactionDetail details = new TransactionDetail();​
 +      details.setAmount(22.34);​
 +      details.setDescription("​My Test Sale"​);​
 +      details.setInvoice("​119891"​);​
 +    params.setDetails(details);​
 +
 +    // populate credit card data
 +    CheckData checkdata = new CheckData();​
 +      checkdata.setRouting("​123123123"​);​
 +      checkdata.setAccount("​321321"​);​
 +    params.setCheckData(checkdata);​
 +
 +
 +  // Create request object
 +  RunCheckCredit request = new RunCheckCredit();​
 +    request.setToken(token);​
 +    request.setParams(params);​
 +
 +  // Create response object
 +  TransactionResponse response;
 +
 +  // run credit
 +  response = client.runCheckCredit(token,​ params);
 +
 +  System.out.println("​Response:​ " + response.getResult() + " RefNum: " + response.getRefNum());​
 +} catch (Exception e) {
 +    System.out.println("​Soap Exception: " + e.getMessage());​
 +}
 +</​code>​
 +
 +==== Visual Basic (.Net) ====
 +
 +For directions on how to set up the WSDL link, create "​token"​ and "​client",​ go to [[..:​howto:​vb|Visual Basic .Net Soap How-to]].
 +
 +<code vb>
 +Dim transaction As usaepay.TransactionRequestObject ​
 +transaction = New usaepay.TransactionRequestObject
 +
 +transaction.CheckData = New usaepay.CheckData
 +transaction.CheckData.Account = "​1112223333"​
 +transaction.CheckData.Routing = "​123456789"​
 +transaction.CheckData.DriversLicense = "​D5555555"​
 +transaction.CheckData.DriversLicenseState = "​CA"​
 +
 +transaction.Details = New usaepay.TransactionDetail
 +transaction.Details.Amount = "​1.00"​
 +transaction.Details.AmountSpecified = True
 +transaction.Details.Invoice = "​55555"​
 +transaction.Details.Description = "Test Check Sale"
 +
 +transaction.AccountHolder = "Test Guy"
 +
 +Dim response As usaepay.TransactionResponse
 +
 +response = client.runCheckCredit(token,​ transaction)
 +
 +If response.ResultCode = "​A"​ Then
 +MsgBox("​Transaction Approved, Reference Number: " & response.RefNum)
 +ElseIf response.ResultCode = "​D"​ Then
 +MsgBox("​Transaction Declined, Reason: " & response.Error)
 +Else
 +MsgBox("​Transaction Error, Reason: " & response.Error)
 +End If
 +</​code>​
  
 ==== XML ==== ==== XML ====
developer/soap/methods/runcheckcredit.txt ยท Last modified: 2009/09/10 12:44 by charlie

Page Tools