Basic Example 2:
AuthorizeNetCC anetcc = new AuthorizeNetCC("/path/to/config.prop"); anetcc.addOptionalField("x_Address","123 Main St."); // if needed for AVS anetcc.addOptionalField("x_Zip","10101"); // if needed for AVS anetcc.addMerchantDefinedField("m_Comment", "Basic Example 2"); anetcc.setTransaction("1234123412341234","11/09","100.00","AUTH_CAPTURE"); try { anetcc.submit(); if (anetcc.getResponseCode().equals("1")) { System.out.println("Your transaction was approved!"); } else { System.out.println("Your transaction was declined! " + anetcc.getResponseReasonText()); } } catch(Exception e) { System.out.println("System Error! " + e); }
This class was designed using the Authorize.net Advanced Integration Method Implementation Guide v1.0. It is recommended that you download a copy of this guide to fully understand what gateway methods should be used for your particular situation.
|
|
|
|