refund method

Future<TransactionResponse> refund({
  1. required num amount,
  2. String? originalTransactionId,
  3. String? reference,
  4. String? transactionId,
  5. String? currency,
  6. String? language,
})

Triggers a refund (credit). Pass originalTransactionId for a referenced refund. Must be activated by hobex; the terminal asks for a password.

Implementation

Future<TransactionResponse> refund({
  required num amount,
  String? originalTransactionId,
  String? reference,
  String? transactionId,
  String? currency,
  String? language,
}) {
  final body = _txBody(
    amount: amount,
    reference: reference,
    transactionId: transactionId ?? _newTransactionId(),
    currency: currency,
    language: language,
    originalTransactionId: originalTransactionId,
  );
  return _sendTransaction('POST', 'api/transaction/refund', body);
}