Performing Refunds
The Refunds feature enables your merchants to transfer the amount of a previous charge transaction back to the shopper.
Linked Refunds
Refunds are implemented as Linked Refunds, which requires you to provide the
transactionIdentifier
of the previous charge transaction in order to perform the refund. For Linked Refunds, the shopper is not required to present their card again and the refund is paid to the same card used for the charge.
To perform a refund, you must create new
MPTransactionParameters
with the
transactionIdentifier
of the previous charge transaction.
For partial refunds, you must specify the amount that will be refunded.
MPTransactionParameters *parameters = [MPTransactionParameters refundForTransactionIdentifier:@"<transactionIdentifier>" optionals: ^(id<MPTransactionParametersRefundOptionals> _Nonnull optionals) { optionals.subject = @"Refund for Bouquet of Flowers"; optionals.customIdentifier = @"yourReferenceForTheTransaction"; // For partial refunds, specify the amount to be refunded // and the currency from the original transaction // [optionals setAmount:[NSDecimalNumber decimalNumberWithString:@"1.00"] currency:MPCurrencyEUR]; }];
This is a modification to an existing transaction so you now must pass the parameters to the
[MPTransactionProvideramendTransactionWithParameters:]
.
As a result, you will receive either:
  • The original transaction that now contains information about the refund in the
    transaction.refundDetails
    .
  • An error message indicating why refunding the charge failed.
To check if a transaction can be refunded, see
transaction.refundDetails.status
.
Performing Refunds
The Refunds feature enables your merchants to transfer the amount of a previous charge transaction back to the shopper.
Linked Refunds
Refunds are implemented as Linked Refunds, which requires you to provide the
transactionIdentifier
of the previous charge transaction in order to perform the refund. For Linked Refunds, the shopper is not required to present their card again and the refund is paid to the same card used for the charge.
To perform a refund, you must create new
MPTransactionParameters
with the
transactionIdentifier
of the previous charge transaction.
For partial refunds, you must specify the amount that will be refunded.
TransactionParameters parameters = new TransactionParameters.Builder() .refund("<transactionIdentifer>") // For partial refunds, specify the amount to be refunded // and the currency from the original transaction //.amountAndCurrency(new BigDecimal("1.00"), io.mpos.transactions.Currency.EUR) .build();
This is a modification to an existing transaction so you are now passing the parameters to the
TransactionProvider.amendTransaction()
.
As a result, you will receive either:
  • The original transaction that now contains information about the refund in the
    transaction.refundDetails
    .
  • An error message indicating why refunding the charge failed.
To check if a transaction can be refunded, see
transaction.refundDetails.status
.