Class PaymentValidationRequest
- java.lang.Object
- 
- com.broadleafcommerce.paymentgateway.domain.PaymentValidationRequest
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class PaymentValidationRequest 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 thetransactionscollection.- Author:
- Chad Harchar (charchar), Chris Kittrell (ckittrell)
- See Also:
- PaymentTransaction, Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description PaymentValidationRequest()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Address<PaymentValidationRequest>addAddress(String addressType, Address<PaymentValidationRequest> address)Adds anAddressto the map, identified by the provided addressType.Address<PaymentValidationRequest>addressByType(String addressType)protected booleancanEqual(Object other)booleanequals(Object o)Address<PaymentValidationRequest>getAddress(String addressType)Gathers one of the payment's relatedaddressesby typeMap<String,Address<PaymentValidationRequest>>getAddressByType()The collection of related addresses that may include billing or shipping addressesjavax.money.MonetaryAmountgetAdjustmentsTotal()The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.javax.money.MonetaryAmountgetAmount()The amount for which this payment is allotted.Map<String,String>getAttributes()General use map to capture any additional attributes needed for this PaymentValidationRequestjavax.money.CurrencyUnitgetCurrency()The currency gathered from thegetAmount()javax.money.MonetaryAmountgetFulfillmentTotal()The payment's total fulfillment costStringgetGatewayType()The gateway used to process this payment.StringgetId()The id of this payment.StringgetName()The name of this payment.StringgetOwnerId()The id of the entity that owns this payment.StringgetOwnerType()Describes the owner of the payment.Map<String,String>getPaymentMethodProperties()Map to capture any information about the payment method needed to perform gateway transactionsbooleangetShouldSavePaymentToCustomer()Deprecated, for removal: This API element is subject to removal in a future version.since 1.0.2, in favor ofshouldSavePaymentForFutureUse()to support owning user types other than a customer (i.e.javax.money.MonetaryAmountgetSubtotal()The payment's total usually excluding adjustments, tax, and shipping.javax.money.MonetaryAmountgetTaxTotal()The payment's total tax costList<PaymentTransaction>getTransactions()Transaction data representing each payment gateway interaction related to this payment.StringgetType()The type of this payment like Credit Card or Gift Card.IntegergetVersion()The version of this payment.inthashCode()booleanisSingleUsePaymentMethod()Whether or not the underlying payment method can only be used once.voidsetAddressByType(Map<String,Address<PaymentValidationRequest>> addressByType)The collection of related addresses that may include billing or shipping addressesvoidsetAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal)The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.voidsetAmount(javax.money.MonetaryAmount amount)The amount for which this payment is allotted.voidsetAttributes(Map<String,String> attributes)General use map to capture any additional attributes needed for this PaymentValidationRequestvoidsetFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal)The payment's total fulfillment costvoidsetGatewayType(String gatewayType)The gateway used to process this payment.voidsetId(String id)The id of this payment.voidsetName(String name)The name of this payment.voidsetOwnerId(String ownerId)The id of the entity that owns this payment.voidsetOwnerType(String ownerType)Describes the owner of the payment.voidsetPaymentMethodProperties(Map<String,String> paymentMethodProperties)Map to capture any information about the payment method needed to perform gateway transactionsvoidsetShouldSavePaymentForFutureUse(boolean shouldSavePaymentForFutureUse)Should the payment method be saved to the owning user.voidsetShouldSavePaymentToCustomer(boolean shouldSavePaymentToCustomer)Deprecated.since 1.0.2, in favor ofshouldSavePaymentForFutureUseto support owning user types other than a customer (i.e.voidsetSingleUsePaymentMethod(boolean singleUsePaymentMethod)Whether or not the underlying payment method can only be used once.voidsetSubtotal(javax.money.MonetaryAmount subtotal)The payment's total usually excluding adjustments, tax, and shipping.voidsetTaxTotal(javax.money.MonetaryAmount taxTotal)The payment's total tax costvoidsetTransactions(List<PaymentTransaction> transactions)Transaction data representing each payment gateway interaction related to this payment.voidsetType(String type)The type of this payment like Credit Card or Gift Card.voidsetVersion(Integer version)The version of this payment.booleanshouldSavePaymentForFutureUse()Should the payment method be saved to the owning userStringtoString()
 
- 
- 
- 
Method Detail- 
getCurrency@Nullable public javax.money.CurrencyUnit getCurrency() The currency gathered from thegetAmount()- Returns:
- The currency gathered from the payment amount
 
 - 
addressByTypepublic Address<PaymentValidationRequest> addressByType(String addressType) 
 - 
addAddresspublic Address<PaymentValidationRequest> addAddress(String addressType, Address<PaymentValidationRequest> address) Adds anAddressto the map, identified by the provided addressType.- Parameters:
- addressType- The type of address that is to be added
- address- The address that is to be added
- Returns:
- The address that was added to the map.
 
 - 
getAddress@Nullable public Address<PaymentValidationRequest> getAddress(String addressType) Gathers one of the payment's relatedaddressesby type- Returns:
- The payment's related address identified by type
 
 - 
getShouldSavePaymentToCustomer@Deprecated(since="1.0.2", forRemoval=true) public boolean getShouldSavePaymentToCustomer() Deprecated, for removal: This API element is subject to removal in a future version.since 1.0.2, in favor ofshouldSavePaymentForFutureUse()to support owning user types other than a customer (i.e. account).
 - 
shouldSavePaymentForFutureUsepublic boolean shouldSavePaymentForFutureUse() Should the payment method be saved to the owning user- Returns:
- Should the payment method be saved to the owning user
 
 - 
getIdpublic String getId() The id of this payment.- Returns:
- The id of this payment.
 
 - 
getNamepublic String getName() The name of this payment. This name is typically something like "Visa ending in 1234".- Returns:
- The name of this payment.
 
 - 
getOwnerTypepublic String getOwnerType() Describes the owner of the payment. For example, the payment could have originated with a cart or a subscription, therefore this value might be CART or SUBSCRIPTION.- Returns:
- The type describing the owner of the payment
 
 - 
getOwnerIdpublic String getOwnerId() The id of the entity that owns this payment. For example, this may be a cart id, or a subscription billing cycle id.- Returns:
- The id of the entity that owns this payment.
 
 - 
getTypepublic String getType() The type of this payment like Credit Card or Gift Card.- Returns:
- The type of this payment like Credit Card or Gift Card.
 
 - 
getGatewayTypepublic String getGatewayType() The gateway used to process this payment. Only a SINGLE payment gateway can modify transactions on a particular payment.- Returns:
- The gateway used to process this payment.
 
 - 
getAmountpublic javax.money.MonetaryAmount getAmount() The amount for which this payment is allotted. The summation of all of thepaymentsfor 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.- Returns:
- The amount for which this payment is allotted.
 
 - 
getSubtotalpublic javax.money.MonetaryAmount getSubtotal() The payment's total usually excluding adjustments, tax, and shipping.- Returns:
- The payment's total usually excluding adjustments, tax, and shipping.
 
 - 
getAdjustmentsTotalpublic javax.money.MonetaryAmount getAdjustmentsTotal() The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.- Returns:
- The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
 
 - 
getFulfillmentTotalpublic javax.money.MonetaryAmount getFulfillmentTotal() The payment's total fulfillment cost- Returns:
- The payment's total fulfillment cost
 
 - 
getTaxTotalpublic javax.money.MonetaryAmount getTaxTotal() The payment's total tax cost- Returns:
- The payment's total tax cost
 
 - 
getAddressByTypepublic Map<String,Address<PaymentValidationRequest>> getAddressByType() The collection of related addresses that may include billing or shipping addresses- Returns:
- The collection of related addresses
 
 - 
getPaymentMethodPropertiespublic Map<String,String> getPaymentMethodProperties() Map to capture any information about the payment method needed to perform gateway transactions- Returns:
- Map to capture any information about the payment method needed to perform gateway transactions
 
 - 
getAttributespublic Map<String,String> getAttributes() General use map to capture any additional attributes needed for this PaymentValidationRequest- Returns:
- General use map to capture any additional attributes needed for this PaymentValidationRequest
 
 - 
getTransactionspublic List<PaymentTransaction> getTransactions() Transaction data representing each payment gateway interaction related to this payment.- Returns:
- Transactions related to this payment.
 
 - 
isSingleUsePaymentMethodpublic boolean isSingleUsePaymentMethod() Whether or not the underlying payment method can only be used once. In most cases, we're managing a single-use token that represents a credit card. This flag is especially important for managing payments with successful transactions. In those cases, the token has already been used and cannot be reused. If we need modify the payment's amount, then we may actually need to archive the existing payment, and create a new payment, with a new underlying token. Additionally, this flag is helpful when needing to re-authorize an expired authorization transaction. In that case, if the payment represents a single-use payment method, then the re-authorization may not be possible, and you'll need to seek an alternative form of payment.- Returns:
- Whether or not the underlying payment method can only be used once
 
 - 
getVersionpublic Integer getVersion() The version of this payment. Used for checking that the requested version of the payment is up-to-date before saving changes. Required for any request which results in an update being made to the payment. This should never be manually incremented/decremented.
 - 
setIdpublic void setId(String id) The id of this payment.- Parameters:
- id- The id of this payment.
 
 - 
setNamepublic void setName(String name) The name of this payment. This name is typically something like "Visa ending in 1234".- Parameters:
- name- The name of this payment.
 
 - 
setOwnerTypepublic void setOwnerType(String ownerType) Describes the owner of the payment. For example, the payment could have originated with a cart or a subscription, therefore this value might be CART or SUBSCRIPTION.- Parameters:
- ownerType- The type describing the owner of the payment
 
 - 
setOwnerIdpublic void setOwnerId(String ownerId) The id of the entity that owns this payment. For example, this may be a cart id, or a subscription billing cycle id.- Parameters:
- ownerId- The id of the entity that owns this payment.
 
 - 
setTypepublic void setType(String type) The type of this payment like Credit Card or Gift Card.- Parameters:
- type- The type of this payment like Credit Card or Gift Card.
 
 - 
setGatewayTypepublic void setGatewayType(String gatewayType) The gateway used to process this payment. Only a SINGLE payment gateway can modify transactions on a particular payment.- Parameters:
- gatewayType- The gateway used to process this payment.
 
 - 
setAmountpublic void setAmount(javax.money.MonetaryAmount amount) The amount for which this payment is allotted. The summation of all of thepaymentsfor 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.- Parameters:
- amount- The amount for which this payment is allotted.
 
 - 
setSubtotalpublic void setSubtotal(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, and shipping.
 - 
setAdjustmentsTotalpublic void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
 - 
setFulfillmentTotalpublic void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment cost
 - 
setTaxTotalpublic void setTaxTotal(javax.money.MonetaryAmount taxTotal) The payment's total tax cost
 - 
setAddressByTypepublic void setAddressByType(Map<String,Address<PaymentValidationRequest>> addressByType) The collection of related addresses that may include billing or shipping addresses- Parameters:
- addressByType- The collection of related addresses
 
 - 
setPaymentMethodPropertiespublic void setPaymentMethodProperties(Map<String,String> paymentMethodProperties) Map to capture any information about the payment method needed to perform gateway transactions- Parameters:
- paymentMethodProperties- Map to capture any information about the payment method needed to perform gateway transactions
 
 - 
setAttributespublic void setAttributes(Map<String,String> attributes) General use map to capture any additional attributes needed for this PaymentValidationRequest- Parameters:
- attributes- General use map to capture any additional attributes needed for this PaymentValidationRequest
 
 - 
setTransactionspublic void setTransactions(List<PaymentTransaction> transactions) Transaction data representing each payment gateway interaction related to this payment.- Parameters:
- transactions- Transactions related to this payment.
 
 - 
setSingleUsePaymentMethodpublic void setSingleUsePaymentMethod(boolean singleUsePaymentMethod) Whether or not the underlying payment method can only be used once. In most cases, we're managing a single-use token that represents a credit card. This flag is especially important for managing payments with successful transactions. In those cases, the token has already been used and cannot be reused. If we need modify the payment's amount, then we may actually need to archive the existing payment, and create a new payment, with a new underlying token. Additionally, this flag is helpful when needing to re-authorize an expired authorization transaction. In that case, if the payment represents a single-use payment method, then the re-authorization may not be possible, and you'll need to seek an alternative form of payment.- Parameters:
- singleUsePaymentMethod- Whether or not the underlying payment method can only be used once
 
 - 
setShouldSavePaymentToCustomer@Deprecated public void setShouldSavePaymentToCustomer(boolean shouldSavePaymentToCustomer) Deprecated.since 1.0.2, in favor ofshouldSavePaymentForFutureUseto support owning user types other than a customer (i.e. account).
 - 
setShouldSavePaymentForFutureUsepublic void setShouldSavePaymentForFutureUse(boolean shouldSavePaymentForFutureUse) Should the payment method be saved to the owning user.- Parameters:
- shouldSavePaymentForFutureUse- Should the payment method be saved to the owning user
 
 - 
setVersionpublic void setVersion(Integer version) The version of this payment. Used for checking that the requested version of the payment is up-to-date before saving changes. Required for any request which results in an update being made to the payment. This should never be manually incremented/decremented.
 - 
canEqualprotected boolean canEqual(Object other) 
 
- 
 
-