wsadiq avatar image
wsadiq asked wsadiq commented

Voiding Payment


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?
OrdersPaymentsClover Android SDK
10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered wsadiq commented
Your app cannot void or refund payments. voidPayment2() is not accessible as you can see in your exception. This has been somewhat controversial but the short story is that there is the possibility of immense havoc if the function was abused or was the subject of a bug.

You can send the merchant to the Transactions app pointing them to a given payment. e.g., have a button that's "click here to initiate refund" or something. See Intents.ACTION_START_TRANSACTION_DETAIL in the SDK for details.
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.

wsadiq avatar image wsadiq commented ·
Ok. That works.

Just to clarify a point though - this is not a giftcard transaction that I was trying to void/refund but a cash or credit card transaction to pay for purchase of a giftcard.

0 Likes 0 ·

Welcome to the
Clover Developer Community