Class DefaultPaymentService<P extends Payment>
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.DefaultPaymentService<P>
- All Implemented Interfaces:
PaymentService<P>
- Author:
- Chris Kittrell (ckittrell)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPaymentService(PaymentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapper, PaymentLockService<P> paymentLockService) -
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of aPayment.voiddelete(@NonNull String id, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Perform a delete operation on thePaymentidentified by the context id.protected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelperprotected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManagerprotected PaymentLockService<P>protected PaymentRepository<com.broadleafcommerce.data.tracking.core.Trackable>readAllByContextId(@NonNull Iterable<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieve allPaymentsbased on a list of context ids.org.springframework.data.domain.Page<P>readAllByCustomerIdAndTenantId(String customerId, String tenantId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find a page of payments for the given owner type and owner id.org.springframework.data.domain.Page<P>readAllByOwnerTypeAndOwnerId(@NonNull String ownerType, @NonNull String ownerId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Find a page of payments for the given owner type and owner id.readByContextId(@NonNull String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read a single instance of aPayment.readByContextIdAndTenantId(@NonNull String id, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds the payment by the context id and tenant id, ignoring other context filtering like archival status.update(@NonNull String id, P payment, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Update aPaymentinstance
-
Constructor Details
-
DefaultPaymentService
public DefaultPaymentService(PaymentRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapper, PaymentLockService<P> paymentLockService)
-
-
Method Details
-
create
public P create(@NonNull P payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceCreate an instance of aPayment.- Specified by:
createin interfacePaymentService<P extends Payment>- Parameters:
payment- ThePaymentinstance.context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.- Returns:
- The new entity instance in the form of a business type instance.
-
readByContextId
public P readByContextId(@NonNull @NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceRead a single instance of aPayment.- Specified by:
readByContextIdin interfacePaymentService<P extends Payment>- Parameters:
id- The context id for thePayment.context- Context information used to discriminate the correct version of an entity by context id when multiple versions may be available across sandboxes, catalogs and applications.- Returns:
- The narrowed entity instance in the form of a business instance
-
readAllByContextId
public Iterable<P> readAllByContextId(@NonNull @NonNull Iterable<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceRetrieve allPaymentsbased on a list of context ids.- Specified by:
readAllByContextIdin interfacePaymentService<P extends Payment>- Parameters:
ids- A list of context ids for the entities. This is the id by which the business recognizes the item.context- Context information used to discriminate the correct version of an entity by context id when multiple versions may be available across sandboxes, catalogs and applications.- Returns:
- The narrowed iterable collection of data in the form of business instances
-
readAllByCustomerIdAndTenantId
public org.springframework.data.domain.Page<P> readAllByCustomerIdAndTenantId(String customerId, String tenantId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceFind a page of payments for the given owner type and owner id.- Specified by:
readAllByCustomerIdAndTenantIdin interfacePaymentService<P extends Payment>- Parameters:
customerId- TheCustomerRef.getCustomerId()of thePaymenttenantId- 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.
-
readAllByOwnerTypeAndOwnerId
public org.springframework.data.domain.Page<P> readAllByOwnerTypeAndOwnerId(@NonNull @NonNull String ownerType, @NonNull @NonNull String ownerId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceFind a page of payments for the given owner type and owner id.- Specified by:
readAllByOwnerTypeAndOwnerIdin interfacePaymentService<P extends Payment>- Parameters:
ownerType- The type of the payment's owner.ownerId- The id of the payment's owner.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.
-
update
public P update(@NonNull @NonNull String id, @NonNull P payment, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceUpdate aPaymentinstance- Specified by:
updatein interfacePaymentService<P extends Payment>- Parameters:
id- The context id for thePayment.payment- ThePaymentpayload used to update the existing entity.lockToken- Token granted to resource that owns the payment lock.context- Context information used to discriminate the correct version of an entity by context id when multiple versions may be available across sandboxes, catalogs and applications.- Returns:
- The updated
Payment
-
delete
public void delete(@NonNull @NonNull String id, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServicePerform a delete operation on thePaymentidentified by the context id. This could result in an archival, or a raw delete, depending on the result of processing throughDomainMapper.deleteMap(Object, ContextInfo).- Specified by:
deletein interfacePaymentService<P extends Payment>- Parameters:
id- The context id for thePayment. This is the id by which the business recognizes the item.lockToken- Token granted to resource that owns the payment lock.context- Context information used to discriminate the correct version of an entity by context id when multiple versions may be available across sandboxes, catalogs and applications.
-
readByContextIdAndTenantId
public P readByContextIdAndTenantId(@NonNull @NonNull String id, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:PaymentServiceFinds the payment by the context id and tenant id, ignoring other context filtering like archival status.- Specified by:
readByContextIdAndTenantIdin interfacePaymentService<P extends Payment>- Parameters:
id- The context id of the paymentcontext- Context information related to multitenancy.- Returns:
- the transaction if found
-
getRepository
-
getHelper
protected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper getHelper() -
getMapper
protected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager getMapper() -
getPaymentLockService
-