Class DefaultAlipayPaymentService

    • Constructor Detail

      • DefaultAlipayPaymentService

        public DefaultAlipayPaymentService()
    • 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 interface ChinesePaymentService
        Parameters:
        request - The HttpServletRequest
        response - 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 interface ChinesePaymentService
        Parameters:
        request - The HttpServletRequest
        response - 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 interface ChinesePaymentService
        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 interface ChinesePaymentService
        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 interface ChinesePaymentService
        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 interface ChinesePaymentService
        Parameters:
        orderCode - The code of the order
      • 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 interface ChinesePaymentService
        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)
      • 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)
      • setAlipayHandleResponseStrategy

        public void setAlipayHandleResponseStrategy​(AlipayHandleResponseStrategy alipayHandleResponseStrategy)
      • setChineseOrderService

        public void setChineseOrderService​(ChineseOrderService chineseOrderService)
      • setAlipayConfiguration

        public void setAlipayConfiguration​(AlipayConfiguration alipayConfiguration)
      • setCmsSiteService

        public void setCmsSiteService​(CMSSiteService cmsSiteService)
      • setCommerceCommonI18NService

        public void setCommerceCommonI18NService​(CommerceCommonI18NService commerceCommonI18NService)
      • getMediaService

        protected MediaService getMediaService()
      • setBaseSiteService

        public void setBaseSiteService​(BaseSiteService baseSiteService)
      • setSiteBaseUrlResolutionService

        public void setSiteBaseUrlResolutionService​(SiteBaseUrlResolutionService siteBaseUrlResolutionService)