question

vhsg avatar image
vhsg asked zgreathouse Deactivated commented

Discounts not Applied on Order

A merchant is attempting to apply order level discounts using our application. - The Merchant is reporting that the discounts are not being applied after attempting to apply them through your app. This problem seems especially persistent for one merchant but other merchants have reported it as occurring infrequently.

Here is a code snippet:

private void addDiscountPercentageForOrder(OrderV31Connector orderConnector, Order order, Double percentage) throws RemoteException, ServiceException, BindingException, ClientException { 
Discount discount = new Discount(); discount.setName(PROMOTION_LABEL); discount.setPercentage(percentage.longValue()); orderConnector.addDiscount(order.getId(), discount); } private void addDiscountAmountForOrder(OrderV31Connector orderConnector, Order order, Double amount) throws RemoteException, ServiceException, BindingException, ClientException { Discount discount = new Discount(); discount.setName(PROMOTION_LABEL); discount.setAmount(-(long) (amount * 100)); orderConnector.addDiscount(order.getId(), discount);
} //The OrderConnector is taken via the following code on the main thread: public static OrderV31Connector connectToOrderConnector(Context context) { Account mAccount = CloverAccount.getAccount(context); if (mAccount == null) { return null; } OrderV31Connector orderV31Connector = new OrderV31Connector(context, mAccount, null); orderV31Connector.connect(); return orderV31Connector;
}


Please advise.
Discounts
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zgreathouse avatar image zgreathouse commented ·

We have been unable to reproduce this issue. The Order never deletes itself and the discount is always successfully applied to the order.

I would recommend doing more testing of your app. If you are able to reproduce it, please provide us with reproduction steps and we will be able to work with you from there.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community