Interface ExternalTransactionResultService
- All Known Implementing Classes:
DefaultExternalTransactionResultService
public interface ExternalTransactionResultService
The service to check the external payment transaction result.
- Author:
- Sgupta
-
Method Summary
Modifier and TypeMethodDescriptionhandleTransactionResult(@NonNull String gatewayType, @NonNull Map<String, String> requestParams, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads the transaction result usingPaymentGatewayTransactionLookupService, records the result to the appropriate transaction and payment.identifyTransactionRequiringExternalInteraction(@NonNull Payment payment, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds the transaction that required external results.lookupAndRecordExternalTransactionResult(@NonNull Payment payment, @NonNull PaymentTransaction transactionRequiringExternal, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads the transaction result usingPaymentGatewayTransactionLookupService, records the result to the appropriate transaction and payment.validatePaymentCallbackToken(org.springframework.data.domain.Page<Payment> payments, PaymentCallbackValidationRequest validationRequest, PaymentLockTokens paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates thecallback requestand returns the result of that validation.
-
Method Details
-
identifyTransactionRequiringExternalInteraction
PaymentTransaction identifyTransactionRequiringExternalInteraction(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds the transaction that required external results.- Parameters:
payment- the payment object that contains a reference to the required transactioncontext- context information related to multitenancy- Returns:
- the transaction that required external results
- Throws:
TransactionIdentificationException- if a transaction requiring external interaction cannot be found
-
lookupAndRecordExternalTransactionResult
TransactionExecutionResponse lookupAndRecordExternalTransactionResult(@NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction transactionRequiringExternal, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads the transaction result usingPaymentGatewayTransactionLookupService, records the result to the appropriate transaction and payment.This can be used, for example, to verify that a customer has approved a payment for transactions that requires to add bank details.
- Parameters:
payment- the payment gateway type that is used to identify the appropriatePaymentGatewayTransactionLookupServicetransactionRequiringExternal- the transaction that requires external resultslockToken- Token granted to resource that owns the payment lock.context- context information related to multitenancy- Returns:
- the
TransactionExecutionResponsedescribing the resulting transaction andPaymentSummary - Throws:
UnsupportedOperationException- when looking up transaction results is not supported for the related payment gatewaycom.broadleafcommerce.paymentgateway.service.exception.InvalidGatewayConfigurationException- when the integration is not sufficiently configured to look up transaction resultscom.broadleafcommerce.paymentgateway.service.exception.InvalidFetchPaymentDetailsParamsException- when insufficient data is provided to look up transaction resultscom.broadleafcommerce.paymentgateway.service.exception.FetchTransactionResultsException- when an error occurred while looking up transaction resultscom.broadleafcommerce.paymentgateway.service.exception.TransactionNotFoundException- when a transaction cannot be found, based on the provided datacom.broadleafcommerce.paymentgateway.service.exception.TransactionResultsNotAvailableException- when the external transaction results are not yet availablecom.broadleafcommerce.common.messaging.exception.ResourceLockException- when a payment lock cannot be obtained to record 3DS transaction results
-
validatePaymentCallbackToken
PaymentCallbackValidationResponse validatePaymentCallbackToken(org.springframework.data.domain.Page<Payment> payments, PaymentCallbackValidationRequest validationRequest, @Nullable PaymentLockTokens paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates thecallback requestand returns the result of that validation.- Parameters:
payments- the page of payments for the requestvalidationRequest- thecallback validation requestpaymentLockTokens- thePaymentLockTokens, if anycontextInfo- context information related to multitenancy.- Returns:
the payment callback validation response
-
handleTransactionResult
TransactionExecutionResponse handleTransactionResult(@NonNull @NonNull String gatewayType, @NonNull @NonNull Map<String, String> requestParams, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads the transaction result usingPaymentGatewayTransactionLookupService, records the result to the appropriate transaction and payment.This can be used, for example, to verify that a customer has approved a payment for transactions that require to add bank details.
- Parameters:
gatewayType- the payment gateway type that is used to identify the appropriatePaymentGatewayTransactionLookupServicerequestParams- the parameters for requestcontext- context information related to multitenancy- Returns:
- the
TransactionExecutionDetaildescribing the resulting transaction andPaymentSummary - Throws:
UnsupportedOperationException- when looking up transaction results is not supported for the related payment gatewaycom.broadleafcommerce.paymentgateway.service.exception.InvalidGatewayConfigurationException- when the integration is not sufficiently configured to look up transaction resultscom.broadleafcommerce.paymentgateway.service.exception.InvalidFetchPaymentDetailsParamsException- when insufficient data is provided to look up transaction resultscom.broadleafcommerce.paymentgateway.service.exception.FetchTransactionResultsException- when an error occurred while looking up transaction resultscom.broadleafcommerce.paymentgateway.service.exception.TransactionNotFoundException- when a transaction cannot be found, based on the provided datacom.broadleafcommerce.paymentgateway.service.exception.TransactionResultsNotAvailableException- when the external transaction results are not yet availablecom.broadleafcommerce.common.messaging.exception.ResourceLockException- when a payment lock cannot be obtained to record external transaction results
-