I have an application that add a discount using the OrderConnector, Here is a portion of the code:
AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { OrderConnector orderConnector = new OrderConnector(activity, CloverAccount.getAccount(activity), null); try { String orderId = activity.getIntent().getStringExtra(Intents.EXTRA_ORDER_ID); orderConnector.connect(); Discount discount = new Discount(); discount.setAmount(-200L); discount.setName(description); orderConnector.addDiscount(orderId, discount); } catch (Exception _e) { message.append("Kiosk clover: " + "rootCause: '" + _e.toString() + "'"); _e.printStackTrace(); } finally { orderConnector.disconnect(); } return null; } }.execute();
This code works fine in my sandbox account, but the approval team is getting the follow error:
'java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.clover.intent.action.ORDER_SERVICE_V3 (has extras) }'
I believe that the error is in the line:
orderConnector.addDiscount(orderId, discount);
I'm getting this error in the catch and then I send it to a endpoint were I log the message.
Anyone has seen that error and why I'm not getting this in my sandbox environment? I'm using clover sdk 117