We have a native application on Clover that uses Clover SDK. We are adding some additional functionality to purchase giftcards. We do the following steps:
1) First create the order for the giftcard.
2) Collect required payment using ACTION_CLOVER_PAY.
3. Once the payment has been accepted we purchase the giftcard in our backend server.
However, if something goes wrong in this last final step, we need to void the payment.
Looking through the related answers on this forum has confused me. Some answers say that voiding or refunding payments is not allowed and some suggest to use voidPayment2 method on order connector.
I have tried to use OrderConnector.voidPayment2 as well as OrderConnector.refund and both of them throw the same exception:
com.clover.sdk.v1.ForbiddenException: status code: 403 App doesn't have required permission
What is the recommended best practice here?