Enum DefaultTransactionTypes
- java.lang.Object
-
- java.lang.Enum<DefaultTransactionTypes>
-
- com.broadleafcommerce.cartoperation.domain.enums.DefaultTransactionTypes
-
- All Implemented Interfaces:
TransactionType
,Serializable
,Comparable<DefaultTransactionTypes>
public enum DefaultTransactionTypes extends Enum<DefaultTransactionTypes> implements TransactionType
The TransactionType is used to represent the types of operations/transactions that could occur against a single payment.- Author:
- Elbert Bautista (elbertbautista), Chris Kittrell (ckittrell)
- See Also:
AUTHORIZE
,REVERSE_AUTH
,AUTHORIZE_AND_CAPTURE
,CAPTURE
,REFUND
,The following is a depiction of the possible state flows for an Order Payment and the hierarchical relationship of all its transactions:
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTHORIZE
Funds have been authorized for capture.AUTHORIZE_AND_CAPTURE
Funds have been captured/authorized all at once.CAPTURE
Funds have been charged/submitted/debited from the customer and payment is complete.DETACHED_CREDIT
Some payment processors allow you to issue credit to a customer that is not tied to an initialAUTHORIZE
orAUTHORIZE_AND_CAPTURE
transaction.REFUND
Funds have been refunded/credited.REVERSE_AUTH
The reverse of anAUTHORIZE
transaction.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAuthorize(String transactionType)
static boolean
isAuthorizeAndCapture(String transactionType)
static boolean
isCapture(String transactionType)
static boolean
isDetachedCredit(String transactionType)
static boolean
isRefund(String transactionType)
static boolean
isReverseAuth(String transactionType)
static DefaultTransactionTypes
valueOf(String name)
Returns the enum constant of this type with the specified name.static DefaultTransactionTypes[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface com.broadleafcommerce.cartoperation.domain.enums.TransactionType
name
-
-
-
-
Enum Constant Detail
-
AUTHORIZE
public static final DefaultTransactionTypes AUTHORIZE
Funds have been authorized for capture. This might appear as a 'pending' transaction on a customer's credit card statement
-
REVERSE_AUTH
public static final DefaultTransactionTypes REVERSE_AUTH
The reverse of anAUTHORIZE
transaction. This can only occur after funds have beenauthorized
and before funds have beencaptured
.
-
CAPTURE
public static final DefaultTransactionTypes CAPTURE
Funds have been charged/submitted/debited from the customer and payment is complete. Can ONLY occur after an amount has been authorized (AUTHORIZE
).
-
AUTHORIZE_AND_CAPTURE
public static final DefaultTransactionTypes AUTHORIZE_AND_CAPTURE
Funds have been captured/authorized all at once. While this might be the simplest to implement from an order management perspective, the recommended approach is to
AUTHORIZE
and thenCAPTURE
in separate transactions and at separate times. For instance, anAUTHORIZE
would happen once the order has completed checkout but then aCAPTURE
would happen once the order has shipped.NOTE: Many gateways like to refer to this as also a SALE transaction.
This should be treated the exact same as a
CAPTURE
.
-
REFUND
public static final DefaultTransactionTypes REFUND
Funds have been refunded/credited. This can ONLY occur after funds have been
captured
. This should only be used when money goes back to a customer. This assumes that there will be a parentAUTHORIZE_AND_CAPTURE
orCAPTURE
transaction that this can be tied back to.NOTE: This can also be referred to as a "follow-on credit"
-
DETACHED_CREDIT
public static final DefaultTransactionTypes DETACHED_CREDIT
Some payment processors allow you to issue credit to a customer that is not tied to an initial
AUTHORIZE
orAUTHORIZE_AND_CAPTURE
transaction. Most payment gateways disable this feature by default because it is against card association (e.g. Visa, MasterCard) rules. However, there may be legitimate instances where you had a sale transaction but are not able to issue a refund (e.g. closed account of original payment etc...) Please contact your payment gateway provider to see how to enable this feature.NOTE: This can also be referred to as a "blind credit" or "stand-alone credit"
-
-
Method Detail
-
values
public static DefaultTransactionTypes[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultTransactionTypes c : DefaultTransactionTypes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultTransactionTypes valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isAuthorize
public static boolean isAuthorize(String transactionType)
-
isReverseAuth
public static boolean isReverseAuth(String transactionType)
-
isCapture
public static boolean isCapture(String transactionType)
-
isAuthorizeAndCapture
public static boolean isAuthorizeAndCapture(String transactionType)
-
isRefund
public static boolean isRefund(String transactionType)
-
isDetachedCredit
public static boolean isDetachedCredit(String transactionType)
-
-