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 boolean
cancelPayment(java.lang.String orderCode)
Canceling the payment with the 3rd part payment service provider servervoid
createTransactionForNewRequest(java.lang.String orderCode)
class for Chinesepspwechatpayservices payment impl.protected ChineseOrderService
getChineseOrderService()
CommerceCheckoutService
getCommerceCheckoutService()
ConfigurationService
getConfigurationService()
MediaService
getMediaService()
protected ModelService
getModelService()
WeChatPayOrderDao
getOrderDao()
java.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 WeChatPayConfiguration
getWeChatPayConfiguration()
protected WeChatPayHttpClient
getWeChatPayHttpClient()
WeChatPayPaymentInfoStrategy
getWeChatPayPaymentInfoStrategy()
WeChatPayPaymentTransactionStrategy
getWeChatPayPaymentTransactionStrategy()
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 serverjava.lang.String
handleSyncResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handling the Sync-response of the 3rd part payment service provider servervoid
setChineseOrderService(ChineseOrderService chineseOrderService)
void
setCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService)
void
setConfigurationService(ConfigurationService configurationService)
void
setMediaService(MediaService mediaService)
void
setModelService(ModelService modelService)
void
setOrderDao(WeChatPayOrderDao orderDao)
boolean
setPaymentInfo(CartModel cartModel, ChinesePaymentInfoModel chinesePaymentInfoModel)
Saving the PaymentInfovoid
setWeChatPayConfiguration(WeChatPayConfiguration weChatPayConfiguration)
void
setWeChatPayHttpClient(WeChatPayHttpClient weChatPayHttpClient)
void
setWeChatPayPaymentInfoStrategy(WeChatPayPaymentInfoStrategy weChatPayPaymentInfoStrategy)
void
setWeChatPayPaymentTransactionStrategy(WeChatPayPaymentTransactionStrategy weChatPayPaymentTransactionStrategy)
void
syncPaymentStatus(java.lang.String orderCode)
Synchronizing the PaymentStatus with the 3rd part payment service provider servervoid
updatePaymentInfoForPlaceOrder(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: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
-
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
-
updatePaymentInfoForPlaceOrder
public void updatePaymentInfoForPlaceOrder(java.lang.String orderCode)
Description copied from interface:ChinesePaymentService
Update payment info after place order- Specified by:
updatePaymentInfoForPlaceOrder
in 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: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
-
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:
getModelService
in classDefaultPaymentServiceImpl
-
setModelService
public void setModelService(ModelService modelService)
- Overrides:
setModelService
in classDefaultPaymentServiceImpl
-
getChineseOrderService
protected ChineseOrderService getChineseOrderService()
-
setChineseOrderService
public void setChineseOrderService(ChineseOrderService chineseOrderService)
-
-