Interface SavedPaymentMethodService<P extends SavedPaymentMethod>

All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultSavedPaymentMethodService

public interface SavedPaymentMethodService<P extends SavedPaymentMethod> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Service API for SavedPaymentMethods.
Author:
Sunny Yu
  • Method Details

    • createSavedPaymentMethod

      P createSavedPaymentMethod(@NonNull @NonNull CreateSavedPaymentMethodRequest savedPaymentRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Parameters:
      savedPaymentRequest - the CreateSavedPaymentMethodRequest to create a SavedPaymentMethod from
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the newly created saved payment method
    • readAllByOwningUserTypeAndOwningUserId

      org.springframework.data.domain.Page<P> readAllByOwningUserTypeAndOwningUserId(@NonNull @NonNull String owningUserType, @NonNull @NonNull String owningUserId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable org.springframework.data.domain.Pageable page, @Nullable cz.jirutka.rsql.parser.ast.Node filters)
      Parameters:
      owningUserType - the type of the owning user
      owningUserId - the ID of the owning user
      contextInfo - context information surrounding sandboxing and multitenant state
      page - the requested page of results from the database
      filters - An RSQL filter used to narrow query results. May be EmptyNode if no filters should be applied
      Returns:
      the SavedPaymentMethods based on the given SavedPaymentMethod.getOwningUserType() and SavedPaymentMethod.getOwningUserId()
    • readAllAvailableToUseByOwningUserTypeAndOwningUserId

      org.springframework.data.domain.Page<P> readAllAvailableToUseByOwningUserTypeAndOwningUserId(@NonNull @NonNull String owningUserType, @NonNull @NonNull String owningUserId, @Nullable org.springframework.data.domain.Pageable page, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds all the saved payment methods available to use.
      Parameters:
      owningUserType - the type of the owning user
      owningUserId - the ID of the owning user
      page - the requested page of results from the database
      filters - An RSQL filter used to narrow query results. May be EmptyNode if no filters should be applied
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the saved payment methods available to use
    • readAllByOriginatingPaymentId

      List<P> readAllByOriginatingPaymentId(@NonNull @NonNull List<String> originatingPaymentIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Parameters:
      originatingPaymentIds - the payment IDs to query SavedPaymentMethod.getOriginatingPaymentId() against
      contextInfo - context information regarding sandboxing and multitenant state
      Returns:
      all the SavedPaymentMethods matching the given SavedPaymentMethod.getOriginatingPaymentId()
    • readByOriginatingPaymentId

      @Nullable default P readByOriginatingPaymentId(@NonNull @NonNull String originatingPaymentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Parameters:
      originatingPaymentId - the payment ID to query SavedPaymentMethod.getOriginatingPaymentId() against
      contextInfo - context information regarding sandboxing and multitenant state
      Returns:
      the SavedPaymentMethod matching the given SavedPaymentMethod.getOriginatingPaymentId()
    • readSavedPaymentMethodsByContextId

      List<P> readSavedPaymentMethodsByContextId(@NonNull @NonNull List<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Parameters:
      ids - the saved payment method IDs to query
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the saved payment methods matching the given ids
    • updateSavedPaymentMethod

      P updateSavedPaymentMethod(@NonNull @NonNull String savedPaymentMethodId, @NonNull @NonNull UpdateSavedPaymentMethodRequest updateRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Updates the SavedPaymentMethod based on the given UpdateSavedPaymentMethodRequest.
      Parameters:
      savedPaymentMethodId - the SavedPaymentMethod.getId() to update
      updateRequest - the UpdateSavedPaymentMethodRequest containing the updates
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the updated SavedPaymentMethod
    • readAllByOwningUserTypeAndOwningUserIdAndTenantId

      org.springframework.data.domain.Page<P> readAllByOwningUserTypeAndOwningUserIdAndTenantId(String owningUserType, String owningUserId, String tenantId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Find a page of SavedPaymentMethods for the given owner type, owner id and tenant id.
      Parameters:
      owningUserType - The type of the saved payment's owning user
      owningUserId - The id of the entity that owns this saved payment method
      tenantId - The ID of the Tenant the payments belong to.
      page - The requested page of results from the database.
      context - Context information related to multitenancy.
      Returns:
      A page of payments for the given owner type and id.
    • readAllForAccount

      org.springframework.data.domain.Page<P> readAllForAccount(String accountId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find a page of SavedPaymentMethods for the given account and its parent accounts This method is for B2B use cases where the SavedPaymentMethod.getOwningUserType() is DefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT.
      Parameters:
      accountId - The id of the entity's account\
      filters - additional filters to apply in the query.
      page - the requested page of results from the database
      contextInfo - the context info
      Returns:
      a page of payments for the given account and parent accounts
    • readByIdForAccount

      Optional<P> readByIdForAccount(String paymentId, String accountId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find a SavedPaymentMethod given its payment id, account and its parent accounts This method is for B2B use cases where the SavedPaymentMethod.getOwningUserType() is DefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT.
      Parameters:
      paymentId - The id of the payment
      accountId - The id of the entity's account
      contextInfo - the context info
      Returns:
      A payment for the given payment id, account id, and parent accounts
    • readByGatewayReferenceId

      Optional<P> readByGatewayReferenceId(String gatewayReferenceId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find a saved payment method for the specified gateway reference id.
      Parameters:
      gatewayReferenceId - the gateway reference id
      contextInfo - context information regarding sandboxing and multitenant state
      Returns:
      a list of saved payments matching the list of originating payment ids.
    • deleteSavedPaymentMethod

      void deleteSavedPaymentMethod(P savedPaymentMethod, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deletes the saved payment method.
      Parameters:
      savedPaymentMethod - the saved payment method id to delete
      contextInfo - the context info