question

Dan avatar image
Dan asked wsadiq commented

Directing where to apply a refund

How do we list apps in the refund screen like this? image description

I have implemented the intent on an activity for our app like so:

     <activity
        android:name=".activities.RefundHandlerActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="clover.intent.action.MANUAL_REFUND" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

But refunds just go straight through without offering the choice to select our app.

RefundIntents
10 |2000

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

Mike M avatar image
Mike M answered Dan commented

You actually should use ACTION_REFUND. It apparently was marked deprecated (incorrectly so), as it still is how the Register app constructs the refund options displayed in your screenshot. https://github.com/clover/clover-andr...

The values passed with the Intent are as follows:

Intents.EXTRA_MERCHANT_ID
Intents.EXTRA_CURRENCY
Intents.EXTRA_ORDER_ID
Intents.EXTRA_PAYMENT_ID
Intents.EXTRA_CLIENT_ID
Intents.EXTRA_LINE_ITEM_IDS
Intents.EXTRA_AMOUNT
5 comments
10 |2000

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

Dan avatar image Dan commented ·

Hi Mike, to be clear this is the Orders app not the Register. I actually tried that and need to do a little more testing but something is not quite right. On my emulator, the default behavior (no intent specified), seems to list tender types that were used for the order as options, and choosing one refunds correctly. If I do specify the intent, all that happens upon choosing my tender type as the refund option is the dialog disappears and does nothing else from what I can tell. I need to do more testing because our sandbox mini was behaving differently again (just immediately refunding...

0 Likes 0 ·
Dan avatar image Dan commented ·

...without any option regardless of tenders used in the order). So currently it looks like the emulator is picking up my intent but not directing it correctly, and I am only presented with an option to direct refunds based on the initial tender type(s) used to pay for the order. Have you any other suggestions as to what might be going on? I will get back to testing on our Mini when I have it to nail down the behavior on that. Emulator apk version is 1794

0 Likes 0 ·
Dan avatar image Dan commented ·

Ugh...I missed out the <category android:name="android.intent.category.DEFAULT" /> line this time around so it looks like things are working. Please ignore those comments above :D (no delete option?!)

0 Likes 0 ·
Dan avatar image Dan commented ·

After more testing (with the intent most definitely functional now), it appears what I said about the refund options being tied to the tenders used for the order is still correct. Could you let me know if this is the case Mike? So for example if an order was paid for with just cash, my custom refund option does not appear. Not sure if this is by design or I am doing something else wrong.

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Great to hear that it is functional for you now!

In regards to the cash <-> tender-refund behavior, that is entirely by design.

0 Likes 0 ·
anthonypinto avatar image
anthonypinto answered wsadiq commented

Mike's answer will allow your tender to properly refund in the case that the original payment was with your tender. In order for your tender to be a refund option for payments made with other tenders, your refund activity (or another more specialized activity) should also us the 'Store Credit' filter:

<intent-filter>
    <action android:name="clover.intent.action.STORE_CREDIT" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Note that this is only ever an option when an employee is refunding an order or item from the order details. It doesn't come up as an option if you are refunding the payment from the payment 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 ·

I want to process the refund through our back-end system. Using the above method, I am able to direct the refund activity to my refund handler. My refund is processed by making a call to our back-end system that issues the digital gift card to the customer's wallet. However, I cannot figure what to return to actually mar that refund as successful. After successfully finishing by back-end refund activity, what do I need to do to makr that refund as being successfully completed? Currently, it stays un-refunded.

It would be great if you have some sample code.

0 Likes 0 ·

Welcome to the
Clover Developer Community