Create a gist now

Instantly share code, notes, and snippets.

Java SDK - Litle Capture Given Auth Transaction
import com.litle.sdk.*;
import com.litle.sdk.generate.*;
public class CaptureGivenAuthExample {
public static void main(String[] args) {
CaptureGivenAuth capturegivenauth = new CaptureGivenAuth();
capturegivenauth.setAmount(106L);
capturegivenauth.setOrderId("12344");
AuthInformation authInfo = new AuthInformation();
Calendar authDate = Calendar.getInstance();
authDate.set(2002, Calendar.OCTOBER, 9);
authInfo.setAuthDate(authDate);
authInfo.setAuthCode("543216");
authInfo.setAuthAmount(12345L);
capturegivenauth.setAuthInformation(authInfo);
capturegivenauth.setOrderSource(OrderSourceType.ECOMMERCE);
CardType card = new CardType();
card.setType(MethodOfPaymentTypeEnum.VI);
card.setNumber("4100000000000001");
card.setExpDate("1210");
capturegivenauth.setCard(card);
CaptureGivenAuthResponse response = new LitleOnline().captureGivenAuth(capturegivenauth);
//Display Results
System.out.println("Response: " + response.getResponse());
System.out.println("Message: " + response.getMessage());
System.out.println("Litle Transaction ID: " + response.getLitleTxnId());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment