I'm having trouble with the Transaction class. I have a java console app that runs a test transaction just fine but when I try to integrate the same code into my web app running under Tomcat 8 I get a class not found error.
I have the same libs included in web app project that I do for the console app
java.lang.NoClassDefFoundError: net/authorize/Transaction
What is interesting is the Transaction class is imported from net.authorize.aim.Transaction not net.authorize.Transaction (no aim package).
I've been able to narrow it down to the inclusion (not even execution) of this line in the code
Result<Transaction> result = (Result<Transaction>) merchant_.postTransaction(authCaptureTransaction);
Possibly a conflict with JSP and the http libs Tomcat uses?
Any ideas?
import java.math.*;
import java.sql.Connection;
import net.authorize.Environment;
import net.authorize.Merchant;
import net.authorize.TransactionType;
import net.authorize.aim.Result;
import net.authorize.aim.Transaction;
Merchant merchant_ = Merchant.createMerchant(Environment.SANDBOX, apiLoginID, transactionKey);
// create credit card
net.authorize.data.creditcard.CreditCard creditCard = net.authorize.data.creditcard.CreditCard.createCreditCard();
creditCard.setCreditCardNumber(ccrTrans.accountNo());
creditCard.setExpirationMonth(String.valueOf(TimeHelper.monthOfYear(ccrTrans.expDate())));
creditCard.setExpirationYear(String.valueOf(TimeHelper.year(ccrTrans.expDate())));
// create transaction
Transaction authCaptureTransaction = merchant_.createAIMTransaction(TransactionType.AUTH_CAPTURE, new BigDecimal(ccrTrans.amount()));
authCaptureTransaction.setCreditCard(creditCard);
Result<Transaction> result = (Result<Transaction>) merchant_.postTransaction(authCaptureTransaction);
ccrTrans.procRef(result.getTarget().getTransactionId());
ccrTrans.respMsg(result.getResponseText());
ccrTrans.procResult(result.getResponseCode().ordinal());