public enum DefaultTransactionTypes extends Enum<DefaultTransactionTypes> implements TransactionType
#AUTHORIZE}
,
#CAPTURE}
,
#AUTHORIZE_AND_CAPTURE}
,
#SETTLE}
,
#REFUND}
,
#DETACHED_CREDIT}
,
#VOID}
,
#REVERSE_AUTH}
The following is a depiction of the possible state flows for an Order Payment and the
hierarchical relationship of all its transactions:
Enum Constant and 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
initial
AUTHORIZE or AUTHORIZE_AND_CAPTURE transaction. |
REFUND
Funds have been refunded/credited.
|
REVERSE_AUTH
The reverse of an
AUTHORIZE transaction. |
SETTLE
Can ONLY occur after a payment has been captured (
CAPTURE ). |
VOID
Void can happen after a CAPTURE but before it has been settled.
|
Modifier and Type | Method and 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 boolean |
isSettle(String transactionType) |
static boolean |
isVoid(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.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
name
public static final DefaultTransactionTypes AUTHORIZE
public static final DefaultTransactionTypes REVERSE_AUTH
AUTHORIZE
transaction. This can only occur after funds have been
authorized
and before funds have been captured
.public static final DefaultTransactionTypes CAPTURE
AUTHORIZE
).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 then CAPTURE
in separate transactions and at separate times.
For instance, an AUTHORIZE
would happen once the order has completed checkout but
then a CAPTURE
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
.
public static final DefaultTransactionTypes SETTLE
CAPTURE
). This represents a
payment that has been balanced by the payment provider. This represents more finality than a
CAPTURE
. Some payment providers might not explicitly expose the details of settled
transactions which are usually done in batches at the end of the day.public static final DefaultTransactionTypes REFUND
Funds have been refunded/credited. This can ONLY occur after funds have been
captured
or settled
. This should only be used when money
goes back to a customer. This assumes that there will be a parent
AUTHORIZE_AND_CAPTURE
, CAPTURE
, or settled
transaction that
this can be tied back to.
NOTE: This can also be referred to as a "follow-on 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
or AUTHORIZE_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"
public static final DefaultTransactionTypes VOID
Void can happen after a CAPTURE but before it has been settled. Payment transactions are usually settled in batches at the end of the day.
public static DefaultTransactionTypes[] values()
for (DefaultTransactionTypes c : DefaultTransactionTypes.values()) System.out.println(c);
public static DefaultTransactionTypes valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static boolean isAuthorize(String transactionType)
public static boolean isReverseAuth(String transactionType)
public static boolean isCapture(String transactionType)
public static boolean isAuthorizeAndCapture(String transactionType)
public static boolean isSettle(String transactionType)
public static boolean isRefund(String transactionType)
public static boolean isDetachedCredit(String transactionType)
public static boolean isVoid(String transactionType)
Copyright © 2021. All rights reserved.