@@ -0,0 +1,2680 @@
+package com.sailthru.client;%0A%0Aimport com.sailthru.client.exceptions.ApiException;%0Aimport com.sailthru.client.handler.response.JsonResponse;%0Aimport com.sailthru.client.params.Purchase;%0Aimport com.sailthru.client.params.PurchaseItem;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class SendExample %7B%0A    public static void main(String%5B%5D args) %7B%0A        %7B%0A            String apiKey = %22****%22;%0A            String apiSecret = %22***%22;%0A            SailthruClient client = new SailthruClient(apiKey, apiSecret);%0A            try %7B%0A                Purchase purchase = new Purchase();%0A                PurchaseItem firstpurchaseitem = new PurchaseItem(1, %22example purchase item%22, 1999, %22example id%22, %22http://www.sailthru.com/example/purchase/url%22);%0A                java.util.List%3CPurchaseItem%3E items = new ArrayList%3CPurchaseItem%3E();%0A                items.add(firstpurchaseitem);%0A                purchase.setItems(items);%0A%0A                Map%3CString, Object%3E adjustmentItem = new HashMap%3CString, Object%3E();%0A                adjustmentItem.put(%22title%22, %22bar%22);%0A                adjustmentItem.put(%22price%22, 1000);%0A                java.util.ArrayList adjustments = new ArrayList();%0A                adjustments.add(adjustmentItem);%0A                purchase.setAdjustments(adjustments);%0A%0A                Map%3CString, Object%3E TenderItem = new HashMap%3CString, Object%3E();%0A                TenderItem.put(%22title%22, %22bar%22);%0A                TenderItem.put(%22price%22, 1000);%0A                java.util.ArrayList tenders = new ArrayList();%0A                tenders.add(TenderItem);%0A                purchase.setTenders(tenders);%0A%0A                Map%3CString, Object%3E vars = new HashMap%3CString, Object%3E();%0A                vars.put(%22name%22, %22Prajwal Tuladhar%22);%0A                Map%3CString, String%3E addressVars = new HashMap%3CString, String%3E();%0A                addressVars.put(%22state%22, %22NY%22);%0A                addressVars.put(%22city%22, %22Jackson Heights%22);%0A                addressVars.put(%22zip%22, %2211372%22);%0A                vars.put(%22address%22, addressVars);%0A%0A                purchase.setPurchaseLevelVars(vars);%0A%0A                purchase.setSendTemplate(%22test%22);%0A%0A                purchase.setEmail(%22dyu@sailthru.com%22);%0A%0A%0A                JsonResponse response = client.purchase(purchase);%0A                if (response.isOK()) %7B%0A                    System.out.println(response.getResponse());%0A                %7D else %7B%0A                    System.out.println(response.getResponse().get(%22error%22).toString());%0A                %7D%0A            %7D catch (ApiException e) %7B%0A                // handle exception%0A            %7D catch (IOException e) %7B%0A                // handle exception%0A            %7D%0A    %7D%0A%7D

add purchase example