We have an app which is registered to MODIFY_ORDER and adds discount to an order. I want if our server is down to void the Clover transaction after it happened. I have set a receiver for:
<action android:name="com.clover.intent.action.ORDER_CREATED" />
<action android:name="com.clover.intent.action.PAYMENT_PROCESSED" />
How can I void the transaction and let merchant have the order paid without discount?
More details:
We give loyalty points to customers when the merchant uses our app. He can also spend the points the customer earns.
When he spends the points we make a request to our server and save the order id and the points count and also add discount to the order based on the points.
After the order is paid in the receiver we actually make a request to our server and spend the customer points on our side. But what happens if we gave a discount to the customer and after the order is paid we could not contact our server to spend customer points? Can I just void the transaction and display a message?
Solution 1: Other way is to refund the payment. But using the Void Transaction option is better.
P.S.1 I get the this error when I use void payment 2. What is the required permission? I have them all checked... :
orderConnector.voidPayment2(orderId, order.getPayments().get(0).getId(), null, VoidReason.USER_CANCEL, packageName);
W/System.err: com.clover.sdk.v1.ForbiddenException: App doesn't have required permission