question

gaurav avatar image
gaurav Suspended asked sam Deactivated commented

process refund using custom tender the way clover gift card app processes

Hi There

I am looking for a way to refund amount to custom tender using clover's orders app like the way clover's gift card app does i.e upon making a payment of e.g. $5 using cash tender clover's gift card app provides option to refund this payment of $5 by cash or gift card. I am figuring out the possibility of doing this as because clover allows payment through custom tender then refund can also be made using custom tender.
Any information at earnest on this will be appreciable.

Thanks in advance
Clover Android SDKRefundCustom Tenders
10 |2000

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

sam avatar image
sam Deactivated answered sam Deactivated commented
As Chanel said, the option to refund using the original payment will exist by default. Details on how to handle the refund is outlined in this answer by Mark:
https://community.clover.com/questions/2159/custom...
You will need to receive and handle refund intent in your app.
2 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.

gaurav avatar image gaurav commented ·

Also what about cash payment, can we refund cash payment to our custom tender as well

0 Likes 0 ·
sam avatar image sam gaurav commented ·

Cash is simply another tender type, so no you won't be able to invoke another tender type to refund other than the original payment tender type. A workaround would be to refund using our tender type but within your implementation, note that cash was returned rather than credit being remitted. The issue here would be that in Reporting and Order app, the refund will still indicate your tender as the refund, regardless of whether cash or credit was given.

0 Likes 0 ·
chanel avatar image
chanel Deactivated answered
If you've created the custom tender correctly, what you're describing should already be possible with no extra effort. Going through the refund process through the app will bring up the option to refund the payment through your custom tender or through ValueLink (the gift card option).

If this is different from what you require please let me know.
10 |2000

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

Bryanne Vega avatar image
Bryanne Vega answered
As redacted by Custom tenders

Handling refunds

You will also need to account for all refunds on partial payments made by custom tenders. Note that the merchant can issue a LineItem-level refund using Custom tenders.

First, ensure your custom tender’s Refund Activity can handle refund intents:

<intent-filter>

<action android:name="clover.intent.action.REFUND" />

<category android:name="android.intent.category.DEFAULT" />From your Refund Activity, capture some Extras from the Refund Intent:final long amount = getIntent().getLongExtra(Intents.EXTRA_AMOUNT, 0);

final String orderId = getIntent().getStringExtra(Intents.EXTRA_ORDER_ID);

final String paymentId = getIntent().getStringExtra(Intents.EXTRA_PAYMENT_ID);

final ArrayList lineItemIds = getIntent().getStringArrayListExtra(Intents.EXTRA_LINE_ITEM_IDS);If the Refund POSTs successfully on your end, tell Clover everything went as planned:

Intent data = new Intent();

data.putExtra(Intents.EXTRA_ORDER_ID, orderId);

data.putExtra(Intents.EXTRA_PAYMENT_ID, paymentId);

data.putExtra(Intents.EXTRA_LINE_ITEM_IDS, lineItemIds);

data.putExtra(Intents.EXTRA_AMOUNT, amount);

data.putExtra(Intents.EXTRA_CLIENT_ID, "Your_external_payment_ID");

setResult(RESULT_OK, data);

finish();Else:

setResult(RESULT_CANCELED, data);

finish();

10 |2000

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

Welcome to the
Clover Developer Community