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 aSavedPaymentMethodfrom the givenCreateSavedPaymentMethodRequest.voiddeleteSavedPaymentMethod(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 theSavedPaymentMethodsbySavedPaymentMethod.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 activeSavedPaymentMethodsbased 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 ofSavedPaymentMethodsfor 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 ofSavedPaymentMethodsfor 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 aSavedPaymentMethodgiven its payment id, account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT.default PreadByOriginatingPaymentId(@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 theSavedPaymentMethodsbySavedPaymentMethod.getId().updateSavedPaymentMethod(@NonNull String savedPaymentMethodId, @NonNull UpdateSavedPaymentMethodRequest updateRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates theSavedPaymentMethodbased 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, updateSortMethods 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 aSavedPaymentMethodfrom the givenCreateSavedPaymentMethodRequest.- Parameters:
savedPaymentRequest- theCreateSavedPaymentMethodRequestto create aSavedPaymentMethodfromcontextInfo- 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 activeSavedPaymentMethodsbased 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 beEmptyNodeif no filters should be applied- Returns:
- the
SavedPaymentMethodsbased 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 beEmptyNodeif 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 theSavedPaymentMethodsbySavedPaymentMethod.getOriginatingPaymentId()- Parameters:
originatingPaymentIds- the payment IDs to querySavedPaymentMethod.getOriginatingPaymentId()againstcontextInfo- context information regarding sandboxing and multitenant state- Returns:
- all the
SavedPaymentMethodsmatching 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
SavedPaymentMethodmatching the givenSavedPaymentMethod.getOriginatingPaymentId()
-
readSavedPaymentMethodsByContextId
List<P> readSavedPaymentMethodsByContextId(@NonNull @NonNull List<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all theSavedPaymentMethodsbySavedPaymentMethod.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 theSavedPaymentMethodbased on the givenUpdateSavedPaymentMethodRequest.- Parameters:
savedPaymentMethodId- theSavedPaymentMethod.getId()to updateupdateRequest- theUpdateSavedPaymentMethodRequestcontaining 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 ofSavedPaymentMethodsfor 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 theTenantthe 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 ofSavedPaymentMethodsfor 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 aSavedPaymentMethodgiven 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
-