@Entity public class OrderPaymentImpl extends Object implements OrderPayment, CurrencyCodeIdentifiable
| Modifier and Type | Class and Description |
|---|---|
static class |
OrderPaymentImpl.Presentation |
| Modifier and Type | Field and Description |
|---|---|
protected BigDecimal |
amount |
protected ArchiveStatus |
archiveStatus |
protected Address |
billingAddress |
protected String |
gatewayType |
protected Long |
id |
protected Order |
order |
protected String |
referenceNumber |
protected List<PaymentTransaction> |
transactions |
protected String |
type |
| Constructor and Description |
|---|
OrderPaymentImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTransaction(PaymentTransaction transaction)
A more declarative way to invoke
#getTransactions().add(). |
boolean |
equals(Object obj) |
Money |
getAmount()
The amount that this payment is allotted for.
|
Character |
getArchived() |
Address |
getBillingAddress()
Gets the billing address associated with this payment.
|
BroadleafCurrency |
getCurrency()
The currency that this payment should be taken in.
|
String |
getCurrencyCode() |
PaymentGatewayType |
getGatewayType()
Gets the gateway that was used to process this order payment.
|
Long |
getId() |
PaymentTransaction |
getInitialTransaction()
Returns the initial transaction for this order payment.
|
Order |
getOrder() |
String |
getReferenceNumber()
The soft link to a
Referenced entity which will be stored in the blSecurePU persistence unit. |
Money |
getSuccessfulTransactionAmountForType(PaymentTransactionType type)
Returns all of the transactions on this payment that were successful for the given type.
|
Money |
getTransactionAmountForType(PaymentTransactionType type)
Looks through all of the transactions for this payment and adds up the amount for the given transaction type.
|
List<PaymentTransaction> |
getTransactions()
All of the transactions that have been applied to this particular payment.
|
List<PaymentTransaction> |
getTransactionsForType(PaymentTransactionType type)
Returns a transaction for given type.
|
PaymentType |
getType()
The type of this payment like Credit Card or Gift Card.
|
int |
hashCode() |
boolean |
isActive() |
boolean |
isConfirmed()
Looks through all of the transactions for this payment and returns whether or not
it contains a transaction of type
PaymentTransactionType.AUTHORIZE_AND_CAPTURE or
PaymentTransactionType.AUTHORIZE |
boolean |
isFinalPayment()
Returns whether or not this payment is considered to be the final payment on the order.
|
void |
setAmount(Money amount)
The amount that this payment is allotted for.
|
void |
setArchived(Character archived) |
void |
setBillingAddress(Address billingAddress)
Sets the billing address associated with this payment.
|
void |
setId(Long id) |
void |
setOrder(Order order) |
void |
setPaymentGatewayType(PaymentGatewayType gatewayType)
Gets the gateway that was used to process this order payment.
|
void |
setReferenceNumber(String referenceNumber)
Sets the soft link to a
Referenced entity stored in the blSecurePU persistence unit. |
void |
setTransactions(List<PaymentTransaction> transactions)
All of the transactions that have been applied to this particular payment.
|
void |
setType(PaymentType type)
Sets the type of this payment like Credit Card or Gift Card
|
protected Long id
protected Order order
protected Address billingAddress
protected BigDecimal amount
protected String referenceNumber
protected String type
protected String gatewayType
protected List<PaymentTransaction> transactions
protected ArchiveStatus archiveStatus
public Money getAmount()
OrderPaymentOrderPayments for a particular
Order should equal Order.getTotal()getAmount in interface OrderPaymentpublic void setAmount(Money amount)
OrderPaymentOrderPayments for a particular
Order should equal Order.getTotal()setAmount in interface OrderPaymentpublic Long getId()
getId in interface OrderPaymentpublic void setId(Long id)
setId in interface OrderPaymentpublic Order getOrder()
getOrder in interface OrderPaymentpublic void setOrder(Order order)
setOrder in interface OrderPaymentpublic Address getBillingAddress()
OrderPaymentgetBillingAddress in interface OrderPaymentpublic void setBillingAddress(Address billingAddress)
OrderPaymentsetBillingAddress in interface OrderPaymentpublic String getReferenceNumber()
OrderPaymentReferenced entity which will be stored in the blSecurePU persistence unit. If you are not
attempting to store credit cards in your own database (which is the usual, recommended case) then this will not be
used or set. If you do use this reference number, this can be anything that is unique (like System.currentTimeMillis()).getReferenceNumber in interface OrderPaymentpublic void setReferenceNumber(String referenceNumber)
OrderPaymentReferenced entity stored in the blSecurePU persistence unit. This will likely not
be used as the common case is to not store credit cards yourself.setReferenceNumber in interface OrderPaymentpublic PaymentType getType()
OrderPaymentgetType in interface OrderPaymentPaymentType}public void setType(PaymentType type)
OrderPaymentsetType in interface OrderPaymentPaymentType}public PaymentGatewayType getGatewayType()
OrderPaymentgetGatewayType in interface OrderPaymentpublic void setPaymentGatewayType(PaymentGatewayType gatewayType)
OrderPaymentGets the gateway that was used to process this order payment. Only a SINGLE payment gateway can modify transactions on a particular order payment.
It usually does not make sense to modify the gateway type after it has already been set once. Instead, consider just archiving this payment type (by deleting it) and creating a new payment for the new gateway.
setPaymentGatewayType in interface OrderPaymentpublic List<PaymentTransaction> getTransactions()
OrderPaymentAll of the transactions that have been applied to this particular payment. Transactions are denoted by the various
PaymentTransactionTypes. In almost all scenarios (as in, 99.9999% of all cases) there will be a at least one
PaymentTransaction for every OrderPayment.
To add a transaction to an OrderPayment see OrderPayment.addTransaction(PaymentTransaction).
getTransactions in interface OrderPayment#addTransaction(PaymentTransaction)}public void setTransactions(List<PaymentTransaction> transactions)
OrderPaymentAll of the transactions that have been applied to this particular payment. Transactions are denoted by the various
PaymentTransactionTypes. In almost all scenarios (as in, 99.9999% of all cases) there will be a at least one
PaymentTransaction for every OrderPayment.
To add a transaction to an OrderPayment see OrderPayment.addTransaction(PaymentTransaction).
setTransactions in interface OrderPayment#addTransaction(PaymentTransaction)}public void addTransaction(PaymentTransaction transaction)
OrderPayment#getTransactions().add(). This is the preferred way to add a transaction
to this payment.addTransaction in interface OrderPaymentpublic List<PaymentTransaction> getTransactionsForType(PaymentTransactionType type)
OrderPaymentPaymentTransaction
can actually be added to this payment. For instance, there can only be a single PaymentTransactionType.AUTHORIZE
for a payment.getTransactionsForType in interface OrderPaymenttype - the type of transaction to look for within OrderPayment.getTransactions()public PaymentTransaction getInitialTransaction()
OrderPaymentPaymentTransactionType.AUTHORIZE
or PaymentTransactionType.AUTHORIZE_AND_CAPTURE or PaymentTransactionType.UNCONFIRMED.
Implementation-wise this would
be any PaymentTransaction whose parentTransaction is NULL.getInitialTransaction in interface OrderPaymentpublic Money getTransactionAmountForType(PaymentTransactionType type)
OrderPaymentgetTransactionAmountForType in interface OrderPayment#getSuccessfulTransactionAmountForType(PaymentTransactionType)}public Money getSuccessfulTransactionAmountForType(PaymentTransactionType type)
OrderPaymentgetSuccessfulTransactionAmountForType in interface OrderPaymenttype - the type of transactionpublic boolean isConfirmed()
OrderPaymentPaymentTransactionType.AUTHORIZE_AND_CAPTURE or
PaymentTransactionType.AUTHORIZEisConfirmed in interface OrderPaymentpublic boolean isFinalPayment()
OrderPaymentPaymentType.THIRD_PARTY_ACCOUNT
and PaymentType.CREDIT_CARD final payments because integrations with external Payment Gateways require it.
For example, a THIRD_PARTY_ACCOUNT payment's (e.g. PayPal Express Checkout) amount to charge
to the customer will be automatically calculated based on other payments that have already been applied
to the order, such as GIFT_CARDs or ACCOUNT_CREDITs. This final amount (OrderPayment) will be sent to the gateway.isFinalPayment in interface OrderPaymentpublic BroadleafCurrency getCurrency()
OrderPayment#getOrder()#getCurrency().getCurrency in interface OrderPaymentpublic String getCurrencyCode()
getCurrencyCode in interface CurrencyCodeIdentifiablepublic Character getArchived()
getArchived in interface Statuspublic void setArchived(Character archived)
setArchived in interface StatusCopyright © 2015. All Rights Reserved.