public class PaymentDataAnalyzer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static int |
CREDIT_STATE_CANCELED
CREDIT_STATE_CANCELED
|
static int |
CREDIT_STATE_CREDITED
CREDIT_STATE_CREDITED
|
static int |
CREDIT_STATE_CREDITING
CREDIT_STATE_CREDITING
|
static int |
CREDIT_STATE_FAILED
CREDIT_STATE_FAILED
|
static int |
CREDIT_STATE_NEW
CREDIT_STATE_NEW
|
static int |
CREDIT_STATE_REVERSING_CREDIT
CREDIT_STATE_REVERSING_CREDIT
|
static int |
PAYMENT_STATE_APPROVED
PAYMENT_STATE_APPROVED
|
static int |
PAYMENT_STATE_APPROVING
PAYMENT_STATE_APPROVINFG
|
static int |
PAYMENT_STATE_CANCELED
PAYMENT_STATE_CANCELED
|
static int |
PAYMENT_STATE_DEPOSITED
PAYMENT_STATE_DEPOSITED
|
static int |
PAYMENT_STATE_DEPOSITING
PAYMENT_STATE_DEPOSITING
|
static int |
PAYMENT_STATE_EXPIRED
PAYMENT_STATE_EXPIRED
|
static int |
PAYMENT_STATE_FAILED
PAYMENT_STATE_FAILED
|
static int |
PAYMENT_STATE_NEW
PAYMENT_STATE_NEW
|
static int |
PAYMENT_STATE_REVERSING_APPROVAL
PAYMENT_STATE_REVERSING_APPROVAL
|
static int |
PAYMENT_STATE_REVERSING_DEPOSIT
PAYMENT_STATE_REVERSING_DEPOSIT
|
static int |
PI_STATE_INVALID
PI_STATE_INVALID
|
static int |
PI_STATE_NEW
PI_STATE_NEW
|
Constructor and Description |
---|
PaymentDataAnalyzer(Credit localCredit)
This method creates a new analyzer from a credit object.
|
PaymentDataAnalyzer(Payment localPayment)
This method creates a new analyzer from a payment object.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getApprovedAmount()
This method returns the approved amount.
|
java.math.BigDecimal |
getApprovingAmount()
This method returns the approving amount.
|
Credit |
getCredit()
This method returns the backend credit object.
|
int |
getCreditState()
This method returns the backend credit state.
|
static java.lang.String |
getCreditStateAsString(int state)
This method returns a non-globalized human-readable representation of a credit state.
|
java.math.BigDecimal |
getDepositedAmount()
This method returns the deposited amount of the payment.
|
java.math.BigDecimal |
getDepositingAmount()
This method returns the depositing amount of the payment.
|
java.lang.String |
getLocalizedCreditState(java.util.Locale locale)
This method returns the backend credit state as a localize human-readable
string.
|
java.lang.String |
getLocalizedPaymentState(java.util.Locale locale)
This method returns the backend payment state as a localize
human-readable string.
|
Payment |
getPayment()
This method returns the backend payment object.
|
int |
getPaymentState()
This method returns the payment backend state.
|
static java.lang.String |
getPaymentStateAsString(int state)
This method returns a non-globalized human-readable representation of a payment state.
|
boolean |
hasExpired()
This method checks if payment approval is expired.
|
boolean |
isApproved()
This method checks if payment is in approved state.
|
boolean |
isFullyDeposited()
This method checks if the payment is fully deposited.
|
boolean |
isPending()
This method checks if the payment (or credit) backend object is in pending.
|
java.lang.String |
toString()
This method converts the payment (or credit) into a readable string.
|
public static final java.lang.String COPYRIGHT
public static final int PI_STATE_NEW
public static final int PAYMENT_STATE_NEW
public static final int CREDIT_STATE_NEW
public static final int PAYMENT_STATE_CANCELED
public static final int CREDIT_STATE_CANCELED
public static final int PAYMENT_STATE_EXPIRED
public static final int PAYMENT_STATE_FAILED
public static final int CREDIT_STATE_FAILED
public static final int PAYMENT_STATE_APPROVING
public static final int PAYMENT_STATE_APPROVED
public static final int PAYMENT_STATE_DEPOSITING
public static final int PAYMENT_STATE_DEPOSITED
public static final int PAYMENT_STATE_REVERSING_APPROVAL
public static final int PAYMENT_STATE_REVERSING_DEPOSIT
public static final int PI_STATE_INVALID
public static final int CREDIT_STATE_CREDITING
public static final int CREDIT_STATE_CREDITED
public static final int CREDIT_STATE_REVERSING_CREDIT
public PaymentDataAnalyzer(Payment localPayment) throws InvalidDataException
localPayment
- The payment to be setInvalidDataException
- Thrown if null is passed inpublic PaymentDataAnalyzer(Credit localCredit) throws InvalidDataException
localCredit
- The new analyzer from a credit objectInvalidDataException
- In case of invalid datapublic boolean isApproved()
public boolean hasExpired()
public java.math.BigDecimal getApprovedAmount()
public java.math.BigDecimal getApprovingAmount()
public Credit getCredit()
public int getCreditState()
public java.math.BigDecimal getDepositedAmount()
public java.math.BigDecimal getDepositingAmount()
public boolean isFullyDeposited()
public java.lang.String getLocalizedCreditState(java.util.Locale locale)
locale
- Localepublic java.lang.String getLocalizedPaymentState(java.util.Locale locale)
locale
- Localepublic Payment getPayment()
public int getPaymentState()
public boolean isPending()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String getCreditStateAsString(int state)
state
- The credit statepublic static java.lang.String getPaymentStateAsString(int state)
state
- The payment state