Class TerminalRefundRequest

java.lang.Object
com.codename1.payment.terminal.TerminalRefundRequest

public final class TerminalRefundRequest extends Object

What a PaymentTerminal.refund(TerminalRefundRequest) should return.

A linked refund names the payment it returns money for, and goes back to that card without the customer present where the provider allows it. An unlinked refund names none: the customer presents a card on the terminal, and the money goes to that card. Terminals that support only one kind say so through TerminalOperation.REFUND and TerminalOperation.UNLINKED_REFUND.

TerminalRefundRequest linked = new TerminalRefundRequest(500, "USD")
        .setOriginalTransactionId("pi_3Nk...");
  • Constructor Details

    • TerminalRefundRequest

      public TerminalRefundRequest(long amount, String currency)
      Parameters
      • amount: the amount to return, in the currency's minor unit; must be positive. A partial refund is an amount below the original's.

      • currency: the ISO 4217 code, such as USD

  • Method Details

    • getAmount

      public long getAmount()
      The amount to return, in the currency's minor unit.
    • getCurrency

      public String getCurrency()
      The ISO 4217 currency code.
    • getOriginalTransactionId

      public String getOriginalTransactionId()
      The transaction ID of the payment being refunded, as its TerminalResult.getTransactionId() reported it; null for an unlinked refund.
    • setOriginalTransactionId

      public TerminalRefundRequest setOriginalTransactionId(String originalTransactionId)

      Sets getOriginalTransactionId().

      Returns

      this request

    • isUnlinked

      public boolean isUnlinked()
      True when the refund names no earlier payment.
    • getReference

      public String getReference()
      The app's own identifier for the refund; may be null.
    • setReference

      public TerminalRefundRequest setReference(String reference)

      Sets getReference().

      Returns

      this request