Class GatewayResponse

java.lang.Object
org.apache.ofbiz.accounting.thirdparty.eway.GatewayResponse

public class GatewayResponse extends Object
A class representing the payment gateway's response to a request. It holds fields of the response which are filled in when the response arrives and available through getter methods. This response class supports all 3 payment methods. Based on public domain sample code provided by eWay.com.au
  • Constructor Details

    • GatewayResponse

      public GatewayResponse(InputStream xmlstream, GatewayRequest req) throws Exception
      Creates the GatewayResponse object by parsing an xml from a stream. Fills in the fields of the object that are available through getters after this method returns.
      Parameters:
      xmlstream - the stream to parse the response from
      Throws:
      Exception - if the xml contains a root element with a bad name or an unknown element, or if the xml is badly formatted
  • Method Details

    • getTrxnNumber

      public String getTrxnNumber()
      Gets trxn number.
      Returns:
      the trxn number
    • getTrxnReference

      public String getTrxnReference()
      Gets trxn reference.
      Returns:
      the trxn reference
    • getTrxnOption1

      public String getTrxnOption1()
      Gets trxn option 1.
      Returns:
      the trxn option 1
    • getTrxnOption2

      public String getTrxnOption2()
      Gets trxn option 2.
      Returns:
      the trxn option 2
    • getTrxnOption3

      public String getTrxnOption3()
      Gets trxn option 3.
      Returns:
      the trxn option 3
    • getAuthCode

      public String getAuthCode()
      Gets auth code.
      Returns:
      the auth code
    • getTrxnError

      public String getTrxnError()
      Gets trxn error.
      Returns:
      the trxn error
    • getReturnAmount

      public int getReturnAmount()
      Gets return amount.
      Returns:
      the return amount
    • getTransactionAmount

      public BigDecimal getTransactionAmount()
      Gets transaction amount.
      Returns:
      the transaction amount
    • getTrxnStatus

      public boolean getTrxnStatus()
      Gets trxn status.
      Returns:
      the trxn status
    • getBeagleScore

      public double getBeagleScore()
      Gets the beagle score. Defaults to -1 in case of non-Beagle payment methods or if the response does not contain this field.
      Returns:
      The beagle score or -1 if it was not defined in the response
    • toString

      public String toString()
      Overrides:
      toString in class Object