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 of
ChinesePaymentService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildString(StringBuilder builder, String s) booleancancelPayment(String orderCode) Canceling the payment with the 3rd part payment service provider serverconvertKey2CamelCase(Map<String, String> snakeCaseMap) protected AlipayCancelPaymentRequestDataprotected AlipayDirectPayRequestDataprotected AlipayPaymentStatusRequestDataprotected Optional<AlipayRefundRequestData>protected AlipayConfigurationprotected AlipayCreateRequestStrategyprotected AlipayHandleResponseStrategyprotected AlipayOrderServiceprotected AlipayPaymentInfoStrategyprotected AlipayPaymentTransactionStrategyprotected AlipayResponseValidationStrategyprotected BaseSiteServiceprotected ChineseOrderServiceprotected CMSSiteServiceprotected CommerceCheckoutServiceprotected CommerceCommonI18NServiceprotected MediaServiceprotected ModelServiceprotected OrderModelgetOrderModelByCode(String orderCode) retrieve OrderModel by order codegetPaymentRequestUrl(String orderCode) Getting the PaymentRequestUrl to be send to the 3rd part payment service provider serverGetting the Logo of the 3rd part payment service providersgetRefundRequestUrl(String orderCode) Getting the RefundRequestUrl to be send to the 3rd part payment service provider serverprotected SiteBaseUrlResolutionServiceprotected StringhandleAsyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handling the Asyn-response of the 3rd part payment service provider serverprotected voidhandleErrorResponse(Map<String, String> responseMap) protected StringhandleNotification(Map<String, String> responseMap, javax.servlet.http.HttpServletResponse response) protected voidhandleRefundNotification(Map<String, String> responseMap, javax.servlet.http.HttpServletResponse response) protected StringhandleReturnInfo(Map<String, String> responseMap) handleSyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handling the Sync-response of the 3rd part payment service provider serverprotected booleanisOrderNonRefundable(OrderModel order) voidsetAlipayConfiguration(AlipayConfiguration alipayConfiguration) voidsetAlipayCreateRequestStrategy(AlipayCreateRequestStrategy alipayCreateRequestStrategy) voidsetAlipayHandleResponseStrategy(AlipayHandleResponseStrategy alipayHandleResponseStrategy) voidsetAlipayOrderService(AlipayOrderService alipayOrderService) voidsetAlipayPaymentInfoStrategy(AlipayPaymentInfoStrategy alipayPaymentInfoStrategy) voidsetAlipayPaymentTransactionStrategy(AlipayPaymentTransactionStrategy alipayPaymentTransactionStrategy) voidsetAlipayResponseValidationStrategy(AlipayResponseValidationStrategy alipayResponseValidationStrategy) voidsetBaseSiteService(BaseSiteService baseSiteService) voidsetChineseOrderService(ChineseOrderService chineseOrderService) voidsetCmsSiteService(CMSSiteService cmsSiteService) voidsetCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService) voidsetCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) voidsetMediaService(MediaService mediaService) voidsetModelService(ModelService modelService) booleansetPaymentInfo(CartModel cartModel, ChinesePaymentInfoModel chinesePaymentInfoModel) Saving the PaymentInfovoidsetSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService) voidsyncPaymentStatus(String orderCode) Synchronizing the PaymentStatus with the 3rd part payment service provider serverunifyRequestParameterValue(Map<String, 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, updateSubscriptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.chinesepaymentservices.payment.ChinesePaymentService
updatePaymentInfoForPlaceOrderMethods 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
-
Constructor Details
-
DefaultAlipayPaymentService
public DefaultAlipayPaymentService()
-
-
Method Details
-
handleAsyncResponse
public String handleAsyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Description copied from interface:ChinesePaymentServiceHandling the Asyn-response of the 3rd part payment service provider server- Specified by:
handleAsyncResponsein interfaceChinesePaymentService- Parameters:
request- The HttpServletRequestresponse- The HttpServletResponse- Returns:
- the code of the order
-
handleSyncResponse
public String handleSyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Description copied from interface:ChinesePaymentServiceHandling the Sync-response of the 3rd part payment service provider server- Specified by:
handleSyncResponsein interfaceChinesePaymentService- Parameters:
request- The HttpServletRequestresponse- The HttpServletResponse- Returns:
- the code of the order
-
cancelPayment
Description copied from interface:ChinesePaymentServiceCanceling the payment with the 3rd part payment service provider server- Specified by:
cancelPaymentin interfaceChinesePaymentService- Parameters:
orderCode- The code of the order- Returns:
- true when canceling payment is successful
-
getPaymentRequestUrl
Description copied from interface:ChinesePaymentServiceGetting the PaymentRequestUrl to be send to the 3rd part payment service provider server- Specified by:
getPaymentRequestUrlin interfaceChinesePaymentService- Parameters:
orderCode- The code of the order- Returns:
- the payment request Url of the 3rd part payment service provider
-
getRefundRequestUrl
Description copied from interface:ChinesePaymentServiceGetting the RefundRequestUrl to be send to the 3rd part payment service provider server- Specified by:
getRefundRequestUrlin 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
-
syncPaymentStatus
Description copied from interface:ChinesePaymentServiceSynchronizing the PaymentStatus with the 3rd part payment service provider server- Specified by:
syncPaymentStatusin interfaceChinesePaymentService- Parameters:
orderCode- The code of the order
-
setPaymentInfo
Description copied from interface:ChinesePaymentServiceSaving the PaymentInfo- Specified by:
setPaymentInfoin interfaceChinesePaymentService- Parameters:
cartModel- The current cartchinesePaymentInfoModel- The ChinesePaymentInfo of the cart- Returns:
- true when setting PaymentInfo is successful
-
getPspLogoUrl
Description copied from interface:ChinesePaymentServiceGetting the Logo of the 3rd part payment service providers- Specified by:
getPspLogoUrlin interfaceChinesePaymentService- Returns:
- the url of the payment service provider logo
-
getOrderModelByCode
retrieve OrderModel by order code- Parameters:
orderCode- order code of OrderModel- Returns:
- OrderModel
-
unifyRequestParameterValue
-
buildString
-
convertKey2CamelCase
-
handleNotification
protected String handleNotification(Map<String, String> responseMap, javax.servlet.http.HttpServletResponse response) throws IOException- Throws:
IOException
-
handleReturnInfo
-
handleErrorResponse
-
createAlipayDirectPayRequestDataByOrder
-
createAlipayCancelPaymentRequestDataByOrder
protected AlipayCancelPaymentRequestData createAlipayCancelPaymentRequestDataByOrder(OrderModel order) -
createAlipayPaymentStatusRequestDataByOrder
protected AlipayPaymentStatusRequestData createAlipayPaymentStatusRequestDataByOrder(OrderModel order) -
createAlipayRefundRequestDataByOrder
-
handleRefundNotification
protected void handleRefundNotification(Map<String, String> responseMap, javax.servlet.http.HttpServletResponse response) throws IOException- Throws:
IOException
-
getUrlEncodePattern
-
setAlipayPaymentInfoStrategy
-
setCommerceCheckoutService
-
setMediaService
-
setAlipayOrderService
-
setAlipayCreateRequestStrategy
-
setAlipayPaymentTransactionStrategy
public void setAlipayPaymentTransactionStrategy(AlipayPaymentTransactionStrategy alipayPaymentTransactionStrategy) -
setAlipayResponseValidationStrategy
public void setAlipayResponseValidationStrategy(AlipayResponseValidationStrategy alipayResponseValidationStrategy) -
setAlipayHandleResponseStrategy
public void setAlipayHandleResponseStrategy(AlipayHandleResponseStrategy alipayHandleResponseStrategy) -
setChineseOrderService
-
setAlipayConfiguration
-
setModelService
- Overrides:
setModelServicein classDefaultPaymentServiceImpl
-
setCmsSiteService
-
setCommerceCommonI18NService
-
getAlipayPaymentInfoStrategy
-
getCommerceCheckoutService
-
getAlipayOrderService
-
getAlipayCreateRequestStrategy
-
getAlipayPaymentTransactionStrategy
-
getAlipayResponseValidationStrategy
-
getAlipayHandleResponseStrategy
-
getMediaService
-
getChineseOrderService
-
getAlipayConfiguration
-
getModelService
- Overrides:
getModelServicein classDefaultPaymentServiceImpl
-
getCmsSiteService
-
getCommerceCommonI18NService
-
getBaseSiteService
-
setBaseSiteService
-
getSiteBaseUrlResolutionService
-
setSiteBaseUrlResolutionService
public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
-