Class CreateSavedPaymentMethodEventListener
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.messaging.savedpayment.CreateSavedPaymentMethodEventListener
@DataRouteByKey("paymentTransaction")
@Deprecated(since="1.0.2",
forRemoval=true)
public class CreateSavedPaymentMethodEventListener
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
An event listener that triggers when a checkout is successfully completed. Responsible for
checking the completed cart for any newly specified payment methods that the user wishes to save
for future usage, or usage of any previously saved payment methods to record the latest results.
This listener is only needed for the transitional period after upgrading to 1.0.2, to ensure that
saved payments are created for unprocessed messages after the upgrade. Once a day or two have
passed after adopting the upgrade, this listener can be disabled by declaring
broadleaf.paymenttransaction.saved-payment.checkout-complete-create-listener.enabled=false
- Author:
- Chris Kittrell (ckittrell), Sunny Yu
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version.protected static final String
Deprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorDescriptionCreateSavedPaymentMethodEventListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, PaymentManagementService<Payment> paymentManagementService, SavedPaymentMethodService<SavedPaymentMethod> savedPaymentMethodService, SavedPaymentMethodManagementService savedPaymentMethodManagementService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(@NonNull com.jayway.jsonpath.DocumentContext jsonContext) Deprecated, for removal: This API element is subject to removal in a future version.Builds aContextInfo
for the application context id and tenant idprotected com.jayway.jsonpath.DocumentContext
getDocumentContext
(@NonNull String payload) Deprecated, for removal: This API element is subject to removal in a future version.Parses the message payload into a `DocumentContext` which allows for JsonPath parsing using Jackson providers.protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
Deprecated, for removal: This API element is subject to removal in a future version.protected com.fasterxml.jackson.databind.ObjectMapper
Deprecated, for removal: This API element is subject to removal in a future version.protected PaymentManagementService<Payment>
Deprecated, for removal: This API element is subject to removal in a future version.protected SavedPaymentMethodManagementService
Deprecated, for removal: This API element is subject to removal in a future version.protected SavedPaymentMethodService<SavedPaymentMethod>
Deprecated, for removal: This API element is subject to removal in a future version.protected com.broadleafcommerce.common.extension.TypeFactory
Deprecated, for removal: This API element is subject to removal in a future version.protected boolean
isSubmittedOrder
(com.jayway.jsonpath.DocumentContext jsonContext) Deprecated, for removal: This API element is subject to removal in a future version.void
Deprecated, for removal: This API element is subject to removal in a future version.Event listener entry point.protected void
processMessage
(@NonNull org.springframework.messaging.Message<String> message) Deprecated, for removal: This API element is subject to removal in a future version.Handles the interpretation of the message payload & if necessary, createsSavedPaymentMethods
for the orderprotected String
readStringValueByPath
(@NonNull com.jayway.jsonpath.DocumentContext context, @NonNull String path) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
SUBMITTED
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
SUCCESS
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
CART_STATUS_PATH
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
CART_ID_PATH
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
APPLICATION_ID_PATH
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
TENANT_ID_PATH
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
CUSTOMER_CONTEXT_ID_PATH
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
CUSTOMER_ID_PATH
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Constructor Details
-
CreateSavedPaymentMethodEventListener
public CreateSavedPaymentMethodEventListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, PaymentManagementService<Payment> paymentManagementService, SavedPaymentMethodService<SavedPaymentMethod> savedPaymentMethodService, SavedPaymentMethodManagementService savedPaymentMethodManagementService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
listen
@StreamListener("checkoutCompletionInputPaymentTransaction") public void listen(org.springframework.messaging.Message<String> message) Deprecated, for removal: This API element is subject to removal in a future version.Event listener entry point. Checks if the message has already been received and, if not, begins processing it.- Parameters:
message
- the message to be processed
-
processMessage
protected void processMessage(@NonNull @NonNull org.springframework.messaging.Message<String> message) Deprecated, for removal: This API element is subject to removal in a future version.Handles the interpretation of the message payload & if necessary, createsSavedPaymentMethods
for the order- Parameters:
message
- the message to be processed
-
getDocumentContext
Deprecated, for removal: This API element is subject to removal in a future version.Parses the message payload into a `DocumentContext` which allows for JsonPath parsing using Jackson providers.- Parameters:
payload
- the message payload- Returns:
- a `DocumentContext` representation of the message payload
-
isSubmittedOrder
protected boolean isSubmittedOrder(com.jayway.jsonpath.DocumentContext jsonContext) Deprecated, for removal: This API element is subject to removal in a future version. -
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(@NonNull @NonNull com.jayway.jsonpath.DocumentContext jsonContext) Deprecated, for removal: This API element is subject to removal in a future version.Builds aContextInfo
for the application context id and tenant id- Parameters:
jsonContext
- The json representation of the message payload- Returns:
- the
ContextInfo
of the completed checkout
-
readStringValueByPath
@Nullable protected String readStringValueByPath(@NonNull @NonNull com.jayway.jsonpath.DocumentContext context, @NonNull @NonNull String path) Deprecated, for removal: This API element is subject to removal in a future version. -
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService()Deprecated, for removal: This API element is subject to removal in a future version. -
getPaymentManagementService
Deprecated, for removal: This API element is subject to removal in a future version. -
getSavedPaymentMethodService
Deprecated, for removal: This API element is subject to removal in a future version. -
getSavedPaymentMethodManagementService
Deprecated, for removal: This API element is subject to removal in a future version. -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Deprecated, for removal: This API element is subject to removal in a future version. -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()Deprecated, for removal: This API element is subject to removal in a future version.
-
TransactionExecutionService
. Once a day or two have passed after adopting the upgrade, this listener can be disabled by declaringbroadleaf.paymenttransaction.saved-payment.checkout-complete-create-listener.enabled=false