Class DefaultWeChatPayPaymentService
- java.lang.Object
-
- de.hybris.platform.payment.impl.DefaultPaymentServiceImpl
-
- de.hybris.platform.chinesepspwechatpayservices.payment.impl.DefaultWeChatPayPaymentService
-
- All Implemented Interfaces:
ChinesePaymentService,PaymentService
public class DefaultWeChatPayPaymentService extends DefaultPaymentServiceImpl implements ChinesePaymentService
A default implements of chinese payment service
-
-
Constructor Summary
Constructors Constructor Description DefaultWeChatPayPaymentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancelPayment(java.lang.String orderCode)Canceling the payment with the 3rd part payment service provider servervoidcreateTransactionForNewRequest(java.lang.String orderCode)class for Chinesepspwechatpayservices payment impl.protected ChineseOrderServicegetChineseOrderService()CommerceCheckoutServicegetCommerceCheckoutService()ConfigurationServicegetConfigurationService()MediaServicegetMediaService()protected ModelServicegetModelService()WeChatPayOrderDaogetOrderDao()java.lang.StringgetPaymentRequestUrl(java.lang.String orderCode)Getting the PaymentRequestUrl to be send to the 3rd part payment service provider serverjava.lang.StringgetPspLogoUrl()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 WeChatPayConfigurationgetWeChatPayConfiguration()protected WeChatPayHttpClientgetWeChatPayHttpClient()WeChatPayPaymentInfoStrategygetWeChatPayPaymentInfoStrategy()WeChatPayPaymentTransactionStrategygetWeChatPayPaymentTransactionStrategy()java.lang.StringhandleAsyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Handling the Asyn-response of the 3rd part payment service provider serverjava.lang.StringhandleSyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Handling the Sync-response of the 3rd part payment service provider servervoidsetChineseOrderService(ChineseOrderService chineseOrderService)voidsetCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService)voidsetConfigurationService(ConfigurationService configurationService)voidsetMediaService(MediaService mediaService)voidsetModelService(ModelService modelService)voidsetOrderDao(WeChatPayOrderDao orderDao)booleansetPaymentInfo(CartModel cartModel, ChinesePaymentInfoModel chinesePaymentInfoModel)Saving the PaymentInfovoidsetWeChatPayConfiguration(WeChatPayConfiguration weChatPayConfiguration)voidsetWeChatPayHttpClient(WeChatPayHttpClient weChatPayHttpClient)voidsetWeChatPayPaymentInfoStrategy(WeChatPayPaymentInfoStrategy weChatPayPaymentInfoStrategy)voidsetWeChatPayPaymentTransactionStrategy(WeChatPayPaymentTransactionStrategy weChatPayPaymentTransactionStrategy)voidsyncPaymentStatus(java.lang.String orderCode)Synchronizing the PaymentStatus with the 3rd part payment service provider servervoidupdatePaymentInfoForPlaceOrder(java.lang.String orderCode)Update payment info after place order-
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.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: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 java.lang.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
public boolean cancelPayment(java.lang.String orderCode)
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
public java.lang.String getPaymentRequestUrl(java.lang.String orderCode)
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
-
syncPaymentStatus
public void syncPaymentStatus(java.lang.String orderCode)
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
public boolean setPaymentInfo(CartModel cartModel, ChinesePaymentInfoModel chinesePaymentInfoModel)
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
public java.lang.String 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
-
updatePaymentInfoForPlaceOrder
public void updatePaymentInfoForPlaceOrder(java.lang.String orderCode)
Description copied from interface:ChinesePaymentServiceUpdate payment info after place order- Specified by:
updatePaymentInfoForPlaceOrderin interfaceChinesePaymentService- Parameters:
orderCode- The code of the order
-
getRefundRequestUrl
public java.util.Optional<java.lang.String> getRefundRequestUrl(java.lang.String orderCode)
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
-
createTransactionForNewRequest
public void createTransactionForNewRequest(java.lang.String orderCode)
class for Chinesepspwechatpayservices payment impl.- Parameters:
orderCode- Find Order by the orderCode
-
getMediaService
public MediaService getMediaService()
-
setMediaService
public void setMediaService(MediaService mediaService)
-
getWeChatPayPaymentInfoStrategy
public WeChatPayPaymentInfoStrategy getWeChatPayPaymentInfoStrategy()
-
setWeChatPayPaymentInfoStrategy
public void setWeChatPayPaymentInfoStrategy(WeChatPayPaymentInfoStrategy weChatPayPaymentInfoStrategy)
-
getCommerceCheckoutService
public CommerceCheckoutService getCommerceCheckoutService()
-
setCommerceCheckoutService
public void setCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService)
-
getConfigurationService
public ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
getOrderDao
public WeChatPayOrderDao getOrderDao()
-
setOrderDao
public void setOrderDao(WeChatPayOrderDao orderDao)
-
getWeChatPayPaymentTransactionStrategy
public WeChatPayPaymentTransactionStrategy getWeChatPayPaymentTransactionStrategy()
- Returns:
- the weChatPayPaymentTransactionStrategy
-
setWeChatPayPaymentTransactionStrategy
public void setWeChatPayPaymentTransactionStrategy(WeChatPayPaymentTransactionStrategy weChatPayPaymentTransactionStrategy)
- Parameters:
weChatPayPaymentTransactionStrategy- the weChatPayPaymentTransactionStrategy to set
-
getWeChatPayConfiguration
protected WeChatPayConfiguration getWeChatPayConfiguration()
-
setWeChatPayConfiguration
public void setWeChatPayConfiguration(WeChatPayConfiguration weChatPayConfiguration)
-
getWeChatPayHttpClient
protected WeChatPayHttpClient getWeChatPayHttpClient()
-
setWeChatPayHttpClient
public void setWeChatPayHttpClient(WeChatPayHttpClient weChatPayHttpClient)
-
getModelService
protected ModelService getModelService()
- Overrides:
getModelServicein classDefaultPaymentServiceImpl
-
setModelService
public void setModelService(ModelService modelService)
- Overrides:
setModelServicein classDefaultPaymentServiceImpl
-
getChineseOrderService
protected ChineseOrderService getChineseOrderService()
-
setChineseOrderService
public void setChineseOrderService(ChineseOrderService chineseOrderService)
-
-