cancel
Showing results for 
Search instead for 
Did you mean: 

get transaction error using Java SDK

I'm trying to get the transaction detail using Java SDK, but I got this serror:

 

The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:name' element is invalid - The value 'l8WvUDkZPBu15VPKuEp9KnSytfGEi6KfF27n6L35ptk=' is invalid according to its datatype 'String' - The actual length is greater than the MaxLength value.

 

not sure what is wrong, I got the sdk from maven repository

 

<dependency>
<groupId>net.authorize</groupId>
<artifactId>anet-java-sdk</artifactId>
<version>1.8.0</version>
</dependency>

 

and here is the code I'm using

 

<code>
Merchant merchant = Merchant.createMerchant(Environment.SANDBOX,
anetLogin,anetKey);
 
Transaction transaction = merchant.createReportingTransaction(TransactionType.GET_TRANSACTION_DETAILS);
ReportingDetails reportingDetails = ReportingDetails.createReportingDetails();
reportingDetails.setTransactionId(payment.getPaymentDetail().getTransactionId());
transaction.setReportingDetails(reportingDetails);
Result<Transaction> result = (Result<Transaction>) merchant.postTransaction(transaction);
</code>

 

 

hope someone could help me.

jibarra04
Member
1 ACCEPTED SOLUTION

Accepted Solutions

I was selecting the wrong merchant login from my db, once I get the right the transaction works as expected.

 

Thanks all for you support. 

View solution in original post

5 REPLIES 5

does it an SDK issue?

jibarra04
Member

does the setup work with creating transaction? did you encrypt the anetLogin?

Merchant.createMerchant(Environment.SANDBOX,anetLogin,anetKey);

not I didn't encryot the anetLogin or anetKEt, since there is no comment at all in the code sample setions. here is how the configure the merchant

 

  String apiLoginID = "YOUR_API_LOGIN_ID";
  String transactionKey = "YOUR_TRANSACTION_KEY";

  Merchant merchant = Merchant.createMerchant(Environment.SANDBOX,
              apiLoginID, transactionKey);

 nothing about encryptatio is mention.

 

So should I encrypt it?

So should I encrypt it? No.

 

Can you log the xml to see what is getting send?

And what is this?

l8WvUDkZPBu15VPKuEp9KnSytfGEi6KfF27n6L35ptk=

I was selecting the wrong merchant login from my db, once I get the right the transaction works as expected.

 

Thanks all for you support.