Interface SavedPaymentMethodManagementService

All Known Implementing Classes:
CustomerPaymentAccountManagementService, DefaultSavedPaymentMethodManagementService

public interface SavedPaymentMethodManagementService
Service API for managing saved payment methods.
Author:
Sunny Yu
  • Method Details

    • createSavedPaymentMethodForFutureUse

      default void createSavedPaymentMethodForFutureUse(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a saved payment method for future use from the given Payment.
      Parameters:
      payment - the payment that should be saved
      contextInfo - context information related to multitenancy
    • createSavedPaymentMethodForFutureUse

      void createSavedPaymentMethodForFutureUse(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a saved payment method for future use from the given Payment and PaymentResponse.
      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

      void updateSavedPaymentMethodBasedOnPaymentResponse(@NonNull @NonNull String savedPaymentMethodId, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      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.

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

      default void updateSavedPaymentMethodBasedOnPaymentResponse(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      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.

      Parameters:
      savedPaymentMethod - the saved payment method to update
      paymentResponse - the PaymentResponse from the transaction execution
      contextInfo - context information related to multitenancy
    • populatePaymentFromSavedPaymentMethod

      Payment populatePaymentFromSavedPaymentMethod(@NonNull @NonNull Payment payment, @NonNull @NonNull String savedPaymentMethodId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Populates the given Payment with the saved payment method specified in Payment.getSavedPaymentMethodId().
      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

      OwnershipSummary getSavedPaymentMethodOwnership(@NonNull @NonNull String savedPaymentMethodId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Gets an OwnershipSummary of the saved payment method.
      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