Hi There,
I am trying to create an order on the Poynt client by binding to the IPoyntOrderService.
when I try to send the test order using :
orderService.createOrder(createTestOrder(),"ybeiuhf737hf7h7hekfuihih6g86ggy", orderListener);
In my IPoyntOrderServiceListener it states as my poyntError.getReason() that ‘Parameter provided is invalid’.
My order is taken from the discount sample app:
public Order createTestOrder(){
Order order = new Order();
order.setId(UUID.randomUUID());
List<OrderItem> items = new ArrayList<OrderItem>();
// create some dummy items to display in second screen
items = new ArrayList<OrderItem>();
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);
order.setContext(new ClientContext());
return order;
}
Is there something I am missing…?
Thanks in advance.