Getnet DocsGetnet Docs

Refund a Payment

This guide walks you through processing a refund operation to reverse a previous payment transaction. You’ll learn how to reference the original transaction and initiate the refund using the Get Mini App2App integration.

Requirements

Before following the steps, ensure you have:

  • Get Mini application installed on the Android device
  • Compatible PIN pad device paired and connected
  • Original transaction details including authorization number, order ID, and date
  • ActivityResultLauncher properly registered in your Activity or Fragment

You must have the exact details from the original transaction to process a refund. These are returned in the payment response.

Refund Process

This section guides you through creating a refund Intent with the original transaction details. The Get Mini app will validate the information and process the reversal.

Step 1: Create the Refund Intent

Create an Intent with the action es.redsys.paysys.mPOSRedsys_REFUND_REQUEST and include all required parameters from the original transaction. The refund amount can be equal to or less than the original payment amount, allowing for partial refunds.

The table below lists the mandatory fields:

ParameterTypeRequiredDescription
amountdoubleYesThe amount to be refunded.
dateStringYesDate of the original payment (YYYYMMDD format).
authorizationStringYesAuthorization number from the original payment.
orderStringYesOrder number from the original payment.

The date, authorization, and order values must match the original transaction exactly. Discrepancies will cause the refund to be declined.

The following code shows how to create and launch the refund Intent:

// Create the Intent
Intent intent = new Intent("es.redsys.paysys.mPOSRedsys_REFUND_REQUEST");

// Add required parameters from the original transaction
intent.putExtra("amount", 10.50);
intent.putExtra("date", "20240116");
intent.putExtra("authorization", "123456");
intent.putExtra("order", "ORD-12345");

// Launch the Get Mini app
refundLauncher.launch(intent);

Step 2: Handle the Refund Result

After processing the refund, the Get Mini app returns control to your application with the result. Check the result code and extract the refund details from the Intent extras, including the new transaction status and receipt information.

For complete details on handling responses, see Handle Transaction Results.

Next Steps

Now that you’ve processed a refund, you can explore other operations: