Class DefaultThreeDSTransactionResultService
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.DefaultThreeDSTransactionResultService
- All Implemented Interfaces:
ThreeDSTransactionResultService
public class DefaultThreeDSTransactionResultService
extends Object
implements ThreeDSTransactionResultService
The default implementation for
ThreeDSTransactionResultService
.- Author:
- Dima Myroniuk (dmyroniuk)
-
Constructor Summary
ConstructorDescriptionDefaultThreeDSTransactionResultService
(com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider paymentGatewayResourceProvider, PaymentTransactionService<PaymentTransaction> paymentTransactionService, PaymentService<Payment> paymentService, PaymentLockService<Payment> paymentLockService, TransactionExecutionUtil transactionExecutionUtil, TransactionExecutionService transactionExecutionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.paymentgateway.domain.TransactionLookupRequest
buildTransactionLookupRequest
(@NonNull Payment payment, @NonNull PaymentTransaction paymentTransaction, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected Payment
getPayment
(@NonNull PaymentTransaction transactionRequiring3DS, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider
protected PaymentLockService<Payment>
protected PaymentService<Payment>
protected PaymentTransactionService<PaymentTransaction>
protected TransactionExecutionService
protected TransactionExecutionUtil
protected TransactionResultService
protected com.broadleafcommerce.common.extension.TypeFactory
handleTransactionResult
(@NonNull String gatewayType, @NonNull Map<String, String> requestParams, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads the transaction result usingPaymentGateway3DSTransactionLookupService
, records the result to the appropriate transaction and payment.protected PaymentTransaction
identify3DSTransaction
(@NonNull com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier transactionIdentifier, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected Optional<PaymentTransaction>
identifyChildTransaction
(@NonNull Payment payment, @NonNull PaymentTransaction transactionRequiring3DS) identifyTransactionRequiring3DSVerification
(@NonNull Payment payment, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds the transaction that required 3DS results.lookupAndRecord3DSTransactionResult
(@NonNull Payment payment, @NonNull PaymentTransaction transactionRequiring3DS, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads the transaction result usingPaymentGateway3DSTransactionLookupService
, records the result to the appropriate transaction and payment.protected TransactionExecutionResponse
record3DSTransactionResults
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull Payment payment, @NonNull PaymentTransaction transactionRequiring3DS, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
setTransactionResultService
(TransactionResultService transactionResultService) protected void
validateTransactionResults
(@NonNull TransactionExecutionResponse transactionResponse, @NonNull PaymentTransaction transactionRequiring3DS, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
DefaultThreeDSTransactionResultService
public DefaultThreeDSTransactionResultService(com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider paymentGatewayResourceProvider, PaymentTransactionService<PaymentTransaction> paymentTransactionService, PaymentService<Payment> paymentService, PaymentLockService<Payment> paymentLockService, TransactionExecutionUtil transactionExecutionUtil, TransactionExecutionService transactionExecutionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
lookupAndRecord3DSTransactionResult
public TransactionExecutionResponse lookupAndRecord3DSTransactionResult(@NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction transactionRequiring3DS, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ThreeDSTransactionResultService
Reads the transaction result usingPaymentGateway3DSTransactionLookupService
, 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 3D security checks.
- Specified by:
lookupAndRecord3DSTransactionResult
in interfaceThreeDSTransactionResultService
- Parameters:
payment
- the payment gateway type that is used to identify the appropriatePaymentGateway3DSTransactionLookupService
transactionRequiring3DS
- the transaction that requires 3DS resultslockToken
- Token granted to resource that owns the payment lock.context
- context information related to multitenancy- Returns:
- the
TransactionExecutionResponse
describing the resulting transaction andPaymentSummary
-
handleTransactionResult
public TransactionExecutionResponse handleTransactionResult(@NonNull @NonNull String gatewayType, @NonNull @NonNull Map<String, String> requestParams, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ThreeDSTransactionResultService
Reads the transaction result usingPaymentGateway3DSTransactionLookupService
, 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 3D security checks.
- Specified by:
handleTransactionResult
in interfaceThreeDSTransactionResultService
- Parameters:
gatewayType
- the payment gateway type that is used to identify the appropriatePaymentGateway3DSTransactionLookupService
requestParams
- the parameters for requestcontext
- context information related to multitenancy- Returns:
- the
TransactionExecutionDetail
describing the resulting transaction andPaymentSummary
-
identifyTransactionRequiring3DSVerification
public PaymentTransaction identifyTransactionRequiring3DSVerification(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ThreeDSTransactionResultService
Finds the transaction that required 3DS results.- Specified by:
identifyTransactionRequiring3DSVerification
in interfaceThreeDSTransactionResultService
- Parameters:
payment
- the payment object that contains a reference to the required transactioncontext
- context information related to multitenancy- Returns:
- the transaction that required 3DS results
-
record3DSTransactionResults
protected TransactionExecutionResponse record3DSTransactionResults(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction transactionRequiring3DS, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
identify3DSTransaction
protected PaymentTransaction identify3DSTransaction(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.TransactionIdentifier transactionIdentifier, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getPayment
protected Payment getPayment(@NonNull @NonNull PaymentTransaction transactionRequiring3DS, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
identifyChildTransaction
protected Optional<PaymentTransaction> identifyChildTransaction(@NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction transactionRequiring3DS) -
buildTransactionLookupRequest
protected com.broadleafcommerce.paymentgateway.domain.TransactionLookupRequest buildTransactionLookupRequest(@NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction paymentTransaction, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateTransactionResults
protected void validateTransactionResults(@NonNull @NonNull TransactionExecutionResponse transactionResponse, @NonNull @NonNull PaymentTransaction transactionRequiring3DS, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getPaymentGatewayResourceProvider
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider getPaymentGatewayResourceProvider() -
getPaymentTransactionService
-
getPaymentService
-
getPaymentLockService
-
getTransactionExecutionUtil
-
getTransactionExecutionService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getTransactionResultService
-
setTransactionResultService
@Autowired public void setTransactionResultService(TransactionResultService transactionResultService)
-