0

Hello! How receive "refund request" for my custom payment (gift) application? Where can I see an example?

asked 2017-05-02 06:57:48 -0500

igor_yazovtsev gravatar image

1 answer

Sort by  
1

Make sure you're handling refund intent:

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

Your refund intent activity will be given:

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<String> 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();

Please refer to this thread: https://devask.clover.com/question/62...

answered 2017-05-02 13:17:03 -0500

Sam gravatar image

updated 2017-05-02 18:19:09 -0500