Class DefaultPaymentFacade
- java.lang.Object
-
- de.hybris.platform.acceleratorfacades.payment.impl.DefaultPaymentFacade
-
- All Implemented Interfaces:
PaymentFacade
- Direct Known Subclasses:
DefaultCommerceWebServicesPaymentFacade
public class DefaultPaymentFacade extends java.lang.Object implements PaymentFacade
Default implementation ofPaymentFacade
-
-
Constructor Summary
Constructors Constructor Description DefaultPaymentFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentDatabeginHopCreateSubscription(java.lang.String responseUrl, java.lang.String merchantCallbackUrl)Gets the Hosted Order Page request data which includes all data required to create a subscription (customer profile).PaymentDatabeginSopCreateSubscription(java.lang.String responseUrl, java.lang.String merchantCallbackUrl)Gets the Silent Order Post request data which includes all data required to create a subscription (customer profile).PaymentSubscriptionResultDatacompleteHopCreateSubscription(java.util.Map<java.lang.String,java.lang.String> parameters, boolean saveInAccount)Called to create a subscription internally with the result parameters obtained from the provider's Hosted Order Page.PaymentSubscriptionResultDatacompleteSopCreateSubscription(java.util.Map<java.lang.String,java.lang.String> parameters, boolean saveInAccount)Called to create a subscription internally with the result parameters obtained from the provider's Silent Order Post.PaymentSubscriptionResultDatacompleteSopCreateSubscription(java.util.Map<java.lang.String,java.lang.String> parameters, boolean saveInAccount, boolean defaultPayment)Called to create a subscription internally with the result parameters obtained from the provider's Silent Order Post.protected BaseSiteServicegetBaseSiteService()protected CheckoutCustomerStrategygetCheckoutCustomerStrategy()protected java.lang.StringgetCurrentSiteName()protected CustomerModelgetCurrentUserForCheckout()protected CustomerAccountServicegetCustomerAccountService()protected AddressModelgetDefaultPaymentAddress(CustomerModel customerModel)protected java.lang.StringgetFullResponseUrl(java.lang.String responseUrl, boolean isSecure)Resolves a given URL to a full URL including server and port, etc.protected PaymentServicegetPaymentService()protected Converter<PaymentSubscriptionResultItem,PaymentSubscriptionResultData>getPaymentSubscriptionResultDataConverter()protected SiteBaseUrlResolutionServicegetSiteBaseUrlResolutionService()protected SiteConfigServicegetSiteConfigService()protected UserServicegetUserService()voidsetBaseSiteService(BaseSiteService baseSiteService)voidsetCheckoutCustomerStrategy(CheckoutCustomerStrategy checkoutCustomerStrategy)voidsetCustomerAccountService(CustomerAccountService customerAccountService)voidsetPaymentService(PaymentService paymentService)voidsetPaymentSubscriptionResultDataConverter(Converter<PaymentSubscriptionResultItem,PaymentSubscriptionResultData> paymentSubscriptionResultDataConverter)voidsetSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)voidsetSiteConfigService(SiteConfigService siteConfigService)voidsetUserService(UserService userService)
-
-
-
Method Detail
-
getCheckoutCustomerStrategy
protected CheckoutCustomerStrategy getCheckoutCustomerStrategy()
-
setCheckoutCustomerStrategy
public void setCheckoutCustomerStrategy(CheckoutCustomerStrategy checkoutCustomerStrategy)
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
getSiteBaseUrlResolutionService
protected SiteBaseUrlResolutionService getSiteBaseUrlResolutionService()
-
setSiteBaseUrlResolutionService
public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getPaymentService
protected PaymentService getPaymentService()
-
setPaymentService
public void setPaymentService(PaymentService paymentService)
-
getPaymentSubscriptionResultDataConverter
protected Converter<PaymentSubscriptionResultItem,PaymentSubscriptionResultData> getPaymentSubscriptionResultDataConverter()
-
setPaymentSubscriptionResultDataConverter
public void setPaymentSubscriptionResultDataConverter(Converter<PaymentSubscriptionResultItem,PaymentSubscriptionResultData> paymentSubscriptionResultDataConverter)
-
getSiteConfigService
protected SiteConfigService getSiteConfigService()
-
setSiteConfigService
public void setSiteConfigService(SiteConfigService siteConfigService)
-
getCustomerAccountService
protected CustomerAccountService getCustomerAccountService()
-
setCustomerAccountService
public void setCustomerAccountService(CustomerAccountService customerAccountService)
-
beginHopCreateSubscription
public PaymentData beginHopCreateSubscription(java.lang.String responseUrl, java.lang.String merchantCallbackUrl)
Description copied from interface:PaymentFacadeGets the Hosted Order Page request data which includes all data required to create a subscription (customer profile).- Specified by:
beginHopCreateSubscriptionin interfacePaymentFacade- Parameters:
responseUrl- - requires aHostedOrderPageRequestobject containing all the request data.merchantCallbackUrl- - The URL of the MerchantCallbackController used by the Provider to send validation responses.- Returns:
- a
PaymentDataobject which contains all data required to create a subscription.
-
beginSopCreateSubscription
public PaymentData beginSopCreateSubscription(java.lang.String responseUrl, java.lang.String merchantCallbackUrl)
Description copied from interface:PaymentFacadeGets the Silent Order Post request data which includes all data required to create a subscription (customer profile).- Specified by:
beginSopCreateSubscriptionin interfacePaymentFacade- Parameters:
responseUrl- - requires aHostedOrderPageRequestobject containing all the request data.merchantCallbackUrl- - The URL of the MerchantCallbackController used by the Provider to send validation responses.- Returns:
- a
PaymentDataobject which contains all data required to create a subscription.
-
completeHopCreateSubscription
public PaymentSubscriptionResultData completeHopCreateSubscription(java.util.Map<java.lang.String,java.lang.String> parameters, boolean saveInAccount)
Description copied from interface:PaymentFacadeCalled to create a subscription internally with the result parameters obtained from the provider's Hosted Order Page.- Specified by:
completeHopCreateSubscriptionin interfacePaymentFacade- Parameters:
parameters- - a Map of key-value paired Strings with the result data returned from the HOP/SOP response.saveInAccount- - a Flag to tell if the PaymentInfo created should saved to the account. During guest checkout the Anonymous user should not hav the PaymentInfos assigned- Returns:
- - a
CCPaymentInfoDataobject representing the subscription created by the HOP/SOP response.
-
completeSopCreateSubscription
public PaymentSubscriptionResultData completeSopCreateSubscription(java.util.Map<java.lang.String,java.lang.String> parameters, boolean saveInAccount)
Description copied from interface:PaymentFacadeCalled to create a subscription internally with the result parameters obtained from the provider's Silent Order Post.- Specified by:
completeSopCreateSubscriptionin interfacePaymentFacade- Parameters:
parameters- - a Map of key-value paired Strings with the result data returned from the HOP/SOP response.saveInAccount- - a Flag to tell if the PaymentInfo created should saved to the account. During guest checkout the Anonymous user should not hav the PaymentInfos assigned- Returns:
- - a
CCPaymentInfoDataobject representing the subscription created by the HOP/SOP response.
-
completeSopCreateSubscription
public PaymentSubscriptionResultData completeSopCreateSubscription(java.util.Map<java.lang.String,java.lang.String> parameters, boolean saveInAccount, boolean defaultPayment)
Description copied from interface:PaymentFacadeCalled to create a subscription internally with the result parameters obtained from the provider's Silent Order Post.- Specified by:
completeSopCreateSubscriptionin interfacePaymentFacade- Parameters:
parameters- - a Map of key-value paired Strings with the result data returned from the HOP/SOP response.saveInAccount- - a Flag to tell if the PaymentInfo created should saved to the account. During guest checkout the Anonymous user should not hav the PaymentInfos assigneddefaultPayment- - a flag to tell whether the created PaymentInfo should be made default or not- Returns:
- - a
CCPaymentInfoDataobject representing the subscription created by the HOP/SOP response.
-
getDefaultPaymentAddress
protected AddressModel getDefaultPaymentAddress(CustomerModel customerModel)
-
getCurrentSiteName
protected java.lang.String getCurrentSiteName()
- Returns:
- the name of the current base site.
-
getFullResponseUrl
protected java.lang.String getFullResponseUrl(java.lang.String responseUrl, boolean isSecure)Resolves a given URL to a full URL including server and port, etc.- Parameters:
responseUrl- - the URL to resolveisSecure- - flag to indicate whether the final URL should use a secure connection or not.- Returns:
- a full URL including HTTP protocol, server, port, path etc.
-
getCurrentUserForCheckout
protected CustomerModel getCurrentUserForCheckout()
-
-