Enum DefaultTransactionTypes
- java.lang.Object
-
- java.lang.Enum<DefaultTransactionTypes>
-
- com.broadleafcommerce.paymentgateway.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)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTHORIZEFunds have been authorized for capture.AUTHORIZE_AND_CAPTUREFunds have been captured/authorized all at once.CAPTUREFunds have been charged/submitted/debited from the customer and payment is complete.DETACHED_CREDITSome payment processors allow you to issue credit to a customer that is not tied to an initialAUTHORIZEorAUTHORIZE_AND_CAPTUREtransaction.REFUNDFunds have been refunded/credited.REVERSE_AUTHThe reverse of anAUTHORIZEtransaction.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAuthorize(String transactionType)static booleanisAuthorizeAndCapture(String transactionType)static booleanisCapture(String transactionType)static booleanisDetachedCredit(String transactionType)static booleanisRefund(String transactionType)static booleanisReverseAuth(String transactionType)static DefaultTransactionTypesvalueOf(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.paymentgateway.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 anAUTHORIZEtransaction. This can only occur after funds have beenauthorizedand 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
AUTHORIZEand thenCAPTUREin separate transactions and at separate times. For instance, anAUTHORIZEwould happen once the order has completed checkout but then aCAPTUREwould 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_CAPTUREorCAPTUREtransaction 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
AUTHORIZEorAUTHORIZE_AND_CAPTUREtransaction. 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)
-
-