Class DefaultSavedPaymentMethodWebhookService
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.webhook.DefaultSavedPaymentMethodWebhookService
- All Implemented Interfaces:
SavedPaymentMethodWebhookService
public class DefaultSavedPaymentMethodWebhookService
extends Object
implements SavedPaymentMethodWebhookService
The default implementation of
SavedPaymentMethodWebhookService
.- Author:
- Dima Myroniuk (dmyroniuk)
-
Constructor Summary
ConstructorDescriptionDefaultSavedPaymentMethodWebhookService
(com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider paymentGatewayResourceProvider, SavedPaymentMethodService<SavedPaymentMethod> savedPaymentMethodService) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.http.ResponseEntity<?>
buildErrorResponse
(com.broadleafcommerce.paymentgateway.service.PaymentGatewaySavedPaymentMethodWebhookHandler webhookHandler, @NonNull Exception e) protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
getContextInfo
(@NonNull com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodSetupResult savedPaymentMethodSetupResult) protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider
protected SavedPaymentMethodService<SavedPaymentMethod>
org.springframework.http.ResponseEntity<?>
handleWebhook
(String gatewayType, org.springframework.http.HttpHeaders headers, String rawRequestBody, Map<String, String> parameters) Handles the saved payment method webhook request for the specified gateway type.protected SavedPaymentMethod
replaceSavedPaymentMethod
(SavedPaymentMethod savedPaymentMethod, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
updateSavedPaymentMethodForResult
(com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodSetupResult savedPaymentMethodSetupResult) protected SavedPaymentMethod
updateSavedPaymentMethodForResult
(com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodSetupResult savedPaymentMethodSetupResult, SavedPaymentMethod savedPaymentMethod, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
DefaultSavedPaymentMethodWebhookService
public DefaultSavedPaymentMethodWebhookService(com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider paymentGatewayResourceProvider, SavedPaymentMethodService<SavedPaymentMethod> savedPaymentMethodService)
-
-
Method Details
-
handleWebhook
public org.springframework.http.ResponseEntity<?> handleWebhook(String gatewayType, org.springframework.http.HttpHeaders headers, String rawRequestBody, Map<String, String> parameters) Description copied from interface:SavedPaymentMethodWebhookService
Handles the saved payment method webhook request for the specified gateway type.- Specified by:
handleWebhook
in interfaceSavedPaymentMethodWebhookService
- Parameters:
gatewayType
- the gateway type that is used to identify the appropriatePaymentGatewaySavedPaymentMethodWebhookHandler
headers
- the webhook request headersrawRequestBody
- the webhook request bodyparameters
- the webhook request parameters- Returns:
- a
ResponseEntity
meant to communicate to the gateway with the processing result of the webhook.
-
updateSavedPaymentMethodForResult
protected void updateSavedPaymentMethodForResult(com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodSetupResult savedPaymentMethodSetupResult) -
updateSavedPaymentMethodForResult
protected SavedPaymentMethod updateSavedPaymentMethodForResult(com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodSetupResult savedPaymentMethodSetupResult, SavedPaymentMethod savedPaymentMethod, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
replaceSavedPaymentMethod
protected SavedPaymentMethod replaceSavedPaymentMethod(SavedPaymentMethod savedPaymentMethod, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo getContextInfo(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.SavedPaymentMethodSetupResult savedPaymentMethodSetupResult) -
buildErrorResponse
protected org.springframework.http.ResponseEntity<?> buildErrorResponse(@Nullable com.broadleafcommerce.paymentgateway.service.PaymentGatewaySavedPaymentMethodWebhookHandler webhookHandler, @NonNull @NonNull Exception e) -
getPaymentGatewayResourceProvider
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayResourceProvider getPaymentGatewayResourceProvider() -
getSavedPaymentMethodService
-