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
ConstructorsConstructorDescriptionDefaultThreeDSTransactionResultService(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 TransactionExecutionResponsebuildThreeDSTransactionNotFoundResponse(@NonNull PaymentTransaction transactionRequiring3DS, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected com.broadleafcommerce.paymentgateway.domain.TransactionLookupRequestbuildTransactionLookupRequest(@NonNull Payment payment, @NonNull PaymentTransaction paymentTransaction, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected PaymentgetPayment(@NonNull PaymentTransaction transactionRequiring3DS, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProviderprotected PaymentLockService<Payment>protected PaymentService<Payment>protected PaymentTransactionService<PaymentTransaction>protected TransactionExecutionServiceprotected TransactionExecutionUtilprotected com.broadleafcommerce.common.extension.TypeFactoryhandleTransactionResult(@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 PaymentTransactionidentify3DSTransaction(@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 TransactionExecutionResponserecord3DSTransactionResults(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull Payment payment, @NonNull PaymentTransaction transactionRequiring3DS, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected voidvalidateTransactionResults(@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:ThreeDSTransactionResultServiceReads 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:
lookupAndRecord3DSTransactionResultin interfaceThreeDSTransactionResultService- Parameters:
payment- the payment gateway type that is used to identify the appropriatePaymentGateway3DSTransactionLookupServicetransactionRequiring3DS- the transaction that requires 3DS resultslockToken- Token granted to resource that owns the payment lock.context- context information related to multitenancy- Returns:
- the
TransactionExecutionResponsedescribing 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:ThreeDSTransactionResultServiceReads 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:
handleTransactionResultin interfaceThreeDSTransactionResultService- Parameters:
gatewayType- the payment gateway type that is used to identify the appropriatePaymentGateway3DSTransactionLookupServicerequestParams- the parameters for requestcontext- context information related to multitenancy- Returns:
- the
TransactionExecutionDetaildescribing 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:ThreeDSTransactionResultServiceFinds the transaction that required 3DS results.- Specified by:
identifyTransactionRequiring3DSVerificationin 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) -
buildThreeDSTransactionNotFoundResponse
protected TransactionExecutionResponse buildThreeDSTransactionNotFoundResponse(@NonNull @NonNull PaymentTransaction transactionRequiring3DS, @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()
-