Hi, I implemented this. I will try to help. All this code is in the poynt examples, you can google it, but i provide this for you, in order to you can search it.
- First you need to capture the transaction as you said.
if (Intents.ACTION_NEW_ORDER_CREATED.equals(action)) {
Log.e(“Log”, “Received broadcast: NEW_ORDER_CREATED”);
orderid = String.valueOf(intent.getExtras().get(Intents.INTENT_EXTRAS_ORDER_ID));
getOrder(orderid);
}
- You need to bind mOrderService, then the implementation of getOrder:
private IPoyntOrderService mOrderService;
public void getOrder(String orderId) {
if (mOrderService != null) {
try {
mOrderService.getOrder(orderId, UUID.randomUUID().toString(), mOrderServiceListener);
Log.e(“LogApp”, "orderID: " + orderId);
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
- Then you can access to the order object in the order service listener:
private IPoyntOrderServiceListener mOrderServiceListener = new IPoyntOrderServiceListener.Stub() {
public void orderResponse(Order order, String requestId, PoyntError poyntError) throws RemoteException {
if(order != null) {
List list = order.getItems();
if(list != null) {
if(list.size() > 0) {
for(OrderItem item : list) {
Log.e(“Log”, item.getName() + “(” + item.getQuantity() + " x " + item.getUnitPrice() + “)”);
}
}
}
So, this you can access the order and order items. Hope this helps!!