<%@ page import com.luckycart.client.LuckyCart; %> <%@ page import com.luckycart.client.domain.*; %> <% // Create a LuckyCart object with your key and secret LuckyCart luckyCart = LuckyCart.builder().setKey("key").setSecret("secret").createLuckyCart(); // Create a LuckyCartTransaction object // Assuming data from the site are store in a customer and cart object. LuckyCartTransaction transaction = new LuckyCartTransaction(); // mandatory data transaction.setCustomerId(customer.getId()); transaction.setCartId(cart.getId()); transaction.setTtc(cart.getTtc()); transaction.setHt(cart.getHt()); transaction.setCountry(customer.getCountry()); transaction.setEmail(customer.getEmail()); transaction.setPayment(cart.getPayment()); transaction.setFirstName(customer.getFirstName()); transaction.setLastName(customer.getLastName()); transaction.setCodePromo(cart.getCode()); transaction.setCurrency(cart.getCurrency()); transaction.setLang(cart.getLang()); transaction.setProducts(Arrays.asList( new LuckyCartProduct(cart.products[0].getId(), cart.products[0].getHt(), cart.products[0].getTtc(), cart.products[0].getQty()), new LuckyCartProduct(cart.products[1].getId(), cart.products[1].getHt(), cart.products[1].getTtc(), cart.products[1].getQty()) ); // You can add more transaction information by overriding the LuckyCartTransaction class // Sends the request to LC servers LuckyCartPluginResponse pluginResponse = luckyCart.plugin(transaction); %> ... <% out.println(pluginResponse.getGamediv()); %> ... <% out.println(pluginResponse.getScript()); %>