I created 1 order with below code
`private Order generateOrder() {
Order order = new Order();
order.setId(UUID.randomUUID());
List items = new ArrayList();
// create some dummy items to display in second screen
items = new ArrayList();
OrderItem item1 = new OrderItem();
// these are the only required fields for second screen display
item1.setName(“Item1”);
item1.setUnitPrice(100l);
item1.setQuantity(1.0f);
items.add(item1);
OrderItem item2 = new OrderItem();
// these are the only required fields for second screen display
item2.setName("Item2");
item2.setUnitPrice(100l);
item2.setQuantity(1.0f);
items.add(item2);
OrderItem item3 = new OrderItem();
// these are the only required fields for second screen display
item3.setName("Item3");
item3.setUnitPrice(100l);
item3.setQuantity(2.0f);
items.add(item3);
order.setItems(items);
BigDecimal subTotal = new BigDecimal(0);
for (OrderItem item : items) {
BigDecimal price = new BigDecimal(item.getUnitPrice());
price.setScale(2, RoundingMode.HALF_UP);
price = price.multiply(new BigDecimal(item.getQuantity()));
subTotal = subTotal.add(price);
}
OrderAmounts amounts = new OrderAmounts();
amounts.setCurrency("USD");
amounts.setSubTotal(subTotal.longValue());
order.setAmounts(amounts);
return order;
}`
After payment is done and I get the callback , I am trying to create the order using below code:
public void createOrder() {
try {
String referenceId = UUID.randomUUID().toString();
iPoyntOrderService.createOrder(generateOrder(),referenceId,iPoyntOrderServiceListener);
} catch (RemoteException e) {
}
}
It is giving error “Invalid parameter” in call back.
Any one know what is the issue here?