Class CustomerPaymentAccountManagementService

java.lang.Object
com.broadleafcommerce.paymenttransaction.service.CustomerPaymentAccountManagementService
All Implemented Interfaces:
SavedPaymentMethodManagementService

@Deprecated(since="1.0.2", forRemoval=true) public class CustomerPaymentAccountManagementService extends Object implements SavedPaymentMethodManagementService
Deprecated, for removal: This API element is subject to removal in a future version.
since 1.0.2, in favor of using SavedPaymentMethod to manage saved payment methods.
The implementation to support storing saved payment methods using PaymentAccount and CustomerServices, driven by CustomerPaymentAccountProvider.

This implementation can be turned on by configuring the SavedPaymentMethodConfigurationProperties.getStorageLocation() to DefaultSavedPaymentMethodStorageLocations.BLC_CUSTOMER_SERVICES.

Author:
Sunny Yu
  • Constructor Details

    • CustomerPaymentAccountManagementService

      public CustomerPaymentAccountManagementService(com.broadleafcommerce.common.extension.TypeFactory typeFactory, CustomerPaymentAccountProvider<PaymentAccount> paymentAccountProvider)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • createSavedPaymentMethodForFutureUse

      public void createSavedPaymentMethodForFutureUse(Payment payment, @Nullable com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SavedPaymentMethodManagementService
      Creates a saved payment method for future use from the given Payment and PaymentResponse.
      Specified by:
      createSavedPaymentMethodForFutureUse in interface SavedPaymentMethodManagementService
      Parameters:
      payment - the payment that should be saved
      paymentResponse - the PaymentResponse from the transaction execution if there's any
      contextInfo - context information related to multitenancy
    • updateSavedPaymentMethodBasedOnPaymentResponse

      public void updateSavedPaymentMethodBasedOnPaymentResponse(String savedPaymentMethodId, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SavedPaymentMethodManagementService
      Updates the saved payment method from the given PaymentResponse.

      This is typically used to update the last transaction date and response on a saved payment method after executing a transaction.

      Specified by:
      updateSavedPaymentMethodBasedOnPaymentResponse in interface SavedPaymentMethodManagementService
      Parameters:
      savedPaymentMethodId - the id of the saved payment method to update
      paymentResponse - the PaymentResponse from the transaction execution
      contextInfo - context information related to multitenancy
    • populatePaymentFromSavedPaymentMethod

      public Payment populatePaymentFromSavedPaymentMethod(Payment payment, String savedPaymentMethodId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SavedPaymentMethodManagementService
      Populates the given Payment with the saved payment method specified in Payment.getSavedPaymentMethodId().
      Specified by:
      populatePaymentFromSavedPaymentMethod in interface SavedPaymentMethodManagementService
      Parameters:
      payment - the Payment to populate for
      savedPaymentMethodId - the saved payment method id to retrieve the saved payment method from
      contextInfo - context information surrounding multitenant state
      Returns:
      the Payment populated with the saved payment method
    • getSavedPaymentMethodOwnership

      public OwnershipSummary getSavedPaymentMethodOwnership(String savedPaymentMethodId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SavedPaymentMethodManagementService
      Gets an OwnershipSummary of the saved payment method.
      Specified by:
      getSavedPaymentMethodOwnership in interface SavedPaymentMethodManagementService
      Parameters:
      savedPaymentMethodId - the saved payment method id to retrieve the saved payment method from
      contextInfo - context information surrounding multitenant state
      Returns:
      an OwnershipSummary describing the ownership details of the saved payment method
    • buildOwnershipSummary

      protected OwnershipSummary buildOwnershipSummary(@NonNull @NonNull PaymentAccount paymentAccount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds the OwnershipSummary based on the given PaymentAccount.
      Parameters:
      paymentAccount - the PaymentAccount to build the OwnershipSummary for
      Returns:
      the OwnershipSummary based on the given PaymentAccount
    • buildBillingAddress

      protected Address buildBillingAddress(PaymentAccount paymentAccount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds an Address from the given PaymentAccount.
      Parameters:
      paymentAccount - the PaymentAccount to build the Address from
      Returns:
      an Address built from the given PaymentAccount
    • buildPaymentAccount

      public PaymentAccount buildPaymentAccount(Payment payment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds a PaymentAccount from the given Payment.
      Parameters:
      payment - the Payment to build the PaymentAccount from
      Returns:
      a PaymentAccount from the given Payment
    • getLastSuccessfulTransactionDate

      @Nullable protected Instant getLastSuccessfulTransactionDate(Payment payment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the last successful transaction date from the given Payment.
      Parameters:
      payment - the Payment to get the last successful transaction date from
      Returns:
      the last successful transaction date of the given Payment, null if the Payment doesn't have any successful transactions
    • getLastSuccessfulTransactionGatewayResponseCode

      @Nullable protected String getLastSuccessfulTransactionGatewayResponseCode(Payment payment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the last successful transaction gateway response code from the given Payment.
      Parameters:
      payment - the Payment to get the last successful transaction gateway response code from
      Returns:
      the last successful transaction gateway response code of the given Payment, null if the Payment doesn't have any successful transactions
    • getLatestSuccessfulTransaction

      @Nullable protected PaymentTransaction getLatestSuccessfulTransaction(Payment payment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the latest successful PaymentTransaction from the given Payment.
      Parameters:
      payment - the Payment to get the latest successful PaymentTransaction from
      Returns:
      the latest successful PaymentTransaction from the given Payment
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPaymentAccountProvider

      protected CustomerPaymentAccountProvider<PaymentAccount> getPaymentAccountProvider()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSavedPaymentMethodAccessValidationService

      protected SavedPaymentMethodAccessValidationService getSavedPaymentMethodAccessValidationService()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Lazy injected SavedPaymentMethodAccessValidationService since this service is itself a service component.

      This avoids circular dependency exceptions

    • setSavedPaymentMethodAccessValidationService

      @Autowired @Lazy public void setSavedPaymentMethodAccessValidationService(SavedPaymentMethodAccessValidationService savedPaymentMethodAccessValidationService)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Lazy injected SavedPaymentMethodAccessValidationService since this service is itself a service component.

      This avoids circular dependency exceptions