public class Result
extends java.lang.Object
implements java.io.Serializable
This class stores information of a transaction in a payment backend system.
Payment backend implementation providers are free to extend this default implementation, but not required.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
static int |
STATUS_FAILED
The status of the Result object for a failed transaction.
|
static int |
STATUS_PENDING
The status of the Result object for a pending transaction.
|
static int |
STATUS_SUCCESS
The status of the Result object for a successful transaction.
|
static int |
STATUS_UNKNOWN
Unknown status of the Result object for a transaction.
|
Constructor and Description |
---|
Result(Credit credit,
FinancialTransaction transaction,
int status,
java.lang.String reasonCode)
This method creates a new Results object with a Credit, a FinancialTransaction, the status and the reason code
|
Result(Credit credit,
int status,
java.lang.String reasonCode)
This method creates a new Results object with a Credit, the status and the reason code.
|
Result(Payment payment,
FinancialTransaction transaction,
int status,
java.lang.String reasonCode)
This method creates a new Results object with a Payment, a FinancialTransaction, the status and the reason code
|
Result(PaymentInstruction paymentInstruction,
int status,
java.lang.String reasonCode)
This method creates a new Results object with a PaymentInstruction, the status and the reason code.
|
Result(Payment payment,
int status,
java.lang.String reasonCode)
This method creates a new Results object with a Payment, the status and the reason code.
|
Modifier and Type | Method and Description |
---|---|
Credit |
getCredit()
This method gets the credit value object contained by this Result.
|
FinancialTransaction |
getFianancialTransaction()
This method returns the
FinancialTransaction object of this result. |
Payment |
getPayment()
This method gets the payment value object contained by this Result.
|
PaymentInstruction |
getPaymentInstruction()
This method gets the PaymentInstruction value object contained by this Result.
|
PluginException |
getPluginException()
This method gets the plugin exception.
|
java.lang.String |
getReasonCode()
This method gets the backend return code.
|
java.lang.String |
getReasonMessage()
This method gets the reason message related the reason code.
|
int |
getStatus()
This method returns the status of the Result.
|
java.lang.String |
getStatusAsString()
This method gets the non-localized human-readable status.
|
boolean |
isPaymentRequiresAttention()
This method checks if the Payment requires attention though it is successful.
|
boolean |
isRecoverable()
This method gets checks if the related PaymentInstruction is recoverable.
|
void |
setFianancialTransaction(FinancialTransaction transaction)
This method sets the
FinancialTransaction object of this result. |
void |
setPaymentRequiresAttention(boolean paymentRequiresAttention)
This method marks if the payment requires attention though it is successful.
|
void |
setPluginException(PluginException exception)
This method sets the plugin exception.
|
void |
setReasonMessage(java.lang.String reasonMessage)
This method sets the detail reason message related to the reason code.
|
void |
setRecoverable(boolean paraIsRecoverable)
This method gets marks if the related PaymentInstruction is recoverable.
|
java.lang.String |
toString()
This method gets a readable form of the Result object.
|
public static final java.lang.String COPYRIGHT
public static final int STATUS_UNKNOWN
public static final int STATUS_SUCCESS
public static final int STATUS_PENDING
public static final int STATUS_FAILED
public Result(PaymentInstruction paymentInstruction, int status, java.lang.String reasonCode)
This method creates a new Results object with a PaymentInstruction, the status and the reason code.
paymentInstruction
- The PaymentInstruction needs to be put into the result.status
- The status of the result.reasonCode
- The reasonCode received from the backend for the just processed
transaction.public Result(Payment payment, int status, java.lang.String reasonCode)
This method creates a new Results object with a Payment, the status and the reason code.
payment
- The Payment need to be put into the result.status
- The status of the result.reasonCode
- The reasonCode received from the backend for the just processed
transaction.public Result(Payment payment, FinancialTransaction transaction, int status, java.lang.String reasonCode)
payment
- the Payment need to be put into the resulttransaction
- the FinancialTransaction need to be put into the resultstatus
- the status of the resultreasonCode
- The reasonCode received from the backend for the just processed
transactionpublic Result(Credit credit, int status, java.lang.String reasonCode)
This method creates a new Results object with a Credit, the status and the reason code.
credit
- The Credit need to be put into the result.status
- The status of the result.reasonCode
- The reasonCode received from the backend for the just processed
transaction.public Result(Credit credit, FinancialTransaction transaction, int status, java.lang.String reasonCode)
This method creates a new Results object with a Credit, a FinancialTransaction, the status and the reason code
credit
- The Credit need to be put into the resulttransaction
- the FinancialTransaction need to be put into the resultstatus
- The status of the resultreasonCode
- The reasonCode received from the backend for the just processed
transactionpublic Credit getCredit()
public Payment getPayment()
public PaymentInstruction getPaymentInstruction()
public void setPaymentRequiresAttention(boolean paymentRequiresAttention)
paymentRequiresAttention
- The flag to indicate if the payment requires attention.public boolean isPaymentRequiresAttention()
public void setPluginException(PluginException exception)
exception
- The plugin exception.public PluginException getPluginException()
public java.lang.String getReasonCode()
public void setReasonMessage(java.lang.String reasonMessage)
reasonMessage
- The detail message to be set.public java.lang.String getReasonMessage()
public void setRecoverable(boolean paraIsRecoverable)
paraIsRecoverable
- The flag to indicate if the related PaymentInstruction is
recoverable.public boolean isRecoverable()
public int getStatus()
public java.lang.String getStatusAsString()
public java.lang.String toString()
This method gets a readable form of the Result object.
Warning: not localized, for debugging purposes only!toString
in class java.lang.Object
public FinancialTransaction getFianancialTransaction()
FinancialTransaction
object of this result.FinancialTransaction
object of this resultpublic void setFianancialTransaction(FinancialTransaction transaction)
FinancialTransaction
object of this result.transaction
- the FinancialTransaction
object of this result