Class DefaultSapDigitalPaymentService
java.lang.Object
de.hybris.platform.cissapdigitalpayment.service.impl.DefaultSapDigitalPaymentService
- All Implemented Interfaces:
SapDigitalPaymentService
Default implementation of
SapDigitalPaymentService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthorize(String merchantTransactionCode, String paymentProvider, AddressModel deliveryAddress, CisSapDigitalPaymentAuthorizationResult dpAuthResult) Requests a payment authorizationcapture(PaymentTransactionModel transaction) Requests a payment captureprotected booleancheckIfCurrentUserIsTheCartUser(UserModel currentUser, CartModel currentCart) protected DateconstructAuthorizationDateTime(String authorizationDateTime) Returns the authorization date and time.createPaymentSubscription(CCPaymentInfoData paymentInfoData, Map<String, Object> params) Creates a payment subscription and returns theCreditCardPaymentInfoModelvoidcreatePollRegisteredCardProcess(String sessionId) CreatesSapDigitPayPollCardProcessModeland triggers the processde.hybris.platform.servicelayer.dto.converter.Converter<AddressModel,AddressData> de.hybris.platform.store.services.BaseStoreServicede.hybris.platform.processengine.BusinessProcessServicede.hybris.platform.order.CalculationServiceThis method will get the card registration URL from the SAP Digital paymentde.hybris.platform.order.CartServicede.hybris.platform.commerceservices.order.CommerceCardTypeServicede.hybris.platform.commerceservices.order.CommerceCheckoutServicede.hybris.platform.servicelayer.i18n.CommonI18NServicede.hybris.platform.commerceservices.customer.CustomerAccountServicede.hybris.platform.enumeration.EnumerationServicede.hybris.platform.servicelayer.model.ModelServicede.hybris.platform.acceleratorservices.payment.strategies.PaymentFormActionUrlStrategyde.hybris.platform.payment.PaymentServiceGets Digital Payments card registration URLgetRegistrationUrl(String responseUrl) Gets Digital Payments card registration URL and user will be redirected to redirectUrl after transaction is completedprotected StringCheck for the subscription ID from the authorization response.protected StringgetTransactionStatus(CisSapDigitalPaymentTransactionResult transactionResult) Retries the transaction statusde.hybris.platform.servicelayer.user.UserServiceprotected booleanisAnonymousCheckout(UserModel currentUser) booleanChecks if the transaction happened with SAP Digital payment transactionPolls the payment card registration url and return statuspollAndSave(String sessionId) Polls the payment card registration url and return statusprotected CardInfopopulateCardInfo(DigitalPaymentsPollModel digitalPaymentsPollModel) PopulatesCardInfoprotected CardInfopopulateCardInfo(CCPaymentInfoData paymentInfoData) Populates theCardInforefund(PaymentTransactionModel transaction, BigDecimal amountToRefund) Requests a payment refundprotected voidsaveCCPaymentInfo(DigitalPaymentsPollModel dpPollModel) Saves credit card details locallybooleansaveCreditCardPaymentDetailsToCart(String paymentInfoId, Map<String, Object> params) Saves the payment details to the cart.protected voidsaveDeliveryAddressToPaymentInfoData(CCPaymentInfoData paymentInfoData, CartModel currentCart) Saves the delivery address to payment infovoidsetAddressConverter(de.hybris.platform.servicelayer.dto.converter.Converter<AddressModel, AddressData> addressConverter) voidsetBaseStoreService(de.hybris.platform.store.services.BaseStoreService baseStoreService) voidsetBusinessProcessService(de.hybris.platform.processengine.BusinessProcessService businessProcessService) voidsetCalculationService(de.hybris.platform.order.CalculationService calculationService) voidsetCartService(de.hybris.platform.order.CartService cartService) voidsetCisSapDigitalPaymentService(CisSapDigitalPaymentService cisSapDigitalPaymentService) voidsetCommerceCardTypeService(de.hybris.platform.commerceservices.order.CommerceCardTypeService commerceCardTypeService) voidsetCommerceCheckoutService(de.hybris.platform.commerceservices.order.CommerceCheckoutService commerceCheckoutService) voidsetCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) voidsetCustomerAccountService(de.hybris.platform.commerceservices.customer.CustomerAccountService customerAccountService) voidsetDigitalPaymentsConfigurationService(DigitalPaymentsConfigurationService digitalPaymentsConfigurationService) voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) voidsetPaymentFormActionUrlStrategy(de.hybris.platform.acceleratorservices.payment.strategies.PaymentFormActionUrlStrategy paymentFormActionUrlStrategy) voidsetPaymentService(de.hybris.platform.payment.PaymentService paymentService) voidsetSapDigiPayAuthTranResult(Map<String, String> sapDigiPayAuthTranResult) voidsetSapDigitalPaymentConfigurationStrategy(SapDigitalPaymentConfigurationStrategy sapDigitalPaymentConfigurationStrategy) voidsetUserService(de.hybris.platform.servicelayer.user.UserService userService)
-
Constructor Details
-
DefaultSapDigitalPaymentService
public DefaultSapDigitalPaymentService()
-
-
Method Details
-
getRegistrationUrl
Description copied from interface:SapDigitalPaymentServiceGets Digital Payments card registration URL and user will be redirected to redirectUrl after transaction is completed- Specified by:
getRegistrationUrlin interfaceSapDigitalPaymentService- Parameters:
responseUrl- - URL to redirect- Returns:
- registration mode
-
poll
Description copied from interface:SapDigitalPaymentServicePolls the payment card registration url and return status- Specified by:
pollin interfaceSapDigitalPaymentService- Parameters:
sessionId- session id of card registration- Returns:
- poll model
-
authorize
public PaymentTransactionEntryModel authorize(String merchantTransactionCode, String paymentProvider, AddressModel deliveryAddress, CisSapDigitalPaymentAuthorizationResult dpAuthResult) Description copied from interface:SapDigitalPaymentServiceRequests a payment authorization- Specified by:
authorizein interfaceSapDigitalPaymentService- Parameters:
merchantTransactionCode- - merchant transaction codepaymentProvider- - payment service providerdeliveryAddress- - delivery addressdpAuthResult- - payment authorization result- Returns:
- PaymentTransactionEntryModel
-
capture
public PaymentTransactionEntryModel capture(PaymentTransactionModel transaction) throws SapDigitalPaymentCaptureException Description copied from interface:SapDigitalPaymentServiceRequests a payment capture- Specified by:
capturein interfaceSapDigitalPaymentService- Parameters:
transaction- - payment transaction- Returns:
PaymentTransactionEntryModel- Throws:
SapDigitalPaymentCaptureException- - Capture payment exception
-
refund
public PaymentTransactionEntryModel refund(PaymentTransactionModel transaction, BigDecimal amountToRefund) throws SapDigitalPaymentRefundException Description copied from interface:SapDigitalPaymentServiceRequests a payment refund- Specified by:
refundin interfaceSapDigitalPaymentService- Parameters:
transaction- - payment transactionamountToRefund- - amount to refund- Returns:
PaymentTransactionEntryModel- Throws:
SapDigitalPaymentRefundException- - Payment refund exception
-
getCardRegistrationUrl
This method will get the card registration URL from the SAP Digital payment- Specified by:
getCardRegistrationUrlin interfaceSapDigitalPaymentService- Returns:
- registration URL
-
createPollRegisteredCardProcess
CreatesSapDigitPayPollCardProcessModeland triggers the process- Specified by:
createPollRegisteredCardProcessin interfaceSapDigitalPaymentService- Parameters:
sessionId- - sessionId w.r.t registered card
-
createPaymentSubscription
public CreditCardPaymentInfoModel createPaymentSubscription(CCPaymentInfoData paymentInfoData, Map<String, Object> params) Creates a payment subscription and returns theCreditCardPaymentInfoModel- Specified by:
createPaymentSubscriptionin interfaceSapDigitalPaymentService- Parameters:
paymentInfoData- - credit card payment info dataparams- - pass the parameters like cart, user, payment provider etc- Returns:
CreditCardPaymentInfoModel
-
saveCreditCardPaymentDetailsToCart
Saves the payment details to the cart.- Specified by:
saveCreditCardPaymentDetailsToCartin interfaceSapDigitalPaymentService- Parameters:
paymentInfoId- - payment info IDparams- -Map<String,Object> - Returns:
Boolean
-
saveDeliveryAddressToPaymentInfoData
protected void saveDeliveryAddressToPaymentInfoData(CCPaymentInfoData paymentInfoData, CartModel currentCart) Saves the delivery address to payment info -
populateCardInfo
Populates theCardInfo -
checkIfCurrentUserIsTheCartUser
-
isAnonymousCheckout
-
getTransactionStatus
Retries the transaction status- Parameters:
transactionResult- -CisSapDigitalPaymentTransactionResult- Returns:
String
-
constructAuthorizationDateTime
Returns the authorization date and time. In case of errors, return a newDate -
getSubscriptionId
Check for the subscription ID from the authorization response. If empty,set an empty string -
isSapDigitalPaymentTransaction
Checks if the transaction happened with SAP Digital payment transaction- Specified by:
isSapDigitalPaymentTransactionin interfaceSapDigitalPaymentService- Parameters:
txn- -PaymentTransactionModel- Returns:
Boolean
-
pollAndSave
Description copied from interface:SapDigitalPaymentServicePolls the payment card registration url and return status- Specified by:
pollAndSavein interfaceSapDigitalPaymentService- Parameters:
sessionId- session id of card registration- Returns:
- poll model
-
saveCCPaymentInfo
Saves credit card details locally- Parameters:
dpPollModel- result from Digital Payments
-
getRegistrationUrl
Description copied from interface:SapDigitalPaymentServiceGets Digital Payments card registration URL- Specified by:
getRegistrationUrlin interfaceSapDigitalPaymentService- Returns:
- registration mode
-
populateCardInfo
PopulatesCardInfo -
getCisSapDigitalPaymentService
- Returns:
- the cisSapDigitalPaymentService
-
setCisSapDigitalPaymentService
- Parameters:
cisSapDigitalPaymentService- the cisSapDigitalPaymentService to set
-
getModelService
public de.hybris.platform.servicelayer.model.ModelService getModelService()- Returns:
- the modelService
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) - Parameters:
modelService- the modelService to set
-
getPaymentService
public de.hybris.platform.payment.PaymentService getPaymentService()- Returns:
- the paymentService
-
setPaymentService
public void setPaymentService(de.hybris.platform.payment.PaymentService paymentService) - Parameters:
paymentService- the paymentService to set
-
getCommonI18NService
public de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()- Returns:
- the commonI18NService
-
setCommonI18NService
public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) - Parameters:
commonI18NService- the commonI18NService to set
-
getPaymentFormActionUrlStrategy
public de.hybris.platform.acceleratorservices.payment.strategies.PaymentFormActionUrlStrategy getPaymentFormActionUrlStrategy()- Returns:
- the paymentFormActionUrlStrategy
-
setPaymentFormActionUrlStrategy
public void setPaymentFormActionUrlStrategy(de.hybris.platform.acceleratorservices.payment.strategies.PaymentFormActionUrlStrategy paymentFormActionUrlStrategy) - Parameters:
paymentFormActionUrlStrategy- the paymentFormActionUrlStrategy to set
-
getBusinessProcessService
public de.hybris.platform.processengine.BusinessProcessService getBusinessProcessService()- Returns:
- the businessProcessService
-
setBusinessProcessService
public void setBusinessProcessService(de.hybris.platform.processengine.BusinessProcessService businessProcessService) - Parameters:
businessProcessService- the businessProcessService to set
-
getCartService
public de.hybris.platform.order.CartService getCartService()- Returns:
- the cartService
-
setCartService
public void setCartService(de.hybris.platform.order.CartService cartService) - Parameters:
cartService- the cartService to set
-
getCommerceCardTypeService
public de.hybris.platform.commerceservices.order.CommerceCardTypeService getCommerceCardTypeService()- Returns:
- the commerceCardTypeService
-
setCommerceCardTypeService
public void setCommerceCardTypeService(de.hybris.platform.commerceservices.order.CommerceCardTypeService commerceCardTypeService) - Parameters:
commerceCardTypeService- the commerceCardTypeService to set
-
getCustomerAccountService
public de.hybris.platform.commerceservices.customer.CustomerAccountService getCustomerAccountService()- Returns:
- the customerAccountService
-
setCustomerAccountService
public void setCustomerAccountService(de.hybris.platform.commerceservices.customer.CustomerAccountService customerAccountService) - Parameters:
customerAccountService- the customerAccountService to set
-
getCommerceCheckoutService
public de.hybris.platform.commerceservices.order.CommerceCheckoutService getCommerceCheckoutService()- Returns:
- the commerceCheckoutService
-
setCommerceCheckoutService
public void setCommerceCheckoutService(de.hybris.platform.commerceservices.order.CommerceCheckoutService commerceCheckoutService) - Parameters:
commerceCheckoutService- the commerceCheckoutService to set
-
getAddressConverter
public de.hybris.platform.servicelayer.dto.converter.Converter<AddressModel,AddressData> getAddressConverter()- Returns:
- the addressConverter
-
setAddressConverter
public void setAddressConverter(de.hybris.platform.servicelayer.dto.converter.Converter<AddressModel, AddressData> addressConverter) - Parameters:
addressConverter- the addressConverter to set
-
getUserService
public de.hybris.platform.servicelayer.user.UserService getUserService()- Returns:
- the userService
-
setUserService
public void setUserService(de.hybris.platform.servicelayer.user.UserService userService) - Parameters:
userService- the userService to set
-
getBaseStoreService
public de.hybris.platform.store.services.BaseStoreService getBaseStoreService()- Returns:
- the baseStoreService
-
setBaseStoreService
public void setBaseStoreService(de.hybris.platform.store.services.BaseStoreService baseStoreService) - Parameters:
baseStoreService- the baseStoreService to set
-
getCalculationService
public de.hybris.platform.order.CalculationService getCalculationService()- Returns:
- the calculationService
-
setCalculationService
public void setCalculationService(de.hybris.platform.order.CalculationService calculationService) - Parameters:
calculationService- the calculationService to set
-
getSapDigiPayAuthTranResult
- Returns:
- the sapDigiPayAuthTranResult
-
getSapDigitalPaymentConfigurationStrategy
- Returns:
- the sapDigitalPaymentConfigurationStrategy
-
setSapDigitalPaymentConfigurationStrategy
public void setSapDigitalPaymentConfigurationStrategy(SapDigitalPaymentConfigurationStrategy sapDigitalPaymentConfigurationStrategy) - Parameters:
sapDigitalPaymentConfigurationStrategy- the sapDigitalPaymentConfigurationStrategy to set
-
setSapDigiPayAuthTranResult
- Parameters:
sapDigiPayAuthTranResult- the sapDigiPayAuthTranResult to set
-
getDigitalPaymentsConfigurationService
-
setDigitalPaymentsConfigurationService
public void setDigitalPaymentsConfigurationService(DigitalPaymentsConfigurationService digitalPaymentsConfigurationService) -
getEnumerationService
public de.hybris.platform.enumeration.EnumerationService getEnumerationService() -
setEnumerationService
public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
-