Skip to content

Instantly share code, notes, and snippets.

@VantivSDK
Created March 20, 2012 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VantivSDK/2139803 to your computer and use it in GitHub Desktop.
Save VantivSDK/2139803 to your computer and use it in GitHub Desktop.
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