I integrate the example code into my java class and run it on the localhost server, there's an error when debugging at line Transaction authCaptureTransaction = merchant.createAIMTransaction(TransactionType.AUTH_CAPTURE, new BigDecimal(1.99)); The error says java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory . Please help me, i'm very new to authorize.net.
private static final String API_LOGIN_ID = "xxx";
private static final String TRANSACTION_KEY = "xxx";
public static void checkout() {
Merchant merchant = Merchant.createMerchant(Environment.SANDBOX, API_LOGIN_ID, TRANSACTION_KEY);
CreditCard creditCard = CreditCard.createCreditCard();
creditCard.setCreditCardNumber("4111 1111 1111 1111");
creditCard.setExpirationMonth("12");
creditCard.setExpirationYear("2015");
// Create AUTH transaction
Transaction authCaptureTransaction = merchant.createAIMTransaction(TransactionType.AUTH_CAPTURE, new BigDecimal(1.99));
authCaptureTransaction.setCreditCard(creditCard);
Result<Transaction> result = (Result<Transaction>) merchant.postTransaction(authCaptureTransaction);
System.out.println(result.getTarget().getTransactionId());
System.out.println("responseCode = " + result.getResponseCode());
System.out.println("responseText = " + result.getResponseText());
System.out.println("reasonResponseCode = " + result.getReasonResponseCode());
}
Solved! Go to Solution.
12-03-2012 02:00 AM - edited 12-03-2012 02:04 AM
Using the wrong type of account. Read the following
12-03-2012 04:24 AM
I've been missing a few lib files in the sdk, but now there's another error "Transactions of this market type cannot be processed on this system." Anyone who knows please help.
12-03-2012 02:40 AM
Using the wrong type of account. Read the following
12-03-2012 04:24 AM
Thank you, I've solved it
12-04-2012 01:10 AM