public class Payment extends Object implements Serializable
This entity is designed to store payment methods associated to a Cart, the getAmount()
the user is to be charged via that payment method, and the history of attempted transactions
(authorizations, charges, refunds, etc.) against that payment method for the owning Cart.
Every payment gateway interaction should have its results stored in the transactions
collection.
Payments
are not actually deleted from the database but rather are only
soft-deleted (archived = true)
PaymentTransaction
,
Serialized FormConstructor and Description |
---|
Payment() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
javax.money.MonetaryAmount |
getAdjustmentsTotal()
The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment
discounts.
|
javax.money.MonetaryAmount |
getAmount()
The amount for which this payment is allotted.
|
Map<String,String> |
getAttributes()
General use map to capture any additional attributes needed for this Payment
|
Address |
getBillingAddress()
The billing address associated with this payment.
|
String |
getCustomerPaymentAccountId()
The id of the customer's saved payment account that was used to build this payment object.
|
Map<String,String> |
getDisplayAttributes()
General use map to capture any display properties for this Payment
|
javax.money.MonetaryAmount |
getFulfillmentTotal()
The payment's total fulfillment cost
|
String |
getGatewayType()
The gateway used to process this payment.
|
String |
getId()
The id of this payment.
|
String |
getName()
The name of this payment.
|
Map<String,String> |
getPaymentGatewayProperties()
Map to capture any gateway-specific information needed to perform gateway transactions
|
boolean |
getShouldSavePaymentToCustomer()
Should the payment method be saved to the customer
|
String |
getStatus()
Deprecated.
in favor of
PaymentSummary |
javax.money.MonetaryAmount |
getSubtotal()
The payment's total usually excluding adjustments, tax, and shipping.
|
javax.money.MonetaryAmount |
getTaxTotal()
The payment's total tax cost
|
List<PaymentTransaction> |
getTransactions()
Transaction data representing each payment gateway interaction related to this payment.
|
String |
getType()
The type of this payment like Credit Card or Gift Card.
|
int |
hashCode() |
boolean |
isArchived()
Whether or not this payment has been archived.
|
boolean |
isSingleUsePaymentMethod()
Whether or not the underlying payment method can only be used once.
|
void |
setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal)
The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment
discounts.
|
void |
setAmount(javax.money.MonetaryAmount amount)
The amount for which this payment is allotted.
|
void |
setArchived(boolean archived)
Whether or not this payment has been archived.
|
void |
setAttributes(Map<String,String> attributes)
General use map to capture any additional attributes needed for this Payment
|
void |
setBillingAddress(Address billingAddress)
The billing address associated with this payment.
|
void |
setCustomerPaymentAccountId(String customerPaymentAccountId)
The id of the customer's saved payment account that was used to build this payment object.
|
void |
setDisplayAttributes(Map<String,String> displayAttributes)
General use map to capture any display properties for this Payment
|
void |
setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal)
The payment's total fulfillment cost
|
void |
setGatewayType(String gatewayType)
The gateway used to process this payment.
|
void |
setId(String id)
The id of this payment.
|
void |
setName(String name)
The name of this payment.
|
void |
setPaymentGatewayProperties(Map<String,String> paymentGatewayProperties)
Map to capture any gateway-specific information needed to perform gateway transactions
|
void |
setShouldSavePaymentToCustomer(boolean shouldSavePaymentToCustomer)
Should the payment method be saved to the customer
|
void |
setSingleUsePaymentMethod(boolean isSingleUsePaymentMethod)
Whether or not the underlying payment method can only be used once.
|
void |
setStatus(String status)
Deprecated.
in favor of
PaymentSummary |
void |
setSubtotal(javax.money.MonetaryAmount subtotal)
The payment's total usually excluding adjustments, tax, and shipping.
|
void |
setTaxTotal(javax.money.MonetaryAmount taxTotal)
The payment's total tax cost
|
void |
setTransactions(List<PaymentTransaction> transactions)
Transaction data representing each payment gateway interaction related to this payment.
|
void |
setType(String type)
The type of this payment like Credit Card or Gift Card.
|
String |
toString() |
public boolean getShouldSavePaymentToCustomer()
public String getId()
public String getName()
public String getCustomerPaymentAccountId()
public boolean isSingleUsePaymentMethod()
@Deprecated public String getStatus()
PaymentSummary
public String getType()
public String getGatewayType()
public javax.money.MonetaryAmount getAmount()
payments
for a particular cart should equal the cart's total.
If specified, the amount details (subtotal
, adjustmentsTotal
,
fulfillmentTotal
, & taxTotal
) should sum together to equal this amount.public javax.money.MonetaryAmount getSubtotal()
public javax.money.MonetaryAmount getAdjustmentsTotal()
public javax.money.MonetaryAmount getFulfillmentTotal()
public javax.money.MonetaryAmount getTaxTotal()
public Address getBillingAddress()
public Map<String,String> getPaymentGatewayProperties()
public Map<String,String> getAttributes()
public Map<String,String> getDisplayAttributes()
public List<PaymentTransaction> getTransactions()
public boolean isArchived()
public void setId(String id)
id
- The id of this payment.public void setName(String name)
name
- The name of this payment.public void setCustomerPaymentAccountId(String customerPaymentAccountId)
customerPaymentAccountId
- The id of the customer's saved payment account.public void setSingleUsePaymentMethod(boolean isSingleUsePaymentMethod)
shouldSavePaymentToCustomer
- Whether or not the underlying payment method can only be
used oncepublic void setShouldSavePaymentToCustomer(boolean shouldSavePaymentToCustomer)
shouldSavePaymentToCustomer
- Should the payment method be saved to the customer@Deprecated public void setStatus(String status)
PaymentSummary
status
- the status of the payment.public void setType(String type)
type
- The type of this payment like Credit Card or Gift Card.public void setGatewayType(String gatewayType)
gatewayType
- The gateway used to process this payment.public void setAmount(javax.money.MonetaryAmount amount)
payments
for a particular cart should equal the cart's total.
If specified, the amount details (subtotal
, adjustmentsTotal
,
fulfillmentTotal
, & taxTotal
) should sum together to equal this amount.amount
- The amount for which this payment is allotted.public void setSubtotal(javax.money.MonetaryAmount subtotal)
public void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal)
public void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal)
public void setTaxTotal(javax.money.MonetaryAmount taxTotal)
public void setBillingAddress(Address billingAddress)
billingAddress
- The billing address associated with this payment.public void setPaymentGatewayProperties(Map<String,String> paymentGatewayProperties)
paymentGatewayProperties
- Map to capture any gateway-specific information needed to
perform gateway transactionspublic void setAttributes(Map<String,String> attributes)
attributes
- General use map to capture any additional attributes needed for this
Paymentpublic void setDisplayAttributes(Map<String,String> displayAttributes)
displayAttributes
- General use map to capture any display properties for this Paymentpublic void setTransactions(List<PaymentTransaction> transactions)
transactions
- Transactions related to this payment.public void setArchived(boolean archived)
protected boolean canEqual(Object other)
Copyright © 2021. All rights reserved.