Class SavedPaymentMethod

java.lang.Object
com.broadleafcommerce.paymenttransaction.domain.SavedPaymentMethod
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.policy.Owned, Serializable

public class SavedPaymentMethod extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.policy.Owned
This entity is designed to store customer's, account's, or other entity's saved payment methods for future use.
See Also:
  • Constructor Details

    • SavedPaymentMethod

      public SavedPaymentMethod()
  • Method Details

    • getOwnerIdentifier

      public String getOwnerIdentifier()
      Specified by:
      getOwnerIdentifier in interface com.broadleafcommerce.data.tracking.core.policy.Owned
    • getId

      public String getId()
      The id of this saved payment method.
      Returns:
      The id of this saved payment method.
    • getName

      public String getName()
      The name of this saved payment method. This name is typically something like "Visa ending in 1234".
      Returns:
      The name of this saved payment method.
    • isDefaultForOwner

      public boolean isDefaultForOwner()
      Whether this saved payment is the default payment method for the owner entity.
      Returns:
      True if this saved payment is the default payment method for the owner, otherwise false.
    • getOriginatingPaymentId

      public String getOriginatingPaymentId()
      The Payment.getId() that this saved payment was created from. This is typically populated when a multi-use payment token is produced by executing a transaction against a single-use token via a checkout interaction.
      Returns:
      The Payment.getId() that this saved payment was created from
    • getOwningUserType

      public String getOwningUserType()
      Describes the owning user of the saved payment method. For example, the saved payment could belong to a Broadleaf customer or an account, therefore this value might be BLC_CUSTOMER, or BLC_ACCOUNT.
      Returns:
      The type describing the owning user of the saved payment method
    • getOwningUserId

      public String getOwningUserId()
      The id of the entity that owns this saved payment method. For example, this may be a customer id, or an account id.
      Returns:
      The id of the entity that owns this saved payment method.
    • getType

      public String getType()
      The type of this saved payment method like Credit Card or Gift Card.
      Returns:
      The type of this saved payment method like Credit Card or Gift Card.
    • getGatewayType

      public String getGatewayType()
      The gateway used to process this saved payment method. Only a SINGLE payment gateway can be used for a payment.
      Returns:
      The gateway used to process this saved payment method.
    • getPaymentMethodProperties

      public 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
    • getAttributes

      public Map<String,String> getAttributes()
      General use map to capture any additional attributes needed for this saved payment method.
      Returns:
      General use map to capture any additional attributes needed for this saved payment method
    • getDisplayAttributes

      public Map<String,String> getDisplayAttributes()
      General use map to capture any display properties for this saved payment method.
      Returns:
      General use map to capture any display properties for this saved payment method
    • getLastTransactionDateTime

      public Instant getLastTransactionDateTime()
      The timestamp of the last transaction made by this saved payment method.
      Returns:
      the last transaction date and time of the saved payment method
    • getLastTransactionResultCode

      public String getLastTransactionResultCode()
      The result code returned from the gateway on the last transaction.
      Returns:
      the result code from the last transaction for this saved payment method
    • getBillingAddress

      public Address getBillingAddress()
      The billing address of this saved payment method.
      Returns:
      the billing address of this saved payment method
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • getVersion

      public Integer getVersion()
      The version of this saved payment. Used for checking that the requested version of the saved payment is up-to-date before saving changes. Required for any request which results in an update being made to the saved payment. This should never be manually incremented/decremented.
    • getVisibleToChildren

      public String getVisibleToChildren()
      The visibility of the payment method to child accounts.

      This is typically for B2B use cases where the getOwningUserType() is DefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT. Should be DefaultChildrenVisibilityType.NO for typical B2C use cases.

      Returns:
      The visibility of the payment method to child accounts
      See Also:
    • setId

      public void setId(String id)
      The id of this saved payment method.
      Parameters:
      id - The id of this saved payment method.
    • setName

      public void setName(String name)
      The name of this saved payment method. This name is typically something like "Visa ending in 1234".
      Parameters:
      name - The name of this saved payment method.
    • setDefaultForOwner

      public void setDefaultForOwner(boolean defaultForOwner)
      Whether this saved payment is the default payment method for the owner entity.
      Parameters:
      defaultForOwner - Whether this saved payment is the default payment method for the owner entity.
    • setOriginatingPaymentId

      public void setOriginatingPaymentId(String originatingPaymentId)
      The Payment.getId() that this saved payment was created from. This is typically populated when a multi-use payment token is produced by executing a transaction against a single-use token via a checkout interaction.
      Parameters:
      originatingPaymentId - The Payment.getId() that this saved payment was created from
    • setOwningUserType

      public void setOwningUserType(String owningUserType)
      Describes the owning user of the saved payment method. For example, the saved payment could belong to a Broadleaf customer or an account, therefore this value might be BLC_CUSTOMER, or BLC_ACCOUNT.
      Parameters:
      owningUserType - The type describing the owning user of the saved payment method
    • setOwningUserId

      public void setOwningUserId(String owningUserId)
      The id of the entity that owns this saved payment method. For example, this may be a customer id, or an account id.
      Parameters:
      owningUserId - The id of the entity that owns this saved payment method.
    • setType

      public void setType(String type)
      The type of this saved payment method like Credit Card or Gift Card.
      Parameters:
      type - The type of this saved payment method like Credit Card or Gift Card.
    • setGatewayType

      public void setGatewayType(String gatewayType)
      The gateway used to process this saved payment method. Only a SINGLE payment gateway can be used for a payment.
      Parameters:
      gatewayType - The gateway used to process this saved payment method.
    • setPaymentMethodProperties

      public 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
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      General use map to capture any additional attributes needed for this saved payment method.
      Parameters:
      attributes - General use map to capture any additional attributes needed for this payment method
    • setDisplayAttributes

      public void setDisplayAttributes(Map<String,String> displayAttributes)
      General use map to capture any display properties for this saved payment method.
      Parameters:
      displayAttributes - General use map to capture any display properties for this payment method
    • setLastTransactionDateTime

      public void setLastTransactionDateTime(Instant lastTransactionDateTime)
      The timestamp of the last transaction made by this saved payment method.
      Parameters:
      lastTransactionDateTime - the last transaction date and time of the saved payment method
    • setLastTransactionResultCode

      public void setLastTransactionResultCode(String lastTransactionResultCode)
      The result code returned from the gateway on the last transaction.
      Parameters:
      lastTransactionResultCode - the result code from the last transaction for this saved payment method
    • setBillingAddress

      public void setBillingAddress(Address billingAddress)
      The billing address of this saved payment method.
      Parameters:
      billingAddress - the billing address of this saved payment method
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • setVersion

      public void setVersion(Integer version)
      The version of this saved payment. Used for checking that the requested version of the saved payment is up-to-date before saving changes. Required for any request which results in an update being made to the saved payment. This should never be manually incremented/decremented.
    • setVisibleToChildren

      public void setVisibleToChildren(String visibleToChildren)
      The visibility of the payment method to child accounts.

      This is typically for B2B use cases where the getOwningUserType() is DefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT. Should be DefaultChildrenVisibilityType.NO for typical B2C use cases.

      Parameters:
      visibleToChildren - The visibility of the payment method to child accounts
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object