Class DefaultSavedPaymentMethodService<P extends SavedPaymentMethod>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.paymenttransaction.service.DefaultSavedPaymentMethodService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,SavedPaymentMethodService<P>
public class DefaultSavedPaymentMethodService<P extends SavedPaymentMethod>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements SavedPaymentMethodService<P>
-
Constructor Summary
ConstructorDescriptionDefaultSavedPaymentMethodService
(SavedPaymentMethodRepository<com.broadleafcommerce.data.tracking.core.Trackable> savedPaymentMethodRepository, com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider paymentGatewayResourceProvider, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected P
buildSavedPaymentMethod
(@NonNull CreateSavedPaymentMethodRequest createRequest) Builds aSavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
.protected com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodInfo
buildSavedPaymentMethodInfo
(P savedPaymentMethod, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Builds the saved payment info that is needed to build the customer notification.createSavedPaymentMethod
(@NonNull CreateSavedPaymentMethodRequest createRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates aSavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
.protected void
deleteGatewaySavedPaymentMethod
(P savedPaymentMethod, String applicationId, String tenantId) A hook method that can be used by a gateway implementation to modify the payment method properties before deleting the saved payment method.void
deleteSavedPaymentMethod
(P savedPaymentMethod, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes the saved payment method.protected String
determineSavedPaymentMethodStatus
(@NonNull SavedPaymentMethodNextAction nextAction) protected String
getApplicationIdFromContext
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
protected PaymentCustomerNotificationService
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider
protected SavedPaymentMethodRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected String
getTenantIdFromContext
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.extension.TypeFactory
protected P
modifyPaymentMethodPropertiesForCreate
(@NonNull CreateSavedPaymentMethodRequest createRequest, P savedPayment, String tenantId, String applicationId) A hook method that can be used by a gateway implementation to modify the payment method properties before creation the saved payment method.protected P
modifyPaymentMethodPropertiesForUpdate
(P originalSavedPaymentMethod, P updatedSavedPaymentMethod, String applicationId, String tenantId) A hook method that can be used by a gateway implementation to modify the payment method properties before updating the saved payment method.protected P
populateSavedPaymentMethodUpdates
(P savedPayment, @NonNull UpdateSavedPaymentMethodRequest updateRequest) Populates the updates fromUpdateSavedPaymentMethodRequest
to the givenSavedPaymentMethod
.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 ownerType, @NonNull String ownerId, 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
(@NonNull String gatewayReferenceId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a saved payment method for the specified gateway reference id.readByIdForAccount
(String id, 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
.readSavedPaymentMethodsByContextId
(@NonNull List<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all theSavedPaymentMethods
bySavedPaymentMethod.getId()
.resetExistingDefaultPaymentFlags
(String newDefaultSavedPaymentId, @NonNull String owningUserType, @NonNull String owningUserId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves any existingSavedPaymentMethods
and setSavedPaymentMethod.isDefaultForOwner()
to false.protected void
sendCustomerNotificationIfNeeded
(P savedPaymentMethod, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends the customer notification built byPaymentGatewaySavedPaymentMethodService.buildCustomerNotification(SavedPaymentMethodInfo, String, String)
to the notification service.void
setAuthenticationUtils
(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) void
setCustomerNotificationService
(PaymentCustomerNotificationService customerNotificationService) void
setSavedPaymentMethodVersionValidationService
(SavedPaymentMethodVersionValidationService savedPaymentMethodVersionValidationService) toUpdates
(@NonNull Collection<P> savedPayments) update
(@NonNull String id, P updated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) updateSavedPaymentMethod
(@NonNull String savedPaymentMethodId, @NonNull UpdateSavedPaymentMethodRequest updateRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates theSavedPaymentMethod
based on the givenUpdateSavedPaymentMethodRequest
.protected void
updateStatusAndAction
(P savedPayment, @NonNull UpdateSavedPaymentMethodRequest updateRequest) Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
Methods inherited from interface com.broadleafcommerce.paymenttransaction.service.SavedPaymentMethodService
readByOriginatingPaymentId
-
Constructor Details
-
DefaultSavedPaymentMethodService
public DefaultSavedPaymentMethodService(SavedPaymentMethodRepository<com.broadleafcommerce.data.tracking.core.Trackable> savedPaymentMethodRepository, com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider paymentGatewayResourceProvider, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
createSavedPaymentMethod
public P createSavedPaymentMethod(@NonNull @NonNull CreateSavedPaymentMethodRequest createRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Creates aSavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
.- Specified by:
createSavedPaymentMethod
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- Parameters:
createRequest
- theCreateSavedPaymentMethodRequest
to create aSavedPaymentMethod
fromcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the newly created saved payment method
-
create
public P create(@NonNull P instance, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
create
in interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends SavedPaymentMethod>
- Overrides:
create
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends SavedPaymentMethod>
-
readAllByOwningUserTypeAndOwningUserId
public org.springframework.data.domain.Page<P> readAllByOwningUserTypeAndOwningUserId(@NonNull @NonNull String ownerType, @NonNull @NonNull String ownerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable org.springframework.data.domain.Pageable page, @Nullable cz.jirutka.rsql.parser.ast.Node filters) Description copied from interface:SavedPaymentMethodService
Finds all the activeSavedPaymentMethods
based on the givenSavedPaymentMethod.getOwningUserType()
andSavedPaymentMethod.getOwningUserId()
.- Specified by:
readAllByOwningUserTypeAndOwningUserId
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- Parameters:
ownerType
- the type of the owning userownerId
- 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
public 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) Description copied from interface:SavedPaymentMethodService
Finds all the saved payment methods available to use.- Specified by:
readAllAvailableToUseByOwningUserTypeAndOwningUserId
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- 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
public List<P> readAllByOriginatingPaymentId(@NonNull @NonNull List<String> originatingPaymentIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Find all theSavedPaymentMethods
bySavedPaymentMethod.getOriginatingPaymentId()
- Specified by:
readAllByOriginatingPaymentId
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- Parameters:
originatingPaymentIds
- the payment IDs to querySavedPaymentMethod.getOriginatingPaymentId()
againstcontextInfo
- context information regarding sandboxing and multitenant state- Returns:
- all the
SavedPaymentMethods
matching the givenSavedPaymentMethod.getOriginatingPaymentId()
-
readSavedPaymentMethodsByContextId
public List<P> readSavedPaymentMethodsByContextId(@NonNull @NonNull List<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Find all theSavedPaymentMethods
bySavedPaymentMethod.getId()
.- Specified by:
readSavedPaymentMethodsByContextId
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- 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
public P updateSavedPaymentMethod(@NonNull @NonNull String savedPaymentMethodId, @NonNull @NonNull UpdateSavedPaymentMethodRequest updateRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Updates theSavedPaymentMethod
based on the givenUpdateSavedPaymentMethodRequest
.- Specified by:
updateSavedPaymentMethod
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- Parameters:
savedPaymentMethodId
- theSavedPaymentMethod.getId()
to updateupdateRequest
- theUpdateSavedPaymentMethodRequest
containing the updatescontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the updated
SavedPaymentMethod
-
update
public P update(@NonNull @NonNull String id, @NonNull P updated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
update
in interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends SavedPaymentMethod>
- Overrides:
update
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends SavedPaymentMethod>
-
readAllByOwningUserTypeAndOwningUserIdAndTenantId
public 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) Description copied from interface:SavedPaymentMethodService
Find a page ofSavedPaymentMethods
for the given owner type, owner id and tenant id.- Specified by:
readAllByOwningUserTypeAndOwningUserIdAndTenantId
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- 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
public 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) Description copied from interface:SavedPaymentMethodService
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
.- Specified by:
readAllForAccount
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- 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
public Optional<P> readByIdForAccount(String id, String accountId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Find aSavedPaymentMethod
given its payment id, account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT
.- Specified by:
readByIdForAccount
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- Parameters:
id
- 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
public Optional<P> readByGatewayReferenceId(@NonNull @NonNull String gatewayReferenceId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Find a saved payment method for the specified gateway reference id.- Specified by:
readByGatewayReferenceId
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- 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
public void deleteSavedPaymentMethod(@NonNull P savedPaymentMethod, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SavedPaymentMethodService
Deletes the saved payment method.- Specified by:
deleteSavedPaymentMethod
in interfaceSavedPaymentMethodService<P extends SavedPaymentMethod>
- Parameters:
savedPaymentMethod
- the saved payment method id to deletecontextInfo
- the context info
-
resetExistingDefaultPaymentFlags
protected List<P> resetExistingDefaultPaymentFlags(@Nullable String newDefaultSavedPaymentId, @NonNull @NonNull String owningUserType, @NonNull @NonNull String owningUserId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves any existingSavedPaymentMethods
and setSavedPaymentMethod.isDefaultForOwner()
to false.This is typically used when creating or updating a
SavedPaymentMethod
to be the default payment method.- Parameters:
newDefaultSavedPaymentId
- the id of the new defaultSavedPaymentMethod
. Should be null if the new defaultSavedPaymentMethod
has not yet been createdowningUserType
- theSavedPaymentMethod.getOwningUserType()
to identify the payments withowningUserId
- theSavedPaymentMethod.getOwningUserId()
to identify the payments withcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- a list of updated
SavedPaymentMethods
-
toUpdates
protected List<com.broadleafcommerce.data.tracking.core.service.Update<P>> toUpdates(@NonNull @NonNull Collection<P> savedPayments) -
buildSavedPaymentMethod
protected P buildSavedPaymentMethod(@NonNull @NonNull CreateSavedPaymentMethodRequest createRequest) Builds aSavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
.- Parameters:
createRequest
- theCreateSavedPaymentMethodRequest
to build theSavedPaymentMethod
from- Returns:
- a built
SavedPaymentMethod
from the givenCreateSavedPaymentMethodRequest
-
getApplicationIdFromContext
@Nullable protected String getApplicationIdFromContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getTenantIdFromContext
@Nullable protected String getTenantIdFromContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
modifyPaymentMethodPropertiesForCreate
protected P modifyPaymentMethodPropertiesForCreate(@NonNull @NonNull CreateSavedPaymentMethodRequest createRequest, @NonNull P savedPayment, @Nullable String tenantId, @Nullable String applicationId) A hook method that can be used by a gateway implementation to modify the payment method properties before creation the saved payment method. For example, this can be used to create a multi-use token for future use to execute transactions.- Parameters:
createRequest
- theCreateSavedPaymentMethodRequest
to get a single-use tokensavedPayment
- aSavedPaymentMethod
tenantId
- the id for the current tenantapplicationId
- the id for the current application- Returns:
- the saved payment method with updated payment method properties
-
modifyPaymentMethodPropertiesForUpdate
protected P modifyPaymentMethodPropertiesForUpdate(@NonNull P originalSavedPaymentMethod, @NonNull P updatedSavedPaymentMethod, @Nullable String applicationId, @Nullable String tenantId) A hook method that can be used by a gateway implementation to modify the payment method properties before updating the saved payment method. For example, this can be used to update a multi-use token for future use to execute transactions.- Parameters:
originalSavedPaymentMethod
- aSavedPaymentMethod
updatedSavedPaymentMethod
- theUpdateSavedPaymentMethodRequest
applicationId
- the id for the current applicationtenantId
- the id for the current tenant- Returns:
-
deleteGatewaySavedPaymentMethod
protected void deleteGatewaySavedPaymentMethod(@NonNull P savedPaymentMethod, @Nullable String applicationId, @Nullable String tenantId) A hook method that can be used by a gateway implementation to modify the payment method properties before deleting the saved payment method. For example, this can be used to delete a multi-use token.- Parameters:
savedPaymentMethod
- aSavedPaymentMethod
applicationId
- the id for the current applicationtenantId
- the id for the current tenant
-
populateSavedPaymentMethodUpdates
protected P populateSavedPaymentMethodUpdates(@NonNull P savedPayment, @NonNull @NonNull UpdateSavedPaymentMethodRequest updateRequest) Populates the updates fromUpdateSavedPaymentMethodRequest
to the givenSavedPaymentMethod
.- Parameters:
savedPayment
- theSavedPaymentMethod
to updateupdateRequest
- theUpdateSavedPaymentMethodRequest
containing all theSavedPaymentMethod
updates- Returns:
- the update
SavedPaymentMethod
based on the givenUpdateSavedPaymentMethodRequest
-
updateStatusAndAction
protected void updateStatusAndAction(@NonNull P savedPayment, @NonNull @NonNull UpdateSavedPaymentMethodRequest updateRequest) -
determineSavedPaymentMethodStatus
@Nullable protected String determineSavedPaymentMethodStatus(@NonNull @NonNull SavedPaymentMethodNextAction nextAction) -
sendCustomerNotificationIfNeeded
protected void sendCustomerNotificationIfNeeded(@NonNull P savedPaymentMethod, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends the customer notification built byPaymentGatewaySavedPaymentMethodService.buildCustomerNotification(SavedPaymentMethodInfo, String, String)
to the notification service.- Parameters:
savedPaymentMethod
- the saved payment methodcontextInfo
- context information around sandbox and multitenant state
-
buildSavedPaymentMethodInfo
protected com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodInfo buildSavedPaymentMethodInfo(@NonNull P savedPaymentMethod, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Builds the saved payment info that is needed to build the customer notification.- Parameters:
savedPaymentMethod
- the saved payment methodcontextInfo
- context information around sandbox and multitenant state- Returns:
- the saved payment method info
-
getSavedPaymentMethodRepository
protected SavedPaymentMethodRepository<com.broadleafcommerce.data.tracking.core.Trackable> getSavedPaymentMethodRepository() -
getPaymentGatewayResourceProvider
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider getPaymentGatewayResourceProvider() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getAuthenticationUtils
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils() -
setAuthenticationUtils
@Autowired public void setAuthenticationUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) -
getSavedPaymentMethodVersionValidationService
protected SavedPaymentMethodVersionValidationService getSavedPaymentMethodVersionValidationService() -
setSavedPaymentMethodVersionValidationService
@Autowired public void setSavedPaymentMethodVersionValidationService(SavedPaymentMethodVersionValidationService savedPaymentMethodVersionValidationService) -
getCustomerNotificationService
-
setCustomerNotificationService
@Autowired public void setCustomerNotificationService(PaymentCustomerNotificationService customerNotificationService)
-