Class PaymentTransactionType
- All Implemented Interfaces:
Serializable,BroadleafEnumerationType
- Author:
- Jerry Ocanas (jocanas), Phillip Verheyden (phillipuniverse), Elbert Bautista (elbertbautista), Jerry Ocanas (jocanas), Phillip Verheyden (phillipuniverse), Elbert Bautista (elbertbautista)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaymentTransactionTypeFunds have been authorized for capture.static final PaymentTransactionTypeFunds have been captured/authorized all at once.static final PaymentTransactionTypeFunds have been charged/submitted/debited from the customer and payment is complete.static final PaymentTransactionTypeSome payment processors allow you to issue credit to a customer that is not tied to an initialAUTHORIZEorAUTHORIZE_AND_CAPTUREtransaction.static final PaymentTransactionTypeSome implementations may wish to defer any Authorization or Authorize and Capture transactions outside the scope of the checkout workflow.static final PaymentTransactionTypeFunds have been refunded/credited.static final PaymentTransactionTypeThe reverse ofAUTHORIZE.static final PaymentTransactionTypeCan ONLY occur after a payment has beenCAPTUREd.static final PaymentTransactionTypeThis applies to payment types like "PayPal Express Checkout" and Credit Card tokens/nonce where a transaction must be confirmed at a later stage.static final PaymentTransactionTypeVoid can happen after a CAPTURE but before it has been SETTLED. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic PaymentTransactionTypegetInstance(String type) getType()inthashCode()protected void
-
Field Details
-
AUTHORIZE
Funds have been authorized for capture. This might appear as a 'pending' transaction on a customer's credit card statement -
CAPTURE
Funds have been charged/submitted/debited from the customer and payment is complete. Can ONLY occur after an amount has benAUTHORIZEd. -
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 theOrderhas completed checkout but then aCAPTUREwould happen once theOrderhas shipped.NOTE: Many Gateways like to refer to this as also a SALE transaction.
This should be treated the exact same as a
CAPTURE. -
SETTLED
Can ONLY occur after a payment has beenCAPTUREd. This represents a payment that has been balanced by the payment provider. This represents more finality than aCAPTURE. Some payment providers might not explicitly expose the details of settled transactions which are usually done in batches at the end of the day. -
REFUND
Funds have been refunded/credited. This can ONLY occur after funds have been
CAPTUREd orSETTLED. This should only be used when money goes back to a customer. This assumes that there will be a parentAUTHORIZE_AND_CAPTURE,CAPTURE, orSETTLEDtransaction that this can be tied back to.NOTE: This can also be referred to as a "follow-on credit"
-
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"
-
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.
-
REVERSE_AUTH
-
UNCONFIRMED
This applies to payment types like "PayPal Express Checkout" and Credit Card tokens/nonce where a transaction must be confirmed at a later stage. A payment is considered "confirmed" if the gateway has actually processed a transaction against this user's card/account. There might be instances where payments have not been confirmed at the moment it has been added to the order.
For example, there might be a scenario where it is desirable to show a 'review confirmation' page to the user before actually hitting 'submit' and completing the checkout workflow (this is also the desired case with gift cards and account credits).
It is important to note that all "UNCONFIRMED" transactions will be confirmed in the checkout workflow via the
ValidateAndConfirmPaymentActivity. That means that any unconfirmed CREDIT_CARD transactions will be "Authorized" or "Authorized and Captured" at time of checkout. If the Order Payment is of any other type, then the activity will attempt to call the gateways implementation of:PaymentGatewayTransactionConfirmationService.confirmTransaction(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO) -
PENDING
Some implementations may wish to defer any Authorization or Authorize and Capture transactions outside the scope of the checkout workflow. For example, some may wish to take all orders up front (possibly just doing AVS and CVV checks during checkout) and opt to process the users card offline or asynchronously through some other external mechanism or process. In this scenario, you may create an Order Payment with a transaction that "marks" it with the intention of being processed later. This allows the
ValidateAndConfirmPaymentActivityto correctly compare the equality of all the successful payments on the order against the order total.NOTE: This differs from
UNCONFIRMEDbecause at the time of checkout, the checkout workflow will try to AUTH or SALE any UNCONFIRMED transactions on all the payments.
-
-
Constructor Details
-
PaymentTransactionType
public PaymentTransactionType() -
PaymentTransactionType
-
-
Method Details
-
getInstance
-
getType
- Specified by:
getTypein interfaceBroadleafEnumerationType
-
setType
-
getFriendlyType
- Specified by:
getFriendlyTypein interfaceBroadleafEnumerationType
-
hashCode
public int hashCode() -
equals
-