Skip to content

Instantly share code, notes, and snippets.

@VantivSDK
Created April 11, 2012 18:51
Show Gist options
  • Save VantivSDK/2361357 to your computer and use it in GitHub Desktop.
Save VantivSDK/2361357 to your computer and use it in GitHub Desktop.
Java SDK - Litle non published example for possible approaches
import com.litle.sdk.*;
import com.litle.sdk.generate.*;
import java.util.Properties;
public class MultiCurrencyExample {
public static void main(String[] args) {
LitleOnline litle = new LitleOnline();
Authorization authorization = new Authorization();
authorization.setReportGroup("Planets");
authorization.setOrderId("12344");
authorization.setAmount(106L);
authorization.setOrderSource(OrderSourceType.ECOMMERCE);
CardType card = new CardType();
card.setType(MethodOfPaymentTypeEnum.VI);
card.setNumber("4100000000000002");
card.setExpDate("1210");
authorization.setCard(card);
LitleOnlineRequest overrides = new LitleOnlineRequest();
if(obj.getCountry.equals("US")) {
overrides.setMerchantId("1001"); //configured in our system for USD
} else if(obj.getCountry.equals("CA")) {
overrides.setMerchantId("1002"); //configured in our system for CDN
}
AuthorizationResponse litle = litle.authorize(authorization, overrides);
//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