Class ExternalPaymentTransactionExecutionProvider
java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.cartoperation.service.provider.external.payments.ExternalPaymentTransactionExecutionProvider
- All Implemented Interfaces:
PaymentTransactionExecutionProvider
public class ExternalPaymentTransactionExecutionProvider
extends AbstractExternalProvider
implements PaymentTransactionExecutionProvider
- Author:
- Chris Kittrell (ckittrell)
-
Field Summary
FieldsFields inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND -
Constructor Summary
ConstructorsConstructorDescriptionExternalPaymentTransactionExecutionProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalPaymentProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionauthorizeAndCapturePayment(@NonNull String paymentId, @NonNull Integer paymentVersion, @NonNull TransactionExecutionRequest request, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) authorizePayment(@NonNull String paymentId, @NonNull Integer paymentVersion, @NonNull TransactionExecutionRequest request, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected org.springframework.web.util.UriComponentsBuilderGets the base URI common to all requests this provider will make.protected StringhandleExternalTransactionResult(@NonNull String gatewayType, @NonNull Map<String, Object> request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Looks up external payment transaction results & records them to the relevant transaction.lookup3DSTransactionResult(@NonNull String paymentId, @NonNull String requestId, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Looks up the 3DS transaction results from the gateway.lookupExternalTransactionResult(@NonNull String paymentId, @NonNull String requestId, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Looks up the external transaction results from the gateway.validatePaymentCallbackToken(@NonNull PaymentCallbackValidationRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates the payment callback and returns the validation results in thePaymentCallbackValidationResponsefor interpretation.Methods inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams, uriVars
-
Field Details
-
DEFAULT_HEADER_PAYMENT_VERSION
- See Also:
-
DEFAULT_HEADER_PAYMENT_LOCK_TOKEN
- See Also:
-
-
Constructor Details
-
ExternalPaymentTransactionExecutionProvider
public ExternalPaymentTransactionExecutionProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalPaymentProperties properties)
-
-
Method Details
-
authorizePayment
public TransactionExecutionResponse authorizePayment(@NonNull @NonNull String paymentId, @NonNull @NonNull Integer paymentVersion, @NonNull @NonNull TransactionExecutionRequest request, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
authorizePaymentin interfacePaymentTransactionExecutionProvider
-
authorizeAndCapturePayment
public TransactionExecutionResponse authorizeAndCapturePayment(@NonNull @NonNull String paymentId, @NonNull @NonNull Integer paymentVersion, @NonNull @NonNull TransactionExecutionRequest request, String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
authorizeAndCapturePaymentin interfacePaymentTransactionExecutionProvider
-
lookup3DSTransactionResult
public TransactionExecutionResponse lookup3DSTransactionResult(@NonNull @NonNull String paymentId, @NonNull @NonNull String requestId, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PaymentTransactionExecutionProviderLooks up the 3DS transaction results from the gateway. If the results are present in the payment gateway, but not in Payment Transaction Services, then record the results; otherwise, return the existing transaction results.- Specified by:
lookup3DSTransactionResultin interfacePaymentTransactionExecutionProvider- Parameters:
paymentId- the id of the payment that contains a reference to the required 3DS transactionrequestId- The id representing this request to checkoutlockToken- the token that owns the payment lockcontextInfo- context information around sandbox and multitenant state- Returns:
- a
TransactionExecutionResponseobject describing the result of the transaction
-
lookupExternalTransactionResult
public TransactionExecutionResponse lookupExternalTransactionResult(@NonNull @NonNull String paymentId, @NonNull @NonNull String requestId, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PaymentTransactionExecutionProviderLooks up the external transaction results from the gateway. If the results are present in the payment gateway, but not in Payment Transaction Services, then record the results; otherwise, return the existing transaction results.- Specified by:
lookupExternalTransactionResultin interfacePaymentTransactionExecutionProvider- Parameters:
paymentId- the id of the payment that contains a reference to the required external transactionrequestId- The id representing this request to checkoutlockToken- the token that owns the payment lockcontextInfo- context information around sandbox and multitenant state- Returns:
- a
TransactionExecutionResponseobject describing the result of the transaction
-
validatePaymentCallbackToken
public PaymentCallbackValidationResponse validatePaymentCallbackToken(@NonNull @NonNull PaymentCallbackValidationRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PaymentTransactionExecutionProviderValidates the payment callback and returns the validation results in thePaymentCallbackValidationResponsefor interpretation.- Specified by:
validatePaymentCallbackTokenin interfacePaymentTransactionExecutionProvider- Parameters:
request- thevalidation requestto perform on this payment callbackcontextInfo- context information related to multitenancy- Returns:
- the result of the validation
-
handleExternalTransactionResult
public TransactionExecutionResponse handleExternalTransactionResult(@NonNull @NonNull String gatewayType, @NonNull @NonNull Map<String, Object> request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PaymentTransactionExecutionProviderLooks up external payment transaction results & records them to the relevant transaction.- Specified by:
handleExternalTransactionResultin interfacePaymentTransactionExecutionProvider- Parameters:
gatewayType- The gateway used to process the transactionrequest- A map of the payment-gateway-provided properties used to lookup the transactioncontextInfo- context information related to multitenancy.- Returns:
- a
TransactionExecutionResponseobject describing the result of the transaction
-
getBaseUri
protected org.springframework.web.util.UriComponentsBuilder getBaseUri()Gets the base URI common to all requests this provider will make.- Returns:
- a URI components builder with the base URI set up
-
getServiceClient
-