We have faced this scenario in our development environment and QA environment as well. We tried to reproduce this scenario using the same steps, but could not replicate the same.
On Clover forum, we searched for the similar issue, and found the exact same issue from another development team. They are stating the same problem. This might be any possible scenario which is being not taken care at Clover Order Connector class. The link for that ticket is given below-
https://community.clover.com/questions/10456/disco...
As far as the implementation goes, we are using the AsynTask to add the order discount using below code-
public class PS_AddDiscountAsyncTask extends AsyncTask<Void, Void, Order> { private PS_IAddDiscountCallback mAddDiscountCallback; private OrderV31Connector mOrderConnector; private String mOrderId; private boolean isDiscountAdded = false; private String mCouponDiscountId = null; public PS_AddDiscountAsyncTask(OrderV31Connector orderConnector, String orderId, PS_ IAddDiscountCallback addDiscountCallback) { mOrderConnector = orderConnector; mOrderId = orderId; mAddDiscountCallback = addDiscountCallback; } @Overrideprotected Order doInBackground(Void... voids) { if (mOrderId != null) { try { Order order = mOrderConnector.getOrder(mOrderId); Discount dollarDiscount = new Discount(); dollarDiscount.setName("XYZ"); Long totalDiscount; dollarDiscount.setPercentage(10L); mCouponDiscountId = mOrderConnector.addDiscount2(order.g etId(), dollarDiscount).getId(); if (mCouponDiscountId != null && !mCouponDiscountId.trim ().isEmpty()) { isDiscountAdded = true; } return order; } catch (Exception e) { e.printStackTrace(); } } return null; } @Overrideprotected void onPostExecute(Order order) { super.onPostExecute(order); mAddDiscountCallback.onDiscountAdded(order, isDiscountAdded, mCouponDiscountId); } }