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 Summary
Modifier and TypeMethodDescriptioncreateSavedPaymentMethod
(@NonNull CreateSavedPaymentMethodRequest savedPaymentRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates aSavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
.void
deleteSavedPaymentMethod
(P savedPaymentMethod, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes the saved payment method.org.springframework.data.domain.Page<P>
readAllAvailableToUseByOwningUserTypeAndOwningUserId
(@NonNull String owningUserType, @NonNull String owningUserId, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all the saved payment methods available to use.readAllByOriginatingPaymentId
(@NonNull List<String> originatingPaymentIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all theSavedPaymentMethods
bySavedPaymentMethod.getOriginatingPaymentId()
org.springframework.data.domain.Page<P>
readAllByOwningUserTypeAndOwningUserId
(@NonNull String owningUserType, @NonNull String owningUserId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters) Finds all the activeSavedPaymentMethods
based on the givenSavedPaymentMethod.getOwningUserType()
andSavedPaymentMethod.getOwningUserId()
.org.springframework.data.domain.Page<P>
readAllByOwningUserTypeAndOwningUserIdAndTenantId
(String owningUserType, String owningUserId, String tenantId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find a page ofSavedPaymentMethods
for the given owner type, owner id and tenant id.org.springframework.data.domain.Page<P>
readAllForAccount
(String accountId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a page ofSavedPaymentMethods
for the given account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT
.readByGatewayReferenceId
(String gatewayReferenceId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a saved payment method for the specified gateway reference id.readByIdForAccount
(String paymentId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find aSavedPaymentMethod
given its payment id, account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT
.default P
readByOriginatingPaymentId
(@NonNull String originatingPaymentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) readSavedPaymentMethodsByContextId
(@NonNull List<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all theSavedPaymentMethods
bySavedPaymentMethod.getId()
.updateSavedPaymentMethod
(@NonNull String savedPaymentMethodId, @NonNull UpdateSavedPaymentMethodRequest updateRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates theSavedPaymentMethod
based on the givenUpdateSavedPaymentMethodRequest
.Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Method Details
-
createSavedPaymentMethod
P createSavedPaymentMethod(@NonNull @NonNull CreateSavedPaymentMethodRequest savedPaymentRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates aSavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
.- Parameters:
savedPaymentRequest
- theCreateSavedPaymentMethodRequest
to create aSavedPaymentMethod
fromcontextInfo
- 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) Finds all the activeSavedPaymentMethods
based on the givenSavedPaymentMethod.getOwningUserType()
andSavedPaymentMethod.getOwningUserId()
.- Parameters:
owningUserType
- the type of the owning userowningUserId
- the ID of the owning usercontextInfo
- context information surrounding sandboxing and multitenant statepage
- the requested page of results from the databasefilters
- An RSQL filter used to narrow query results. May beEmptyNode
if no filters should be applied- Returns:
- the
SavedPaymentMethods
based on the givenSavedPaymentMethod.getOwningUserType()
andSavedPaymentMethod.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 userowningUserId
- the ID of the owning userpage
- the requested page of results from the databasefilters
- An RSQL filter used to narrow query results. May beEmptyNode
if no filters should be appliedcontextInfo
- 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) Find all theSavedPaymentMethods
bySavedPaymentMethod.getOriginatingPaymentId()
- Parameters:
originatingPaymentIds
- the payment IDs to querySavedPaymentMethod.getOriginatingPaymentId()
againstcontextInfo
- context information regarding sandboxing and multitenant state- Returns:
- all the
SavedPaymentMethods
matching the givenSavedPaymentMethod.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 querySavedPaymentMethod.getOriginatingPaymentId()
againstcontextInfo
- context information regarding sandboxing and multitenant state- Returns:
- the
SavedPaymentMethod
matching the givenSavedPaymentMethod.getOriginatingPaymentId()
-
readSavedPaymentMethodsByContextId
List<P> readSavedPaymentMethodsByContextId(@NonNull @NonNull List<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all theSavedPaymentMethods
bySavedPaymentMethod.getId()
.- Parameters:
ids
- the saved payment method IDs to querycontextInfo
- 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 theSavedPaymentMethod
based on the givenUpdateSavedPaymentMethodRequest
.- Parameters:
savedPaymentMethodId
- theSavedPaymentMethod.getId()
to updateupdateRequest
- theUpdateSavedPaymentMethodRequest
containing the updatescontextInfo
- 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 ofSavedPaymentMethods
for the given owner type, owner id and tenant id.- Parameters:
owningUserType
- The type of the saved payment's owning userowningUserId
- The id of the entity that owns this saved payment methodtenantId
- The ID of theTenant
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 ofSavedPaymentMethods
for the given account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.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 databasecontextInfo
- 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 aSavedPaymentMethod
given its payment id, account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT
.- Parameters:
paymentId
- The id of the paymentaccountId
- The id of the entity's accountcontextInfo
- 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 idcontextInfo
- 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 deletecontextInfo
- the context info
-