We implemented refunds and store credit in February on our custom tender. At the time, it was marking refunded line items properly. I have orders in my history to prove it. Today, when I run successful refunds with the same code, the line items are not marked and can be refunded again. Refunds using cash tender are functioning as expected.

I have no idea which version of Clover or the Orders app I was using in February, but it seems to me that a new version has been released with a bug or new requirements that we are not satisfying. Is this the case? I have another post open regarding Clover apps crashing after an update on all of my test devices, so I have a high level of suspicion at the moment. I have ruled out changes on our end.

There is virtually no documentation or example code for refunds, so any guidance will be appreciated. We are returning a result of OK with the refund amount and intent extras that are passed to us: lineitemids, amount, orderid, merchantid, and payment_id.

asked 2016-03-24 14:01:29 -0500

bbiwer gravatar image

The Clover app crashing issue has been resolved, but my refunds are still not marking line items. I just confirmed that an older version of the app that used to mark line items as refunded is no longer doing so, so I'm confident that we haven't broken something in our app.

bbiwer gravatar image
bbiwer 2016-03-28 07:45:30 -0500

Do you have an app in production where this is failing? Or is this an app in development?

jeff gravatar image
jeff 2016-03-28 11:25:21 -0500

Both. The version in production has marked line items as refunded but is not now. My latest development version is behaving the same way.

bbiwer gravatar image
bbiwer 2016-03-28 11:31:05 -0500

What's your app?

jeff gravatar image
jeff 2016-03-28 11:39:21 -0500
bbiwer gravatar image
bbiwer 2016-03-28 12:14:45 -0500

1 answer

Sort by  
            Intent data = new Intent();
            data.putExtra(Intents.EXTRA_AMOUNT, amount);
            data.putExtra(Intents.EXTRA_ORDER_ID, orderId);
            data.putExtra(Intents.EXTRA_PAYMENT_ID, paymentId);
            data.putExtra(Intents.EXTRA_LINE_ITEM_IDS, lineItemIds);

            setResult(RESULT_OK, data);

I ran a test against the versions of our apps in prod and could not reproduce your problem. Can you grab the logcat and provide a pastebin link?

answered 2016-03-28 12:36:17 -0500

jeff gravatar image

updated 2016-03-28 12:36:46 -0500


Good call checking the logs. It didn't occur to me to check if Clover was logging something regarding my intent.

Turns out it was the type of the value I was using for lineitemids. String[] causes a cast exception, and then Clover uses the default value of null. I must have changed that along the way.

Key clover.intent.extra.LINE_ITEM_IDS expected ArrayList<String> but value was a [Ljava.lang.String;.  The default value <null> was returned.
Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.String[] cannot be cast to java.util.ArrayLiist
bbiwer gravatar image
bbiwer 2016-03-28 14:49:38 -0500

How do I transfer data when I pay to use it for Refund? I used "EXTRA_LINE_ITEM_IDS", "EXTRA_NOTE", but in Refund I could not retrieve them, I get null.

igor_yazovtsev gravatar image
igor_yazovtsev 2017-05-04 08:28:48 -0500