Class DefaultAlipayPaymentService
- java.lang.Object
-
- de.hybris.platform.payment.impl.DefaultPaymentServiceImpl
-
- de.hybris.platform.chinesepspalipayservices.payment.DefaultAlipayPaymentService
-
- All Implemented Interfaces:
ChinesePaymentService
,PaymentService
public class DefaultAlipayPaymentService extends DefaultPaymentServiceImpl implements ChinesePaymentService
Default implementation ofChinesePaymentService
-
-
Constructor Summary
Constructors Constructor Description DefaultAlipayPaymentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildString(java.lang.StringBuilder builder, java.lang.String s)
boolean
cancelPayment(java.lang.String orderCode)
Canceling the payment with the 3rd part payment service provider serverprotected java.util.Map<java.lang.String,java.lang.String>
convertKey2CamelCase(java.util.Map<java.lang.String,java.lang.String> snakeCaseMap)
protected AlipayCancelPaymentRequestData
createAlipayCancelPaymentRequestDataByOrder(OrderModel order)
protected AlipayDirectPayRequestData
createAlipayDirectPayRequestDataByOrder(OrderModel order)
protected AlipayPaymentStatusRequestData
createAlipayPaymentStatusRequestDataByOrder(OrderModel order)
protected java.util.Optional<AlipayRefundRequestData>
createAlipayRefundRequestDataByOrder(OrderModel order)
protected AlipayConfiguration
getAlipayConfiguration()
protected AlipayCreateRequestStrategy
getAlipayCreateRequestStrategy()
protected AlipayHandleResponseStrategy
getAlipayHandleResponseStrategy()
protected AlipayOrderService
getAlipayOrderService()
protected AlipayPaymentInfoStrategy
getAlipayPaymentInfoStrategy()
protected AlipayPaymentTransactionStrategy
getAlipayPaymentTransactionStrategy()
protected AlipayResponseValidationStrategy
getAlipayResponseValidationStrategy()
protected BaseSiteService
getBaseSiteService()
protected ChineseOrderService
getChineseOrderService()
protected CMSSiteService
getCmsSiteService()
protected CommerceCheckoutService
getCommerceCheckoutService()
protected CommerceCommonI18NService
getCommerceCommonI18NService()
protected MediaService
getMediaService()
protected ModelService
getModelService()
protected OrderModel
getOrderModelByCode(java.lang.String orderCode)
retrieve OrderModel by order codejava.lang.String
getPaymentRequestUrl(java.lang.String orderCode)
Getting the PaymentRequestUrl to be send to the 3rd part payment service provider serverjava.lang.String
getPspLogoUrl()
Getting the Logo of the 3rd part payment service providersjava.util.Optional<java.lang.String>
getRefundRequestUrl(java.lang.String orderCode)
Getting the RefundRequestUrl to be send to the 3rd part payment service provider serverprotected SiteBaseUrlResolutionService
getSiteBaseUrlResolutionService()
protected java.lang.String
getUrlEncodePattern()
java.lang.String
handleAsyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handling the Asyn-response of the 3rd part payment service provider serverprotected void
handleErrorResponse(java.util.Map<java.lang.String,java.lang.String> responseMap)
protected java.lang.String
handleNotification(java.util.Map<java.lang.String,java.lang.String> responseMap, javax.servlet.http.HttpServletResponse response)
protected void
handleRefundNotification(java.util.Map<java.lang.String,java.lang.String> responseMap, javax.servlet.http.HttpServletResponse response)
protected java.lang.String
handleReturnInfo(java.util.Map<java.lang.String,java.lang.String> responseMap)
java.lang.String
handleSyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handling the Sync-response of the 3rd part payment service provider serverprotected boolean
isOrderNonRefundable(OrderModel order)
void
setAlipayConfiguration(AlipayConfiguration alipayConfiguration)
void
setAlipayCreateRequestStrategy(AlipayCreateRequestStrategy alipayCreateRequestStrategy)
void
setAlipayHandleResponseStrategy(AlipayHandleResponseStrategy alipayHandleResponseStrategy)
void
setAlipayOrderService(AlipayOrderService alipayOrderService)
void
setAlipayPaymentInfoStrategy(AlipayPaymentInfoStrategy alipayPaymentInfoStrategy)
void
setAlipayPaymentTransactionStrategy(AlipayPaymentTransactionStrategy alipayPaymentTransactionStrategy)
void
setAlipayResponseValidationStrategy(AlipayResponseValidationStrategy alipayResponseValidationStrategy)
void
setBaseSiteService(BaseSiteService baseSiteService)
void
setChineseOrderService(ChineseOrderService chineseOrderService)
void
setCmsSiteService(CMSSiteService cmsSiteService)
void
setCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService)
void
setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
void
setMediaService(MediaService mediaService)
void
setModelService(ModelService modelService)
boolean
setPaymentInfo(CartModel cartModel, ChinesePaymentInfoModel chinesePaymentInfoModel)
Saving the PaymentInfovoid
setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
void
syncPaymentStatus(java.lang.String orderCode)
Synchronizing the PaymentStatus with the 3rd part payment service provider serverprotected java.util.Map<java.lang.String,java.lang.String>
unifyRequestParameterValue(java.util.Map<java.lang.String,java.lang.String[]> params)
-
Methods inherited from class de.hybris.platform.payment.impl.DefaultPaymentServiceImpl
attachPaymentInfo, authorize, authorize, authorize, authorize, authorize, authorize, authorizeInternal, cancel, capture, createBillingInfo, createBillingInfo, createSubscription, createSubscription, deleteSubscription, getCardPaymentService, getCommonI18NService, getFlexibleSearchService, getNewPaymentTransactionEntryCode, getPaymentInfoCreator, getPaymentTransaction, getPaymentTransactionEntry, getSubscriptionData, getTransactionCodeGenerator, partialCapture, refundFollowOn, refundStandalone, refundStandalone, setCardPaymentService, setCommonI18NService, setFlexibleSearchService, setPaymentInfoCreator, setTransactionCodeGenerator, updateSubscription
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.chinesepaymentservices.payment.ChinesePaymentService
updatePaymentInfoForPlaceOrder
-
Methods inherited from interface de.hybris.platform.payment.PaymentService
attachPaymentInfo, authorize, authorize, authorize, authorize, authorize, authorize, cancel, capture, createSubscription, createSubscription, deleteSubscription, getNewPaymentTransactionEntryCode, getPaymentTransaction, getPaymentTransactionEntry, getSubscriptionData, partialCapture, refundFollowOn, refundStandalone, refundStandalone, updateSubscription
-
-
-
-
Method Detail
-
handleAsyncResponse
public java.lang.String handleAsyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:ChinesePaymentService
Handling the Asyn-response of the 3rd part payment service provider server- Specified by:
handleAsyncResponse
in interfaceChinesePaymentService
- Parameters:
request
- The HttpServletRequestresponse
- The HttpServletResponse- Returns:
- the code of the order
-
handleSyncResponse
public java.lang.String handleSyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:ChinesePaymentService
Handling the Sync-response of the 3rd part payment service provider server- Specified by:
handleSyncResponse
in interfaceChinesePaymentService
- Parameters:
request
- The HttpServletRequestresponse
- The HttpServletResponse- Returns:
- the code of the order
-
cancelPayment
public boolean cancelPayment(java.lang.String orderCode)
Description copied from interface:ChinesePaymentService
Canceling the payment with the 3rd part payment service provider server- Specified by:
cancelPayment
in interfaceChinesePaymentService
- Parameters:
orderCode
- The code of the order- Returns:
- true when canceling payment is successful
-
getPaymentRequestUrl
public java.lang.String getPaymentRequestUrl(java.lang.String orderCode)
Description copied from interface:ChinesePaymentService
Getting the PaymentRequestUrl to be send to the 3rd part payment service provider server- Specified by:
getPaymentRequestUrl
in interfaceChinesePaymentService
- Parameters:
orderCode
- The code of the order- Returns:
- the payment request Url of the 3rd part payment service provider
-
getRefundRequestUrl
public java.util.Optional<java.lang.String> getRefundRequestUrl(java.lang.String orderCode)
Description copied from interface:ChinesePaymentService
Getting the RefundRequestUrl to be send to the 3rd part payment service provider server- Specified by:
getRefundRequestUrl
in interfaceChinesePaymentService
- Parameters:
orderCode
- The code of the order- Returns:
- the refund request Url of the 3rd part payment service provider if order can be refunded, otherwise return an empty Optional
-
isOrderNonRefundable
protected boolean isOrderNonRefundable(OrderModel order)
-
syncPaymentStatus
public void syncPaymentStatus(java.lang.String orderCode)
Description copied from interface:ChinesePaymentService
Synchronizing the PaymentStatus with the 3rd part payment service provider server- Specified by:
syncPaymentStatus
in interfaceChinesePaymentService
- Parameters:
orderCode
- The code of the order
-
setPaymentInfo
public boolean setPaymentInfo(CartModel cartModel, ChinesePaymentInfoModel chinesePaymentInfoModel)
Description copied from interface:ChinesePaymentService
Saving the PaymentInfo- Specified by:
setPaymentInfo
in interfaceChinesePaymentService
- Parameters:
cartModel
- The current cartchinesePaymentInfoModel
- The ChinesePaymentInfo of the cart- Returns:
- true when setting PaymentInfo is successful
-
getPspLogoUrl
public java.lang.String getPspLogoUrl()
Description copied from interface:ChinesePaymentService
Getting the Logo of the 3rd part payment service providers- Specified by:
getPspLogoUrl
in interfaceChinesePaymentService
- Returns:
- the url of the payment service provider logo
-
getOrderModelByCode
protected OrderModel getOrderModelByCode(java.lang.String orderCode)
retrieve OrderModel by order code- Parameters:
orderCode
- order code of OrderModel- Returns:
- OrderModel
-
unifyRequestParameterValue
protected java.util.Map<java.lang.String,java.lang.String> unifyRequestParameterValue(java.util.Map<java.lang.String,java.lang.String[]> params)
-
buildString
protected void buildString(java.lang.StringBuilder builder, java.lang.String s)
-
convertKey2CamelCase
protected java.util.Map<java.lang.String,java.lang.String> convertKey2CamelCase(java.util.Map<java.lang.String,java.lang.String> snakeCaseMap)
-
handleNotification
protected java.lang.String handleNotification(java.util.Map<java.lang.String,java.lang.String> responseMap, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
- Throws:
java.io.IOException
-
handleReturnInfo
protected java.lang.String handleReturnInfo(java.util.Map<java.lang.String,java.lang.String> responseMap)
-
handleErrorResponse
protected void handleErrorResponse(java.util.Map<java.lang.String,java.lang.String> responseMap)
-
createAlipayDirectPayRequestDataByOrder
protected AlipayDirectPayRequestData createAlipayDirectPayRequestDataByOrder(OrderModel order)
-
createAlipayCancelPaymentRequestDataByOrder
protected AlipayCancelPaymentRequestData createAlipayCancelPaymentRequestDataByOrder(OrderModel order)
-
createAlipayPaymentStatusRequestDataByOrder
protected AlipayPaymentStatusRequestData createAlipayPaymentStatusRequestDataByOrder(OrderModel order)
-
createAlipayRefundRequestDataByOrder
protected java.util.Optional<AlipayRefundRequestData> createAlipayRefundRequestDataByOrder(OrderModel order)
-
handleRefundNotification
protected void handleRefundNotification(java.util.Map<java.lang.String,java.lang.String> responseMap, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
- Throws:
java.io.IOException
-
getUrlEncodePattern
protected java.lang.String getUrlEncodePattern()
-
setAlipayPaymentInfoStrategy
public void setAlipayPaymentInfoStrategy(AlipayPaymentInfoStrategy alipayPaymentInfoStrategy)
-
setCommerceCheckoutService
public void setCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService)
-
setMediaService
public void setMediaService(MediaService mediaService)
-
setAlipayOrderService
public void setAlipayOrderService(AlipayOrderService alipayOrderService)
-
setAlipayCreateRequestStrategy
public void setAlipayCreateRequestStrategy(AlipayCreateRequestStrategy alipayCreateRequestStrategy)
-
setAlipayPaymentTransactionStrategy
public void setAlipayPaymentTransactionStrategy(AlipayPaymentTransactionStrategy alipayPaymentTransactionStrategy)
-
setAlipayResponseValidationStrategy
public void setAlipayResponseValidationStrategy(AlipayResponseValidationStrategy alipayResponseValidationStrategy)
-
setAlipayHandleResponseStrategy
public void setAlipayHandleResponseStrategy(AlipayHandleResponseStrategy alipayHandleResponseStrategy)
-
setChineseOrderService
public void setChineseOrderService(ChineseOrderService chineseOrderService)
-
setAlipayConfiguration
public void setAlipayConfiguration(AlipayConfiguration alipayConfiguration)
-
setModelService
public void setModelService(ModelService modelService)
- Overrides:
setModelService
in classDefaultPaymentServiceImpl
-
setCmsSiteService
public void setCmsSiteService(CMSSiteService cmsSiteService)
-
setCommerceCommonI18NService
public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
-
getAlipayPaymentInfoStrategy
protected AlipayPaymentInfoStrategy getAlipayPaymentInfoStrategy()
-
getCommerceCheckoutService
protected CommerceCheckoutService getCommerceCheckoutService()
-
getAlipayOrderService
protected AlipayOrderService getAlipayOrderService()
-
getAlipayCreateRequestStrategy
protected AlipayCreateRequestStrategy getAlipayCreateRequestStrategy()
-
getAlipayPaymentTransactionStrategy
protected AlipayPaymentTransactionStrategy getAlipayPaymentTransactionStrategy()
-
getAlipayResponseValidationStrategy
protected AlipayResponseValidationStrategy getAlipayResponseValidationStrategy()
-
getAlipayHandleResponseStrategy
protected AlipayHandleResponseStrategy getAlipayHandleResponseStrategy()
-
getMediaService
protected MediaService getMediaService()
-
getChineseOrderService
protected ChineseOrderService getChineseOrderService()
-
getAlipayConfiguration
protected AlipayConfiguration getAlipayConfiguration()
-
getModelService
protected ModelService getModelService()
- Overrides:
getModelService
in classDefaultPaymentServiceImpl
-
getCmsSiteService
protected CMSSiteService getCmsSiteService()
-
getCommerceCommonI18NService
protected CommerceCommonI18NService getCommerceCommonI18NService()
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
getSiteBaseUrlResolutionService
protected SiteBaseUrlResolutionService getSiteBaseUrlResolutionService()
-
setSiteBaseUrlResolutionService
public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
-
-