Advertisement
Guest User

Untitled

a guest
Dec 18th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. W/System.err: java.lang.SecurityException: Access denied to package [package name here]
  2. W/System.err: at android.os.Parcel.readException(Parcel.java:1465)
  3. W/System.err: at android.os.Parcel.readException(Parcel.java:1419)
  4. W/System.err: at com.clover.sdk.v3.inventory.IInventoryService$Stub$Proxy.deleteModifier(IInventoryService.java:2279)
  5. W/System.err: at com.clover.sdk.v3.inventory.InventoryConnector$45.run(InventoryConnector.java:410)
  6. W/System.err: at com.clover.sdk.v3.inventory.InventoryConnector$45.run(InventoryConnector.java:408)
  7. W/System.err: at com.clover.sdk.v1.ServiceConnector.execute(ServiceConnector.java:196)
  8. W/System.err: at com.clover.sdk.v3.inventory.InventoryConnector.deleteModifier(InventoryConnector.java:408)
  9.  
  10. Java API attempt:
  11. Modifier modifier = new Modifier();
  12. List<ModifierGroup> modifierGroupsForItem = inventoryConnector.getModifierGroupsForItem(itemId);
  13. final ModifierGroup modifierGroup = modifierGroupsForItem.get(0);
  14. Reference modGroupRef = new Reference();
  15. modGroupRef.setId(modifierGroup.getId());
  16. modifier.setModifierGroup(modGroupRef);
  17. modifier.setPrice((long)0);
  18. Modifier modifier1 = inventoryConnector.createModifier(modifierGroup.getId(), modifier);
  19. String modifierId = modifier1.getId();
  20. LineItem lineItem = new LineItem();
  21. lineItem = orderConnector.addVariablePriceLineItem(orderId, itemId, payAmount / 10, null, null);
  22. orderConnector.addLineItemModification(orderId, lineItem.getId(), modifier1);
  23. inventoryConnector.deleteModifier(modifierId);
  24.  
  25. REST API attempt:
  26. String URL= baseUrl + "/v3/merchants/" + merchId + "/modifier_groups/" + modifierGroup.getId() + "/modifiers/" + modifierId;
  27. DefaultHttpClient httpclient = new DefaultHttpClient();
  28. HttpDelete httpDeleteRequest = new HttpDelete(URL);
  29. httpDeleteRequest.setHeader("Accept", "application/json");
  30. httpDeleteRequest.setHeader("Content-type", "application/json");
  31. httpDeleteRequest.setHeader("Authorization", "Bearer " + authId);
  32. HttpResponse response = httpclient.execute(httpDeleteRequest);
  33. HttpEntity entity = response.getEntity();
  34. InputStream instream = entity.getContent();
  35. String resultString= convertStreamToString(instream);
  36. instream.close();
  37. JSONObject jsonObjRecv = new JSONObject(resultString);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement