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
ConstructorDescriptionDefaultPaymentService
(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
.void
delete
(@NonNull String id, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Perform a delete operation on thePayment
identified by the context id.protected com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper
protected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager
protected PaymentLockService<P>
protected PaymentRepository<com.broadleafcommerce.data.tracking.core.Trackable>
readAllByContextId
(@NonNull Iterable<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieve allPayments
based 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 aPayment
instance
-
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:PaymentService
Create an instance of aPayment
.- Specified by:
create
in interfacePaymentService<P extends Payment>
- Parameters:
payment
- ThePayment
instance.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:PaymentService
Read a single instance of aPayment
.- Specified by:
readByContextId
in 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:PaymentService
Retrieve allPayments
based on a list of context ids.- Specified by:
readAllByContextId
in 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:PaymentService
Find a page of payments for the given owner type and owner id.- Specified by:
readAllByCustomerIdAndTenantId
in interfacePaymentService<P extends Payment>
- Parameters:
customerId
- TheCustomerRef.getCustomerId()
of thePayment
tenantId
- 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.
-
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:PaymentService
Find a page of payments for the given owner type and owner id.- Specified by:
readAllByOwnerTypeAndOwnerId
in 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:PaymentService
Update aPayment
instance- Specified by:
update
in interfacePaymentService<P extends Payment>
- Parameters:
id
- The context id for thePayment
.payment
- ThePayment
payload 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:PaymentService
Perform a delete operation on thePayment
identified 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:
delete
in 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:PaymentService
Finds the payment by the context id and tenant id, ignoring other context filtering like archival status.- Specified by:
readByContextIdAndTenantId
in 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
-