Class JpaCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
java.lang.Object
com.broadleafcommerce.paymenttransaction.provider.jpa.repository.JpaCustomizedPaymentTransactionRepository<D>
- All Implemented Interfaces:
CustomizedPaymentTransactionRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
extends Object
implements CustomizedPaymentTransactionRepository<D>, org.springframework.beans.factory.InitializingBean
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJpaCustomizedPaymentTransactionRepository
(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager typeManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
org.springframework.data.domain.Page<D>
findAllByDateRecordedBeforeAndManagementStateIsNotIn
(@NonNull Instant date, @NonNull List<String> transactionManagementStates, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the transactions recorded before the the specified time, excluding those with the specified management statesfindByContextIdAndTenantId
(String contextId, String tenantId) Finds the payment transaction by the context id and tenant id, ignoring other context filtering like archival status.findByGatewayTransactionIdAndTenantId
(String gatewayTransactionId, String tenantId) Finds the payment transaction by the gateway transaction id and tenant id, ignoring other context filtering like archival status.findByTransactionReferenceIdAndTenantId
(String transactionReferenceId, String tenantId) Finds the payment transaction by the transaction reference id and tenant id, ignoring other context filtering like archival status.org.springframework.data.domain.Page<D>
findTransactionsToReverse
(Duration reversalCandidateTtl, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the payment transactions that are eligible for reverse.protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected PaymentTransactionRepository<D>
void
setRepository
(PaymentTransactionRepository<D> repository)
-
Field Details
-
DATE_RECORDED_FLD
- See Also:
-
MANAGEMENT_STATE_FLD
- See Also:
-
REVERSAL_CANDIDATE_TTL_CREATE
- See Also:
-
REVERSAL_CANDIDATE_TTL_UPDATE
- See Also:
-
-
Constructor Details
-
JpaCustomizedPaymentTransactionRepository
public JpaCustomizedPaymentTransactionRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager typeManager)
-
-
Method Details
-
findAllByDateRecordedBeforeAndManagementStateIsNotIn
public org.springframework.data.domain.Page<D> findAllByDateRecordedBeforeAndManagementStateIsNotIn(@NonNull @NonNull Instant date, @NonNull @NonNull List<String> transactionManagementStates, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizedPaymentTransactionRepository
Returns the transactions recorded before the the specified time, excluding those with the specified management states- Specified by:
findAllByDateRecordedBeforeAndManagementStateIsNotIn
in interfaceCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
- Parameters:
date
- the date until which the transaction was recordedtransactionManagementStates
- the excluded management states for the transactionspageable
- The requested page of results from the database.context
- Request context information around sandbox and multitenant state- Returns:
- the transactions excluding those with the specified management states
-
findTransactionsToReverse
public org.springframework.data.domain.Page<D> findTransactionsToReverse(Duration reversalCandidateTtl, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizedPaymentTransactionRepository
Returns the payment transactions that are eligible for reverse. By default this method returns the transaction withDefaultTransactionStatuses.SUCCESS
status,DefaultTransactionManagementStates.REVERSAL_CANDIDATE
management state and that have not been updated within a specified duration.If the transaction management state is
DefaultTransactionManagementStates.REQUIRES_REVERSAL
the update time is not considered.- Specified by:
findTransactionsToReverse
in interfaceCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
- Parameters:
reversalCandidateTtl
- the amount of time the payment transactions have not been updated and can be reversedpage
- The requested page of results from the databasecontext
- context information related to multitenancy- Returns:
- the payment transactions that are eligible for reversal
- See Also:
-
findByTransactionReferenceIdAndTenantId
public Optional<D> findByTransactionReferenceIdAndTenantId(String transactionReferenceId, String tenantId) Description copied from interface:CustomizedPaymentTransactionRepository
Finds the payment transaction by the transaction reference id and tenant id, ignoring other context filtering like archival status.- Specified by:
findByTransactionReferenceIdAndTenantId
in interfaceCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
- Parameters:
transactionReferenceId
- the transaction id known by the payment gatewaytenantId
- the tenant context of this payment transaction- Returns:
- the transaction if found
-
findByGatewayTransactionIdAndTenantId
public Optional<D> findByGatewayTransactionIdAndTenantId(String gatewayTransactionId, String tenantId) Description copied from interface:CustomizedPaymentTransactionRepository
Finds the payment transaction by the gateway transaction id and tenant id, ignoring other context filtering like archival status.- Specified by:
findByGatewayTransactionIdAndTenantId
in interfaceCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
- Parameters:
gatewayTransactionId
- The id of the payment gateway's transaction representationtenantId
- the tenant context of this payment transaction- Returns:
- the transaction if found
-
findByContextIdAndTenantId
Description copied from interface:CustomizedPaymentTransactionRepository
Finds the payment transaction by the context id and tenant id, ignoring other context filtering like archival status.- Specified by:
findByContextIdAndTenantId
in interfaceCustomizedPaymentTransactionRepository<D extends JpaPaymentTransaction>
- Parameters:
contextId
- The context id of the payment transactiontenantId
- the tenant context of this payment transaction- Returns:
- the transaction if found
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setRepository
-
getRepository
-
getNarrowingHelper
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper()
-