developer:soap:methods:postauth

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:methods:postauth [2009/07/27 08:35]
tem
developer:soap:methods:postauth [2009/09/10 12:49]
charlie
Line 65: Line 65:
   die("​QuickSale failed :" .$e->​getMessage()); ​   die("​QuickSale failed :" .$e->​getMessage()); ​
   }    } 
 +</​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 card holder name and AuthCode
 +    params.setAccountHolder("​Test Joe");
 +    params.setAuthCode("​123123"​);​
 +
 +
 +    // 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
 +    CreditCardData ccdata = new CreditCardData();​
 +      ccdata.setCardNumber("​4444555566667779"​);​
 +      ccdata.setCardExpiration("​0912"​);​
 +      ccdata.setCardCode("​999"​);​
 +    params.setCreditCardData(ccdata);​
 +    ​
 +  // Create response object
 +  TransactionResponse response;
 +  ​
 +  // run sale
 +  response = client.postAuth(token,​ params);
 +
 +  System.out.println("​Response:​ " + response.getResult() + " RefNum: " + response.getRefNum());​
 +} catch (Exception e) {
 +    System.out.println("​Soap Exception: " + e.getMessage());​
 +}
 </​code>​ </​code>​
  
developer/soap/methods/postauth.txt ยท Last modified: 2009/09/10 12:50 by charlie

Page Tools