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 SDKRefund
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

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