cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need a SSL Certificate to make anet_java_sdk testcases work?

I downloaded the current version of sdk and tried to run all the test, but all functional tests seems doesn't work for me. What should I do to make it work?

leoce
Member
4 REPLIES 4

No need for a SSL cert for testing. Were you able to get any debug info at all? Testmode off on the test account?

RaynorC1emen7
Expert

I have this testcase snippet

 

public

void testCreditCardGateway() throws Exception {

Gateway g =

new Gateway();

 

g.setApiLoginID(

apiLoginId);

g.setTransactionKey(

transactionKey);

g.setEnvironment(Environment.

SANDBOX);

 

CreditCard card = CreditCard.createCreditCard();

//card.setAvsCode(avsCode);

//card.setCardholderAuthenticationIndicator("5");

//card.setCardholderAuthenticationValue("123");

card.setCardType(CardType.

VISA);

card.setCreditCardNumber(

"4007000000027");

card.setExpirationMonth(

"12");

card.setExpirationYear(

"2015");

   

MerchantResponse ms = g.authCapture(card, 27.00);

System.

out.println("Credit card AuthCapture");   

System.

out.println(inspectMerchantResponse(ms));

}

 

private

String inspectMerchantResponse(MerchantResponse ms) {

    StringBuffer sb =

new StringBuffer();

    sb.append(

"MerchantResponse " + ms.toString() + ": ");

    sb.append(

"\n- getResponseCode: " + ms.getResponseCode());

    sb.append(

"\n- getResponseReason: " + ms.getResponseReason());

    sb.append(

"\n- getResponseSubCode: " + ms.getResponseSubCode());

    sb.append(

"\n- getResponseNotes: " + ms.getResponseNotes());

    sb.append(

"\n- getTransactionId: " + ms.getTransactionId());

   

return sb.toString();

}

 

and I got this return

 

Credit card AuthCapture

MerchantResponse com.univera.authorizenet.paymentgateway.dao.merchant.MerchantResponse@4c4975:

- getResponseCode: ERROR

- getResponseReason: This transaction has been declined.

- getResponseSubCode: DECLINED

- getResponseNotes: This transaction was submitted from a blocked IP address.

- getTransactionId: 0

 

 

Are you doing custom code? Not sure how it will get a "This transaction was submitted from a blocked IP address." message.

No I created a class that invoked the AIM API/SDK, but when I run the test cases I received that response. I am trying to integrate AIM in a Server application.