I'm putting together an application which is to pay invoices by looking up a rest api and adding line items to an order. The lookup searches a reference number and returns an amount and some related data to the app. This all works well when using my app and passing to the tender process using startActivityForResult(intent, 1) with an OnOrderUpdateListener2 to run an update via onPaymentProcessed to the remote API.
However, the invoices are to be within a store front/office which may sell further items on the same order. We have therefore transfer our app to the register which shows my list items and all other inventory items as required. All good to this point! Our problem is that the register then moves to tender and once successful "done" is pressed on the tender screen. We return back to the register and we're ready to create a new order. At this point I'm wanting to send the intent back to our app and the update listener is no longer run. I would imagine this is due to the intent moving 3 steps rather than 2 however this is an assumption.
To note, we are unable to use web hooks as the underlying installation will be on a LAN with no ability to host a web server (due to policy).
My question therefore is
- should the orderConnector.addOnOrderChangedListener(..) be retained when moving to the register intent and subsequently to the tender intent. i.e. should I expect that the listener is called when the tender is complete
- is there an alternative method using the register, to add add an item to an order but intervene with a dialog to lookup the invoice before adding it to the order.
Many thanks
Gary