atg.commerce.csr.returns
Class RefundMethod

java.lang.Object
  extended by atg.commerce.csr.returns.RefundMethod
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CreditCardRefundMethod

public class RefundMethod
extends java.lang.Object
implements java.io.Serializable

This class represents information for a refund

This is class is just a base class. Out of box, the returns feature supports only CreditCardRefundMethod and StoreCreditRefundMethod. If you want to support additional payment type as refund option, you need to extend this class.

The #saveRefundMethod(RepositoryItem, Order) is used to load refund method properties from repository item. if you add additional properties to refund method and it needs to be loaded to the refund method object, you need to extend this method.

The saveRefundMethod(MutableRepositoryItem) is used to save refund method properties to repository item. if you add additional properties to refund method and it needs to be saved in the repository, you need to extend this method.

See Also:
loadRefundMethod(RepositoryItem, Order), saveRefundMethod(MutableRepositoryItem), Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String CREDIT_CARD_TYPE
           
protected  double mMaximumRefundAmount
           
static int NO_LIMIT
           
static java.lang.String RETURN_MANAGER_PATH
           
static java.lang.String STORE_CREDIT_TYPE
           
static java.lang.String UNKNOWN_TYPE
           
 
Constructor Summary
RefundMethod()
          Deprecated.  
RefundMethod(java.lang.String pRefundType)
          Construct this object, setting the refund type
RefundMethod(java.lang.String pRefundType, double pAmount)
          Construct this object, setting the refund type and amount
 
Method Summary
 double getAmount()
          Returns the amount of the refund
static RefundMethod getInstance()
          Deprecated.  
 double getMaximumRefundAmount()
          This method is just an empty method and returns -1.
 java.lang.String getRefundType()
          Returns refund type for this record
 ReturnManager getReturnManager()
          Deprecated.  
 void loadRefundMethod(RepositoryItem pSource, Order pOrder)
          This method is used to copy the information from the source refund method repository item to refund method instance.
 void saveRefundMethod(MutableRepositoryItem pDestination)
          This method is used to copy the information from refund method instance to repository item.
 void setAmount(double pAmount)
          The amount of the refund
 void setMaximumRefundAmount(double pMaximumRefundAmount)
           
protected  void setRefundType(java.lang.String pRefundType)
          Sets the refund type for this record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

NO_LIMIT

public static final int NO_LIMIT
See Also:
Constant Field Values

CREDIT_CARD_TYPE

public static final java.lang.String CREDIT_CARD_TYPE
See Also:
Constant Field Values

STORE_CREDIT_TYPE

public static final java.lang.String STORE_CREDIT_TYPE
See Also:
Constant Field Values

UNKNOWN_TYPE

public static final java.lang.String UNKNOWN_TYPE
See Also:
Constant Field Values

RETURN_MANAGER_PATH

public static final java.lang.String RETURN_MANAGER_PATH
See Also:
Constant Field Values

mMaximumRefundAmount

protected double mMaximumRefundAmount
Constructor Detail

RefundMethod

public RefundMethod()
Deprecated. 

Construct this object, setting the refund type There is a sub-class for the Store credits.


RefundMethod

public RefundMethod(java.lang.String pRefundType)
Construct this object, setting the refund type


RefundMethod

public RefundMethod(java.lang.String pRefundType,
                    double pAmount)
Construct this object, setting the refund type and amount

Method Detail

setAmount

public void setAmount(double pAmount)
The amount of the refund

Parameters:
pAmount - the amount of the refund

getAmount

public double getAmount()
Returns the amount of the refund


setRefundType

protected void setRefundType(java.lang.String pRefundType)
Sets the refund type for this record

Parameters:
pRefundType - the refund type for this record

getRefundType

public java.lang.String getRefundType()
Returns refund type for this record


getReturnManager

public ReturnManager getReturnManager()
Deprecated. 

This method gets the http request and resolves the ReturnManager.
This method only works with the http request. If the http request is null,
then this method returns null.

Returns:
ReturnManager

getInstance

public static RefundMethod getInstance()
Deprecated. 

This method calls RefundMethod() to create
instance of RefundMethod.

Returns:
RefundMethod

getMaximumRefundAmount

public double getMaximumRefundAmount()
This method is just an empty method and returns -1.
You need to over ride this method in the sub class.
This class is already made available for the public and
we can't make this class as an abstract class. Also we do not want to
create an new interface and maintain the interface.

This method computes the maximum allowed refund amount.

Returns:
The maximum refund amount for the refund method. The amount returned in this method is -1

setMaximumRefundAmount

public void setMaximumRefundAmount(double pMaximumRefundAmount)

loadRefundMethod

public void loadRefundMethod(RepositoryItem pSource,
                             Order pOrder)
                      throws ReturnException
This method is used to copy the information from the source refund method repository item to refund method instance.

This method sets the amount property.

Parameters:
pOrder -
pSource - The information to be copied from.
Throws:
ReturnException

saveRefundMethod

public void saveRefundMethod(MutableRepositoryItem pDestination)
                      throws ReturnException
This method is used to copy the information from refund method instance to repository item.

This method sets the ReturnTools.getAmountPropertyName() in the repository item.

Parameters:
pDestination - The information to be copied
Throws:
ReturnException