Perform Refunds

Refunds allow your merchants to transfer the amount of a previous charge transaction back to the shopper.

Linked Refunds

Refunds are implemented as Linked Refunds, meaning you need to provide the transactionIdentifier of the previous charge transaction in order to perform the refund. For Linked Refunds it is not required for the shopper to present his card again and the refund will be paid out on the exact same card as used for the charge.

To perform a refund, you need to create new MPTransactionParameters with the transactionIdentifier of the previous charge transaction.

MPTransactionParameters *parameters =
[MPTransactionParameters refundForTransactionIdentifier:@"<transactionIdentifier>"
											  optionals:
 ^(id<MPTransactionParametersRefundOptionals>  _Nonnull optionals)
 {
	 optionals.subject = @"Refund for Bouquet of Flowers";
	 optionals.customIdentifier = @"yourReferenceForTheTransaction";

 }];

Since this is a modification to an existing transaction, you now need to pass the parameters to [MPTransactionProvider amendTransactionWithParameters:].

As a result, you will receive one of the following:

  • The original transaction that now contains information about the refund in the transaction.refundDetails
  • An error indicating why refunding the charge failed

To check if a transaction can be refunded in general, have a look at transaction.refundDetails.status.

Refunds allow your merchants to transfer the amount of a previous charge transaction back to the shopper.

Linked Refunds

Refunds are implemented as Linked Refunds, meaning you need to provide the transactionIdentifier of the previous charge transaction in order to perform the refund. For Linked Refunds it is not required for the shopper to present his card again and the refund will be paid out on the exact same card as used for the charge.

To perform a refund, you need to create new TransactionParameters with the transactionIdentifier of the previous charge transaction.

TransactionParameters parameters = new TransactionParameters.Builder()
        .refund("<transactionIdentifer>")
        .build();

Since this is a modification to an existing transaction, you are now passing the parameters to TransactionProvider.amendTransaction().

As a result, you will receive one of the following:

  • The original transaction that now contains information about the refund in the transaction.refundDetails
  • An error indicating why refunding the charge failed

To check if a transaction can be refunded in general, have a look at transaction.refundDetails.status.