Class DefaultAcceleratorPaymentService
java.lang.Object
de.hybris.platform.acceleratorservices.payment.impl.DefaultAcceleratorPaymentService
- All Implemented Interfaces:
PaymentService
Default implementation of
PaymentService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginHopCreatePaymentSubscription(String siteName, String responseUrl, String merchantCallbackUrl, CustomerModel customer, CreditCardPaymentInfoModel cardInfo, AddressModel paymentAddress) This method generates the Hosted Order Page request data which includes all data required to create a subscription (customer profile).beginSopCreatePaymentSubscription(String siteName, String responseUrl, String merchantCallbackUrl, CustomerModel customer, CreditCardPaymentInfoModel cardInfo, AddressModel paymentAddress) This method generates the Hosted Order Page request data which includes all data required to create a subscription (customer profile).completeHopCreatePaymentSubscription(CustomerModel customerModel, boolean saveInAccount, Map<String, String> parameters) This method creates a subscription internally with the result parameters obtained from the provider's Hosted Order Page.completeSopCreatePaymentSubscription(CustomerModel customerModel, boolean saveInAccount, Map<String, String> parameters) This method creates a subscription internally with the result parameters obtained from the provider's Silent Order Post.protected CartServiceprotected ClientReferenceLookupStrategyprotected CommonI18NServiceprotected CreateSubscriptionRequestStrategyprotected CreditCardPaymentInfoCreateStrategyprotected FraudCallbackStrategyprotected PaymentResponseInterpretationStrategyprotected ModelServiceprotected Converter<CreateSubscriptionRequest,PaymentData> protected PaymentFormActionUrlStrategyprotected PaymentResponseInterpretationStrategyprotected PaymentTransactionStrategyprotected SignatureValidationStrategyprotected SiteConfigServiceprotected UserServicevoidhandleCreateSubscriptionCallback(Map<String, String> parameters) This method attempts to validate the payment info with a given subscriptionId.voidhandleFraudUpdateCallback(Map<String, String> parameters) Uses the fraud call back strategy to handle fraud call backprotected voidmarkPaymentValidated(CreateSubscriptionResult response) voidsetCartService(CartService cartService) voidsetClientReferenceLookupStrategy(ClientReferenceLookupStrategy clientReferenceLookupStrategy) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetCreateSubscriptionRequestStrategy(CreateSubscriptionRequestStrategy createSubscriptionRequestStrategy) voidsetCreateSubscriptionResultValidationStrategy(CreateSubscriptionResultValidationStrategy createSubscriptionResultValidationStrategy) voidsetCreditCardPaymentInfoCreateStrategy(CreditCardPaymentInfoCreateStrategy creditCardPaymentInfoCreateStrategy) voidsetCreditCardPaymentSubscriptionDao(CreditCardPaymentSubscriptionDao creditCardPaymentSubscriptionDao) voidsetFraudCallbackStrategy(FraudCallbackStrategy fraudCallbackStrategy) voidsetHopPaymentResponseInterpretation(PaymentResponseInterpretationStrategy paymentResponseInterpretation) voidsetModelService(ModelService modelService) voidsetPaymentDataConverter(Converter<CreateSubscriptionRequest, PaymentData> paymentDataConverter) voidsetPaymentFormActionUrlStrategy(PaymentFormActionUrlStrategy paymentFormActionUrlStrategy) voidsetPaymentResponseInterpretation(PaymentResponseInterpretationStrategy paymentResponseInterpretation) voidsetPaymentTransactionReviewResult(PaymentTransactionEntryModel reviewDecisionEntry, String guid) This method add new PaymentTransactionEntry of type REVIEW_DECISION to the order.voidsetPaymentTransactionStrategy(PaymentTransactionStrategy paymentTransactionStrategy) voidsetSignatureValidationStrategy(SignatureValidationStrategy signatureValidationStrategy) voidsetSiteConfigService(SiteConfigService siteConfigService) voidsetUserService(UserService userService)
-
Constructor Details
-
DefaultAcceleratorPaymentService
public DefaultAcceleratorPaymentService()
-
-
Method Details
-
beginHopCreatePaymentSubscription
public PaymentData beginHopCreatePaymentSubscription(String siteName, String responseUrl, String merchantCallbackUrl, CustomerModel customer, CreditCardPaymentInfoModel cardInfo, AddressModel paymentAddress) Description copied from interface:PaymentServiceThis method generates the Hosted Order Page request data which includes all data required to create a subscription (customer profile). The request data will be sent to the HOP/SOP URL in a POST method.- Specified by:
beginHopCreatePaymentSubscriptionin interfacePaymentService- Parameters:
siteName- - The name of the current CMS siteresponseUrl- - The URL used by the CMS site to handle responses from the Hosted Order Page or Silent Order Post.merchantCallbackUrl- - The URL of the MerchantCallbackController used by the Provider to send validation responses.customer- - The Customer details.cardInfo- - If available will contain any existing credit card details used to pre-populate the HOP.paymentAddress- - If available contains the customer's billing address, used to pre-populate the HOP.- Returns:
- a
PaymentDataobject which contains all data required to create a subscription.
-
beginSopCreatePaymentSubscription
public PaymentData beginSopCreatePaymentSubscription(String siteName, String responseUrl, String merchantCallbackUrl, CustomerModel customer, CreditCardPaymentInfoModel cardInfo, AddressModel paymentAddress) Description copied from interface:PaymentServiceThis method generates the Hosted Order Page request data which includes all data required to create a subscription (customer profile). The request data will be sent to the HOP/SOP URL in a POST method.- Specified by:
beginSopCreatePaymentSubscriptionin interfacePaymentService- Parameters:
siteName- - The name of the current CMS siteresponseUrl- - The URL used by the CMS site to handle responses from the Hosted Order Page or Silent Order Post.merchantCallbackUrl- - The URL of the MerchantCallbackController used by the Provider to send validation responses.customer- - The Customer details.cardInfo- - If available will contain any existing credit card details used to pre-populate the HOP.paymentAddress- - If available contains the customer's billing address, used to pre-populate the HOP.- Returns:
- a
PaymentDataobject which contains all data required to create a subscription.
-
completeHopCreatePaymentSubscription
public PaymentSubscriptionResultItem completeHopCreatePaymentSubscription(CustomerModel customerModel, boolean saveInAccount, Map<String, String> parameters) Description copied from interface:PaymentServiceThis method creates a subscription internally with the result parameters obtained from the provider's Hosted Order Page. Only basic customer information and a subscription id is stored internally. All customer information is stored on the provider's system including credit card number and security code. The subscription id is used for future lookup for obtaining the customer's credit card details.- Specified by:
completeHopCreatePaymentSubscriptionin interfacePaymentService- Parameters:
customerModel- - The Customer details.saveInAccount- - Flag indicating if this new payment card will be stored in the customer's profile.parameters- - a Map of key-value paired Strings with the result data returned from the Hosted Order Page.- Returns:
- a
PaymentSubscriptionResultItemobject which contains the newly created credit card.
-
completeSopCreatePaymentSubscription
public PaymentSubscriptionResultItem completeSopCreatePaymentSubscription(CustomerModel customerModel, boolean saveInAccount, Map<String, String> parameters) Description copied from interface:PaymentServiceThis method creates a subscription internally with the result parameters obtained from the provider's Silent Order Post. Only basic customer information and a subscription id is stored internally. All customer information is stored on the provider's system including credit card number and security code. The subscription id is used for future lookup for obtaining the customer's credit card details.- Specified by:
completeSopCreatePaymentSubscriptionin interfacePaymentService- Parameters:
customerModel- - The Customer details.saveInAccount- - Flag indicating if this new payment card will be stored in the customer's profile.parameters- - a Map of key-value paired Strings with the result data returned from the Hosted Order Page.- Returns:
- a
PaymentSubscriptionResultItemobject which contains the newly created credit card.
-
handleCreateSubscriptionCallback
Description copied from interface:PaymentServiceThis method attempts to validate the payment info with a given subscriptionId. Validation should only pass if both the payment info and the valid subscription exists for this subscriptionId.- Specified by:
handleCreateSubscriptionCallbackin interfacePaymentService- Parameters:
parameters- - a Map of key-value paired Strings with the result data returned from the callback handler.
-
markPaymentValidated
-
handleFraudUpdateCallback
Description copied from interface:PaymentServiceUses the fraud call back strategy to handle fraud call back- Specified by:
handleFraudUpdateCallbackin interfacePaymentService- Parameters:
parameters- a Map of key-value paired Strings with the result data returned from the callback handler
-
setPaymentTransactionReviewResult
public void setPaymentTransactionReviewResult(PaymentTransactionEntryModel reviewDecisionEntry, String guid) This method add new PaymentTransactionEntry of type REVIEW_DECISION to the order. It also send event to allow submitorder proccess to end waitForReviewDecision action.- Specified by:
setPaymentTransactionReviewResultin interfacePaymentService- Parameters:
reviewDecisionEntry- - payment transaction entry of REVIEW_DECISION typeguid- -AbstractOrderModel.GUIDto which PaymentTransaction will be added
-
getUserService
-
setUserService
-
getModelService
-
setModelService
-
getCartService
-
setCartService
-
getCreditCardPaymentSubscriptionDao
-
setCreditCardPaymentSubscriptionDao
public void setCreditCardPaymentSubscriptionDao(CreditCardPaymentSubscriptionDao creditCardPaymentSubscriptionDao) -
getPaymentFormActionUrlStrategy
-
setPaymentFormActionUrlStrategy
public void setPaymentFormActionUrlStrategy(PaymentFormActionUrlStrategy paymentFormActionUrlStrategy) -
getPaymentResponseInterpretation
-
setPaymentResponseInterpretation
public void setPaymentResponseInterpretation(PaymentResponseInterpretationStrategy paymentResponseInterpretation) -
getHopPaymentResponseInterpretation
-
setHopPaymentResponseInterpretation
public void setHopPaymentResponseInterpretation(PaymentResponseInterpretationStrategy paymentResponseInterpretation) -
getPaymentDataConverter
-
setPaymentDataConverter
public void setPaymentDataConverter(Converter<CreateSubscriptionRequest, PaymentData> paymentDataConverter) -
getSiteConfigService
-
setSiteConfigService
-
getCommonI18NService
-
setCommonI18NService
-
getCreateSubscriptionRequestStrategy
-
setCreateSubscriptionRequestStrategy
public void setCreateSubscriptionRequestStrategy(CreateSubscriptionRequestStrategy createSubscriptionRequestStrategy) -
getCreateSubscriptionResultValidationStrategy
protected CreateSubscriptionResultValidationStrategy getCreateSubscriptionResultValidationStrategy() -
setCreateSubscriptionResultValidationStrategy
public void setCreateSubscriptionResultValidationStrategy(CreateSubscriptionResultValidationStrategy createSubscriptionResultValidationStrategy) -
getSignatureValidationStrategy
-
setSignatureValidationStrategy
-
getCreditCardPaymentInfoCreateStrategy
-
setCreditCardPaymentInfoCreateStrategy
public void setCreditCardPaymentInfoCreateStrategy(CreditCardPaymentInfoCreateStrategy creditCardPaymentInfoCreateStrategy) -
getPaymentTransactionStrategy
-
setPaymentTransactionStrategy
-
getFraudCallbackStrategy
-
setFraudCallbackStrategy
-
getClientReferenceLookupStrategy
-
setClientReferenceLookupStrategy
public void setClientReferenceLookupStrategy(ClientReferenceLookupStrategy clientReferenceLookupStrategy)
-